aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/configure.engine3
-rw-r--r--engines/agos/configure.engine4
-rw-r--r--engines/agos/detection_tables.h24
-rw-r--r--engines/agos/icons.cpp6
-rw-r--r--engines/avalanche/animation.cpp80
-rw-r--r--engines/avalanche/animation.h8
-rw-r--r--engines/avalanche/avalanche.cpp43
-rw-r--r--engines/avalanche/avalanche.h8
-rw-r--r--engines/avalanche/avalot.cpp115
-rw-r--r--engines/avalanche/avalot.h21
-rw-r--r--engines/avalanche/background.cpp2
-rw-r--r--engines/avalanche/clock.cpp116
-rw-r--r--engines/avalanche/clock.h60
-rw-r--r--engines/avalanche/configure.engine3
-rw-r--r--engines/avalanche/console.cpp1
-rw-r--r--engines/avalanche/detection.cpp2
-rw-r--r--engines/avalanche/dialogs.cpp59
-rw-r--r--engines/avalanche/enums.h5
-rw-r--r--engines/avalanche/graphics.cpp138
-rw-r--r--engines/avalanche/graphics.h32
-rw-r--r--engines/avalanche/menu.cpp6
-rw-r--r--engines/avalanche/module.mk4
-rw-r--r--engines/avalanche/nim.cpp575
-rw-r--r--engines/avalanche/nim.h79
-rw-r--r--engines/avalanche/parser.cpp188
-rw-r--r--engines/avalanche/parser.h36
-rw-r--r--engines/avalanche/pingo.cpp12
-rw-r--r--engines/avalanche/pingo.h3
-rw-r--r--engines/avalanche/timer.cpp38
-rw-r--r--engines/cge/bitmap.cpp6
-rw-r--r--engines/cge/cge_main.cpp14
-rw-r--r--engines/cge/configure.engine3
-rw-r--r--engines/cge/fileio.cpp12
-rw-r--r--engines/cge/fileio.h8
-rw-r--r--engines/cge/sound.cpp4
-rw-r--r--engines/cine/configure.engine3
-rw-r--r--engines/composer/composer.cpp9
-rw-r--r--engines/composer/composer.h6
-rw-r--r--engines/composer/configure.engine3
-rw-r--r--engines/composer/console.cpp31
-rw-r--r--engines/composer/console.h40
-rw-r--r--engines/composer/module.mk1
-rw-r--r--engines/configure.engines57
-rw-r--r--engines/cruise/configure.engine3
-rw-r--r--engines/draci/barchive.cpp12
-rw-r--r--engines/draci/configure.engine3
-rw-r--r--engines/draci/game.cpp2
-rw-r--r--engines/draci/script.cpp110
-rw-r--r--engines/drascula/configure.engine3
-rw-r--r--engines/drascula/drascula.cpp5
-rw-r--r--engines/drascula/drascula.h9
-rw-r--r--engines/dreamweb/configure.engine3
-rw-r--r--engines/dreamweb/dreamweb.h2
-rw-r--r--engines/engines.mk263
-rw-r--r--engines/fullpipe/behavior.cpp50
-rw-r--r--engines/fullpipe/behavior.h4
-rw-r--r--engines/fullpipe/configure.engine3
-rw-r--r--engines/fullpipe/console.cpp52
-rw-r--r--engines/fullpipe/console.h42
-rw-r--r--engines/fullpipe/constants.h1351
-rw-r--r--engines/fullpipe/floaters.cpp220
-rw-r--r--engines/fullpipe/floaters.h12
-rw-r--r--engines/fullpipe/fullpipe.cpp42
-rw-r--r--engines/fullpipe/fullpipe.h38
-rw-r--r--engines/fullpipe/gameloader.cpp159
-rw-r--r--engines/fullpipe/gameloader.h5
-rw-r--r--engines/fullpipe/gfx.cpp146
-rw-r--r--engines/fullpipe/gfx.h11
-rw-r--r--engines/fullpipe/init.cpp20
-rw-r--r--engines/fullpipe/input.cpp78
-rw-r--r--engines/fullpipe/interaction.cpp44
-rw-r--r--engines/fullpipe/interaction.h3
-rw-r--r--engines/fullpipe/inventory.cpp26
-rw-r--r--engines/fullpipe/inventory.h4
-rw-r--r--engines/fullpipe/lift.cpp13
-rw-r--r--engines/fullpipe/messagehandlers.cpp243
-rw-r--r--engines/fullpipe/messages.cpp262
-rw-r--r--engines/fullpipe/messages.h29
-rw-r--r--engines/fullpipe/modal.cpp375
-rw-r--r--engines/fullpipe/modal.h31
-rw-r--r--engines/fullpipe/module.mk35
-rw-r--r--engines/fullpipe/motion.cpp825
-rw-r--r--engines/fullpipe/motion.h116
-rw-r--r--engines/fullpipe/ngiarchive.cpp4
-rw-r--r--engines/fullpipe/objectnames.h65
-rw-r--r--engines/fullpipe/objects.h2
-rw-r--r--engines/fullpipe/scene.cpp151
-rw-r--r--engines/fullpipe/scene.h5
-rw-r--r--engines/fullpipe/scenes.cpp740
-rw-r--r--engines/fullpipe/scenes.h473
-rw-r--r--engines/fullpipe/scenes/scene01.cpp23
-rw-r--r--engines/fullpipe/scenes/scene02.cpp53
-rw-r--r--engines/fullpipe/scenes/scene03.cpp75
-rw-r--r--engines/fullpipe/scenes/scene04.cpp1263
-rw-r--r--engines/fullpipe/scenes/scene05.cpp386
-rw-r--r--engines/fullpipe/scenes/scene06.cpp770
-rw-r--r--engines/fullpipe/scenes/scene07.cpp175
-rw-r--r--engines/fullpipe/scenes/scene08.cpp546
-rw-r--r--engines/fullpipe/scenes/scene10.cpp220
-rw-r--r--engines/fullpipe/scenes/scene11.cpp786
-rw-r--r--engines/fullpipe/scenes/scene12.cpp85
-rw-r--r--engines/fullpipe/scenes/scene13.cpp380
-rw-r--r--engines/fullpipe/scenes/scene14.cpp849
-rw-r--r--engines/fullpipe/scenes/scene15.cpp209
-rw-r--r--engines/fullpipe/scenes/scene16.cpp484
-rw-r--r--engines/fullpipe/scenes/scene17.cpp285
-rw-r--r--engines/fullpipe/scenes/scene18and19.cpp49
-rw-r--r--engines/fullpipe/scenes/scene20.cpp155
-rw-r--r--engines/fullpipe/scenes/scene21.cpp148
-rw-r--r--engines/fullpipe/scenes/scene22.cpp395
-rw-r--r--engines/fullpipe/scenes/scene23.cpp555
-rw-r--r--engines/fullpipe/scenes/scene24.cpp129
-rw-r--r--engines/fullpipe/scenes/scene25.cpp723
-rw-r--r--engines/fullpipe/scenes/scene26.cpp355
-rw-r--r--engines/fullpipe/scenes/scene28.cpp474
-rw-r--r--engines/fullpipe/scenes/scene30.cpp152
-rw-r--r--engines/fullpipe/scenes/scene31.cpp126
-rw-r--r--engines/fullpipe/scenes/scene32.cpp431
-rw-r--r--engines/fullpipe/scenes/scene33.cpp314
-rw-r--r--engines/fullpipe/scenes/scene34.cpp479
-rw-r--r--engines/fullpipe/scenes/scene35.cpp264
-rw-r--r--engines/fullpipe/scenes/scene36.cpp94
-rw-r--r--engines/fullpipe/scenes/scene37.cpp316
-rw-r--r--engines/fullpipe/scenes/scene38.cpp417
-rw-r--r--engines/fullpipe/scenes/sceneDbg.cpp27
-rw-r--r--engines/fullpipe/scenes/sceneIntro.cpp15
-rw-r--r--engines/fullpipe/sound.cpp70
-rw-r--r--engines/fullpipe/sound.h14
-rw-r--r--engines/fullpipe/stateloader.cpp30
-rw-r--r--engines/fullpipe/statics.cpp234
-rw-r--r--engines/fullpipe/statics.h20
-rw-r--r--engines/fullpipe/utils.cpp21
-rw-r--r--engines/fullpipe/utils.h3
-rw-r--r--engines/gob/configure.engine3
-rw-r--r--engines/groovie/configure.engine4
-rw-r--r--engines/groovie/font.cpp4
-rw-r--r--engines/groovie/font.h6
-rw-r--r--engines/hopkins/configure.engine3
-rw-r--r--engines/hopkins/events.cpp2
-rw-r--r--engines/hopkins/graphics.cpp4
-rw-r--r--engines/hopkins/hopkins.cpp1
-rw-r--r--engines/hopkins/hopkins.h7
-rw-r--r--engines/hopkins/objects.cpp2
-rw-r--r--engines/hopkins/talk.cpp4
-rw-r--r--engines/hugo/configure.engine3
-rw-r--r--engines/kyra/configure.engine5
-rw-r--r--engines/kyra/kyra_mr.cpp1
-rw-r--r--engines/kyra/staticres.cpp2
-rw-r--r--engines/kyra/vqa.cpp1017
-rw-r--r--engines/kyra/vqa.h139
-rw-r--r--engines/lastexpress/configure.engine3
-rw-r--r--engines/lastexpress/entities/abbot.cpp162
-rw-r--r--engines/lastexpress/entities/abbot.h56
-rw-r--r--engines/lastexpress/entities/alexei.cpp230
-rw-r--r--engines/lastexpress/entities/alexei.h56
-rw-r--r--engines/lastexpress/entities/alouan.cpp48
-rw-r--r--engines/lastexpress/entities/alouan.h10
-rw-r--r--engines/lastexpress/entities/anna.cpp398
-rw-r--r--engines/lastexpress/entities/anna.h113
-rw-r--r--engines/lastexpress/entities/august.cpp32
-rw-r--r--engines/lastexpress/entities/chapters.cpp32
-rw-r--r--engines/lastexpress/entities/coudert.cpp54
-rw-r--r--engines/lastexpress/entities/entity.cpp4
-rw-r--r--engines/lastexpress/entities/entity.h74
-rw-r--r--engines/lastexpress/entities/francois.cpp150
-rw-r--r--engines/lastexpress/entities/francois.h29
-rw-r--r--engines/lastexpress/entities/gendarmes.cpp10
-rw-r--r--engines/lastexpress/entities/kahina.cpp24
-rw-r--r--engines/lastexpress/entities/kronos.cpp4
-rw-r--r--engines/lastexpress/entities/mertens.cpp60
-rw-r--r--engines/lastexpress/entities/milos.cpp30
-rw-r--r--engines/lastexpress/entities/rebecca.cpp8
-rw-r--r--engines/lastexpress/entities/servers0.cpp4
-rw-r--r--engines/lastexpress/entities/tatiana.cpp14
-rw-r--r--engines/lastexpress/entities/vassili.cpp8
-rw-r--r--engines/lastexpress/entities/verges.cpp4
-rw-r--r--engines/lastexpress/entities/yasmin.cpp74
-rw-r--r--engines/lastexpress/entities/yasmin.h16
-rw-r--r--engines/lastexpress/fight/fight.cpp2
-rw-r--r--engines/lastexpress/game/action.cpp116
-rw-r--r--engines/lastexpress/game/action.h28
-rw-r--r--engines/lastexpress/game/entities.h8
-rw-r--r--engines/lastexpress/game/inventory.cpp56
-rw-r--r--engines/lastexpress/game/inventory.h20
-rw-r--r--engines/lastexpress/game/logic.cpp6
-rw-r--r--engines/lastexpress/game/logic.h2
-rw-r--r--engines/lastexpress/game/object.cpp29
-rw-r--r--engines/lastexpress/game/object.h28
-rw-r--r--engines/lastexpress/game/savegame.h54
-rw-r--r--engines/lastexpress/game/scenes.cpp12
-rw-r--r--engines/lastexpress/game/state.h12
-rw-r--r--engines/lastexpress/shared.h30
-rw-r--r--engines/lastexpress/sound/sound.cpp2
-rw-r--r--engines/lure/configure.engine3
-rw-r--r--engines/made/configure.engine3
-rw-r--r--engines/made/detection.cpp114
-rw-r--r--engines/made/screenfx.cpp2
-rw-r--r--engines/made/sound.cpp2
-rw-r--r--engines/mohawk/configure.engine6
-rw-r--r--engines/mortevielle/actions.cpp235
-rw-r--r--engines/mortevielle/configure.engine3
-rw-r--r--engines/mortevielle/debugger.cpp7
-rw-r--r--engines/mortevielle/debugger.h3
-rw-r--r--engines/mortevielle/dialogs.cpp99
-rw-r--r--engines/mortevielle/dialogs.h3
-rw-r--r--engines/mortevielle/graphics.cpp25
-rw-r--r--engines/mortevielle/graphics.h3
-rw-r--r--engines/mortevielle/menu.cpp84
-rw-r--r--engines/mortevielle/menu.h3
-rw-r--r--engines/mortevielle/mortevielle.cpp71
-rw-r--r--engines/mortevielle/mortevielle.h28
-rw-r--r--engines/mortevielle/mouse.cpp8
-rw-r--r--engines/mortevielle/mouse.h2
-rw-r--r--engines/mortevielle/outtext.cpp32
-rw-r--r--engines/mortevielle/outtext.h3
-rw-r--r--engines/mortevielle/saveload.cpp12
-rw-r--r--engines/mortevielle/saveload.h3
-rw-r--r--engines/mortevielle/sound.cpp9
-rw-r--r--engines/mortevielle/sound.h4
-rw-r--r--engines/mortevielle/utils.cpp482
-rw-r--r--engines/neverhood/configure.engine3
-rw-r--r--engines/neverhood/detection.cpp15
-rw-r--r--engines/neverhood/diskplayerscene.cpp6
-rw-r--r--engines/neverhood/gamemodule.cpp32
-rw-r--r--engines/neverhood/gamemodule.h2
-rw-r--r--engines/neverhood/graphics.cpp2
-rw-r--r--engines/neverhood/klaymen.cpp144
-rw-r--r--engines/neverhood/menumodule.cpp35
-rw-r--r--engines/neverhood/messages.h48
-rw-r--r--engines/neverhood/module.cpp2
-rw-r--r--engines/neverhood/modules/module1000.cpp48
-rw-r--r--engines/neverhood/modules/module1000_sprites.cpp238
-rw-r--r--engines/neverhood/modules/module1100.cpp21
-rw-r--r--engines/neverhood/modules/module1100_sprites.cpp16
-rw-r--r--engines/neverhood/modules/module1200.cpp18
-rw-r--r--engines/neverhood/modules/module1200_sprites.cpp58
-rw-r--r--engines/neverhood/modules/module1300.cpp108
-rw-r--r--engines/neverhood/modules/module1300_sprites.cpp82
-rw-r--r--engines/neverhood/modules/module1400.cpp46
-rw-r--r--engines/neverhood/modules/module1400_sprites.cpp88
-rw-r--r--engines/neverhood/modules/module1500.cpp6
-rw-r--r--engines/neverhood/modules/module1600.cpp34
-rw-r--r--engines/neverhood/modules/module1600_sprites.cpp66
-rw-r--r--engines/neverhood/modules/module1700.cpp2
-rw-r--r--engines/neverhood/modules/module1700_sprites.cpp12
-rw-r--r--engines/neverhood/modules/module1900.cpp4
-rw-r--r--engines/neverhood/modules/module1900_sprites.cpp14
-rw-r--r--engines/neverhood/modules/module2000.cpp2
-rw-r--r--engines/neverhood/modules/module2000_sprites.cpp8
-rw-r--r--engines/neverhood/modules/module2100.cpp12
-rw-r--r--engines/neverhood/modules/module2100_sprites.cpp26
-rw-r--r--engines/neverhood/modules/module2200.cpp54
-rw-r--r--engines/neverhood/modules/module2200_sprites.cpp128
-rw-r--r--engines/neverhood/modules/module2400.cpp28
-rw-r--r--engines/neverhood/modules/module2400_sprites.cpp60
-rw-r--r--engines/neverhood/modules/module2500.cpp34
-rw-r--r--engines/neverhood/modules/module2500_sprites.cpp8
-rw-r--r--engines/neverhood/modules/module2600.cpp8
-rw-r--r--engines/neverhood/modules/module2600_sprites.cpp6
-rw-r--r--engines/neverhood/modules/module2700.cpp94
-rw-r--r--engines/neverhood/modules/module2800.cpp171
-rw-r--r--engines/neverhood/modules/module2800_sprites.cpp146
-rw-r--r--engines/neverhood/modules/module2900.cpp4
-rw-r--r--engines/neverhood/modules/module3000.cpp16
-rw-r--r--engines/neverhood/modules/module3000_sprites.cpp10
-rw-r--r--engines/neverhood/navigationscene.cpp8
-rw-r--r--engines/neverhood/neverhood.cpp15
-rw-r--r--engines/neverhood/neverhood.h4
-rw-r--r--engines/neverhood/palette.cpp13
-rw-r--r--engines/neverhood/palette.h1
-rw-r--r--engines/neverhood/scene.cpp22
-rw-r--r--engines/neverhood/smackerplayer.cpp14
-rw-r--r--engines/neverhood/smackerscene.cpp6
-rw-r--r--engines/neverhood/sound.cpp33
-rw-r--r--engines/neverhood/sound.h1
-rw-r--r--engines/neverhood/sprite.cpp6
-rw-r--r--engines/parallaction/configure.engine3
-rw-r--r--engines/parallaction/exec.h2
-rw-r--r--engines/parallaction/gui_ns.cpp2
-rw-r--r--engines/parallaction/input.h2
-rw-r--r--engines/parallaction/objects.h6
-rw-r--r--engines/parallaction/parallaction.h4
-rw-r--r--engines/parallaction/parser.h2
-rw-r--r--engines/parallaction/sound.h6
-rw-r--r--engines/pegasus/configure.engine3
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoria.cpp18
-rw-r--r--engines/pegasus/neighborhood/mars/mars.cpp2
-rw-r--r--engines/pegasus/neighborhood/prehistoric/prehistoric.cpp20
-rw-r--r--engines/pegasus/pegasus.cpp34
-rw-r--r--engines/pegasus/pegasus.h2
-rw-r--r--engines/pegasus/timers.cpp1
-rw-r--r--engines/plugins_table.h130
-rw-r--r--engines/queen/configure.engine3
-rw-r--r--engines/saga/configure.engine5
-rw-r--r--engines/saga/saga.h2
-rw-r--r--engines/sci/configure.engine4
-rw-r--r--engines/sci/console.cpp2
-rw-r--r--engines/sci/detection_tables.h802
-rw-r--r--engines/sci/engine/kfile.cpp2
-rw-r--r--engines/sci/engine/kgraphics.cpp3
-rw-r--r--engines/sci/engine/object.cpp1
-rw-r--r--engines/sci/engine/savegame.cpp41
-rw-r--r--engines/sci/engine/script.cpp7
-rw-r--r--engines/sci/engine/script.h9
-rw-r--r--engines/sci/engine/script_patches.cpp1594
-rw-r--r--engines/sci/engine/script_patches.h108
-rw-r--r--engines/sci/engine/seg_manager.cpp7
-rw-r--r--engines/sci/engine/seg_manager.h5
-rw-r--r--engines/sci/engine/workarounds.cpp214
-rw-r--r--engines/sci/graphics/picture.cpp150
-rw-r--r--engines/sci/graphics/picture.h2
-rw-r--r--engines/sci/graphics/portrait.cpp261
-rw-r--r--engines/sci/graphics/portrait.h11
-rw-r--r--engines/sci/graphics/ports.cpp5
-rw-r--r--engines/sci/graphics/view.cpp112
-rw-r--r--engines/sci/resource.cpp42
-rw-r--r--engines/sci/resource.h34
-rw-r--r--engines/sci/resource_audio.cpp122
-rw-r--r--engines/sci/sci.cpp32
-rw-r--r--engines/sci/sci.h3
-rw-r--r--engines/sci/sound/midiparser_sci.cpp208
-rw-r--r--engines/sci/sound/midiparser_sci.h20
-rw-r--r--engines/sci/sound/music.cpp582
-rw-r--r--engines/sci/sound/music.h44
-rw-r--r--engines/sci/sound/soundcmd.cpp16
-rw-r--r--engines/scumm/configure.engine5
-rw-r--r--engines/scumm/detection.cpp26
-rw-r--r--engines/scumm/he/animation_he.cpp6
-rw-r--r--engines/scumm/he/animation_he.h8
-rw-r--r--engines/scumm/he/intern_he.h15
-rw-r--r--engines/scumm/he/logic/football.cpp19
-rw-r--r--engines/scumm/he/script_v100he.cpp7
-rw-r--r--engines/scumm/he/script_v60he.cpp276
-rw-r--r--engines/scumm/he/script_v72he.cpp66
-rw-r--r--engines/scumm/he/script_v80he.cpp49
-rw-r--r--engines/scumm/he/script_v90he.cpp5
-rw-r--r--engines/scumm/he/wiz_he.cpp31
-rw-r--r--engines/scumm/saveload.cpp141
-rw-r--r--engines/scumm/scumm.cpp6
-rw-r--r--engines/scumm/scumm.h19
-rw-r--r--engines/sky/configure.engine3
-rw-r--r--engines/sword1/configure.engine3
-rw-r--r--engines/sword2/configure.engine3
-rw-r--r--engines/sword25/configure.engine3
-rw-r--r--engines/sword25/gfx/image/art.cpp3
-rw-r--r--engines/sword25/gfx/renderobjectmanager.cpp17
-rw-r--r--engines/sword25/util/lua/lopcodes.cpp2
-rw-r--r--engines/sword25/util/lua/lua.h2
-rw-r--r--engines/teenagent/callbacks.cpp12
-rw-r--r--engines/teenagent/configure.engine3
-rw-r--r--engines/teenagent/teenagent.h6
-rw-r--r--engines/testbed/configure.engine3
-rw-r--r--engines/tinsel/configure.engine3
-rw-r--r--engines/tinsel/detection_tables.h2
-rw-r--r--engines/tinsel/music.cpp35
-rw-r--r--engines/tinsel/scene.cpp42
-rw-r--r--engines/tinsel/tinsel.h3
-rw-r--r--engines/toltecs/configure.engine3
-rw-r--r--engines/toltecs/render.cpp2
-rw-r--r--engines/toltecs/saveload.cpp2
-rw-r--r--engines/toltecs/screen.cpp4
-rw-r--r--engines/toltecs/script.cpp10
-rw-r--r--engines/toltecs/toltecs.cpp8
-rw-r--r--engines/toltecs/toltecs.h7
-rw-r--r--engines/tony/configure.engine3
-rw-r--r--engines/tony/mpal/mpal.cpp4
-rw-r--r--engines/tony/sound.cpp2
-rw-r--r--engines/tony/tony.h2
-rw-r--r--engines/tony/window.cpp12
-rw-r--r--engines/tony/window.h1
-rw-r--r--engines/toon/configure.engine3
-rw-r--r--engines/touche/configure.engine3
-rw-r--r--engines/tsage/blue_force/blueforce_logic.cpp29
-rw-r--r--engines/tsage/blue_force/blueforce_logic.h18
-rw-r--r--engines/tsage/blue_force/blueforce_scenes2.cpp2
-rw-r--r--engines/tsage/blue_force/blueforce_scenes3.cpp77
-rw-r--r--engines/tsage/blue_force/blueforce_scenes3.h5
-rw-r--r--engines/tsage/blue_force/blueforce_scenes4.cpp98
-rw-r--r--engines/tsage/blue_force/blueforce_scenes4.h13
-rw-r--r--engines/tsage/blue_force/blueforce_scenes5.cpp30
-rw-r--r--engines/tsage/blue_force/blueforce_scenes5.h2
-rw-r--r--engines/tsage/blue_force/blueforce_scenes7.cpp2
-rw-r--r--engines/tsage/blue_force/blueforce_scenes8.cpp19
-rw-r--r--engines/tsage/blue_force/blueforce_scenes8.h3
-rw-r--r--engines/tsage/blue_force/blueforce_scenes9.cpp47
-rw-r--r--engines/tsage/configure.engine3
-rw-r--r--engines/tsage/converse.cpp56
-rw-r--r--engines/tsage/converse.h8
-rw-r--r--engines/tsage/core.cpp96
-rw-r--r--engines/tsage/core.h17
-rw-r--r--engines/tsage/debugger.cpp48
-rw-r--r--engines/tsage/debugger.h2
-rw-r--r--engines/tsage/detection_tables.h17
-rw-r--r--engines/tsage/events.cpp4
-rw-r--r--engines/tsage/globals.cpp102
-rw-r--r--engines/tsage/globals.h13
-rw-r--r--engines/tsage/graphics.cpp35
-rw-r--r--engines/tsage/graphics.h3
-rw-r--r--engines/tsage/ringworld/ringworld_scenes1.cpp8
-rw-r--r--engines/tsage/ringworld/ringworld_scenes1.h5
-rw-r--r--engines/tsage/ringworld/ringworld_scenes10.cpp2
-rw-r--r--engines/tsage/ringworld/ringworld_scenes3.cpp38
-rw-r--r--engines/tsage/ringworld/ringworld_scenes3.h2
-rw-r--r--engines/tsage/ringworld/ringworld_scenes5.cpp12
-rw-r--r--engines/tsage/ringworld/ringworld_scenes5.h1
-rw-r--r--engines/tsage/ringworld/ringworld_scenes6.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_dialogs.cpp17
-rw-r--r--engines/tsage/ringworld2/ringworld2_dialogs.h3
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp63
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.h1
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.cpp90
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes0.h18
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp5650
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h217
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes3.cpp335
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes3.h19
-rw-r--r--engines/tsage/ringworld2/ringworld2_speakers.cpp311
-rw-r--r--engines/tsage/saveload.h2
-rw-r--r--engines/tsage/scenes.cpp18
-rw-r--r--engines/tsage/scenes.h4
-rw-r--r--engines/tsage/sound.cpp4
-rw-r--r--engines/tsage/sound.h2
-rw-r--r--engines/tsage/staticres.cpp10
-rw-r--r--engines/tsage/staticres.h8
-rw-r--r--engines/tsage/tsage.cpp34
-rw-r--r--engines/tsage/tsage.h3
-rw-r--r--engines/tsage/user_interface.cpp6
-rw-r--r--engines/tsage/user_interface.h1
-rw-r--r--engines/tucker/configure.engine3
-rw-r--r--engines/wintermute/base/base_file_manager.cpp65
-rw-r--r--engines/wintermute/base/base_game.h3
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp23
-rw-r--r--engines/wintermute/base/font/base_font_truetype.h3
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp19
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp10
-rw-r--r--engines/wintermute/base/saveload.cpp1
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.cpp18
-rw-r--r--engines/wintermute/base/sound/base_sound_buffer.cpp10
-rw-r--r--engines/wintermute/base/sound/base_sound_buffer.h1
-rw-r--r--engines/wintermute/configure.engine3
-rw-r--r--engines/wintermute/dctypes.h3
-rw-r--r--engines/wintermute/detection_tables.h291
-rw-r--r--engines/wintermute/graphics/transparent_surface.cpp4
-rw-r--r--engines/wintermute/utils/string_util.cpp247
-rw-r--r--engines/wintermute/utils/string_util.h5
-rw-r--r--engines/wintermute/video/video_theora_player.cpp11
-rw-r--r--engines/zvision/configure.engine3
-rw-r--r--engines/zvision/zvision.h3
448 files changed, 30212 insertions, 10946 deletions
diff --git a/engines/agi/configure.engine b/engines/agi/configure.engine
new file mode 100644
index 0000000000..fad659f86d
--- /dev/null
+++ b/engines/agi/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 agi "AGI" yes
diff --git a/engines/agos/configure.engine b/engines/agos/configure.engine
new file mode 100644
index 0000000000..3ae1fb16f2
--- /dev/null
+++ b/engines/agos/configure.engine
@@ -0,0 +1,4 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine agos "AGOS" yes "agos2" "AGOS 1 games"
+add_engine agos2 "AGOS 2 games" yes
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index 70757865f5..329af75d0c 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -1091,6 +1091,30 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_32COLOR | GF_CRUNCHED | GF_CRUNCHED_GAMEPC | GF_OLD_BUNDLE | GF_PLANAR
},
+ // Simon the Sorcerer 1 - German Amiga OCS Floppy
+ {
+ {
+ "simon1",
+ "OCS Floppy",
+
+ {
+ { "gameamiga", GAME_BASEFILE, "634c82b7a0b760214fd71add328c7a00", 39493},
+ { "icon.pkd", GAME_ICONFILE, "565ef7a98dcc21ef526a2bb10b6f42ed", 18979},
+ { "stripped.txt", GAME_STRFILE, "f5fc67db3b8c5283cda51c43b98a74f8", 243},
+ { "tbllist", GAME_TBLFILE, "f9d5bf2ce09f82289c791c3ca26e1e4b", 696},
+ { NULL, 0, NULL, 0}
+ },
+ Common::DE_DEU,
+ Common::kPlatformAmiga,
+ ADGF_NO_FLAGS,
+ GUIO2(GUIO_NOSPEECH, GUIO_NOMIDI)
+ },
+
+ GType_SIMON1,
+ GID_SIMON1,
+ GF_32COLOR | GF_CRUNCHED | GF_OLD_BUNDLE | GF_PLANAR
+ },
+
// Simon the Sorcerer 1 - English Amiga AGA Floppy
{
{
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index 6d4192da2a..5647fece7e 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -1089,15 +1089,15 @@ bool AGOSEngine_PN::ifObjectInInv(uint16 a) {
}
bool AGOSEngine_PN::testContainer(uint16 a) {
- return bitextract(_quickptr[1] + a * _quickshort[1], 0) != 0;
+ return bitextract(_quickptr[1] + a * _quickshort[1], 0) != 0;
}
bool AGOSEngine_PN::testObvious(uint16 a) {
- return bitextract(_quickptr[1] + a * _quickshort[1], 4) != 0;
+ return bitextract(_quickptr[1] + a * _quickshort[1], 4) != 0;
}
bool AGOSEngine_PN::testSeen(uint16 a) {
- return bitextract(_quickptr[1] + a * _quickshort[1], 3) != 0;
+ return bitextract(_quickptr[1] + a * _quickshort[1], 3) != 0;
}
void AGOSEngine_PN::printIcon(HitArea *ha, uint8 i, uint8 r) {
diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp
index 927de07236..639abe99b3 100644
--- a/engines/avalanche/animation.cpp
+++ b/engines/avalanche/animation.cpp
@@ -248,7 +248,7 @@ void AnimationType::walk() {
break;
case kMagicUnfinished: {
bounce();
- Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!",
+ Common::String tmpStr = Common::String::format("%c%cSorry.%cThis place is not available yet!",
kControlBell, kControlCenter, kControlRoman);
_anim->_vm->_dialogs->displayText(tmpStr);
}
@@ -792,7 +792,7 @@ void Animation::callSpecial(uint16 which) {
_vm->_magics[11]._data = 5;
_vm->_magics[3]._operation = kMagicBounce; // Now works as planned!
stopWalking();
- _vm->_dialogs->displayScrollChain('q', 26);
+ _vm->_dialogs->displayScrollChain('Q', 26);
_vm->_userMovesAvvy = true;
break;
case 3: // _vm->special 3: Room 71: triggers dart.
@@ -824,12 +824,12 @@ void Animation::callSpecial(uint16 which) {
if (_vm->_friarWillTieYouUp) {
// _vm->special 5: Room 42: touched tree, and get tied up.
_vm->_magics[4]._operation = kMagicBounce; // Boundary effect is now working again.
- _vm->_dialogs->displayScrollChain('q', 35);
+ _vm->_dialogs->displayScrollChain('Q', 35);
_sprites[0]->remove();
AnimationType *spr1 = _sprites[1];
_vm->_background->draw(-1, -1, 1);
- _vm->_dialogs->displayScrollChain('q', 36);
+ _vm->_dialogs->displayScrollChain('Q', 36);
_vm->_tiedUp = true;
_vm->_friarWillTieYouUp = false;
spr1->walkTo(2);
@@ -862,7 +862,7 @@ void Animation::callSpecial(uint16 which) {
case 8: // _vm->special 8: leave du Lustie's room.
if (_vm->_geidaFollows && !_vm->_lustieIsAsleep) {
AnimationType *spr1 = _sprites[1];
- _vm->_dialogs->displayScrollChain('q', 63);
+ _vm->_dialogs->displayScrollChain('Q', 63);
spr1->turn(kDirDown);
spr1->stopWalk();
spr1->_callEachStepFl = false; // Geida
@@ -885,9 +885,9 @@ void Animation::callSpecial(uint16 which) {
if ((_vm->_catacombX == 4) && (_vm->_catacombY == 1)) {
// Into Geida's room.
if (_vm->_objects[kObjectKey - 1])
- _vm->_dialogs->displayScrollChain('q', 62);
+ _vm->_dialogs->displayScrollChain('Q', 62);
else {
- _vm->_dialogs->displayScrollChain('q', 61);
+ _vm->_dialogs->displayScrollChain('Q', 61);
return;
}
}
@@ -1247,7 +1247,7 @@ void Animation::animLink() {
if (_mustExclaim) {
_mustExclaim = false;
- _vm->_dialogs->displayScrollChain('x', _sayWhat);
+ _vm->_dialogs->displayScrollChain('X', _sayWhat);
}
}
@@ -1399,6 +1399,69 @@ void Animation::handleMoveKey(const Common::Event &event) {
}
}
+/**
+* Draws a part of the lightning bolt for thunder().
+* @remarks Originally called 'zl'
+*/
+void Animation::drawLightning(int16 x1, int16 y1, int16 x2, int16 y2) {
+ _vm->_graphics->drawLine(x1, y1 - 1, x2, y2 - 1, 1, 3, kColorBlue);
+ _vm->_graphics->drawLine(x1, y1, x2, y2, 1, 1, kColorLightcyan);
+}
+
+/**
+* Plays the actual thunder animation when Avvy (the player) swears too much.
+* @remarks Originally called 'zonk'
+*/
+void Animation::thunder() {
+ _vm->_graphics->setBackgroundColor(kColorYellow);
+
+ _vm->_graphics->saveScreen();
+
+ int x = _vm->_animation->_sprites[0]->_x + _vm->_animation->_sprites[0]->_xLength / 2;
+ int y = _vm->_animation->_sprites[0]->_y;
+
+ for (int i = 0; i < 256; i++) {
+ _vm->_sound->playNote(270 - i, 1);
+
+ drawLightning(640, 0, 0, y / 4);
+ drawLightning(0, y / 4, 640, y / 2);
+ drawLightning(640, y / 2, x, y);
+ _vm->_graphics->refreshScreen();
+
+ _vm->_sound->playNote(2700 - 10 * i, 5);
+ _vm->_system->delayMillis(5);
+ _vm->_sound->playNote(270 - i, 1);
+
+ _vm->_graphics->restoreScreen();
+ _vm->_sound->playNote(2700 - 10 * i, 5);
+ _vm->_system->delayMillis(5);
+ }
+
+ _vm->_graphics->restoreScreen();
+ _vm->_graphics->removeBackup();
+
+ _vm->_graphics->setBackgroundColor(kColorBlack);
+}
+
+/**
+* Makes the screen wobble.
+*/
+void Animation::wobble() {
+ _vm->_graphics->saveScreen();
+
+ for (int i = 0; i < 26; i++) {
+ _vm->_graphics->shiftScreen();
+ _vm->_graphics->refreshScreen();
+ _vm->_system->delayMillis(i * 7);
+
+ _vm->_graphics->restoreScreen();
+ _vm->_system->delayMillis(i * 7);
+ }
+
+ _vm->_graphics->restoreScreen();
+ _vm->_graphics->removeBackup();
+}
+
void Animation::setDirection(Direction dir) {
_direction = dir;
}
@@ -1433,6 +1496,7 @@ int Animation::getAvvyClothes() {
}
void Animation::resetVariables() {
+ setDirection(kDirUp);
_geidaSpin = 0;
_geidaTime = 0;
_arrowTriggered = false;
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 3223615985..aa4e6482a4 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -125,6 +125,12 @@ public:
void handleMoveKey(const Common::Event &event);
void hideInCupboard();
+ // These 2 functions are responsible for playing the thunder animation when the player swears too much.
+ void drawLightning(int16 x1, int16 y1, int16 x2, int16 y2);
+ void thunder();
+
+ void wobble();
+
void setDirection(Direction dir);
void setOldDirection(Direction dir);
Direction getDirection();
@@ -157,7 +163,7 @@ private:
void followAvalotY(byte tripnum);
void backAndForth(byte tripnum);
void faceAvvy(byte tripnum);
-
+
// Movements for Homing NPCs: Spludwick and Geida.
void spin(Direction dir, byte &tripnum);
void takeAStep(byte &tripnum);
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 8b3efe4081..dbe434cde3 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -42,7 +42,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
_system->getTimeAndDate(time);
_rnd->setSeed(time.tm_sec + time.tm_min + time.tm_hour);
_showDebugLines = false;
-
+
_clock = nullptr;
_graphics = nullptr;
_parser = nullptr;
@@ -55,6 +55,7 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
_menu = nullptr;
_closing = nullptr;
_sound = nullptr;
+ _nim = nullptr;
_platform = gd->desc.platform;
initVariables();
@@ -77,6 +78,7 @@ AvalancheEngine::~AvalancheEngine() {
delete _menu;
delete _closing;
delete _sound;
+ delete _nim;
for (int i = 0; i < 31; i++) {
for (int j = 0; j < 2; j++) {
@@ -142,30 +144,7 @@ void AvalancheEngine::initVariables() {
_currentMouse = 177;
_holdLeftMouse = false;
- _jumpStatus = 0;
- _mushroomGrowing = false;
- _crapulusWillTell = false;
- _enterCatacombsFromLustiesRoom = false;
- _teetotal = false;
- _malagauche = 0;
- _drinking = '\0';
- _enteredLustiesRoomAsMonk = false;
- _catacombX = 0;
- _catacombY = 0;
- _avvysInTheCupboard = false;
- _geidaFollows = false;
- _givenPotionToGeida = false;
- _lustieIsAsleep = false;
- _beenTiedUp = false;
- _sittingInPub = false;
- _spurgeTalkCount = 0;
- _metAvaroid = false;
- _takenMushroom = false;
- _givenPenToAyles = false;
- _askedDogfoodAboutNim = false;
- _spludwickAtHome = false;
- _passedCwytalotInHerts = false;
- _lastRoom = _lastRoomNotMap = kRoomDummy;
+ resetVariables();
}
Common::ErrorCode AvalancheEngine::initialize() {
@@ -182,6 +161,7 @@ Common::ErrorCode AvalancheEngine::initialize() {
_menu = new Menu(this);
_closing = new Closing(this);
_sound = new SoundHandler(this);
+ _nim = new Nim(this);
_graphics->init();
_dialogs->init();
@@ -210,6 +190,7 @@ const char *AvalancheEngine::getCopyrightString() const {
void AvalancheEngine::synchronize(Common::Serializer &sz) {
_animation->synchronize(sz);
_parser->synchronize(sz);
+ _nim->synchronize(sz);
_sequence->synchronize(sz);
_background->synchronize(sz);
@@ -349,7 +330,7 @@ void AvalancheEngine::synchronize(Common::Serializer &sz) {
sz.syncAsByte(_timer->_times[i]._action);
sz.syncAsByte(_timer->_times[i]._reason);
}
-
+
}
bool AvalancheEngine::canSaveGameStateCurrently() { // TODO: Refine these!!!
@@ -417,7 +398,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
// Check version. We can't restore from obsolete versions.
byte saveVersion = f->readByte();
- if (saveVersion != kSavegameVersion) {
+ if (saveVersion > kSavegameVersion) {
warning("Savegame of incompatible version!");
delete f;
return false;
@@ -440,7 +421,7 @@ bool AvalancheEngine::loadGame(const int16 slot) {
t.tm_mon = f->readSint16LE();
t.tm_year = f->readSint16LE();
- resetVariables();
+ resetAllVariables();
Common::Serializer sz(f, NULL);
synchronize(sz);
@@ -466,9 +447,9 @@ bool AvalancheEngine::loadGame(const int16 slot) {
_animation->animLink();
_background->update();
- Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.",
- kControlItalic, kControlRoman, description.c_str(), kControlCenter, kControlNewLine,
- kControlNewLine, _roomnName.c_str(), kControlNewLine, kControlNewLine,
+ Common::String tmpStr = Common::String::format("%cLoaded: %c%s.ASG%c%c%c%s%c%csaved on %s.",
+ kControlItalic, kControlRoman, description.c_str(), kControlCenter, kControlNewLine,
+ kControlNewLine, _roomnName.c_str(), kControlNewLine, kControlNewLine,
expandDate(t.tm_mday, t.tm_mon, t.tm_year).c_str());
_dialogs->displayText(tmpStr);
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index fdbc4c7a15..ef2338e629 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -41,6 +41,8 @@
#include "avalanche/menu.h"
#include "avalanche/closing.h"
#include "avalanche/sound.h"
+#include "avalanche/nim.h"
+#include "avalanche/clock.h"
#include "common/serializer.h"
@@ -59,7 +61,7 @@ struct AvalancheGameDescription {
ADGameDescription desc;
};
-static const int kSavegameVersion = 1;
+static const int kSavegameVersion = 2;
enum Pitch {
kPitchInvalid,
@@ -84,6 +86,7 @@ public:
Menu *_menu;
Closing *_closing;
SoundHandler *_sound;
+ Nim *_nim;
OSystem *_system;
@@ -289,7 +292,7 @@ public:
void newGame(); // This sets up the DNA for a completely new game.
bool getFlag(char x);
bool decreaseMoney(uint16 amount); // Called pennycheck in the original.
-
+
Common::String getName(People whose);
Common::String getItem(byte which); // Called get_better in the original.
Common::String f5Does(); // This procedure determines what f5 does.
@@ -338,6 +341,7 @@ private:
void checkClick();
void fixFlashers();
void loadAlso(byte num);
+ void resetAllVariables();
void resetVariables();
};
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 08096d85c0..04fd2a8d98 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -116,88 +116,6 @@ Room AvalancheEngine::_whereIs[29] = {
kRoomWiseWomans // The Wise Woman.
};
-Clock::Clock(AvalancheEngine *vm) {
- _vm = vm;
- // Magic value to determine if we just created the instance
- _oldHour = _oldHourAngle = _oldMinute = 17717;
- _hour = _minute = _second = 0;
- _hourAngle = 0;
-}
-
-void Clock::update() {
- TimeDate t;
- _vm->_system->getTimeAndDate(t);
- _hour = t.tm_hour;
- _minute = t.tm_min;
- _second = t.tm_sec;
-
- _hourAngle = (_hour % 12) * 30 + _minute / 2;
-
- if (_oldHour != _hour) {
- plotHands();
- chime();
- }
-
- if (_oldMinute != _minute)
- plotHands();
-
- if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
- Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
- "midnight. Are you having an all-night Avvy session? Glad you like the game that much!",
- kControlNewLine, kControlNewLine);
- _vm->_dialogs->displayText(tmpStr);
- }
- _oldHour = _hour;
- _oldHourAngle = _hourAngle;
- _oldMinute = _minute;
-}
-
-Common::Point Clock::calcHand(uint16 angle, uint16 length, Color color) {
- if (angle > 900) {
- return(Common::Point(177, 177));
- }
-
- return(_vm->_graphics->drawScreenArc(kCenterX, kCenterY, 449 - angle, 450 - angle, length, color));
-}
-
-void Clock::drawHand(const Common::Point &endPoint, Color color) {
- if (endPoint.x == 177)
- return;
-
- _vm->_graphics->drawScreenLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
-}
-
-void Clock::plotHands() {
- _clockHandHour = calcHand(_oldHourAngle, 14, kColorYellow);
- _clockHandMinute = calcHand(_oldMinute * 6, 17, kColorYellow);
- drawHand(_clockHandHour, kColorBrown);
- drawHand(_clockHandMinute, kColorBrown);
-
- _clockHandHour = calcHand(_hourAngle, 14, kColorBrown);
- _clockHandMinute = calcHand(_minute * 6, 17, kColorBrown);
- drawHand(_clockHandHour, kColorYellow);
- drawHand(_clockHandMinute, kColorYellow);
-}
-
-void Clock::chime() {
- // Too high - must be first time around
- // Mute - skip the sound generation
- if ((_oldHour == 17717) || (!_vm->_soundFx))
- return;
-
- byte hour = _hour % 12;
- if (hour == 0)
- hour = 12;
-
- _vm->_graphics->loadMouse(kCurWait);
-
- for (int i = 1; i <= hour; i++) {
- for (int j = 1; j <= 3; j++)
- _vm->_sound->playNote((i % 3) * 64 + 140 - j * 30, 50 - j * 12);
- if (i != hour)
- _vm->_system->delayMillis(100);
- }
-}
void AvalancheEngine::handleKeyDown(Common::Event &event) {
@@ -301,7 +219,7 @@ void AvalancheEngine::setup() {
fxToggle();
thinkAbout(kObjectMoney, kThing);
- _dialogs->displayScrollChain('q', 83); // Info on the game, etc.
+ _dialogs->displayScrollChain('Q', 83); // Info on the game, etc.
}
}
@@ -576,7 +494,6 @@ void AvalancheEngine::exitRoom(byte x) {
_lastRoomNotMap = _room;
}
-
/**
* Only when entering a NEW town! Not returning to the last one,
* but choosing another from the map.
@@ -811,12 +728,12 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
_graphics->zoomOut(_peds[ped - 1]._x, _peds[ped - 1]._y);
if ((_objects[kObjectWine - 1]) && (_wineState != 3)) {
- _dialogs->displayScrollChain('q', 9); // Don't want to waste the wine!
+ _dialogs->displayScrollChain('Q', 9); // Don't want to waste the wine!
_objects[kObjectWine - 1] = false;
refreshObjectList();
}
- _dialogs->displayScrollChain('q', 69);
+ _dialogs->displayScrollChain('Q', 69);
break;
case kRoomCatacombs:
@@ -999,7 +916,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) {
case kRoomDucks:
_npcFacing = 1; // Duck.
- break;
+ break;
default:
break;
@@ -1064,7 +981,7 @@ void AvalancheEngine::drawScore() {
_scoreToDisplay[i] = numbers[i];
}
-void AvalancheEngine::incScore(byte num) {
+void AvalancheEngine::incScore(byte num) {
for (int i = 1; i <= num; i++) {
_dnascore++;
@@ -1311,9 +1228,9 @@ void AvalancheEngine::fadeOut() {
void AvalancheEngine::fadeIn() {
if (_holdTheDawn || !_fxHidden)
return;
-
+
_fxHidden = false;
-
+
byte pal[3];
for (int i = 15; i >= 0; i--) {
for (int j = 0; j < 16; j++) {
@@ -1341,7 +1258,6 @@ void AvalancheEngine::drawDirection() { // It's data is loaded in load_digits().
CursorMan.showMouse(true);
}
-
void AvalancheEngine::gameOver() {
_userMovesAvvy = false;
@@ -1380,7 +1296,7 @@ uint16 AvalancheEngine::bearing(byte whichPed) {
if (avvy->_x == curPed->_x)
return 0;
-
+
int16 deltaX = avvy->_x - curPed->_x;
int16 deltaY = avvy->_y - curPed->_y;
uint16 result = (uint16)(atan((float)(deltaY / deltaX)) * 180 / M_PI);
@@ -1391,7 +1307,7 @@ uint16 AvalancheEngine::bearing(byte whichPed) {
}
}
-/**
+/**
* @remarks Originally called 'sprite_run'
*/
void AvalancheEngine::spriteRun() {
@@ -1413,7 +1329,6 @@ Common::String AvalancheEngine::intToStr(int32 num) {
}
void AvalancheEngine::resetVariables() {
- _animation->setDirection(kDirUp);
_carryNum = 0;
for (int i = 0; i < kObjectNum; i++)
_objects[i] = false;
@@ -1482,8 +1397,12 @@ void AvalancheEngine::resetVariables() {
_givenPenToAyles = false;
_askedDogfoodAboutNim = false;
_startTime = getTimeInSeconds();
+}
+void AvalancheEngine::resetAllVariables() {
+ resetVariables();
_parser->resetVariables();
+ _nim->resetVariables();
_animation->resetVariables();
_sequence->resetVariables();
_background->resetVariables();
@@ -1503,7 +1422,7 @@ void AvalancheEngine::newGame() {
avvy->init(0, true);
_alive = true;
- resetVariables();
+ resetAllVariables();
_dialogs->setBubbleStateNatural();
@@ -1566,7 +1485,7 @@ Common::String AvalancheEngine::getName(People whose) {
static const char lads[17][20] = {
"Avalot", "Spludwick", "Crapulus", "Dr. Duck", "Malagauche",
"Friar Tuck", "Robin Hood", "Cwytalot", "du Lustie", "the Duke of Cardiff",
- "Dogfood", "A trader", "Ibythneth", "Ayles", "Port",
+ "Dogfood", "A trader", "Ibythneth", "Ayles", "Port",
"Spurge", "Jacques"
};
@@ -1748,10 +1667,10 @@ void AvalancheEngine::openDoor(Room whither, byte ped, byte magicnum) {
}
void AvalancheEngine::setRoom(People persId, Room roomId) {
- _whereIs[persId - kPeopleAvalot] = roomId;
+ _whereIs[persId - kPeopleAvalot] = roomId;
}
Room AvalancheEngine::getRoom(People persId) {
- return _whereIs[persId - kPeopleAvalot];
+ return _whereIs[persId - kPeopleAvalot];
}
} // End of namespace Avalanche
diff --git a/engines/avalanche/avalot.h b/engines/avalanche/avalot.h
index ab78f5c385..e5b8f3d490 100644
--- a/engines/avalanche/avalot.h
+++ b/engines/avalanche/avalot.h
@@ -35,27 +35,6 @@
namespace Avalanche {
class AvalancheEngine;
-class Clock {
-public:
- Clock(AvalancheEngine *vm);
-
- void update();
-
-private:
- static const int kCenterX = 510;
- static const int kCenterY = 183;
-
- AvalancheEngine *_vm;
-
- uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
- Common::Point _clockHandHour, _clockHandMinute;
-
- Common::Point calcHand(uint16 angle, uint16 length, Color color);
- void drawHand(const Common::Point &endPoint, Color color);
- void plotHands();
- void chime();
-};
-
static const byte kObjectNum = 18; // always preface with a #
static const int16 kCarryLimit = 12; // carry limit
diff --git a/engines/avalanche/background.cpp b/engines/avalanche/background.cpp
index 523b7a6826..5d168a20af 100644
--- a/engines/avalanche/background.cpp
+++ b/engines/avalanche/background.cpp
@@ -251,7 +251,7 @@ void Background::update() {
if (_nextBell < 5)
_nextBell = 12;
_nextBell--;
- // CHECKME: 2 is a guess. No length in the original?
+ // CHECKME: 2 is a guess. No length in the original?
_vm->_sound->playNote(_vm->kNotes[_nextBell], 2);
break;
case 2:
diff --git a/engines/avalanche/clock.cpp b/engines/avalanche/clock.cpp
new file mode 100644
index 0000000000..1c2c50c3bf
--- /dev/null
+++ b/engines/avalanche/clock.cpp
@@ -0,0 +1,116 @@
+/* ScummVM - Graphic Adventure Engine
+*
+* ScummVM is the legal property of its developers, whose names
+* are too numerous to list here. Please refer to the COPYRIGHT
+* file distributed with this source distribution.
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 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 the original source code of Lord Avalot d'Argent version 1.3.
+* Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman.
+*/
+
+#include "avalanche/clock.h"
+#include "avalanche/avalanche.h"
+
+namespace Avalanche {
+
+Clock::Clock(AvalancheEngine *vm) {
+ _vm = vm;
+ // Magic value to determine if we just created the instance
+ _oldHour = _oldHourAngle = _oldMinute = 17717;
+ _hour = _minute = _second = 0;
+ _hourAngle = 0;
+}
+
+void Clock::update() {
+ TimeDate t;
+ _vm->_system->getTimeAndDate(t);
+ _hour = t.tm_hour;
+ _minute = t.tm_min;
+ _second = t.tm_sec;
+
+ _hourAngle = (_hour % 12) * 30 + _minute / 2;
+
+ if (_oldHour != _hour) {
+ plotHands();
+ chime();
+ }
+
+ if (_oldMinute != _minute)
+ plotHands();
+
+ if ((_hour == 0) && (_oldHour != 0) && (_oldHour != 17717)) {
+ Common::String tmpStr = Common::String::format("Good morning!%c%cYes, it's just past " \
+ "midnight. Are you having an all-night Avvy session? Glad you like the game that much!",
+ kControlNewLine, kControlNewLine);
+ _vm->_dialogs->displayText(tmpStr);
+ }
+ _oldHour = _hour;
+ _oldHourAngle = _hourAngle;
+ _oldMinute = _minute;
+}
+
+Common::Point Clock::calcHand(uint16 angle, uint16 length, Color color) {
+ if (angle > 900) {
+ return(Common::Point(177, 177));
+ }
+
+ return(_vm->_graphics->drawScreenArc(kCenterX, kCenterY, 449 - angle, 450 - angle, length, color));
+}
+
+void Clock::drawHand(const Common::Point &endPoint, Color color) {
+ if (endPoint.x == 177)
+ return;
+
+ _vm->_graphics->drawScreenLine(kCenterX, kCenterY, endPoint.x, endPoint.y, color);
+}
+
+void Clock::plotHands() {
+ _clockHandHour = calcHand(_oldHourAngle, 14, kColorYellow);
+ _clockHandMinute = calcHand(_oldMinute * 6, 17, kColorYellow);
+ drawHand(_clockHandHour, kColorBrown);
+ drawHand(_clockHandMinute, kColorBrown);
+
+ _clockHandHour = calcHand(_hourAngle, 14, kColorBrown);
+ _clockHandMinute = calcHand(_minute * 6, 17, kColorBrown);
+ drawHand(_clockHandHour, kColorYellow);
+ drawHand(_clockHandMinute, kColorYellow);
+}
+
+void Clock::chime() {
+ // Too high - must be first time around
+ // Mute - skip the sound generation
+ if ((_oldHour == 17717) || (!_vm->_soundFx))
+ return;
+
+ byte hour = _hour % 12;
+ if (hour == 0)
+ hour = 12;
+
+ _vm->_graphics->loadMouse(kCurWait);
+
+ for (int i = 1; i <= hour; i++) {
+ for (int j = 1; j <= 3; j++)
+ _vm->_sound->playNote((i % 3) * 64 + 140 - j * 30, 50 - j * 12);
+ if (i != hour)
+ _vm->_system->delayMillis(100);
+ }
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/clock.h b/engines/avalanche/clock.h
new file mode 100644
index 0000000000..68e8e119f0
--- /dev/null
+++ b/engines/avalanche/clock.h
@@ -0,0 +1,60 @@
+/* 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 the original source code of Lord Avalot d'Argent version 1.3.
+* Copyright (c) 1994-1995 Mike: Mark and Thomas Thurman.
+*/
+
+#ifndef AVALANCHE_CLOCK_H
+#define AVALANCHE_CLOCK_H
+
+#include "common/rect.h"
+#include "avalanche/enums.h"
+
+namespace Avalanche {
+class AvalancheEngine;
+
+class Clock {
+public:
+ Clock(AvalancheEngine *vm);
+
+ void update();
+
+private:
+ static const int kCenterX = 510;
+ static const int kCenterY = 183;
+
+ AvalancheEngine *_vm;
+
+ uint16 _hour, _minute, _second, _hourAngle, _oldHour, _oldMinute, _oldHourAngle;
+ Common::Point _clockHandHour, _clockHandMinute;
+
+ Common::Point calcHand(uint16 angle, uint16 length, Color color);
+ void drawHand(const Common::Point &endPoint, Color color);
+ void plotHands();
+ void chime();
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_CLOCK_H
diff --git a/engines/avalanche/configure.engine b/engines/avalanche/configure.engine
new file mode 100644
index 0000000000..28d6a558db
--- /dev/null
+++ b/engines/avalanche/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 avalanche "Lord Avalot d'Argent" no
diff --git a/engines/avalanche/console.cpp b/engines/avalanche/console.cpp
index 656cc1907c..e4b52116e4 100644
--- a/engines/avalanche/console.cpp
+++ b/engines/avalanche/console.cpp
@@ -50,5 +50,4 @@ bool AvalancheConsole::Cmd_MagicLines(int argc, const char **argv) {
return false;
}
-
} // End of namespace Avalanche
diff --git a/engines/avalanche/detection.cpp b/engines/avalanche/detection.cpp
index 048b0fe148..5f4f03a78b 100644
--- a/engines/avalanche/detection.cpp
+++ b/engines/avalanche/detection.cpp
@@ -129,7 +129,7 @@ SaveStateList AvalancheMetaEngine::listSaves(const char *target) const {
// Check version.
byte saveVersion = file->readByte();
- if (saveVersion != kSavegameVersion) {
+ if (saveVersion > kSavegameVersion) {
warning("Savegame of incompatible version!");
delete file;
continue;
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp
index 4b6cacf569..c68ad4b002 100644
--- a/engines/avalanche/dialogs.cpp
+++ b/engines/avalanche/dialogs.cpp
@@ -190,7 +190,6 @@ void Dialogs::scrollModeNormal() {
break;
} while (!((mrelease > 0) || (buttona1()) || (buttonb1())));
-
if (mrelease == 0) {
inkey();
if (aboutscroll) {
@@ -319,7 +318,7 @@ void Dialogs::scrollModeMusic() {
|| (event.kbd.keycode == Common::KEYCODE_u) || (event.kbd.keycode == Common::KEYCODE_i)
|| (event.kbd.keycode == Common::KEYCODE_o) || (event.kbd.keycode == Common::KEYCODE_p)
|| (event.kbd.keycode == Common::KEYCODE_LEFTBRACKET) || (event.kbd.keycode == Common::KEYCODE_RIGHTBRACKET))) {
- byte value;
+ byte value = 0;
switch (event.kbd.keycode) {
case Common::KEYCODE_q:
value = 0;
@@ -375,7 +374,7 @@ void Dialogs::scrollModeMusic() {
else
store(kPitchHigher, played);
}
-
+
if (theyMatch(played)) {
setReadyLight(0);
_vm->_timer->addTimer(8, Timer::kProcJacquesWakesUp, Timer::kReasonJacquesWakingUp);
@@ -502,7 +501,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
_underScroll = (my + 3) * 2; // Multiplying because of the doubled screen height.
ringBell();
-
+
_vm->_dropsOk = false;
dodgem();
@@ -510,7 +509,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) {
unDodgem();
_vm->_dropsOk = true;
-
+
resetScrollDriver();
}
@@ -597,7 +596,7 @@ Common::String Dialogs::displayMoney() {
else
result = Common::String::format("%d/%d", _vm->_money / 12, _vm->_money % 12);
} else { // L, s & d
- result = Common::String::format("\x9C%d.%d.%d", _vm->_money / 240, (_vm->_money / 12) % 20,
+ result = Common::String::format("\x9C%d.%d.%d", _vm->_money / 240, (_vm->_money / 12) % 20,
_vm->_money % 12);
}
if (_vm->_money > 12) {
@@ -636,7 +635,7 @@ void Dialogs::solidify(byte n) {
/**
* @remarks Originally called 'calldriver'
- * Display text by calling the dialog driver. It unifies the function of the original
+ * Display text by calling the dialog driver. It unifies the function of the original
* 'calldriver' and 'display' by using Common::String instead of a private buffer.
*/
void Dialogs::displayText(Common::String text) {
@@ -717,7 +716,7 @@ void Dialogs::displayText(Common::String text) {
PedType *quasiPed = &_vm->_peds[kQuasipeds[_param - 10]._whichPed];
_talkX = quasiPed->_x;
_talkY = quasiPed->_y; // Position.
-
+
_vm->_graphics->setDialogColor(kQuasipeds[_param - 10]._backgroundColor, kQuasipeds[_param - 10]._textColor);
} else {
_vm->errorLed(); // Not valid.
@@ -732,7 +731,7 @@ void Dialogs::displayText(Common::String text) {
return;
break;
- // CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive
+ // CHECME: The whole kControlNegative block seems completely unused, as the only use (the easter egg check) is a false positive
case kControlNegative:
switch (_param) {
case 1:
@@ -763,7 +762,7 @@ void Dialogs::displayText(Common::String text) {
case 10:
switch (_vm->_boxContent) {
case 0: // Sixpence.
- displayScrollChain('q', 37); // You find the sixpence.
+ displayScrollChain('Q', 37); // You find the sixpence.
_vm->_money += 6;
_vm->_boxContent = _vm->_parser->kNothing;
_vm->incScore(2);
@@ -777,7 +776,7 @@ void Dialogs::displayText(Common::String text) {
break;
case 11:
for (int j = 0; j < kObjectNum; j++) {
- if (_vm->_objects[j])
+ if (_vm->_objects[j])
displayText(_vm->getItem(j) + ", " + kControlToBuffer);
}
break;
@@ -830,7 +829,7 @@ int16 Dialogs::getTalkPosX() {
bool Dialogs::displayQuestion(Common::String question) {
displayText(question + kControlNewLine + kControlQuestion);
-
+
if (_scReturn && (_vm->_rnd->getRandomNumber(1) == 0)) { // Half-and-half chance.
Common::String tmpStr = Common::String::format("...Positive about that?%cI%c%c%c", kControlRegister, kControlIcon, kControlNewLine, kControlQuestion);
displayText(tmpStr); // Be annoying!
@@ -874,7 +873,7 @@ void Dialogs::loadFont() {
* @remarks Originally called 'musical_scroll'
*/
void Dialogs::displayMusicalScroll() {
- Common::String tmpStr = Common::String::format("To play the harp...%c%cUse these keys:%c%cQ W E R T Y U I O P [ ]%c%cOr press Enter to stop playing.%c",
+ Common::String tmpStr = Common::String::format("To play the harp...%c%cUse these keys:%c%cQ W E R T Y U I O P [ ]%c%cOr press Enter to stop playing.%c",
kControlNewLine, kControlNewLine, kControlNewLine, kControlInsertSpaces, kControlNewLine, kControlNewLine, kControlToBuffer);
displayText(tmpStr);
@@ -906,7 +905,7 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
bool error = false;
- indexfile.seek((toupper(block) - 65) * 2);
+ indexfile.seek((toupper(block) - 'A') * 2);
uint16 idx_offset = indexfile.readUint16LE();
if (idx_offset == 0)
error = true;
@@ -953,7 +952,7 @@ void Dialogs::displayScrollChain(char block, byte point, bool report, bool bubbl
*/
void Dialogs::speak(byte who, byte subject) {
if (subject == 0) { // No subject.
- displayScrollChain('s', who, false, true);
+ displayScrollChain('S', who, false, true);
return;
}
@@ -1007,7 +1006,7 @@ void Dialogs::talkTo(byte whom) {
switch (whom) {
case kPeopleSpludwick:
if ((_vm->_lustieIsAsleep) & (!_vm->_objects[kObjectPotion - 1])) {
- displayScrollChain('q', 68);
+ displayScrollChain('Q', 68);
_vm->_objects[kObjectPotion - 1] = true;
_vm->refreshObjectList();
_vm->incScore(3);
@@ -1019,64 +1018,64 @@ void Dialogs::talkTo(byte whom) {
case 1: // Fallthrough is intended.
case 2: {
Common::String objStr = _vm->getItem(AvalancheEngine::kSpludwicksOrder[_vm->_givenToSpludwick]);
- Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c",
+ Common::String tmpStr = Common::String::format("Can you get me %s, please?%c2%c",
objStr.c_str(), kControlRegister, kControlSpeechBubble);
displayText(tmpStr);
}
return;
case 3:
- displayScrollChain('q', 30); // Need any help with the game?
+ displayScrollChain('Q', 30); // Need any help with the game?
return;
}
} else {
- displayScrollChain('q', 42); // Haven't talked to Crapulus. Go and talk to him.
+ displayScrollChain('Q', 42); // Haven't talked to Crapulus. Go and talk to him.
return;
}
break;
case kPeopleIbythneth:
if (_vm->_givenBadgeToIby) {
- displayScrollChain('q', 33); // Thanks a lot!
+ displayScrollChain('Q', 33); // Thanks a lot!
return; // And leave the proc.
}
break; // Or... just continue, 'cos he hasn't got it.
case kPeopleDogfood:
if (_vm->_wonNim) { // We've won the game.
- displayScrollChain('q', 6); // "I'm Not Playing!"
+ displayScrollChain('Q', 6); // "I'm Not Playing!"
return; // Zap back.
} else
_vm->_askedDogfoodAboutNim = true;
break;
case kPeopleAyles:
if (!_vm->_aylesIsAwake) {
- displayScrollChain('q', 43); // He's fast asleep!
+ displayScrollChain('Q', 43); // He's fast asleep!
return;
} else if (!_vm->_givenPenToAyles) {
- displayScrollChain('q', 44); // Can you get me a pen, Avvy?
+ displayScrollChain('Q', 44); // Can you get me a pen, Avvy?
return;
}
break;
case kPeopleJacques:
- displayScrollChain('q', 43);
+ displayScrollChain('Q', 43);
return;
case kPeopleGeida:
if (_vm->_givenPotionToGeida)
_vm->_geidaFollows = true;
else {
- displayScrollChain('u', 17);
+ displayScrollChain('U', 17);
return;
}
break;
case kPeopleSpurge:
if (!_vm->_sittingInPub) {
- displayScrollChain('q', 71); // Try going over and sitting down.
+ displayScrollChain('Q', 71); // Try going over and sitting down.
return;
} else {
if (_vm->_spurgeTalkCount < 5)
_vm->_spurgeTalkCount++;
if (_vm->_spurgeTalkCount > 1) { // no. 1 falls through
- displayScrollChain('q', 70 + _vm->_spurgeTalkCount);
+ displayScrollChain('Q', 70 + _vm->_spurgeTalkCount);
return;
}
}
@@ -1084,7 +1083,7 @@ void Dialogs::talkTo(byte whom) {
}
// On a subject. Is there any reason to block it?
} else if ((whom == kPeopleAyles) && (!_vm->_aylesIsAwake)) {
- displayScrollChain('q', 43); // He's fast asleep!
+ displayScrollChain('Q', 43); // He's fast asleep!
return;
}
@@ -1109,12 +1108,12 @@ void Dialogs::talkTo(byte whom) {
speak(whom, _vm->_subjectNum);
if (!_noError)
- displayScrollChain('n', whom); // File not found!
+ displayScrollChain('N', whom); // File not found!
if ((_vm->_subjectNum == 0) && ((whom + 149) == kPeopleCrapulus)) { // Crapulus: get the badge - first time only
_vm->_objects[kObjectBadge - 1] = true;
_vm->refreshObjectList();
- displayScrollChain('q', 1); // Circular from Cardiff.
+ displayScrollChain('Q', 1); // Circular from Cardiff.
_vm->_talkedToCrapulus = true;
_vm->setRoom(kPeopleCrapulus, kRoomDummy); // Crapulus walks off.
diff --git a/engines/avalanche/enums.h b/engines/avalanche/enums.h
index 604c62de84..2b5db67609 100644
--- a/engines/avalanche/enums.h
+++ b/engines/avalanche/enums.h
@@ -81,12 +81,12 @@ enum VerbCode {
kVerbCodeRestart = 31, kVerbCodeEat = 32, kVerbCodeListen = 33, kVerbCodeBuy = 34, kVerbCodeAttack = 35,
kVerbCodePasswd = 36, kVerbCodeDir = 37, kVerbCodeDie = 38, kVerbCodeScore = 39, kVerbCodePut = 40,
kVerbCodeKiss = 41, kVerbCodeClimb = 42, kVerbCodeJump = 43, kVerbCodeHiscores = 44, kVerbCodeWake = 45,
- kVerbCodeHello = 46, kVerbCodeThanks = 47,
+ kVerbCodeHello = 46, kVerbCodeThanks = 47,
kVerbCodeSmartAlec = 249, kVerbCodeExpletive = 253, kVerbCodePardon = 254
};
enum MouseCursor {
- kCurUpArrow = 0, kCurScrewDriver = 1, kCurRightArrow = 2, kCurFletch = 3, kCurWait = 4, kCurHand = 5,
+ kCurUpArrow = 0, kCurScrewDriver = 1, kCurRightArrow = 2, kCurFletch = 3, kCurWait = 4, kCurHand = 5,
kCurCrosshair = 6, kCurIBeam = 7
};
@@ -127,7 +127,6 @@ static const int16 kScreenHeight = 200;
static const int16 kWalk = 3;
static const int16 kRun = 5;
-
} // End of namespace Avalanche
#endif // AVALANCHE_ENUMS_H
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index d7c32cb1fc..82248f5087 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -36,15 +36,15 @@ namespace Avalanche {
const byte GraphicManager::kEgaPaletteIndex[16] = {0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63};
const MouseHotspotType GraphicManager::kMouseHotSpots[9] = {
- {8,0}, // 0 - up-arrow
- {0,0}, // 1 - screwdriver
+ {8,0}, // 0 - up-arrow
+ {0,0}, // 1 - screwdriver
{15,6}, // 2 - right-arrow
- {0,0}, // 3 - fletch
- {8,7}, // 4 - hourglass
- {4,0}, // 5 - TTHand
- {8,5}, // 6 - Mark's crosshairs
- {8,7}, // 7 - I-beam
- {0,0} // 8 - question mark
+ {0,0}, // 3 - fletch
+ {8,7}, // 4 - hourglass
+ {4,0}, // 5 - TTHand
+ {8,5}, // 6 - Mark's crosshairs
+ {8,7}, // 7 - I-beam
+ {0,0} // 8 - question mark
};
GraphicManager::GraphicManager(AvalancheEngine *vm) {
@@ -127,7 +127,6 @@ void GraphicManager::loadMouse(byte which) {
cursor.create(16, 32, Graphics::PixelFormat::createFormatCLUT8());
cursor.fillRect(Common::Rect(0, 0, 16, 32), 255);
-
// The AND mask.
f.seek(kMouseSize * 2 * which + 134);
@@ -282,6 +281,10 @@ Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16
return endPoint;
}
+void GraphicManager::drawLine(int x1, int y1, int x2, int y2, int penX, int penY, Color color) {
+ _surface.drawThickLine(x1, y1, x2, y2, penX, penY, color);
+}
+
Common::Point GraphicManager::drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color) {
return drawArc(_surface, x, y, stAngle, endAngle, radius, color);
}
@@ -452,6 +455,51 @@ void GraphicManager::drawDebugLines() {
}
}
+void GraphicManager::drawFilledRectangle(Common::Rect rect, Color color) {
+ _surface.fillRect(rect, color);
+}
+
+void GraphicManager::drawRectangle(Common::Rect rect, Color color) {
+ _surface.frameRect(rect, color);
+}
+
+void GraphicManager::nimLoad() {
+ Common::File file;
+ Common::String filename = "nim.avd";
+
+ if (!file.open(filename))
+ error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
+
+ file.seek(41);
+
+ _nimStone = loadPictureSign(file, 7, 23);
+ for (int i = 0; i < 3; i++)
+ _nimInitials[i] = loadPictureSign(file, 7, 23);
+ _nimLogo = loadPictureSign(file, 30, 37);
+
+ file.close();
+}
+
+void GraphicManager::nimDrawStone(int x, int y) {
+ drawPicture(_surface, _nimStone, x, y);
+}
+
+void GraphicManager::nimDrawInitials() {
+ for (int i = 0; i < 3; i++)
+ drawPicture(_surface, _nimInitials[i], 0, 75 + i * 35);
+}
+
+void GraphicManager::nimDrawLogo() {
+ drawPicture(_surface, _nimLogo, 392, 5);
+}
+
+void GraphicManager::nimFree() {
+ _nimStone.free();
+ for (int i = 0; i < 3; i++)
+ _nimInitials[i].free();
+ _nimLogo.free();
+}
+
/**
* This function mimics Pascal's getimage().
*/
@@ -504,6 +552,41 @@ Graphics::Surface GraphicManager::loadPictureRaw(Common::File &file, uint16 widt
return picture;
}
+Graphics::Surface GraphicManager::loadPictureSign(Common::File &file, int xl, int yl) {
+ // I know it looks very similar to the other loadPicture methods, but in truth it's the combination of the two.
+ uint16 width = xl * 8;
+ uint16 height = yl;
+
+ Graphics::Surface picture; // We make a Surface object for the picture itself.
+ picture.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
+ // Produce the picture. We read it in row-by-row, and every row has 4 planes.
+ for (int yy = 0; yy < height; yy++) {
+ for (int8 plane = 0; plane < 4; plane++) { // The planes are in the "right" order.
+ for (uint16 xx = 0; xx < width; xx += 8) {
+ byte pixel = file.readByte();
+ for (int bit = 0; bit < 8; bit++) {
+ byte pixelBit = (pixel >> bit) & 1;
+ if (pixelBit != 0)
+ *(byte *)picture.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane);
+ }
+ }
+ }
+ }
+
+ return picture;
+}
+
+/**
+* Shifts the whole screen down by one line and fills the gap with black.
+*/
+void GraphicManager::shiftScreen() {
+ for (uint16 y = _surface.h - 1; y > 1; y--)
+ memcpy(_surface.getBasePtr(0, y), _surface.getBasePtr(0, y - 1), _surface.w);
+
+ _surface.drawLine(0, 0, _surface.w, 0, kColorBlack);
+}
+
void GraphicManager::clearAlso() {
_magics.fillRect(Common::Rect(0, 0, 640, 200), 0);
_magics.frameRect(Common::Rect(0, 45, 640, 161), 15);
@@ -573,7 +656,7 @@ void GraphicManager::drawPicture(Graphics::Surface &target, const Graphics::Surf
if (destX + maxX > target.w)
maxX = target.w - destX;
-
+
if (destY + maxY > target.h)
maxY = target.h - destY;
@@ -604,28 +687,10 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) {
if (!file.open(filename))
error("AVALANCHE: Scrolls: File not found: %s", filename.c_str());
- // I know it looks very similar to the loadPicture methods, but in truth it's the combination of the two.
- uint16 width = xl * 8;
- uint16 height = yl;
-
Graphics::Surface sign; // We make a Surface object for the picture itself.
- sign.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
-
- // Produce the picture. We read it in row-by-row, and every row has 4 planes.
- for (int yy = 0; yy < height; yy++) {
- for (int8 plane = 0; plane < 4; plane++) { // The planes are in the "right" order.
- for (uint16 xx = 0; xx < width; xx += 8) {
- byte pixel = file.readByte();
- for (int bit = 0; bit < 8; bit++) {
- byte pixelBit = (pixel >> bit) & 1;
- if (pixelBit != 0)
- *(byte *)sign.getBasePtr(xx + 7 - bit, yy) += (pixelBit << plane);
- }
- }
- }
- }
-
- drawPicture(_scrolls, sign, kScreenWidth / 2 - width / 2, y);
+ sign = loadPictureSign(file, xl, yl);
+ uint16 width = xl * 8;
+ drawPicture(_scrolls, sign, kScreenWidth / 2 - width / 2, y); // x coord: center the picture.
file.close();
}
@@ -669,7 +734,7 @@ void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[
drawTriangle(points, _talkBackgroundColor);
}
-/**
+/**
* Set the background of the text to the desired color.
*/
void GraphicManager::wipeChar(int x, int y, Color color) {
@@ -760,9 +825,12 @@ void GraphicManager::setDialogColor(Color bg, Color text) {
_talkFontColor = text;
}
-// Original name background()
-void GraphicManager::setBackgroundColor(Color x) {
- warning("STUB: setBackgroundColor()");
+/**
+* Changes the black color of the palette to the selected one.
+* @remarks Originally called 'background'
+*/
+void GraphicManager::setBackgroundColor(Color newColor) {
+ g_system->getPaletteManager()->setPalette(_egaPalette[kEgaPaletteIndex[newColor]], kColorBlack, 1);
}
} // End of namespace Avalanche
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 4af6d4e8db..ea3b621d69 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -58,6 +58,7 @@ public:
void loadDigits();
void loadMouse(byte which);
+ void drawLine(int x1, int y1, int x2, int y2, int penX, int penY, Color color);
Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color);
void drawTriangle(Common::Point *p, Color color);
@@ -77,18 +78,28 @@ public:
void drawChar(byte ander, int x, int y, Color color);
void drawDebugLines();
+ // For the mini-game "Nim".
+ void drawFilledRectangle(Common::Rect rect, Color color);
+ void drawRectangle(Common::Rect rect, Color color);
+ void nimLoad();
+ void nimDrawStone(int x, int y);
+ void nimDrawInitials();
+ void nimDrawLogo();
+ void nimFree();
+
+ // Used in wobble()
+ void shiftScreen();
+
void clearAlso();
void clearTextBar();
void setAlsoLine(int x1, int y1, int x2, int y2, Color color);
byte getAlsoColor(int x1, int y1, int x2, int y2);
byte getScreenColor(Common::Point pos);
- // The caller has to .free() the returned Surfaces!!!
- // Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
+ // Further information about this: http://www.shikadi.net/moddingwiki/Raw_EGA_data
Graphics::Surface loadPictureRaw(Common::File &file, uint16 width, uint16 height);
void drawSprite(AnimationType *sprite, byte picnum, int16 x, int16 y);
- void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);
void drawThinkPic(Common::String filename, int id);
void drawToolbar();
void drawCursor(byte pos);
@@ -100,7 +111,7 @@ public:
void refreshScreen();
void loadBackground(Common::File &file);
void refreshBackground();
- void setBackgroundColor(Color x);
+ void setBackgroundColor(Color newColor);
void setDialogColor(Color bg, Color text);
void zoomOut(int16 x, int16 y);
@@ -108,8 +119,8 @@ public:
void getNaturalPicture(SpriteType &sprite);
void saveScreen();
- void removeBackup();
void restoreScreen();
+ void removeBackup();
private:
static const uint16 kBackgroundWidth = kScreenWidth;
@@ -125,12 +136,23 @@ private:
Graphics::Surface _screen; // Only used in refreshScreen() to make it more optimized. (No recreation of it at every call of the function.)
Graphics::Surface _scrolls;
Graphics::Surface _surface;
+
+ // For the mini-game "Nim".
+ Graphics::Surface _nimStone;
+ Graphics::Surface _nimInitials[3];
+ Graphics::Surface _nimLogo;
+
byte _egaPalette[64][3];
AvalancheEngine *_vm;
+ // Further information about these two: http://www.shikadi.net/moddingwiki/Raw_EGA_data
Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
+ Graphics::Surface loadPictureSign(Common::File &file, int xl, int yl); // Reads a tricky type of picture used for the "game over"/"about" scrolls and in the mini-game Nim.
+
void drawText(Graphics::Surface &surface, const Common::String text, FontType font, byte fontHeight, int16 x, int16 y, Color color);
+ void drawPicture(Graphics::Surface &target, const Graphics::Surface picture, uint16 destX, uint16 destY);
+
// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
// Returns the end point of the arc. (Needed in Clock.)
// TODO: Make it more accurate later.
diff --git a/engines/avalanche/menu.cpp b/engines/avalanche/menu.cpp
index 7c37b79bc8..c3fa709ee4 100644
--- a/engines/avalanche/menu.cpp
+++ b/engines/avalanche/menu.cpp
@@ -64,7 +64,7 @@ void HeadType::highlight() {
// Force reload and redraw of cursor.
_menu->_vm->_currentMouse = 177;
-
+
}
bool HeadType::parseAltTrigger(char key) {
@@ -141,8 +141,8 @@ void MenuItem::display() {
void MenuItem::wipe() {
CursorMan.showMouse(false);
- _menu->drawMenuText(_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._xpos, 1,
- _menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._trigger,
+ _menu->drawMenuText(_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._xpos, 1,
+ _menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._trigger,
_menu->_menuBar._menuItems[_menu->_activeMenuItem._activeNum]._title, true, false);
_activeNow = false;
diff --git a/engines/avalanche/module.mk b/engines/avalanche/module.mk
index 9c1205df02..39ca94e3f8 100644
--- a/engines/avalanche/module.mk
+++ b/engines/avalanche/module.mk
@@ -15,7 +15,9 @@ MODULE_OBJS = \
dialogs.o \
sequence.o \
sound.o \
- timer.o
+ timer.o \
+ nim.o \
+ clock.o
# This module can be built as a plugin
ifeq ($(ENABLE_AVALANCHE), DYNAMIC_PLUGIN)
diff --git a/engines/avalanche/nim.cpp b/engines/avalanche/nim.cpp
new file mode 100644
index 0000000000..e4897a6d49
--- /dev/null
+++ b/engines/avalanche/nim.cpp
@@ -0,0 +1,575 @@
+/* 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 the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#include "avalanche/avalanche.h"
+#include "avalanche/nim.h"
+
+namespace Avalanche {
+
+const char * const Nim::kNames[2] = {"Avalot", "Dogfood"};
+
+Nim::Nim(AvalancheEngine *vm) {
+ _vm = vm;
+
+ resetVariables();
+}
+
+void Nim::resetVariables() {
+ _playedNim = 0;
+ _turns = 0;
+ _dogfoodsTurn = false;
+ _stonesLeft = 0;
+ _clicked = false;
+ _row = 0;
+ _number = 0;
+ _squeak = false;
+ _lmo = false;
+
+ for (int i = 0; i < 3; i++) {
+ _old[i] = 0;
+ _stones[i] = 0;
+ _inAp[i] = 0;
+ _r[i] = 0;
+ }
+}
+
+void Nim::synchronize(Common::Serializer &sz) {
+ if (sz.isLoading() && sz.getVersion() < 2)
+ return;
+
+ sz.syncAsByte(_playedNim);
+}
+
+void Nim::playNim() {
+ if (_vm->_wonNim) { // Already won the game.
+ _vm->_dialogs->displayScrollChain('Q', 6);
+ return;
+ }
+
+ if (!_vm->_askedDogfoodAboutNim) {
+ _vm->_dialogs->displayScrollChain('Q', 84);
+ return;
+ }
+
+ _vm->_dialogs->displayScrollChain('Q', 3);
+ _playedNim++;
+
+ _vm->_graphics->saveScreen();
+ _vm->fadeOut();
+
+ CursorMan.showMouse(false);
+ setup();
+ board();
+ //CursorMan.showMouse(true);
+
+ do {
+
+ startMove();
+ if (_dogfoodsTurn)
+ dogFood();
+ else {
+ CursorMan.showMouse(true);
+ takeSome();
+ CursorMan.showMouse(false);
+ }
+ _stones[_row] -= _number;
+ showChanges();
+ } while (_stonesLeft != 0);
+
+ endOfGame(); // Winning sequence is A1, B3, B1, C1, C1, btw.
+
+ _vm->fadeOut();
+ _vm->_graphics->restoreScreen();
+ _vm->_graphics->removeBackup();
+ _vm->fadeIn();
+ CursorMan.showMouse(true);
+
+ if (_dogfoodsTurn) {
+ // Dogfood won - as usual.
+ if (_playedNim == 1) // Your first game.
+ _vm->_dialogs->displayScrollChain('Q', 4); // Goody! Play me again?
+ else
+ _vm->_dialogs->displayScrollChain('Q', 5); // Oh, look at that! I've won again!
+ _vm->decreaseMoney(4); // And you've just lost 4d!
+ } else {
+ // You won - strange!
+ _vm->_dialogs->displayScrollChain('Q', 7);
+ _vm->_objects[kObjectLute - 1] = true;
+ _vm->refreshObjectList();
+ _vm->_wonNim = true;
+ _vm->_background->draw(-1, -1, 0); // Show the settle with no lute on it.
+
+ // 7 points for winning!
+ _vm->incScore(7);
+ }
+
+ if (_playedNim == 1) {
+ // 3 points for playing your 1st game.
+ _vm->incScore(3);
+ }
+}
+
+void Nim::chalk(int x, int y, Common::String text) {
+ const Color greys[] = { kColorBlack, kColorDarkgray, kColorLightgray, kColorWhite };
+
+ for (int i = 0; i < 4; i++) {
+ _vm->_graphics->drawNormalText(text, _vm->_font, 8, x - i, y, greys[i]);
+ _vm->_graphics->refreshScreen();
+ int freq = i * 100 * text.size();
+ if (freq == 0)
+ _vm->_system->delayMillis(3);
+ else
+ _vm->_sound->playNote(freq, 3);
+ _vm->_system->delayMillis(30);
+ }
+}
+
+void Nim::setup() {
+ _vm->fadeIn();
+ _vm->_graphics->nimLoad();
+
+ _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack);
+ // Upper left rectangle.
+ _vm->_graphics->drawRectangle(Common::Rect(10, 5, 381, 71), kColorRed);
+ _vm->_graphics->drawFilledRectangle(Common::Rect(11, 6, 380, 70), kColorBrown);
+ // Bottom right rectangle.
+ _vm->_graphics->drawRectangle(Common::Rect(394, 50, 635, 198), kColorRed);
+ _vm->_graphics->drawFilledRectangle(Common::Rect(395, 51, 634, 197), kColorBrown);
+
+ _vm->_graphics->nimDrawLogo();
+ _vm->_graphics->nimDrawInitials();
+
+ _vm->_graphics->drawNormalText("SCOREBOARD:", _vm->_font, 8, 475, 45, kColorWhite);
+ _vm->_graphics->drawNormalText("Turn:", _vm->_font, 8, 420, 55, kColorYellow);
+ _vm->_graphics->drawNormalText("Player:", _vm->_font, 8, 490, 55, kColorYellow);
+ _vm->_graphics->drawNormalText("Move:", _vm->_font, 8, 570, 55, kColorYellow);
+
+ chalk(27, 7, "Take pieces away with:");
+ chalk(77, 17, "1) the mouse (click leftmost)");
+ chalk(53, 27, "or 2) the keyboard:");
+ chalk(220, 27, Common::String(24) + '/' + 25 + ": choose row,");
+ chalk(164, 37, Common::String("+/- or ") + 27 + '/' + 26 + ": more/fewer,");
+ chalk(204, 47, "Enter: take stones.");
+
+ _vm->_graphics->refreshScreen();
+
+ for (int i = 0; i < 3; i++)
+ _stones[i] = i + 3;
+ _stonesLeft = 12;
+
+ _turns = 0;
+ _dogfoodsTurn = true;
+
+ _row = 0;
+ _number = 1;
+ for (int i = 0; i < 3; i++)
+ _old[i] = 0;
+}
+
+void Nim::board() {
+ _vm->_graphics->drawFilledRectangle(Common::Rect(57, 72, 393, 200), kColorBlack);
+ for (int i = 0; i < 3; i++)
+ for (int j = 0; j < _stones[i]; j++)
+ _vm->_graphics->nimDrawStone(64 + j * 8 * 8, 75 + i * 35);
+ // It's practically the body of the Pascal function "plotstone()", reimplemented.
+ // It's the only place where we use it, so there's no reason to keep it separated as a function.
+ _vm->_graphics->refreshScreen();
+}
+
+void Nim::startMove() {
+ _turns++;
+ Common::String turnsStr = Common::String::format("%d", _turns);
+ int y = 55 + _turns * 10;
+ _dogfoodsTurn = !_dogfoodsTurn;
+ chalk(433, y, turnsStr);
+ chalk(493, y, kNames[_dogfoodsTurn]);
+ for (int i = 0; i < 3; i++)
+ _old[i] = _stones[i];
+}
+
+void Nim::showChanges() {
+ chalk(573, 55 + _turns * 10, Common::String('A' + _row) + Common::String('0' + _number));
+ board();
+ _stonesLeft -= _number;
+}
+
+void Nim::blip() {
+ _vm->_sound->playNote(1771, 3);
+}
+
+void Nim::findNextUp() {
+ while (_stones[_row] == 0) {
+ _row--;
+ if (_row < 0)
+ _row = 2;
+ }
+
+ if (_number > _stones[_row])
+ _number = _stones[_row];
+}
+
+void Nim::findNextDown() {
+ while (_stones[_row] == 0) {
+ _row++;
+ if (_row > 2)
+ _row = 0;
+ }
+
+ if (_number > _stones[_row])
+ _number = _stones[_row];
+}
+
+bool Nim::checkInput() {
+ while (!_vm->shouldQuit()) {
+ _vm->_graphics->refreshScreen();
+ Common::Event event;
+ while (_vm->getEvent(event)) {
+ if (event.type == Common::EVENT_LBUTTONUP) {
+ Common::Point cursorPos = _vm->getMousePos();
+
+ int8 newRow = (cursorPos.y / 2 - 38) / 35 - 1;
+ if ((newRow < 0) || (newRow > 2)) {
+ blip();
+ return false;
+ }
+
+ int8 newNum = _stones[newRow] - ((cursorPos.x - 64) / 64);
+ if ((newNum < 1) || (newNum > _stones[newRow])) {
+ blip();
+ return false;
+ }
+
+ _number = newNum;
+ _row = newRow;
+
+ return true;
+ } else if (event.type == Common::EVENT_KEYDOWN) {
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP_PLUS:
+ if (_stones[_row] > _number)
+ _number++;
+ return false;
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP_MINUS:
+ if (_number > 1)
+ _number--;
+ return false;
+ case Common::KEYCODE_1:
+ _number = 1;
+ return false;
+ case Common::KEYCODE_2:
+ if (_stones[_row] >= 2)
+ _number = 2;
+ return false;
+ case Common::KEYCODE_3:
+ if (_stones[_row] >= 3)
+ _number = 3;
+ else
+ _number = _stones[_row];
+ return false;
+ case Common::KEYCODE_4:
+ if (_stones[_row] >= 4)
+ _number = 4;
+ else
+ _number = _stones[_row];
+ return false;
+ case Common::KEYCODE_5:
+ if (_stones[_row] == 5)
+ _number = 5;
+ else
+ _number = _stones[_row];
+ return false;
+ case Common::KEYCODE_HOME:
+ _number = _stones[_row];
+ return false;
+ case Common::KEYCODE_END:
+ _number = 1;
+ return false;
+ case Common::KEYCODE_UP:
+ _row--;
+ if (_row < 0)
+ _row = 2;
+ findNextUp();
+ return false;
+ case Common::KEYCODE_DOWN:
+ _row++;
+ if (_row > 2)
+ _row = 0;
+ findNextDown();
+ return false;
+ case Common::KEYCODE_a:
+ if (_stones[0] != 0) {
+ _row = 0;
+ if (_number > _stones[_row])
+ _number = _stones[_row];
+ }
+ return false;
+ case Common::KEYCODE_b:
+ if (_stones[1] != 0) {
+ _row = 1;
+ if (_number > _stones[_row])
+ _number = _stones[_row];
+ }
+ return false;
+ case Common::KEYCODE_c:
+ if (_stones[2] != 0) {
+ _row = 2;
+ if (_number > _stones[_row])
+ _number = _stones[_row];
+ }
+ return false;
+ case Common::KEYCODE_PAGEUP:
+ _row = 0;
+ findNextDown();
+ return false;
+ case Common::KEYCODE_PAGEDOWN:
+ _row = 2;
+ findNextUp();
+ return false;
+ case Common::KEYCODE_RETURN:
+ return true;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ return false;
+}
+
+void Nim::takeSome() {
+ _number = 1;
+
+ do {
+ byte sr;
+ do {
+ sr = _stones[_row];
+ if (sr == 0) {
+ if (_row == 2)
+ _row = 0;
+ else
+ _row++;
+ _number = 1;
+ }
+ } while (sr == 0);
+
+ if (_number > sr)
+ _number = sr;
+
+ int x1 = 63 + (_stones[_row] - _number) * 64;
+ int y1 = 38 + 35 * (_row + 1);
+ int x2 = 54 + _stones[_row] * 64;
+ int y2 = 63 + 35 * (_row + 1);
+ _vm->_graphics->drawRectangle(Common::Rect(x1, y1, x2, y2), kColorBlue); // Draw the selection rectangle.
+ _vm->_graphics->refreshScreen();
+
+ bool confirm = false;
+ do {
+ confirm = checkInput();
+
+ if (!confirm) {
+ _vm->_graphics->drawRectangle(Common::Rect(x1, y1, x2, y2), kColorBlack); // Erase the previous selection.
+ x1 = 63 + (_stones[_row] - _number) * 64;
+ y1 = 38 + 35 * (_row + 1);
+ x2 = 54 + _stones[_row] * 64;
+ y2 = 63 + 35 * (_row + 1);
+ _vm->_graphics->drawRectangle(Common::Rect(x1, y1, x2, y2), kColorBlue); // Draw the new one.
+ _vm->_graphics->refreshScreen();
+ }
+ } while (!confirm);
+
+ return;
+
+ } while (true);
+}
+
+void Nim::endOfGame() {
+ chalk(595, 55 + _turns * 10, "Wins!");
+ _vm->_graphics->drawNormalText("- - - Press any key... - - -", _vm->_font, 8, 100, 190, kColorWhite);
+
+ Common::Event event;
+ bool escape = false;
+ while (!_vm->shouldQuit() && !escape) {
+ _vm->_graphics->refreshScreen();
+ while (_vm->getEvent(event)) {
+ if ((event.type == Common::EVENT_LBUTTONUP) || (event.type == Common::EVENT_KEYDOWN)) {
+ escape = true;
+ break;
+ }
+ }
+ }
+
+ _vm->_graphics->nimFree();
+}
+
+bool Nim::find(byte x) {
+ bool ret = false;
+ for (int i = 0; i < 3; i++) {
+ if (_stones[i] == x) {
+ ret = true;
+ _inAp[i] = true;
+ }
+ }
+ return ret;
+}
+
+void Nim::findAp(byte start, byte stepSize) {
+ byte thisOne = 0;
+ byte matches = 0;
+
+ for (int i = 0; i < 3; i++)
+ _inAp[i] = 0; // Blank 'em all!
+
+ for (int i = 0; i < 3; i++) {
+ if (find(start + i * stepSize))
+ matches++;
+ else
+ thisOne = i;
+ }
+
+ // Now... Matches must be 0, 1, 2, or 3.
+ // 0 / 1 mean there are no A.P.s here, so we'll keep looking,
+ // 2 means there is a potential A.P.that we can create (ideal!), and
+ // 3 means that we're already in an A.P. (Trouble!)
+
+ byte ooo = 0; // Odd one out.
+
+ switch (matches) {
+ case 2:
+ for (int i = 0; i < 3; i++) { // Find which one didn't fit the A.P.
+ if (!_inAp[i])
+ ooo = i;
+ }
+
+ if (_stones[ooo] > (start + thisOne * stepSize)) { // Check if it's possible!
+ // Create an A.P.
+ _row = ooo; // Already calculated.
+ // Start + thisone * stepsize will give the amount we SHOULD have here.
+ _number = _stones[_row] - (start + thisOne * stepSize);
+ _lmo = true;
+ return;
+ }
+ break;
+ case 3: // We're actually IN an A.P! Trouble! Oooh dear.
+ // Take 1 from the largest pile.
+ _row = _r[2];
+ _number = 1;
+ _lmo = true;
+ return;
+ default:
+ break;
+ }
+}
+
+void Nim::dogFood() {
+ _lmo = false;
+ byte live = 0;
+ byte sr[3];
+
+ for (int i = 0; i < 3; i++) {
+ if (_stones[i] > 0) {
+ _r[live] = i;
+ sr[live] = _stones[i];
+ live++;
+ }
+ }
+
+ switch (live) {
+ case 1: // Only one is free - so take 'em all!
+ _row = _r[0];
+ _number = _stones[_r[0]];
+ return;
+ case 2: // Two are free - make them equal!
+ if (sr[0] > sr[1]) { // T > b
+ _row = _r[0];
+ _number = sr[0] - sr[1];
+ }
+ else if (sr[0] < sr[1]) { // B > t
+ _row = _r[1];
+ _number = sr[1] - sr[0];
+ }
+ else { // B = t... oh no, we've lost!
+ _row = _r[0];
+ _number = 1;
+ }
+ return;
+ case 3: {
+ // Ho hum... this'll be difficult!
+ // There are three possible courses of action when we have 3 lines left:
+ // 1) Look for 2 equal lines, then take the odd one out.
+ // 2) Look for A.P.s, and capitalise on them.
+ // 3) Go any old where.
+ const byte other[3][2] = { { 2, 3 }, { 1, 3 }, { 1, 2 } };
+
+ for (int i = 0; i < 3; i++) { // Look for 2 equal lines.
+ if (_stones[other[i][0]] == _stones[other[i][1]]) {
+ _row = i; // This row.
+ _number = _stones[i]; // All of 'em.
+ return;
+ }
+ }
+
+ bool sorted;
+ do {
+ sorted = true;
+ for (int i = 0; i < 2; i++) {
+ if (sr[i] > sr[i + 1]) {
+ byte temp = sr[i + 1];
+ sr[i + 1] = sr[i];
+ sr[i] = temp;
+
+ temp = _r[i + 1];
+ _r[i + 1] = _r[i];
+ _r[i] = temp;
+
+ sorted = false;
+ }
+ }
+ } while (!sorted);
+
+ // Now we look for A.P.s...
+ for (int i = 1; i <= 3; i++) {
+ findAp(i, 1); // There are 3 "1"s.
+ if (_lmo)
+ return; // Cut - out.
+ }
+ findAp(1, 2); // Only "2" possible.
+ if (_lmo)
+ return;
+
+ // A.P.search must have failed - use the default move.
+ _row = _r[2];
+ _number = 1;
+ return;
+ }
+ default:
+ break;
+ }
+}
+
+} // End of namespace Avalanche
diff --git a/engines/avalanche/nim.h b/engines/avalanche/nim.h
new file mode 100644
index 0000000000..7e5f55e69f
--- /dev/null
+++ b/engines/avalanche/nim.h
@@ -0,0 +1,79 @@
+/* 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 the original source code of Lord Avalot d'Argent version 1.3.
+ * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
+ */
+
+#ifndef AVALANCHE_NIM_H
+#define AVALANCHE_NIM_H
+
+namespace Avalanche {
+
+class Nim {
+public:
+ Nim(AvalancheEngine *vm);
+ void resetVariables();
+ void synchronize(Common::Serializer &sz);
+ void playNim();
+
+private:
+ AvalancheEngine *_vm;
+
+ static const char * const kNames[2];
+
+ byte _old[3];
+ byte _stones[3];
+ byte _turns;
+ bool _dogfoodsTurn;
+ byte _stonesLeft;
+ bool _clicked;
+ int8 _row;
+ byte _number;
+ bool _squeak;
+ byte _playedNim; // How many times you've played Nim.
+
+ // Inner variables for dogFood(), find() and findAp().
+ bool _inAp[3];
+ bool _lmo; // Let Me Out!
+ byte _r[3];
+
+ void chalk(int x, int y, Common::String text);
+ void setup();
+ void board();
+ void startMove();
+ void showChanges();
+ void blip();
+ void findNextUp(); // Inner function for checkInput().
+ void findNextDown(); // Same as above.
+ bool checkInput(); // It returns TRUE if the player confirmed his selection of stones either by pressing RETURN or by clicking on a stone.
+ void takeSome();
+ void endOfGame();
+ bool find(byte x); // This gives TRUE if there's a pile with x stones in.
+ void findAp(byte start, byte stepSize);
+ void dogFood(); // AI procedure to play the game.
+};
+
+} // End of namespace Avalanche
+
+#endif // AVALANCHE_NIM_H
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 6090dc967a..b0524a0d7e 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -27,6 +27,7 @@
#include "avalanche/avalanche.h"
#include "avalanche/parser.h"
+#include "avalanche/nim.h"
#include "gui/saveload.h"
@@ -50,7 +51,7 @@ Parser::Parser(AvalancheEngine *vm) {
_thing2 = 0;
_sworeNum = 0;
_alcoholLevel = 0;
- _playedNim = 0;
+
_boughtOnion = false;
}
@@ -521,10 +522,17 @@ void Parser::cursorOff() {
_cursorState = false;
}
+/**
+ * Asks the parsekey proc in Dropdown if it knows it.
+ */
void Parser::tryDropdown() {
- warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown's keyboard handling.
+ // TODO: Implement at the same time with Dropdown's keyboard handling.
+ warning("STUB: Parser::tryDropdown()");
}
+/**
+ * Returns the index of the first appearance of crit in src.
+ */
int16 Parser::getPos(const Common::String &crit, const Common::String &src) {
if (src.contains(crit))
return strstr(src.c_str(),crit.c_str()) - src.c_str();
@@ -624,6 +632,9 @@ void Parser::cheatParse(Common::String codes) {
warning("STUB: Parser::cheatParse()");
}
+/**
+ * Strips punctuation from word.
+ */
void Parser::stripPunctuation(Common::String &word) {
const char punct[] = "~`!@#$%^&*()_+-={}[]:\"|;'\\,./<>?";
@@ -732,7 +743,7 @@ void Parser::storeInterrogation(byte interrogation) {
if (!_vm->_spareEvening.empty())
_vm->_spareEvening.clear();
_vm->_spareEvening = _inputText;
- _vm->_dialogs->displayScrollChain('z', 5); // His closing statement...
+ _vm->_dialogs->displayScrollChain('Z', 5); // His closing statement...
_vm->_animation->_sprites[1]->walkTo(3); // The end of the drawbridge
_vm->_animation->_sprites[1]->_vanishIfStill = true; // Then go away!
_vm->_magics[1]._operation = kMagicNothing;
@@ -748,8 +759,6 @@ void Parser::storeInterrogation(byte interrogation) {
_vm->_timer->cardiffSurvey();
}
-
-
void Parser::parse() {
// First parsing - word identification
if (!_thats.empty())
@@ -762,7 +771,6 @@ void Parser::parse() {
_person = kPeoplePardon;
clearWords();
-
// A cheat mode attempt.
if (_inputText[0] == '.') {
cheatParse(_inputText);
@@ -925,7 +933,7 @@ void Parser::parse() {
_polite = true;
}
- if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) &&
+ if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) &&
(_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
_vm->_dialogs->displayText(tmpStr);
@@ -947,6 +955,9 @@ void Parser::parse() {
}
}
+/**
+ * Examine a standard object-thing
+ */
void Parser::examineObject() {
if (_thing != _vm->_thinks)
_vm->thinkAbout(_thing, AvalancheEngine::kThing);
@@ -956,29 +967,29 @@ void Parser::examineObject() {
switch (_vm->_wineState) {
case 1:
// Normal examine wine scroll
- _vm->_dialogs->displayScrollChain('t', 1);
+ _vm->_dialogs->displayScrollChain('T', 1);
break;
case 2:
// Bad wine
- _vm->_dialogs->displayScrollChain('d', 6);
+ _vm->_dialogs->displayScrollChain('D', 6);
break;
case 3:
// Vinegar
- _vm->_dialogs->displayScrollChain('d', 7);
+ _vm->_dialogs->displayScrollChain('D', 7);
break;
}
break;
case kObjectOnion:
if (_vm->_rottenOnion)
// Yucky onion
- _vm->_dialogs->displayScrollChain('q', 21);
+ _vm->_dialogs->displayScrollChain('Q', 21);
else
// Normal onion
- _vm->_dialogs->displayScrollChain('t', 18);
+ _vm->_dialogs->displayScrollChain('T', 18);
break;
default:
// Ordinarily
- _vm->_dialogs->displayScrollChain('t', _thing);
+ _vm->_dialogs->displayScrollChain('T', _thing);
}
}
@@ -1011,7 +1022,7 @@ void Parser::exampers() {
// He's asleep.
_vm->_dialogs->displayScrollChain('Q', 65);
else
- _vm->_dialogs->displayScrollChain('p', newPerson);
+ _vm->_dialogs->displayScrollChain('P', newPerson);
if ((_person == kPeopleAyles) && !_vm->_aylesIsAwake)
_vm->_dialogs->displayScrollChain('Q', 13);
@@ -1029,6 +1040,8 @@ bool Parser::isHolding() {
// Also object
if ((51 <= _thing) && (_thing <= 99))
return true;
+ if (_thing == 0)
+ return false;
bool holdingResult = false;
@@ -1131,7 +1144,7 @@ void Parser::swallow() {
return;
}
_vm->_dialogs->displayScrollChain('U', 1);
- _vm->_pingo->wobble();
+ _vm->_animation->wobble();
_vm->_dialogs->displayScrollChain('U', 2);
_vm->_objects[kObjectWine - 1] = false;
_vm->refreshObjectList();
@@ -1140,7 +1153,7 @@ void Parser::swallow() {
case 2:
case 3:
// You can't drink it!
- _vm->_dialogs->displayScrollChain('d', 8);
+ _vm->_dialogs->displayScrollChain('D', 8);
break;
}
break;
@@ -1177,6 +1190,9 @@ void Parser::swallow() {
}
}
+/**
+ * this lists the other people in the room.
+ */
void Parser::peopleInRoom() {
// First compute the number of people in the room.
byte numPeople = 0;
@@ -1214,42 +1230,45 @@ void Parser::peopleInRoom() {
_vm->_dialogs->displayText(tmpStr + " here.");
}
+/**
+ * This is called when you say "look".
+ */
void Parser::lookAround() {
_vm->_dialogs->displayText(*_vm->_also[0][1]);
switch (_vm->_room) {
case kRoomSpludwicks:
if (_vm->_avariciusTalk > 0)
- _vm->_dialogs->displayScrollChain('q', 23);
+ _vm->_dialogs->displayScrollChain('Q', 23);
else
peopleInRoom();
break;
case kRoomRobins:
if (_vm->_tiedUp)
- _vm->_dialogs->displayScrollChain('q', 38);
+ _vm->_dialogs->displayScrollChain('Q', 38);
if (_vm->_mushroomGrowing)
- _vm->_dialogs->displayScrollChain('q', 55);
+ _vm->_dialogs->displayScrollChain('Q', 55);
break;
case kRoomInsideCardiffCastle:
if (!_vm->_takenPen)
- _vm->_dialogs->displayScrollChain('q', 49);
+ _vm->_dialogs->displayScrollChain('Q', 49);
break;
case kRoomLustiesRoom:
if (_vm->_lustieIsAsleep)
- _vm->_dialogs->displayScrollChain('q', 65);
+ _vm->_dialogs->displayScrollChain('Q', 65);
break;
case kRoomCatacombs:
switch (_vm->_catacombY * 256 + _vm->_catacombX) {
case 258 :
// Inside art gallery.
- _vm->_dialogs->displayScrollChain('q', 80);
+ _vm->_dialogs->displayScrollChain('Q', 80);
break;
case 514 :
// Outside ditto.
- _vm->_dialogs->displayScrollChain('q', 81);
+ _vm->_dialogs->displayScrollChain('Q', 81);
break;
case 260 :
// Outside Geida's room.
- _vm->_dialogs->displayScrollChain('q', 82);
+ _vm->_dialogs->displayScrollChain('Q', 82);
break;
}
break;
@@ -1272,7 +1291,7 @@ void Parser::openDoor() {
break;
case kRoomSpludwicks:
if (_thing == 61) {
- _vm->_dialogs->displayScrollChain('q', 85);
+ _vm->_dialogs->displayScrollChain('Q', 85);
return;
}
break;
@@ -1290,7 +1309,7 @@ void Parser::openDoor() {
switch (portal->_operation) {
case kMagicExclaim:
_vm->_animation->_sprites[0]->bounce();
- _vm->_dialogs->displayScrollChain('x', portal->_data);
+ _vm->_dialogs->displayScrollChain('X', portal->_data);
break;
case kMagicTransport:
_vm->flipRoom((Room)((portal->_data) >> 8), portal->_data & 0x0F);
@@ -1318,6 +1337,9 @@ void Parser::openDoor() {
_vm->_dialogs->displayText("Door? What door?");
}
+/**
+ * Called when you call kVerbCodeput.
+ */
void Parser::putProc() {
if (!isHolding())
return;
@@ -1346,7 +1368,7 @@ void Parser::putProc() {
// Put onion into vinegar! Yes!
_vm->_onionInVinegar = true;
_vm->incScore(7);
- _vm->_dialogs->displayScrollChain('u', 9);
+ _vm->_dialogs->displayScrollChain('U', 9);
}
}
} else
@@ -1424,6 +1446,7 @@ void Parser::goToCauldron() {
/**
* Check is it's possible to give something to Spludwick
+ * The result of this function is whether or not he says "Hey, thanks!".
* @remarks Originally called 'give2spludwick'
*/
bool Parser::giveToSpludwick() {
@@ -1436,10 +1459,10 @@ bool Parser::giveToSpludwick() {
case kObjectOnion:
_vm->_objects[kObjectOnion - 1] = false;
if (_vm->_rottenOnion)
- _vm->_dialogs->displayScrollChain('q', 22);
+ _vm->_dialogs->displayScrollChain('Q', 22);
else {
_vm->_givenToSpludwick++;
- _vm->_dialogs->displayScrollChain('q', 20);
+ _vm->_dialogs->displayScrollChain('Q', 20);
goToCauldron();
_vm->incScore(3);
}
@@ -1449,13 +1472,13 @@ bool Parser::giveToSpludwick() {
_vm->_objects[kObjectInk - 1] = false;
_vm->refreshObjectList();
_vm->_givenToSpludwick++;
- _vm->_dialogs->displayScrollChain('q', 24);
+ _vm->_dialogs->displayScrollChain('Q', 24);
goToCauldron();
_vm->incScore(3);
break;
case kObjectMushroom:
_vm->_objects[kObjectMushroom - 1] = false;
- _vm->_dialogs->displayScrollChain('q', 25);
+ _vm->_dialogs->displayScrollChain('Q', 25);
_vm->incScore(5);
_vm->_givenToSpludwick++;
goToCauldron();
@@ -1503,6 +1526,9 @@ void Parser::already() {
_vm->_dialogs->displayText("You're already standing!");
}
+/**
+ * Called when you ask Avvy to stand.
+ */
void Parser::standUp() {
switch (_vm->_room) {
case kRoomYours:
@@ -1510,9 +1536,9 @@ void Parser::standUp() {
if (_vm->_avvyIsAwake && _vm->_avvyInBed) {
// But he's in bed.
if (_vm->_teetotal) {
- _vm->_dialogs->displayScrollChain('d', 12);
+ _vm->_dialogs->displayScrollChain('D', 12);
_vm->_graphics->setBackgroundColor(kColorBlack);
- _vm->_dialogs->displayScrollChain('d', 14);
+ _vm->_dialogs->displayScrollChain('D', 14);
}
_vm->_animation->_sprites[0]->_visible = true;
_vm->_userMovesAvvy = true;
@@ -1567,7 +1593,7 @@ void Parser::getProc(char thing) {
_vm->_dialogs->displayText(tmpStr);
}
} else
- _vm->_dialogs->displayScrollChain('q', 57);
+ _vm->_dialogs->displayScrollChain('Q', 57);
break;
case kRoomInsideCardiffCastle:
switch (thing) {
@@ -1588,15 +1614,15 @@ void Parser::getProc(char thing) {
_vm->_dialogs->displayText("Taken.");
}
} else if (_vm->_standingOnDais)
- _vm->_dialogs->displayScrollChain('q', 53);
+ _vm->_dialogs->displayScrollChain('Q', 53);
else
- _vm->_dialogs->displayScrollChain('q', 51);
+ _vm->_dialogs->displayScrollChain('Q', 51);
break;
case kObjectBolt:
- _vm->_dialogs->displayScrollChain('q', 52);
+ _vm->_dialogs->displayScrollChain('Q', 52);
break;
default:
- _vm->_dialogs->displayScrollChain('q', 57);
+ _vm->_dialogs->displayScrollChain('Q', 57);
}
break;
case kRoomRobins:
@@ -1609,10 +1635,10 @@ void Parser::getProc(char thing) {
_vm->refreshObjectList();
_vm->incScore(3);
} else
- _vm->_dialogs->displayScrollChain('q', 57);
+ _vm->_dialogs->displayScrollChain('Q', 57);
break;
default:
- _vm->_dialogs->displayScrollChain('q', 57);
+ _vm->_dialogs->displayScrollChain('Q', 57);
}
}
@@ -1629,7 +1655,7 @@ void Parser::giveGeidaTheLute() {
_vm->_objects[kObjectLute - 1] = false;
_vm->refreshObjectList();
// She plays it.
- _vm->_dialogs->displayScrollChain('q', 64);
+ _vm->_dialogs->displayScrollChain('Q', 64);
_vm->_timer->addTimer(1, Timer::kProcGiveLuteToGeida, Timer::kReasonGeidaSings);
//_vm->_enid->backToBootstrap(4); TODO: Replace it with proper ScummVM-friendly function(s)! Do not remove until then!
@@ -1643,7 +1669,7 @@ void Parser::playHarp() {
}
void Parser::winSequence() {
- _vm->_dialogs->displayScrollChain('q', 78);
+ _vm->_dialogs->displayScrollChain('Q', 78);
_vm->_sequence->startWinSeq();
_vm->_timer->addTimer(30, Timer::kProcWinning, Timer::kReasonWinning);
}
@@ -1668,6 +1694,10 @@ void Parser::doThat() {
// "Slip" object
_thing -= 49;
+ if (_vm->_tiedUp) {
+ _vm->_dialogs->displayText("You better stay quiet now!");
+ return;
+ }
if ((_verb != kVerbCodeLoad) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeQuit) && (_verb != kVerbCodeInfo) && (_verb != kVerbCodeHelp)
&& (_verb != kVerbCodeLarrypass) && (_verb != kVerbCodePhaon) && (_verb != kVerbCodeBoss) && (_verb != kVerbCodeCheat) && (_verb != kVerbCodeRestart)
@@ -1677,7 +1707,7 @@ void Parser::doThat() {
"Try restarting, or restoring a saved game!");
return;
}
- if (!_vm->_avvyIsAwake && (_verb != kVerbCodeDie) && (_verb != kVerbCodeExpletive) && (_verb != kVerbCodeWake)) {
+ if (!_vm->_avvyIsAwake && (_verb != kVerbCodeWake)) {
_vm->_dialogs->displayText("Talking in your sleep? Try waking up!");
return;
}
@@ -1690,7 +1720,7 @@ void Parser::doThat() {
case kVerbCodeOpen:
openDoor();
break;
- case kVerbCodePause: {
+ case kVerbCodePause: {
// Note that the original game doesn't care about the "O.K." box neither, it accepts
// clicks from everywhere on the screen to continue. Just like my code.
Common::String tmpStr = Common::String::format("Game paused.%c%c%cPress Enter, Esc, or click the mouse on the `O.K.\" " \
@@ -1782,7 +1812,7 @@ void Parser::doThat() {
break;
case kPeopleIbythneth:
if (_thing == kObjectBadge) {
- _vm->_dialogs->displayScrollChain('q', 32); // Thanks! Wow!
+ _vm->_dialogs->displayScrollChain('Q', 32); // Thanks! Wow!
_vm->incScore(3);
_vm->_objects[kObjectBadge - 1] = false;
_vm->_objects[kObjectHabit - 1] = true;
@@ -1796,7 +1826,7 @@ void Parser::doThat() {
if (_vm->_aylesIsAwake) {
if (_thing == kObjectPen) {
_vm->_objects[kObjectPen - 1] = false;
- _vm->_dialogs->displayScrollChain('q', 54);
+ _vm->_dialogs->displayScrollChain('Q', 54);
_vm->_objects[kObjectInk - 1] = true;
_vm->_givenPenToAyles = true;
_vm->refreshObjectList();
@@ -1811,7 +1841,7 @@ void Parser::doThat() {
case kObjectPotion:
_vm->_objects[kObjectPotion - 1] = false;
// She drinks it.
- _vm->_dialogs->displayScrollChain('u', 16);
+ _vm->_dialogs->displayScrollChain('U', 16);
_vm->incScore(2);
_vm->_givenPotionToGeida = true;
_vm->refreshObjectList();
@@ -1830,7 +1860,7 @@ void Parser::doThat() {
winSequence();
else
// That Geida woman!
- _vm->_dialogs->displayScrollChain('q', 77);
+ _vm->_dialogs->displayScrollChain('Q', 77);
break;
default:
_vm->_dialogs->sayThanks(_thing - 1);
@@ -1860,7 +1890,7 @@ void Parser::doThat() {
if (savegameId < 0)
// dialog aborted, nothing to load
return;
-
+
_vm->loadGame(savegameId);
}
break;
@@ -1964,45 +1994,7 @@ void Parser::doThat() {
// They just typed "play"...
switch (_vm->_room) {
case kRoomArgentPub:
- // ...in the pub, => play Nim.
- warning("STUB: Parser::doThat() - case kVerbCodeplay - play_nim()");
- // play_nim();
-
- // The following parts are copied from play_nim().
- // The player automatically wins the game everytime he wins, until I implement the mini-game.
- if (_vm->_wonNim) { // Already won the game.
- _vm->_dialogs->displayScrollChain('Q', 6);
- return;
- }
-
- if (!_vm->_askedDogfoodAboutNim) {
- _vm->_dialogs->displayScrollChain('q', 84);
- return;
- }
-
- _vm->_dialogs->displayScrollChain('Q', 3);
- _playedNim++;
-
- // You won - strange!
-
- // You won! Give us a lute!
- _vm->_dialogs->displayScrollChain('Q', 7);
- _vm->_objects[kObjectLute - 1] = true;
- _vm->refreshObjectList();
- _vm->_wonNim = true;
- // Show the settle with no lute on it.
- _vm->_background->draw(-1, -1, 0);
- // 7 points for winning!
- _vm->incScore(7);
-
- if (_playedNim == 1)
- // 3 points for playing your 1st game.
- _vm->incScore(3);
-
- // A warning to the player that there should have been a mini-game. TODO: Remove it later!!!
- _vm->_dialogs->displayText(Common::String("P.S.: There should have been the mini-game called \"Nim\", " \
- "but I haven't implemented it yet: you win and get the lute automatically.")
- + kControlNewLine + kControlNewLine + "Peter (uruk)");
+ _vm->_nim->playNim(); // ...in the pub, => play Nim.
break;
case kRoomMusicRoom:
playHarp();
@@ -2081,13 +2073,13 @@ void Parser::doThat() {
break;
case kVerbCodeMagic:
if (_vm->_avariciusTalk > 0)
- _vm->_dialogs->displayScrollChain('q', 19);
+ _vm->_dialogs->displayScrollChain('Q', 19);
else {
if ((_vm->_room == kRoomSpludwicks) & (_vm->_animation->inField(1))) {
// Avaricius appears!
- _vm->_dialogs->displayScrollChain('q', 17);
+ _vm->_dialogs->displayScrollChain('Q', 17);
if (_vm->getRoom(kPeopleSpludwick) == kRoomSpludwicks)
- _vm->_dialogs->displayScrollChain('q', 18);
+ _vm->_dialogs->displayScrollChain('Q', 18);
else {
Avalanche::AnimationType *spr = _vm->_animation->_sprites[1];
// Avaricius
@@ -2121,7 +2113,7 @@ void Parser::doThat() {
}
break;
default: {
- _vm->_pingo->zonk();
+ _vm->_animation->thunder();
Common::String tmpStr = Common::String::format("A crack of lightning shoots from the sky, and fries you." \
"%c%c(`Such is the anger of the gods, Avvy!\")", kControlNewLine, kControlNewLine);
_vm->_dialogs->displayText(tmpStr);
@@ -2241,7 +2233,7 @@ void Parser::doThat() {
case kRoomNottsPub:
// Can't sell to southerners.
- _vm->_dialogs->displayScrollChain('n', 15);
+ _vm->_dialogs->displayScrollChain('N', 15);
break;
default:
// Can't buy that.
@@ -2317,7 +2309,7 @@ void Parser::doThat() {
break;
case kVerbCodeScore: {
Common::String tmpStr = Common::String::format("Your score is %d,%c%cout of a possible 128.%c%c " \
- "This gives you a rank of %s.%c%c%s", _vm->_dnascore, kControlCenter, kControlNewLine, kControlNewLine,
+ "This gives you a rank of %s.%c%c%s", _vm->_dnascore, kControlCenter, kControlNewLine, kControlNewLine,
kControlNewLine, rank().c_str(), kControlNewLine, kControlNewLine, totalTime().c_str());
_vm->_dialogs->displayText(tmpStr);
}
@@ -2378,7 +2370,7 @@ void Parser::doThat() {
// Picture of Avvy, awake in bed.
_vm->_background->draw(-1, -1, 2);
if (_vm->_teetotal)
- _vm->_dialogs->displayScrollChain('d', 13);
+ _vm->_dialogs->displayScrollChain('D', 13);
} else
_vm->_dialogs->displayText("You're already awake, Avvy!");
break;
@@ -2479,7 +2471,6 @@ void Parser::resetVariables() {
_wearing = kNothing;
_sworeNum = 0;
_alcoholLevel = 0;
- _playedNim = 0;
_boughtOnion = false;
}
@@ -2487,7 +2478,10 @@ void Parser::synchronize(Common::Serializer &sz) {
sz.syncAsByte(_wearing);
sz.syncAsByte(_sworeNum);
sz.syncAsByte(_alcoholLevel);
- sz.syncAsByte(_playedNim);
+ if (sz.isLoading() && sz.getVersion() < 2) {
+ int dummy;
+ sz.syncAsByte(dummy);
+ }
sz.syncAsByte(_boughtOnion);
}
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index bdb5ab9bc1..20066329e5 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -34,17 +34,16 @@
#include "common/str.h"
#include "common/serializer.h"
-
namespace Avalanche {
class AvalancheEngine;
class Parser {
public:
- static const byte kPardon = 254; // Didn't understand / wasn't given.
static const int16 kParserWordsNum = 277; // How many words does the parser know?
+ static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
+ static const byte kPardon = 254; // Didn't understand / wasn't given.
static const byte kNothing = 250;
- static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
- static const int16 kFirstPassword = 88; // words[kFirstPassword] should equal "TIROS".
+ static const byte kMoved = 0; // This word was moved. (Usually because it was the subject of conversation.)
struct VocabEntry {
byte _number;
@@ -63,9 +62,9 @@ public:
byte _thing;
People _person;
bool _polite;
- Common::String _inputText; // Original name: current
+ Common::String _inputText;
Common::String _inputTextBackup;
- byte _inputTextPos; // Original name: curpos
+ byte _inputTextPos;
bool _quote;
bool _cursorState;
bool _weirdWord;
@@ -87,8 +86,8 @@ public:
void plotText();
void cursorOn();
void cursorOff();
- void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
- int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+ void tryDropdown();
+ int16 getPos(const Common::String &crit, const Common::String &src);
void doVerb(VerbCode id);
void resetVariables();
@@ -107,10 +106,9 @@ private:
Common::String _thats;
byte _thing2;
- byte _sworeNum; // number of times you've sworn
+ byte _sworeNum; // number of times you've sworn
byte _alcoholLevel; // Your blood alcohol level.
- byte _playedNim; // How many times you've played Nim.
- bool _boughtOnion; // Have you bought an onion yet?
+ bool _boughtOnion; // Have you bought an onion yet?
byte wordNum(Common::String word);
void replace(Common::String oldChars, byte newChar);
@@ -120,14 +118,14 @@ private:
void clearWords();
void cheatParse(Common::String codes);
- void stripPunctuation(Common::String &word); // Strips punctuation from word.
- void displayWhat(byte target, bool animate, bool &ambiguous); // << It's an adjective!
+ void stripPunctuation(Common::String &word);
+ void displayWhat(byte target, bool animate, bool &ambiguous);
bool doPronouns();
void properNouns();
- void lookAround(); // This is called when you say "look".
+ void lookAround();
void openDoor();
void storeInterrogation(byte interrogation);
- void examineObject(); // Examine a standard object-thing
+ void examineObject();
bool isPersonHere();
void exampers();
bool isHolding();
@@ -135,14 +133,14 @@ private:
void examine();
void inventory();
void swallow();
- void peopleInRoom(); // This lists the other people in the room.
- void putProc(); // Called when you call kVerbCodeput.
+ void peopleInRoom();
+ void putProc();
void notInOrder();
void goToCauldron();
- bool giveToSpludwick(); // The result of this fn is whether or not he says "Hey, thanks!".
+ bool giveToSpludwick();
void cardiffClimbing();
void already();
- void standUp(); // Called when you ask Avvy to stand.
+ void standUp();
void getProc(char thing);
void giveGeidaTheLute();
void playHarp();
diff --git a/engines/avalanche/pingo.cpp b/engines/avalanche/pingo.cpp
index 433924f594..40467ab839 100644
--- a/engines/avalanche/pingo.cpp
+++ b/engines/avalanche/pingo.cpp
@@ -56,18 +56,6 @@ void Pingo::copyPage(byte frp, byte top) { // taken from Copy02 (above)
warning("STUB: Pingo::copyPage()");
}
-void Pingo::wobble() {
- warning("STUB: Pingo::wobble()");
-}
-
-void Pingo::zl(int16 x1, int16 y1, int16 x2, int16 y2) {
- warning("STUB: Pingo::zl()");
-}
-
-void Pingo::zonk() {
- warning("STUB: Pingo::zonk()");
-}
-
void Pingo::winningPic() {
Common::File f;
_vm->fadeOut();
diff --git a/engines/avalanche/pingo.h b/engines/avalanche/pingo.h
index 72fdb54c2a..6eecaf6453 100644
--- a/engines/avalanche/pingo.h
+++ b/engines/avalanche/pingo.h
@@ -43,15 +43,12 @@ public:
void copy02();
void copy03();
void copyPage(byte frp, byte top);
- void wobble();
- void zonk();
void winningPic();
private:
AvalancheEngine *_vm;
void dPlot(int16 x, int16 y, Common::String z);
- void zl(int16 x1, int16 y1, int16 x2, int16 y2);
};
} // End of namespace Avalanche.
diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp
index 8a4aa1c055..c8ea820c0e 100644
--- a/engines/avalanche/timer.cpp
+++ b/engines/avalanche/timer.cpp
@@ -201,7 +201,7 @@ void Timer::updateTimer() {
}
}
}
-
+
_vm->_roomCycles++; // Cycles since you've been in this room.
}
@@ -224,7 +224,7 @@ void Timer::openDrawbridge() {
}
void Timer::avariciusTalks() {
- _vm->_dialogs->displayScrollChain('q', _vm->_avariciusTalk);
+ _vm->_dialogs->displayScrollChain('Q', _vm->_avariciusTalk);
_vm->_avariciusTalk++;
if (_vm->_avariciusTalk < 17)
@@ -267,25 +267,25 @@ void Timer::stairs() {
void Timer::cardiffSurvey() {
if (_vm->_cardiffQuestionNum == 0) {
_vm->_cardiffQuestionNum++;
- _vm->_dialogs->displayScrollChain('q', 27);
+ _vm->_dialogs->displayScrollChain('Q', 27);
}
- _vm->_dialogs->displayScrollChain('z', _vm->_cardiffQuestionNum);
+ _vm->_dialogs->displayScrollChain('Z', _vm->_cardiffQuestionNum);
_vm->_interrogation = _vm->_cardiffQuestionNum;
addTimer(182, kProcCardiffSurvey, kReasonCardiffsurvey);
}
void Timer::cardiffReturn() {
- _vm->_dialogs->displayScrollChain('q', 28);
+ _vm->_dialogs->displayScrollChain('Q', 28);
cardiffSurvey(); // Add end of question.
}
void Timer::cwytalotInHerts() {
- _vm->_dialogs->displayScrollChain('q', 29);
+ _vm->_dialogs->displayScrollChain('Q', 29);
}
void Timer::getTiedUp() {
- _vm->_dialogs->displayScrollChain('q', 34); // ...Trouble!
+ _vm->_dialogs->displayScrollChain('Q', 34); // ...Trouble!
_vm->_userMovesAvvy = false;
_vm->_beenTiedUp = true;
_vm->_animation->stopWalking();
@@ -312,18 +312,18 @@ void Timer::hangAround() {
avvy->init(7, true); // Robin Hood
_vm->setRoom(kPeopleRobinHood, kRoomRobins);
_vm->_animation->appearPed(0, 1);
- _vm->_dialogs->displayScrollChain('q', 39);
+ _vm->_dialogs->displayScrollChain('Q', 39);
avvy->walkTo(6);
addTimer(55, kProcHangAround2, kReasonHangingAround);
}
void Timer::hangAround2() {
- _vm->_dialogs->displayScrollChain('q', 40);
+ _vm->_dialogs->displayScrollChain('Q', 40);
AnimationType *spr = _vm->_animation->_sprites[1];
spr->_vanishIfStill = false;
spr->walkTo(3);
_vm->setRoom(kPeopleFriarTuck, kRoomRobins);
- _vm->_dialogs->displayScrollChain('q', 41);
+ _vm->_dialogs->displayScrollChain('Q', 41);
_vm->_animation->_sprites[0]->remove();
spr->remove(); // Get rid of Robin Hood and Friar Tuck.
@@ -367,7 +367,7 @@ void Timer::afterTheShootemup() {
warning("STUB: Timer::after_the_shootemup()");
- _vm->_dialogs->displayScrollChain('q', 70);
+ _vm->_dialogs->displayScrollChain('Q', 70);
}
void Timer::jacquesWakesUp() {
@@ -423,7 +423,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon
void Timer::naughtyDuke2() {
AnimationType *spr = _vm->_animation->_sprites[1];
- _vm->_dialogs->displayScrollChain('q', 48); // "Ha ha, it worked again!"
+ _vm->_dialogs->displayScrollChain('Q', 48); // "Ha ha, it worked again!"
spr->walkTo(0); // Walk to the door.
spr->_vanishIfStill = true; // Then go away!
@@ -476,14 +476,14 @@ void Timer::jump() {
_vm->_arrowInTheDoor = false; // You've got it.
_vm->_objects[kObjectBolt - 1] = true;
_vm->refreshObjectList();
- _vm->_dialogs->displayScrollChain('q', 50);
+ _vm->_dialogs->displayScrollChain('Q', 50);
_vm->incScore(3);
}
}
}
void Timer::crapulusSaysSpludOut() {
- _vm->_dialogs->displayScrollChain('q', 56);
+ _vm->_dialogs->displayScrollChain('Q', 56);
_vm->_crapulusWillTell = false;
}
@@ -492,7 +492,7 @@ void Timer::buyDrinks() {
_vm->_malagauche = 0;
_vm->_dialogs->displayScrollChain('D', _vm->_drinking); // Display message about it.
- _vm->_pingo->wobble(); // Do the special effects.
+ _vm->_animation->wobble(); // Do the special effects.
_vm->_dialogs->displayScrollChain('D', 1); // That'll be thruppence.
if (_vm->decreaseMoney(3)) // Pay 3d.
_vm->_dialogs->displayScrollChain('D', 3); // Tell 'em you paid up.
@@ -578,7 +578,7 @@ void Timer::robinHoodAndGeida() {
}
void Timer::robinHoodAndGeidaTalk() {
- _vm->_dialogs->displayScrollChain('q', 66);
+ _vm->_dialogs->displayScrollChain('Q', 66);
AnimationType *avvy = _vm->_animation->_sprites[0];
AnimationType *spr = _vm->_animation->_sprites[1];
@@ -597,7 +597,7 @@ void Timer::avalotReturns() {
spr->remove();
avvy->init(0, true);
_vm->_animation->appearPed(0, 0);
- _vm->_dialogs->displayScrollChain('q', 67);
+ _vm->_dialogs->displayScrollChain('Q', 67);
_vm->_userMovesAvvy = true;
}
@@ -628,12 +628,12 @@ void Timer::arkataShouts() {
if (_vm->_teetotal)
return;
- _vm->_dialogs->displayScrollChain('q', 76);
+ _vm->_dialogs->displayScrollChain('Q', 76);
addTimer(160, kProcArkataShouts, kReasonArkataShouts);
}
void Timer::winning() {
- _vm->_dialogs->displayScrollChain('q', 79);
+ _vm->_dialogs->displayScrollChain('Q', 79);
_vm->_pingo->winningPic();
warning("STUB: Timer::winning()");
diff --git a/engines/cge/bitmap.cpp b/engines/cge/bitmap.cpp
index 989d2bbe99..5acd111c97 100644
--- a/engines/cge/bitmap.cpp
+++ b/engines/cge/bitmap.cpp
@@ -72,16 +72,16 @@ Bitmap::Bitmap(CGEEngine *vm, uint16 w, uint16 h, uint8 fill)
// + room for wash table
assert(v != NULL);
- *(uint16 *) v = TO_LE_16(kBmpCPY | dsiz); // data chunk hader
+ WRITE_LE_UINT16(v, (kBmpCPY | dsiz)); // data chunk hader
memset(v + 2, fill, dsiz); // data bytes
- *(uint16 *)(v + lsiz - 2) = TO_LE_16(kBmpSKP | ((kScrWidth / 4) - dsiz)); // gap
+ WRITE_LE_UINT16(v + lsiz - 2, (kBmpSKP | ((kScrWidth / 4) - dsiz))); // gap
// Replicate lines
byte *destP;
for (destP = v + lsiz; destP < (v + psiz); destP += lsiz)
Common::copy(v, v + lsiz, destP);
- *(uint16 *)(v + psiz - 2) = TO_LE_16(kBmpEOI); // plane trailer uint16
+ WRITE_LE_UINT16(v + psiz - 2, kBmpEOI); // plane trailer uint16
// Replicate planes
for (destP = v + psiz; destP < (v + 4 * psiz); destP += psiz)
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 5325558f8b..602b36d6ef 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -539,14 +539,12 @@ void CGEEngine::setMapBrick(int x, int z) {
debugC(1, kCGEDebugEngine, "CGEEngine::setMapBrick(%d, %d)", x, z);
Square *s = new Square(this);
- if (s) {
- char n[6];
- s->gotoxy(x * kMapGridX, kMapTop + z * kMapGridZ);
- sprintf(n, "%02d:%02d", x, z);
- _clusterMap[z][x] = 1;
- s->setName(n);
- _vga->_showQ->insert(s, _vga->_showQ->first());
- }
+ char n[6];
+ s->gotoxy(x * kMapGridX, kMapTop + z * kMapGridZ);
+ sprintf(n, "%02d:%02d", x, z);
+ _clusterMap[z][x] = 1;
+ s->setName(n);
+ _vga->_showQ->insert(s, _vga->_showQ->first());
}
void CGEEngine::keyClick() {
diff --git a/engines/cge/configure.engine b/engines/cge/configure.engine
new file mode 100644
index 0000000000..72af1197be
--- /dev/null
+++ b/engines/cge/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 cge "CGE" yes
diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp
index 609d5e86aa..8ee726c46d 100644
--- a/engines/cge/fileio.cpp
+++ b/engines/cge/fileio.cpp
@@ -70,7 +70,7 @@ ResourceManager::ResourceManager() {
_catFile = new Common::File();
_catFile->open(kCatName);
- if ((!_datFile) || (!_catFile))
+ if (!_datFile->isOpen() || !_catFile->isOpen())
error("Unable to open data files");
for (int i = 0; i < kBtLevel; i++) {
@@ -93,8 +93,8 @@ ResourceManager::~ResourceManager() {
delete _buff[i]._page;
}
-uint16 ResourceManager::XCrypt(void *buf, uint16 length) {
- byte *b = static_cast<byte *>(buf);
+uint16 ResourceManager::XCrypt(byte *buf, uint16 length) {
+ byte *b = buf;
for (uint16 i = 0; i < length; i++)
*b++ ^= kCryptSeed;
@@ -106,7 +106,7 @@ bool ResourceManager::seek(int32 offs, int whence) {
return _datFile->seek(offs, whence);
}
-uint16 ResourceManager::read(void *buf, uint16 length) {
+uint16 ResourceManager::read(byte *buf, uint16 length) {
if (!_datFile->isOpen())
return 0;
@@ -178,7 +178,7 @@ bool ResourceManager::exist(const char *name) {
return scumm_stricmp(find(name)->_key, name) == 0;
}
-uint16 ResourceManager::catRead(void *buf, uint16 length) {
+uint16 ResourceManager::catRead(byte *buf, uint16 length) {
if (!_catFile->isOpen())
return 0;
@@ -225,7 +225,7 @@ EncryptedStream::EncryptedStream(CGEEngine *vm, const char *name) : _vm(vm) {
_readStream = new Common::MemoryReadStream(dataBuffer, bufSize, DisposeAfterUse::YES);
}
-uint32 EncryptedStream::read(void *dataPtr, uint32 dataSize) {
+uint32 EncryptedStream::read(byte *dataPtr, uint32 dataSize) {
return _readStream->read(dataPtr, dataSize);
}
diff --git a/engines/cge/fileio.h b/engines/cge/fileio.h
index cee1fa79ef..653aabae8f 100644
--- a/engines/cge/fileio.h
+++ b/engines/cge/fileio.h
@@ -83,15 +83,15 @@ class ResourceManager {
} _buff[kBtLevel];
BtPage *getPage(int level, uint16 pageId);
- uint16 catRead(void *buf, uint16 length);
+ uint16 catRead(byte *buf, uint16 length);
Common::File *_catFile;
Common::File *_datFile;
- uint16 XCrypt(void *buf, uint16 length);
+ uint16 XCrypt(byte *buf, uint16 length);
public:
ResourceManager();
~ResourceManager();
- uint16 read(void *buf, uint16 length);
+ uint16 read(byte *buf, uint16 length);
bool seek(int32 offs, int whence = 0);
BtKeypack *find(const char *key);
@@ -111,7 +111,7 @@ public:
bool seek(int32 offset);
int32 pos();
int32 size();
- uint32 read(void *dataPtr, uint32 dataSize);
+ uint32 read(byte *dataPtr, uint32 dataSize);
Common::String readLine();
};
diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp
index b378898955..892b826318 100644
--- a/engines/cge/sound.cpp
+++ b/engines/cge/sound.cpp
@@ -186,6 +186,10 @@ DataCk *Fx::load(int idx, int ref) {
DataCk *Fx::loadWave(EncryptedStream *file) {
byte *data = (byte *)malloc(file->size());
+
+ if (!data)
+ return 0;
+
file->read(data, file->size());
return new DataCk(data, file->size());
diff --git a/engines/cine/configure.engine b/engines/cine/configure.engine
new file mode 100644
index 0000000000..2b7e2085fa
--- /dev/null
+++ b/engines/cine/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 cine "Cinematique evo 1" yes
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 2d7075cba1..10906480fe 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -42,6 +42,7 @@
#include "composer/composer.h"
#include "composer/graphics.h"
#include "composer/resource.h"
+#include "composer/console.h"
namespace Composer {
@@ -57,6 +58,7 @@ ComposerEngine::ComposerEngine(OSystem *syst, const ComposerGameDescription *gam
_mouseEnabled = false;
_mouseSpriteId = 0;
_lastButton = NULL;
+ _console = NULL;
}
ComposerEngine::~ComposerEngine() {
@@ -73,6 +75,7 @@ ComposerEngine::~ComposerEngine() {
i->_surface.free();
delete _rnd;
+ delete _console;
}
Common::Error ComposerEngine::run() {
@@ -113,6 +116,8 @@ Common::Error ComposerEngine::run() {
CursorMan.replaceCursorPalette(cursor->getPalette(), cursor->getPaletteStartIndex(), cursor->getPaletteCount());
delete cursor;
+ _console = new Console(this);
+
loadLibrary(0);
uint fps = atoi(getStringFromConfig("Common", "FPS").c_str());
@@ -190,11 +195,11 @@ Common::Error ComposerEngine::run() {
case Common::EVENT_KEYDOWN:
switch (event.kbd.keycode) {
case Common::KEYCODE_d:
- /*if (event.kbd.hasFlags(Common::KBD_CTRL)) {
+ if (event.kbd.hasFlags(Common::KBD_CTRL)) {
// Start the debugger
getDebugger()->attach();
getDebugger()->onFrame();
- }*/
+ }
break;
case Common::KEYCODE_q:
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 7d8022455a..f945df8bb1 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -34,11 +34,14 @@
#include "engines/engine.h"
#include "engines/util.h"
+#include "gui/debugger.h"
+
#include "graphics/surface.h"
#include "audio/mixer.h"
#include "composer/resource.h"
+#include "composer/console.h"
namespace Audio {
class QueuingAudioStream;
@@ -159,6 +162,9 @@ public:
const ComposerGameDescription *_gameDescription;
+ Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
+
private:
Common::RandomSource *_rnd;
diff --git a/engines/composer/configure.engine b/engines/composer/configure.engine
new file mode 100644
index 0000000000..71a79acb5d
--- /dev/null
+++ b/engines/composer/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 composer "Magic Composer" yes
diff --git a/engines/composer/console.cpp b/engines/composer/console.cpp
new file mode 100644
index 0000000000..8c68b3205b
--- /dev/null
+++ b/engines/composer/console.cpp
@@ -0,0 +1,31 @@
+/* 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 "composer/composer.h"
+
+namespace Composer {
+
+Console::Console(ComposerEngine *vm) : GUI::Debugger() {
+ _vm = vm;
+}
+
+} // End of namespace Composer
diff --git a/engines/composer/console.h b/engines/composer/console.h
new file mode 100644
index 0000000000..0567d8bc6f
--- /dev/null
+++ b/engines/composer/console.h
@@ -0,0 +1,40 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 COMPOSER_CONSOLE_H
+#define COMPOSER_CONSOLE_H
+
+namespace Composer {
+
+class ComposerEngine;
+
+class Console : public GUI::Debugger {
+public:
+ Console(ComposerEngine *vm);
+
+private:
+ ComposerEngine *_vm;
+};
+
+} // End of namespace Composer
+
+#endif /* COMPOSER_CONSOLE_H */
diff --git a/engines/composer/module.mk b/engines/composer/module.mk
index 8bfaf932e8..c879d53630 100644
--- a/engines/composer/module.mk
+++ b/engines/composer/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/composer
MODULE_OBJS = \
+ console.o \
composer.o \
detection.o \
graphics.o \
diff --git a/engines/configure.engines b/engines/configure.engines
deleted file mode 100644
index ec7d4667ca..0000000000
--- a/engines/configure.engines
+++ /dev/null
@@ -1,57 +0,0 @@
-# This file is included from the main "configure" script
-# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine scumm "SCUMM" yes "scumm_7_8 he" "v0-v6 games"
-add_engine scumm_7_8 "v7 & v8 games" yes
-add_engine he "HE71+ games" yes
-add_engine agi "AGI" yes
-add_engine agos "AGOS" yes "agos2" "AGOS 1 games"
-add_engine agos2 "AGOS 2 games" yes
-add_engine avalanche "Lord Avalot d'Argent" no
-add_engine cge "CGE" yes
-add_engine cine "Cinematique evo 1" yes
-add_engine composer "Magic Composer" yes
-add_engine cruise "Cinematique evo 2" yes
-add_engine draci "Dragon History" yes
-add_engine drascula "Drascula: The Vampire Strikes Back" yes
-add_engine dreamweb "Dreamweb" yes
-add_engine fullpipe "Full Pipe" no
-add_engine gob "Gobli*ns" yes
-add_engine groovie "Groovie" yes "groovie2" "7th Guest"
-add_engine groovie2 "Groovie 2 games" no "" "" "jpeg"
-add_engine hopkins "Hopkins FBI" yes "" "" "16bit"
-add_engine hugo "Hugo Trilogy" yes
-add_engine kyra "Kyra" yes "lol eob" "Legend of Kyrandia 1-3"
-add_engine lol "Lands of Lore" yes
-add_engine eob "Eye of the Beholder" yes
-add_engine lastexpress "The Last Express" no "" "" "16bit"
-add_engine lure "Lure of the Temptress" yes
-add_engine made "MADE" yes
-add_engine mohawk "Mohawk" yes "cstime myst riven" "Living Books"
-add_engine mortevielle "Mortevielle" no
-add_engine cstime "Where in Time is Carmen Sandiego?" no
-add_engine riven "Riven: The Sequel to Myst" no "" "" "16bit"
-add_engine myst "Myst" no "" "" "16bit"
-add_engine neverhood "Neverhood" no
-add_engine parallaction "Parallaction" yes
-add_engine pegasus "The Journeyman Project: Pegasus Prime" yes "" "" "16bit"
-add_engine queen "Flight of the Amazon Queen" yes
-add_engine saga "SAGA" yes "ihnm saga2" "ITE"
-add_engine ihnm "IHNM" yes
-add_engine saga2 "SAGA 2 games" no
-add_engine sci "SCI" yes "sci32" "SCI 0-1.1 games"
-add_engine sci32 "SCI32 games" no
-add_engine sky "Beneath a Steel Sky" yes
-add_engine sword1 "Broken Sword" yes
-add_engine sword2 "Broken Sword II" yes
-add_engine sword25 "Broken Sword 2.5" no "" "" "png zlib 16bit"
-add_engine teenagent "Teen Agent" yes
-add_engine testbed "TestBed: the Testing framework" no
-add_engine tinsel "Tinsel" yes
-add_engine toltecs "3 Skulls of the Toltecs" yes
-add_engine toon "Toonstruck" yes
-add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes
-add_engine tony "Tony Tough and the Night of Roasted Moths" yes "" "" "16bit"
-add_engine tsage "TsAGE" yes
-add_engine tucker "Bud Tucker in Double Trouble" yes
-add_engine wintermute "Wintermute" no "" "" "jpeg png zlib vorbis 16bit"
-add_engine zvision "ZVision" no "" "" "freetype2 16bit"
diff --git a/engines/cruise/configure.engine b/engines/cruise/configure.engine
new file mode 100644
index 0000000000..925da25370
--- /dev/null
+++ b/engines/cruise/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 cruise "Cinematique evo 2" yes
diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp
index 31dfe62dee..584367fdfb 100644
--- a/engines/draci/barchive.cpp
+++ b/engines/draci/barchive.cpp
@@ -203,12 +203,12 @@ void BArchive::openArchive(const Common::String &path) {
uint32 fileOffset;
fileOffset = reader.readUint32LE();
- _f.seek(fileOffset); // Seek to next file in archive
+ _f.seek(fileOffset); // Seek to next file in archive
- _files[i]._compLength = _f.readUint16LE(); // Compressed size
+ _files[i]._compLength = _f.readUint16LE(); // Compressed size
// should be the same as uncompressed
- _files[i]._length = _f.readUint16LE(); // Original size
+ _files[i]._length = _f.readUint16LE(); // Original size
_files[i]._offset = fileOffset; // Offset of file from start
@@ -216,9 +216,9 @@ void BArchive::openArchive(const Common::String &path) {
assert(compressionType == 0 &&
"Compression type flag is non-zero (file is compressed)");
- _files[i]._crc = _f.readByte(); // CRC checksum of the file
- _files[i]._data = NULL; // File data will be read in on demand
- _files[i]._stopper = 0; // Dummy value; not used in BAR files, needed in DFW
+ _files[i]._crc = _f.readByte(); // CRC checksum of the file
+ _files[i]._data = NULL; // File data will be read in on demand
+ _files[i]._stopper = 0; // Dummy value; not used in BAR files, needed in DFW
}
// Last footer item should be equal to footerOffset
diff --git a/engines/draci/configure.engine b/engines/draci/configure.engine
new file mode 100644
index 0000000000..09022b06f5
--- /dev/null
+++ b/engines/draci/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 draci "Dragon History" yes
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index a5c8aa867f..009f1bb3d2 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -1410,7 +1410,7 @@ void Game::enterNewRoom() {
// for the dragon in the persons array
if (_newRoom == _info._mapRoom) {
_persons[kDragonObject]._x = 160;
- _persons[kDragonObject]._y = 0;
+ _persons[kDragonObject]._y = 0;
}
// Set the appropriate loop status before loading the room
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 8ff60033ed..504476869e 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -41,65 +41,65 @@ namespace Draci {
void Script::setupCommandList() {
/** A table of all the commands the game player uses */
static const GPL2Command gplCommands[] = {
- { 0, 0, "gplend", 0, { }, NULL },
- { 0, 1, "exit", 0, { }, NULL },
- { 1, 1, "goto", 1, { kGPL2Ident }, &Script::c_Goto },
- { 2, 1, "Let", 2, { kGPL2Ident, kGPL2Math }, &Script::c_Let },
- { 3, 1, "if", 2, { kGPL2Math, kGPL2Ident }, &Script::c_If },
- { 4, 1, "Start", 2, { kGPL2Ident, kGPL2Str }, &Script::start },
- { 5, 1, "Load", 2, { kGPL2Ident, kGPL2Str }, &Script::load },
- { 5, 2, "StartPlay", 2, { kGPL2Ident, kGPL2Str }, &Script::startPlay },
- { 5, 3, "JustTalk", 0, { }, &Script::justTalk },
- { 5, 4, "JustStay", 0, { }, &Script::justStay },
- { 6, 1, "Talk", 2, { kGPL2Ident, kGPL2Str }, &Script::talk },
- { 7, 1, "ObjStat", 2, { kGPL2Ident, kGPL2Ident }, &Script::objStat },
- { 7, 2, "ObjStat_On", 2, { kGPL2Ident, kGPL2Ident }, &Script::objStatOn },
- { 8, 1, "IcoStat", 2, { kGPL2Ident, kGPL2Ident }, &Script::icoStat },
- { 9, 1, "Dialogue", 1, { kGPL2Str }, &Script::dialogue },
- { 9, 2, "ExitDialogue", 0, { }, &Script::exitDialogue },
- { 9, 3, "ResetDialogue", 0, { }, &Script::resetDialogue },
- { 9, 4, "ResetDialogueFrom", 0, { }, &Script::resetDialogueFrom },
- { 9, 5, "ResetBlock", 1, { kGPL2Ident }, &Script::resetBlock },
- { 10, 1, "WalkOn", 3, { kGPL2Num, kGPL2Num, kGPL2Ident }, &Script::walkOn },
- { 10, 2, "StayOn", 3, { kGPL2Num, kGPL2Num, kGPL2Ident }, &Script::stayOn },
- { 10, 3, "WalkOnPlay", 3, { kGPL2Num, kGPL2Num, kGPL2Ident }, &Script::walkOnPlay },
- { 11, 1, "LoadPalette", 1, { kGPL2Str }, &Script::loadPalette },
- { 12, 1, "SetPalette", 0, { }, &Script::setPalette },
- { 12, 2, "BlackPalette", 0, { }, &Script::blackPalette },
- { 13, 1, "FadePalette", 3, { kGPL2Num, kGPL2Num, kGPL2Num }, &Script::fadePalette },
- { 13, 2, "FadePalettePlay", 3, { kGPL2Num, kGPL2Num, kGPL2Num }, &Script::fadePalettePlay },
- { 14, 1, "NewRoom", 2, { kGPL2Ident, kGPL2Num }, &Script::newRoom },
- { 15, 1, "ExecInit", 1, { kGPL2Ident }, &Script::execInit },
- { 15, 2, "ExecLook", 1, { kGPL2Ident }, &Script::execLook },
- { 15, 3, "ExecUse", 1, { kGPL2Ident }, &Script::execUse },
- { 18, 1, "LoadMusic", 1, { kGPL2Str }, &Script::loadMusic },
- { 18, 2, "StartMusic", 0, { }, &Script::startMusic },
- { 18, 3, "StopMusic", 0, { }, &Script::stopMusic },
- { 19, 1, "Mark", 0, { }, &Script::mark },
- { 19, 2, "Release", 0, { }, &Script::release },
- { 20, 1, "Play", 0, { }, &Script::play },
- { 21, 1, "LoadMap", 1, { kGPL2Str }, &Script::loadMap },
- { 21, 2, "RoomMap", 0, { }, &Script::roomMap },
- { 22, 1, "DisableQuickHero", 0, { }, &Script::disableQuickHero },
- { 22, 2, "EnableQuickHero", 0, { }, &Script::enableQuickHero },
- { 23, 1, "DisableSpeedText", 0, { }, &Script::disableSpeedText },
- { 23, 2, "EnableSpeedText", 0, { }, &Script::enableSpeedText },
- { 24, 1, "QuitGame", 0, { }, &Script::quitGame },
- { 25, 1, "PushNewRoom", 0, { }, &Script::pushNewRoom },
- { 25, 2, "PopNewRoom", 0, { }, &Script::popNewRoom },
+ { 0, 0, "gplend", 0, { }, NULL },
+ { 0, 1, "exit", 0, { }, NULL },
+ { 1, 1, "goto", 1, { kGPL2Ident }, &Script::c_Goto },
+ { 2, 1, "Let", 2, { kGPL2Ident, kGPL2Math }, &Script::c_Let },
+ { 3, 1, "if", 2, { kGPL2Math, kGPL2Ident }, &Script::c_If },
+ { 4, 1, "Start", 2, { kGPL2Ident, kGPL2Str }, &Script::start },
+ { 5, 1, "Load", 2, { kGPL2Ident, kGPL2Str }, &Script::load },
+ { 5, 2, "StartPlay", 2, { kGPL2Ident, kGPL2Str }, &Script::startPlay },
+ { 5, 3, "JustTalk", 0, { }, &Script::justTalk },
+ { 5, 4, "JustStay", 0, { }, &Script::justStay },
+ { 6, 1, "Talk", 2, { kGPL2Ident, kGPL2Str }, &Script::talk },
+ { 7, 1, "ObjStat", 2, { kGPL2Ident, kGPL2Ident }, &Script::objStat },
+ { 7, 2, "ObjStat_On", 2, { kGPL2Ident, kGPL2Ident }, &Script::objStatOn },
+ { 8, 1, "IcoStat", 2, { kGPL2Ident, kGPL2Ident }, &Script::icoStat },
+ { 9, 1, "Dialogue", 1, { kGPL2Str }, &Script::dialogue },
+ { 9, 2, "ExitDialogue", 0, { }, &Script::exitDialogue },
+ { 9, 3, "ResetDialogue", 0, { }, &Script::resetDialogue },
+ { 9, 4, "ResetDialogueFrom", 0, { }, &Script::resetDialogueFrom },
+ { 9, 5, "ResetBlock", 1, { kGPL2Ident }, &Script::resetBlock },
+ { 10, 1, "WalkOn", 3, { kGPL2Num, kGPL2Num, kGPL2Ident }, &Script::walkOn },
+ { 10, 2, "StayOn", 3, { kGPL2Num, kGPL2Num, kGPL2Ident }, &Script::stayOn },
+ { 10, 3, "WalkOnPlay", 3, { kGPL2Num, kGPL2Num, kGPL2Ident }, &Script::walkOnPlay },
+ { 11, 1, "LoadPalette", 1, { kGPL2Str }, &Script::loadPalette },
+ { 12, 1, "SetPalette", 0, { }, &Script::setPalette },
+ { 12, 2, "BlackPalette", 0, { }, &Script::blackPalette },
+ { 13, 1, "FadePalette", 3, { kGPL2Num, kGPL2Num, kGPL2Num }, &Script::fadePalette },
+ { 13, 2, "FadePalettePlay", 3, { kGPL2Num, kGPL2Num, kGPL2Num }, &Script::fadePalettePlay },
+ { 14, 1, "NewRoom", 2, { kGPL2Ident, kGPL2Num }, &Script::newRoom },
+ { 15, 1, "ExecInit", 1, { kGPL2Ident }, &Script::execInit },
+ { 15, 2, "ExecLook", 1, { kGPL2Ident }, &Script::execLook },
+ { 15, 3, "ExecUse", 1, { kGPL2Ident }, &Script::execUse },
+ { 18, 1, "LoadMusic", 1, { kGPL2Str }, &Script::loadMusic },
+ { 18, 2, "StartMusic", 0, { }, &Script::startMusic },
+ { 18, 3, "StopMusic", 0, { }, &Script::stopMusic },
+ { 19, 1, "Mark", 0, { }, &Script::mark },
+ { 19, 2, "Release", 0, { }, &Script::release },
+ { 20, 1, "Play", 0, { }, &Script::play },
+ { 21, 1, "LoadMap", 1, { kGPL2Str }, &Script::loadMap },
+ { 21, 2, "RoomMap", 0, { }, &Script::roomMap },
+ { 22, 1, "DisableQuickHero", 0, { }, &Script::disableQuickHero },
+ { 22, 2, "EnableQuickHero", 0, { }, &Script::enableQuickHero },
+ { 23, 1, "DisableSpeedText", 0, { }, &Script::disableSpeedText },
+ { 23, 2, "EnableSpeedText", 0, { }, &Script::enableSpeedText },
+ { 24, 1, "QuitGame", 0, { }, &Script::quitGame },
+ { 25, 1, "PushNewRoom", 0, { }, &Script::pushNewRoom },
+ { 25, 2, "PopNewRoom", 0, { }, &Script::popNewRoom },
// The following commands are not used in the original game files.
- { 16, 1, "RepaintInventory", 0, { }, NULL },
- { 16, 2, "ExitInventory", 0, { }, NULL },
- { 17, 1, "ExitMap", 0, { }, NULL },
- { 18, 4, "FadeOutMusic", 1, { kGPL2Num }, NULL },
- { 18, 5, "FadeInMusic", 1, { kGPL2Num }, NULL },
+ { 16, 1, "RepaintInventory", 0, { }, NULL },
+ { 16, 2, "ExitInventory", 0, { }, NULL },
+ { 17, 1, "ExitMap", 0, { }, NULL },
+ { 18, 4, "FadeOutMusic", 1, { kGPL2Num }, NULL },
+ { 18, 5, "FadeInMusic", 1, { kGPL2Num }, NULL },
// The following commands are not even defined in the game
// sources, but their numbers are allocated for internal
// purposes of the old player.
- { 26, 1, "ShowCheat", 0, { }, NULL },
- { 26, 2, "HideCheat", 0, { }, NULL },
- { 26, 3, "ClearCheat", 1, { kGPL2Num }, NULL },
- { 27, 1, "FeedPassword", 3, { kGPL2Num, kGPL2Num, kGPL2Num }, NULL }
+ { 26, 1, "ShowCheat", 0, { }, NULL },
+ { 26, 2, "HideCheat", 0, { }, NULL },
+ { 26, 3, "ClearCheat", 1, { kGPL2Num }, NULL },
+ { 27, 1, "FeedPassword", 3, { kGPL2Num, kGPL2Num, kGPL2Num }, NULL }
};
/** Operators used by the mathematical evaluator */
diff --git a/engines/drascula/configure.engine b/engines/drascula/configure.engine
new file mode 100644
index 0000000000..b9b76638fd
--- /dev/null
+++ b/engines/drascula/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 drascula "Drascula: The Vampire Strikes Back" yes
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 163f0077fc..14cb4be5a0 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -864,6 +864,11 @@ void DrasculaEngine::updateEvents() {
#endif
switch (event.type) {
case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) {
+ // Start the debugger
+ getDebugger()->attach();
+ getDebugger()->onFrame();
+ }
addKeyToBuffer(event.kbd);
break;
case Common::EVENT_KEYUP:
diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h
index 944191b5fb..53fce9c212 100644
--- a/engines/drascula/drascula.h
+++ b/engines/drascula/drascula.h
@@ -38,6 +38,8 @@
#include "engines/savestate.h"
+#include "drascula/console.h"
+
#include "audio/mixer.h"
#include "engines/engine.h"
@@ -313,8 +315,6 @@ static const int interf_y[] = { 51, 51, 51, 51, 83, 83, 83 };
struct RoomHandlers;
-class Console;
-
class DrasculaEngine : public Engine {
protected:
// Engine APIs
@@ -724,11 +724,12 @@ public:
void update_62_pre();
void update_102();
+ Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
+
private:
int _lang;
- Console *_console;
-
CharInfo *_charMap;
int _charMapSize;
diff --git a/engines/dreamweb/configure.engine b/engines/dreamweb/configure.engine
new file mode 100644
index 0000000000..27506e650f
--- /dev/null
+++ b/engines/dreamweb/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 dreamweb "Dreamweb" yes
diff --git a/engines/dreamweb/dreamweb.h b/engines/dreamweb/dreamweb.h
index 010f3883b0..87a9f5423f 100644
--- a/engines/dreamweb/dreamweb.h
+++ b/engines/dreamweb/dreamweb.h
@@ -110,6 +110,8 @@ protected:
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
+ GUI::Debugger *getDebugger() { return _console; }
+
public:
DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc);
virtual ~DreamWebEngine();
diff --git a/engines/engines.mk b/engines/engines.mk
deleted file mode 100644
index cfde77321d..0000000000
--- a/engines/engines.mk
+++ /dev/null
@@ -1,263 +0,0 @@
-ifdef ENABLE_SCUMM
-DEFINES += -DENABLE_SCUMM=$(ENABLE_SCUMM)
-MODULES += engines/scumm
-
-ifdef ENABLE_SCUMM_7_8
-DEFINES += -DENABLE_SCUMM_7_8
-endif
-
-ifdef ENABLE_HE
-DEFINES += -DENABLE_HE
-endif
-
-endif
-
-ifdef ENABLE_AGI
-DEFINES += -DENABLE_AGI=$(ENABLE_AGI)
-MODULES += engines/agi
-endif
-
-ifdef ENABLE_AGOS
-DEFINES += -DENABLE_AGOS=$(ENABLE_AGOS)
-MODULES += engines/agos
-
-ifdef ENABLE_AGOS2
-DEFINES += -DENABLE_AGOS2
-endif
-endif
-
-ifdef ENABLE_AVALANCHE
-DEFINES += -DENABLE_AVALANCHE=$(ENABLE_AVALANCHE)
-MODULES += engines/avalanche
-endif
-
-ifdef ENABLE_CGE
-DEFINES += -DENABLE_CGE=$(ENABLE_CGE)
-MODULES += engines/cge
-endif
-
-ifdef ENABLE_CINE
-DEFINES += -DENABLE_CINE=$(ENABLE_CINE)
-MODULES += engines/cine
-endif
-
-ifdef ENABLE_COMPOSER
-DEFINES += -DENABLE_COMPOSER=$(ENABLE_COMPOSER)
-MODULES += engines/composer
-endif
-
-ifdef ENABLE_CRUISE
-DEFINES += -DENABLE_CRUISE=$(ENABLE_CRUISE)
-MODULES += engines/cruise
-endif
-
-ifdef ENABLE_DRACI
-DEFINES += -DENABLE_DRACI=$(ENABLE_DRACI)
-MODULES += engines/draci
-endif
-
-ifdef ENABLE_DRASCULA
-DEFINES += -DENABLE_DRASCULA=$(ENABLE_DRASCULA)
-MODULES += engines/drascula
-endif
-
-ifdef ENABLE_DREAMWEB
-DEFINES += -DENABLE_DREAMWEB=$(ENABLE_DREAMWEB)
-MODULES += engines/dreamweb
-endif
-
-ifdef ENABLE_FULLPIPE
-DEFINES += -DENABLE_FULLPIPE=$(ENABLE_FULLPIPE)
-MODULES += engines/fullpipe
-endif
-
-ifdef ENABLE_GOB
-DEFINES += -DENABLE_GOB=$(ENABLE_GOB)
-MODULES += engines/gob
-endif
-
-ifdef ENABLE_GROOVIE
-DEFINES += -DENABLE_GROOVIE=$(ENABLE_GROOVIE)
-MODULES += engines/groovie
-
-ifdef ENABLE_GROOVIE2
-DEFINES += -DENABLE_GROOVIE2
-endif
-endif
-
-ifdef ENABLE_HOPKINS
-DEFINES += -DENABLE_HOPKINS=$(ENABLE_HOPKINS)
-MODULES += engines/hopkins
-endif
-
-ifdef ENABLE_HUGO
-DEFINES += -DENABLE_HUGO=$(ENABLE_HUGO)
-MODULES += engines/hugo
-endif
-
-ifdef ENABLE_KYRA
-DEFINES += -DENABLE_KYRA=$(ENABLE_KYRA)
-MODULES += engines/kyra
-
-ifdef ENABLE_LOL
-DEFINES += -DENABLE_LOL
-endif
-
-ifdef ENABLE_EOB
-DEFINES += -DENABLE_EOB
-endif
-endif
-
-ifdef ENABLE_LASTEXPRESS
-DEFINES += -DENABLE_LASTEXPRESS=$(ENABLE_LASTEXPRESS)
-MODULES += engines/lastexpress
-endif
-
-ifdef ENABLE_LURE
-DEFINES += -DENABLE_LURE=$(ENABLE_LURE)
-MODULES += engines/lure
-endif
-
-ifdef ENABLE_MADE
-DEFINES += -DENABLE_MADE=$(ENABLE_MADE)
-MODULES += engines/made
-endif
-
-ifdef ENABLE_MOHAWK
-DEFINES += -DENABLE_MOHAWK=$(ENABLE_MOHAWK)
-MODULES += engines/mohawk
-
-ifdef ENABLE_CSTIME
-DEFINES += -DENABLE_CSTIME
-endif
-
-ifdef ENABLE_MYST
-DEFINES += -DENABLE_MYST
-endif
-
-ifdef ENABLE_RIVEN
-DEFINES += -DENABLE_RIVEN
-endif
-endif
-
-ifdef ENABLE_MORTEVIELLE
-DEFINES += -DENABLE_MORTEVIELLE=$(ENABLE_MORTEVIELLE)
-MODULES += engines/mortevielle
-endif
-
-ifdef ENABLE_NEVERHOOD
-DEFINES += -DENABLE_NEVERHOOD=$(ENABLE_NEVERHOOD)
-MODULES += engines/neverhood
-endif
-
-ifdef ENABLE_PARALLACTION
-DEFINES += -DENABLE_PARALLACTION=$(ENABLE_PARALLACTION)
-MODULES += engines/parallaction
-endif
-
-ifdef ENABLE_PEGASUS
-DEFINES += -DENABLE_PEGASUS=$(ENABLE_PEGASUS)
-MODULES += engines/pegasus
-endif
-
-ifdef ENABLE_QUEEN
-DEFINES += -DENABLE_QUEEN=$(ENABLE_QUEEN)
-MODULES += engines/queen
-endif
-
-ifdef ENABLE_SAGA
-DEFINES += -DENABLE_SAGA=$(ENABLE_SAGA)
-MODULES += engines/saga
-
-ifdef ENABLE_IHNM
-DEFINES += -DENABLE_IHNM
-endif
-
-ifdef ENABLE_SAGA2
-DEFINES += -DENABLE_SAGA2
-endif
-endif
-
-ifdef ENABLE_SCI
-DEFINES += -DENABLE_SCI=$(ENABLE_SCI)
-MODULES += engines/sci
-
-ifdef ENABLE_SCI32
-DEFINES += -DENABLE_SCI32
-endif
-endif
-
-ifdef ENABLE_SKY
-DEFINES += -DENABLE_SKY=$(ENABLE_SKY)
-MODULES += engines/sky
-endif
-
-ifdef ENABLE_SWORD1
-DEFINES += -DENABLE_SWORD1=$(ENABLE_SWORD1)
-MODULES += engines/sword1
-endif
-
-ifdef ENABLE_SWORD2
-DEFINES += -DENABLE_SWORD2=$(ENABLE_SWORD2)
-MODULES += engines/sword2
-endif
-
-ifdef ENABLE_SWORD25
-DEFINES += -DENABLE_SWORD25=$(ENABLE_SWORD25)
-MODULES += engines/sword25
-endif
-
-ifdef ENABLE_TESTBED
-DEFINES += -DENABLE_TESTBED=$(ENABLE_TESTBED)
-MODULES += engines/testbed
-endif
-
-ifdef ENABLE_TEENAGENT
-DEFINES += -DENABLE_TEENAGENT=$(ENABLE_TEENAGENT)
-MODULES += engines/teenagent
-endif
-
-ifdef ENABLE_TINSEL
-DEFINES += -DENABLE_TINSEL=$(ENABLE_TINSEL)
-MODULES += engines/tinsel
-endif
-
-ifdef ENABLE_TOLTECS
-DEFINES += -DENABLE_TOLTECS=$(ENABLE_TOLTECS)
-MODULES += engines/toltecs
-endif
-
-ifdef ENABLE_TONY
-DEFINES += -DENABLE_TONY=$(ENABLE_TONY)
-MODULES += engines/tony
-endif
-
-ifdef ENABLE_TOON
-DEFINES += -DENABLE_TOON=$(ENABLE_TOON)
-MODULES += engines/toon
-endif
-
-ifdef ENABLE_TOUCHE
-DEFINES += -DENABLE_TOUCHE=$(ENABLE_TOUCHE)
-MODULES += engines/touche
-endif
-
-ifdef ENABLE_TSAGE
-DEFINES += -DENABLE_TSAGE=$(ENABLE_TSAGE)
-MODULES += engines/tsage
-endif
-
-ifdef ENABLE_TUCKER
-DEFINES += -DENABLE_TUCKER=$(ENABLE_TUCKER)
-MODULES += engines/tucker
-endif
-
-ifdef ENABLE_WINTERMUTE
-DEFINES += -DENABLE_WINTERMUTE=$(ENABLE_WINTERMUTE)
-MODULES += engines/wintermute
-endif
-
-ifdef ENABLE_ZVISION
-DEFINES += -DENABLE_ZVISION=$(ENABLE_ZVISION)
-MODULES += engines/zvision
-endif
diff --git a/engines/fullpipe/behavior.cpp b/engines/fullpipe/behavior.cpp
index c7b526d2c1..75cb027d7a 100644
--- a/engines/fullpipe/behavior.cpp
+++ b/engines/fullpipe/behavior.cpp
@@ -132,7 +132,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorEntry *
mq->sendNextCommand();
bhi->_flags &= 0xFFFFFFFD;
- } else if (behaviorInfo->_counter >= bhi->_delay && bhi->_percent && g_fullpipe->_rnd->getRandomNumber(32767) <= entry->_items[i]->_percent) {
+ } else if (behaviorInfo->_counter >= bhi->_delay && bhi->_percent && g_fp->_rnd->getRandomNumber(32767) <= entry->_items[i]->_percent) {
MessageQueue *mq = new MessageQueue(bhi->_messageQueue, 0, 1);
mq->sendNextCommand();
@@ -149,7 +149,7 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
MessageQueue *mq = 0;
if (bhe->_flags & 1) {
- uint rnd = g_fullpipe->_rnd->getRandomNumber(32767);
+ uint rnd = g_fp->_rnd->getRandomNumber(32767);
uint runPercent = 0;
for (int i = 0; i < bhe->_itemsCount; i++) {
if (!(bhe->_items[i]->_flags & 1) && bhe->_items[i]->_percent) {
@@ -164,7 +164,7 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
for (int i = 0; i < bhe->_itemsCount; i++) {
if (!(bhe->_items[i]->_flags & 1) && delay >= bhe->_items[i]->_delay) {
if (bhe->_items[i]->_percent) {
- if (g_fullpipe->_rnd->getRandomNumber(32767) <= bhe->_items[i]->_percent) {
+ if (g_fp->_rnd->getRandomNumber(32767) <= bhe->_items[i]->_percent) {
mq = new MessageQueue(bhe->_items[i]->_messageQueue, 0, 1);
break;
}
@@ -180,11 +180,49 @@ void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, B
}
bool BehaviorManager::setBehaviorEnabled(StaticANIObject *obj, int aniId, int quId, int flag) {
- warning("STUB: BehaviorManager::setBehaviorEnabled()");
+ BehaviorEntryInfo *entry = getBehaviorEntryInfoByMessageQueueDataId(obj, aniId, quId);
+
+ if (entry) {
+ if (flag)
+ entry->_flags &= 0xFFFFFFFE;
+ else
+ entry->_flags |= 1;
+ } else
+ return false;
return true;
}
+void BehaviorManager::setFlagByStaticAniObject(StaticANIObject *ani, int flag) {
+ for (uint i = 0; i < _behaviors.size(); i++) {
+ BehaviorInfo *beh = _behaviors[i];
+
+ if (ani == beh->_ani) {
+ if (flag)
+ beh->_flags &= 0xfe;
+ else
+ beh->_flags |= 1;
+ }
+ }
+}
+
+BehaviorEntryInfo *BehaviorManager::getBehaviorEntryInfoByMessageQueueDataId(StaticANIObject *ani, int id1, int id2) {
+ for (uint i = 0; i < _behaviors.size(); i++) {
+ if (_behaviors[i]->_ani == ani) {
+ for (uint j = 0; j < _behaviors[i]->_bheItems.size(); j++) {
+ if (_behaviors[i]->_bheItems[j]->_staticsId == id1) {
+ for (int k = 0; k < _behaviors[i]->_bheItems[j]->_itemsCount; k++) {
+ if (_behaviors[i]->_bheItems[j]->_items[k]->_messageQueue->_dataId == id2)
+ return _behaviors[i]->_bheItems[j]->_items[k];
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
+
void BehaviorInfo::clear() {
_ani = 0;
_staticsId = 0;
@@ -233,11 +271,11 @@ void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *
if (strcmp(var->_value.stringValue, "ROOT"))
break;
- GameVar *v1 = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("BEHAVIOR")->getSubVarByName(ani->getName());
+ GameVar *v1 = g_fp->getGameLoaderGameVar()->getSubVarByName("BEHAVIOR")->getSubVarByName(ani->getName());
if (v1 == var)
return;
- sc = g_fullpipe->accessScene(ani->_sceneId);
+ sc = g_fp->accessScene(ani->_sceneId);
clear();
var = v1;
_itemsCount = var->getSubVarsCount();
diff --git a/engines/fullpipe/behavior.h b/engines/fullpipe/behavior.h
index 4fd1454351..90bb38dc9b 100644
--- a/engines/fullpipe/behavior.h
+++ b/engines/fullpipe/behavior.h
@@ -79,6 +79,10 @@ class BehaviorManager : public CObject {
void updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorEntry *beh);
bool setBehaviorEnabled(StaticANIObject *obj, int aniId, int quId, int flag);
+
+ void setFlagByStaticAniObject(StaticANIObject *ani, int flag);
+
+ BehaviorEntryInfo *getBehaviorEntryInfoByMessageQueueDataId(StaticANIObject *ani, int id1, int id2);
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/configure.engine b/engines/fullpipe/configure.engine
new file mode 100644
index 0000000000..fce5951e26
--- /dev/null
+++ b/engines/fullpipe/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 fullpipe "Full Pipe" no
diff --git a/engines/fullpipe/console.cpp b/engines/fullpipe/console.cpp
new file mode 100644
index 0000000000..2d27fc2ddd
--- /dev/null
+++ b/engines/fullpipe/console.cpp
@@ -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.
+ *
+ */
+
+#include "fullpipe/constants.h"
+#include "fullpipe/fullpipe.h"
+#include "fullpipe/gameloader.h"
+#include "fullpipe/scene.h"
+
+namespace Fullpipe {
+
+Console::Console(FullpipeEngine *vm) : GUI::Debugger(), _vm(vm) {
+ DCmd_Register("scene", WRAP_METHOD(Console, Cmd_Scene));
+}
+
+bool Console::Cmd_Scene(int argc, const char **argv) {
+ if (argc != 2) {
+ int sceneTag = _vm->_currentScene->_sceneId;
+ DebugPrintf("Current scene: %d (scene tag: %d)\n", _vm->getSceneFromTag(sceneTag), sceneTag);
+ DebugPrintf("Use %s <scene> to change the current scene\n", argv[0]);
+ return true;
+ } else {
+ int scene = _vm->convertScene(atoi(argv[1]));
+ _vm->_gameLoader->loadScene(726);
+ _vm->_gameLoader->gotoScene(726, TrubaLeft);
+
+ if (scene != 726)
+ _vm->_gameLoader->preloadScene(726, _vm->getSceneEntrance(scene));
+
+ return false;
+ }
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/console.h b/engines/fullpipe/console.h
new file mode 100644
index 0000000000..af2b5114ac
--- /dev/null
+++ b/engines/fullpipe/console.h
@@ -0,0 +1,42 @@
+/* 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 FULLPIPE_CONSOLE_H
+#define FULLPIPE_CONSOLE_H
+
+namespace Fullpipe {
+
+class FullpipeEngine;
+
+class Console : public GUI::Debugger {
+public:
+ Console(FullpipeEngine *vm);
+
+private:
+ FullpipeEngine *_vm;
+
+ bool Cmd_Scene(int argc, const char **argv);
+};
+
+} // End of namespace Fullpipe
+
+#endif /* FULLPIPE_CONSOLE_H */
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index 087a768156..1d1dbeece8 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -25,107 +25,32 @@
namespace Fullpipe {
-#define ANI_BOOT_1 4231
-#define ANI_CLOCK 588
-#define ANI_DOMINO_3 2732
-#define ANI_DADAYASHIK 306
-#define ANI_EGGEATER 334
-#define ANI_HAND 601
-#define ANI_IN1MAN 5110
-#define ANI_INV_COIN 875
-#define ANI_INV_EGGAPL 1564
-#define ANI_INV_EGGBOOT 1570
-#define ANI_INV_EGGCOIN 1567
-#define ANI_INV_EGGDOM 1561
-#define ANI_INV_EGGGLS 1573
+// Common
+#define ANI_FLY 4916
#define ANI_INV_MAP 5321
-#define ANI_KOZAWKA 495
#define ANI_LIFTBUTTON 2751
-#define ANI_MAMASHA_4 660
#define ANI_MAN 322
-#define ANI_PLANK 501
-#define ANI_SC2_BOX 1020
-#define ANI_SC4_BOOT 1035
-#define ANI_SC4_COIN 690
-#define ANI_SPEAKER_4 3275
-#define ANI_SPRING 542
-#define MSG_CLICKBOTTLE 569
-#define MSG_CLICKBUTTON 609
-#define MSG_CLICKPLANK 549
+#define ANI_PBAR 896
#define MSG_CMN_WINARCADE 4778
#define MSG_DISABLESAVES 5201
#define MSG_ENABLESAVES 5202
#define MSG_HMRKICK_METAL 4764
#define MSG_HMRKICK_STUCCO 4765
-#define MSG_INTR_ENDINTRO 5139
-#define MSG_INTR_GETUPMAN 5135
-#define MSG_INTR_SWITCHTO1 5145
-#define MSG_INTR_SWITCHTO2 5134
-#define MSG_KOZAWRESTART 546
-#define MSG_LIFT_CLICKBUTTON 2780
-#define MSG_LIFT_CLOSEDOOR 5194
-#define MSG_LIFT_EXITLIFT 5187
-#define MSG_LIFT_GO 1065
-#define MSG_LIFT_STARTEXITQUEUE 5186
-#define MSG_LOWERPLANK 540
#define MSG_MANSHADOWSOFF 5196
#define MSG_MANSHADOWSON 5197
-#define MSG_RAISEPLANK 547
-#define MSG_RESTARTGAME 4767
-#define MSG_SC1_SHOWOSK 1019
-#define MSG_SC1_SHOWOSK2 468
-#define MSG_SC1_UTRUBACLICK 1100
-#define MSG_SC2_HIDELADDER 1023
-#define MSG_SC2_LADDERCLICK 1101
-#define MSG_SC2_PUTMANUP 1026
-#define MSG_SC2_SHOWLADDER 1027
-#define MSG_SC3_HIDEDOMINO 3177
-#define MSG_SC3_ONTAKECOIN 5338
-#define MSG_SC3_RELEASEEGG 2681
-#define MSG_SC3_TAKEEGG 1583
-#define MSG_SC3_TESTFAT 1582
-#define MSG_SC3_UTRUBACLICK 1103
-#define MSG_SC4_COINOUT 2895
-#define MSG_SC4_COINPUT 1032
-#define MSG_SC4_CLICKLADDER 1439
-#define MSG_SC4_DROPBOTTLE 2896
-#define MSG_SC4_HANDOVER 2960
-#define MSG_SC4_HIDEBOOT 4563
-#define MSG_SC4_KOZAWFALL 2858
-#define MSG_SC4_MANFROMBOTTLE 2854
-#define MSG_SC4_MANTOBOTTLE 2852
-#define PIC_SC4_LADDER 1438
-#define MSG_GOTOLADDER 618
-#define MSG_SHAKEBOTTLE 584
-#define MSG_SHOOTKOZAW 557
-#define MSG_SHOWCOIN 1033
-#define MSG_STARTHAND 612
-#define MSG_TAKEBOTTLE 614
-#define MSG_TAKEKOZAW 611
-#define MSG_TESTPLANK 538
-#define MSG_UPDATEBOTTLE 613
-#define MV_EGTR_FATASK 5332
-#define MV_IN1MAN_SLEEP 5111
-#define MV_KZW_JUMP 558
-#define MV_KZW_JUMPROTATE 561
-#define MV_BDG_OPEN 1379
-#define MV_MAN_GOD 481
+#define MV_FLY_FLY 4917
#define MV_MAN_GOLADDER 451
#define MV_MAN_GOLADDER2 2844
-#define MV_MAN_GOU 460
#define MV_MAN_LOOKUP 4773
+#define rMV_MAN_LOOKUP 4775
+#define MV_MAN_TOLADDER 448
+#define MV_MAN_TOLADDER2 2841
#define MV_MAN_STARTLADDER 452
#define MV_MAN_STARTLADDER2 2842
#define MV_MAN_STOPLADDER 454
#define MV_MAN_STOPLADDER2 2845
-#define MV_MAN_TOLADDER 448
-#define MV_MAN_TOLADDER2 2841
#define MV_MAN_TURN_LU 486
-#define MV_PNK_WEIGHTLEFT 541
-#define MV_PNK_WEIGHTRIGHT 502
-#define MV_SC4_COIN_default 1029
-#define MV_SPK4_PLAY 3276
-#define PIC_CMN_EVAL 3468
+#define MV_PBAR_RUN 897
#define PIC_CSR_DEFAULT 4891
#define PIC_CSR_DEFAULT_INV 4892
#define PIC_CSR_ITN 4893
@@ -161,35 +86,90 @@ namespace Fullpipe {
#define PIC_IN1_GAMETITLE 5169
#define PIC_IN1_PIPETITLE 5167
#define PIC_INV_MENU 991
+#define PIC_MAP_A01 5263
+#define PIC_MAP_A02 5264
+#define PIC_MAP_A03 5265
+#define PIC_MAP_A04 5266
+#define PIC_MAP_A05 5267
+#define PIC_MAP_A06 5268
+#define PIC_MAP_A07 5269
+#define PIC_MAP_A08 5270
+#define PIC_MAP_A09 5271
+#define PIC_MAP_A10 5272
+#define PIC_MAP_A11 5273
+#define PIC_MAP_A12 5274
#define PIC_MAP_A13 5275
+#define PIC_MAP_A14 5276
+#define PIC_MAP_I01 5295
+#define PIC_MAP_I02 5296
+#define PIC_MAP_P01 5277
+#define PIC_MAP_P02 5278
+#define PIC_MAP_P03 5279
+#define PIC_MAP_P04 5280
+#define PIC_MAP_P05 5281
+#define PIC_MAP_P06 5282
+#define PIC_MAP_P07 5283
+#define PIC_MAP_P08 5284
+#define PIC_MAP_P09 5285
+#define PIC_MAP_P10 5286
+#define PIC_MAP_P11 5287
+#define PIC_MAP_P12 5288
+#define PIC_MAP_P13 5289
+#define PIC_MAP_P14 5290
+#define PIC_MAP_P15 5291
+#define PIC_MAP_P16 5292
+#define PIC_MAP_P17 5293
+#define PIC_MAP_P18 5294
#define PIC_MAP_S01 5223
-#define PIC_SC1_KUCHKA 1321
-#define PIC_SC1_LADDER 1091
-#define PIC_SC1_OSK 1018
-#define PIC_SC1_OSK2 2932
-#define PIC_SC2_DTRUBA 841
-#define PIC_SC2_LADDER 412
-#define PIC_SC3_DOMIN 5182
-#define PIC_SC3_LADDER 1102
-#define PIC_SC4_BOTTLE 568
-#define PIC_SC4_BOTTLE2 2936
-#define PIC_SC4_DOWNTRUBA 619
-#define PIC_SC4_LADDER 1438
-#define PIC_SC4_LRTRUBA 616
-#define PIC_SC4_MASK 585
-#define PIC_SC4_PLANK 5183
-#define PIC_SCD_SEL 734
-#define QU_EGTR_MD2_SHOW 4698
-#define QU_EGTR_MD1_SHOW 4697
-#define QU_EGTR_SLIMSHOW 4883
-#define QU_IN2_DO 5144
-#define QU_INTR_FINISH 5138
-#define QU_INTR_GETUPMAN 5136
+#define PIC_MAP_S02 5224
+#define PIC_MAP_S03 5225
+#define PIC_MAP_S04 5226
+#define PIC_MAP_S05 5227
+#define PIC_MAP_S06 5228
+#define PIC_MAP_S07 5229
+#define PIC_MAP_S08 5231
+#define PIC_MAP_S09 5230
+#define PIC_MAP_S10 5232
+#define PIC_MAP_S11 5233
+#define PIC_MAP_S12 5234
+#define PIC_MAP_S13 5235
+#define PIC_MAP_S14 5236
+#define PIC_MAP_S15 5237
+#define PIC_MAP_S16 5238
+#define PIC_MAP_S17 5239
+#define PIC_MAP_S1819 5240
+#define PIC_MAP_S20 5241
+#define PIC_MAP_S21 5242
+#define PIC_MAP_S22 5243
+#define PIC_MAP_S23_1 5244
+#define PIC_MAP_S23_2 5245
+#define PIC_MAP_S24 5246
+#define PIC_MAP_S25 5247
+#define PIC_MAP_S26 5248
+#define PIC_MAP_S27 5249
+#define PIC_MAP_S28 5250
+#define PIC_MAP_S29 5251
+#define PIC_MAP_S30 5252
+#define PIC_MAP_S31_1 5253
+#define PIC_MAP_S31_2 5254
+#define PIC_MAP_S32_1 5255
+#define PIC_MAP_S32_2 5256
+#define PIC_MAP_S33 5257
+#define PIC_MAP_S34 5258
+#define PIC_MAP_S35 5259
+#define PIC_MAP_S36 5260
+#define PIC_MAP_S37 5261
+#define PIC_MAP_S38 5262
#define QU_INTR_STARTINTRO 5133
-#define QU_PNK_CLICK 550
-#define QU_SC3_ENTERLIFT 2779
-#define QU_SC3_EXITLIFT 2808
#define SC_1 301
+#define SC_2 302
+#define SC_3 303
+#define SC_4 304
+#define SC_5 305
+#define SC_6 649
+#define SC_7 650
+#define SC_8 651
+#define SC_9 652
#define SC_10 653
#define SC_11 654
#define SC_12 655
@@ -200,7 +180,6 @@ namespace Fullpipe {
#define SC_17 1141
#define SC_18 1142
#define SC_19 1143
-#define SC_2 302
#define SC_20 1144
#define SC_21 1546
#define SC_22 1547
@@ -211,7 +190,6 @@ namespace Fullpipe {
#define SC_27 1552
#define SC_28 2062
#define SC_29 2063
-#define SC_3 303
#define SC_30 2064
#define SC_31 2065
#define SC_32 2066
@@ -221,12 +199,6 @@ namespace Fullpipe {
#define SC_36 2070
#define SC_37 2071
#define SC_38 2072
-#define SC_4 304
-#define SC_5 305
-#define SC_6 649
-#define SC_7 650
-#define SC_8 651
-#define SC_9 652
#define SC_COMMON 321
#define SC_DBGMENU 726
#define SC_FINAL1 4999
@@ -237,23 +209,14 @@ namespace Fullpipe {
#define SC_INTRO2 3907
#define SC_INV 858
#define SC_LDR 635
-#define SC_MAINMENU 4620
#define SC_MAP 5222
-#define SC_TEST 903
-#define SC_TITLES 5166
-#define SND_4_010 3125
-#define SND_4_012 3127
-#define SND_4_033 4990
#define SND_CMN_031 3516
+#define SND_CMN_060 4921
+#define SND_CMN_061 4922
#define SND_CMN_070 5199
#define SND_INTR_019 5220
-#define ST_CLK_CLOSED 590
-#define ST_DYAS_LIES 318
-#define ST_EGTR_MID1 2863
-#define ST_EGTR_MID2 2869
-#define ST_EGTR_SLIM 336
-#define ST_IN1MAN_SLEEP 5112
-#define ST_KZW_EMPTY 498
+#define ST_EGTR_SLIMSORROW 340
+#define ST_FLY_FLY 4918
#define ST_LBN_0N 2832
#define ST_LBN_0P 2833
#define ST_LBN_1N 2753
@@ -275,12 +238,1138 @@ namespace Fullpipe {
#define ST_LBN_9N 2777
#define ST_LBN_9P 2778
#define ST_MAN_EMPTY 476
+#define ST_MAN_GOU 459
#define ST_MAN_RIGHT 325
#define TrubaDown 697
#define TrubaLeft 474
-#define TrubaRight 696
#define TrubaUp 680
-#define rMV_MAN_LOOKUP 4775
+
+// Intro
+#define ANI_IN1MAN 5110
+#define MSG_INTR_ENDINTRO 5139
+#define MSG_INTR_GETUPMAN 5135
+#define MSG_INTR_SWITCHTO1 5145
+#define MSG_INTR_SWITCHTO2 5134
+#define MV_IN1MAN_SLEEP 5111
+#define QU_IN2_DO 5144
+#define QU_INTR_FINISH 5138
+#define QU_INTR_GETUPMAN 5136
+#define ST_IN1MAN_SLEEP 5112
+
+// Scene 1
+#define ANI_BOOT_1 4231
+#define MSG_SC1_SHOWOSK 1019
+#define MSG_SC1_SHOWOSK2 468
+#define MSG_SC1_UTRUBACLICK 1100
+#define PIC_SC1_KUCHKA 1321
+#define PIC_SC1_LADDER 1091
+#define PIC_SC1_OSK 1018
+#define PIC_SC1_OSK2 2932
+#define TrubaRight 696
+
+// Scene 2
+#define ANI_SC2_BOX 1020
+#define ANI_DADAYASHIK 306
+#define MSG_SC2_HIDELADDER 1023
+#define MSG_SC2_LADDERCLICK 1101
+#define MSG_SC2_PUTMANUP 1026
+#define MSG_SC2_SHOWLADDER 1027
+#define PIC_SC2_DTRUBA 841
+#define PIC_SC2_LADDER 412
+#define ST_DYAS_LIES 318
+
+// Scene 3
+#define ANI_DOMINO_3 2732
+#define ANI_EGGEATER 334
+#define ANI_INV_COIN 875
+#define ANI_INV_EGGAPL 1564
+#define ANI_INV_EGGBOOT 1570
+#define ANI_INV_EGGCOIN 1567
+#define ANI_INV_EGGDOM 1561
+#define ANI_INV_EGGGLS 1573
+#define MSG_LIFT_CLICKBUTTON 2780
+#define MSG_LIFT_CLOSEDOOR 5194
+#define MSG_LIFT_EXITLIFT 5187
+#define MSG_LIFT_GO 1065
+#define MSG_LIFT_STARTEXITQUEUE 5186
+#define MSG_SC3_HIDEDOMINO 3177
+#define MSG_SC3_ONTAKECOIN 5338
+#define MSG_SC3_RELEASEEGG 2681
+#define MSG_SC3_TAKEEGG 1583
+#define MSG_SC3_TESTFAT 1582
+#define MSG_SC3_UTRUBACLICK 1103
+#define MV_EGTR_FATASK 5332
+#define PIC_SC3_DOMIN 5182
+#define PIC_SC3_LADDER 1102
+#define ST_EGTR_MID1 2863
+#define ST_EGTR_MID2 2869
+#define ST_EGTR_SLIM 336
+#define QU_EGTR_MD2_SHOW 4698
+#define QU_EGTR_MD1_SHOW 4697
+#define QU_EGTR_SLIMSHOW 4883
+#define QU_SC3_ENTERLIFT 2779
+#define QU_SC3_EXITLIFT 2808
+
+// Scene 4
+#define ANI_BIGBALL 4923
+#define ANI_BUTTON 598
+#define ANI_CLOCK 588
+#define ANI_HAND 601
+#define ANI_KOZAWKA 495
+#define ANI_MAMASHA_4 660
+#define ANI_PLANK 501
+#define ANI_SC4_BOOT 1035
+#define ANI_SC4_COIN 690
+#define ANI_SPEAKER_4 3275
+#define ANI_SPRING 542
+#define MSG_GOTOLADDER 618
+#define MSG_KOZAWRESTART 546
+#define MSG_SC4_COINOUT 2895
+#define MSG_SC4_COINPUT 1032
+#define MSG_SC4_CLICKLADDER 1439
+#define MSG_SC4_DROPBOTTLE 2896
+#define MSG_SC4_HANDOVER 2960
+#define MSG_SC4_HIDEBOOT 4563
+#define MSG_SC4_KOZAWFALL 2858
+#define MSG_SC4_MANFROMBOTTLE 2854
+#define MSG_SC4_MANTOBOTTLE 2852
+#define MSG_SHAKEBOTTLE 584
+#define MSG_SHOOTKOZAW 557
+#define MSG_STARTHAND 612
+#define MSG_CLICKBOTTLE 569
+#define MSG_CLICKBUTTON 609
+#define MSG_CLICKPLANK 549
+#define MSG_LOWERPLANK 540
+#define MSG_RAISEPLANK 547
+#define MSG_SHOWCOIN 1033
+#define MSG_TAKEBOTTLE 614
+#define MSG_TAKEKOZAW 611
+#define MSG_TESTPLANK 538
+#define MSG_UPDATEBOTTLE 613
+#define MV_BTN_CLICK 599
+#define MV_CLK_GO 589
+#define MV_HND_POINT 602
+#define MV_KZW_GOR 564
+#define rMV_KZW_GOR 566
+#define MV_KZW_JUMP 558
+#define MV_KZW_JUMPROTATE 561
+#define MV_KZW_TOHOLERV 537
+#define MV_KZW_WALKPLANK 500
+#define MV_KZW_JUMPHIT 2857
+#define MV_KZW_JUMPOUT 586
+#define MV_KZW_RAISEHEAD 577
+#define MV_KZW_STANDUP 563
+#define MV_KZW_TURN 562
+#define MV_MAN_FROMLADDER 493
+#define MV_MAN_GOD 481
+#define MV_MAN_GOU 460
+#define MV_MAN_JUMPONPLANK 551
+#define MV_MAN_LOOKLADDER 520
+#define MV_MAN_PLANKTOLADDER 553
+#define MV_MAN_STARTLADDERD 457
+#define MV_PNK_WEIGHTLEFT 541
+#define MV_PNK_WEIGHTRIGHT 502
+#define MV_SC4_COIN_default 1029
+#define MV_SPK4_PLAY 3276
+#define MV_SPR_LOWER 543
+#define PIC_MAP_P03 5279
+#define PIC_SC4_BOTTLE 568
+#define PIC_SC4_BOTTLE2 2936
+#define PIC_SC4_DOWNTRUBA 619
+#define PIC_SC4_LADDER 1438
+#define PIC_SC4_LRTRUBA 616
+#define PIC_SC4_MASK 585
+#define PIC_SC4_PLANK 5183
+#define QU_BALL_WALKL 4920
+#define QU_BALL_WALKR 4919
+#define QU_HND_TAKE0 1440
+#define QU_HND_TAKE1 1441
+#define QU_HND_TAKE2 1442
+#define QU_HND_TAKEBOTTLE 1443
+#define QU_KOZAW_WALK 505
+#define QU_PNK_CLICK 550
+#define QU_SC4_GOCLOCK 595
+#define QU_SC4_MANFROMBOTTLE 2851
+#define QU_SC4_MANTOBOTTLE 2850
+#define SND_4_010 3125
+#define SND_4_012 3127
+#define SND_4_033 4990
+#define ST_CLK_CLOSED 590
+#define ST_HND_EMPTY 603
+#define ST_KZW_EMPTY 498
+#define ST_KZW_JUMPOUT 587
+#define ST_KZW_RIGHT 559
+#define ST_KZW_SIT 560
+#define ST_MAN_GOLADDER 450
+#define ST_MAN_GOLADDER2 2843
+#define MV_MAN_LOOKLADDERRV 556
+#define ST_MAN_LADDERDOWN 521
+#define ST_MAN_LOOKPLANK 555
+#define ST_MAN_ONPLANK 552
+#define ST_MAN_SIT 1164
+#define ST_MAN_STANDLADDER 453
+#define ST_MAN_UP 449
+#define ST_PNK_WEIGHTLEFT 503
+#define ST_PNK_WEIGHTRIGHT 504
+#define ST_SPR_UP 544
+
+// Scene 5
+#define ANI_BIGLUK 909
+#define ANI_HANDLE 622
+#define ANI_OTMOROZ 419
+#define MSG_SC5_BGRSOUNDOFF 5315
+#define MSG_SC5_BGRSOUNDON 5314
+#define MSG_SC5_HANDLEDOWN 916
+#define MSG_SC5_HANDLEUP 915
+#define MSG_SC5_HIDEHANDLE 917
+#define MSG_SC5_MAKEMANFLIGHT 1136
+#define MSG_SC5_MAKEOTMFEEDBACK 1169
+#define MSG_SC5_SHOWHANDLE 918
+#define MSG_SC5_TESTLUK 914
+#define MV_BLK_CLOSE 911
+#define MV_BLK_OPEN 910
+#define MV_MANHDL_HANDLEDOWN 630
+#define MV_MANHDL_HANDLEUP 631
+#define MV_OTM_BOXHANDLEDOWN 626
+#define MV_OTM_BOXHANDLEUP 627
+#define MV_OTM_HANDLEDOWN 620
+#define MV_OTM_HANDLEUP 621
+#define QU_SC5_MANBUMP 1167
+#define QU_SC5_MANFLY 1168
+#define SND_5_026 5316
+#define ST_BLK_CLOSED 912
+#define ST_BLK_OPEN 913
+#define ST_HDL_BROKEN 3342
+#define ST_HDL_DOWN 625
+#define ST_HDL_UP 624
+#define ST_OTM_BOX_LEFT 429
+#define ST_OTM_GLS_LEFT 421
+#define ST_OTM_VNT_LEFT 434
+
+// Scene 6
+#define ANI_BALLDROP 2685
+#define ANI_BUTTON_6 2988
+#define ANI_EGGIE 4929
+#define ANI_INV_HANDLE 893
+#define ANI_MAMASHA 656
+#define ANI_NEWBALL 1073
+#define MSG_SC6_BTNPUSH 1017
+#define MSG_SC6_ENABLEDROPS 687
+#define MSG_SC6_INSTHANDLE 1012
+#define MSG_SC6_JUMPBK 2900
+#define MSG_SC6_JUMPFW 2901
+#define MSG_SC6_RESTORESCROLL 2906
+#define MSG_SC6_SHOWNEXTBALL 790
+#define MSG_SC6_STARTDROPS 2897
+#define MSG_SC6_TAKEBALL 682
+#define MSG_SC6_TESTNUMBALLS 2904
+#define MSG_SC6_UTRUBACLICK 1105
+#define MSG_SPINHANDLE 2398
+#define MV_MAN6_TAKEBALL 2691
+#define MV_MAN6_THROWBALL 2692
+#define MV_MOM_CYCLEBK 3012
+#define MV_MOM_JUMPBK 662
+#define MV_MOM_JUMPFW 661
+#define MV_MOM_STARTBK 3010
+#define MV_MOM_STOPBK 3013
+#define MV_MOM_TAKE1 2885
+#define MV_MOM_TAKE2 2886
+#define MV_MOM_TAKE3 2887
+#define MV_MOM_TAKE4 2888
+#define MV_MOM_TAKE5 2889
+#define PIC_SC6_LADDER 1104
+#define QU_EGG6_GOL 4936
+#define QU_EGG6_GOR 4935
+#define QU_MOM_JUMPBK 671
+#define QU_MOM_JUMPFW 670
+#define QU_MOM_PUTBALL 2903
+#define QU_MOM_SITDOWN 685
+#define QU_MOM_STANDUP 2899
+#define QU_MOM_TOLIFT 2902
+#define QU_SC6_DROPS 2898
+#define QU_SC6_DROPS3 2955
+#define QU_SC6_ENTERLIFT 1054
+#define QU_SC6_EXITLIFT 1055
+#define QU_SC6_FALLBALL 2690
+#define QU_SC6_FALLHANDLE 2995
+#define QU_SC6_SHOWHANDLE 1689
+#define QU_SC6_SHOWNEXTBALL 2689
+#define ST_HDL_PLUGGED 2397
+#define ST_MAN6_BALL 2688
+#define ST_MOM_SITS 659
+#define ST_MOM_STANDS 658
+#define ST_NBL_NORM 1076
+
+// Scene 7
+#define ANI_CORNERSITTER 71
+#define ANI_HOOLIGAN 808
+#define ANI_LUKE 803
+#define ANI_PLUSMINUS 2938
+#define ANI_SC7_BOX 791
+#define MSG_SC7_CLOSELUKE 822
+#define MSG_SC7_HIDEBOX 817
+#define MSG_SC7_HIDELUKE 821
+#define MSG_SC7_OPENLUKE 823
+#define MSG_SC7_PULL 2943
+#define MSG_SC7_SHOWBOX 816
+#define MV_CST_CLOSELUKE 807
+#define MV_SC7_BOX_default 792
+#define QU_CST_CLOSELUKE 820
+#define ST_CST_HANDLELESS 794
+#define ST_HGN_LOOK 811
+#define ST_HGN_LUKE 810
+#define ST_LUK_CLOSED 805
+#define ST_LUK_OPEN 806
+#define ST_PMS_MINUS 2942
+#define ST_PMS_PLUS 2941
+
+// Scene 8
+#define ANI_BATUTA 737
+#define ANI_CLOCK_8 2989
+#define ANI_VMYATS 764
+#define MSG_SC8_ARCADENOW 1044
+#define MSG_SC8_ENTERUP 3037
+#define MSG_SC8_GETHIMUP 789
+#define MSG_SC8_HIDELADDER_D 1107
+#define MSG_SC8_RESUMEFLIGHT 784
+#define MSG_SC8_STANDUP 2976
+#define MSG_STARTARCADE 781
+#define MV_CLK8_GO 2990
+#define MV_MAN_FROMLADDERUP 1522
+#define MV_MAN_TOLADDERD 1524
+#define MV_MAN8_BADLUCK 783
+#define MV_MAN8_DRYGDOWN 770
+#define MV_MAN8_DRYGUP 768
+#define MV_MAN8_HANDSDOWN 772
+#define MV_MAN8_HANDSUP 777
+#define MV_MAN8_JUMP 775
+#define MV_MAN8_JUMPOFF 2969
+#define MV_MAN8_SITDOWN 2968
+#define MV_VMT_DEF 765
+#define PIC_SC8_ARCADENOW 1043
+#define PIC_SC8_LADDER 754
+#define PIC_SC8_LADDER_D 755
+#define PIC_SC8_LADDERD 1106
+#define QU_SC8_FINISH 788
+#define QU_SC8_STANDUP 2975
+#define SND_8_014 3624
+#define ST_BTT_CHESHET 746
+#define ST_BTT_NOSPOON 739
+#define ST_BTT_SLEEPS 748
+#define ST_BTT_SPOON 741
+#define ST_MAN8_FLYDOWN 771
+#define ST_MAN8_FLYUP 769
+#define ST_MAN8_HANDSUP 773
+#define ST_MAN8_STAND 774
+#define ST_VMT_MIN 766
+
+// Scene 10
+#define ANI_GUM 978
+#define ANI_NADUVATEL 944
+#define ANI_PACHKA 975
+#define ANI_PACHKA2 3008
+#define MSG_SC10_CLICKGUM 992
+#define MSG_SC10_HIDEGUM 993
+#define MSG_SC10_LADDERTOBACK 3002
+#define MSG_SC10_LADDERTOFORE 3004
+#define MSG_SC10_SHOWGUM 994
+#define MV_NDV_BLOW2 2855
+#define MV_NDV_DENIES 952
+#define MV_NDV_DENY_NOGUM 3022
+#define PIC_SC10_DTRUBA 974
+#define PIC_SC10_LADDER 995
+#define QU_SC10_ENTERLIFT 1067
+#define QU_SC10_EXITLIFT 2809
+#define QU_SC10_TAKEGUM 3026
+#define ST_NDV_SIT 946
+
+// Scene 11
+#define ANI_BOOTS_11 2704
+#define ANI_KACHELI 1094
+#define ANI_MAN11 1108
+#define ANI_SWINGER 1113
+#define MSG_SC11_HITMAN 3019
+#define MSG_SC11_MANCRY 4691
+#define MSG_SC11_MANTOSWING 1128
+#define MSG_SC11_PUTBOOT 1117
+#define MSG_SC11_RESTARTMAN 1133
+#define MSG_SC11_SHOWSWING 1124
+#define MSG_SC11_SITSWINGER 5198
+#define MV_KCH_MOVE2 1099
+#define MV_KCH_START 1121
+#define MV_MAN11_JUMPHIT 1129
+#define MV_MAN11_JUMPFROMSWING 5209
+#define MV_MAN11_JUMPOVER 1131
+#define MV_MAN11_SWING_0 1109
+#define MV_MAN11_SWING_1 1111
+#define MV_MAN11_SWING_2 1112
+#define PIC_SC11_HINT 5170
+#define QU_SC11_MANFALL 3017
+#define QU_SC11_PUTBOOT1 2709
+#define QU_SC11_PUTBOOT2 2710
+#define QU_SC11_RESTARTMAN 1134
+#define QU_SWR_JUMPDOWN 1123
+#define SND_11_020 3704
+#define SND_11_022 3706
+#define SND_11_024 3708
+#define SND_11_031 5171
+#define ST_BTS11_2 2707
+#define ST_BTS11_ONE 2706
+#define ST_KCH_0 1096
+#define ST_KCH_EMPTY 1132
+#define ST_KCH_STATIC 1122
+#define ST_MAN_1PIX 518
+#define ST_MAN11_EMPTY 1110
+#define ST_MAN11_SWING 1127
+#define ST_SWR_SIT 1147
+#define ST_SWR_SITBALD 1153
+#define ST_SWR_STAND3 3014
+
+// Scene 13
+#define ANI_BRIDGE 1378
+#define ANI_HANDLE_L 1209
+#define ANI_HANDLE_R 1196
+#define ANI_STOROZH 1172
+#define ANI_WHIRLGIG_13 1383
+#define MSG_SC13_CHEW 1220
+#define MSG_SC13_CLOSEBRIDGE 3046
+#define MSG_SC13_CLOSEFAST 1267
+#define MSG_SC13_EATGUM 1219
+#define MSG_SC13_OPENBRIDGE 3064
+#define MSG_SC13_OPENFAST 1266
+#define MSG_SC13_SHOWGUM 1215
+#define MSG_SC13_STARTWHIRLGIG 1388
+#define MSG_SC13_STOPWHIRLGIG 1387
+#define MSG_SC13_TESTCLOSE 3065
+#define MSG_SC13_TESTOPEN 3048
+#define MSG_SC13_UNEATGUM 1218
+#define MSG_SC13_UPDATEBRIDGE 1217
+#define MV_BDG_CLOSE 1382
+#define MV_BDG_OPEN 1379
+#define MV_WHR13_SPIN 1384
+#define QU_SC13_CLOSEFAIL 3063
+#define QU_SC13_CLOSESUCCESS 3062
+#define QU_SC13_OPENFAIL 3042
+#define QU_SC13_OPENSUCCESS 3047
+#define QU_SC13_SHOWGUM 1216
+#define QU_STR_CHEW 1190
+#define QU_STR_LTOR 3054
+#define QU_STR_PLUU 1189
+#define QU_STR_RTOL 3053
+#define QU_STR_TURNR 1186
+#define QU_STR_TURNR_L 3059
+#define SND_13_018 3763
+#define SND_13_033 4685
+#define SND_13_034 4686
+#define SND_13_037 5335
+#define ST_BDG_CLOSED 1380
+#define ST_BDG_OPEN2 1381
+#define ST_HDLL_FIRECAN 1310
+#define ST_HDLL_HAMMER 3205
+#define ST_HDLL_UP 1211
+#define ST_HDLR_DOWN 1199
+#define ST_HDLR_DOWN_GUM 3044
+#define ST_HDLR_GUM 1201
+#define ST_STR_LEFT 1175
+#define ST_STR_RIGHT 1174
+
+// Scene 14
+#define ANI_BALL14 1246
+#define ANI_GRANDMA 1227
+#define MSG_SC14_ENDARCADE 3250
+#define MSG_SC14_GMAJUMP 1250
+#define MSG_SC14_GMATOTRUBA 3249
+#define MSG_SC14_HIDEBALLLAST 3251
+#define MSG_SC14_HIDEPINK 3248
+#define MSG_SC14_MANKICKBALL 1257
+#define MSG_SC14_RESTORESCROLL 4769
+#define MSG_SC14_SCROLLLEFT 4768
+#define MSG_SC14_SHOWBALLFLY 1253
+#define MSG_SC14_SHOWBALLGMADIVE 1260
+#define MSG_SC14_SHOWBALLGMAHIT 1259
+#define MSG_SC14_SHOWBALLGMAHIT2 3245
+#define MSG_SC14_SHOWBALLLAST 3246
+#define MSG_SC14_SHOWBALLMAN 1254
+#define MSG_SC14_STARTARCADE 3252
+#define MV_BAL14_FALL 1258
+#define MV_BAL14_SPIN 1247
+#define MV_BAL14_TOGMA 3214
+#define MV_GMA_BACKOFF 1233
+#define MV_GMA_BACKOFF2 3217
+#define MV_GMA_JUMPFW 1230
+#define MV_GMA_THROW 1232
+#define MV_MAN14_DECLINE 1239
+#define MV_MAN14_FALL 1236
+#define MV_MAN14_KICK 1237
+#define MV_MAN14_KICKAIR 1256
+#define MV_MAN14_STEPFW 1240
+#define PIC_SC14_RTRUBA 1221
+#define ST_GMA_SIT 1229
+#define QU_GMA_BLINK 1252
+#define QU_GMA_JUMPBK 1251
+#define QU_GMA_JUMPFW 1249
+#define QU_GMA_THROW 1255
+#define QU_SC14_ENDARCADE 1391
+#define QU_SC14_ENTERLIFT 1225
+#define QU_SC14_EXITLIFT 1226
+#define QU_SC14_STARTARCADE 1390
+#define QU_SC14_WINARCADE 3247
+
+// Scene 15
+#define ANI_BOOT_15 4779
+#define ANI_INV_BOOT 881
+#define ANI_GRANDMA_ASS 1265
+#define MSG_SC15_ASSDRYG 4755
+#define MSG_SC15_LADDERTOBACK 3259
+#define MSG_SC15_PULL 2940
+#define MSG_SC15_STOPCHANTING 4753
+#define MV_SWR_SWING 1114
+#define PIC_SC15_DTRUBA 1263
+#define PIC_SC15_LADDER 3253
+#define PIC_SC15_LTRUBA 1261
+#define QU_SC15_ENTERLIFT 2811
+#define QU_SC15_EXITLIFT 2812
+#define SND_15_001 3798
+#define SND_15_006 3808
+#define SND_15_011 4754
+#define ST_GMS_BOOT 1270
+#define ST_GMS_BOOTLESS2 3316
+
+// Scene 16
+#define ANI_BEARDED_CMN 3420
+#define ANI_BOOT_16 3285
+#define ANI_BOY 1327
+#define ANI_GIRL 1328
+#define ANI_JETTIE 1392
+#define ANI_MUG 1296
+#define ANI_WIRE16 1344
+#define MSG_SC16_FILLMUG 1363
+#define MSG_SC16_HIDEMAN 1357
+#define MSG_SC16_HIDEMUG 1351
+#define MSG_SC16_HIDEWIRE 1349
+#define MSG_SC16_LAUGHSOUND 4993
+#define MSG_SC16_MUGCLICK 1366
+#define MSG_SC16_SHOWBEARDED 4956
+#define MSG_SC16_SHOWMAN 1358
+#define MSG_SC16_SHOWMUG 1352
+#define MSG_SC16_SHOWMUGFULL 1396
+#define MSG_SC16_SHOWWIRE 1350
+#define MSG_SC16_STARTLAUGH 1374
+#define MV_BOY_DRINK 1333
+#define MV_BT16_FILL 3286
+#define MV_GRL_DRINK 1339
+#define MV_GRL_FALL 3115
+#define MV_GRL_LAUGH_POPA 3278
+#define MV_JTI_FLOWBY 1393
+#define MV_JTI_FLOWIN 1394
+#define MV_MAN16_TAKEMUG 1362
+#define PIC_SC16_TUMBA 1368
+#define QU_BRD16_STARTBEARDED 4948
+#define QU_SC16_BOYKICK 1367
+#define QU_SC16_BOYOUT 1364
+#define QU_SC16_GIRLLAUGH 1375
+#define QU_SC16_GIRLOUT 1365
+#define QU_SC16_GOBOY 1347
+#define QU_SC16_GOGIRL 1348
+#define QU_SC16_MANDRINK 5200
+#define QU_SC16_SHOWMUG 1361
+#define QU_SC16_TAKEMUG 1435
+#define SND_16_034 3854
+#define SND_16_035 3855
+#define SND_16_037 3857
+#define ST_BOY_STAND 1331
+#define ST_GRL_LAUGH 1342
+#define ST_GRL_STAND 1337
+#define ST_MUG_EMPTY 1298
+#define ST_MUG_FULL 1360
+
+// Scene 17
+#define ANI_BOOT_17 4220
+#define ANI_HAND17 1446
+#define ANI_INV_BOTTLE 1418
+#define ANI_INV_SUGAR 1410
+#define ANI_JET_17 2746
+#define ANI_MUG_17 2737
+#define ANI_SAMOGONSHCHIK 1397
+#define MSG_SC17_DROP 3414
+#define MSG_SC17_FILLBOTTLE 1436
+#define MSG_SC17_HIDESUGAR 1417
+#define MSG_SC17_SHOWBOTTLE 1432
+#define MSG_SC17_SHOWSUGAR 1416
+#define MSG_SC17_TESTTRUBA 1458
+#define MSG_SC17_UPDATEHAND 1560
+#define MV_HND17_FIGA 1449
+#define PIC_SC17_RTRUBA 1323
+#define PIC_SC17_RTRUBA2 5297
+#define QU_HND17_ASK 1456
+#define QU_HND17_ATTRACT 1455
+#define QU_HND17_TOCYCLE 1454
+#define QU_JET17_DROP 3295
+#define QU_JET17_FLOW 3294
+#define QU_SC17_FILLBOOT 4237
+#define QU_SC17_FILLBOTTLE 1437
+#define QU_SC17_FILLMUG 2750
+#define QU_SC17_FILLMUG_DROP 3415
+#define QU_SC17_SHOWBOTTLE 1429
+#define QU_SC17_SHOWSUGAR 1415
+#define QU_SMG_FILLBOTTLE 1433
+#define ST_HND17_ATTRACT 1451
+#define ST_HND17_EMPTY 1448
+#define ST_MUG17_EMPTY 2739
+#define ST_SMG_SIT 1399
+
+// Scene 18
+#define PIC_SC18_RTRUBA 1520
+
+// Scene 19
+#define PIC_SC19_RTRUBA3 1515
+
+// Scene 20
+#define ANI_GRANDMA_20 2427
+#define MSG_SC20_UPDATELOCKABLE 5217
+#define ST_GMA20_FLOOR 2429
+#define ST_GMA20_STAND 2436
+#define ST_GMA20_STOOL 2432
+
+// Scene 21
+#define ANI_GIRAFFE_BOTTOM 1633
+#define ANI_INV_BOX 890
+#define ANI_INV_STOOL 1780
+#define MSG_SC21_UPDATEASS 4211
+#define PIC_SC21_DTRUBA 1823
+#define ST_GRFB_SIT 1687
+#define ST_GRFB_HANG 1638
+
+// Scene 22
+#define ANI_GIRAFFE_MIDDLE 1981
+#define ANI_MESHOK 1754
+#define ANI_TABURETTE 1745
+#define MSG_SC22_CHECKGMABOOT 4782
+#define MSG_SC22_CRANEOUT_GMA 5218
+#define MSG_SC22_FROMSTOOL 1799
+#define MSG_SC22_HANDLEDOWN 1796
+#define MSG_SC22_HIDESTOOL 2503
+#define MSG_SC22_ONSTOOL 1798
+#define MSG_SC22_SHOWSTOOL 2495
+#define QU_MSH_CRANEOUT 1811
+#define QU_MSH_CRANEOUT_GMA 5219
+#define QU_SC22_FALLBROOM 1786
+#define QU_SC22_FALLSACK 1791
+#define QU_SC22_FALLSACK_GMA 2613
+#define QU_SC22_FROMSTOOL 1800
+#define QU_SC22_HANDLEDOWN 1804
+#define QU_SC22_PUTSTOOL 1803
+#define QU_SC22_SHOWSTOOL 1793
+#define QU_SC22_TOSTOOL 1801
+#define QU_SC22_TOSTOOL_R 3332
+#define QU_SC22_TRYBOX 5311
+#define QU_SC22_TRYHANDLE 1802
+#define QU_MSH_MOVE 1812
+#define rMV_MAN_TURN_SRL 1090
+#define ST_GRFM_AFTER 3472
+#define ST_GRFM_NORM 1983
+#define ST_MSH_SIT 1756
+
+// Scene 23
+#define ANI_CALENDWHEEL 1702
+#define ANI_GIRAFFE_TOP 1645
+#define ANI_GIRAFFEE 1672
+#define ANI_HANDLE23 1978
+#define ANI_INV_LEVERHANDLE 1777
+#define ANI_LUK23_D 1813
+#define ANI_LUK23_U 1817
+#define MSG_SC23_CLICKBTN1 1736
+#define MSG_SC23_CLICKBTN2 1737
+#define MSG_SC23_CLICKBTN3 1738
+#define MSG_SC23_CLICKBTN4 1739
+#define MSG_SC23_FROMSTOOL 3339
+#define MSG_SC23_HIDEGIRAFFEE 4650
+#define MSG_SC23_ONSTOOL 3334
+#define MSG_SC23_SPINWHEEL1 1740
+#define MSG_SC23_SPINWHEEL2 1741
+#define MSG_SC23_SPINWHEEL3 1742
+#define MSG_SC23_SPINWHEEL4 1743
+#define MV_CND_0_1 1703
+#define MV_CND_1_2 1706
+#define MV_CND_2_3 1708
+#define MV_CND_3_4 1710
+#define MV_CND_4_5 1712
+#define MV_CND_5_6 1714
+#define MV_CND_6_7 1716
+#define MV_CND_7_8 1718
+#define MV_CND_8_9 1720
+#define MV_CND_9_0 1722
+#define MV_MAN23_PUSH1 1724
+#define MV_MAN23_PUSH2 1725
+#define MV_MAN23_PUSH3 1726
+#define MV_MAN23_PUSH4 1727
+#define PIC_SC23_BOXCLOSED 1728
+#define PIC_SC23_BOXOPEN 1723
+#define PIC_SC23_BTN1 1729
+#define PIC_SC23_BTN2 1730
+#define PIC_SC23_BTN3 1731
+#define PIC_SC23_BTN4 1732
+#define PIC_SC23_LADDER 1628
+#define PIC_SC23_LADDERU 3411
+#define QU_GRFU_TURN_UD 1664
+#define QU_GRFU_TURN_UL 1662
+#define QU_SC23_FROMCALENDAR 1734
+#define QU_SC23_FROMCALENDAREXIT 1735
+#define QU_SC23_FROMSTOOL 3338
+#define QU_SC23_SHOWSTOOL 3335
+#define QU_SC23_STARTKISS 1822
+#define QU_SC23_TOCALENDAR 1733
+#define ST_CND_0 1704
+#define ST_CND_1 1705
+#define ST_CND_2 1707
+#define ST_CND_3 1709
+#define ST_CND_4 1711
+#define ST_CND_5 1713
+#define ST_CND_6 1715
+#define ST_CND_7 1717
+#define ST_CND_8 1719
+#define ST_CND_9 1721
+#define ST_GRFG_BALD 1675
+#define ST_GRFG_EMPTY 1674
+#define ST_GRFU_KISS 1681
+#define ST_GRFU_UP 1648
+#define ST_LUK23_OPEN 1816
+#define ST_LUK23_WHANDLE2 1977
+#define ST_LUK23U_CLOSED 1819
+#define ST_LUK23U_OPEN 1820
+
+// Scene 24
+#define ANI_DROP_24 3505
+#define ANI_INV_HAMMER 884
+#define ANI_JET24 1837
+#define ANI_WATER24 1834
+#define MV_MAN_TURN_RL 332
+#define MV_WTR24_FLOW 1835
+#define MV_WTR24_FLOWLOWER 1844
+#define MV_JET24_FLOW 1838
+#define QU_DRP24_TOFLOOR 3510
+#define QU_DRP24_TOWATER 3509
+#define QU_DRP24_TOWATER2 4046
+#define SND_24_006 4041
+#define SND_24_007 4042
+#define ST_DRP24_EMPTY 3507
+#define ST_WTR24_FLOWLOWER 1843
+
+// Scene 25
+#define ANI_BEARDED_CMN 3420
+#define ANI_BOARD25 1898
+#define ANI_DROP_25 3499
+#define ANI_INV_BOARD 1872
+#define ANI_INV_BROOM 1774
+#define ANI_INV_LOPAT 1920
+#define ANI_INV_SWAB 1917
+#define ANI_WATER25 1856
+#define MSG_BRD_TURN 4877
+#define MSG_SC25_ENTERMAN 1861
+#define MSG_SC25_ENTERTRUBA 4214
+#define MSG_SC25_STARTBEARDEDS 3423
+#define MSG_SC25_STOPBEARDEDS 3424
+#define MSG_SC25_TOLADDER 4215
+#define MV_MAN_GOLADDERDOWN 455
+#define MV_MAN25_CHIH 1886
+#define rMV_MAN25_CHIH 3343
+#define MV_BRD25_RIGHT 1899
+#define rMV_BRD25_RIGHT 1903
+#define MV_MAN25_ONBOARD 1885
+#define rMV_MAN25_ONBOARD 1966
+#define MV_WTR25_FLOW 1857
+#define PIC_SC25_LADDERDOWN 1855
+#define PIC_SC25_LADDERUP 1854
+#define PIC_SC25_RTRUBA 1853
+#define QU_DRP25_TOFLOOR 3502
+#define QU_DRP25_TOWATER 3504
+#define QU_SC25_BACKTOLADDER 1955
+#define QU_SC25_BACKTOTRUBA 2061
+#define QU_SC25_BEARDED 3425
+#define QU_SC25_BEARDED2 3426
+#define QU_SC25_BEARDED3 3427
+#define QU_SC25_BOARDTOLADDER 1911
+#define QU_SC25_ENTERUP_FLOOR 1904
+#define QU_SC25_ENTERUP_WATER 1895
+#define QU_SC25_LADDERUP 1925
+#define QU_SC25_MANTOTRUBA 1905
+#define QU_SC25_MANTOTRUBA_R 4218
+#define QU_SC25_PUTBOARD 1896
+#define QU_SC25_ROWTOLADDER 1910
+#define QU_SC25_ROWTOTRUBA 1897
+#define QU_SC25_TRUBATOBOARD 1909
+#define QU_SC25_TRYBROOM 1912
+#define QU_SC25_TRYHAND 4219
+#define QU_SC25_TRYROWHAND 3493
+#define QU_SC25_TRYROWHAND_R 3494
+#define QU_SC25_TRYSPADE 3498
+#define QU_SC25_TRYSWAB 1913
+#define QU_SC25_TRYWATER 1906
+#define SND_25_006 4059
+#define SND_25_025 4874
+#define SND_25_026 4875
+#define SND_25_027 4876
+#define SND_25_028 5173
+#define SND_25_029 5174
+#define SND_25_030 5175
+#define ST_BRD25_RIGHT2 1902
+#define ST_BRDCMN_EMPTY 3422
+#define ST_DRP25_EMPTY 3501
+#define ST_MAN_GOLADDERD 456
+#define ST_MAN_LADDERDOWN_R 3419
+#define ST_MAN25_ONBOARD 1879
+
+// Scene 26
+#define ANI_CHHI 1957
+#define ANI_DROP_26 3345
+#define ANI_INV_SOCK 1698
+#define ANI_INV_VENT 1968
+#define ANI_LUK26 1867
+#define ANI_SOCK_26 4553
+#define ANI_VENT 1927
+#define MSG_SC26_CLICKVENT 1947
+#define MSG_SC26_HIDECHI 1967
+#define MSG_SC26_HIDEVENT 1945
+#define MSG_SC26_SHOWCHI 3495
+#define MSG_SC26_SHOWVENT 1946
+#define MSG_SC26_TESTVENT 1952
+#define MSG_SC26_UPDATEDROP 3496
+#define MSG_SC26_UPDATEPOOL 1956
+#define PIC_SC26_LTRUBA 1864
+#define PIC_SC26_SOCK 5312
+#define QU_CHI_HIDE 1965
+#define QU_CHI_SHOW 1964
+#define QU_SC26_AUTOCLOSE1 1949
+#define QU_SC26_AUTOCLOSE2 1950
+#define QU_SC26_AUTOCLOSE3 1951
+#define QU_SC26_CLOSE1 1936
+#define QU_SC26_CLOSE2 1938
+#define QU_SC26_CLOSE3 1940
+#define QU_SC26_CLOSE4 1942
+#define QU_SC26_CLOSE5 1944
+#define QU_SC26_OPEN1 1935
+#define QU_SC26_OPEN2 1937
+#define QU_SC26_OPEN3 1939
+#define QU_SC26_OPEN4 1941
+#define QU_SC26_OPEN5 1943
+#define SND_26_003 4079
+#define SND_26_018 5340
+#define SND_26_019 5341
+#define SND_26_020 5342
+#define ST_CHI_EMPTY 1959
+#define ST_CHI_NORM 1960
+#define ST_VNT26_RIGHT2 3348
+#define ST_VNT26_UP2 1948
+
+// Scene 28
+#define ANI_LIFT 982
+#define ANI_LIFT_28 4238
+#define ANI_MAN_28 4247
+#define ANI_TIOTIA 4286
+#define MSG_SC28_CLICKLIFT 4258
+#define MSG_SC28_ENDCABIN 3456
+#define MSG_SC28_ENDLIFT1 4259
+#define MSG_SC28_ENDLIFT6 4244
+#define MSG_SC28_LIFT1_SHOWAFTER 4261
+#define MSG_SC28_LIFT6INSIDE 5354
+#define MSG_SC28_LIFT6MUSIC 5355
+#define MSG_SC28_MAKEFACES 4684
+#define MSG_SC28_STARTWORK1 4255
+#define MSG_SC28_TRYVTORPERS 4961
+#define MSG_SC28_TURNOFF_0 4678
+#define MSG_SC28_TURNOFF_1 4279
+#define MSG_SC28_TURNOFF_2 4277
+#define MSG_SC28_TURNOFF_3 4275
+#define MSG_SC28_TURNOFF_4 4282
+#define MSG_SC28_TURNOFF_6 4273
+#define MSG_SC28_TURNON4 4280
+#define MSG_SC28_TURNON_0 4677
+#define MSG_SC28_TURNON_1 4278
+#define MSG_SC28_TURNON_2 4276
+#define MSG_SC28_TURNON_3 4274
+#define MSG_SC28_TURNON_4 4281
+#define MSG_SC28_TURNON_6 4272
+#define MV_WMN28_IN_1 3443
+#define MV_WMN28_IN_2 3445
+#define MV_WMN28_IN_3 3446
+#define MV_WMN28_IN_4 3447
+#define MV_WMN28_IN_5 3448
+#define PIC_SC28_DARK0 4675
+#define PIC_SC28_DARK1 4266
+#define PIC_SC28_DARK2 4267
+#define PIC_SC28_DARK3 4268
+#define PIC_SC28_DARK4 4269
+#define PIC_SC28_DARK5 4270
+#define PIC_SC28_DARK6 4271
+#define QU_BRD28_GOL 4960
+#define QU_BRD28_GOR 4959
+#define QU_GLV28_GOL 4958
+#define QU_GLV28_GOR 4957
+#define QU_SC28_LIFT0_START 4676
+#define QU_SC28_LIFT1_START 4254
+#define QU_SC28_LIFT1_WORK 4256
+#define QU_SC28_LIFT2_START 4246
+#define QU_SC28_LIFT3_START 4245
+#define QU_SC28_LIFT5_START 4674
+#define QU_SC28_LIFT6_END 3563
+#define QU_SC28_LIFT6_START 4243
+#define QU_SC28_LIFT6_START2 4295
+#define QU_SC28_WMN_START 3452
+#define ST_MAN28_RIGHT 4249
+
+// Scene 30
+#define ANI_LEG 2322
+#define MSG_SC30_UPDATEPATH 2358
+#define PIC_SC30_LTRUBA 2354
+#define QU_SC30_ENTERLIFT 2823
+#define QU_SC30_EXITLIFT 2824
+#define ST_LEG_DOWN 2325
+#define ST_LEG_DOWN1 2330
+#define ST_LEG_DOWN2 2334
+#define ST_LEG_EMPTY 2338
+#define ST_LEG_UP 2324
+
+// Scene 31
+#define LiftDown 1058
+#define LiftUp 1057
+#define ANI_CACTUS_31 2456
+#define MSG_SC31_PULL 2944
+#define MSG_SC31_TESTCACTUS 5095
+#define SND_31_001 4377
+#define ST_CTS31_GROWN2 2472
+
+// Scene 32
+#define ANI_BUTTON_32 5347
+#define ANI_CACTUS 2267
+#define ANI_FLAG 2257
+#define ANI_KADKA 2670
+#define ANI_TESTO_BLUE 2659
+#define ANI_TESTO_GREEN 2662
+#define ANI_TESTO_ORANGE 2656
+#define MSG_SC32_ONLADDER 2270
+#define MSG_SC32_SPIN 2405
+#define MSG_SC32_STARTCACTUS 2414
+#define MSG_SC32_STARTFLAGLEFT 2310
+#define MSG_SC32_STARTFLAGRIGHT 2309
+#define MSG_SC32_STOPFLAG 2311
+#define MSG_SC32_TRUBATOBACK 5181
+#define MSG_SC32_TRUBATOFRONT 5180
+#define MSG_SC32_TRYSIT 2294
+#define MV_CTS_DEFAULT 4299
+#define MV_FLG_CYCLEL 2262
+#define MV_FLG_CYCLER 2266
+#define MV_FLG_STARTL 2258
+#define MV_FLG_STARTR 2263
+#define MV_FLG_STOPL 2261
+#define MV_FLG_STOPR 2265
+#define MV_MAN32_SITDOWN 2276
+#define MV_MAN32_STANDUP 2313
+#define MV_TSTG_FLOW 2663
+#define MV_TSTO_FLOW 2657
+#define PIC_SC32_LADDER 4296
+#define PIC_SC32_RTRUBA 2292
+#define QU_CTS_BACK 2415
+#define QU_CTS_GROW 2416
+#define QU_CTS_GROWMAN 2417
+#define QU_KBK32_GO 4977
+#define QU_KBK32_START 4982
+#define QU_KDK_DRIZZLE 4301
+#define QU_SC32_ENTERLIFT 2827
+#define QU_SC32_EXITLIFT 2828
+#define QU_SC32_FALLHANDLE 5351
+#define QU_SC32_FROMLADDER 4300
+#define QU_SC32_SHOWHANDLE 2399
+#define ST_BTN32_OFF 5349
+#define ST_BTN32_ON 5350
+#define ST_CTS_EMPTY 2269
+#define ST_CTS_GROWUP 2467
+#define ST_FLG_LEFT 2260
+#define ST_FLG_NORM 2259
+#define ST_FLG_RIGHT 2264
+#define ST_HDL_LAID 3039
+#define ST_MAN32_SIT 2277
+
+// Scene 33
+#define ANI_KUBIK 4963
+#define ANI_JETTIE_FLOW 2627
+#define ANI_MUG_33 2623
+#define ANI_VENT_33 2637
+#define MSG_SC33_HANDLEDOWN 2643
+#define MSG_SC33_POUR 2645
+#define MSG_SC33_TESTMUG 5185
+#define MSG_SC33_TRYKUBIK 4980
+#define MSG_SC33_UPDATEKUBIK 5346
+#define MV_JTI33_FLOW 2628
+#define MV_JTI33_POUR 2630
+#define MV_JTI33_POURFULL 4455
+#define MV_VNT33_TURND 2638
+#define MV_VNT33_TURNR 2641
+#define PIC_SC33_LTRUBA 2618
+#define PIC_SC33_ZONES 5298
+#define QU_KBK33_GO 4978
+#define QU_KBK33_START 4983
+#define QU_SC33_STARTWATER 2644
+#define ST_MUG33_EMPTY 2625
+#define ST_MUG33_FULL 2626
+#define ST_VNT33_DOWN 2640
+#define ST_VNT33_RIGHT 2639
+
+// Scene 34
+#define ANI_BOOT_34 4560
+#define ANI_BOX_34 2498
+#define ANI_CACTUS_34 2381
+#define ANI_LUK_34 2541
+#define ANI_STOOL_34 2486
+#define ANI_VENT_34 2473
+#define MSG_SC34_CLIMB 2490
+#define MSG_SC34_CLIMBBOX 4571
+#define MSG_SC34_FROMCACTUS 4313
+#define MSG_SC34_LEAVEBOARD 2576
+#define MSG_SC34_ONBOARD 2550
+#define MSG_SC34_ONBUMP 5313
+#define MSG_SC34_ONCACTUS 2482
+#define MSG_SC34_RETRYVENT 5210
+#define MSG_SC34_SHOWBOX 2497
+#define MSG_SC34_SHOWVENT 2481
+#define MSG_SC34_TESTVENT 2557
+#define MSG_SC34_UNCLIMB 2492
+#define MV_MAN34_TRY 2485
+#define MV_MAN34_TRYTABUR 2489
+#define MV_MAN34_TURNVENT_L 4307
+#define MV_MAN34_TURNVENT_R 2500
+#define QU_SC34_ENTERLIFT 2819
+#define QU_SC34_EXITLIFT 2820
+#define QU_SC34_FROMBOX 2494
+#define QU_SC34_FROMBOX_FLOOR 4572
+#define QU_SC34_FROMCACTUS 4312
+#define QU_SC34_FROMSTOOL 2491
+#define QU_SC34_LEAVEBOARD 2575
+#define QU_SC34_SHOWSTOOL 2496
+#define QU_CTS34_FALLEFT 4316
+#define QU_CTS34_FALLRIGHT 4317
+#define QU_LUK34_CLOSE 2547
+#define QU_LUK34_OPEN 2546
+#define ST_CTS34_EMPTY 2383
+#define ST_CTS34_GROWNEMPTY2 2475
+#define ST_LUK34_CLOSED 2543
+#define ST_LUK34_OPEN 2544
+#define ST_STL34_BOX2 4305
+#define ST_VNT34_RIGHT3 4318
+#define ST_VNT34_UP2 4310
+
+// Scene 35
+#define ANI_HOSE 2424
+#define ANI_PUZODUV 2418
+#define MSG_SC35_CHECKPIPESOUND 4761
+#define MSG_SC35_PLUGHOSE 2524
+#define MSG_SC35_SHRINK 2570
+#define MSG_SC35_STARTFLOW 2523
+#define MSG_SC35_STOPFLOW 4864
+#define MSG_SC35_TRYFLY 4985
+#define QU_PDV_SML_BLINK 2553
+#define QU_PDV_SML_TRY 2554
+#define QU_SC35_EATHOZE 2540
+#define QU_SC35_ENTERLIFT 2815
+#define QU_SC35_EXITLIFT 2816
+#define SND_35_011 4509
+#define SND_35_012 4510
+#define SND_35_026 4863
+#define ST_HZE_NORM 2426
+#define ST_PDV_LARGE 2421
+#define ST_PDV_SMALL 2420
+
+// Scene 36
+#define ANI_SCISSORS_36 2647
+#define ANI_ROTOHRUST 2360
+#define PIC_SC36_MASK 5221
+#define ST_RHT_OPEN 2362
+
+// Scene 37
+#define ANI_GUARD_37 2588
+#define ANI_RING 2604
+#define MSG_SC37_EXITLEFT 5006
+#define MSG_SC37_PULL 2945
+#define MV_GRD37_PULL 2589
+#define MV_RNG_CLOSE 2605
+#define MV_RNG_OPEN 4612
+#define PIC_SC37_MASK 2608
+#define SND_37_007 4547
+#define ST_GRD37_STAND 2590
+#define ST_RNG_CLOSED2 4865
+#define ST_RNG_OPEN 2606
+
+// Scene 38
+#define ANI_BOTTLE38 2188
+#define ANI_DOMINO38 2200
+#define ANI_DOMINOS 3317
+#define ANI_DYLDA 2169
+#define ANI_GLAVAR 2154
+#define ANI_MALYSH 2165
+#define MSG_SC38_DRINK 2225
+#define MSG_SC38_HMRKICK 2224
+#define MSG_SC38_POINT 2226
+#define MSG_SC38_POSTHMRKICK 2256
+#define MSG_SC38_PROPOSE 2287
+#define MSG_SC38_TRYTAKEBOTTLE 3179
+#define MV_DMS_FOUR 3322
+#define MV_DMS_THREE 3321
+#define MV_GLV_LOOKMAN 2167
+#define ST_DMS_3 3319
+#define ST_DMS_4 3320
+#define ST_GLV_HAMMER 2156
+#define ST_GLV_NOHAMMER 2159
+#define ST_MLS_LEFT2 2291
+#define QU_DLD_DENY 2218
+#define QU_GLV_TOSMALL 2208
+#define QU_GLV_TOSMALL_NOHMR 2209
+#define QU_MLS_TURNR 2221
+#define QU_SC38_SHOWBOTTLE 2199
+#define QU_SC38_SHOWBOTTLE_ONTABLE 2838
+#define QU_SC38_ENTERLIFT 2836
+#define QU_SC38_EXITLIFT 2837
+
+// Debug scene
+#define MSG_RESTARTGAME 4767
+#define PIC_SCD_1 727
+#define PIC_SCD_2 728
+#define PIC_SCD_3 729
+#define PIC_SCD_4 730
+#define PIC_SCD_5 731
+#define PIC_SCD_6 732
+#define PIC_SCD_7 733
+#define PIC_SCD_8 756
+#define PIC_SCD_9 907
+#define PIC_SCD_10 981
+#define PIC_SCD_11 1098
+#define PIC_SCD_12 857
+#define PIC_SCD_13 1195
+#define PIC_SCD_14 1224
+#define PIC_SCD_15 1278
+#define PIC_SCD_16 1299
+#define PIC_SCD_17 1305
+#define PIC_SCD_18 1306
+#define PIC_SCD_19 1319
+#define PIC_SCD_20 1622
+#define PIC_SCD_21 1623
+#define PIC_SCD_22 1624
+#define PIC_SCD_23 1625
+#define PIC_SCD_24 1845
+#define PIC_SCD_25 1846
+#define PIC_SCD_26 1847
+#define PIC_SCD_27 1916
+#define PIC_SCD_28 2098
+#define PIC_SCD_29 2099
+#define PIC_SCD_30 2359
+#define PIC_SCD_31 2566
+#define PIC_SCD_32 2312
+#define PIC_SCD_33 2636
+#define PIC_SCD_34 2389
+#define PIC_SCD_35 2412
+#define PIC_SCD_36 2567
+#define PIC_SCD_37 2568
+#define PIC_SCD_38 2228
+#define PIC_SCD_FIN 5026
+#define PIC_SCD_SEL 734
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/floaters.cpp b/engines/fullpipe/floaters.cpp
index 384bfa2150..9e5ca7b3f1 100644
--- a/engines/fullpipe/floaters.cpp
+++ b/engines/fullpipe/floaters.cpp
@@ -22,23 +22,233 @@
#include "fullpipe/fullpipe.h"
#include "fullpipe/floaters.h"
+#include "fullpipe/utils.h"
+#include "fullpipe/objects.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/objectnames.h"
namespace Fullpipe {
+Floaters::~Floaters() {
+ delete _hRgn;
+}
+
void Floaters::init(GameVar *var) {
- warning("STUB: Floaters::init()");
+ _array1.clear();
+ _array2.clear();
+
+ GameVar *varFliers = var->getSubVarByName(sO_Fliers);
+
+ if (!varFliers)
+ return;
+
+ GameVar *sub = varFliers->getSubVarByName("flyIdleRegion");
+
+ if (sub) {
+ _hRgn = new ReactPolygonal();
+
+ _hRgn->_pointCount = sub->getSubVarsCount();
+ _hRgn->_points = (Common::Point **)malloc(sizeof(Common::Point *) * _hRgn->_pointCount);
+
+ sub = sub->_subVars;
+
+ int idx = 0;
+
+ while (sub) {
+ _hRgn->_points[idx] = new Common::Point;
+ _hRgn->_points[idx]->x = sub->_subVars->_value.intValue;
+ _hRgn->_points[idx]->y = sub->_subVars->_nextVarObj->_value.intValue;
+
+ idx++;
+ sub = sub->_nextVarObj;
+ }
+ }
+
+ sub = varFliers->getSubVarByName("flyIdlePath");
+
+ if (sub) {
+ _array1.reserve(sub->getSubVarsCount());
+
+ sub = sub->_subVars;
+
+ int idx = 0;
+
+ while (sub) {
+ FloaterArray1 *f = new FloaterArray1;
+
+ f->val1 = sub->_subVars->_value.intValue;
+ f->val2 = sub->_subVars->_nextVarObj->_value.intValue;
+
+ _array1.push_back(f);
+
+ idx++;
+ sub = sub->_nextVarObj;
+ }
+
+ }
}
-void Floaters::genFlies(Scene *sc, int x, int y, int a5, int a6) {
- warning("STUB: Floaters::genFlies()");
+void Floaters::genFlies(Scene *sc, int x, int y, int priority, int flags) {
+ StaticANIObject *ani = new StaticANIObject(g_fp->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_FLY, -1));
+
+ ani->_statics = ani->getStaticsById(ST_FLY_FLY);
+ ani->_movement = 0;
+ ani->setOXY(x, y);
+ ani->_flags |= 4;
+ ani->_priority = priority;
+
+ sc->addStaticANIObject(ani, 1);
+
+ ani->startAnim(MV_FLY_FLY, 0, -1);
+
+ int nummoves;
+
+ if (ani->_movement->_currMovement)
+ nummoves = ani->_movement->_currMovement->_dynamicPhases.size();
+ else
+ nummoves = ani->_movement->_dynamicPhases.size();
+
+ ani->_movement->setDynamicPhaseIndex(g_fp->_rnd->getRandomNumber(nummoves - 1));
+
+ FloaterArray2 *arr2 = new FloaterArray2;
+
+ arr2->ani = ani;
+ arr2->val11 = 15.0;
+ arr2->val3 = y;
+ arr2->val5 = y;
+ arr2->val2 = x;
+ arr2->val4 = x;
+ arr2->fflags = flags;
+
+ _array2.push_back(arr2);
}
void Floaters::update() {
- warning("STUB: Floaters::update()");
+ for (uint i = 0; i < _array2.size(); ++i) {
+ if (_array2[i]->val13 <= 0) {
+ if (_array2[i]->val4 != _array2[i]->val2 || _array2[i]->val5 != _array2[i]->val3) {
+ if (_array2[i]->val9 < 2.0)
+ _array2[i]->val9 = 2.0;
+
+ int dy = _array2[i]->val3 - _array2[i]->val5;
+ int dx = _array2[i]->val2 - _array2[i]->val4;
+ double dst = sqrt((double)(dy * dy + dx * dx));
+ double at = atan2((double)dx, (double)dy);
+ int newX = (int)(cos(at) * _array2[i]->val9);
+ int newY = (int)(sin(at) * _array2[i]->val9);
+
+ if (dst < _array2[i]->val9) {
+ newX = _array2[i]->val2 - _array2[i]->val4;
+ newY = _array2[i]->val3 - _array2[i]->val5;
+ }
+ if (dst <= 30.0) {
+ if (dst < 30.0) {
+ _array2[i]->val9 = _array2[i]->val9 - _array2[i]->val9 * 0.5;
+
+ if (_array2[i]->val9 < 2.0)
+ _array2[i]->val9 = 2.0;
+ }
+ } else {
+ _array2[i]->val9 = _array2[i]->val9 * 0.5 + _array2[i]->val9;
+
+ if (_array2[i]->val9 > _array2[i]->val11)
+ _array2[i]->val9 = _array2[i]->val11;
+ }
+
+ _array2[i]->val4 += newX;
+ _array2[i]->val5 += newY;
+ _array2[i]->ani->setOXY(newX + _array2[i]->ani->_ox, newY + _array2[i]->ani->_oy);
+
+ if (_array2[i]->val4 == _array2[i]->val2 && _array2[i]->val5 == _array2[i]->val3) {
+ _array2[i]->val9 = 0.0;
+
+ _array2[i]->val13 = g_fp->_rnd->getRandomNumber(200) + 20;
+
+ if (_array2[i]->fflags & 1) {
+ g_fp->_currentScene->deleteStaticANIObject(_array2[i]->ani);
+
+ if (_array2[i]->ani)
+ delete _array2[i]->ani;
+
+ _array2.remove_at(i);
+
+ i--;
+
+ if (!_array2.size())
+ g_fp->stopAllSoundInstances(SND_CMN_060);
+
+ continue;
+ }
+ }
+ } else {
+ if ((_array2[i]->fflags & 4) && _array2[i]->countdown < 1) {
+ _array2[i]->fflags |= 1;
+ _array2[i]->val2 = _array2[i]->val6;
+ _array2[i]->val3 = _array2[i]->val7;
+ } else {
+ if (_array2[i]->fflags & 2) {
+ int idx1 = g_fp->_rnd->getRandomNumber(_array1.size() - 1);
+
+ _array2[i]->val2 = _array1[idx1]->val1;
+ _array2[i]->val3 = _array1[idx1]->val2;
+ } else {
+ Common::Rect rect;
+
+ if (!_hRgn)
+ error("Floaters::update(): empty fliers region");
+
+ _hRgn->getBBox(&rect);
+
+ int x2 = rect.left + g_fp->_rnd->getRandomNumber(rect.right - rect.left);
+ int y2 = rect.top + g_fp->_rnd->getRandomNumber(rect.bottom - rect.top);
+
+ if (_hRgn->pointInRegion(x2, y2)) {
+ int dx = _array2[i]->val2 - x2;
+ int dy = _array2[i]->val3 - y2;
+ double dst = sqrt((double)(dy * dy + dx * dx));
+
+ if (dst < 300.0 || !_hRgn->pointInRegion(_array2[i]->val4, _array2[i]->val5)) {
+ _array2[i]->val2 = x2;
+ _array2[i]->val3 = y2;
+ }
+ }
+ }
+
+ g_fp->playSound(SND_CMN_061, 0);
+
+ if (_array2[i]->fflags & 4)
+ _array2[i]->countdown--;
+ }
+ }
+ } else {
+ _array2[i]->val13--;
+ }
+
+ if (!_array2[i]->ani->_movement && _array2[i]->ani->_statics->_staticsId == ST_FLY_FLY) {
+ if (!_array2[i]->val15) {
+ g_fp->playSound(SND_CMN_060, 1);
+
+ _array2[i]->val15 = 1;
+ }
+
+ _array2[i]->ani->startAnim(MV_FLY_FLY, 0, -1);
+ }
+ }
}
void Floaters::stopAll() {
- warning("STUB: Floaters::stopAll()");
+ for (uint i = 0; i < _array2.size(); i++) {
+ g_fp->_currentScene->deleteStaticANIObject(_array2[i]->ani);
+
+ delete _array2[i]->ani;
+ }
+
+ _array2.clear();
+
+ g_fp->stopAllSoundInstances(SND_CMN_060);
}
diff --git a/engines/fullpipe/floaters.h b/engines/fullpipe/floaters.h
index a4d64dd79d..3ecbbeea9c 100644
--- a/engines/fullpipe/floaters.h
+++ b/engines/fullpipe/floaters.h
@@ -27,10 +27,13 @@ namespace Fullpipe {
class StaticANIObject;
class Scene;
+class ReactPolygonal;
struct FloaterArray1 {
int val1;
int val2;
+
+ FloaterArray1() { val1 = 0; val2 = 0; }
};
struct FloaterArray2 {
@@ -48,16 +51,21 @@ struct FloaterArray2 {
int countdown;
int val15;
int fflags;
+
+ FloaterArray2() : ani(0), val2(0), val3(0), val4(0), val5(0), val6(0), val7(0), val8(0),
+ val9(0.0), val11(0.0), val13(0), countdown(0), val15(0), fflags(0) {}
};
class Floaters {
public:
- //HRGN hRgn;
+ ReactPolygonal *_hRgn;
Common::Array<FloaterArray1 *> _array1;
Common::Array<FloaterArray2 *> _array2;
+ Floaters() { _hRgn = 0; }
+ ~Floaters();
void init(GameVar *var);
- void genFlies(Scene *sc, int x, int y, int a5, int a6);
+ void genFlies(Scene *sc, int x, int y, int priority, int flags);
void update();
void stopAll();
};
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 7dedaf3109..1c319d3660 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -33,12 +33,14 @@
#include "fullpipe/behavior.h"
#include "fullpipe/modal.h"
#include "fullpipe/input.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/floaters.h"
+#include "fullpipe/console.h"
namespace Fullpipe {
-FullpipeEngine *g_fullpipe = 0;
+FullpipeEngine *g_fp = 0;
Vars *g_vars = 0;
FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
@@ -51,6 +53,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_rnd = new Common::RandomSource("fullpipe");
+ _console = 0;
_gameProjectVersion = 0;
_pictureScale = 8;
@@ -91,13 +94,17 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_isProcessingMessages = false;
_musicAllowed = -1;
+ _musicGameVar = 0;
_aniMan = 0;
_aniMan2 = 0;
_currentScene = 0;
+ _loaderScene = 0;
_scene2 = 0;
+ _scene3 = 0;
_movTable = 0;
_floaters = 0;
+ _mgm = 0;
_globalMessageQueueList = 0;
_messageHandlers = 0;
@@ -144,14 +151,22 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_objectAtCursor = 0;
_objectIdAtCursor = 0;
+ _arcadeOverlay = 0;
+ _arcadeOverlayHelper = 0;
+ _arcadeOverlayX = 0;
+ _arcadeOverlayY = 0;
+ _arcadeOverlayMidX = 0;
+ _arcadeOverlayMidY = 0;
+
_isSaveAllowed = true;
- g_fullpipe = this;
+ g_fp = this;
g_vars = new Vars;
}
FullpipeEngine::~FullpipeEngine() {
delete _rnd;
+ delete _console;
delete _globalMessageQueueList;
}
@@ -165,6 +180,7 @@ void FullpipeEngine::initialize() {
_sceneRect.bottom = 599;
_floaters = new Floaters;
+ _mgm = new MGM;
}
Common::Error FullpipeEngine::run() {
@@ -174,6 +190,8 @@ Common::Error FullpipeEngine::run() {
_backgroundSurface.create(800, 600, format);
+ _console = new Console(this);
+
initialize();
_isSaveAllowed = false;
@@ -272,6 +290,11 @@ void FullpipeEngine::updateEvents() {
return;
break;
default:
+ if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) {
+ // Start the debugger
+ getDebugger()->attach();
+ getDebugger()->onFrame();
+ }
ex = new ExCommand(0, 17, 36, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = event.kbd.keycode;
ex->_excFlags |= 3;
@@ -428,21 +451,6 @@ void FullpipeEngine::setObjectState(const char *name, int state) {
var->setSubVarAsInt(name, state);
}
-void FullpipeEngine::updateMapPiece(int mapId, int update) {
- for (int i = 0; i < 200; i++) {
- int hiWord = (_mapTable[i] >> 16) & 0xffff;
-
- if (hiWord == mapId) {
- _mapTable[i] |= update;
- return;
- }
- if (!hiWord) {
- _mapTable[i] = (mapId << 16) | update;
- return;
- }
- }
-}
-
void FullpipeEngine::disableSaves(ExCommand *ex) {
warning("STUB: FullpipeEngine::disableSaves()");
}
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 63dde5042b..aa6e0dac3a 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -36,6 +36,9 @@
#include "engines/engine.h"
+#include "gui/debugger.h"
+#include "fullpipe/console.h"
+
struct ADGameDescription;
namespace Fullpipe {
@@ -58,7 +61,10 @@ class GameObject;
class GlobalMessageQueueList;
struct MessageHandler;
struct MovTable;
+class MGM;
class NGIArchive;
+class PictureObject;
+struct PreloadItem;
class Scene;
class SoundList;
class StaticANIObject;
@@ -80,6 +86,9 @@ public:
FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc);
virtual ~FullpipeEngine();
+ Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
+
void initialize();
void setMusicAllowed(int val) { _musicAllowed = val; }
@@ -120,7 +129,9 @@ public:
int _sceneWidth;
int _sceneHeight;
Scene *_currentScene;
+ Scene *_loaderScene;
Scene *_scene2;
+ Scene *_scene3;
StaticANIObject *_aniMan;
StaticANIObject *_aniMan2;
byte *_globalPalette;
@@ -141,7 +152,11 @@ public:
void stopAllSounds();
void toggleMute();
void playSound(int id, int flag);
+ void playTrack(GameVar *sceneVar, const char *name, bool delayed);
void startSceneTrack();
+ void stopSoundStream2();
+ void stopAllSoundStreams();
+ void stopAllSoundInstances(int id);
int _sfxVolume;
@@ -165,8 +180,12 @@ public:
MovTable *_movTable;
Floaters *_floaters;
+ MGM *_mgm;
+
+ Common::Array<Common::Point *> _arcadeKeys;
void initMap();
+ void updateMap(PreloadItem *pre);
void updateMapPiece(int mapId, int update);
void updateScreen();
@@ -223,6 +242,8 @@ public:
Scene *accessScene(int sceneId);
void setSceneMusicParameters(GameVar *var);
int convertScene(int scene);
+ int getSceneEntrance(int scene);
+ int getSceneFromTag(int tag);
NGIArchive *_currArchive;
@@ -230,13 +251,25 @@ public:
void openHelp();
void openMainMenu();
+ PictureObject *_arcadeOverlay;
+ PictureObject *_arcadeOverlayHelper;
+ int _arcadeOverlayX;
+ int _arcadeOverlayY;
+ int _arcadeOverlayMidX;
+ int _arcadeOverlayMidY;
+
void initArcadeKeys(const char *varname);
+ void processArcade(ExCommand *ex);
void winArcade();
+ void setArcadeOverlay(int picId);
+ int drawArcadeOverlay(int adjust);
+
void getAllInventory();
int lift_getButtonIdP(int objid);
void lift_setButton(const char *name, int state);
void lift_sub5(Scene *sc, int qu1, int qu2);
+ void lift_sub7(Scene *sc, int buttonId);
void lift_exitSeq(ExCommand *ex);
void lift_closedoorSeq();
void lift_animation3();
@@ -244,7 +277,10 @@ public:
void lift_sub1(StaticANIObject *ani);
void lift_startExitQueue();
void lift_sub05(ExCommand *ex);
+ bool lift_checkButton(const char *varname);
+ GameVar *_musicGameVar;
+ Audio::SoundHandle _sceneTrackHandle;
public:
bool _isSaveAllowed;
@@ -254,7 +290,7 @@ public:
};
-extern FullpipeEngine *g_fullpipe;
+extern FullpipeEngine *g_fp;
extern Vars *g_vars;
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index a2ab71d7e3..845655dded 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -28,23 +28,26 @@
#include "fullpipe/statics.h"
#include "fullpipe/interaction.h"
#include "fullpipe/motion.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/floaters.h"
namespace Fullpipe {
Inventory2 *getGameLoaderInventory() {
- return &g_fullpipe->_gameLoader->_inventory;
+ return &g_fp->_gameLoader->_inventory;
}
MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId) {
- for (uint i = 0; i < g_fullpipe->_gameLoader->_sc2array.size(); i++)
- if (g_fullpipe->_gameLoader->_sc2array[i]._sceneId == sceneId)
- return (MctlCompound *)g_fullpipe->_gameLoader->_sc2array[i]._motionController;
+ for (uint i = 0; i < g_fp->_gameLoader->_sc2array.size(); i++)
+ if (g_fp->_gameLoader->_sc2array[i]._sceneId == sceneId)
+ return (MctlCompound *)g_fp->_gameLoader->_sc2array[i]._motionController;
return 0;
}
InteractionController *getGameLoaderInteractionController() {
- return g_fullpipe->_gameLoader->_interactionController;
+ return g_fp->_gameLoader->_interactionController;
}
GameLoader::GameLoader() {
@@ -68,10 +71,10 @@ GameLoader::GameLoader() {
_preloadEntranceId = 0;
_updateCounter = 0;
- g_fullpipe->_msgX = 0;
- g_fullpipe->_msgY = 0;
- g_fullpipe->_msgObjectId2 = 0;
- g_fullpipe->_msgId = 0;
+ g_fp->_msgX = 0;
+ g_fp->_msgY = 0;
+ g_fp->_msgObjectId2 = 0;
+ g_fp->_msgId = 0;
}
GameLoader::~GameLoader() {
@@ -79,6 +82,8 @@ GameLoader::~GameLoader() {
delete _gameProject;
delete _interactionController;
delete _inputController;
+
+ warning("STUB: GameLoader::~GameLoader()");
}
bool GameLoader::load(MfcArchive &file) {
@@ -91,10 +96,10 @@ bool GameLoader::load(MfcArchive &file) {
_gameProject->load(file);
- g_fullpipe->_gameProject = _gameProject;
+ g_fp->_gameProject = _gameProject;
- if (g_fullpipe->_gameProjectVersion < 12) {
- error("Old gameProjectVersion: %d", g_fullpipe->_gameProjectVersion);
+ if (g_fp->_gameProjectVersion < 12) {
+ error("Old gameProjectVersion: %d", g_fp->_gameProjectVersion);
}
_gameName = file.readPascalString();
@@ -167,7 +172,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
return false;
if (_sc2array[sc2idx]._entranceDataCount < 1) {
- g_fullpipe->_currentScene = st->_scene;
+ g_fp->_currentScene = st->_scene;
return true;
}
@@ -186,20 +191,20 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
if (sg || (sg = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0)) != 0)
sg->setSubVarAsInt("Entrance", entranceId);
- if (!g_fullpipe->sceneSwitcher(_sc2array[sc2idx]._entranceData[entranceIdx]))
+ if (!g_fp->sceneSwitcher(_sc2array[sc2idx]._entranceData[entranceIdx]))
return false;
- g_fullpipe->_msgObjectId2 = 0;
- g_fullpipe->_msgY = -1;
- g_fullpipe->_msgX = -1;
+ g_fp->_msgObjectId2 = 0;
+ g_fp->_msgY = -1;
+ g_fp->_msgX = -1;
- g_fullpipe->_currentScene = st->_scene;
+ g_fp->_currentScene = st->_scene;
- MessageQueue *mq1 = g_fullpipe->_currentScene->getMessageQueueById(_sc2array[sc2idx]._entranceData[entranceIdx]->_messageQueueId);
+ MessageQueue *mq1 = g_fp->_currentScene->getMessageQueueById(_sc2array[sc2idx]._entranceData[entranceIdx]->_messageQueueId);
if (mq1) {
MessageQueue *mq = new MessageQueue(mq1, 0, 0);
- StaticANIObject *stobj = g_fullpipe->_currentScene->getStaticANIObject1ById(_field_FA, -1);
+ StaticANIObject *stobj = g_fp->_currentScene->getStaticANIObject1ById(_field_FA, -1);
if (stobj) {
stobj->_flags &= 0x100;
@@ -209,7 +214,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
ex->_messageNum = 0;
ex->_excFlags |= 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
}
mq->setFlags(mq->getFlags() | 1);
@@ -220,7 +225,7 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
return false;
}
} else {
- StaticANIObject *stobj = g_fullpipe->_currentScene->getStaticANIObject1ById(_field_FA, -1);
+ StaticANIObject *stobj = g_fp->_currentScene->getStaticANIObject1ById(_field_FA, -1);
if (stobj)
stobj->_flags &= 0xfeff;
}
@@ -228,8 +233,100 @@ bool GameLoader::gotoScene(int sceneId, int entranceId) {
return true;
}
-bool preloadCallback(const PreloadItem &pre, int flag) {
- warning("STUB: preloadCallback");
+bool preloadCallback(PreloadItem &pre, int flag) {
+ if (flag) {
+ if (flag == 50)
+ g_fp->_aniMan->preloadMovements(g_fp->_movTable);
+
+ StaticANIObject *pbar = g_fp->_loaderScene->getStaticANIObject1ById(ANI_PBAR, -1);
+
+ if (pbar) {
+ int sz;
+
+ if (pbar->_movement->_currMovement)
+ sz = pbar->_movement->_currMovement->_dynamicPhases.size();
+ else
+ sz = pbar->_movement->_dynamicPhases.size();
+
+ pbar->_movement->setDynamicPhaseIndex(flag * (sz - 1) / 100);
+ }
+
+ g_fp->updateMap(&pre);
+
+ g_fp->_currentScene = g_fp->_loaderScene;
+
+ g_fp->_loaderScene->draw();
+
+ g_fp->_system->updateScreen();
+ } else {
+ if (g_fp->_scene2) {
+ g_fp->_aniMan = g_fp->_scene2->getAniMan();
+ g_fp->_scene2 = 0;
+ setInputDisabled(1);
+ }
+
+ g_fp->_floaters->stopAll();
+
+ if (g_fp->_soundEnabled) {
+ g_fp->_currSoundListCount = 1;
+ g_fp->_currSoundList1[0] = g_fp->accessScene(SC_COMMON)->_soundList;
+ }
+
+ g_vars->scene18_var01 = 0;
+
+ if ((pre.preloadId1 != SC_18 || pre.sceneId != SC_19) && (pre.preloadId1 != SC_19 || (pre.sceneId != SC_18 && pre.sceneId != SC_19))) {
+ if (g_fp->_scene3) {
+ if (pre.preloadId1 != SC_18)
+ g_fp->_gameLoader->unloadScene(SC_18);
+
+ g_fp->_scene3 = 0;
+ }
+ } else {
+ scene19_preload(g_fp->accessScene(pre.preloadId1), pre.keyCode);
+
+ g_vars->scene18_var01 = 1;
+
+ if (pre.preloadId1 == SC_18) {
+ g_fp->_gameLoader->saveScenePicAniInfos(SC_18);
+
+ scene18_preload();
+ }
+ }
+
+ if (((pre.sceneId == SC_19 && pre.keyCode == TrubaRight) || (pre.sceneId == SC_18 && pre.keyCode == TrubaRight)) && !pre.preloadId2) {
+ pre.sceneId = SC_18;
+ pre.keyCode = TrubaLeft;
+ }
+
+ if (!g_fp->_loaderScene) {
+ g_fp->_gameLoader->loadScene(SC_LDR);
+ g_fp->_loaderScene = g_fp->accessScene(SC_LDR);;
+ }
+
+ StaticANIObject *pbar = g_fp->_loaderScene->getStaticANIObject1ById(ANI_PBAR, -1);
+
+ if (pbar) {
+ pbar->show1(ST_EGTR_SLIMSORROW, ST_MAN_GOU, MV_PBAR_RUN, 0);
+ pbar->startAnim(MV_PBAR_RUN, 0, -1);
+ }
+
+ g_fp->_inventoryScene = 0;
+ g_fp->_updateCursorCallback = 0;
+
+ g_fp->_sceneRect.translate(-g_fp->_sceneRect.left, -g_fp->_sceneRect.top);
+
+ g_fp->_system->delayMillis(10);
+
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_fp->_currentScene = g_fp->_loaderScene;
+
+ g_fp->_loaderScene->draw();
+
+ g_fp->_system->updateScreen();
+
+ g_fp->_currentScene = oldsc;
+ }
return true;
}
@@ -262,8 +359,8 @@ bool GameLoader::preloadScene(int sceneId, int entranceId) {
return false;
}
- if (g_fullpipe->_currentScene && g_fullpipe->_currentScene->_sceneId == sceneId)
- g_fullpipe->_currentScene = 0;
+ if (g_fp->_currentScene && g_fp->_currentScene->_sceneId == sceneId)
+ g_fp->_currentScene = 0;
saveScenePicAniInfos(sceneId);
clearGlobalMessageQueueList1();
@@ -358,7 +455,7 @@ void GameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAni
if (!(picAniInfo[i]->type & 1))
continue;
- Scene *scNew = g_fullpipe->accessScene(picAniInfo[i]->sceneId);
+ Scene *scNew = g_fp->accessScene(picAniInfo[i]->sceneId);
if (!scNew)
continue;
@@ -386,8 +483,8 @@ void GameLoader::saveScenePicAniInfos(int sceneId) {
}
void GameLoader::updateSystems(int counterdiff) {
- if (g_fullpipe->_currentScene) {
- g_fullpipe->_currentScene->update(counterdiff);
+ if (g_fp->_currentScene) {
+ g_fp->_currentScene->update(counterdiff);
_exCommand._messageKind = 17;
_updateCounter++;
@@ -510,4 +607,8 @@ InputController *FullpipeEngine::getGameLoaderInputController() {
return 0;
}
+MctlCompound *getCurrSceneSc2MotionController() {
+ return getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId);
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index 4f5462671d..85bd6ab0fb 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -65,7 +65,7 @@ struct PreloadItem {
int keyCode;
};
-bool preloadCallback(const PreloadItem &pre, int flag);
+bool preloadCallback(PreloadItem &pre, int flag);
class PreloadItems : public Common::Array<PreloadItem *>, public CObject {
public:
@@ -95,7 +95,7 @@ class GameLoader : public CObject {
Inventory2 _inventory;
Sc2Array _sc2array;
void *_sceneSwitcher;
- bool (*_preloadCallback)(const PreloadItem &pre, int flag);
+ bool (*_preloadCallback)(PreloadItem &pre, int flag);
void *_readSavegameCallback;
int16 _field_F8;
int16 _field_FA;
@@ -111,6 +111,7 @@ class GameLoader : public CObject {
Inventory2 *getGameLoaderInventory();
InteractionController *getGameLoaderInteractionController();
MctlCompound *getSc2MctlCompoundBySceneId(int16 sceneId);
+MctlCompound *getCurrSceneSc2MotionController();
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 2e89bd6003..a67a4d7b19 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -58,6 +58,8 @@ Bitmap::Bitmap(Bitmap *src) {
Bitmap::~Bitmap() {
if (_pixels)
free(_pixels);
+
+ _pixels = 0;
}
void Bitmap::load(Common::ReadStream *s) {
@@ -87,6 +89,10 @@ Background::Background() {
_palette = 0;
}
+Background::~Background() {
+ warning("STUB: Background::~Background()");
+}
+
bool Background::load(MfcArchive &file) {
debug(5, "Background::load()");
_bgname = file.readPascalString();
@@ -100,11 +106,11 @@ bool Background::load(MfcArchive &file) {
addPictureObject(pct);
}
- assert(g_fullpipe->_gameProjectVersion >= 4);
+ assert(g_fp->_gameProjectVersion >= 4);
_bigPictureArray1Count = file.readUint32LE();
- assert(g_fullpipe->_gameProjectVersion >= 5);
+ assert(g_fp->_gameProjectVersion >= 5);
_bigPictureArray2Count = file.readUint32LE();
@@ -129,8 +135,8 @@ void Background::addPictureObject(PictureObject *pct) {
pct->renumPictures(&_picObjList);
bool inserted = false;
- for (uint i = 0; i < _picObjList.size(); i++) {
- if (((PictureObject *)_picObjList[i])->_priority == pct->_priority) {
+ for (uint i = 1; i < _picObjList.size(); i++) {
+ if (((PictureObject *)_picObjList[i])->_priority <= pct->_priority) {
_picObjList.insert_at(i, pct);
inserted = true;
break;
@@ -152,6 +158,10 @@ PictureObject::PictureObject() {
_objtype = kObjTypePictureObject;
}
+PictureObject::~PictureObject() {
+ warning("STUB: PictureObject::~PictureObject()");
+}
+
PictureObject::PictureObject(PictureObject *src) : GameObject(src) {
_picture = src->_picture;
_ox2 = _ox;
@@ -222,7 +232,7 @@ void PictureObject::drawAt(int x, int y) {
bool PictureObject::setPicAniInfo(PicAniInfo *picAniInfo) {
if (!(picAniInfo->type & 2) || (picAniInfo->type & 1)) {
- error("Picture::setPicAniInfo(): Wrong type: %d", picAniInfo->type);
+ error("PictureObject::setPicAniInfo(): Wrong type: %d", picAniInfo->type);
return false;
}
@@ -269,6 +279,11 @@ bool PictureObject::isPixelHitAtPos(int x, int y) {
return res;
}
+void PictureObject::setOXY2() {
+ _ox2 = _ox;
+ _oy2 = _oy;
+}
+
GameObject::GameObject() {
_okeyCode = 0;
_flags = 0;
@@ -313,7 +328,7 @@ bool GameObject::load(MfcArchive &file) {
_oy = file.readUint32LE();
_priority = file.readUint16LE();
- if (g_fullpipe->_gameProjectVersion >= 11) {
+ if (g_fp->_gameProjectVersion >= 11) {
_field_8 = file.readUint32LE();
}
@@ -329,8 +344,8 @@ void GameObject::renumPictures(PtrList *lst) {
int *buf = (int *)calloc(lst->size() + 2, sizeof(int));
for (uint i = 0; i < lst->size(); i++) {
- if (_id == ((PictureObject *)((*lst)[i]))->_id)
- buf[((PictureObject *)((*lst)[i]))->_okeyCode] = 1;
+ if (_id == ((GameObject *)((*lst)[i]))->_id)
+ buf[((GameObject *)((*lst)[i]))->_okeyCode] = 1;
}
if (buf[_okeyCode]) {
@@ -464,10 +479,12 @@ Picture::~Picture() {
}
void Picture::freePicture() {
+ debug(5, "Picture::freePicture(): file: %s", _memfilename);
+
if (_bitmap) {
if (testFlags() && !_field_54) {
freeData();
- delete _bitmap;
+ free(_bitmap);
_bitmap = 0;
}
}
@@ -484,6 +501,11 @@ void Picture::freePicture() {
}
}
+void Picture::freePixelData() {
+ freePicture();
+ freeData();
+}
+
bool Picture::load(MfcArchive &file) {
debug(5, "Picture::load()");
MemoryObject::load(file);
@@ -492,7 +514,7 @@ bool Picture::load(MfcArchive &file) {
_y = file.readUint32LE();
_field_44 = file.readUint16LE();
- assert(g_fullpipe->_gameProjectVersion >= 2);
+ assert(g_fp->_gameProjectVersion >= 2);
_width = file.readUint32LE();
_height = file.readUint32LE();
@@ -506,7 +528,7 @@ bool Picture::load(MfcArchive &file) {
setAOIDs();
}
- assert (g_fullpipe->_gameProjectVersion >= 12);
+ assert (g_fp->_gameProjectVersion >= 12);
_alpha = file.readUint32LE() & 0xff;
@@ -519,14 +541,14 @@ bool Picture::load(MfcArchive &file) {
getData();
- debug(5, "Picture::load: <%s>", _memfilename);
+ debug(5, "Picture::load: loaded <%s>", _memfilename);
return true;
}
void Picture::setAOIDs() {
- int w = (g_fullpipe->_pictureScale + _width - 1) / g_fullpipe->_pictureScale;
- int h = (g_fullpipe->_pictureScale + _height - 1) / g_fullpipe->_pictureScale;
+ int w = (g_fp->_pictureScale + _width - 1) / g_fp->_pictureScale;
+ int h = (g_fp->_pictureScale + _height - 1) / g_fp->_pictureScale;
_memoryObject2->_rows = (byte **)malloc(w * sizeof(int *));
@@ -539,6 +561,10 @@ void Picture::setAOIDs() {
}
void Picture::init() {
+ debug(5, "Picture::init(), %s", _memfilename);
+
+ MemoryObject::getData();
+
_bitmap = new Bitmap();
getDibInfo();
@@ -567,6 +593,12 @@ void Picture::getDibInfo() {
warning("Uneven data size: 0x%x", _dataSize);
}
+ if (!_data) {
+ warning("Picture::getDibInfo: data is empty <%s>", _memfilename);
+
+ MemoryObject::load();
+ }
+
Common::MemoryReadStream *s = new Common::MemoryReadStream(_data + off - 32, 32);
_bitmap->load(s);
@@ -584,7 +616,7 @@ void Picture::draw(int x, int y, int style, int angle) {
int x1 = x;
int y1 = y;
- debug(0, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
+ debug(7, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename);
if (x != -1)
x1 = x;
@@ -599,14 +631,14 @@ void Picture::draw(int x, int y, int style, int angle) {
return;
if ((_alpha & 0xff) < 0xff) {
- debug(0, "Picture:draw: alpha = %0x", _alpha);
+ debug(7, "Picture:draw: alpha = %0x", _alpha);
}
byte *pal = _paletteData;
if (!pal) {
//warning("Picture:draw: using global palette");
- pal = g_fullpipe->_globalPalette;
+ pal = g_fp->_globalPalette;
}
Common::Point point;
@@ -638,7 +670,7 @@ void Picture::drawRotated(int x, int y, int angle) {
}
void Picture::displayPicture() {
- if (!g_fullpipe->_gameContinue)
+ if (!g_fp->_gameContinue)
return;
getData();
@@ -647,22 +679,22 @@ void Picture::displayPicture() {
if (!_dataSize)
return;
- g_fullpipe->_backgroundSurface.fillRect(Common::Rect(0, 0, 799, 599), 0);
- g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(0, 0), g_fullpipe->_backgroundSurface.pitch, 0, 0, 799, 599);
+ g_fp->_backgroundSurface.fillRect(Common::Rect(0, 0, 800, 600), 0);
+ g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(0, 0), g_fp->_backgroundSurface.pitch, 0, 0, 800, 600);
draw(0, 0, 0, 0);
- g_fullpipe->updateEvents();
- g_fullpipe->_system->delayMillis(10);
- g_fullpipe->_system->updateScreen();
+ g_fp->updateEvents();
+ g_fp->_system->delayMillis(10);
+ g_fp->_system->updateScreen();
- while (g_fullpipe->_gameContinue) {
- g_fullpipe->updateEvents();
- g_fullpipe->_system->delayMillis(10);
- g_fullpipe->_system->updateScreen();
+ while (g_fp->_gameContinue) {
+ g_fp->updateEvents();
+ g_fp->_system->delayMillis(10);
+ g_fp->_system->updateScreen();
- if (g_fullpipe->_keyState == ' ') {
- g_fullpipe->_keyState = Common::KEYCODE_INVALID;
+ if (g_fp->_keyState == ' ') {
+ g_fp->_keyState = Common::KEYCODE_INVALID;
break;
}
}
@@ -710,7 +742,7 @@ bool Picture::isPixelHitAtPos(int x, int y) {
}
int Picture::getPixelAtPos(int x, int y) {
- return getPixelAtPosEx(x / g_fullpipe->_pictureScale, y / g_fullpipe->_pictureScale);
+ return getPixelAtPosEx(x / g_fp->_pictureScale, y / g_fp->_pictureScale);
return false;
}
@@ -719,8 +751,8 @@ int Picture::getPixelAtPosEx(int x, int y) {
if (x < 0 || y < 0)
return 0;
- if (x < (g_fullpipe->_pictureScale + _width - 1) / g_fullpipe->_pictureScale &&
- y < (g_fullpipe->_pictureScale + _height - 1) / g_fullpipe->_pictureScale &&
+ if (x < (g_fp->_pictureScale + _width - 1) / g_fp->_pictureScale &&
+ y < (g_fp->_pictureScale + _height - 1) / g_fp->_pictureScale &&
_memoryObject2 != 0 && _memoryObject2->_rows != 0)
return _memoryObject2->_rows[x][2 * y];
@@ -771,10 +803,10 @@ bool Bitmap::isPixelAtHitPosRB(int x, int y) {
}
void Bitmap::putDib(int x, int y, int32 *palette) {
- debug(0, "Bitmap::putDib(%d, %d)", x, y);
+ debug(7, "Bitmap::putDib(%d, %d)", x, y);
- _x = x - g_fullpipe->_sceneRect.left;
- _y = y - g_fullpipe->_sceneRect.top;
+ _x = x - g_fp->_sceneRect.left;
+ _y = y - g_fp->_sceneRect.top;
if (_type == MKTAG('R', 'B', '\0', '\0'))
putDibRB(palette);
@@ -795,7 +827,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {
uint16 *srcPtr;
if (!palette && pX == -1) {
- warning("Bitmap::putDibRB(): Both global and local palettes are empty");
+ debug(2, "Bitmap::putDibRB(): Both global and local palettes are empty");
return false;
}
@@ -867,7 +899,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {
if (y <= endy) {
if (pX == -1) {
int bgcolor = palette[(pixel >> 8) & 0xff];
- curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(start1, y);
+ curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(start1, y);
colorFill(curDestPtr, fillLen, bgcolor);
} else {
if (y == pY && pX >= start1 && pX < start1 + fillLen)
@@ -898,7 +930,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {
if (y <= endy) {
if (pX == -1) {
- curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(start1, y);
+ curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(start1, y);
paletteFill(curDestPtr, (byte *)srcPtr2, fillLen, (int32 *)palette);
} else {
if (y == pY && pX >= start1 && pX < start1 + fillLen)
@@ -910,7 +942,7 @@ bool Bitmap::putDibRB(int32 *palette, int pX, int pY) {
}
if (pX == -1)
- g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
+ g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(startx, starty), g_fp->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
return false;
}
@@ -961,17 +993,17 @@ void Bitmap::putDibCB(int32 *palette) {
if (_flags & 0x1000000) {
for (int y = starty; y < endy; srcPtr -= pitch, y++) {
- curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(startx, y);
+ curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(startx, y);
copierKeyColor(curDestPtr, srcPtr, endx - startx + 1, _flags & 0xff, (int32 *)palette, cb05_format);
}
} else {
for (int y = starty; y <= endy; srcPtr -= pitch, y++) {
- curDestPtr = (uint16 *)g_fullpipe->_backgroundSurface.getBasePtr(startx, y);
+ curDestPtr = (uint16 *)g_fp->_backgroundSurface.getBasePtr(startx, y);
copier(curDestPtr, srcPtr, endx - startx + 1, (int32 *)palette, cb05_format);
}
}
- g_fullpipe->_system->copyRectToScreen(g_fullpipe->_backgroundSurface.getBasePtr(startx, starty), g_fullpipe->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
+ g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface.getBasePtr(startx, starty), g_fp->_backgroundSurface.pitch, startx, starty, endx + 1 - startx, endy + 1 - starty);
}
void Bitmap::colorFill(uint16 *dest, int len, int32 color) {
@@ -1166,6 +1198,34 @@ bool BigPicture::load(MfcArchive &file) {
return true;
}
+void BigPicture::draw(int x, int y, int style, int angle) {
+ if (!_bitmap)
+ init();
+
+ if (_bitmap) {
+ _bitmap->_flags &= 0xFEFFFFFF;
+
+ int nx = _x;
+ int ny = _y;
+
+ if (x != -1)
+ nx = x;
+
+ if (y != -1)
+ ny = y;
+
+ if (_alpha < 0xFF) {
+ //vrtSetAlphaBlendMode(g_vrtDrawHandle, 1, v9);
+ }
+
+ _bitmap->putDib(nx, ny, 0);
+
+ if (_alpha < 0xFF) {
+ //vrtSetAlphaBlendMode(g_vrtDrawHandle, 0, 255);
+ }
+ }
+}
+
Shadows::Shadows() {
_staticAniObjectId = 0;
_movementId = 0;
@@ -1182,7 +1242,7 @@ bool Shadows::load(MfcArchive &file) {
}
void Shadows::init() {
- Scene *scene = g_fullpipe->accessScene(_sceneId);
+ Scene *scene = g_fp->accessScene(_sceneId);
StaticANIObject *st;
Movement *mov;
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index 9d5c45de0b..d640decc80 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -88,13 +88,14 @@ class Picture : public MemoryObject {
virtual ~Picture();
void freePicture();
+ void freePixelData();
virtual bool load(MfcArchive &file);
void setAOIDs();
void init();
void getDibInfo();
Bitmap *getPixelData();
- void draw(int x, int y, int style, int angle);
+ virtual void draw(int x, int y, int style, int angle);
void drawRotated(int x, int y, int angle);
byte getAlpha() { return (byte)_alpha; }
@@ -115,7 +116,10 @@ class Picture : public MemoryObject {
class BigPicture : public Picture {
public:
BigPicture() {}
+ virtual ~BigPicture() {}
+
virtual bool load(MfcArchive &file);
+ virtual void draw(int x, int y, int style, int angle);
};
class GameObject : public CObject {
@@ -155,7 +159,9 @@ class PictureObject : public GameObject {
public:
PictureObject();
+
PictureObject(PictureObject *src);
+ virtual ~PictureObject();
virtual bool load(MfcArchive &file, bool bigPicture);
virtual bool load(MfcArchive &file) { assert(0); return false; } // Disable base class
@@ -167,6 +173,7 @@ class PictureObject : public GameObject {
bool setPicAniInfo(PicAniInfo *picAniInfo);
bool isPointInside(int x, int y);
bool isPixelHitAtPos(int x, int y);
+ void setOXY2();
};
class Background : public CObject {
@@ -184,6 +191,8 @@ class Background : public CObject {
public:
Background();
+ virtual ~Background();
+
virtual bool load(MfcArchive &file);
void addPictureObject(PictureObject *pct);
diff --git a/engines/fullpipe/init.cpp b/engines/fullpipe/init.cpp
index 49bf72ac91..8de37b5c9e 100644
--- a/engines/fullpipe/init.cpp
+++ b/engines/fullpipe/init.cpp
@@ -45,27 +45,27 @@ void FullpipeEngine::initObjectStates() {
setSwallowedEggsState();
setObjectState(sO_WeirdWacko, getObjectEnumState(sO_WeirdWacko, sO_InGlasses));
- setObjectState(sO_TumyTrampie, getObjectEnumState(sO_TumyTrampie, sO_Drinking));
+ setObjectState(sO_TummyTrampie, getObjectEnumState(sO_TummyTrampie, sO_IsDrinking));
setObjectState(sO_StairsUp_8, getObjectEnumState(sO_StairsUp_8, sO_NotBroken));
setObjectState(sO_HareTheNooksiter, getObjectEnumState(sO_HareTheNooksiter, sO_WithHandle));
setObjectState(sO_Elephantine, getObjectEnumState(sO_Elephantine, sO_WithBoot));
setObjectState(sO_Fly_12, 0);
- setObjectState(sO_ClockAxis, getObjectEnumState(sO_ClockAxis, sO_NotAvailable));
+ setObjectState(sO_ClockAxis, getObjectEnumState(sO_ClockAxis, sO_IsNotAvailable));
setObjectState(sO_ClockHandle, getObjectEnumState(sO_ClockHandle, sO_In_7));
- setObjectState(sO_BigMumsy, getObjectEnumState(sO_BigMumsy, sO_Sleeping));
+ setObjectState(sO_BigMumsy, getObjectEnumState(sO_BigMumsy, sO_IsSleeping));
setObjectState(sO_CoinSlot_1, getObjectEnumState(sO_CoinSlot_1, sO_Empty));
setObjectState(sO_FriesPit, getObjectEnumState(sO_FriesPit, sO_WithApple));
setObjectState(sO_Jug, getObjectEnumState(sO_Jug, sO_Blocked));
setObjectState(sO_RightStairs_9, getObjectEnumState(sO_RightStairs_9, sO_IsClosed));
setObjectState(sO_Pipe_9, getObjectEnumState(sO_Pipe_9, sO_WithJug));
setObjectState(sO_Inflater, getObjectEnumState(sO_Inflater, sO_WithGum));
- setObjectState(sO_Swingie, getObjectEnumState(sO_Swingie, sO_Swinging));
- setObjectState(sO_DudeJumped, getObjectEnumState(sO_DudeJumped, sO_No));
+ setObjectState(sO_Swingie, getObjectEnumState(sO_Swingie, sO_IsSwinging));
+ setObjectState(sO_DudeHasJumped, getObjectEnumState(sO_DudeHasJumped, sO_No));
setObjectState(sO_Bridge, getObjectEnumState(sO_Bridge, sO_Convoluted));
setObjectState(sO_Guardian, getObjectEnumState(sO_Guardian, sO_OnRight));
setObjectState(sO_Grandma, getObjectEnumState(sO_Grandma, sO_In_14));
setObjectState(sO_Boot_15, getObjectEnumState(sO_Boot_15, sO_NotPresent));
- setObjectState(sO_LeftPipe_15, getObjectEnumState(sO_LeftPipe_15, sO_OpenedShe));
+ setObjectState(sO_LeftPipe_15, getObjectEnumState(sO_LeftPipe_15, sO_IsOpened));
setObjectState(sO_Pedestal_16, getObjectEnumState(sO_Pedestal_16, sO_IsFree));
setObjectState(sO_Cup, getObjectEnumState(sO_Cup, sO_InSmokeRoom));
setObjectState(sO_Pedestal_17, getObjectEnumState(sO_Pedestal_17, sO_IsFree));
@@ -73,7 +73,7 @@ void FullpipeEngine::initObjectStates() {
setObjectState(sO_RightPipe_17, getObjectEnumState(sO_RightPipe_17, sO_IsClosed));
setObjectState(sO_Fly_17, 1);
setObjectState(sO_DudeSwinged, 0);
- setObjectState(sO_Girl, getObjectEnumState(sO_Girl, sO_Swinging));
+ setObjectState(sO_Girl, getObjectEnumState(sO_Girl, sO_IsSwinging));
setObjectState(sO_Sugar, getObjectEnumState(sO_Sugar, sO_Present));
setObjectState(sO_Janitors, getObjectEnumState(sO_Janitors, sO_Together));
setObjectState(sO_Bag_22, getObjectEnumState(sO_Bag_22, sO_NotFallen));
@@ -84,7 +84,7 @@ void FullpipeEngine::initObjectStates() {
setObjectState(sO_Lever_23, getObjectEnumState(sO_Lever_23, sO_NotTaken));
setObjectState(sO_LeverHandle_23, getObjectEnumState(sO_LeverHandle_23, sO_WithoutStool));
setObjectState(sO_LowerPipe_21, getObjectEnumState(sO_LowerPipe_21, sO_IsClosed));
- setObjectState(sO_StarsDown_24, getObjectEnumState(sO_StarsDown_24, sO_OpenedShe));
+ setObjectState(sO_StairsDown_24, getObjectEnumState(sO_StairsDown_24, sO_IsOpened));
setObjectState(sO_Hatch_26, getObjectEnumState(sO_Hatch_26, sO_Closed));
setObjectState(sO_Sock_26, getObjectEnumState(sO_Sock_26, sO_NotHanging));
setObjectState(sO_LeftPipe_26, getObjectEnumState(sO_LeftPipe_26, sO_IsClosed));
@@ -94,7 +94,7 @@ void FullpipeEngine::initObjectStates() {
setObjectState(sO_Valve4_26, getObjectEnumState(sO_Valve4_26, sO_Closed));
setObjectState(sO_Valve5_26, getObjectEnumState(sO_Valve5_26, sO_Opened));
setObjectState(sO_Pool, getObjectEnumState(sO_Pool, sO_Overfull));
- setObjectState(sO_Plank_25, getObjectEnumState(sO_Plank_25, sO_NearDudesStairs));
+ setObjectState(sO_Board_25, getObjectEnumState(sO_Board_25, sO_NearDudesStairs));
setObjectState(sO_Driver, getObjectEnumState(sO_Driver, sO_WithSteering));
setObjectState(sO_Janitress, getObjectEnumState(sO_Janitress, sO_WithMop));
setObjectState(sO_LeftPipe_29, getObjectEnumState(sO_LeftPipe_29, sO_IsClosed));
@@ -116,7 +116,7 @@ void FullpipeEngine::initObjectStates() {
setObjectState(sO_BellyInflater, getObjectEnumState(sO_BellyInflater, sO_WithCork));
setObjectState(sO_Jawcrucnher, getObjectEnumState(sO_Jawcrucnher, sO_WithoutCarpet));
setObjectState(sO_Guard_1, getObjectEnumState(sO_Guard_1, sO_On));
- setObjectState(sO_Gurad_2, getObjectEnumState(sO_Gurad_2, sO_On));
+ setObjectState(sO_Guard_2, getObjectEnumState(sO_Guard_2, sO_On));
setObjectState(sO_Guard_3, getObjectEnumState(sO_Guard_3, sO_On));
setObjectState(sO_Bottle_38, getObjectEnumState(sO_Bottle_38, sO_OnTheTable));
setObjectState(sO_Boss, getObjectEnumState(sO_Boss, sO_WithHammer));
diff --git a/engines/fullpipe/input.cpp b/engines/fullpipe/input.cpp
index e98920c78a..5294c4b4ea 100644
--- a/engines/fullpipe/input.cpp
+++ b/engines/fullpipe/input.cpp
@@ -34,7 +34,7 @@
namespace Fullpipe {
InputController::InputController() {
- g_fullpipe->_inputController = this;
+ g_fp->_inputController = this;
_flag = 0;
_cursorHandle = 0;
@@ -55,16 +55,16 @@ InputController::InputController() {
InputController::~InputController() {
removeMessageHandler(126, -1);
- g_fullpipe->_inputController = 0;
+ g_fp->_inputController = 0;
}
void InputController::setInputDisabled(bool state) {
_flag = state;
- g_fullpipe->_inputDisabled = state;
+ g_fp->_inputDisabled = state;
}
void setInputDisabled(bool state) {
- g_fullpipe->_inputController->setInputDisabled(state);
+ g_fp->_inputController->setInputDisabled(state);
}
void InputController::addCursor(CursorInfo *cursor) {
@@ -93,8 +93,8 @@ void InputController::drawCursor(int x, int y) {
if (_cursorIndex == -1)
return;
- _cursorBounds.left = g_fullpipe->_sceneRect.left + x - _cursorsArray[_cursorIndex]->hotspotX;
- _cursorBounds.top = g_fullpipe->_sceneRect.top + y - _cursorsArray[_cursorIndex]->hotspotY;
+ _cursorBounds.left = g_fp->_sceneRect.left + x - _cursorsArray[_cursorIndex]->hotspotX;
+ _cursorBounds.top = g_fp->_sceneRect.top + y - _cursorsArray[_cursorIndex]->hotspotY;
_cursorBounds.right = _cursorBounds.left + _cursorsArray[_cursorIndex]->width;
_cursorBounds.bottom = _cursorBounds.top + _cursorsArray[_cursorIndex]->height;
@@ -274,4 +274,70 @@ void FullpipeEngine::updateCursorCommon() {
_cursorId = PIC_CSR_DEFAULT;
}
+void FullpipeEngine::initArcadeKeys(const char *varname) {
+ GameVar *var = getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("KEYPOS");
+
+ if (!var)
+ return;
+
+ int cnt = var->getSubVarsCount();
+
+ for (int i = 0; i < cnt; i++) {
+ Common::Point *point = new Common::Point;
+
+ GameVar *sub = var->getSubVarByIndex(i);
+
+ point->x = sub->getSubVarAsInt("X");
+ point->y = sub->getSubVarAsInt("Y");
+
+ _arcadeKeys.push_back(point);
+ }
+}
+
+void FullpipeEngine::setArcadeOverlay(int picId) {
+ Common::Point point;
+ Common::Point point2;
+
+ _arcadeOverlayX = 800;
+ _arcadeOverlayY = 545;
+
+ _arcadeOverlayHelper = accessScene(SC_INV)->getPictureObjectById(PIC_CSR_HELPERBGR, 0);
+ _arcadeOverlay = accessScene(SC_INV)->getPictureObjectById(picId, 0);
+
+ _arcadeOverlay->getDimensions(&point);
+ _arcadeOverlayHelper->getDimensions(&point2);
+
+ _arcadeOverlayMidX = (point2.x - point.x) / 2;
+ _arcadeOverlayMidY = abs(point2.y - point.y) / 2;
+}
+
+int FullpipeEngine::drawArcadeOverlay(int adjust) {
+ _arcadeOverlayHelper->drawAt(_sceneRect.left + _arcadeOverlayX, _sceneRect.top + _arcadeOverlayY);
+ _arcadeOverlay->drawAt(_sceneRect.left + _arcadeOverlayX + _arcadeOverlayMidX, _sceneRect.top + _arcadeOverlayY + _arcadeOverlayMidY);
+
+ if (adjust) {
+ if (_arcadeOverlayX > 745) {
+ _arcadeOverlayX -= 15;
+
+ if (_arcadeOverlayX < 745)
+ _arcadeOverlayX = 745;
+ }
+
+ return 1;
+ }
+
+ if (_arcadeOverlayX >= 800) {
+ return 0;
+ } else {
+ _arcadeOverlayX += 15;
+
+ if (_arcadeOverlayX <= 800)
+ return 1;
+
+ _arcadeOverlayX = 800;
+ }
+
+ return 1;
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index b513d2b8ee..59b01a1777 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -36,8 +36,8 @@ int handleObjectInteraction(StaticANIObject *subject, GameObject *object, int in
bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId) {
int sceneId = 0;
- if (g_fullpipe->_currentScene)
- sceneId = g_fullpipe->_currentScene->_sceneId;
+ if (g_fp->_currentScene)
+ sceneId = g_fp->_currentScene->_sceneId;
InteractionController *intC = getGameLoaderInteractionController();
for (ObList::iterator i = intC->_interactions.begin(); i != intC->_interactions.end(); ++i) {
@@ -55,6 +55,10 @@ bool canInteractAny(GameObject *obj1, GameObject *obj2, int invId) {
return false;
}
+InteractionController::~InteractionController() {
+ warning("STUB: InteractionController::~InteractionController()");
+}
+
bool InteractionController::load(MfcArchive &file) {
debug(5, "InteractionController::load()");
@@ -137,7 +141,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
obj->setPicAniInfo(&aniInfo);
if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1) {
- mq = getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->doWalkTo(subj, xpos, ypos, 1, cinter->_staticsId2);
+ mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->doWalkTo(subj, xpos, ypos, 1, cinter->_staticsId2);
if (mq) {
dur = mq->calcDuration(subj);
delete mq;
@@ -186,7 +190,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject
ex->_excFlags = 3;
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
ex->_field_20 = invId;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
if (mq->_isFinished) {
mq->_isFinished = 0;
@@ -255,7 +259,7 @@ LABEL_38:
ex->_field_14 = 0x100;
ex->_messageNum = 0;
ex->_excFlags = 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
}
ex = new ExCommand(obj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
@@ -263,19 +267,19 @@ LABEL_38:
ex->_field_14 = 0x100;
ex->_messageNum = 0;
ex->_excFlags = 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
ex = new ExCommand(subj->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = subj->_okeyCode;
ex->_field_14 = 0x100;
ex->_messageNum = 0;
ex->_excFlags = 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
ex = new ExCommand(subj->_id, 17, 0x40, 0, 0, 0, 1, 0, 0, 0);
ex->_excFlags |= 3;
ex->_keyCode = 0;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
if (!mq->chain(subj)) {
delete mq;
@@ -305,7 +309,7 @@ LABEL_38:
if (abs(xpos - subj->_ox) > 1 || abs(ypos - subj->_oy) > 1
|| (inter->_staticsId2 != 0 && (subj->_statics == 0 || subj->_statics->_staticsId != inter->_staticsId2))) {
- mq = getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->method34(subj, xpos, ypos, 1, inter->_staticsId2);
+ mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->method34(subj, xpos, ypos, 1, inter->_staticsId2);
if (!mq)
return false;
@@ -317,7 +321,7 @@ LABEL_38:
ex->_excFlags = 3;
ex->_field_20 = invId;
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
someFlag = true;
@@ -357,14 +361,14 @@ LABEL_38:
ex->_field_14 = 0x80;
ex->_keyCode = ani->_okeyCode;
ex->_excFlags = 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
}
}
ex = new ExCommand(ani->_id, 34, 0x100, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = ani->_okeyCode;
ex->_field_14 = 0x100;
ex->_excFlags = 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
} else {
ex = new ExCommand(subj->_id, 55, 0, 0, 0, 0, 1, 0, 0, 0);
ex->_x = ani->_id;
@@ -373,7 +377,7 @@ LABEL_38:
ex->_excFlags = 2;
ex->_field_14 = (obj->_objtype != kObjTypePictureObject);
ex->_field_20 = invId;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
if (!mq->_isFinished)
return true;
@@ -422,6 +426,10 @@ Interaction::Interaction() {
_actionName = 0;
}
+Interaction::~Interaction() {
+ warning("STUB: Interaction::~Interaction()");
+}
+
bool Interaction::load(MfcArchive &file) {
debug(5, "Interaction::load()");
@@ -444,7 +452,7 @@ bool Interaction::load(MfcArchive &file) {
}
bool Interaction::canInteract(GameObject *obj1, GameObject *obj2, int invId) {
- if (_sceneId > 0 && g_fullpipe->_currentScene && g_fullpipe->_currentScene->_sceneId != _sceneId)
+ if (_sceneId > 0 && g_fp->_currentScene && g_fp->_currentScene->_sceneId != _sceneId)
return false;
if (_flags & 0x20000)
@@ -476,20 +484,20 @@ bool Interaction::canInteract(GameObject *obj1, GameObject *obj2, int invId) {
if (_objectState1) {
if (_flags & 0x10) {
- if ((g_fullpipe->getObjectState(obj1->getName()) & _objectState1) == 0)
+ if ((g_fp->getObjectState(obj1->getName()) & _objectState1) == 0)
return false;
} else {
- if (g_fullpipe->getObjectState(obj1->getName()) != _objectState1)
+ if (g_fp->getObjectState(obj1->getName()) != _objectState1)
return false;
}
}
if (_objectState2) {
if (_flags & 0x10) {
- if ((g_fullpipe->getObjectState(obj2->getName()) & _objectState2) == 0)
+ if ((g_fp->getObjectState(obj2->getName()) & _objectState2) == 0)
return false;
} else {
- if (g_fullpipe->getObjectState(obj2->getName()) != _objectState2)
+ if (g_fp->getObjectState(obj2->getName()) != _objectState2)
return false;
}
}
diff --git a/engines/fullpipe/interaction.h b/engines/fullpipe/interaction.h
index 456b35458b..7d9ee0bd51 100644
--- a/engines/fullpipe/interaction.h
+++ b/engines/fullpipe/interaction.h
@@ -54,6 +54,8 @@ class Interaction : public CObject {
public:
Interaction();
+ virtual ~Interaction();
+
virtual bool load(MfcArchive &file);
bool canInteract(GameObject *obj1, GameObject *obj2, int invId);
bool isOverlapping(StaticANIObject *subj, GameObject *obj);
@@ -70,6 +72,7 @@ class InteractionController : public CObject {
public:
InteractionController() : _field_20(0), _flag24(true) {}
+ virtual ~InteractionController();
virtual bool load(MfcArchive &file);
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 18ef3c4d97..f5af0611cb 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -30,6 +30,10 @@
namespace Fullpipe {
+Inventory::~Inventory() {
+ warning("STUB: Inventory::~Inventory()");
+}
+
bool Inventory::load(MfcArchive &file) {
debug(5, "Inventory::load()");
@@ -85,6 +89,10 @@ Inventory2::Inventory2() {
_topOffset = -65;
}
+Inventory2::~Inventory2() {
+ warning("STUB: Inventory2::~Inventory2()");
+}
+
bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartially
int numInvs = file.readUint32LE();
@@ -161,7 +169,7 @@ int Inventory2::getItemFlags(int itemId) {
}
void Inventory2::rebuildItemRects() {
- _scene = g_fullpipe->accessScene(_sceneId);
+ _scene = g_fp->accessScene(_sceneId);
if (!_scene)
return;
@@ -226,11 +234,11 @@ void Inventory2::draw() {
if (!_scene)
return;
- int oldScLeft = g_fullpipe->_sceneRect.left;
- int oldScTop = g_fullpipe->_sceneRect.top;
+ int oldScLeft = g_fp->_sceneRect.left;
+ int oldScTop = g_fp->_sceneRect.top;
- g_fullpipe->_sceneRect.top = -_topOffset;
- g_fullpipe->_sceneRect.left = 0;
+ g_fp->_sceneRect.top = -_topOffset;
+ g_fp->_sceneRect.left = 0;
_picture->draw(-1, -1, 0, 0);
@@ -290,8 +298,8 @@ LABEL_25:
reset:
- g_fullpipe->_sceneRect.top = oldScTop;
- g_fullpipe->_sceneRect.left = oldScLeft;
+ g_fp->_sceneRect.top = oldScTop;
+ g_fp->_sceneRect.left = oldScLeft;
}
@@ -365,7 +373,7 @@ int Inventory2::selectItem(int itemId) {
int idx = getInventoryPoolItemIndexById(itemId);
Picture *pic = _scene->getPictureObjectById(_itemsPool[idx]->pictureObjectId1, 0)->_picture;
- g_fullpipe->getGameLoaderInputController()->setCursorItemPicture(pic);
+ g_fp->getGameLoaderInputController()->setCursorItemPicture(pic);
}
return _selectedId;
@@ -382,7 +390,7 @@ bool Inventory2::unselectItem(bool flag) {
_inventoryIcons[i]->isSelected = false;
}
- g_fullpipe->getGameLoaderInputController()->setCursorItemPicture(0);
+ g_fp->getGameLoaderInputController()->setCursorItemPicture(0);
return true;
}
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index 6d07f069bd..bc5847312b 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -49,6 +49,8 @@ class Inventory : public CObject {
public:
Inventory() { _sceneId = 0; }
+ virtual ~Inventory();
+
virtual bool load(MfcArchive &file);
int getInventoryPoolItemIndexById(int itemId);
@@ -96,6 +98,8 @@ class Inventory2 : public Inventory {
public:
Inventory2();
+ virtual ~Inventory2();
+
bool loadPartial(MfcArchive &file);
void addItem(int itemId, int count);
void addItem2(StaticANIObject *obj);
diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp
index 1d6d986977..e5c566ebcf 100644
--- a/engines/fullpipe/lift.cpp
+++ b/engines/fullpipe/lift.cpp
@@ -67,7 +67,7 @@ int FullpipeEngine::lift_getButtonIdP(int objid) {
}
void FullpipeEngine::lift_setButton(const char *name, int state) {
- GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons);
+ GameVar *var = g_fp->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName(sO_LiftButtons);
if (var)
var->setSubVarAsInt(name, state);
@@ -105,4 +105,15 @@ void FullpipeEngine::lift_sub05(ExCommand *ex) {
warning("STUB: FullpipeEngine::lift_sub05()");
}
+bool FullpipeEngine::lift_checkButton(const char *varname) {
+ warning("STUB: FullpipeEngine::lift_checkButton(%s)", varname);
+
+ return false;
+}
+
+void FullpipeEngine::lift_sub7(Scene *sc, int buttonId) {
+ warning("STUB: lift_sub7()");
+}
+
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/messagehandlers.cpp b/engines/fullpipe/messagehandlers.cpp
index fc57109f07..44a3e4cb60 100644
--- a/engines/fullpipe/messagehandlers.cpp
+++ b/engines/fullpipe/messagehandlers.cpp
@@ -42,7 +42,7 @@ void global_messageHandler_KickMetal() {
}
int global_messageHandler1(ExCommand *cmd) {
- debug(0, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum);
+ debug(5, "global_messageHandler1: %d %d", cmd->_messageKind, cmd->_messageNum);
if (cmd->_excFlags & 0x10000) {
if (cmd->_messageNum == MV_MAN_TOLADDER)
@@ -55,7 +55,7 @@ int global_messageHandler1(ExCommand *cmd) {
cmd->_messageNum = MV_MAN_STOPLADDER2;
}
- if (g_fullpipe->_inputDisabled) {
+ if (g_fp->_inputDisabled) {
if (cmd->_messageKind == 17) {
switch (cmd->_messageNum) {
case 29:
@@ -71,25 +71,25 @@ int global_messageHandler1(ExCommand *cmd) {
} else if (cmd->_messageKind == 17) {
switch (cmd->_messageNum) {
case MSG_MANSHADOWSON:
- g_fullpipe->_aniMan->_shadowsOn = 1;
+ g_fp->_aniMan->_shadowsOn = 1;
break;
case MSG_HMRKICK_STUCCO:
global_messageHandler_KickStucco();
break;
case MSG_MANSHADOWSOFF:
- g_fullpipe->_aniMan->_shadowsOn = 0;
+ g_fp->_aniMan->_shadowsOn = 0;
break;
case MSG_DISABLESAVES:
- g_fullpipe->disableSaves(cmd);
+ g_fp->disableSaves(cmd);
break;
case MSG_ENABLESAVES:
- g_fullpipe->enableSaves();
+ g_fp->enableSaves();
break;
case MSG_HMRKICK_METAL:
global_messageHandler_KickMetal();
break;
case 29: // left mouse
- if (g_fullpipe->_inventoryScene) {
+ if (g_fp->_inventoryScene) {
if (getGameLoaderInventory()->handleLeftClick(cmd))
cmd->_messageKind = 0;
}
@@ -101,22 +101,22 @@ int global_messageHandler1(ExCommand *cmd) {
}
break;
case 36: // keydown
- g_fullpipe->defHandleKeyDown(cmd->_keyCode);
+ g_fp->defHandleKeyDown(cmd->_keyCode);
switch (cmd->_keyCode) {
case '\x1B': // ESC
- if (g_fullpipe->_currentScene) {
+ if (g_fp->_currentScene) {
getGameLoaderInventory()->unselectItem(0);
- g_fullpipe->openMainMenu();
+ g_fp->openMainMenu();
cmd->_messageKind = 0;
}
break;
case 't':
- g_fullpipe->stopAllSounds();
+ g_fp->stopAllSounds();
cmd->_messageKind = 0;
break;
case 'u':
- g_fullpipe->toggleMute();
+ g_fp->toggleMute();
cmd->_messageKind = 0;
break;
case ' ':
@@ -130,13 +130,13 @@ int global_messageHandler1(ExCommand *cmd) {
}
break;
case '\t':
- if (g_fullpipe->_flgCanOpenMap)
- g_fullpipe->openMap();
+ if (g_fp->_flgCanOpenMap)
+ g_fp->openMap();
cmd->_messageKind = 0;
break;
case 'p':
- if (g_fullpipe->_flgCanOpenMap)
- g_fullpipe->openHelp();
+ if (g_fp->_flgCanOpenMap)
+ g_fp->openHelp();
cmd->_messageKind = 0;
break;
default:
@@ -144,47 +144,47 @@ int global_messageHandler1(ExCommand *cmd) {
}
break;
case 33:
- if (!g_fullpipe->_inventoryScene)
+ if (!g_fp->_inventoryScene)
break;
int invItem;
- if (g_fullpipe->_updateFlag && (invItem = g_fullpipe->_inventory->getHoveredItem(&g_fullpipe->_mouseScreenPos))) {
- g_fullpipe->_cursorId = PIC_CSR_ITN;
- if (!g_fullpipe->_currSelectedInventoryItemId && !g_fullpipe->_aniMan->_movement &&
- !(g_fullpipe->_aniMan->_flags & 0x100) && g_fullpipe->_aniMan->isIdle()) {
- int st = g_fullpipe->_aniMan->_statics->_staticsId;
+ if (g_fp->_updateFlag && (invItem = g_fp->_inventory->getHoveredItem(&g_fp->_mouseScreenPos))) {
+ g_fp->_cursorId = PIC_CSR_ITN;
+ if (!g_fp->_currSelectedInventoryItemId && !g_fp->_aniMan->_movement &&
+ !(g_fp->_aniMan->_flags & 0x100) && g_fp->_aniMan->isIdle()) {
+ int st = g_fp->_aniMan->_statics->_staticsId;
ExCommand *newex = 0;
if (st == ST_MAN_RIGHT) {
- newex = new ExCommand(g_fullpipe->_aniMan->_id, 1, rMV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
+ newex = new ExCommand(g_fp->_aniMan->_id, 1, rMV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
} else if (st == (0x4000 | ST_MAN_RIGHT)) {
- newex = new ExCommand(g_fullpipe->_aniMan->_id, 1, MV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
+ newex = new ExCommand(g_fp->_aniMan->_id, 1, MV_MAN_LOOKUP, 0, 0, 0, 1, 0, 0, 0);
}
if (newex) {
- newex->_keyCode = g_fullpipe->_aniMan->_okeyCode;
+ newex->_keyCode = g_fp->_aniMan->_okeyCode;
newex->_excFlags |= 3;
newex->postMessage();
}
}
- if (g_fullpipe->_currSelectedInventoryItemId != invItem)
- g_fullpipe->playSound(SND_CMN_070, 0);
+ if (g_fp->_currSelectedInventoryItemId != invItem)
+ g_fp->playSound(SND_CMN_070, 0);
- g_fullpipe->_currSelectedInventoryItemId = invItem;
- g_fullpipe->setCursor(g_fullpipe->_cursorId);
+ g_fp->_currSelectedInventoryItemId = invItem;
+ g_fp->setCursor(g_fp->_cursorId);
break;
}
- if (g_fullpipe->_updateCursorCallback)
- g_fullpipe->_updateCursorCallback();
+ if (g_fp->_updateCursorCallback)
+ g_fp->_updateCursorCallback();
- g_fullpipe->_currSelectedInventoryItemId = 0;
- g_fullpipe->setCursor(g_fullpipe->_cursorId);
+ g_fp->_currSelectedInventoryItemId = 0;
+ g_fp->setCursor(g_fp->_cursorId);
break;
case 65: // open map
- if (cmd->_field_2C == 11 && cmd->_field_14 == ANI_INV_MAP && g_fullpipe->_flgCanOpenMap)
- g_fullpipe->openMap();
+ if (cmd->_field_2C == 11 && cmd->_field_14 == ANI_INV_MAP && g_fp->_flgCanOpenMap)
+ g_fp->openMap();
break;
default:
break;
@@ -228,13 +228,13 @@ int global_messageHandler2(ExCommand *cmd) {
break;
case 28:
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (ani)
ani->_priority = cmd->_field_14;
break;
case 25:
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (ani) {
if (cmd->_field_14) {
ani->setFlags40(true);
@@ -247,7 +247,7 @@ int global_messageHandler2(ExCommand *cmd) {
break;
case 26:
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (ani) {
Movement *mov = ani->_movement;
if (mov)
@@ -258,7 +258,7 @@ int global_messageHandler2(ExCommand *cmd) {
default:
#if 0
// We never put anything into _defMsgArray
- while (::iterator it = g_fullpipe->_defMsgArray.begin(); it != g_fullpipe->_defMsgArray.end(); ++it)
+ while (::iterator it = g_fp->_defMsgArray.begin(); it != g_fp->_defMsgArray.end(); ++it)
if (((ExCommand *)*it)->_field_24 == _messageNum) {
((ExCommand *)*it)->firef34(v13);
res = 1;
@@ -267,11 +267,11 @@ int global_messageHandler2(ExCommand *cmd) {
//debug_msg(_messageNum);
- if (!g_fullpipe->_soundEnabled || cmd->_messageNum != 33 || g_fullpipe->_currSoundListCount <= 0)
+ if (!g_fp->_soundEnabled || cmd->_messageNum != 33 || g_fp->_currSoundListCount <= 0)
return res;
- for (int snd = 0; snd < g_fullpipe->_currSoundListCount; snd++) {
- SoundList *s = g_fullpipe->_currSoundList1[snd];
+ for (int snd = 0; snd < g_fp->_currSoundListCount; snd++) {
+ SoundList *s = g_fp->_currSoundList1[snd];
int ms = s->getCount();
for (int i = 0; i < ms; i++) {
s->getSoundByIndex(i)->setPanAndVolumeByStaticAni();
@@ -292,7 +292,7 @@ int global_messageHandler3(ExCommand *cmd) {
case 31:
case 32:
case 36:
- if (g_fullpipe->_inputDisabled)
+ if (g_fp->_inputDisabled)
cmd->_messageKind = 0;
break;
default:
@@ -306,41 +306,42 @@ int global_messageHandler3(ExCommand *cmd) {
case 17:
switch (cmd->_messageNum) {
case 61:
- return g_fullpipe->_gameLoader->preloadScene(cmd->_parentId, cmd->_keyCode);
+ debug(0, "preload: { %d, %d },", cmd->_parentId, cmd->_keyCode);
+ return g_fp->_gameLoader->preloadScene(cmd->_parentId, cmd->_keyCode);
case 62:
- return g_fullpipe->_gameLoader->gotoScene(cmd->_parentId, cmd->_keyCode);
+ return g_fp->_gameLoader->gotoScene(cmd->_parentId, cmd->_keyCode);
case 64:
- if (g_fullpipe->_currentScene && g_fullpipe->_msgObjectId2
- && (!(cmd->_keyCode & 4) || g_fullpipe->_msgObjectId2 != cmd->_field_14 || g_fullpipe->_msgId != cmd->_field_20)) {
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_msgObjectId2, g_fullpipe->_msgId);
+ if (g_fp->_currentScene && g_fp->_msgObjectId2
+ && (!(cmd->_keyCode & 4) || g_fp->_msgObjectId2 != cmd->_field_14 || g_fp->_msgId != cmd->_field_20)) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(g_fp->_msgObjectId2, g_fp->_msgId);
if (ani) {
ani->_flags &= 0xFF7F;
ani->_flags &= 0xFEFF;
ani->deleteFromGlobalMessageQueue();
}
}
- g_fullpipe->_msgX = 0;
- g_fullpipe->_msgY = 0;
- g_fullpipe->_msgObjectId2 = 0;
- g_fullpipe->_msgId = 0;
+ g_fp->_msgX = 0;
+ g_fp->_msgY = 0;
+ g_fp->_msgObjectId2 = 0;
+ g_fp->_msgId = 0;
if ((cmd->_keyCode & 1) || (cmd->_keyCode & 2)) {
- g_fullpipe->_msgX = cmd->_x;
- g_fullpipe->_msgY = cmd->_y;
+ g_fp->_msgX = cmd->_x;
+ g_fp->_msgY = cmd->_y;
}
if (cmd->_keyCode & 4) {
- g_fullpipe->_msgObjectId2 = cmd->_field_14;
- g_fullpipe->_msgId = cmd->_field_20;
+ g_fp->_msgObjectId2 = cmd->_field_14;
+ g_fp->_msgId = cmd->_field_20;
}
return result;
case 29:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
return result;
- if (g_fullpipe->_gameLoader->_interactionController->_flag24) {
- ani = g_fullpipe->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
- ani2 = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_gameLoader->_field_FA, -1);
+ if (g_fp->_gameLoader->_interactionController->_flag24) {
+ ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ ani2 = g_fp->_currentScene->getStaticANIObject1ById(g_fp->_gameLoader->_field_FA, -1);
if (ani) {
- if (g_fullpipe->_msgObjectId2 == ani->_id && g_fullpipe->_msgId == ani->_okeyCode) {
+ if (g_fp->_msgObjectId2 == ani->_id && g_fp->_msgId == ani->_okeyCode) {
cmd->_messageKind = 0;
return result;
}
@@ -349,10 +350,10 @@ int global_messageHandler3(ExCommand *cmd) {
return 1;
}
} else {
- int id = g_fullpipe->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
- PictureObject *pic = g_fullpipe->_currentScene->getPictureObjectById(id, 0);
+ int id = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(id, 0);
if (pic) {
- if (g_fullpipe->_msgObjectId2 == pic->_id && g_fullpipe->_msgId == pic->_okeyCode) {
+ if (g_fp->_msgObjectId2 == pic->_id && g_fp->_msgId == pic->_okeyCode) {
cmd->_messageKind = 0;
return result;
}
@@ -364,13 +365,13 @@ int global_messageHandler3(ExCommand *cmd) {
}
}
}
- if (getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->_isEnabled && cmd->_keyCode <= 0) {
- if (g_fullpipe->_msgX != cmd->_sceneClickX || g_fullpipe->_msgY != cmd->_sceneClickY) {
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_gameLoader->_field_FA, -1);
+ if (getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->_isEnabled && cmd->_keyCode <= 0) {
+ if (g_fp->_msgX != cmd->_sceneClickX || g_fp->_msgY != cmd->_sceneClickY) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(g_fp->_gameLoader->_field_FA, -1);
if (!ani || (ani->isIdle() && !(ani->_flags & 0x80) && !(ani->_flags & 0x100))) {
- result = startWalkTo(g_fullpipe->_gameLoader->_field_FA, -1, cmd->_sceneClickX, cmd->_sceneClickY, 0);
+ result = startWalkTo(g_fp->_gameLoader->_field_FA, -1, cmd->_sceneClickX, cmd->_sceneClickY, 0);
if (result) {
- ExCommand *ex = new ExCommand(g_fullpipe->_gameLoader->_field_FA, 17, 64, 0, 0, 0, 1, 0, 0, 0);
+ ExCommand *ex = new ExCommand(g_fp->_gameLoader->_field_FA, 17, 64, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = 1;
ex->_excFlags |= 3;
@@ -388,7 +389,7 @@ int global_messageHandler3(ExCommand *cmd) {
return result;
}
case 58:
- g_fullpipe->setCursor(cmd->_keyCode);
+ g_fp->setCursor(cmd->_keyCode);
return result;
case 59:
setInputDisabled(1);
@@ -398,7 +399,7 @@ int global_messageHandler3(ExCommand *cmd) {
return result;
case 56:
if (cmd->_field_2C) {
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (ani) {
getGameLoaderInventory()->addItem2(ani);
result = 1;
@@ -412,13 +413,13 @@ int global_messageHandler3(ExCommand *cmd) {
case 57:
if (cmd->_field_2C) {
if (!cmd->_field_20) {
- getGameLoaderInventory()->removeItem2(g_fullpipe->_currentScene, cmd->_parentId, cmd->_x, cmd->_y, cmd->_field_14);
+ getGameLoaderInventory()->removeItem2(g_fp->_currentScene, cmd->_parentId, cmd->_x, cmd->_y, cmd->_field_14);
getGameLoaderInventory()->rebuildItemRects();
return 1;
}
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_gameLoader->_field_FA, -1);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(g_fp->_gameLoader->_field_FA, -1);
if (ani) {
- getGameLoaderInventory()->removeItem2(g_fullpipe->_currentScene, cmd->_parentId, ani->_ox + cmd->_x, ani->_oy + cmd->_y, ani->_priority + cmd->_field_14);
+ getGameLoaderInventory()->removeItem2(g_fp->_currentScene, cmd->_parentId, ani->_ox + cmd->_x, ani->_oy + cmd->_y, ani->_priority + cmd->_field_14);
getGameLoaderInventory()->rebuildItemRects();
return 1;
}
@@ -428,13 +429,13 @@ int global_messageHandler3(ExCommand *cmd) {
getGameLoaderInventory()->rebuildItemRects();
return 1;
case 55:
- if (g_fullpipe->_currentScene) {
+ if (g_fp->_currentScene) {
GameObject *obj;
if (cmd->_field_14)
- obj = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_x, cmd->_y);
+ obj = g_fp->_currentScene->getStaticANIObject1ById(cmd->_x, cmd->_y);
else
- obj = g_fullpipe->_currentScene->getPictureObjectById(cmd->_x, cmd->_y);
- handleObjectInteraction(g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode), obj, cmd->_field_20);
+ obj = g_fp->_currentScene->getPictureObjectById(cmd->_x, cmd->_y);
+ handleObjectInteraction(g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode), obj, cmd->_field_20);
result = 1;
}
return result;
@@ -448,7 +449,7 @@ int global_messageHandler3(ExCommand *cmd) {
if (cmd->_objtype == kObjTypeObjstateCommand) {
ObjstateCommand *c = (ObjstateCommand *)cmd;
result = 1;
- g_fullpipe->setObjectState(c->_objCommandName, c->_value);
+ g_fp->setObjectState(c->_objCommandName, c->_value);
}
return result;
default:
@@ -461,7 +462,7 @@ int global_messageHandler4(ExCommand *cmd) {
switch (cmd->_messageKind) {
case 18: {
- MessageQueue *mq = new MessageQueue(g_fullpipe->_currentScene->getMessageQueueById(cmd->_messageNum), cmd->_parId, 0);
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(cmd->_messageNum), cmd->_parId, 0);
if (cmd->_excFlags & 1)
mq->_flag1 = 1;
@@ -472,10 +473,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
}
case 2:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -483,10 +484,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
case 1: {
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -502,10 +503,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
}
case 8:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -513,10 +514,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
case 20: {
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -534,10 +535,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
}
case 21:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -548,17 +549,17 @@ int global_messageHandler4(ExCommand *cmd) {
// Nop in original
break;
case 3:
- g_fullpipe->_currentScene->_y = cmd->_messageNum - cmd->_messageNum % g_fullpipe->_scrollSpeed;
+ g_fp->_currentScene->_y = cmd->_messageNum - cmd->_messageNum % g_fp->_scrollSpeed;
break;
case 4:
- g_fullpipe->_currentScene->_x = cmd->_messageNum - cmd->_messageNum % g_fullpipe->_scrollSpeed;
+ g_fp->_currentScene->_x = cmd->_messageNum - cmd->_messageNum % g_fp->_scrollSpeed;
break;
case 19: {
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -573,10 +574,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
}
case 22:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -585,10 +586,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
case 6:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -596,18 +597,18 @@ int global_messageHandler4(ExCommand *cmd) {
break;
case 27:
- if (!g_fullpipe->_currentScene || g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode) == 0) {
- ani = g_fullpipe->accessScene(cmd->_field_20)->getStaticANIObject1ById(cmd->_parentId, -1);
+ if (!g_fp->_currentScene || g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode) == 0) {
+ ani = g_fp->accessScene(cmd->_field_20)->getStaticANIObject1ById(cmd->_parentId, -1);
if (ani) {
ani = new StaticANIObject(ani);
- g_fullpipe->_currentScene->addStaticANIObject(ani, 1);
+ g_fp->_currentScene->addStaticANIObject(ani, 1);
}
}
// fall through
case 5:
- if (g_fullpipe->_currentScene)
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ if (g_fp->_currentScene)
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -619,10 +620,10 @@ int global_messageHandler4(ExCommand *cmd) {
break;
case 10:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -633,34 +634,34 @@ int global_messageHandler4(ExCommand *cmd) {
break;
case 7: {
- if (!g_fullpipe->_currentScene->_picObjList.size())
+ if (!g_fp->_currentScene->_picObjList.size())
break;
- int offX = g_fullpipe->_scrollSpeed * (cmd->_x / g_fullpipe->_scrollSpeed);
- int offY = g_fullpipe->_scrollSpeed * (cmd->_y / g_fullpipe->_scrollSpeed);
+ int offX = g_fp->_scrollSpeed * (cmd->_x / g_fp->_scrollSpeed);
+ int offY = g_fp->_scrollSpeed * (cmd->_y / g_fp->_scrollSpeed);
if (cmd->_messageNum) {
- g_fullpipe->_currentScene->_x = offX - g_fullpipe->_sceneRect.left;
- g_fullpipe->_currentScene->_y = offY - g_fullpipe->_sceneRect.top;
+ g_fp->_currentScene->_x = offX - g_fp->_sceneRect.left;
+ g_fp->_currentScene->_y = offY - g_fp->_sceneRect.top;
if (cmd->_field_24) {
- g_fullpipe->_currentScene->_messageQueueId = cmd->_parId;
+ g_fp->_currentScene->_messageQueueId = cmd->_parId;
}
} else {
- g_fullpipe->_sceneRect.moveTo(offX, offY);
+ g_fp->_sceneRect.translate(offX - g_fp->_sceneRect.left, offY - g_fp->_sceneRect.top);
- g_fullpipe->_currentScene->_x = 0;
- g_fullpipe->_currentScene->_y = 0;
+ g_fp->_currentScene->_x = 0;
+ g_fp->_currentScene->_y = 0;
- g_fullpipe->_currentScene->updateScrolling2();
+ g_fp->_currentScene->updateScrolling2();
}
break;
}
case 34:
- if (!g_fullpipe->_currentScene)
+ if (!g_fp->_currentScene)
break;
- ani = g_fullpipe->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
+ ani = g_fp->_currentScene->getStaticANIObject1ById(cmd->_parentId, cmd->_keyCode);
if (!ani)
break;
@@ -690,15 +691,15 @@ int MovGraph_messageHandler(ExCommand *cmd) {
if (cmd->_messageNum != 33)
return 0;
- StaticANIObject *ani = g_fullpipe->_currentScene->getStaticANIObject1ById(g_fullpipe->_gameLoader->_field_FA, -1);
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(g_fp->_gameLoader->_field_FA, -1);
- if (!getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId))
+ if (!getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId))
return 0;
- if (getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId)->_objtype != kObjTypeMovGraph || !ani)
+ if (getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->_objtype != kObjTypeMovGraph || !ani)
return 0;
- MovGraph *gr = (MovGraph *)getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId);
+ MovGraph *gr = (MovGraph *)getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId);
MovGraphLink *link = 0;
double mindistance = 1.0e10;
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 4abf2ef56f..7dfdd06fc8 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -41,7 +41,10 @@ ExCommand::ExCommand(ExCommand *src) : Message(src) {
_messageNum = src->_messageNum;
_excFlags = src->_excFlags;
_parId = src->_parId;
+}
+ExCommand *ExCommand::createClone() {
+ return new ExCommand(this);
}
ExCommand::ExCommand(int16 parentId, int messageKind, int messageNum, int x, int y, int a7, int a8, int sceneClickX, int sceneClickY, int a11) :
@@ -73,22 +76,24 @@ bool ExCommand::load(MfcArchive &file) {
_field_3C = 0;
- if (g_fullpipe->_gameProjectVersion >= 12) {
+ if (g_fp->_gameProjectVersion >= 12) {
_excFlags = file.readUint32LE();
_parId = file.readUint32LE();
}
+ _objtype = kObjTypeExCommand;
+
return true;
}
bool ExCommand::handleMessage() {
int cnt = 0;
- for (MessageHandler *m = g_fullpipe->_messageHandlers; m; m = m->nextItem)
+ for (MessageHandler *m = g_fp->_messageHandlers; m; m = m->nextItem)
cnt += m->callback(this);
if (_messageKind == 17 || (_excFlags & 1)) {
if (_parId) {
- MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(_parId);
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(_parId);
if (mq)
mq->update();
}
@@ -101,18 +106,18 @@ bool ExCommand::handleMessage() {
}
void ExCommand::sendMessage() {
- g_fullpipe->_exCommandList.push_back(this);
+ g_fp->_exCommandList.push_back(this);
processMessages();
}
void ExCommand::postMessage() {
- g_fullpipe->_exCommandList.push_back(this);
+ g_fp->_exCommandList.push_back(this);
}
void ExCommand::handle() {
- if (g_fullpipe->_modalObject) {
- g_fullpipe->_modalObject->handleMessage(this);
+ if (g_fp->_modalObject) {
+ g_fp->_modalObject->handleMessage(this);
delete this;
} else {
@@ -120,6 +125,61 @@ void ExCommand::handle() {
}
}
+void ExCommand::setf3c(int val) {
+ if (val != -1)
+ _field_3C = val;
+
+ _field_34 = 1;
+}
+
+void ExCommand::firef34() {
+ if (_field_34) {
+ if (_field_3C >= _keyCode) {
+ _field_34 = 0;
+
+ sendMessage();
+
+ if (!_field_30 )
+ setf3c(_field_2C);
+ }
+ }
+}
+
+ExCommand2::ExCommand2(int messageKind, int parentId, Common::Point **points, int pointsSize) : ExCommand(parentId, messageKind, 0, 0, 0, 0, 1, 0, 0, 0) {
+ _objtype = kObjTypeExCommand2;
+
+ _pointsSize = pointsSize;
+ _points = (Common::Point **)malloc(sizeof(Common::Point *) * pointsSize);
+
+ for (int i = 0; i < pointsSize; i++) {
+ _points[i] = new Common::Point;
+
+ *_points[i] = *points[i];
+ }
+}
+
+ExCommand2::ExCommand2(ExCommand2 *src) : ExCommand(src) {
+ _pointsSize = src->_pointsSize;
+ _points = (Common::Point **)malloc(sizeof(Common::Point *) * _pointsSize);
+
+ for (int i = 0; i < _pointsSize; i++) {
+ _points[i] = new Common::Point;
+
+ *_points[i] = *src->_points[i];
+ }
+}
+
+ExCommand2::~ExCommand2() {
+ for (int i = 0; i < _pointsSize; i++)
+ delete _points[i];
+
+ free(_points);
+}
+
+ExCommand2 *ExCommand2::createClone() {
+ return new ExCommand2(this);
+}
+
Message::Message() {
_messageKind = 0;
_parentId = 0;
@@ -174,12 +234,23 @@ ObjstateCommand::ObjstateCommand() {
_objCommandName = 0;
}
+ObjstateCommand::ObjstateCommand(ObjstateCommand *src) : ExCommand(src) {
+ _value = src->_value;
+ _objCommandName = (char *)calloc(strlen(src->_objCommandName) + 1, 1);
+
+ strncpy(_objCommandName, src->_objCommandName, strlen(src->_objCommandName));
+}
+
+ObjstateCommand::~ObjstateCommand() {
+ free(_objCommandName);
+}
+
bool ObjstateCommand::load(MfcArchive &file) {
debug(5, "ObjStateCommand::load()");
_objtype = kObjTypeObjstateCommand;
- _cmd.load(file);
+ ExCommand::load(file);
_value = file.readUint32LE();
@@ -188,6 +259,10 @@ bool ObjstateCommand::load(MfcArchive &file) {
return true;
}
+ObjstateCommand *ObjstateCommand::createClone() {
+ return new ObjstateCommand(this);
+}
+
MessageQueue::MessageQueue() {
_field_14 = 0;
_parId = 0;
@@ -205,7 +280,7 @@ MessageQueue::MessageQueue(int dataId) {
_field_14 = 0;
_parId = 0;
_dataId = dataId;
- _id = g_fullpipe->_globalMessageQueueList->compact();
+ _id = g_fp->_globalMessageQueueList->compact();
_isFinished = 0;
_flags = 0;
_queueName = 0;
@@ -219,7 +294,7 @@ MessageQueue::MessageQueue(MessageQueue *src, int parId, int field_38) {
_field_38 = (field_38 == 0);
for (Common::List<ExCommand *>::iterator it = src->_exCommands.begin(); it != src->_exCommands.end(); ++it) {
- ExCommand *ex = new ExCommand(*it);
+ ExCommand *ex = (*it)->createClone();
ex->_excFlags |= 2;
_exCommands.push_back(ex);
@@ -231,11 +306,12 @@ MessageQueue::MessageQueue(MessageQueue *src, int parId, int field_38) {
else
_parId = src->_parId;
- _id = g_fullpipe->_globalMessageQueueList->compact();
+ _id = g_fp->_globalMessageQueueList->compact();
_dataId = src->_dataId;
_flags = src->_flags;
+ _queueName = 0;
- g_fullpipe->_globalMessageQueueList->addMessageQueue(this);
+ g_fp->_globalMessageQueueList->addMessageQueue(this);
_isFinished = 0;
_flag1 = 0;
@@ -255,7 +331,7 @@ MessageQueue::~MessageQueue() {
delete _field_14;
if (_flags & 2) {
- g_fullpipe->_globalMessageQueueList->removeQueueById(_id);
+ g_fp->_globalMessageQueueList->removeQueueById(_id);
}
finish();
@@ -270,7 +346,7 @@ bool MessageQueue::load(MfcArchive &file) {
int count = file.readUint16LE();
- assert(g_fullpipe->_gameProjectVersion >= 12);
+ assert(g_fp->_gameProjectVersion >= 12);
_queueName = file.readPascalString();
@@ -291,7 +367,7 @@ bool MessageQueue::load(MfcArchive &file) {
bool MessageQueue::chain(StaticANIObject *ani) {
if (checkGlobalExCommandList1() && checkGlobalExCommandList2()) {
if (!(getFlags() & 2)) {
- g_fullpipe->_globalMessageQueueList->addMessageQueue(this);
+ g_fp->_globalMessageQueueList->addMessageQueue(this);
_flags |= 2;
}
if (ani) {
@@ -309,7 +385,7 @@ void MessageQueue::update() {
if (_counter > 0)
_counter--;
- if (_exCommands.size()) {
+ if (getCount()) {
sendNextCommand();
} else if (_counter == 0) {
_isFinished = 1;
@@ -326,8 +402,21 @@ void MessageQueue::addExCommand(ExCommand *ex) {
_exCommands.push_front(ex);
}
+void MessageQueue::addExCommandToEnd(ExCommand *ex) {
+ _exCommands.push_back(ex);
+}
+
+void MessageQueue::insertExCommandAt(int pos, ExCommand *ex) {
+ Common::List<ExCommand *>::iterator it = _exCommands.begin();
+
+ for (int i = pos; i > 0; i--)
+ ++it;
+
+ _exCommands.insert(it, ex);
+}
+
ExCommand *MessageQueue::getExCommandByIndex(uint idx) {
- if (idx > _exCommands.size())
+ if (idx >= getCount())
return 0;
Common::List<ExCommand *>::iterator it = _exCommands.begin();
@@ -341,7 +430,7 @@ ExCommand *MessageQueue::getExCommandByIndex(uint idx) {
}
void MessageQueue::deleteExCommandByIndex(uint idx, bool doFree) {
- if (idx > _exCommands.size())
+ if (idx >= getCount())
return;
Common::List<ExCommand *>::iterator it = _exCommands.begin();
@@ -351,10 +440,10 @@ void MessageQueue::deleteExCommandByIndex(uint idx, bool doFree) {
idx--;
}
- _exCommands.erase(it);
-
if (doFree)
delete *it;
+
+ _exCommands.erase(it);
}
void MessageQueue::transferExCommands(MessageQueue *mq) {
@@ -365,7 +454,7 @@ void MessageQueue::transferExCommands(MessageQueue *mq) {
}
void MessageQueue::sendNextCommand() {
- if (_exCommands.size()) {
+ if (getCount()) {
if (!(_flags & 4) && (_flags & 1)) {
messageQueueCallback1(16);
}
@@ -394,7 +483,7 @@ bool MessageQueue::checkGlobalExCommandList1() {
if (ex->_messageKind != 1 && ex->_messageKind != 20 && ex->_messageKind != 5 && ex->_messageKind != 27)
continue;
- for (Common::List<ExCommand *>::iterator it = g_fullpipe->_exCommandList.begin(); it != g_fullpipe->_exCommandList.end(); it++) {
+ for (Common::List<ExCommand *>::iterator it = g_fp->_exCommandList.begin(); it != g_fp->_exCommandList.end(); it++) {
ex1 = *it;
if (ex1->_messageKind != 1 && ex1->_messageKind != 20 && ex1->_messageKind != 5 && ex1->_messageKind != 27)
@@ -403,7 +492,7 @@ bool MessageQueue::checkGlobalExCommandList1() {
if (ex1->_keyCode != ex->_keyCode && ex1->_keyCode != -1 && ex->_keyCode != -1)
continue;
- MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(ex1->_parId);
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(ex1->_parId);
if (mq) {
if (mq->getFlags() & 1)
@@ -423,7 +512,7 @@ bool MessageQueue::checkGlobalExCommandList2() {
if (ex->_messageKind != 1 && ex->_messageKind != 20 && ex->_messageKind != 5 && ex->_messageKind != 27)
continue;
- for (Common::List<ExCommand *>::iterator it = g_fullpipe->_exCommandList.begin(); it != g_fullpipe->_exCommandList.end();) {
+ for (Common::List<ExCommand *>::iterator it = g_fp->_exCommandList.begin(); it != g_fp->_exCommandList.end();) {
ex1 = *it;
if (ex1->_messageKind != 1 && ex1->_messageKind != 20 && ex1->_messageKind != 5 && ex1->_messageKind != 27) {
@@ -436,7 +525,7 @@ bool MessageQueue::checkGlobalExCommandList2() {
continue;
}
- MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(ex1->_parId);
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(ex1->_parId);
if (mq) {
if (mq->getFlags() & 1)
@@ -445,7 +534,7 @@ bool MessageQueue::checkGlobalExCommandList2() {
delete mq;
}
- it = g_fullpipe->_exCommandList.erase(it);
+ it = g_fp->_exCommandList.erase(it);
if (ex1->_excFlags & 2) {
delete ex1;
@@ -459,7 +548,7 @@ void MessageQueue::finish() {
if (!_parId)
return;
- MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(_parId);
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(_parId);
_parId = 0;
@@ -492,7 +581,8 @@ int MessageQueue::calcDuration(StaticANIObject *obj) {
ExCommand *ex;
Movement *mov;
- for (uint i = 0; (ex = getExCommandByIndex(i)); i++)
+ for (uint i = 0; i < getCount(); i++) {
+ ex = getExCommandByIndex(i);
if (ex->_parentId == obj->_id) {
if (ex->_messageKind == 1 || ex->_messageKind == 20) {
if ((mov = obj->getMovementById(ex->_messageNum)) != 0) {
@@ -503,12 +593,13 @@ int MessageQueue::calcDuration(StaticANIObject *obj) {
}
}
}
+ }
return res;
}
void MessageQueue::changeParam28ForObjectId(int objId, int oldParam28, int newParam28) {
- for (uint i = 0; i < _exCommands.size(); i++) {
+ for (uint i = 0; i < getCount(); i++) {
ExCommand *ex = getExCommandByIndex(i);
int k = ex->_messageKind;
@@ -557,16 +648,32 @@ void GlobalMessageQueueList::disableQueueById(int id) {
}
int GlobalMessageQueueList::compact() {
+ int *useList = new int[size() + 2];
+
+ for (uint i = 0; i < size() + 2; i++)
+ useList[i] = 0;
+
for (uint i = 0; i < size();) {
if (((MessageQueue *)_storage[i])->_isFinished) {
disableQueueById(_storage[i]->_id);
remove_at(i);
} else {
+ if ((uint)_storage[i]->_id < size() + 2)
+ useList[_storage[i]->_id] = 1;
i++;
}
}
- return size() + 1;
+ uint i;
+
+ for (i = 1; i < size() + 2; i++) {
+ if (!useList[i])
+ break;
+ }
+
+ delete [] useList;
+
+ return i;
}
void GlobalMessageQueueList::addMessageQueue(MessageQueue *msg) {
@@ -576,12 +683,25 @@ void GlobalMessageQueueList::addMessageQueue(MessageQueue *msg) {
}
void clearGlobalMessageQueueList1() {
- warning("STUB: clearGlobalMessageQueueList1()");
+ clearMessages();
+
+ g_fp->_globalMessageQueueList->clear();
+}
+
+void clearMessages() {
+ while (g_fp->_exCommandList.size()) {
+ ExCommand *ex = g_fp->_exCommandList.front();
+
+ g_fp->_exCommandList.pop_front();
+
+ if (ex->_excFlags & 2)
+ delete ex;
+ }
}
bool removeMessageHandler(int16 id, int pos) {
- if (g_fullpipe->_messageHandlers) {
- MessageHandler *curItem = g_fullpipe->_messageHandlers;
+ if (g_fp->_messageHandlers) {
+ MessageHandler *curItem = g_fp->_messageHandlers;
MessageHandler *prevItem = 0;
int curPos = 0;
@@ -615,13 +735,13 @@ void addMessageHandler(int (*callback)(ExCommand *), int16 id) {
if (getMessageHandlerById(id))
return;
- MessageHandler *curItem = g_fullpipe->_messageHandlers;
+ MessageHandler *curItem = g_fp->_messageHandlers;
if (!curItem)
return;
int index = 0;
- for (MessageHandler *i = g_fullpipe->_messageHandlers->nextItem; i; i = i->nextItem) {
+ for (MessageHandler *i = g_fp->_messageHandlers->nextItem; i; i = i->nextItem) {
curItem = i;
index++;
}
@@ -633,7 +753,7 @@ void addMessageHandler(int (*callback)(ExCommand *), int16 id) {
}
MessageHandler *getMessageHandlerById(int16 id) {
- MessageHandler *curItem = g_fullpipe->_messageHandlers;
+ MessageHandler *curItem = g_fp->_messageHandlers;
if (!curItem)
return 0;
@@ -663,7 +783,7 @@ bool allocMessageHandler(MessageHandler *where, int16 id, int (*callback)(ExComm
msg->callback = callback;
msg->index = 0;
- g_fullpipe->_messageHandlers = msg;
+ g_fp->_messageHandlers = msg;
}
return true;
@@ -671,7 +791,7 @@ bool allocMessageHandler(MessageHandler *where, int16 id, int (*callback)(ExComm
int getMessageHandlersCount() {
int result;
- MessageHandler *curItem = g_fullpipe->_messageHandlers;
+ MessageHandler *curItem = g_fp->_messageHandlers;
for (result = 0; curItem; result++)
curItem = curItem->nextItem;
@@ -684,7 +804,7 @@ bool addMessageHandlerByIndex(int (*callback)(ExCommand *), int index, int16 id)
return false;
if (index) {
- MessageHandler *curItem = g_fullpipe->_messageHandlers;
+ MessageHandler *curItem = g_fp->_messageHandlers;
for (int i = index - 1; i > 0; i--)
if (curItem)
@@ -702,13 +822,13 @@ bool addMessageHandlerByIndex(int (*callback)(ExCommand *), int index, int16 id)
} else {
MessageHandler *newItem = new MessageHandler;
- newItem->nextItem = g_fullpipe->_messageHandlers;
+ newItem->nextItem = g_fp->_messageHandlers;
newItem->id = id;
newItem->callback = callback;
newItem->index = 0;
- updateMessageHandlerIndex(g_fullpipe->_messageHandlers, 1);
- g_fullpipe->_messageHandlers = newItem;
+ updateMessageHandlerIndex(g_fp->_messageHandlers, 1);
+ g_fp->_messageHandlers = newItem;
return true;
}
@@ -718,7 +838,7 @@ bool insertMessageHandler(int (*callback)(ExCommand *), int index, int16 id) {
if (getMessageHandlerById(id))
return false;
- MessageHandler *curItem = g_fullpipe->_messageHandlers;
+ MessageHandler *curItem = g_fp->_messageHandlers;
for (int i = index; i > 0; i--)
if (curItem)
@@ -735,7 +855,7 @@ void clearMessageHandlers() {
MessageHandler *curItem;
MessageHandler *nextItem;
- curItem = g_fullpipe->_messageHandlers;
+ curItem = g_fp->_messageHandlers;
if (curItem) {
do {
nextItem = curItem->nextItem;
@@ -745,32 +865,51 @@ void clearMessageHandlers() {
curItem = nextItem;
} while (nextItem);
- g_fullpipe->_messageHandlers = 0;
+ g_fp->_messageHandlers = 0;
}
}
void processMessages() {
- if (!g_fullpipe->_isProcessingMessages) {
- g_fullpipe->_isProcessingMessages = true;
+ if (!g_fp->_isProcessingMessages) {
+ g_fp->_isProcessingMessages = true;
- while (g_fullpipe->_exCommandList.size()) {
- ExCommand *ex = g_fullpipe->_exCommandList.front();
- g_fullpipe->_exCommandList.pop_front();
+ while (g_fp->_exCommandList.size()) {
+ ExCommand *ex = g_fp->_exCommandList.front();
+ g_fp->_exCommandList.pop_front();
ex->handleMessage();
}
- g_fullpipe->_isProcessingMessages = false;
+ g_fp->_isProcessingMessages = false;
}
}
void updateGlobalMessageQueue(int id, int objid) {
- MessageQueue *m = g_fullpipe->_globalMessageQueueList->getMessageQueueById(id);
+ MessageQueue *m = g_fp->_globalMessageQueueList->getMessageQueueById(id);
if (m) {
m->update();
}
}
bool chainQueue(int queueId, int flags) {
- MessageQueue *mq = g_fullpipe->_currentScene->getMessageQueueById(queueId);
+ MessageQueue *mq = g_fp->_currentScene->getMessageQueueById(queueId);
+
+ if (!mq)
+ return false;
+
+ MessageQueue *nmq = new MessageQueue(mq, 0, 0);
+
+ nmq->_flags |= flags;
+
+ if (!nmq->chain(0)) {
+ delete nmq;
+
+ return false;
+ }
+
+ return true;
+}
+
+bool chainObjQueue(StaticANIObject *obj, int queueId, int flags) {
+ MessageQueue *mq = g_fp->_currentScene->getMessageQueueById(queueId);
if (!mq)
return false;
@@ -779,8 +918,8 @@ bool chainQueue(int queueId, int flags) {
nmq->_flags |= flags;
- if (!mq->chain(0)) {
- delete mq;
+ if (!nmq->chain(obj)) {
+ delete nmq;
return false;
}
@@ -788,4 +927,17 @@ bool chainQueue(int queueId, int flags) {
return true;
}
+void postExCommand(int parentId, int keyCode, int x, int y, int f20, int f14) {
+ ExCommand *ex = new ExCommand(parentId, 17, 64, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_keyCode = keyCode;
+ ex->_excFlags |= 3;
+ ex->_x = x;
+ ex->_y = y;
+ ex->_field_20 = f20;
+ ex->_field_14 = f14;
+
+ ex->postMessage();
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/messages.h b/engines/fullpipe/messages.h
index 326f05cef3..33bb827888 100644
--- a/engines/fullpipe/messages.h
+++ b/engines/fullpipe/messages.h
@@ -57,7 +57,6 @@ class Message : public CObject {
class ExCommand : public Message {
public:
-
int _messageNum;
int _field_3C;
int _excFlags;
@@ -70,27 +69,42 @@ class ExCommand : public Message {
virtual bool load(MfcArchive &file);
+ virtual ExCommand *createClone();
+
bool handleMessage();
void sendMessage();
void postMessage();
void handle();
+
+ void firef34();
+ void setf3c(int val);
};
class ExCommand2 : public ExCommand {
public:
Common::Point **_points;
int _pointsSize;
+
+ ExCommand2(int messageKind, int parentId, Common::Point **points, int pointsSize);
+ ExCommand2(ExCommand2 *src);
+ virtual ~ExCommand2();
+
+ virtual ExCommand2 *createClone();
};
-class ObjstateCommand : public CObject {
+class ObjstateCommand : public ExCommand {
public:
- ExCommand _cmd;
char *_objCommandName;
int _value;
public:
ObjstateCommand();
+ ObjstateCommand(ObjstateCommand *src);
+ virtual ~ObjstateCommand();
+
virtual bool load(MfcArchive &file);
+
+ virtual ObjstateCommand *createClone();
};
class MessageQueue : public CObject {
@@ -100,13 +114,15 @@ class MessageQueue : public CObject {
char *_queueName;
int16 _dataId;
CObject *_field_14;
- Common::List<ExCommand *> _exCommands;
int _counter;
int _field_38;
int _isFinished;
int _parId;
int _flag1;
+ private:
+ Common::List<ExCommand *> _exCommands;
+
public:
MessageQueue();
MessageQueue(int dataId);
@@ -121,6 +137,8 @@ class MessageQueue : public CObject {
uint getCount() { return _exCommands.size(); }
void addExCommand(ExCommand *ex);
+ void addExCommandToEnd(ExCommand *ex);
+ void insertExCommandAt(int pos, ExCommand *ex);
ExCommand *getExCommandByIndex(uint idx);
void deleteExCommandByIndex(uint idx, bool doFree);
@@ -172,9 +190,12 @@ bool insertMessageHandler(int (*callback)(ExCommand *), int index, int16 id);
void clearMessageHandlers();
void processMessages();
void updateGlobalMessageQueue(int id, int objid);
+void clearMessages();
void clearGlobalMessageQueueList1();
bool chainQueue(int queueId, int flags);
+bool chainObjQueue(StaticANIObject *obj, int queueId, int flags);
+void postExCommand(int parentId, int keyCode, int x, int y, int f20, int f16);
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index f766be3eac..ddb5b63d6a 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -24,9 +24,15 @@
#include "fullpipe/modal.h"
#include "fullpipe/messages.h"
#include "fullpipe/constants.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/constants.h"
+
+#include "graphics/palette.h"
+#include "video/avi_decoder.h"
+
namespace Fullpipe {
ModalIntro::ModalIntro() {
@@ -40,17 +46,17 @@ ModalIntro::ModalIntro() {
_introFlags = 33;
_countDown = 150;
- PictureObject *pict = g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0);
+ PictureObject *pict = g_fp->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0);
pict->setFlags(pict->_flags & 0xFFFB);
}
g_vars->sceneIntro_skipIntro = false;
- _sfxVolume = g_fullpipe->_sfxVolume;
+ _sfxVolume = g_fp->_sfxVolume;
}
ModalIntro::~ModalIntro() {
- g_fullpipe->stopAllSounds();
- g_fullpipe->_sfxVolume = _sfxVolume;
+ g_fp->stopAllSounds();
+ g_fp->_sfxVolume = _sfxVolume;
}
bool ModalIntro::handleMessage(ExCommand *message) {
@@ -84,7 +90,7 @@ bool ModalIntro::init(int counterdiff) {
}
if (_introFlags & 0x10)
- g_fullpipe->_gameLoader->updateSystems(42);
+ g_fp->_gameLoader->updateSystems(42);
_introFlags |= 2;
@@ -94,7 +100,7 @@ bool ModalIntro::init(int counterdiff) {
if (_introFlags & 4) {
ModalVideoPlayer *player = new ModalVideoPlayer();
- g_fullpipe->_modalObject = player;
+ g_fp->_modalObject = player;
player->_parentObj = this;
player->play("intro.avi");
@@ -118,7 +124,7 @@ bool ModalIntro::init(int counterdiff) {
if (_introFlags & 0x40) {
ModalVideoPlayer *player = new ModalVideoPlayer();
- g_fullpipe->_modalObject = player;
+ g_fp->_modalObject = player;
player->_parentObj = this;
player->play("intro2.avi");
@@ -151,7 +157,7 @@ bool ModalIntro::init(int counterdiff) {
_countDown = 150;
_introFlags = (_introFlags & 0xf7) | 0x21;
- g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0)->_flags &= 0xfffb;
+ g_fp->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0)->_flags &= 0xfffb;
}
if (!(_introFlags & 0x20)) {
@@ -159,12 +165,12 @@ bool ModalIntro::init(int counterdiff) {
if (!_stillRunning) {
_introFlags |= 1;
- g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0)->_flags &= 0xfffb;
- g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_GAMETITLE, 0)->_flags &= 0xfffb;
+ g_fp->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_PIPETITLE, 0)->_flags &= 0xfffb;
+ g_fp->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_GAMETITLE, 0)->_flags &= 0xfffb;
chainQueue(QU_INTR_STARTINTRO, 1);
}
- g_fullpipe->_gameLoader->updateSystems(42);
+ g_fp->_gameLoader->updateSystems(42);
}
return true;
}
@@ -180,7 +186,7 @@ bool ModalIntro::init(int counterdiff) {
_introFlags = (_introFlags & 0xdf) | 0x10;
- g_fullpipe->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_GAMETITLE, 0)->_flags &= 0xfffb;
+ g_fp->accessScene(SC_INTRO1)->getPictureObjectById(PIC_IN1_GAMETITLE, 0)->_flags &= 0xfffb;
_stillRunning = 0;
}
@@ -189,14 +195,14 @@ bool ModalIntro::init(int counterdiff) {
}
void ModalIntro::update() {
- if (g_fullpipe->_currentScene) {
+ if (g_fp->_currentScene) {
if (_introFlags & 1) {
//sceneFade(virt, g_currentScene, 1);
_stillRunning = 255;
_introFlags &= 0xfe;
if (_introFlags & 0x20)
- g_fullpipe->playSound(SND_INTR_019, 0);
+ g_fp->playSound(SND_INTR_019, 0);
} else if (_introFlags & 2) {
if (g_vars->sceneIntro_needBlackout) {
//vrtRectangle(*(_DWORD *)virt, 0, 0, 0, 800, 600);
@@ -209,26 +215,349 @@ void ModalIntro::update() {
_introFlags &= 0xfd;
}
} else if (_stillRunning) {
- g_fullpipe->_currentScene->draw();
+ g_fp->_currentScene->draw();
}
}
}
void ModalIntro::finish() {
- g_fullpipe->_gameLoader->unloadScene(SC_INTRO2);
- g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO1);
- g_fullpipe->_gameLoader->preloadScene(SC_INTRO1, TrubaDown);
+ g_fp->_gameLoader->unloadScene(SC_INTRO2);
+ g_fp->_currentScene = g_fp->accessScene(SC_INTRO1);
+ g_fp->_gameLoader->preloadScene(SC_INTRO1, TrubaDown);
+
+ if (g_fp->_currentScene)
+ g_fp->_gameLoader->updateSystems(42);
+}
+
+void ModalVideoPlayer::play(const char *filename) {
+ // TODO: Videos are encoded using Intel Indeo 5 (IV50), which isn't supported yet
+
+ Video::AVIDecoder *aviDecoder = new Video::AVIDecoder();
+
+ if (!aviDecoder->loadFile(filename))
+ return;
+
+ uint16 x = (g_system->getWidth() - aviDecoder->getWidth()) / 2;
+ uint16 y = (g_system->getHeight() - aviDecoder->getHeight()) / 2;
+ bool skipVideo = false;
+
+ aviDecoder->start();
+
+ while (!g_fp->shouldQuit() && !aviDecoder->endOfVideo() && !skipVideo) {
+ if (aviDecoder->needsUpdate()) {
+ const Graphics::Surface *frame = aviDecoder->decodeNextFrame();
+ if (frame) {
+ g_fp->_system->copyRectToScreen(frame->getPixels(), frame->pitch, x, y, frame->w, frame->h);
+
+ if (aviDecoder->hasDirtyPalette())
+ g_fp->_system->getPaletteManager()->setPalette(aviDecoder->getPalette(), 0, 256);
+
+ g_fp->_system->updateScreen();
+ }
+ }
+
+ Common::Event event;
+ while (g_fp->_system->getEventManager()->pollEvent(event)) {
+ if ((event.type == Common::EVENT_KEYDOWN && (event.kbd.keycode == Common::KEYCODE_ESCAPE ||
+ event.kbd.keycode == Common::KEYCODE_RETURN ||
+ event.kbd.keycode == Common::KEYCODE_SPACE))
+ || event.type == Common::EVENT_LBUTTONUP)
+ skipVideo = true;
+ }
+
+ g_fp->_system->delayMillis(aviDecoder->getTimeToNextFrame());
+ }
+}
+
+ModalMap::ModalMap() {
+ _mapScene = 0;
+ _pic = 0;
+ _isRunning = false;
+ _rect1 = g_fp->_sceneRect;
+ _x = g_fp->_currentScene->_x;
+ _y = g_fp->_currentScene->_y;
+ _flag = 0;
+ _mouseX = 0;
+ _mouseY = 0;
+ _field_38 = 0;
+ _field_3C = 0;
+ _field_40 = 12;
+ _rect2.top = 0;
+ _rect2.left = 0;
+ _rect2.bottom = 600;
+ _rect2.right = 800;
+}
+
+ModalMap::~ModalMap() {
+ g_fp->_gameLoader->unloadScene(SC_MAP);
+
+ g_fp->_sceneRect = _rect1;
- if (g_fullpipe->_currentScene)
- g_fullpipe->_gameLoader->updateSystems(42);
+ g_fp->_currentScene->_x = _x;
+ g_fp->_currentScene->_y = _y;
}
-void ModalVideoPlayer::play(const char *fname) {
- warning("STUB: ModalVideoPlayer::play(%s)", fname);
+bool ModalMap::init(int counterdiff) {
+ g_fp->setCursor(PIC_CSR_ITN);
+
+ if (_flag) {
+ _rect2.left = _mouseX + _field_38 - g_fp->_mouseScreenPos.x;
+ _rect2.top = _mouseY + _field_3C - g_fp->_mouseScreenPos.y;;
+ _rect2.right = _rect2.left + 800;
+ _rect2.bottom = _rect2.top + 600;
+
+ g_fp->_sceneRect =_rect2;
+
+ _mapScene->updateScrolling2();
+
+ _rect2 = g_fp->_sceneRect;
+ }
+
+ _field_40--;
+
+ if (_field_40 <= 0) {
+ _field_40 = 12;
+
+ if (_pic)
+ _pic->_flags ^= 4;
+ }
+
+ return _isRunning;
+}
+
+void ModalMap::update() {
+ g_fp->_sceneRect = _rect2;
+
+ _mapScene->draw();
+
+ g_fp->drawArcadeOverlay(1);
+}
+
+bool ModalMap::handleMessage(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return false;
+
+ switch (cmd->_messageNum) {
+ case 29:
+ _flag = 1;
+ _mouseX = g_fp->_mouseScreenPos.x;
+ _mouseY = g_fp->_mouseScreenPos.x;
+
+ _field_3C = _rect2.top;
+ _field_38 = _rect2.left;
+
+ break;
+
+ case 30:
+ _flag = 0;
+ break;
+
+ case 36:
+ if (cmd->_keyCode != 9 && cmd->_keyCode != 27 )
+ return false;
+
+ break;
+
+ case 107:
+ break;
+
+ default:
+ return false;
+ }
+
+ _isRunning = 0;
+
+ return true;
+}
+
+void ModalMap::initMap() {
+ _isRunning = 1;
+
+ _mapScene = g_fp->accessScene(SC_MAP);
+
+ if (!_mapScene)
+ error("ModalMap::initMap(): error accessing scene SC_MAP");
+
+ PictureObject *pic;
+
+ for (int i = 0; i < 200; i++) {
+ if (!g_fp->_mapTable[i] >> 16)
+ break;
+
+ pic = _mapScene->getPictureObjectById(g_fp->_mapTable[i] >> 16, 0);
+
+ if ((g_fp->_mapTable[i] & 0xffff) == 1)
+ pic->_flags |= 4;
+ else
+ pic->_flags &= 0xfffb;
+ }
+
+ pic = getScenePicture();
+
+ Common::Point point;
+ Common::Point point2;
+
+ if (pic) {
+ pic->getDimensions(&point);
+
+ _rect2.left = point.x / 2 + pic->_ox - 400;
+ _rect2.top = point.y / 2 + pic->_oy - 300;
+ _rect2.right = _rect2.left + 800;
+ _rect2.bottom = _rect2.top + 600;
+
+ _mapScene->updateScrolling2();
+
+ _pic = _mapScene->getPictureObjectById(PIC_MAP_I02, 0);
+ _pic->getDimensions(&point2);
+
+ _pic->setOXY(pic->_ox + point.x / 2 - point2.x / 2, point.y - point2.y / 2 + pic->_oy - 24);
+ _pic->_flags |= 4;
+
+ _pic = _mapScene->getPictureObjectById(PIC_MAP_I01, 0);
+ _pic->getDimensions(&point2);
+
+ _pic->setOXY(pic->_ox + point.x / 2 - point2.x / 2, point.y - point2.y / 2 + pic->_oy - 25);
+ _pic->_flags |= 4;
+ }
+
+ g_fp->setArcadeOverlay(PIC_CSR_MAP);
+}
+
+PictureObject *ModalMap::getScenePicture() {
+ int picId = 0;
+
+ switch (g_fp->_currentScene->_sceneId) {
+ case SC_1:
+ picId = PIC_MAP_S01;
+ break;
+ case SC_2:
+ picId = PIC_MAP_S02;
+ break;
+ case SC_3:
+ picId = PIC_MAP_S03;
+ break;
+ case SC_4:
+ picId = PIC_MAP_S04;
+ break;
+ case SC_5:
+ picId = PIC_MAP_S05;
+ break;
+ case SC_6:
+ picId = PIC_MAP_S06;
+ break;
+ case SC_7:
+ picId = PIC_MAP_S07;
+ break;
+ case SC_8:
+ picId = PIC_MAP_S08;
+ break;
+ case SC_9:
+ picId = PIC_MAP_S09;
+ break;
+ case SC_10:
+ picId = PIC_MAP_S10;
+ break;
+ case SC_11:
+ picId = PIC_MAP_S11;
+ break;
+ case SC_12:
+ picId = PIC_MAP_S12;
+ break;
+ case SC_13:
+ picId = PIC_MAP_S13;
+ break;
+ case SC_14:
+ picId = PIC_MAP_S14;
+ break;
+ case SC_15:
+ picId = PIC_MAP_S15;
+ break;
+ case SC_16:
+ picId = PIC_MAP_S16;
+ break;
+ case SC_17:
+ picId = PIC_MAP_S17;
+ break;
+ case SC_18:
+ case SC_19:
+ picId = PIC_MAP_S1819;
+ break;
+ case SC_20:
+ picId = PIC_MAP_S20;
+ break;
+ case SC_21:
+ picId = PIC_MAP_S21;
+ break;
+ case SC_22:
+ picId = PIC_MAP_S22;
+ break;
+ case SC_23:
+ picId = PIC_MAP_S23_1;
+ break;
+ case SC_24:
+ picId = PIC_MAP_S24;
+ break;
+ case SC_25:
+ picId = PIC_MAP_S25;
+ break;
+ case SC_26:
+ picId = PIC_MAP_S26;
+ break;
+ case SC_27:
+ picId = PIC_MAP_S27;
+ break;
+ case SC_28:
+ picId = PIC_MAP_S28;
+ break;
+ case SC_29:
+ picId = PIC_MAP_S29;
+ break;
+ case SC_30:
+ picId = PIC_MAP_S30;
+ break;
+ case SC_31:
+ picId = PIC_MAP_S31_1;
+ break;
+ case SC_32:
+ picId = PIC_MAP_S32_1;
+ break;
+ case SC_33:
+ picId = PIC_MAP_S33;
+ break;
+ case SC_34:
+ picId = PIC_MAP_S34;
+ break;
+ case SC_35:
+ picId = PIC_MAP_S35;
+ break;
+ case SC_36:
+ picId = PIC_MAP_S36;
+ break;
+ case SC_37:
+ picId = PIC_MAP_S37;
+ break;
+ case SC_38:
+ picId = PIC_MAP_S38;
+ break;
+ case SC_FINAL1:
+ picId = PIC_MAP_S38;
+ break;
+ }
+
+ if (picId)
+ return _mapScene->getPictureObjectById(picId, 0);
+
+ error("ModalMap::getScenePicture(): Unknown scene id: %d", g_fp->_currentScene->_sceneId);
}
void FullpipeEngine::openMap() {
- warning("STUB: FullpipeEngine::openMap()");
+ if (!_modalObject) {
+ ModalMap *map = new ModalMap;
+
+ _modalObject = map;
+
+ map->initMap();
+ }
}
void FullpipeEngine::openHelp() {
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index b57d1fbd06..af52e1b6a9 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -25,6 +25,8 @@
namespace Fullpipe {
+class PictureObject;
+
class BaseModalObject {
public:
@@ -75,6 +77,35 @@ public:
void play(const char *fname);
};
+class ModalMap : public BaseModalObject {
+ Scene *_mapScene;
+ PictureObject *_pic;
+ bool _isRunning;
+ Common::Rect _rect1;
+ int _x;
+ int _y;
+ int _flag;
+ int _mouseX;
+ int _mouseY;
+ int _field_38;
+ int _field_3C;
+ int _field_40;
+ Common::Rect _rect2;
+
+ public:
+ ModalMap();
+ virtual ~ModalMap();
+
+ virtual bool pollEvent() { return true; }
+ virtual bool handleMessage(ExCommand *message);
+ virtual bool init(int counterdiff);
+ virtual void update();
+ virtual void saveload() {}
+
+ void initMap();
+ PictureObject *getScenePicture();
+};
+
} // End of namespace Fullpipe
#endif /* FULLPIPE_MODAL_H */
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 88e3ac5d02..d9cecf058a 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/fullpipe
MODULE_OBJS = \
behavior.o \
+ console.o \
detection.o \
floaters.o \
fullpipe.o \
@@ -23,12 +24,42 @@ MODULE_OBJS = \
stateloader.o \
statics.o \
utils.o \
+ scenes/sceneIntro.o \
scenes/scene01.o \
scenes/scene02.o \
scenes/scene03.o \
scenes/scene04.o \
- scenes/sceneDbg.o \
- scenes/sceneIntro.o
+ scenes/scene05.o \
+ scenes/scene06.o \
+ scenes/scene07.o \
+ scenes/scene08.o \
+ scenes/scene10.o \
+ scenes/scene11.o \
+ scenes/scene12.o \
+ scenes/scene13.o \
+ scenes/scene14.o \
+ scenes/scene15.o \
+ scenes/scene16.o \
+ scenes/scene17.o \
+ scenes/scene18and19.o \
+ scenes/scene20.o \
+ scenes/scene21.o \
+ scenes/scene22.o \
+ scenes/scene23.o \
+ scenes/scene24.o \
+ scenes/scene25.o \
+ scenes/scene26.o \
+ scenes/scene28.o \
+ scenes/scene30.o \
+ scenes/scene31.o \
+ scenes/scene32.o \
+ scenes/scene33.o \
+ scenes/scene34.o \
+ scenes/scene35.o \
+ scenes/scene36.o \
+ scenes/scene37.o \
+ scenes/scene38.o \
+ scenes/sceneDbg.o
# This module can be built as a plugin
ifeq ($(ENABLE_FULLPIPE), DYNAMIC_PLUGIN)
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index c1977c0ac3..f0318581f1 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -28,9 +28,9 @@
#include "fullpipe/objects.h"
#include "fullpipe/statics.h"
+#include "fullpipe/gameloader.h"
#include "fullpipe/motion.h"
#include "fullpipe/messages.h"
-#include "fullpipe/gameloader.h"
namespace Fullpipe {
@@ -42,6 +42,48 @@ bool MotionController::load(MfcArchive &file) {
return true;
}
+void MotionController::enableLinks(const char *linkName, bool enable) {
+ warning("STUB: MotionController::enableLinks()");
+}
+
+MovGraphLink *MotionController::getLinkByName(const char *name) {
+ if (_objtype == kObjTypeMctlCompound) {
+ MctlCompound *obj = (MctlCompound *)this;
+
+ for (uint i = 0; i < obj->getMotionControllerCount(); i++) {
+ MotionController *con = obj->getMotionController(i);
+
+ if (con->_objtype == kObjTypeMovGraph) {
+ MovGraph *gr = (MovGraph *)con;
+
+ for (ObList::iterator l = gr->_links.begin(); l != gr->_links.end(); ++l) {
+ assert(((CObject *)*l)->_objtype == kObjTypeMovGraphLink);
+
+ MovGraphLink *lnk = (MovGraphLink *)*l;
+
+ if (!strcmp(lnk->_name, name))
+ return lnk;
+ }
+ }
+ }
+ }
+
+ if (_objtype == kObjTypeMovGraph) {
+ MovGraph *gr = (MovGraph *)this;
+
+ for (ObList::iterator l = gr->_links.begin(); l != gr->_links.end(); ++l) {
+ assert(((CObject *)*l)->_objtype == kObjTypeMovGraphLink);
+
+ MovGraphLink *lnk = (MovGraphLink *)*l;
+
+ if (!strcmp(lnk->_name, name))
+ return lnk;
+ }
+ }
+
+ return 0;
+}
+
bool MctlCompound::load(MfcArchive &file) {
debug(5, "MctlCompound::load()");
@@ -168,9 +210,9 @@ MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos,
if (mq) {
for (uint i = 0; i < closestP->_messageQueueObj->getCount(); i++) {
- ex = new ExCommand(closestP->_messageQueueObj->getExCommandByIndex(i));
+ ex = closestP->_messageQueueObj->getExCommandByIndex(i)->createClone();
ex->_excFlags |= 2;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
}
ex = new ExCommand(subj->_id, 51, 0, xpos, ypos, 0, 1, 0, 0, 0);
@@ -179,18 +221,201 @@ MessageQueue *MctlCompound::doWalkTo(StaticANIObject *subj, int xpos, int ypos,
ex->_keyCode = subj->_okeyCode;
ex->_excFlags |= 2;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
}
return mq;
}
+MctlCompoundArrayItem::~MctlCompoundArrayItem() {
+ delete _movGraphReactObj;
+ delete _motionControllerObj;
+}
+
+MctlLadder::MctlLadder() {
+ _width = 0;
+ _ladderX = 0;
+ _height = 0;
+ _ladderY = 0;
+ _ladder_field_14 = 0;
+
+ _ladder_field_20 = 0;
+ _ladder_field_24 = 0;
+}
+
+MctlLadder::~MctlLadder() {
+ freeItems();
+}
+
+int MctlLadder::collisionDetection(StaticANIObject *man) {
+ if (findObjectPos(man) < 0)
+ return 0;
+
+ double delta;
+
+ if ((double)(man->_oy - _ladderY) / (double)_height < 0.0)
+ delta = -0.5;
+ else
+ delta = 0.5;
+
+ int res = (int)((double)(man->_oy - _ladderY) / (double)_height + delta);
+
+ if (res < 0)
+ return 0;
+
+ return res;
+}
+
+void MctlLadder::addObject(StaticANIObject *obj) {
+ if (findObjectPos(obj) < 0) {
+ MctlLadderMovement *movement = new MctlLadderMovement;
+
+ if (initMovement(obj, movement)) {
+ _mgm.addItem(obj->_id);
+ _movements.push_back(movement);
+ } else {
+ delete movement;
+ }
+ }
+}
+
+int MctlLadder::findObjectPos(StaticANIObject *obj) {
+ int res = -1;
+
+ for (Common::List<MctlLadderMovement *>::iterator it = _movements.begin(); it != _movements.end(); ++it, ++res)
+ if ((*it)->objId == obj->_id)
+ break;
+
+ return res;
+}
+
+bool MctlLadder::initMovement(StaticANIObject *ani, MctlLadderMovement *movement) {
+ GameVar *v = g_fp->getGameLoaderGameVar()->getSubVarByName(ani->getName());
+
+ if (!v)
+ return false;
+
+ v = v->getSubVarByName("Test_Ladder");
+
+ if (!v)
+ return false;
+
+ movement->staticIdsSize = 6;
+ movement->movVars = new MctlLadderMovementVars;
+ movement->staticIds = new int[movement->staticIdsSize];
+
+ v = v->getSubVarByName("Up");
+
+ if (!v)
+ return false;
+
+ movement->movVars->varUpStart = v->getSubVarAsInt("Start");
+ movement->movVars->varUpGo = v->getSubVarAsInt("Go");
+ movement->movVars->varUpStop = v->getSubVarAsInt("Stop");
+
+ movement->staticIds[0] = ani->getMovementById(movement->movVars->varUpStart)->_staticsObj1->_staticsId;
+ movement->staticIds[2] = ani->getMovementById(movement->movVars->varUpGo)->_staticsObj1->_staticsId;
+
+ v = v->getSubVarByName("Down");
+
+ if (!v)
+ return false;
+
+ movement->movVars->varDownStart = v->getSubVarAsInt("Start");
+ movement->movVars->varDownGo = v->getSubVarAsInt("Go");
+ movement->movVars->varDownStop = v->getSubVarAsInt("Stop");
+
+ movement->staticIds[1] = ani->getMovementById(movement->movVars->varDownStart)->_staticsObj1->_staticsId;
+ movement->staticIds[3] = ani->getMovementById(movement->movVars->varDownGo)->_staticsObj1->_staticsId;
+
+ movement->objId = ani->_id;
+
+ return true;
+}
+
+void MctlLadder::freeItems() {
+ _mgm.clear();
+
+ for (Common::List<MctlLadderMovement *>::iterator it = _movements.begin(); it != _movements.end(); ++it) {
+ delete (*it)->movVars;
+ delete [] (*it)->staticIds;
+ }
+
+ _movements.clear();
+}
+
+MessageQueue *MctlLadder::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
+ MessageQueue *mq = doWalkTo(subj, xpos, ypos, fuzzyMatch, staticsId);
+
+ if (mq) {
+ if (mq->chain(subj))
+ return mq;
+ }
+
+ return 0;
+}
+
+MessageQueue *MctlLadder::doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
+ warning("STUB: MctlLadder::doWalkTo()");
+
+ return 0;
+}
+
+MessageQueue *MctlLadder::controllerWalkTo(StaticANIObject *ani, int off) {
+ return doWalkTo(ani, _ladderX + off * _width, _ladderY + off * _height, 1, 0);
+}
+
MctlConnectionPoint *MctlCompound::findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, int *minDistancePtr) {
warning("STUB: MctlCompound::findClosestConnectionPoint()");
return 0;
}
+void MctlCompound::replaceNodeX(int from, int to) {
+ warning("STUB: MctlCompound::replaceNodeX()");
+}
+
+MctlConnectionPoint::MctlConnectionPoint() {
+ _connectionX = 0;
+ _connectionY = 0;
+ _field_C = 0;
+ _field_10 = 0;
+ _field_14 = 0;
+ _field_16 = 0;
+ _messageQueueObj = 0;
+ _motionControllerObj = 0;
+}
+
+MctlConnectionPoint::~MctlConnectionPoint() {
+ delete _messageQueueObj;
+}
+
+MovInfo1::MovInfo1(MovInfo1 *src) {
+ index = src->index;
+ pt1 = src->pt1;
+ pt2 = src->pt2;
+ distance1 = src->distance1;
+ distance2 = src->distance2;
+ subIndex = src->subIndex;
+ item1Index = src->item1Index;
+ items = src->items;
+ itemsCount = src->itemsCount;
+ flags = src->flags;
+}
+
+void MovInfo1::clear() {
+ index = 0;
+ pt1.x = pt1.y = 0;
+ pt2.x = pt2.y = 0;
+ distance1 = 0;
+ distance2 = 0;
+ subIndex = 0;
+ item1Index = 0;
+ items.clear();
+ itemsCount = 0;
+ flags = 0;
+}
+
bool MctlCompoundArray::load(MfcArchive &file) {
debug(5, "MctlCompoundArray::load()");
@@ -238,6 +463,10 @@ MovGraph::MovGraph() {
_objtype = kObjTypeMovGraph;
}
+MovGraph::~MovGraph() {
+ warning("STUB: MovGraph::~MovGraph()");
+}
+
bool MovGraph::load(MfcArchive &file) {
debug(5, "MovGraph::load()");
@@ -280,10 +509,9 @@ int MovGraph::method28() {
return 0;
}
-int MovGraph::method2C() {
- warning("STUB: MovGraph::method2C()");
-
- return 0;
+int MovGraph::method2C(StaticANIObject *obj, int x, int y) {
+ obj->setOXY(x, y);
+ return method3C(obj, 1);
}
MessageQueue *MovGraph::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
@@ -298,7 +526,7 @@ int MovGraph::changeCallback() {
return 0;
}
-int MovGraph::method3C() {
+int MovGraph::method3C(StaticANIObject *ani, int flag) {
warning("STUB: MovGraph::method3C()");
return 0;
@@ -351,8 +579,8 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int fuzz
return -1.0;
}
} else {
- point->x = n1x + (dist2x * distm / link->_distance);
- point->y = n1y + (dist2y * distm / link->_distance);
+ point->x = (int)(n1x + (dist2x * distm / link->_distance));
+ point->y = (int)(n1y + (dist2y * distm / link->_distance));
}
return res;
@@ -405,7 +633,7 @@ bool MovGraph2::initDirections(StaticANIObject *obj, MovGraph2Item *item) {
item->_obj = obj;
item->_objectId = obj->_id;
- GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(obj->_objectName);
+ GameVar *var = g_fp->getGameLoaderGameVar()->getSubVarByName(obj->_objectName);
if (!var)
return false;
@@ -658,15 +886,13 @@ void MovGraph2::buildMovInfo1SubItems(MovInfo1 *movinfo, Common::Array<MovGraphL
}
MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
- MovInfo1 movinfo;
-
- memcpy(&movinfo, movInfo, sizeof(movinfo));
+ MovInfo1 movinfo(movInfo);
int curX = movInfo->pt1.x;
int curY = movInfo->pt1.y;
int curDistance = movInfo->distance1;
- MessageQueue *mq = new MessageQueue(g_fullpipe->_globalMessageQueueList->compact());
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
for (int i = 0; i < movInfo->itemsCount - 1; i++) {
if (movInfo->items[i + 1]->subIndex != 10) {
@@ -674,10 +900,10 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
if (i >= movInfo->itemsCount - 2 || movInfo->items[i + 2]->subIndex != 10) {
movinfo.flags = 0;
- mg2i = &_items2[movInfo->field_0]->_subItems[movInfo->items[i]->subIndex]._turnS[movInfo->items[i + 1]->subIndex];
+ mg2i = &_items2[movInfo->index]->_subItems[movInfo->items[i]->subIndex]._turnS[movInfo->items[i + 1]->subIndex];
} else {
movinfo.flags = 2;
- mg2i = &_items2[movInfo->field_0]->_subItems[movInfo->items[i]->subIndex]._turn[movInfo->items[i + 1]->subIndex];
+ mg2i = &_items2[movInfo->index]->_subItems[movInfo->items[i]->subIndex]._turn[movInfo->items[i + 1]->subIndex];
}
if (i < movInfo->itemsCount - 2
|| (movInfo->items[i]->x == movInfo->items[i + 1]->x
@@ -687,13 +913,13 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
|| movInfo->items[i + 1]->x == -1
|| movInfo->items[i + 1]->y == -1) {
- ExCommand *ex = new ExCommand(_items2[movInfo->field_0]->_objectId, 1, mg2i->_movementId, 0, 0, 0, 1, 0, 0, 0);
+ ExCommand *ex = new ExCommand(_items2[movInfo->index]->_objectId, 1, mg2i->_movementId, 0, 0, 0, 1, 0, 0, 0);
ex->_excFlags |= 2;
- ex->_keyCode = _items2[movInfo->field_0]->_obj->_okeyCode;
+ ex->_keyCode = _items2[movInfo->index]->_obj->_okeyCode;
ex->_field_24 = 1;
ex->_field_14 = -1;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
curX += mg2i->_mx;
curY += mg2i->_my;
@@ -702,7 +928,7 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
memset(&mgminfo, 0, sizeof(mgminfo));
- mgminfo.ani = _items2[movInfo->field_0]->_obj;
+ mgminfo.ani = _items2[movInfo->index]->_obj;
mgminfo.staticsId2 = mg2i->_mov->_staticsObj2->_staticsId;
mgminfo.x1 = movInfo->items[i + 1]->x;
mgminfo.y1 = movInfo->items[i + 1]->y;
@@ -745,13 +971,13 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
|| movInfo->items[i + 2]->subIndex == movInfo->items[i + 3]->subIndex) {
movinfo.flags &= 3;
} else {
- MG2I *m = &_items2[movInfo->field_0]->_subItems[movInfo->items[i + 2]->subIndex]._turnS[movInfo->items[i + 3]->subIndex];
+ MG2I *m = &_items2[movInfo->index]->_subItems[movInfo->items[i + 2]->subIndex]._turnS[movInfo->items[i + 3]->subIndex];
movinfo.pt2.x -= m->_mx;
movinfo.pt2.y -= m->_my;
movinfo.flags &= 3;
}
} else {
- MG2I *m = &_items2[movInfo->field_0]->_subItems[movInfo->items[i + 2]->subIndex]._turn[movInfo->items[i + 3]->subIndex];
+ MG2I *m = &_items2[movInfo->index]->_subItems[movInfo->items[i + 2]->subIndex]._turn[movInfo->items[i + 3]->subIndex];
if (movinfo.item1Index && movinfo.item1Index != 1) {
movinfo.pt2.y -= m->_my;
@@ -765,7 +991,7 @@ MessageQueue *MovGraph2::buildMovInfo1MessageQueue(MovInfo1 *movInfo) {
MessageQueue *mq2 = genMovement(&movinfo);
- if (mq2) {
+ if (!mq2) {
delete mq;
return 0;
}
@@ -902,7 +1128,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
}
if (obj->_ox == xpos && obj->_oy == ypos) {
- g_fullpipe->_globalMessageQueueList->compact();
+ g_fp->_globalMessageQueueList->compact();
MessageQueue *mq = new MessageQueue();
@@ -922,20 +1148,20 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
ex->_keyCode = picAniInfo.field_8;
ex->_excFlags |= 2;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
} else {
ExCommand *ex = new ExCommand(picAniInfo.objectId, 22, obj->_statics->_staticsId, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = picAniInfo.field_8;
ex->_excFlags |= 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
ex = new ExCommand(picAniInfo.objectId, 5, -1, obj->_ox, obj->_oy, 0, 1, 0, 0, 0);
ex->_field_14 = -1;
ex->_keyCode = picAniInfo.field_8;
ex->_excFlags |= 3;
- mq->_exCommands.push_back(ex);
+ mq->addExCommandToEnd(ex);
}
obj->setPicAniInfo(&picAniInfo);
@@ -979,6 +1205,8 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
if (minPath < 0.0 || ((linkInfoSource.node != linkInfoDest.node || !linkInfoSource.node) && !tempLinkList.size()))
return 0;
+ movInfo1.clear();
+
movInfo1.subIndex = idxsub;
movInfo1.pt1.x = obj->_ox;
movInfo1.pt1.y = obj->_oy;
@@ -1008,7 +1236,7 @@ MessageQueue *MovGraph2::doWalkTo(StaticANIObject *obj, int xpos, int ypos, int
double dst1 = sqrt((double)((ypos - nod->_y) * (ypos - nod->_y) + (xpos - nod->_x) * (xpos - nod->_x)));
int dst = linkInfoDest.link->_movGraphNode2->_distance - nod->_distance;
- movInfo1.distance2 = nod->_distance + (dst1 * (double)dst / linkInfoDest.link->_distance);
+ movInfo1.distance2 = (int)(nod->_distance + (dst1 * (double)dst / linkInfoDest.link->_distance));
calcDistance(&movInfo1.pt2, linkInfoDest.link, 1);
@@ -1155,10 +1383,205 @@ int MovGraph2::findLink(Common::Array<MovGraphLink *> *linkList, int idx, Common
return node3->_x >= node2->_x;
}
-MessageQueue *MovGraph2::genMovement(MovInfo1 *movinfo) {
- warning("STUB: MovGraph2::genMovement()");
+MessageQueue *MovGraph2::genMovement(MovInfo1 *info) {
+ int mx1 = 0;
+ int my1 = 0;
- return 0;
+ if (!(info->flags & 2)) {
+ mx1 = _items2[info->index]->_subItems[info->subIndex]._walk[0]._mx;
+ my1 = _items2[info->index]->_subItems[info->subIndex]._walk[0]._my;
+ }
+
+ int mx2 = 0;
+ int my2 = 0;
+
+ if (!(info->flags & 4)) {
+ mx2 = _items2[info->index]->_subItems[info->subIndex]._walk[2]._mx;
+ my2 = _items2[info->index]->_subItems[info->subIndex]._walk[2]._my;
+ }
+
+ Common::Point point;
+
+ int y = info->pt2.y - info->pt1.y - my2 - my1;
+ int x = info->pt2.x - info->pt1.x - mx2 - mx1;
+ int a2;
+ int mgmLen;
+
+ _mgm.calcLength(&point, _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov, x, y, &mgmLen, &a2, info->flags & 1);
+
+ int x1 = point.x;
+ int y1 = point.y;
+
+ if (!(info->flags & 1)) {
+ if (info->subIndex == 1 || info->subIndex == 0) {
+ a2 = -1;
+ x1 = mgmLen * _items2[info->index]->_subItems[info->subIndex]._walk[1]._mx;
+ x = x1;
+ info->pt2.x = x1 + info->pt1.x + mx1 + mx2;
+ }
+ }
+
+ if (!(info->flags & 1)) {
+ if (info->subIndex == 2 || info->subIndex == 3) {
+ a2 = -1;
+ y1 = mgmLen * _items2[info->index]->_subItems[info->subIndex]._walk[1]._my;
+ y = y1;
+ info->pt2.y = y1 + info->pt1.y + my1 + my2;
+ }
+ }
+
+ int cntX = 0;
+ int cntY = 0;
+
+ if (!(info->flags & 2)) {
+ cntX = _items2[info->index]->_subItems[info->subIndex]._walk[0]._mov->countPhasesWithFlag(-1, 1);
+ cntY = _items2[info->index]->_subItems[info->subIndex]._walk[0]._mov->countPhasesWithFlag(-1, 2);
+ }
+
+ if (mgmLen > 1) {
+ cntX += (mgmLen - 1) * _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov->countPhasesWithFlag(-1, 1);
+ cntY += (mgmLen - 1) * _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov->countPhasesWithFlag(-1, 2);
+ }
+
+ if (mgmLen > 0) {
+ cntX += _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov->countPhasesWithFlag(a2, 1);
+ cntY += _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov->countPhasesWithFlag(a2, 2);
+ }
+
+ if (!(info->flags & 4)) {
+ cntX += _items2[info->index]->_subItems[info->subIndex]._walk[2]._mov->countPhasesWithFlag(-1, 1);
+ cntY += _items2[info->index]->_subItems[info->subIndex]._walk[2]._mov->countPhasesWithFlag(-1, 2);
+ }
+
+ int dx1 = x - x1;
+ int dy1 = y - y1;
+
+ if (cntX)
+ x1 = (int)((double)dx1 / (double)cntX);
+ else
+ x1 = 0;
+
+ if (cntY)
+ y1 = (int)((double)dy1 / (double)cntY);
+ else
+ y1 = 0;
+
+ int v34 = dx1 - cntX * x1;
+ int v35 = dy1 - cntY * y1;
+ Common::Point x2;
+ Common::Point y2(v34, v35);
+
+ if (v34)
+ x2.x = v34 / abs(v34);
+ else
+ x2.x = 0;
+
+ if (v35)
+ x2.y = v35 / abs(v35);
+ else
+ x2.y = 0;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand *ex;
+
+ if (info->flags & 2) {
+ ex = new ExCommand(
+ _items2[info->index]->_objectId,
+ 5,
+ _items2[info->index]->_subItems[info->subIndex]._walk[1]._movementId,
+ info->pt1.x,
+ info->pt1.y,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0);
+
+ ex->_field_14 = info->distance1;
+
+ ex->_keyCode = _items2[info->index]->_obj->_okeyCode;
+ ex->_field_24 = 1;
+ ex->_excFlags |= 2;
+ } else {
+ ex = new ExCommand(
+ _items2[info->index]->_objectId,
+ 5,
+ _items2[info->index]->_subItems[info->subIndex]._walk[0]._movementId,
+ info->pt1.x,
+ info->pt1.y,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0);
+
+ ex->_field_14 = info->distance1;
+
+ ex->_keyCode = _items2[info->index]->_obj->_okeyCode;
+ ex->_field_24 = 1;
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = _mgm.buildExCommand2(
+ _items2[info->index]->_subItems[info->subIndex]._walk[0]._mov,
+ _items2[info->index]->_objectId,
+ x1,
+ y1,
+ &x2,
+ &y2,
+ -1);
+ ex->_parId = mq->_id;
+ ex->_keyCode = _items2[info->index]->_obj->_okeyCode;
+ }
+
+ mq->addExCommandToEnd(ex);
+
+ for (int i = 0; i < mgmLen; ++i) {
+ int par;
+
+ if (i == mgmLen - 1)
+ par = a2;
+ else
+ par = -1;
+
+ ex = _mgm.buildExCommand2(
+ _items2[info->index]->_subItems[info->subIndex]._walk[1]._mov,
+ _items2[info->index]->_objectId,
+ x1,
+ y1,
+ &x2,
+ &y2,
+ par);
+ ex->_parId = mq->_id;
+ ex->_keyCode = _items2[info->index]->_obj->_okeyCode;
+ mq->addExCommandToEnd(ex);
+ }
+
+ if (!(info->flags & 4)) {
+ ex = _mgm.buildExCommand2(
+ _items2[info->index]->_subItems[info->subIndex]._walk[2]._mov,
+ _items2[info->index]->_objectId,
+ x1,
+ y1,
+ &x2,
+ &y2,
+ -1);
+ ex->_parId = mq->_id;
+ ex->_keyCode = _items2[info->index]->_obj->_okeyCode;
+
+ mq->addExCommandToEnd(ex);
+ }
+
+ ex = new ExCommand(_items2[info->index]->_objectId, 5, -1, info->pt2.x, info->pt2.y, 0, 1, 0, 0, 0);
+ ex->_field_14 = info->distance2;
+
+ ex->_keyCode = _items2[info->index]->_obj->_okeyCode;
+ ex->_field_24 = 0;
+ ex->_excFlags |= 2;
+
+ mq->addExCommandToEnd(ex);
+
+ return mq;
}
MovGraphLink *MovGraph2::findLink1(int x, int y, int idx, int fuzzyMatch) {
@@ -1365,7 +1788,7 @@ void MGM::rebuildTables(int objId) {
_items[idx]->movements1.clear();
_items[idx]->movements2.clear();
- StaticANIObject *obj = g_fullpipe->_currentScene->getStaticANIObject1ById(objId, -1);
+ StaticANIObject *obj = g_fp->_currentScene->getStaticANIObject1ById(objId, -1);
if (!obj)
return;
@@ -1393,6 +1816,243 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) {
return 0;
}
+void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) {
+ if (getItemIndexById(ani->_id) == -1)
+ return;
+
+ if (ani->_movement) {
+ ani->queueMessageQueue(0);
+ ani->_movement->gotoLastFrame();
+ ani->_statics = ani->_movement->_staticsObj2;
+
+ int x = ani->_movement->_ox;
+ int y = ani->_movement->_oy;
+
+ ani->_movement = 0;
+
+ ani->setOXY(x, y);
+ }
+
+ if (ani->_statics) {
+ Common::Point point;
+
+ getPoint(&point, ani->_id, ani->_statics->_staticsId, staticsId);
+
+ ani->setOXY(ani->_ox + point.x, ani->_oy + point.y);
+
+ ani->_statics = ani->getStaticsById(staticsId);
+ }
+}
+
+Common::Point *MGM::getPoint(Common::Point *point, int objectId, int staticsId1, int staticsId2) {
+ int idx = getItemIndexById(objectId);
+
+ if (idx == -1) {
+ point->x = -1;
+ point->y = -1;
+ } else {
+ int st1idx = getStaticsIndexById(idx, staticsId1);
+ int st2idx = getStaticsIndexById(idx, staticsId2);
+
+ if (st1idx == st2idx) {
+ point->x = 0;
+ point->y = 0;
+ } else {
+ int subidx = st1idx + st2idx * _items[idx]->statics.size();
+
+ if (!_items[idx]->subItems[subidx]->movement) {
+ clearMovements2(idx);
+ recalcOffsets(idx, st1idx, st2idx, false, true);
+
+ if (!_items[idx]->subItems[subidx]->movement) {
+ clearMovements2(idx);
+ recalcOffsets(idx, st1idx, st2idx, true, false);
+ }
+ }
+
+ MGMSubItem *sub = _items[idx]->subItems[subidx];
+
+ if (sub->movement) {
+ point->x = sub->x;
+ point->y = sub->y;
+ } else {
+ point->x = 0;
+ point->y = 0;
+ }
+ }
+ }
+
+ return point;
+}
+
+int MGM::getStaticsIndexById(int idx, int16 id) {
+ if (!_items[idx]->statics.size())
+ return -1;
+
+ for (uint i = 0; i < _items[idx]->statics.size(); i++) {
+ if (_items[idx]->statics[i]->_staticsId == id)
+ return i;
+ }
+
+ return 0;
+}
+
+int MGM::getStaticsIndex(int idx, Statics *st) {
+ if (!_items[idx]->statics.size())
+ return -1;
+
+ for (uint i = 0; i < _items[idx]->statics.size(); i++) {
+ if (_items[idx]->statics[i] == st)
+ return i;
+ }
+
+ return 0;
+}
+
+void MGM::clearMovements2(int idx) {
+ _items[idx]->movements2.clear();
+}
+
+int MGM::recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop) {
+ warning("STUB: MGM::recalcOffsets()");
+
+ return 0;
+}
+
+Common::Point *MGM::calcLength(Common::Point *pRes, Movement *mov, int x, int y, int *x1, int *y1, int flag) {
+ Common::Point point;
+
+ mov->calcSomeXY(point, 0);
+ int p1x = point.x;
+ int p1y = point.y;
+
+ int newx1 = 0;
+ int oldy1 = *y1;
+
+ if (abs(p1y) > abs(p1x)) {
+ if (mov->calcSomeXY(point, 0)->y)
+ newx1 = (int)((double)y / point.y);
+ } else if (mov->calcSomeXY(point, 0)->x) {
+ newx1 = (int)((double)x / point.y);
+ }
+
+ if (newx1 < 0)
+ newx1 = 0;
+
+ *x1 = newx1;
+
+ int phase = 1;
+ int sz;
+
+ if (flag) {
+ if (abs(p1y) > abs(p1x)) {
+ while (abs(p1y * newx1 + mov->calcSomeXY(point, 0)->y) < abs(y)) {
+ sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
+
+ if (phase >= sz) {
+ phase--;
+
+ break;
+ }
+
+ phase++;
+ }
+ } else {
+ while (abs(p1x * newx1 + mov->calcSomeXY(point, 0)->x) < abs(x)) {
+ sz = mov->_currMovement ? mov->_currMovement->_dynamicPhases.size() : mov->_dynamicPhases.size();
+
+ if (phase >= sz) {
+ phase--;
+
+ break;
+ }
+
+ phase++;
+ }
+ }
+
+ *y1 = phase - 1;
+ } else {
+ *y1 = -1;
+ }
+
+ int p2x = 0;
+ int p2y = 0;
+
+ if (!oldy1)
+ oldy1 = -1;
+
+ if (oldy1 > 0) {
+ ++*x1;
+
+ mov->calcSomeXY(point, 0);
+ p2x = point.x;
+ p2y = point.y;
+
+ if (abs(p1y) > abs(p1x))
+ p2x = p1x;
+ else
+ p2y = p1y;
+ }
+
+ pRes->x = p2x + p1x * newx1;
+ pRes->y = p2y + p1y * newx1;
+
+ return pRes;
+}
+
+ExCommand2 *MGM::buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len) {
+ uint cnt;
+
+ if (mov->_currMovement)
+ cnt = mov->_currMovement->_dynamicPhases.size();
+ else
+ cnt = mov->_dynamicPhases.size();
+
+ if (len > 0 && cnt > (uint)len)
+ cnt = len;
+
+ Common::Point **points = (Common::Point **)malloc(sizeof(Common::Point *) * cnt);
+
+ for (uint i = 0; i < cnt; i++) {
+ int flags = mov->getDynamicPhaseByIndex(i)->getDynFlags();
+
+ points[i] = new Common::Point;
+
+ if (flags & 1) {
+ points[i]->x = x1 + x2->x;
+
+ y2->x -= x2->x;
+
+ if (!y2->x)
+ x2->x = 0;
+ }
+
+ if (flags & 2) {
+ points[i]->y = y1 + x2->y;
+
+ y2->y -= x2->y;
+
+ if (!y2->y)
+ x2->y = 0;
+ }
+ }
+
+ ExCommand2 *ex = new ExCommand2(20, objId, points, cnt);
+ ex->_excFlags = 2;
+ ex->_messageNum = mov->_id;
+ ex->_field_14 = len;
+ ex->_field_24 = 1;
+ ex->_keyCode = -1;
+
+ for (uint i = 0; i < cnt; i++)
+ delete points[i];
+
+ free(points);
+
+ return ex;
+}
+
MovGraphLink::MovGraphLink() {
_distance = 0;
_angle = 0;
@@ -1407,6 +2067,11 @@ MovGraphLink::MovGraphLink() {
_objtype = kObjTypeMovGraphLink;
}
+MovGraphLink::~MovGraphLink() {
+ warning("STUB: MovGraphLink::~MovGraphLink()");
+}
+
+
bool MovGraphLink::load(MfcArchive &file) {
debug(5, "MovGraphLink::load()");
@@ -1482,7 +2147,7 @@ void ReactParallel::createRegion() {
for (int i = 0; i < 4; i++)
_points[i] = new Common::Point;
- double at = atan2((double)(_x1 - _x2), (double)(_y1 - _y2)) + 1.570796;
+ double at = atan2((double)(_x1 - _x2), (double)(_y1 - _y2)) + 1.570796; // pi/2
double sn = sin(at);
double cs = cos(at);
@@ -1502,20 +2167,28 @@ void ReactParallel::createRegion() {
// GdiObject::Attach(_rgn, CreatePolygonRgn(_points, 4, 2);
}
-void ReactParallel::method14() {
- warning("STUB: ReactParallel::method14()");
+void ReactParallel::setCenter(int x1, int y1, int x2, int y2) {
+ _x1 = x1;
+ _y1 = y1;
+ _x2 = x2;
+ _y2 = y2;
}
ReactPolygonal::ReactPolygonal() {
- _field_C = 0;
- _field_10 = 0;
+ _centerX = 0;
+ _centerY = 0;
+ _bbox = 0;
+}
+
+ReactPolygonal::~ReactPolygonal() {
+ delete _bbox;
}
bool ReactPolygonal::load(MfcArchive &file) {
debug(5, "ReactPolygonal::load()");
- _field_C = file.readUint32LE();
- _field_10 = file.readUint32LE();
+ _centerX = file.readUint32LE();
+ _centerY = file.readUint32LE();
_pointCount = file.readUint32LE();
if (_pointCount > 0) {
@@ -1542,10 +2215,54 @@ void ReactPolygonal::createRegion() {
}
}
-void ReactPolygonal::method14() {
- warning("STUB: ReactPolygonal::method14()");
+void ReactPolygonal::setCenter(int x1, int y1, int x2, int y2) {
+ int cX = (x2 + x1) / 2;
+ int cY = (y2 + y1) / 2;
+
+ if (_points) {
+ for (int i = 0; i < _pointCount; i++) {
+ _points[i]->x += cX - _centerX;
+ _points[i]->y += cY - _centerY;
+ }
+ }
+
+ _centerX = cX;
+ _centerY = cY;
+}
+
+void ReactPolygonal::getBBox(Common::Rect *rect) {
+ if (!_pointCount)
+ return;
+
+ if (_bbox) {
+ *rect = *_bbox;
+ return;
+ }
+
+ rect->left = _points[0]->x;
+ rect->top = _points[0]->y;
+ rect->right = _points[0]->x;
+ rect->bottom = _points[0]->y;
+
+ for (int i = 1; i < _pointCount; i++) {
+ if (rect->left > _points[i]->x)
+ rect->left = _points[i]->x;
+
+ if (rect->top < _points[i]->y)
+ rect->top = _points[i]->y;
+
+ if (rect->right < _points[i]->x)
+ rect->right = _points[i]->x;
+
+ if (rect->bottom > _points[i]->y)
+ rect->bottom = _points[i]->y;
+ }
+
+ _bbox = new Common::Rect;
+ *_bbox = *rect;
}
+
bool MovGraphReact::pointInRegion(int x, int y) {
if (_pointCount < 3) {
return false;
@@ -1555,15 +2272,15 @@ bool MovGraphReact::pointInRegion(int x, int y) {
double xinters;
Common::Point p, p1, p2;
- p.x = (double)x;
- p.y = (double)y;
+ p.x = x;
+ p.y = y;
- p1.x = (double)_points[0]->x;
- p1.y = (double)_points[0]->y;
+ p1.x = _points[0]->x;
+ p1.y = _points[0]->y;
for (int i = 1; i <= _pointCount; i++) {
- p2.x = (double)_points[i % _pointCount]->x;
- p2.y = (double)_points[i % _pointCount]->y;
+ p2.x = _points[i % _pointCount]->x;
+ p2.y = _points[i % _pointCount]->y;
if (p.y > MIN(p1.y, p2.y)) {
if (p.y <= MAX(p1.y, p2.y)) {
@@ -1588,16 +2305,20 @@ bool MovGraphReact::pointInRegion(int x, int y) {
}
int startWalkTo(int objId, int objKey, int x, int y, int a5) {
- MctlCompound *mc = getSc2MctlCompoundBySceneId(g_fullpipe->_currentScene->_sceneId);
+ MctlCompound *mc = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId);
if (mc)
- return (mc->method34(g_fullpipe->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, a5, 0) != 0);
+ return (mc->method34(g_fp->_currentScene->getStaticANIObject1ById(objId, objKey), x, y, a5, 0) != 0);
return 0;
}
int doSomeAnimation(int objId, int objKey, int a3) {
- warning("STUB: doSomeAnimation(%d, %d, %d)", objId, objKey, a3);
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(objId, objKey);
+ MctlCompound *cmp = getCurrSceneSc2MotionController();
+
+ if (ani && cmp)
+ return cmp->method3C(ani, a3);
return 0;
}
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index bab0ffc8ca..6ad46e719a 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -28,6 +28,9 @@ namespace Fullpipe {
class Statics;
class Movement;
class MctlConnectionPoint;
+class MovGraphLink;
+class MessageQueue;
+class ExCommand2;
int startWalkTo(int objId, int objKey, int x, int y, int a5);
int doSomeAnimation(int objId, int objKey, int a3);
@@ -50,15 +53,18 @@ public:
virtual int removeObject(StaticANIObject *obj) { return 0; }
virtual void freeItems() {}
virtual int method28() { return 0; }
- virtual int method2C() { return 0; }
+ virtual int method2C(StaticANIObject *obj, int x, int y) { return 0; }
virtual int method30() { return 0; }
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
virtual int changeCallback() { return 0; }
- virtual int method3C() { return 0; }
+ virtual int method3C(StaticANIObject *ani, int flag) { return 0; }
virtual int method40() { return 0; }
virtual int method44() { return 0; }
virtual int method48() { return -1; }
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) { return 0; }
+
+ void enableLinks(const char *linkName, bool enable);
+ MovGraphLink *getLinkByName(const char *name);
};
class MovGraphReact : public CObject {
@@ -70,15 +76,13 @@ public:
MovGraphReact() : _pointCount(0), _points(0) {}
~MovGraphReact() { free(_points); }
- virtual void method14() {}
+ virtual void setCenter(int x1, int y1, int x2, int y2) {}
virtual void createRegion() {}
virtual bool pointInRegion(int x, int y);
};
class MctlCompoundArrayItem : public CObject {
- friend class MctlCompound;
-
-protected:
+public:
MotionController *_motionControllerObj;
MovGraphReact *_movGraphReactObj;
Common::Array<MctlConnectionPoint *> _connectionPoints;
@@ -88,6 +92,7 @@ protected:
public:
MctlCompoundArrayItem() : _movGraphReactObj(0), _motionControllerObj(0), _field_20(0), _field_24(0), _field_28(0) {}
+ ~MctlCompoundArrayItem();
};
class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public CObject {
@@ -96,9 +101,9 @@ class MctlCompoundArray : public Common::Array<MctlCompoundArrayItem *>, public
};
class MctlCompound : public MotionController {
+public:
MctlCompoundArray _motionControllers;
- public:
MctlCompound() { _objtype = kObjTypeMctlCompound; }
virtual bool load(MfcArchive &file);
@@ -111,10 +116,14 @@ class MctlCompound : public MotionController {
void initMovGraph2();
MctlConnectionPoint *findClosestConnectionPoint(int ox, int oy, int destIndex, int connectionX, int connectionY, int sourceIndex, int *minDistancePtr);
+ void replaceNodeX(int from, int to);
+
+ uint getMotionControllerCount() { return _motionControllers.size(); }
+ MotionController *getMotionController(int num) { return _motionControllers[num]->_motionControllerObj; }
};
struct MGMSubItem {
- int movement;
+ Movement *movement;
int staticsIndex;
int field_8;
int field_C;
@@ -146,6 +155,8 @@ struct MGMInfo {
int x2;
int y2;
int flags;
+
+ MGMInfo() { memset(this, 0, sizeof(MGMInfo)); }
};
class MGM : public CObject {
@@ -159,6 +170,60 @@ public:
int getItemIndexById(int objId);
MessageQueue *genMovement(MGMInfo *mgminfo);
+ void updateAnimStatics(StaticANIObject *ani, int staticsId);
+ Common::Point *getPoint(Common::Point *point, int aniId, int staticsId1, int staticsId2);
+ int getStaticsIndexById(int idx, int16 id);
+ int getStaticsIndex(int idx, Statics *st);
+ void clearMovements2(int idx);
+ int recalcOffsets(int idx, int st1idx, int st2idx, bool flip, bool flop);
+ Common::Point *calcLength(Common::Point *point, Movement *mov, int x, int y, int *x1, int *y1, int flag);
+ ExCommand2 *buildExCommand2(Movement *mov, int objId, int x1, int y1, Common::Point *x2, Common::Point *y2, int len);
+};
+
+struct MctlLadderMovementVars {
+ int varUpGo;
+ int varDownGo;
+ int varUpStop;
+ int varDownStop;
+ int varUpStart;
+ int varDownStart;
+};
+
+struct MctlLadderMovement {
+ int objId;
+ int staticIdsSize;
+ MctlLadderMovementVars *movVars;
+ int *staticIds;
+};
+
+class MctlLadder : public MotionController {
+public:
+ int _ladderX;
+ int _ladderY;
+ int _ladder_field_14;
+ int _width;
+ int _height;
+ int _ladder_field_20;
+ int _ladder_field_24;
+ Common::List<MctlLadderMovement *> _movements;
+ MGM _mgm;
+
+public:
+ MctlLadder();
+ virtual ~MctlLadder();
+ int collisionDetection(StaticANIObject *man);
+
+ virtual void addObject(StaticANIObject *obj);
+ virtual int removeObject(StaticANIObject *obj) { return 1; }
+ virtual void freeItems();
+ virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
+ virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
+
+ MessageQueue *controllerWalkTo(StaticANIObject *ani, int off);
+
+private:
+ int findObjectPos(StaticANIObject *obj);
+ bool initMovement(StaticANIObject *ani, MctlLadderMovement *movement);
};
class MovGraphNode : public CObject {
@@ -183,25 +248,29 @@ class ReactParallel : public MovGraphReact {
int _dx;
int _dy;
- public:
+public:
ReactParallel();
virtual bool load(MfcArchive &file);
- virtual void method14();
+ virtual void setCenter(int x1, int y1, int x2, int y2);
virtual void createRegion();
};
class ReactPolygonal : public MovGraphReact {
- //CRgn _rgn;
- int _field_C;
- int _field_10;
+ Common::Rect *_bbox;
+ int _centerX;
+ int _centerY;
- public:
+public:
ReactPolygonal();
+ ~ReactPolygonal();
+
virtual bool load(MfcArchive &file);
- virtual void method14();
+ virtual void setCenter(int x1, int y1, int x2, int y2);
virtual void createRegion();
+
+ void getBBox(Common::Rect *rect);
};
class MovGraphLink : public CObject {
@@ -220,6 +289,8 @@ class MovGraphLink : public CObject {
public:
MovGraphLink();
+ virtual ~MovGraphLink();
+
virtual bool load(MfcArchive &file);
void calcNodeDistanceAndAngle();
@@ -257,16 +328,18 @@ public:
public:
MovGraph();
+ virtual ~MovGraph();
+
virtual bool load(MfcArchive &file);
virtual void addObject(StaticANIObject *obj);
virtual int removeObject(StaticANIObject *obj);
virtual void freeItems();
virtual int method28();
- virtual int method2C();
+ virtual int method2C(StaticANIObject *obj, int x, int y);
virtual MessageQueue *method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
virtual int changeCallback();
- virtual int method3C();
+ virtual int method3C(StaticANIObject *ani, int flag);
virtual int method44();
virtual MessageQueue *doWalkTo(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId);
virtual int method50();
@@ -306,7 +379,7 @@ struct MovInfo1Sub {
};
struct MovInfo1 {
- int field_0;
+ int index;
Common::Point pt1;
Common::Point pt2;
int distance1;
@@ -316,6 +389,10 @@ struct MovInfo1 {
Common::Array<MovInfo1Sub *> items;
int itemsCount;
int flags;
+
+ MovInfo1() { clear(); }
+ MovInfo1(MovInfo1 *src);
+ void clear();
};
struct MovGraph2Item { // 744
@@ -365,6 +442,9 @@ public:
int16 _field_16;
MessageQueue *_messageQueueObj;
int _motionControllerObj;
+
+ MctlConnectionPoint();
+ ~MctlConnectionPoint();
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/ngiarchive.cpp b/engines/fullpipe/ngiarchive.cpp
index 5d895c17a0..132f4758d3 100644
--- a/engines/fullpipe/ngiarchive.cpp
+++ b/engines/fullpipe/ngiarchive.cpp
@@ -91,7 +91,7 @@ NGIArchive::NGIArchive(const Common::String &filename) : _ngiFilename(filename)
free(fat);
- g_fullpipe->_currArchive = this;
+ g_fp->_currArchive = this;
debug(0, "NGIArchive::NGIArchive(%s): Located %d files", filename.c_str(), _headers.size());
}
@@ -103,7 +103,7 @@ NGIArchive::~NGIArchive() {
delete it->_value;
}
- g_fullpipe->_currArchive = 0;
+ g_fp->_currArchive = 0;
}
bool NGIArchive::hasFile(const Common::String &name) const {
diff --git a/engines/fullpipe/objectnames.h b/engines/fullpipe/objectnames.h
index 241e31b165..eafdb2a8e7 100644
--- a/engines/fullpipe/objectnames.h
+++ b/engines/fullpipe/objectnames.h
@@ -30,15 +30,16 @@ namespace Fullpipe {
#define sO_Grandma "\xc1\xe0\xe1\xf3\xeb\xff" // "Бабуля"
#define sO_Jar_4 "\xc1\xe0\xed\xea\xe0_4" // "Банка_4"
#define sO_Pool "\xc1\xe0\xf1\xf1\xe5\xe9\xed" // "Бассейн"
-#define sO_TumyTrampie "\xc1\xe0\xf2\xf3\xf2\xe0" // "Батута"
+#define sO_TummyTrampie "\xc1\xe0\xf2\xf3\xf2\xe0" // "Батута"
#define sO_WithoutBoot "\xc1\xe5\xe7 \xe1\xee\xf2\xe8\xed\xea\xe0" // "Без ботинка"
-#define sO_WithoutJug "\xc1\xe5\xe7 \xe3\xee\xf0\xf8\xea\xee\xe2" // "Без горшков"
+#define sO_WithoutJugs "\xc1\xe5\xe7 \xe3\xee\xf0\xf8\xea\xee\xe2" // "Без горшков"
#define sO_WithoutCarpet "\xc1\xe5\xe7 \xea\xee\xe2\xf0\xe8\xea\xe0" // "Без коврика"
#define sO_WithoutCoin "\xc1\xe5\xe7 \xec\xee\xed\xe5\xf2\xfb" // "Без монеты"
#define sO_WithNothing "\xc1\xe5\xe7 \xed\xe8\xf7\xe5\xe3\xee" // "Без ничего"
#define sO_WithoutHandle "\xc1\xe5\xe7 \xf0\xf3\xf7\xea\xe8" // "Без ручки"
#define sO_WithoutStool "\xc1\xe5\xe7 \xf2\xe0\xe1\xf3\xf0\xe5\xf2\xea\xe8" // "Без табуретки"
#define sO_WithoutDrawer "\xc1\xe5\xe7 \xff\xf9\xe8\xea\xe0" // "Без ящика"
+#define sO_Nearby "\xc1\xeb\xe8\xe7\xea\xee" // "Близко"
#define sO_Blocked "\xc1\xeb\xee\xea\xe8\xf0\xee\xe2\xe0\xed" // "Блокирован"
#define sO_BlockedShe "\xc1\xeb\xee\xea\xe8\xf0\xee\xe2\xe0\xed\xe0" // "Блокирована"
#define sO_Awaken "\xc1\xee\xe4\xf0\xf1\xf2\xe2\xf3\xe5\xf2" // "Бодрствует"
@@ -48,8 +49,14 @@ namespace Fullpipe {
#define sO_InSock "\xc2 \xed\xee\xf1\xea\xe5" // "В носке"
#define sO_InGlasses "\xc2 \xee\xf7\xea\xe0\xf5" // "В очках"
#define sO_In_14 "\xc2_14" // "В_14"
+#define sO_In_15 "\xc2_15" // "В_15"
+#define sO_In_15_1 "\xc2_15_1" // "В_15_1"
+#define sO_In_15_2 "\xc2_15_2" // "В_15_2"
+#define sO_In_15_3 "\xc2_15_3" // "В_15_3"
+#define sO_In_16 "\xc2_16" // "В_16"
+#define sO_In_32 "\xc2_32" // "В_32"
#define sO_In_32_Lies "\xc2_32 \xeb\xe5\xe6\xe8\xf2" // "В_32 лежит"
-#define sO_In_32_Stands "\xc2_32 \xf2\xee\xf0\xf7\xe8\xf2" // "В_32 торчит"
+#define sO_In_32_Sticks "\xc2_32 \xf2\xee\xf0\xf7\xe8\xf2" // "В_32 торчит"
#define sO_In_33 "\xc2_33" // "В_33"
#define sO_In_7 "\xc2_7" // "В_7"
#define sO_Together "\xc2\xe4\xe2\xee\xe5\xec" // "Вдвоем"
@@ -73,16 +80,17 @@ namespace Fullpipe {
#define sO_Jug "\xc3\xee\xf0\xf8\xee\xea" // "Горшок"
#define sO_Strolling "\xc3\xf3\xeb\xff\xe5\xf2" // "Гуляет"
#define sO_Yes "\xc4\xe0" // "Да"
+#define sO_FarAway "\xc4\xe0\xeb\xe5\xea\xee" // "Далеко"
#define sO_Girl "\xc4\xe5\xe2\xee\xf7\xea\xe0" // "Девочка"
#define sO_Elephantine "\xc4\xe5\xe2\xee\xf7\xea\xe0-\xf1\xeb\xee\xed\xe8\xea" // "Девочка-слоник"
#define sO_Grandpa "\xc4\xe5\xe4\xf3\xf8\xea\xe0" // "Дедушка"
-#define sO_Plank_25 "\xc4\xee\xf1\xea\xe0_25" // "Доска_25"
+#define sO_Board_25 "\xc4\xee\xf1\xea\xe0_25" // "Доска_25"
#define sO_Plank_34 "\xc4\xee\xf1\xea\xe0_34" // "Доска_34"
-#define sO_DudeJumped "\xc4\xff\xe4\xff \xef\xf0\xfb\xe3\xe0\xeb" // "Дядя прыгал"
+#define sO_DudeHasJumped "\xc4\xff\xe4\xff \xef\xf0\xfb\xe3\xe0\xeb" // "Дядя прыгал"
#define sO_Dude "\xc4\xff\xe4\xff" // "Дядя"
#define sO_GuvTheDrawer "\xc4\xff\xe4\xff-\xff\xf9\xe8\xea" // "Дядя-ящик"
#define sO_DudeSwinged "\xc4\xff\xe4\xff_\xea\xe0\xf2\xe0\xeb\xf1\xff" // "Дядя_катался"
-#define sO_Eats "\xc5\xf1\xf2" // "Ест"
+#define sO_IsEating "\xc5\xf1\xf2" // "Ест"
#define sO_Present "\xc5\xf1\xf2\xfc" // "Есть"
#define sO_CloseThing1 "\xc7\xe0\xea\xf0\xfb\xe2\xe0\xe5\xec\xee\xe5 1" // "Закрываемое 1"
#define sO_CloseThing2 "\xc7\xe0\xea\xf0\xfb\xe2\xe0\xe5\xec\xee\xe5 2" // "Закрываемое 2"
@@ -94,11 +102,11 @@ namespace Fullpipe {
#define sO_HalfFull "\xc7\xe0\xef\xee\xeb\xed\xe5\xed \xed\xe0\xef\xee\xeb\xee\xe2\xe8\xed\xf3" // "Заполнен наполовину"
#define sO_Full "\xc7\xe0\xef\xee\xeb\xed\xe5\xed \xf6\xe5\xeb\xe8\xea\xee\xec" // "Заполнен целиком"
#define sO_MirroredTo "\xc7\xe5\xf0\xea\xe0\xeb\xfc\xed\xe0\xff \xea" // "Зеркальная к"
-#define sO_Playing "\xc8\xe3\xf0\xe0\xe5\xf2" // "Играет"
+#define sO_IsPlaying "\xc8\xe3\xf0\xe0\xe5\xf2" // "Играет"
#define sO_Tub "\xca\xe0\xe4\xea\xe0" // "Кадка"
#define sO_Cactus "\xca\xe0\xea\xf2\xf3\xf1" // "Кактус"
-#define sO_SwingingWithBoot "\xca\xe0\xf2\xe0\xe5\xf2\xf1\xff \xf1 \xe1\xee\xf2\xe8\xed\xea\xee\xec" // "Катается с ботинком"
-#define sO_Swinging "\xca\xe0\xf2\xe0\xe5\xf2\xf1\xff" // "Катается"
+#define sO_IsSwingingWithBoot "\xca\xe0\xf2\xe0\xe5\xf2\xf1\xff \xf1 \xe1\xee\xf2\xe8\xed\xea\xee\xec" // "Катается с ботинком"
+#define sO_IsSwinging "\xca\xe0\xf2\xe0\xe5\xf2\xf1\xff" // "Катается"
#define sO_Swingie "\xca\xe0\xf7\xe5\xeb\xe5\xed\xff" // "Качеленя"
#define sO_LiftButtons "\xca\xed\xee\xef\xea\xe8 \xeb\xe8\xf4\xf2\xe0" // "Кнопки лифта"
#define sO_Carpet_35 "\xca\xee\xe2\xf0\xe8\xea_35" // "Коврик_35"
@@ -110,7 +118,7 @@ namespace Fullpipe {
#define sO_LeftPipe_29 "\xcb\xe5\xe2\xe0\xff \xf2\xf0\xf3\xe1\xe0_29" // "Левая труба_29"
#define sO_LeftPipe_30 "\xcb\xe5\xe2\xe0\xff \xf2\xf0\xf3\xe1\xe0_30" // "Левая труба_30"
#define sO_LeftPipe_37 "\xcb\xe5\xe2\xe0\xff \xf2\xf0\xf3\xe1\xe0_37" // "Левая труба_37"
-#define sO_StarsDown_24 "\xcb\xe5\xf1\xf2\xed\xe8\xf6\xe0 \xe2\xed\xe8\xe7_24" // "Лестница вниз_24"
+#define sO_StairsDown_24 "\xcb\xe5\xf1\xf2\xed\xe8\xf6\xe0 \xe2\xed\xe8\xe7_24" // "Лестница вниз_24"
#define sO_StairsUp_8 "\xcb\xe5\xf1\xf2\xed\xe8\xf6\xe0 \xf1\xe2\xe5\xf0\xf5\xf3_8" // "Лестница сверху_8"
#define sO_Stairway "\xcb\xe5\xf1\xf2\xed\xe8\xf6\xe0" // "Лестница"
#define sO_Fliers "\xcb\xe5\xf2\xf3\xed\xfb" // "Летуны"
@@ -135,7 +143,7 @@ namespace Fullpipe {
#define sO_NotGrown "\xcd\xe5 \xe2\xfb\xf0\xee\xf1" // "Не вырос"
#define sO_DidNotCrackEgg "\xcd\xe5 \xea\xee\xeb\xee\xeb \xff\xe9\xf6\xee" // "Не колол яйцо"
#define sO_NotFallen "\xcd\xe5 \xef\xe0\xe4\xe0\xeb" // "Не падал"
-#define sO_NotAvailable "\xcd\xe5\xe4\xee\xf1\xf2\xf3\xef\xed\xe0" // "Недоступна"
+#define sO_IsNotAvailable "\xcd\xe5\xe4\xee\xf1\xf2\xf3\xef\xed\xe0" // "Недоступна"
#define sO_CannotTake "\xcd\xe5\xeb\xfc\xe7\xff \xe2\xe7\xff\xf2\xfc" // "Нельзя взять"
#define sO_No "\xcd\xe5\xf2" // "Нет"
#define sO_LowerHatch_23 "\xcd\xe8\xe6\xed\xe8\xe9 \xeb\xfe\xea_23" // "Нижний люк_23"
@@ -148,7 +156,7 @@ namespace Fullpipe {
#define sO_ClockAxis "\xce\xf1\xfc \xf7\xe0\xf1\xee\xe2" // "Ось часов"
#define sO_Opened "\xce\xf2\xea\xf0\xfb\xf2" // "Открыт"
#define sO_OpenedWithBoot "\xce\xf2\xea\xf0\xfb\xf2\xe0 \xf1 \xe1\xee\xf2\xe8\xed\xea\xee\xec" // "Открыта с ботинком"
-#define sO_OpenedShe "\xce\xf2\xea\xf0\xfb\xf2\xe0" // "Открыта"
+#define sO_IsOpened "\xce\xf2\xea\xf0\xfb\xf2\xe0" // "Открыта"
#define sO_WeirdWacko "\xce\xf2\xec\xee\xf0\xee\xe6\xe5\xed\xed\xfb\xe9" // "Отмороженный"
#define sO_NotPresent "\xce\xf2\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Отсутствует"
#define sO_Error "\xce\xf8\xe8\xe1\xea\xe0" // "Ошибка"
@@ -161,17 +169,17 @@ namespace Fullpipe {
#define sO_FullPipe "\xcf\xee\xeb\xed\xe0\xff \xd2\xf0\xf3\xe1\xe0" // "Полная Труба"
#define sO_RightStairs_9 "\xcf\xf0\xe0\xe2\xe0\xff \xeb\xe5\xf1\xf2\xed\xe8\xf6\xe0_9" // "Правая лестница_9"
#define sO_RightPipe_17 "\xcf\xf0\xe0\xe2\xe0\xff \xf2\xf0\xf3\xe1\xe0_17" // "Правая труба_17"
-#define sO_Available "\xcf\xf0\xe8\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Присутствует"
+#define sO_IsPresent "\xcf\xf0\xe8\xf1\xf3\xf2\xf1\xf2\xe2\xf3\xe5\xf2" // "Присутствует"
#define sO_GulpedEgg "\xcf\xf0\xee\xe3\xeb\xee\xf7\xe5\xed\xed\xee\xe5 \xff\xe9\xf6\xee" // "Проглоченное яйцо"
#define sO_GulpedEggs "\xcf\xf0\xee\xe3\xeb\xee\xf7\xe5\xed\xed\xfb\xe5 \xff\xe9\xf6\xe0" // "Проглоченные яйца"
#define sO_BellyInflater "\xcf\xf3\xe7\xee\xe4\xf3\xe2" // "Пузодув"
#define sO_Empty "\xcf\xf3\xf1\xf2" // "Пуст"
#define sO_EmptyShe "\xcf\xf3\xf1\xf2\xe0\xff" // "Пустая"
#define sO_WayToPipe "\xcf\xf3\xf2\xfc \xea \xf2\xf0\xf3\xe1\xe5" // "Путь к трубе"
-#define sO_Drinking "\xcf\xfc\xe5\xf2" // "Пьет"
-#define sO_BrokenInPieces "\xd0\xe0\xe7\xe1\xe8\xf2\xe0" // "Разбита"
+#define sO_IsDrinking "\xcf\xfc\xe5\xf2" // "Пьет"
+#define sO_Broken "\xd0\xe0\xe7\xe1\xe8\xf2\xe0" // "Разбита"
#define sO_Unblocked "\xd0\xe0\xe7\xe1\xeb\xee\xea\xe8\xf0\xee\xe2\xe0\xed" // "Разблокирован"
-#define sO_Unfolded "\xd0\xe0\xe7\xe2\xe5\xf0\xed\xf3\xf2" // "Развернут"
+#define sO_Unconvoluted "\xd0\xe0\xe7\xe2\xe5\xf0\xed\xf3\xf2" // "Развернут"
#define sO_Jawcrucnher "\xd0\xee\xf2\xee\xf5\xf0\xf3\xf1" // "Ротохрус"
#define sO_UsherHand "\xd0\xf3\xea\xe0 \xc1\xe8\xeb\xe5\xf2\xe5\xf0\xf8\xe8" // "Рука Билетерши"
#define sO_LeverHandle_23 "\xd0\xf3\xea\xee\xff\xf2\xea\xe0 \xf0\xfb\xf7\xe0\xe3\xe0_23" // "Рукоятка рычага_23"
@@ -185,7 +193,7 @@ namespace Fullpipe {
#define sO_WithJug "\xd1 \xe3\xee\xf0\xf8\xea\xee\xec" // "С горшком"
#define sO_WithGum "\xd1 \xe6\xe2\xe0\xf7\xea\xee\xe9" // "С жвачкой"
#define sO_WithShovel "\xd1 \xeb\xee\xef\xe0\xf2\xee\xe9" // "С лопатой"
-#define sO_WithTiny "\xd1 \xec\xe0\xeb\xfb\xec" // "С малым"
+#define sO_WithSmall "\xd1 \xec\xe0\xeb\xfb\xec" // "С малым"
#define sO_WithHammer "\xd1 \xec\xee\xeb\xee\xf2\xea\xee\xec" // "С молотком"
#define sO_WithCoin "\xd1 \xec\xee\xed\xe5\xf2\xee\xe9" // "С монетой"
#define sO_WithSock "\xd1 \xed\xee\xf1\xea\xee\xec" // "С носком"
@@ -197,19 +205,19 @@ namespace Fullpipe {
#define sO_Sugar "\xd1\xe0\xf5\xe0\xf0\xee\xea" // "Сахарок"
#define sO_Convoluted "\xd1\xe2\xe5\xf0\xed\xf3\xf2" // "Свернут"
#define sO_IsFree "\xd1\xe2\xee\xe1\xee\xe4\xed\xe0" // "Свободна"
-#define sO_Sitting "\xd1\xe8\xe4\xe8\xf2" // "Сидит"
-#define sO_Laughing "\xd1\xec\xe5\xe5\xf2\xf1\xff" // "Смеется"
-#define sO_WithEveryone "\xd1\xee \xe2\xf1\xe5\xec\xe8" // "Со всеми"
+#define sO_IsSitting "\xd1\xe8\xe4\xe8\xf2" // "Сидит"
+#define sO_IsLaughing "\xd1\xec\xe5\xe5\xf2\xf1\xff" // "Смеется"
+#define sO_WithAll "\xd1\xee \xe2\xf1\xe5\xec\xe8" // "Со всеми"
#define sO_WithMop "\xd1\xee \xf8\xe2\xe0\xe1\xf0\xee\xe9" // "Со шваброй"
#define sO_WithHose "\xd1\xee \xf8\xeb\xe0\xed\xe3\xee\xec" // "Со шлангом"
#define sO_WithBrush "\xd1\xee \xf9\xe5\xf2\xea\xee\xe9" // "Со щеткой"
-#define sO_Sleeping "\xd1\xef\xe8\xf2" // "Спит"
+#define sO_IsSleeping "\xd1\xef\xe8\xf2" // "Спит"
#define sO_OnRight "\xd1\xef\xf0\xe0\xe2\xe0" // "Справа"
-#define sO_StandsInBoots "\xd1\xf2\xee\xe8\xf2 \xe2 \xe1\xee\xf2\xe8\xed\xea\xe0\xf5" // "Стоит в ботинках"
-#define sO_StandsInCorner "\xd1\xf2\xee\xe8\xf2 \xe2 \xf3\xe3\xeb\xf3" // "Стоит в углу"
+#define sO_IsStandingInBoots "\xd1\xf2\xee\xe8\xf2 \xe2 \xe1\xee\xf2\xe8\xed\xea\xe0\xf5" // "Стоит в ботинках"
+#define sO_IsStandingInCorner "\xd1\xf2\xee\xe8\xf2 \xe2 \xf3\xe3\xeb\xf3" // "Стоит в углу"
#define sO_Guardian "\xd1\xf2\xee\xf0\xee\xe6" // "Сторож"
#define sO_Guard_1 "\xd1\xf2\xf0\xe0\xe6 1" // "Страж 1"
-#define sO_Gurad_2 "\xd1\xf2\xf0\xe0\xe6 2" // "Страж 2"
+#define sO_Guard_2 "\xd1\xf2\xf0\xe0\xe6 2" // "Страж 2"
#define sO_Guard_3 "\xd1\xf2\xf0\xe0\xe6 3" // "Страж 3"
#define sO_Stool_34 "\xd2\xe0\xe1\xf3\xf0\xe5\xf2_34" // "Табурет_34"
#define sO_Pipe_9 "\xd2\xf0\xf3\xe1\xe0_9" // "Труба_9"
@@ -217,16 +225,17 @@ namespace Fullpipe {
#define sO_Pedestal_17 "\xd2\xf3\xec\xe1\xe0_17" // "Тумба_17"
#define sO_Pedestal_33 "\xd2\xf3\xec\xe1\xe0_33" // "Тумба_33"
#define sO_NearDudesStairs "\xd3 \xc4\xff\xe4\xe8 \xed\xe0 \xeb\xe5\xf1\xf2\xed\xe8\xf6\xe5" // "У Дяди на лестнице"
-#define sO_NearDude "\xd3 \xc4\xff\xe4\xe8" // "У Дяди"
+#define sO_DudeHas "\xd3 \xc4\xff\xe4\xe8" // "У Дяди"
#define sO_NearPipeWithStool "\xd3 \xf2\xf0\xf3\xe1\xfb \xf1 \xf2\xe0\xe1\xf3\xf0\xe5\xf2\xea\xee\xe9" // "У трубы с табуреткой"
#define sO_NearPipe "\xd3 \xf2\xf0\xf3\xe1\xfb" // "У трубы"
#define sO_Janitors "\xd3\xe1\xee\xf0\xf9\xe8\xea\xe8" // "Уборщики"
#define sO_Janitress "\xd3\xe1\xee\xf0\xf9\xe8\xf6\xe0" // "Уборщица"
-#define sO_Gone "\xd3\xe5\xf5\xe0\xeb\xe0" // "Уехала"
+#define sO_IsGone "\xd3\xe5\xf5\xe0\xeb\xe0" // "Уехала"
+#define sO_FallenTwice "\xd3\xef\xe0\xeb \xe4\xe2\xe0" // "Упал два"
#define sO_FallenOnce "\xd3\xef\xe0\xeb \xf0\xe0\xe7" // "Упал раз"
-#define sO_FallenBrush "\xd3\xef\xe0\xeb\xe0 \xf9\xe5\xf2\xea\xe0" // "Упала щетка"
+#define sO_BrushHasFallen "\xd3\xef\xe0\xeb\xe0 \xf9\xe5\xf2\xea\xe0" // "Упала щетка"
#define sO_NotBroken "\xd6\xe5\xeb\xe0" // "Цела"
-#define sO_ScratchingBelly "\xd7\xe5\xf8\xe5\xf2 \xef\xf3\xe7\xee" // "Чешет пузо"
+#define sO_IsScratchingBelly "\xd7\xe5\xf8\xe5\xf2 \xef\xf3\xe7\xee" // "Чешет пузо"
#define sO_Level0 "\xdd\xf2\xe0\xe6 0" // "Этаж 0"
#define sO_Level1 "\xdd\xf2\xe0\xe6 1" // "Этаж 1"
#define sO_Level2 "\xdd\xf2\xe0\xe6 2" // "Этаж 2"
diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h
index a12851e63b..d13559429a 100644
--- a/engines/fullpipe/objects.h
+++ b/engines/fullpipe/objects.h
@@ -82,6 +82,8 @@ class GameVar : public CObject {
public:
GameVar();
+ virtual ~GameVar();
+
virtual bool load(MfcArchive &file);
GameVar *getSubVarByName(const char *name);
bool setSubVarAsInt(const char *name, int value);
diff --git a/engines/fullpipe/scene.cpp b/engines/fullpipe/scene.cpp
index 3831831866..997d92ae1c 100644
--- a/engines/fullpipe/scene.cpp
+++ b/engines/fullpipe/scene.cpp
@@ -92,6 +92,9 @@ bool SceneTag::load(MfcArchive &file) {
SceneTag::~SceneTag() {
free(_tag);
+
+ delete _scene;
+ delete _field_4;
}
void SceneTag::loadScene() {
@@ -114,7 +117,7 @@ void SceneTag::loadScene() {
delete file;
- g_fullpipe->_currArchive = 0;
+ g_fp->_currArchive = 0;
free(fname);
free(archname);
@@ -129,6 +132,10 @@ Scene::Scene() {
_sceneName = 0;
}
+Scene::~Scene() {
+ warning("STUB: Scene::~Scene()");
+}
+
bool Scene::load(MfcArchive &file) {
debug(5, "Scene::load()");
@@ -146,7 +153,7 @@ bool Scene::load(MfcArchive &file) {
int aniNum = file.readUint16LE();
char *aniname = genFileName(0, aniNum, "ani");
- Common::SeekableReadStream *f = g_fullpipe->_currArchive->createReadStreamForMember(aniname);
+ Common::SeekableReadStream *f = g_fp->_currArchive->createReadStreamForMember(aniname);
StaticANIObject *ani = new StaticANIObject();
@@ -168,7 +175,7 @@ bool Scene::load(MfcArchive &file) {
int qNum = file.readUint16LE();
char *qname = genFileName(0, qNum, "qu");
- Common::SeekableReadStream *f = g_fullpipe->_currArchive->createReadStreamForMember(qname);
+ Common::SeekableReadStream *f = g_fp->_currArchive->createReadStreamForMember(qname);
MfcArchive archive(f);
archive.readUint16LE(); // Skip 2 bytes
@@ -191,7 +198,7 @@ bool Scene::load(MfcArchive &file) {
assert(0);
}
- _libHandle = g_fullpipe->_currArchive;
+ _libHandle = g_fp->_currArchive;
if (_picObjList.size() > 0 && _bgname && strlen(_bgname) > 1) {
char fname[260];
@@ -216,10 +223,10 @@ bool Scene::load(MfcArchive &file) {
char *slsname = genFileName(0, _sceneId, "sls");
- if (g_fullpipe->_soundEnabled) {
+ if (g_fp->_soundEnabled) {
_soundList = new SoundList();
- if (g_fullpipe->_flgSoundList) {
+ if (g_fp->_flgSoundList) {
char *nlname = genFileName(17, _sceneId, "nl");
_soundList->loadFile(slsname, nlname);
@@ -249,7 +256,7 @@ void Scene::init() {
_x = 0;
_y = 0;
- g_fullpipe->_sceneRect.moveTo(0, 0);
+ g_fp->_sceneRect.moveTo(0, 0);
for (uint i = 0; i < _picObjList.size(); i++)
((PictureObject *)_picObjList[i])->clearFlags();
@@ -398,7 +405,7 @@ void Scene::preloadMovements(GameVar *var) {
}
void Scene::initObjectCursors(const char *varname) {
- GameVar *cursorsVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("CURSORS");
+ GameVar *cursorsVar = g_fp->getGameLoaderGameVar()->getSubVarByName(varname)->getSubVarByName("CURSORS");
if (!cursorsVar || !cursorsVar->_subVars)
return;
@@ -417,10 +424,10 @@ void Scene::initObjectCursors(const char *varname) {
}
}
- g_fullpipe->_minCursorId = minId;
- g_fullpipe->_maxCursorId = maxId;
+ g_fp->_minCursorId = minId;
+ g_fp->_maxCursorId = maxId;
- g_fullpipe->_objectIdCursors.resize(maxId - minId + 1);
+ g_fp->_objectIdCursors.resize(maxId - minId + 1);
for (GameVar *sub = cursorsVar->_subVars; sub; sub = sub->_nextVarObj) {
GameObject *obj = getPictureObjectByName(sub->_varName, -1);
@@ -431,7 +438,7 @@ void Scene::initObjectCursors(const char *varname) {
PictureObject *pic = getGameLoaderInventory()->getScene()->getPictureObjectByName(sub->_value.stringValue, -1);
if (obj && pic)
- g_fullpipe->_objectIdCursors[obj->_id - minId] = pic->_id;
+ g_fp->_objectIdCursors[obj->_id - minId] = pic->_id;
}
}
@@ -442,14 +449,25 @@ bool Scene::compareObjPriority(const void *p1, const void *p2) {
return false;
}
-void Scene::objectList_sortByPriority(PtrList &list) {
- Common::sort(list.begin(), list.end(), Scene::compareObjPriority);
+void Scene::objectList_sortByPriority(PtrList &list, bool skipFirst) {
+ if (skipFirst) {
+ PtrList::iterator s = list.begin();
+
+ ++s;
+
+ Common::sort(s, list.end(), Scene::compareObjPriority);
+ } else {
+ Common::sort(list.begin(), list.end(), Scene::compareObjPriority);
+ }
}
void Scene::draw() {
- debug(0, ">>>>> Scene::draw()");
+ debug(6, ">>>>> Scene::draw()");
updateScrolling();
+ // Clean previous stuff
+ g_fp->_backgroundSurface.fillRect(Common::Rect(0, 0, 800, 600), 0);
+
drawContent(60000, 0, true);
objectList_sortByPriority(_staticANIObjectList2);
@@ -470,11 +488,74 @@ void Scene::draw() {
}
void Scene::updateScrolling() {
- debug(0, "STUB Scene::updateScrolling()");
+ if (_messageQueueId && !_x && !_y) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
+
+ if (mq)
+ mq->update();
+
+ _messageQueueId = 0;
+ }
+
+ if (_x || _y) {
+ int offsetX = 0;
+ int offsetY = 0;
+
+ if (_x < 0) {
+ if (!g_fp->_sceneRect.left && !(((PictureObject *)_picObjList[0])->_flags & 2))
+ _x = 0;
+
+ if (_x <= -g_fp->_scrollSpeed) {
+ offsetX = -g_fp->_scrollSpeed;
+ _x += g_fp->_scrollSpeed;
+ }
+ } else if (_x >= g_fp->_scrollSpeed) {
+ offsetX = g_fp->_scrollSpeed;
+ _x -= g_fp->_scrollSpeed;
+ } else {
+ _x = 0;
+ }
+
+ if (_y > 0) {
+ offsetY = g_fp->_scrollSpeed;
+ _y -= g_fp->_scrollSpeed;
+ }
+
+ if (_y < 0) {
+ offsetY -= g_fp->_scrollSpeed;
+ _y += g_fp->_scrollSpeed;
+ }
+
+ g_fp->_sceneRect.translate(offsetX, offsetY);
+ }
+
+ updateScrolling2();
}
void Scene::updateScrolling2() {
- warning("STUB Scene::updateScrolling2()");
+ if (_picObjList.size()) {
+ Common::Point point;
+ int offsetY = 0;
+ int offsetX = 0;
+
+ ((PictureObject *)_picObjList[0])->getDimensions(&point);
+
+ int flags = ((PictureObject *)_picObjList[0])->_flags;
+
+ if (g_fp->_sceneRect.left < 0 && !(flags & 2))
+ offsetX = -g_fp->_sceneRect.left;
+
+ if (g_fp->_sceneRect.top < 0 && !(flags & 0x20))
+ offsetY = -g_fp->_sceneRect.top;
+
+ if (g_fp->_sceneRect.right > point.x - 1 && g_fp->_sceneRect.left > 0 && !(flags & 2))
+ offsetX = point.x - g_fp->_sceneRect.right - 1;
+
+ if (g_fp->_sceneRect.bottom > point.y - 1 && g_fp->_sceneRect.top > 0 && !(flags & 0x20))
+ offsetY = point.y - g_fp->_sceneRect.bottom - 1;
+
+ g_fp->_sceneRect.translate(offsetX, offsetY);
+ }
}
StaticANIObject *Scene::getStaticANIObjectAtPos(int x, int y) {
@@ -525,7 +606,7 @@ int Scene::getPictureObjectIdAtPos(int x, int y) {
}
void Scene::update(int counterdiff) {
- debug(0, "Scene::update(%d)", counterdiff);
+ debug(6, "Scene::update(%d)", counterdiff);
for (PtrList::iterator s = _staticANIObjectList2.begin(); s != _staticANIObjectList2.end(); ++s)
((StaticANIObject *)*s)->update(counterdiff);
@@ -536,13 +617,13 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
return;
if (_palette) {
- g_fullpipe->_globalPalette = _palette->_data;
+ g_fp->_globalPalette = _palette->_data;
}
debug(8, "Scene::drawContent(>%d, <%d, %d)", minPri, maxPri, drawBg);
if (_picObjList.size() > 2) { // We need to z-sort them
- objectList_sortByPriority(_picObjList);
+ objectList_sortByPriority(_picObjList, true);
}
if (minPri == -1 && _picObjList.size())
@@ -569,7 +650,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
debug(8, "w2: %d h2:%d", point.x, point.y);
- int bgStX = g_fullpipe->_sceneRect.left % point.x;
+ int bgStX = g_fp->_sceneRect.left % point.x;
if (bgStX < 0)
bgStX += point.x;
@@ -577,7 +658,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
int bgNumX = bgStX / width;
int bgOffsetX = bgStX % width;
- int bgStY = g_fullpipe->_sceneRect.top % point.y;
+ int bgStY = g_fp->_sceneRect.top % point.y;
if (bgStY < 0)
bgStY += point.y;
@@ -585,12 +666,12 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
int bgNumY = bgStY / height;
int bgOffsetY = bgStY % height;
- int bgPosX = g_fullpipe->_sceneRect.left - bgOffsetX;
+ int bgPosX = g_fp->_sceneRect.left - bgOffsetX;
- if (bgPosX < g_fullpipe->_sceneRect.right - 1) {
+ if (bgPosX < g_fp->_sceneRect.right - 1) {
while (1) {
int v25 = bgNumY;
- for (int y = g_fullpipe->_sceneRect.top - bgOffsetY; y < g_fullpipe->_sceneRect.bottom - 1;) {
+ for (int y = g_fp->_sceneRect.top - bgOffsetY; y < g_fp->_sceneRect.bottom - 1;) {
BigPicture *v27 = _bigPictureArray[bgNumX][v25];
v27->draw(bgPosX, y, 0, 0);
y += v27->getDimensions(&point)->y;
@@ -603,7 +684,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
}
}
_bigPictureArray[bgNumX][0]->getDimensions(&point);
- int v32 = point.x + bgPosX;
+ int oldx = point.x + bgPosX;
bgPosX += point.x;
bgNumX++;
@@ -612,7 +693,7 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
break;
bgNumX = 0;
}
- if (v32 >= g_fullpipe->_sceneRect.right - 1)
+ if (oldx >= g_fp->_sceneRect.right - 1)
break;
}
}
@@ -637,22 +718,22 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
int height = point.y;
if (obj->_flags & 8) {
- while (objX > g_fullpipe->_sceneRect.right) {
+ while (objX > g_fp->_sceneRect.right) {
objX -= width;
obj->setOXY(objX, objY);
}
- for (int j = width + objX; width + objX < g_fullpipe->_sceneRect.left; j = width + objX) {
+ for (int j = width + objX; width + objX < g_fp->_sceneRect.left; j = width + objX) {
objX = j;
obj->setOXY(j, objY);
}
}
if (obj->_flags & 0x10) {
- while (objY > g_fullpipe->_sceneRect.bottom) {
+ while (objY > g_fp->_sceneRect.bottom) {
objY -= height;
obj->setOXY(objX, objY);
}
- for (int j = objY + height; objY + height < g_fullpipe->_sceneRect.top; j = objY + height) {
+ for (int j = objY + height; objY + height < g_fp->_sceneRect.top; j = objY + height) {
objY = j;
obj->setOXY(objX, j);
}
@@ -661,12 +742,12 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
obj->draw();
if (obj->_flags & 2) {
- if (objX > g_fullpipe->_sceneRect.left) {
+ if (objX > g_fp->_sceneRect.left) {
obj->setOXY(objX - width, objY);
obj->draw();
obj->setOXY(objX, objY);
}
- if (width + objX < g_fullpipe->_sceneRect.right) {
+ if (width + objX < g_fp->_sceneRect.right) {
obj->setOXY(width + objX, objY);
obj->draw();
obj->setOXY(objX, objY);
@@ -674,12 +755,12 @@ void Scene::drawContent(int minPri, int maxPri, bool drawBg) {
}
if (obj->_flags & 0x20) {
- if (objY > g_fullpipe->_sceneRect.top) {
+ if (objY > g_fp->_sceneRect.top) {
obj->setOXY(objX, objY - height);
obj->draw();
obj->setOXY(objX, objY);
}
- if (height + objY < g_fullpipe->_sceneRect.bottom) {
+ if (height + objY < g_fp->_sceneRect.bottom) {
obj->setOXY(objX, height + objY);
obj->draw();
obj->setOXY(objX, objY);
diff --git a/engines/fullpipe/scene.h b/engines/fullpipe/scene.h
index db0da5db31..fc04a877f5 100644
--- a/engines/fullpipe/scene.h
+++ b/engines/fullpipe/scene.h
@@ -44,6 +44,7 @@ class Scene : public Background {
public:
Scene();
+ virtual ~Scene();
virtual bool load(MfcArchive &file);
@@ -79,12 +80,12 @@ class Scene : public Background {
private:
static bool compareObjPriority(const void *p1, const void *p2);
- void objectList_sortByPriority(PtrList &list);
+ void objectList_sortByPriority(PtrList &list, bool skipFirst = false);
};
class SceneTag : public CObject {
public:
- int _field_4;
+ CObject *_field_4;
char *_tag;
Scene *_scene;
int16 _sceneId;
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index 6771fe8ec8..1e4a5633ea 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -72,30 +72,319 @@ Vars::Vars() {
scene04_coinPut = false;
scene04_soundPlaying = false;
scene04_dynamicPhaseIndex = 0;
+ scene04_dudeOnLadder = false;
scene04_sceneClickX = 0;
scene04_sceneClickY = 0;
- scene04_var01 = 0;
- scene04_var02 = 0;
- scene04_var04 = 0;
- scene04_var05 = 0;
- scene04_var06 = 0;
- scene04_var07 = 0;
- scene04_var08 = 0;
- scene04_var09 = 0;
- scene04_var10 = 0;
- scene04_var11 = 0;
- scene04_var12 = 0;
- scene04_var13 = 0;
- scene04_var14 = 0;
- scene04_var15 = 0;
- scene04_var16 = 0;
- scene04_var17 = 0;
- scene04_var18 = 0;
- scene04_var19 = 0;
- scene04_var20 = 0;
- scene04_var24 = 0;
+ scene04_dudePosX = 0;
+ scene04_dudePosY = 0;
+
+ scene04_bottleIsTaken = false;
+ scene04_kozyawkaOnLadder = false;
+ scene04_walkingKozyawka = 0;
+ scene04_bottleWeight = 0;
+ scene04_var07 = false;
+ scene04_ladderClickable = false;
+ scene04_handIsDown = false;
+ scene04_dudeInBottle = false;
+ scene04_kozHeadRaised = false;
+ scene04_bottleIsDropped = false;
+ scene04_bigBallIn = false;
+ scene04_bigBallCounter = 0;
+ scene04_bigBallFromLeft = false;
+ scene04_speakerVariant = 0;
+ scene04_speakerPhase = 0;
+ scene04_clockCanGo = false;
+ scene04_objectIsTaken = false;
+ scene04_springOffset = 0;
+ scene04_lastKozyawka = 0;
+ scene04_springDelay = 0;
+ scene04_bottleY = 0;
+ scene04_ladderOffset = 0;
+
+ scene05_handle = 0;
+ scene05_wacko = 0;
+ scene05_bigHatch = 0;
+ scene05_wackoTicker = 0;
+ scene05_handleFlipper = 0;
+ scene05_floatersTicker = 0;
+
+ scene06_manX = 0;
+ scene06_manY = 0;
+ scene06_ballX = 0;
+ scene06_ballY = 0;
+ scene06_mumsy = 0;
+ scene06_someBall = 0;
+ scene06_invHandle = 0;
+ scene06_liftButton = 0;
+ scene06_ballDrop = 0;
+ scene06_arcadeEnabled = false;
+ scene06_aimingBall = false;
+ scene06_currentBall = 0;
+ scene06_ballInHands = 0;
+ scene06_flyingBall = 0;
+ scene06_numBallsGiven = 0;
+ scene06_mumsyNumBalls = 0;
+ scene06_eggieTimeout = 0;
+ scene06_eggieDirection = true;
+ scene06_mumsyGotBall = 0;
+ scene06_ballDeltaX = 0;
+ scene06_ballDeltaY = 0;
+ scene06_sceneClickX = 0;
+ scene06_sceneClickY = 0;
+ scene06_mumsyPos = 0;
+ scene06_mumsyJumpBk = 0;
+ scene06_mumsyJumpFw = 0;
+ scene06_mumsyJumpBkPercent = 0;
+ scene06_mumsyJumpFwPercent = 0;
+
+ scene07_lukeAnim = 0;
+ scene07_lukePercent = 0;
+ scene07_plusMinus = 0;
+
+ scene08_batuta = 0;
+ scene08_vmyats = 0;
+ scene08_clock = 0;
+ scene08_inAir = false;
+ scene08_flyingUp = false;
+ scene08_onBelly = false;
+ scene08_stairsOffset = -37;
+ scene08_snoringCountdown = -1;
+ scene08_inArcade = false;
+ scene08_stairsVisible = true;
+ scene08_manOffsetY = 0;
+
+ scene10_gum = 0;
+ scene10_packet = 0;
+ scene10_packet2 = 0;
+ scene10_inflater = 0;
+ scene10_ladder = 0;
+ scene10_hasGum = 0;
+
+ scene11_swingie = 0;
+ scene11_boots = 0;
+ scene11_dudeOnSwing = 0;
+ scene11_hint = 0;
+ scene11_arcadeIsOn = false;
+ scene11_scrollIsEnabled = false;
+ scene11_scrollIsMaximized = false;
+ scene11_hintCounter = 0;
+ scene11_swingieScreenEdge = 0;
+ scene11_crySound = 0;
+ scene11_swingAngle = 1.0;
+ scene11_swingOldAngle = 1.0;
+ scene11_swingSpeed = 1.0;
+ scene11_swingAngleDiff = 1.0;
+ scene11_swingInertia = 0.0;
+ scene11_swingCounter = 0;
+ scene11_swingCounterPrevTurn = 0;
+ scene11_swingDirection = 0;
+ scene11_swingDirectionPrevTurn = 0;
+ scene11_swingIsSwinging = false;
+ scene11_swingieStands = false;
+ scene11_dudeX = 0;
+ scene11_dudeY = 0;
+ scene11_swingMaxAngle = 45;
+
+ scene12_fly = 0;
+ scene12_flyCountdown = 0;
+
+ scene13_whirlgig = 0;
+ scene13_guard = 0;
+ scene13_handleR = 0;
+ scene13_handleL = 0;
+ scene13_bridge = 0;
+ scene13_guardDirection = false;
+ scene13_dudeX = 0;
+
+ scene14_grandma = 0;
+ scene14_sceneDeltaX = 0;
+ scene14_sceneDeltaY = 0;
+ scene14_arcadeIsOn = false;
+ scene14_dudeIsKicking = false;
+ scene14_ballIsFlying = false;
+ scene14_dudeCanKick = false;
+ scene14_sceneDiffX = 0;
+ scene14_sceneDiffY = 0;
+ scene14_pink = 0;
+ scene14_flyingBall = 0;
+ scene14_balls.clear();
+ scene14_grandmaIsHere = false;
+ scene14_dudeX = 0;
+ scene14_dudeY = 0;
+ scene14_grandmaX = 0;
+ scene14_grandmaY = 0;
+ scene14_dude2X = 0;
+ scene14_ballDeltaX = 0;
+ scene14_ballDeltaY = 0;
+ scene14_ballX = 0;
+ scene14_ballY = 0;
+ scene14_hitsLeft = 0;
+
+ scene15_chantingCountdown = 0;
+ scene15_plusminus = 0;
+ scene15_ladder = 0;
+ scene15_boot = 0;
+
+ scene16_figures.clear();
+ scene16_walkingBoy = 0;
+ scene16_walkingGirl = 0;
+ scene16_walkingCount = 0;
+ scene16_wire = 0;
+ scene16_mug = 0;
+ scene16_jettie = 0;
+ scene16_boot = 0;
+ scene16_girlIsLaughing = false;
+ scene16_sound = 0;
+ scene16_placeIsOccupied = false;
+
+ scene17_flyState = 0;
+ scene17_sugarIsShown = false;
+ scene17_sceneOldEdgeX = 0;
+ scene17_flyCountdown = 0;
+ scene17_hand = 0;
+ scene17_handPhase = false;
+ scene17_sceneEdgeX = 0;
+
+ scene18_var01 = 0;
+
+ scene20_fliesCountdown = 0;
+ scene20_grandma = 0;
+
+ scene21_giraffeBottom = 0;
+ scene21_giraffeBottomX = 0;
+ scene21_giraffeBottomY = 0;
+ scene21_pipeIsOpen = false;
+ scene21_wigglePos = 0.0;
+ scene21_wiggleTrigger = 0;
+
+ scene22_bag = 0;
+ scene22_giraffeMiddle = 0;
+ scene22_dudeIsOnStool = false;
+ scene22_interactionIsDisabled = false;
+ scene22_craneIsOut = true;
+ scene22_numBagFalls = 1;
+
+ scene23_calend0 = 0;
+ scene23_calend1 = 0;
+ scene23_calend2 = 0;
+ scene23_calend3 = 0;
+ scene23_topReached = false;
+ scene23_isOnStool = false;
+ scene23_someVar = 0;
+ scene23_giraffeTop = 0;
+ scene23_giraffee = 0;
+
+ scene24_jetIsOn = false;
+ scene24_flowIsLow = false;
+ scene24_waterIsOn = false;
+ scene24_water = 0;
+ scene24_jet = 0;
+ scene24_drop = 0;
+
+ scene25_water = 0;
+ scene25_board = 0;
+ scene25_drop = 0;
+ scene25_dudeIsOnBoard = false;
+ scene25_waterIsPresent = false;
+ scene25_boardIsSelectable = false;
+ scene25_beardersAreThere = false;
+ scene25_beardersCounter = 0;
+ scene25_bearders.clear();
+ scene25_sneezeFlipper = false;
+
+ scene26_chhi = 0;
+ scene26_drop = 0;
+ scene26_sockPic = 0;
+ scene26_sock = 0;
+ scene26_activeVent = 0;
+
+ scene28_fliesArePresent = true;
+ scene28_beardedDirection = true;
+ scene28_darkeningObject = 0;
+ scene28_lighteningObject = 0;
+ scene28_headDirection = false;
+ scene28_headBeardedFlipper = false;
+ scene28_lift6inside = false;
+
+ scene30_leg = 0;
+ scene30_liftFlag = 1;
+
+ scene31_chantingCountdown = 0;
+ scene31_cactus = 0;
+ scene31_plusMinus = 0;
+
+ scene32_flagIsWaving = false;
+ scene32_flagNeedsStopping = false;
+ scene32_dudeIsSitting = false;
+ scene32_cactusCounter = -1;
+ scene32_dudeOnLadder = false;
+ scene32_cactusIsGrowing = false;
+ scene32_flag = 0;
+ scene32_cactus = 0;
+ scene32_massOrange = 0;
+ scene32_massBlue = 0;
+ scene32_massGreen = 0;
+ scene32_button = 0;
+
+ scene33_mug = 0;
+ scene33_jettie = 0;
+ scene33_cube = 0;
+ scene33_cubeX = -1;
+ scene33_handleIsDown = false;
+
+ for (int i = 0; i < 9; i++) {
+ scene33_ventsX[i] = 0;
+ scene33_ventsState[i] = 0;
+ }
+
+ scene34_cactus = 0;
+ scene34_vent = 0;
+ scene34_hatch = 0;
+ scene34_boot = 0;
+ scene34_dudeClimbed = false;
+ scene34_dudeOnBoard = false;
+ scene34_dudeOnCactus = false;
+ scene34_fliesCountdown = 0;
+
+ scene35_hose = 0;
+ scene35_bellyInflater = 0;
+ scene35_flowCounter = 0;
+ scene35_fliesCounter = 0;
+
+ scene36_rotohrust = 0;
+ scene36_scissors = 0;
+
+ scene37_rings.clear();
+ scene37_lastDudeX = -1;
+ scene37_cursorIsLocked = 0;
+ scene37_plusMinus1 = 0;
+ scene37_plusMinus2 = 0;
+ scene37_plusMinus3 = 0;
+ scene37_soundFlipper = 0;
+ scene37_dudeX = 0;
+
+ scene38_var01 = 0;
+ scene38_var02 = 0;
+ scene38_var03 = 0;
+ scene38_var04 = 0;
+ scene38_boss = 0;
+ scene38_tally = 0;
+ scene38_shorty = 0;
+ scene38_domino0 = 0;
+ scene38_dominos = 0;
+ scene38_domino1 = 0;
+ scene38_bottle = 0;
+ scene38_var05 = 0;
+ scene38_var06 = 0;
+ scene38_var07 = 0;
+ scene38_var08 = 0;
+ scene38_var09 = 0;
+ scene38_var10 = 0;
+ scene38_var11 = 0;
+ scene38_var12 = 0;
+ scene38_var13 = 0;
selector = 0;
}
@@ -104,19 +393,43 @@ static int scenes[] = {
SC_1, SC_2, SC_3, SC_4, SC_5, SC_6, SC_7, SC_8, SC_9, SC_10,
SC_11, SC_12, SC_13, SC_14, SC_15, SC_16, SC_17, SC_18, SC_19, SC_20,
SC_21, SC_22, SC_23, SC_24, SC_25, SC_26, SC_27, SC_28, SC_29, SC_30,
- SC_31, SC_32, SC_33, SC_34, SC_35, SC_36, SC_37, SC_38, SC_DBGMENU
+ SC_31, SC_32, SC_33, SC_34, SC_35, SC_36, SC_37, SC_38, SC_FINAL1, SC_DBGMENU
+};
+
+static int scenesD[] = {
+ PIC_SCD_1, PIC_SCD_2, PIC_SCD_3, PIC_SCD_4, PIC_SCD_5, PIC_SCD_6, PIC_SCD_7, PIC_SCD_8, PIC_SCD_9, PIC_SCD_10,
+ PIC_SCD_11, PIC_SCD_12, PIC_SCD_13, PIC_SCD_14, PIC_SCD_15, PIC_SCD_16, PIC_SCD_17, PIC_SCD_18, PIC_SCD_19, PIC_SCD_20,
+ PIC_SCD_21, PIC_SCD_22, PIC_SCD_23, PIC_SCD_24, PIC_SCD_25, PIC_SCD_26, PIC_SCD_27, PIC_SCD_28, PIC_SCD_29, PIC_SCD_30,
+ PIC_SCD_31, PIC_SCD_32, PIC_SCD_33, PIC_SCD_34, PIC_SCD_35, PIC_SCD_36, PIC_SCD_37, PIC_SCD_38, PIC_SCD_FIN, 0
};
int FullpipeEngine::convertScene(int scene) {
if (!scene || scene >= SC_1)
return scene;
- if (scene < 1 || scene > 39)
+ if (scene < 1 || scene > 40)
return SC_1;
return scenes[scene - 1];
}
+int FullpipeEngine::getSceneEntrance(int scene) {
+ for (int i = 0; i < 40; i++)
+ if (scenes[i] == scene)
+ return scenesD[i];
+
+ return 0;
+}
+
+int FullpipeEngine::getSceneFromTag(int tag) {
+ for (int i = 0; i < ARRAYSIZE(scenes); i++) {
+ if (scenes[i] == tag)
+ return i + 1;
+ }
+
+ return 1;
+}
+
bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
GameVar *sceneVar;
Common::Point sceneDim;
@@ -259,7 +572,6 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_updateCursorCallback = scene04_updateCursor;
break;
-#if 0
case SC_5:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_5");
scene->preloadMovements(sceneVar);
@@ -278,7 +590,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_behaviorManager->initBehavior(scene, sceneVar);
scene->initObjectCursors("SC_6");
setSceneMusicParameters(sceneVar);
- sub_415300();
+ scene06_initMumsy();
insertMessageHandler(sceneHandler06, 2, 2);
_updateCursorCallback = scene06_updateCursor;
break;
@@ -301,11 +613,12 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_behaviorManager->initBehavior(scene, sceneVar);
scene->initObjectCursors("SC_8");
setSceneMusicParameters(sceneVar);
- sub_416890();
+ scene08_setupMusic();
addMessageHandler(sceneHandler08, 2);
_updateCursorCallback = scene08_updateCursor;
break;
+#if 0
case SC_9:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_9");
scene->preloadMovements(sceneVar);
@@ -316,6 +629,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
insertMessageHandler(sceneHandler09, 2, 2);
_updateCursorCallback = scene09_updateCursor;
break;
+#endif
case SC_10:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_10");
@@ -336,7 +650,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_11");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler11, 2, 2);
- scene11_sub_41A980();
+ scene11_setupMusic();
_updateCursorCallback = scene11_updateCursor;
break;
@@ -370,7 +684,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_14");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler14, 2, 2);
- scene14_sub_41D2B0();
+ scene14_setupMusic();
_updateCursorCallback = scene14_updateCursor;
break;
@@ -404,10 +718,11 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_17");
setSceneMusicParameters(sceneVar);
addMessageHandler(sceneHandler17, 2);
- scene17_sub_41F060();
+ scene17_restoreState();
_updateCursorCallback = scene17_updateCursor;
break;
+#if 0
case SC_18:
sub_40E1B0();
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_18");
@@ -448,6 +763,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene19_sub_4211D0(scene);
_updateCursorCallback = scene19_updateCursor;
break;
+#endif
case SC_20:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_20");
@@ -478,7 +794,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_behaviorManager->initBehavior(scene, sceneVar);
scene->initObjectCursors("SC_22");
setSceneMusicParameters(sceneVar);
- scene22_sub_4228A0();
+ scene22_setBagState();
insertMessageHandler(sceneHandler22, 2, 2);
_updateCursorCallback = scene22_updateCursor;
break;
@@ -491,7 +807,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_23");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler23, 2, 2);
- scene23_sub_423B00();
+ scene23_setGiraffeState();
_updateCursorCallback = scene23_updateCursor;
break;
@@ -503,19 +819,19 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_24");
setSceneMusicParameters(sceneVar);
addMessageHandler(sceneHandler24, 2);
- scene24_sub_423DD0();
+ scene24_setPoolState();
_updateCursorCallback = defaultUpdateCursor;
break;
case SC_25:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_25");
scene->preloadMovements(sceneVar);
- scene25_initScene(scene, entrance->field_4);
+ scene25_initScene(scene, entrance->_field_4);
_behaviorManager->initBehavior(scene, sceneVar);
scene->initObjectCursors("SC_25");
setSceneMusicParameters(sceneVar);
addMessageHandler(sceneHandler25, 2);
- scene25_sub_4253B0(scene, entrance->field_4);
+ scene25_setupWater(scene, entrance->_field_4);
_updateCursorCallback = scene25_updateCursor;
break;
@@ -527,10 +843,11 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_26");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler26, 2, 2);
- scene26_sub_426140(scene);
+ scene26_setupDrop(scene);
_updateCursorCallback = scene26_updateCursor;
break;
+#if 0
case SC_27:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_27");
scene->preloadMovements(sceneVar);
@@ -541,6 +858,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
addMessageHandler(sceneHandler27, 2);
_updateCursorCallback = scene27_updateCursor;
break;
+#endif
case SC_28:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_28");
@@ -553,6 +871,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_updateCursorCallback = scene28_updateCursor;
break;
+#if 0
case SC_29:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_29");
scene->preloadMovements(sceneVar);
@@ -563,11 +882,12 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
addMessageHandler(sceneHandler29, 2);
_updateCursorCallback = scene29_updateCursor;
break;
+#endif
case SC_30:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_30");
scene->preloadMovements(sceneVar);
- scene30_initScene(scene, entrance->field_4);
+ scene30_initScene(scene, entrance->_field_4);
_behaviorManager->initBehavior(scene, sceneVar);
scene->initObjectCursors("SC_30");
setSceneMusicParameters(sceneVar);
@@ -594,7 +914,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_32");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler32, 2, 2);
- scene32_sub_42C5C0();
+ scene32_setupMusic();
_updateCursorCallback = scene32_updateCursor;
break;
@@ -606,7 +926,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_33");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler33, 2, 2);
- scene33_sub_42CEF0();
+ scene33_setupMusic();
_updateCursorCallback = scene33_updateCursor;
break;
@@ -618,7 +938,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
scene->initObjectCursors("SC_34");
setSceneMusicParameters(sceneVar);
insertMessageHandler(sceneHandler34, 2, 2);
- scene34_sub_42DEE0();
+ scene34_initBeh();
_updateCursorCallback = scene34_updateCursor;
break;
@@ -655,6 +975,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
_updateCursorCallback = scene37_updateCursor;
break;
+#if 0
case SC_38:
sceneVar = _gameLoader->_gameVar->getSubVarByName("SC_38");
scene->preloadMovements(sceneVar);
@@ -688,7 +1009,7 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
break;
default:
- _behaviorManager->initBehavior(0, 0);
+ error("Unknown scene %d", entrance->_sceneId);
break;
}
@@ -696,13 +1017,346 @@ bool FullpipeEngine::sceneSwitcher(EntranceInfo *entrance) {
}
int defaultUpdateCursor() {
- g_fullpipe->updateCursorCommon();
+ g_fp->updateCursorCommon();
+
+ return g_fp->_cursorId;
+}
+
+void FullpipeEngine::processArcade(ExCommand *ex) {
+ warning("STUB: FullpipeEngine::processArcade()");
+}
+
+void FullpipeEngine::updateMapPiece(int mapId, int update) {
+ for (int i = 0; i < 200; i++) {
+ int hiWord = (_mapTable[i] >> 16) & 0xffff;
- return g_fullpipe->_cursorId;
+ if (hiWord == mapId) {
+ _mapTable[i] |= update;
+ return;
+ }
+ if (!hiWord) {
+ _mapTable[i] = (mapId << 16) | update;
+ return;
+ }
+ }
}
-void FullpipeEngine::initArcadeKeys(const char *varname) {
- warning("STUB: FullpipeEngine::initArcadeKeys(\"%s\")", varname);
+void FullpipeEngine::updateMap(PreloadItem *pre) {
+ switch (pre->sceneId) {
+ case SC_1:
+ updateMapPiece(PIC_MAP_S01, 1);
+
+ if (pre->keyCode == TrubaUp)
+ updateMapPiece(PIC_MAP_P01, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_A13, 1);
+ break;
+
+ case SC_2:
+ updateMapPiece(PIC_MAP_S02, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_P01, 1);
+
+ break;
+
+ case SC_3:
+ updateMapPiece(PIC_MAP_S03, 1);
+ break;
+
+ case SC_4:
+ updateMapPiece(PIC_MAP_S04, 1);
+
+ if (pre->keyCode == TrubaRight)
+ updateMapPiece(PIC_MAP_P04, 1);
+
+ break;
+
+ case SC_5:
+ updateMapPiece(PIC_MAP_S05, 1);
+
+ if (pre->keyCode == TrubaLeft) {
+ updateMapPiece(PIC_MAP_P04, 1);
+ }
+
+ if (pre->keyCode == TrubaUp) {
+ updateMapPiece(PIC_MAP_P05, 1);
+ updateMapPiece(PIC_MAP_A11, 1);
+ }
+
+ break;
+
+ case SC_6:
+ updateMapPiece(PIC_MAP_S06, 1);
+
+ if (pre->keyCode == TrubaUp)
+ updateMapPiece(PIC_MAP_A12, 1);
+
+ break;
+
+ case SC_7:
+ updateMapPiece(PIC_MAP_S07, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_P18, 1);
+
+ break;
+
+ case SC_8:
+ updateMapPiece(PIC_MAP_S08, 1);
+
+ if (pre->keyCode == TrubaUp)
+ updateMapPiece(PIC_MAP_P11, 1);
+
+ if (pre->keyCode == TrubaRight)
+ updateMapPiece(PIC_MAP_P18, 1);
+
+ return;
+
+ case SC_9:
+ updateMapPiece(PIC_MAP_S09, 1);
+
+ if (pre->keyCode == TrubaDown)
+ updateMapPiece(PIC_MAP_P11, 1);
+
+ return;
+
+ case SC_10:
+ updateMapPiece(PIC_MAP_S10, 1);
+
+ if (pre->keyCode == TrubaRight)
+ updateMapPiece(PIC_MAP_P02, 1);
+
+ break;
+
+ case SC_11:
+ updateMapPiece(PIC_MAP_S11, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_P02, 1);
+
+ break;
+
+ case SC_12:
+ updateMapPiece(PIC_MAP_S12, 1);
+ break;
+
+ case SC_13:
+ updateMapPiece(PIC_MAP_S13, 1);
+
+ if (pre->keyCode == TrubaUp) {
+ updateMapPiece(PIC_MAP_P06, 1);
+ updateMapPiece(PIC_MAP_A10, 1);
+ }
+ break;
+
+ case SC_14:
+ updateMapPiece(PIC_MAP_S14, 1);
+ break;
+
+ case SC_15:
+ updateMapPiece(PIC_MAP_S15, 1);
+
+ if (pre->keyCode == TrubaUp) {
+ updateMapPiece(PIC_MAP_P08, 1);
+ updateMapPiece(PIC_MAP_A14, 1);
+ }
+
+ break;
+
+ case SC_16:
+ updateMapPiece(PIC_MAP_S16, 1);
+ break;
+
+ case SC_17:
+ updateMapPiece(PIC_MAP_S17, 1);
+ break;
+
+ case SC_18:
+ updateMapPiece(PIC_MAP_S1819, 1);
+
+ if (pre->keyCode == PIC_SC18_RTRUBA)
+ updateMapPiece(PIC_MAP_P14, 1);
+
+ break;
+
+ case SC_19:
+ updateMapPiece(PIC_MAP_S1819, 1);
+
+ if (pre->keyCode == PIC_SC19_RTRUBA3) {
+ updateMapPiece(PIC_MAP_P15, 1);
+ updateMapPiece(PIC_MAP_A09, 1);
+ }
+
+ break;
+
+ case SC_20:
+ updateMapPiece(PIC_MAP_S20, 1);
+ break;
+
+ case SC_21:
+ updateMapPiece(PIC_MAP_S21, 1);
+
+ if (pre->keyCode == TrubaLeft) {
+ updateMapPiece(PIC_MAP_P15, 1);
+ updateMapPiece(PIC_MAP_A09, 1);
+ }
+
+ if (pre->keyCode == TrubaDown)
+ updateMapPiece(PIC_MAP_A08, 1);
+
+ break;
+
+ case SC_22:
+ updateMapPiece(PIC_MAP_S22, 1);
+ break;
+
+ case SC_23:
+ if (getObjectState("Верхний люк_23") == getObjectEnumState("Верхний люк_23", "Открыт")) {
+ updateMapPiece(PIC_MAP_S23_1, 0);
+ updateMapPiece(PIC_MAP_S23_2, 1);
+ updateMapPiece(PIC_MAP_P07, 1);
+ } else {
+ updateMapPiece(PIC_MAP_S23_1, 1);
+ updateMapPiece(PIC_MAP_S23_2, 0);
+ }
+ break;
+
+ case SC_24:
+ updateMapPiece(PIC_MAP_S24, 1);
+
+ if (pre->keyCode == TrubaUp)
+ updateMapPiece(PIC_MAP_A08, 1);
+
+ if (pre->keyCode == TrubaDown) {
+ updateMapPiece(PIC_MAP_P13, 1);
+ updateMapPiece(PIC_MAP_A07, 1);
+ }
+ break;
+
+ case SC_25:
+ updateMapPiece(PIC_MAP_S25, 1);
+ break;
+
+ case SC_26:
+ updateMapPiece(PIC_MAP_S26, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_A06, 1);
+
+ if (pre->keyCode == TrubaUp) {
+ updateMapPiece(PIC_MAP_P13, 1);
+ updateMapPiece(PIC_MAP_A07, 1);
+ }
+
+ break;
+
+ case SC_27:
+ updateMapPiece(PIC_MAP_S27, 1);
+ break;
+
+ case SC_28:
+ updateMapPiece(PIC_MAP_S28, 1);
+
+ if (pre->keyCode == TrubaRight)
+ updateMapPiece(PIC_MAP_A06, 1);
+
+ break;
+
+ case SC_29:
+ updateMapPiece(PIC_MAP_S29, 1);
+
+ if (pre->keyCode == TrubaUp)
+ updateMapPiece(PIC_MAP_A05, 1);
+
+ break;
+
+ case SC_30:
+ updateMapPiece(PIC_MAP_S30, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_P09, 1);
+
+ if (pre->keyCode == TrubaRight)
+ updateMapPiece(PIC_MAP_A04, 1);
+
+ break;
+
+ case SC_31:
+ updateMapPiece(PIC_MAP_S31_2, 1);
+
+ if (getObjectState("Кактус") == getObjectEnumState("Кактус", "Вырос"))
+ updateMapPiece(PIC_MAP_S31_1, 1);
+
+ if (pre->keyCode == TrubaRight)
+ updateMapPiece(PIC_MAP_P09, 1);
+
+ break;
+
+ case SC_32:
+ updateMapPiece(PIC_MAP_S32_2, 1);
+
+ if (getObjectState("Кактус") == getObjectEnumState("Кактус", "Вырос"))
+ updateMapPiece(PIC_MAP_S32_1, 1);
+
+ break;
+
+ case SC_33:
+ updateMapPiece(PIC_MAP_S33, 1);
+ break;
+
+ case SC_34:
+ updateMapPiece(PIC_MAP_S34, 1);
+
+ if (pre->keyCode == TrubaUp)
+ updateMapPiece(PIC_MAP_A03, 1);
+
+ break;
+
+ case SC_35:
+ updateMapPiece(PIC_MAP_S35, 1);
+
+ if (pre->keyCode == TrubaLeft)
+ updateMapPiece(PIC_MAP_A02, 1);
+
+ if (pre->keyCode == TrubaDown)
+ updateMapPiece(PIC_MAP_A03, 1);
+
+ break;
+
+ case SC_36:
+ updateMapPiece(PIC_MAP_S36, 1);
+ break;
+
+ case SC_37:
+ updateMapPiece(PIC_MAP_S37, 1);
+ updateMapPiece(PIC_MAP_A01, 1);
+ break;
+
+ case SC_38:
+ updateMapPiece(PIC_MAP_S38, 1);
+
+ switch (pre->preloadId1) {
+ case SC_15:
+ updateMapPiece(PIC_MAP_P16, 1);
+ break;
+
+ case SC_1:
+ updateMapPiece(PIC_MAP_P10, 1);
+ break;
+
+ case SC_10:
+ updateMapPiece(PIC_MAP_P17, 1);
+ break;
+
+ case SC_19:
+ updateMapPiece(PIC_MAP_P12, 1);
+ break;
+ }
+ break;
+ }
}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 277beb0083..b35d0eb87f 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -25,6 +25,10 @@
namespace Fullpipe {
+struct BehaviorEntryInfo;
+class MGM;
+class MctlLadder;
+struct Ring;
class StaticANIObject;
int defaultUpdateCursor();
@@ -49,6 +53,126 @@ int scene04_updateCursor();
void scene04_initScene(Scene *sc);
int sceneHandler04(ExCommand *cmd);
+void scene05_initScene(Scene *sc);
+int sceneHandler05(ExCommand *cmd);
+
+void scene06_initScene(Scene *sc);
+void scene06_initMumsy();
+int sceneHandler06(ExCommand *cmd);
+int scene06_updateCursor();
+
+void scene07_initScene(Scene *sc);
+int sceneHandler07(ExCommand *cmd);
+
+void scene08_initScene(Scene *sc);
+void scene08_setupMusic();
+int sceneHandler08(ExCommand *cmd);
+int scene08_updateCursor();
+
+void scene10_initScene(Scene *sc);
+int sceneHandler10(ExCommand *cmd);
+int scene10_updateCursor();
+
+void scene11_initScene(Scene *sc);
+void scene11_setupMusic();
+int sceneHandler11(ExCommand *cmd);
+int scene11_updateCursor();
+
+void scene12_initScene(Scene *sc);
+int sceneHandler12(ExCommand *ex);
+
+void scene13_initScene(Scene *sc);
+int sceneHandler13(ExCommand *ex);
+
+void scene14_initScene(Scene *sc);
+void scene14_setupMusic();
+int sceneHandler14(ExCommand *cmd);
+int scene14_updateCursor();
+
+int scene15_updateCursor();
+void scene15_initScene(Scene *sc);
+int sceneHandler15(ExCommand *cmd);
+
+void scene16_initScene(Scene *sc);
+int sceneHandler16(ExCommand *cmd);
+int scene16_updateCursor();
+
+void scene17_initScene(Scene *sc);
+void scene17_restoreState();
+int sceneHandler17(ExCommand *cmd);
+int scene17_updateCursor();
+
+void scene18_preload();
+void scene19_preload(Scene *sc, int key);
+
+void scene20_initScene(Scene *sc);
+int sceneHandler20(ExCommand *ex);
+
+int scene21_updateCursor();
+void scene21_initScene(Scene *sc);
+int sceneHandler21(ExCommand *cmd);
+
+void scene22_initScene(Scene *sc);
+void scene22_setBagState();
+int sceneHandler22(ExCommand *cmd);
+int scene22_updateCursor();
+
+void scene23_initScene(Scene *sc);
+void scene23_setGiraffeState();
+int sceneHandler23(ExCommand *cmd);
+int scene23_updateCursor();
+
+void scene24_initScene(Scene *sc);
+void scene24_setPoolState();
+int sceneHandler24(ExCommand *cmd);
+
+void scene25_initScene(Scene *sc, int entrance);
+void scene25_setupWater(Scene *sc, int entrance);
+int sceneHandler25(ExCommand *cmd);
+int scene25_updateCursor();
+
+void scene26_initScene(Scene *sc);
+void scene26_setupDrop(Scene *sc);
+int sceneHandler26(ExCommand *cmd);
+int scene26_updateCursor();
+
+void scene28_initScene(Scene *sc);
+ int sceneHandler28(ExCommand *ex);
+int scene28_updateCursor();
+
+int scene30_updateCursor();
+void scene30_initScene(Scene *sc, int flag);
+int sceneHandler30(ExCommand *cmd);
+
+void scene31_initScene(Scene *sc);
+int sceneHandler31(ExCommand *ex);
+
+void scene32_initScene(Scene *sc);
+void scene32_setupMusic();
+int sceneHandler32(ExCommand *cmd);
+int scene32_updateCursor();
+
+void scene33_initScene(Scene *sc);
+void scene33_setupMusic();
+int sceneHandler33(ExCommand *cmd);
+int scene33_updateCursor();
+
+void scene34_initScene(Scene *sc);
+void scene34_initBeh();
+int sceneHandler34(ExCommand *cmd);
+int scene34_updateCursor();
+
+void scene35_initScene(Scene *sc);
+int sceneHandler35(ExCommand *cmd);
+
+int scene36_updateCursor();
+void scene36_initScene(Scene *sc);
+int sceneHandler36(ExCommand *cmd);
+
+void scene37_initScene(Scene *sc);
+int sceneHandler37(ExCommand *ex);
+int scene37_updateCursor();
+
void sceneDbgMenu_initScene(Scene *sc);
int sceneHandlerDbgMenu(ExCommand *cmd);
@@ -89,43 +213,344 @@ public:
Common::Point scene04_jumpingKozyawki[20];
Common::Point scene04_jumpRotateKozyawki[20];
- Common::Array<StaticANIObject *> scene04_kozyawkiObjList;
- Common::Array<GameObject *> scene04_bottleObjList;
- Common::Array<StaticANIObject *> scene04_kozyawkiAni;
+ Common::List<StaticANIObject *> scene04_kozyawkiObjList;
+ Common::List<GameObject *> scene04_bottleObjList;
+ Common::List<StaticANIObject *> scene04_kozyawkiAni;
+
+ MctlLadder *scene04_ladder;
+ int scene04_ladderOffset;
- int scene04_ladder;
bool scene04_coinPut;
bool scene04_soundPlaying;
+ bool scene04_dudeOnLadder;
+
int scene04_dynamicPhaseIndex;
int scene04_sceneClickX;
int scene04_sceneClickY;
int scene04_dudePosX;
int scene04_dudePosY;
+ int scene04_bottleY;
+
+ StaticANIObject *scene04_walkingKozyawka;
+
+ int scene04_speakerVariant;
+ int scene04_speakerPhase;
- int scene04_var01;
- int scene04_var02;
- int scene04_var04;
- StaticANIObject *scene04_var05;
- int scene04_var06;
- int scene04_var07;
- int scene04_var08;
- int scene04_var09;
- int scene04_var10;
- int scene04_var11;
- int scene04_var12;
- int scene04_var13;
- int scene04_var14;
- int scene04_var15;
- int scene04_var16;
- int scene04_var17;
- int scene04_var18;
- int scene04_var19;
- int scene04_var20;
- StaticANIObject *scene04_var24;
+ bool scene04_bottleIsTaken;
+ bool scene04_kozyawkaOnLadder;
+ int scene04_bottleWeight;
+ bool scene04_var07;
+ bool scene04_ladderClickable;
+ bool scene04_handIsDown;
+ bool scene04_dudeInBottle;
+ bool scene04_kozHeadRaised;
+ bool scene04_bottleIsDropped;
+ bool scene04_bigBallIn;
+ int scene04_bigBallCounter;
+ bool scene04_bigBallFromLeft;
+ bool scene04_clockCanGo;
+ bool scene04_objectIsTaken;
+ int scene04_springOffset;
+ StaticANIObject *scene04_lastKozyawka;
+ int scene04_springDelay;
+
+ StaticANIObject *scene05_handle;
+ StaticANIObject *scene05_wacko;
+ StaticANIObject *scene05_bigHatch;
+ int scene05_wackoTicker;
+ int scene05_handleFlipper;
+ int scene05_floatersTicker;
+
+ StaticANIObject *scene06_mumsy;
+ int scene06_manX;
+ int scene06_manY;
+ int scene06_ballX;
+ int scene06_ballY;
+ StaticANIObject *scene06_someBall;
+ StaticANIObject *scene06_invHandle;
+ StaticANIObject *scene06_liftButton;
+ StaticANIObject *scene06_ballDrop;
+ bool scene06_arcadeEnabled;
+ bool scene06_aimingBall;
+ StaticANIObject *scene06_currentBall;
+ StaticANIObject *scene06_ballInHands;
+ StaticANIObject *scene06_flyingBall;
+ Common::Array<StaticANIObject *> scene06_balls;
+ int scene06_numBallsGiven;
+ int scene06_mumsyNumBalls;
+ int scene06_eggieTimeout;
+ int scene06_eggieDirection;
+ int scene06_mumsyGotBall;
+ int scene06_ballDeltaX;
+ int scene06_ballDeltaY;
+ int scene06_sceneClickX;
+ int scene06_sceneClickY;
+ int scene06_mumsyPos;
+ BehaviorEntryInfo *scene06_mumsyJumpBk;
+ BehaviorEntryInfo *scene06_mumsyJumpFw;
+ int scene06_mumsyJumpBkPercent;
+ int scene06_mumsyJumpFwPercent;
+
+ BehaviorEntryInfo *scene07_lukeAnim;
+ int scene07_lukePercent;
+ StaticANIObject *scene07_plusMinus;
+
+ StaticANIObject *scene08_batuta;
+ StaticANIObject *scene08_vmyats;
+ StaticANIObject *scene08_clock;
+ bool scene08_inAir;
+ bool scene08_flyingUp;
+ int scene08_onBelly;
+ int scene08_stairsOffset;
+ int scene08_snoringCountdown;
+ bool scene08_inArcade;
+ bool scene08_stairsVisible;
+ int scene08_manOffsetY;
+
+ StaticANIObject *scene10_gum;
+ StaticANIObject *scene10_packet;
+ StaticANIObject *scene10_packet2;
+ StaticANIObject *scene10_inflater;
+ PictureObject *scene10_ladder;
+ int scene10_hasGum;
+
+ StaticANIObject *scene11_swingie;
+ StaticANIObject *scene11_boots;
+ StaticANIObject *scene11_dudeOnSwing;
+ PictureObject *scene11_hint;
+ MGM scene11_mgm;
+ bool scene11_arcadeIsOn;
+ bool scene11_scrollIsEnabled;
+ bool scene11_scrollIsMaximized;
+ int scene11_hintCounter;
+ int scene11_swingieScreenEdge;
+ int scene11_crySound;
+ double scene11_swingAngle;
+ double scene11_swingOldAngle;
+ double scene11_swingSpeed;
+ double scene11_swingAngleDiff;
+ double scene11_swingInertia;
+ int scene11_swingCounter;
+ int scene11_swingCounterPrevTurn;
+ int scene11_swingDirection;
+ int scene11_swingDirectionPrevTurn;
+ bool scene11_swingIsSwinging;
+ bool scene11_swingieStands;
+ int scene11_dudeX;
+ int scene11_dudeY;
+ int scene11_swingMaxAngle;
+
+ int scene12_fly;
+ int scene12_flyCountdown;
+
+ StaticANIObject *scene13_whirlgig;
+ StaticANIObject *scene13_guard;
+ StaticANIObject *scene13_handleR;
+ StaticANIObject *scene13_handleL;
+ StaticANIObject *scene13_bridge;
+ bool scene13_guardDirection;
+ int scene13_dudeX;
+
+ StaticANIObject *scene14_grandma;
+ int scene14_sceneDeltaX;
+ int scene14_sceneDeltaY;
+ bool scene14_arcadeIsOn;
+ bool scene14_dudeIsKicking;
+ bool scene14_ballIsFlying;
+ bool scene14_dudeCanKick;
+ int scene14_sceneDiffX;
+ int scene14_sceneDiffY;
+ StaticANIObject *scene14_pink;
+ StaticANIObject *scene14_flyingBall;
+ Common::List<StaticANIObject *> scene14_balls;
+ bool scene14_grandmaIsHere;
+ int scene14_dudeX;
+ int scene14_dudeY;
+ int scene14_grandmaX;
+ int scene14_grandmaY;
+ int scene14_dude2X;
+ int scene14_ballDeltaX;
+ int scene14_ballDeltaY;
+ int scene14_ballX;
+ int scene14_ballY;
+ int scene14_hitsLeft;
+ Common::Point scene14_mouseCursorPos;
+
+ int scene15_chantingCountdown;
+ StaticANIObject *scene15_plusminus;
+ PictureObject *scene15_ladder;
+ StaticANIObject *scene15_boot;
+
+ Common::List<StaticANIObject *> scene16_figures;
+ StaticANIObject *scene16_walkingBoy;
+ StaticANIObject *scene16_walkingGirl;
+ int scene16_walkingCount;
+ StaticANIObject *scene16_wire;
+ StaticANIObject *scene16_mug;
+ StaticANIObject *scene16_jettie;
+ StaticANIObject *scene16_boot;
+ bool scene16_girlIsLaughing;
+ int scene16_sound;
+ bool scene16_placeIsOccupied;
+
+ int scene17_flyState;
+ bool scene17_sugarIsShown;
+ int scene17_sceneOldEdgeX;
+ int scene17_flyCountdown;
+ StaticANIObject *scene17_hand;
+ bool scene17_handPhase;
+ int scene17_sceneEdgeX;
+
+ int scene18_var01;
+
+ int scene20_fliesCountdown;
+ StaticANIObject *scene20_grandma;
+
+ StaticANIObject *scene21_giraffeBottom;
+ int scene21_giraffeBottomX;
+ int scene21_giraffeBottomY;
+ int scene21_pipeIsOpen;
+ double scene21_wigglePos;
+ bool scene21_wiggleTrigger;
+
+ StaticANIObject *scene22_bag;
+ StaticANIObject *scene22_giraffeMiddle;
+ bool scene22_dudeIsOnStool;
+ bool scene22_interactionIsDisabled;
+ bool scene22_craneIsOut;
+ int scene22_numBagFalls;
+
+ StaticANIObject *scene23_calend0;
+ StaticANIObject *scene23_calend1;
+ StaticANIObject *scene23_calend2;
+ StaticANIObject *scene23_calend3;
+ bool scene23_topReached;
+ bool scene23_isOnStool;
+ int scene23_someVar;
+ StaticANIObject *scene23_giraffeTop;
+ StaticANIObject *scene23_giraffee;
+
+ bool scene24_jetIsOn;
+ bool scene24_flowIsLow;
+ bool scene24_waterIsOn;
+ StaticANIObject *scene24_water;
+ StaticANIObject *scene24_jet;
+ StaticANIObject *scene24_drop;
+
+ StaticANIObject *scene25_water;
+ StaticANIObject *scene25_board;
+ StaticANIObject *scene25_drop;
+ bool scene25_dudeIsOnBoard;
+ bool scene25_waterIsPresent;
+ bool scene25_boardIsSelectable;
+ bool scene25_beardersAreThere;
+ int scene25_beardersCounter;
+ Common::Array<StaticANIObject *> scene25_bearders;
+ bool scene25_sneezeFlipper;
+
+ StaticANIObject *scene26_chhi;
+ StaticANIObject *scene26_drop;
+ PictureObject *scene26_sockPic;
+ StaticANIObject *scene26_sock;
+ StaticANIObject *scene26_activeVent;
+
+ bool scene28_fliesArePresent;
+ bool scene28_beardedDirection;
+ PictureObject *scene28_darkeningObject;
+ PictureObject *scene28_lighteningObject;
+ bool scene28_headDirection;
+ bool scene28_headBeardedFlipper;
+ bool scene28_lift6inside;
+
+ StaticANIObject *scene30_leg;
+ int scene30_liftFlag;
+
+ int scene31_chantingCountdown;
+ StaticANIObject *scene31_cactus;
+ StaticANIObject *scene31_plusMinus;
+
+ bool scene32_flagIsWaving;
+ bool scene32_flagNeedsStopping;
+ bool scene32_dudeIsSitting;
+ int scene32_cactusCounter;
+ bool scene32_dudeOnLadder;
+ bool scene32_cactusIsGrowing;
+ StaticANIObject *scene32_flag;
+ StaticANIObject *scene32_cactus;
+ StaticANIObject *scene32_massOrange;
+ StaticANIObject *scene32_massBlue;
+ StaticANIObject *scene32_massGreen;
+ StaticANIObject *scene32_button;
+
+ StaticANIObject *scene33_mug;
+ StaticANIObject *scene33_jettie;
+ StaticANIObject *scene33_cube;
+ int scene33_cubeX;
+ bool scene33_handleIsDown;
+ int scene33_ventsX[9];
+ int scene33_ventsState[9];
+
+ StaticANIObject *scene34_cactus;
+ StaticANIObject *scene34_vent;
+ StaticANIObject *scene34_hatch;
+ StaticANIObject *scene34_boot;
+ bool scene34_dudeClimbed;
+ bool scene34_dudeOnBoard;
+ bool scene34_dudeOnCactus;
+ int scene34_fliesCountdown;
+
+ StaticANIObject *scene35_hose;
+ StaticANIObject *scene35_bellyInflater;
+ int scene35_flowCounter;
+ int scene35_fliesCounter;
+
+ StaticANIObject *scene36_rotohrust;
+ StaticANIObject *scene36_scissors;
+
+ Common::Array<Ring *> scene37_rings;
+ int scene37_lastDudeX;
+ bool scene37_cursorIsLocked;
+ StaticANIObject *scene37_plusMinus1;
+ StaticANIObject *scene37_plusMinus2;
+ StaticANIObject *scene37_plusMinus3;
+ int scene37_soundFlipper;
+ int scene37_dudeX;
+
+ int scene38_var01;
+ int scene38_var02;
+ int scene38_var03;
+ int scene38_var04;
+ StaticANIObject *scene38_boss;
+ StaticANIObject *scene38_tally;
+ StaticANIObject *scene38_shorty;
+ StaticANIObject *scene38_domino0;
+ StaticANIObject *scene38_dominos;
+ StaticANIObject *scene38_domino1;
+ StaticANIObject *scene38_bottle;
+ int scene38_var05;
+ int scene38_var06;
+ int scene38_var07;
+ int scene38_var08;
+ int scene38_var09;
+ int scene38_var10;
+ int scene38_var11;
+ int scene38_var12;
+ int scene38_var13;
PictureObject *selector;
};
+struct Ring {
+ StaticANIObject *ani;
+ int x;
+ int y;
+ int numSubRings;
+ int subRings[10];
+ bool state;
+
+ Ring();
+};
+
} // End of namespace Fullpipe
#endif /* FULLPIPE_SCENES_H */
diff --git a/engines/fullpipe/scenes/scene01.cpp b/engines/fullpipe/scenes/scene01.cpp
index 4181bbffe3..6c8f26d209 100644
--- a/engines/fullpipe/scenes/scene01.cpp
+++ b/engines/fullpipe/scenes/scene01.cpp
@@ -26,6 +26,7 @@
#include "fullpipe/constants.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/statics.h"
@@ -36,7 +37,7 @@
namespace Fullpipe {
void scene01_fixEntrance() {
- GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
+ GameVar *var = g_fp->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
if (var->getSubVarAsInt("Entrance") == TrubaLeft)
var->setSubVarAsInt("Entrance", TrubaRight);
}
@@ -48,7 +49,7 @@ void scene01_initScene(Scene *sc, int entrance) {
g_vars->scene01_picSc01Osk2 = sc->getPictureObjectById(PIC_SC1_OSK2, 0);
g_vars->scene01_picSc01Osk2->_flags &= 0xFFFB;
- if (g_fullpipe->getObjectState(sO_EggCracker) == g_fullpipe->getObjectEnumState(sO_EggCracker, sO_DidNotCrackEgg)) {
+ if (g_fp->getObjectState(sO_EggCracker) == g_fp->getObjectEnumState(sO_EggCracker, sO_DidNotCrackEgg)) {
PictureObject *pic = sc->getPictureObjectById(PIC_SC1_KUCHKA, 0);
if (pic)
pic->_flags &= 0xFFFB;
@@ -60,7 +61,7 @@ void scene01_initScene(Scene *sc, int entrance) {
bootAnim->_flags &= ~0x04;
}
- g_fullpipe->lift_setButton(sO_Level2, ST_LBN_2N);
+ g_fp->lift_setButton(sO_Level2, ST_LBN_2N);
}
int sceneHandler01(ExCommand *cmd) {
@@ -71,7 +72,7 @@ int sceneHandler01(ExCommand *cmd) {
if (cmd->_messageNum > MSG_SC1_SHOWOSK) {
if (cmd->_messageNum == MSG_SC1_UTRUBACLICK)
- handleObjectInteraction(g_fullpipe->_aniMan, g_fullpipe->_currentScene->getPictureObjectById(PIC_SC1_LADDER, 0), 0);
+ handleObjectInteraction(g_fp->_aniMan, g_fp->_currentScene->getPictureObjectById(PIC_SC1_LADDER, 0), 0);
return 0;
}
@@ -97,19 +98,19 @@ int sceneHandler01(ExCommand *cmd) {
return 0;
}
- if (g_fullpipe->_aniMan2) {
- if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200) {
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300;
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200) {
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
}
- if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200)
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300;
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
res = 1;
}
- g_fullpipe->_behaviorManager->updateBehaviors();
+ g_fp->_behaviorManager->updateBehaviors();
- g_fullpipe->startSceneTrack();
+ g_fp->startSceneTrack();
return res;
}
diff --git a/engines/fullpipe/scenes/scene02.cpp b/engines/fullpipe/scenes/scene02.cpp
index dd01af4c4b..95cf1df7dd 100644
--- a/engines/fullpipe/scenes/scene02.cpp
+++ b/engines/fullpipe/scenes/scene02.cpp
@@ -26,6 +26,7 @@
#include "fullpipe/constants.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/statics.h"
@@ -39,12 +40,12 @@ namespace Fullpipe {
void scene02_initScene(Scene *sc) {
g_vars->scene02_guvTheDrawer = sc->getStaticANIObject1ById(ANI_DADAYASHIK, -1);
- if (g_fullpipe->getObjectState(sO_GuvTheDrawer) == g_fullpipe->getObjectEnumState(sO_GuvTheDrawer, sO_Sleeping)) {
- Scene *s = g_fullpipe->_currentScene;
+ if (g_fp->getObjectState(sO_GuvTheDrawer) == g_fp->getObjectEnumState(sO_GuvTheDrawer, sO_IsSleeping)) {
+ Scene *s = g_fp->_currentScene;
- g_fullpipe->_currentScene = sc;
+ g_fp->_currentScene = sc;
g_vars->scene02_guvTheDrawer->changeStatics2(ST_DYAS_LIES);
- g_fullpipe->_currentScene = s;
+ g_fp->_currentScene = s;
}
g_vars->scene02_boxDelay = 0;
@@ -55,23 +56,23 @@ void scene02_initScene(Scene *sc) {
g_vars->scene02_boxOpen = false;
} else {
g_vars->scene02_boxOpen = true;
- g_vars->scene02_boxDelay = 100 * g_fullpipe->_rnd->getRandomNumber(32767) + 150;
+ g_vars->scene02_boxDelay = 100 * g_fp->_rnd->getRandomNumber(32767) + 150;
}
- g_fullpipe->_floaters->init(g_fullpipe->_gameLoader->_gameVar->getSubVarByName("SC_2"));
+ g_fp->_floaters->init(g_fp->_gameLoader->_gameVar->getSubVarByName("SC_2"));
}
void sceneHandler02_ladderClick() {
- handleObjectInteraction(g_fullpipe->_aniMan2, g_fullpipe->_currentScene->getPictureObjectById(PIC_SC2_DTRUBA, 0), 0);
+ handleObjectInteraction(g_fp->_aniMan2, g_fp->_currentScene->getPictureObjectById(PIC_SC2_DTRUBA, 0), 0);
}
void sceneHandler02_showLadder() {
- g_fullpipe->_currentScene->getPictureObjectById(PIC_SC2_LADDER, 0)->_flags |= 4;
+ g_fp->_currentScene->getPictureObjectById(PIC_SC2_LADDER, 0)->_flags |= 4;
}
void sceneHandler02_hideLadder() {
- g_fullpipe->_currentScene->getPictureObjectById(PIC_SC2_LADDER, 0)->_flags &= 0xfffb;
- g_fullpipe->_aniMan2->_priority = 25;
+ g_fp->_currentScene->getPictureObjectById(PIC_SC2_LADDER, 0)->_flags &= 0xfffb;
+ g_fp->_aniMan2->_priority = 25;
}
int sceneHandler02(ExCommand *ex) {
@@ -90,7 +91,7 @@ int sceneHandler02(ExCommand *ex) {
return 0;
case MSG_SC2_PUTMANUP:
- g_fullpipe->_aniMan2->_priority = 0;
+ g_fp->_aniMan2->_priority = 0;
return 0;
case MSG_SC2_HIDELADDER:
@@ -98,12 +99,12 @@ int sceneHandler02(ExCommand *ex) {
return 0;
case 33:
- if (g_fullpipe->_aniMan2) {
- if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200)
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300;
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
- if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200)
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300;
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
res = 1;
}
@@ -111,24 +112,24 @@ int sceneHandler02(ExCommand *ex) {
if (g_vars->scene02_boxOpen) {
if (g_vars->scene02_boxDelay >= 1) {
--g_vars->scene02_boxDelay;
- } else if (g_fullpipe->_floaters->_array2.size() >= 1) {
- if (g_fullpipe->_floaters->_array2[0]->val5 == -50) {
- g_fullpipe->_floaters->stopAll();
+ } else if (g_fp->_floaters->_array2.size() >= 1) {
+ if (g_fp->_floaters->_array2[0]->val5 == -50) {
+ g_fp->_floaters->stopAll();
g_vars->scene02_boxOpen = false;
- g_vars->scene02_boxDelay = 100 * g_fullpipe->_rnd->getRandomNumber(32767) + 150;
+ g_vars->scene02_boxDelay = 100 * g_fp->_rnd->getRandomNumber(32767) + 150;
} else {
- g_fullpipe->_floaters->_array2[0]->val3 = -50;
+ g_fp->_floaters->_array2[0]->val3 = -50;
}
} else {
- g_fullpipe->_floaters->genFlies(g_fullpipe->_currentScene, g_fullpipe->_rnd->getRandomNumber(700) + 100, -50, 0, 0);
- g_vars->scene02_boxDelay = 500 * g_fullpipe->_rnd->getRandomNumber(32767) + 1000;
+ g_fp->_floaters->genFlies(g_fp->_currentScene, g_fp->_rnd->getRandomNumber(700) + 100, -50, 0, 0);
+ g_vars->scene02_boxDelay = 500 * g_fp->_rnd->getRandomNumber(32767) + 1000;
}
}
- g_fullpipe->_floaters->update();
- g_fullpipe->_behaviorManager->updateBehaviors();
+ g_fp->_floaters->update();
+ g_fp->_behaviorManager->updateBehaviors();
- g_fullpipe->startSceneTrack();
+ g_fp->startSceneTrack();
}
return res;
diff --git a/engines/fullpipe/scenes/scene03.cpp b/engines/fullpipe/scenes/scene03.cpp
index e9f8a240e8..40e70e2ea5 100644
--- a/engines/fullpipe/scenes/scene03.cpp
+++ b/engines/fullpipe/scenes/scene03.cpp
@@ -26,6 +26,7 @@
#include "fullpipe/constants.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/statics.h"
@@ -50,34 +51,34 @@ void scene03_initScene(Scene *sc) {
g_vars->scene03_eggeater = sc->getStaticANIObject1ById(ANI_EGGEATER, -1);
g_vars->scene03_domino = sc->getStaticANIObject1ById(ANI_DOMINO_3, -1);
- GameVar *v = g_fullpipe->_gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_GulpedEggs);
+ GameVar *v = g_fp->_gameLoader->_gameVar->getSubVarByName("OBJSTATES")->getSubVarByName(sO_GulpedEggs);
g_vars->swallowedEgg1 = v->getSubVarByName(sO_Egg1);
g_vars->swallowedEgg2 = v->getSubVarByName(sO_Egg2);
g_vars->swallowedEgg3 = v->getSubVarByName(sO_Egg3);
- g_fullpipe->lift_setButton(sO_Level2, ST_LBN_2N);
+ g_fp->lift_setButton(sO_Level2, ST_LBN_2N);
- g_fullpipe->lift_sub5(sc, QU_SC3_ENTERLIFT, QU_SC3_EXITLIFT);
+ g_fp->lift_sub5(sc, QU_SC3_ENTERLIFT, QU_SC3_EXITLIFT);
}
void scene03_setEaterState() {
- if (g_fullpipe->getObjectState(sO_EggGulperGaveCoin) == g_fullpipe->getObjectEnumState(sO_EggGulperGaveCoin, sO_Yes)) {
- g_fullpipe->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_SLIM, QU_EGTR_SLIMSHOW, 0);
- g_fullpipe->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_MID1, QU_EGTR_MD1_SHOW, 0);
- g_fullpipe->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_MID2, QU_EGTR_MD2_SHOW, 0);
+ if (g_fp->getObjectState(sO_EggGulperGaveCoin) == g_fp->getObjectEnumState(sO_EggGulperGaveCoin, sO_Yes)) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_SLIM, QU_EGTR_SLIMSHOW, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_MID1, QU_EGTR_MD1_SHOW, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene03_eggeater, ST_EGTR_MID2, QU_EGTR_MD2_SHOW, 0);
}
}
int scene03_updateCursor() {
- g_fullpipe->updateCursorCommon();
+ g_fp->updateCursorCommon();
- if (g_fullpipe->_cursorId == PIC_CSR_DEFAULT && g_fullpipe->_objectIdAtCursor == PIC_SC3_DOMIN && g_vars->scene03_domino) {
+ if (g_fp->_cursorId == PIC_CSR_DEFAULT && g_fp->_objectIdAtCursor == PIC_SC3_DOMIN && g_vars->scene03_domino) {
if (g_vars->scene03_domino->_flags & 4)
- g_fullpipe->_cursorId = PIC_CSR_ITN;
+ g_fp->_cursorId = PIC_CSR_ITN;
}
- return g_fullpipe->_cursorId;
+ return g_fp->_cursorId;
}
void sceneHandler03_eaterFat() {
@@ -94,7 +95,7 @@ void sceneHandler03_swallowEgg(int item) {
} else if (!g_vars->swallowedEgg3->_value.intValue) {
g_vars->swallowedEgg3->_value.intValue = item;
- g_fullpipe->setObjectState(sO_EggGulperGaveCoin, g_fullpipe->getObjectEnumState(sO_EggGulperGaveCoin, sO_Yes));
+ g_fp->setObjectState(sO_EggGulperGaveCoin, g_fp->getObjectEnumState(sO_EggGulperGaveCoin, sO_Yes));
scene03_setEaterState();
}
@@ -112,7 +113,7 @@ int sceneHandler03_swallowedEgg1State() {
}
void sceneHandler03_giveCoin(ExCommand *ex) {
- MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(ex->_parId);
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(ex->_parId);
if (mq && mq->getCount() > 0) {
ExCommand *ex0 = mq->getExCommandByIndex(0);
@@ -136,7 +137,7 @@ void sceneHandler03_giveCoin(ExCommand *ex) {
}
void sceneHandler03_goLadder() {
- handleObjectInteraction(g_fullpipe->_aniMan, g_fullpipe->_currentScene->getPictureObjectById(PIC_SC3_LADDER, 0), 0);
+ handleObjectInteraction(g_fp->_aniMan, g_fp->_currentScene->getPictureObjectById(PIC_SC3_LADDER, 0), 0);
}
void sceneHandler03_pushEggStack() {
@@ -158,7 +159,7 @@ void sceneHandler03_releaseEgg() {
}
void sceneHandler03_takeEgg(ExCommand *ex) {
- MessageQueue *mq = g_fullpipe->_globalMessageQueueList->getMessageQueueById(ex->_parId);
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(ex->_parId);
if (mq && mq->getCount() > 0) {
ExCommand *ex0 = mq->getExCommandByIndex(0);
@@ -179,7 +180,7 @@ void sceneHandler03_takeEgg(ExCommand *ex) {
if (ex1->_objtype == kObjTypeObjstateCommand) {
ObjstateCommand *com = (ObjstateCommand *)ex1;
- com->_value = g_fullpipe->getObjectEnumState(sO_EggGulper, sO_WantsNothing);
+ com->_value = g_fp->getObjectEnumState(sO_EggGulper, sO_WantsNothing);
}
}
}
@@ -194,11 +195,11 @@ int sceneHandler03(ExCommand *ex) {
switch (ex->_messageNum) {
case MSG_LIFT_EXITLIFT:
- g_fullpipe->lift_exitSeq(ex);
+ g_fp->lift_exitSeq(ex);
break;
case MSG_LIFT_CLOSEDOOR:
- g_fullpipe->lift_closedoorSeq();
+ g_fp->lift_closedoorSeq();
break;
case MSG_SC3_ONTAKECOIN:
@@ -206,7 +207,7 @@ int sceneHandler03(ExCommand *ex) {
break;
case MSG_LIFT_STARTEXITQUEUE:
- g_fullpipe->lift_startExitQueue();
+ g_fp->lift_startExitQueue();
break;
case MSG_SC3_RELEASEEGG:
@@ -214,7 +215,7 @@ int sceneHandler03(ExCommand *ex) {
break;
case MSG_LIFT_CLICKBUTTON:
- g_fullpipe->lift_animation3();
+ g_fp->lift_animation3();
break;
case MSG_SC3_HIDEDOMINO:
@@ -226,7 +227,7 @@ int sceneHandler03(ExCommand *ex) {
break;
case MSG_LIFT_GO:
- g_fullpipe->lift_goAnimation();
+ g_fp->lift_goAnimation();
break;
case MSG_SC3_UTRUBACLICK:
@@ -238,25 +239,25 @@ int sceneHandler03(ExCommand *ex) {
break;
case 64:
- g_fullpipe->lift_sub05(ex);
+ g_fp->lift_sub05(ex);
break;
- case 93:
+ case 29:
{
- StaticANIObject *ani = g_fullpipe->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
if (ani && ani->_id == ANI_LIFTBUTTON) {
- g_fullpipe->lift_sub1(ani);
+ g_fp->lift_sub1(ani);
ex->_messageKind = 0;
return 0;
}
- if (g_fullpipe->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY) == PIC_SC3_DOMIN) {
+ if (g_fp->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY) == PIC_SC3_DOMIN) {
if (g_vars->scene03_domino)
if (g_vars->scene03_domino->_flags & 4)
- if (g_fullpipe->_aniMan->isIdle())
- if (!(g_fullpipe->_aniMan->_flags & 0x100) && g_fullpipe->_msgObjectId2 != g_vars->scene03_domino->_id) {
- handleObjectInteraction(g_fullpipe->_aniMan, g_vars->scene03_domino, ex->_keyCode);
+ if (g_fp->_aniMan->isIdle())
+ if (!(g_fp->_aniMan->_flags & 0x100) && g_fp->_msgObjectId2 != g_vars->scene03_domino->_id) {
+ handleObjectInteraction(g_fp->_aniMan, g_vars->scene03_domino, ex->_keyCode);
ex->_messageKind = 0;
return 0;
@@ -266,23 +267,23 @@ int sceneHandler03(ExCommand *ex) {
break;
}
- case 97:
+ case 33:
{
int res = 0;
- if (g_fullpipe->_aniMan2) {
- if (g_fullpipe->_aniMan2->_ox < g_fullpipe->_sceneRect.left + 200)
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.left - 300;
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
- if (g_fullpipe->_aniMan2->_ox > g_fullpipe->_sceneRect.right - 200)
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan2->_ox - g_fullpipe->_sceneRect.right + 300;
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
res = 1;
}
- g_fullpipe->_behaviorManager->updateBehaviors();
+ g_fp->_behaviorManager->updateBehaviors();
- g_fullpipe->startSceneTrack();
+ g_fp->startSceneTrack();
return res;
}
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index 5e1454793f..332935072c 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -26,8 +26,9 @@
#include "fullpipe/constants.h"
#include "fullpipe/utils.h"
#include "fullpipe/gfx.h"
-#include "fullpipe/scenes.h"
#include "fullpipe/messages.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
#include "fullpipe/statics.h"
#include "fullpipe/scene.h"
#include "fullpipe/interaction.h"
@@ -36,12 +37,31 @@
namespace Fullpipe {
-void scene04_callback(int *param) {
- warning("STUB: scene04_callback");
+static const int scene04_speakerPhases[] = {
+ 0, 1, 2, 3, -1, -1,
+ 0, 2, 3, -1, -1, -1,
+ 0, 2, -1, -1, -1, -1
+};
+
+void scene04_speakerCallback(int *phase) {
+ if (g_vars->scene04_soundPlaying) {
+ if (g_vars->scene04_speakerPhase >= 0) {
+ *phase = scene04_speakerPhases[g_vars->scene04_speakerPhase + 6 * g_vars->scene04_speakerVariant];
+
+ g_vars->scene04_speakerPhase++;
+
+ if (scene04_speakerPhases[g_vars->scene04_speakerPhase + 6 * g_vars->scene04_speakerVariant] < 0) {
+ g_vars->scene04_speakerPhase = 0;
+ g_vars->scene04_speakerVariant = g_fp->_rnd->getRandomNumber(2);
+ }
+ } else {
+ ++g_vars->scene04_speakerPhase;
+ }
+ }
}
void scene04_initScene(Scene *sc) {
- g_vars->scene04_var01 = 0;
+ g_vars->scene04_dudeOnLadder = false;
g_vars->scene04_bottle = sc->getPictureObjectById(PIC_SC4_BOTTLE, 0);
g_vars->scene04_hand = sc->getStaticANIObject1ById(ANI_HAND, -1);
g_vars->scene04_plank = sc->getStaticANIObject1ById(ANI_PLANK, -1);
@@ -93,7 +113,7 @@ void scene04_initScene(Scene *sc) {
if (plank)
plank->_flags |= 8;
- if (g_fullpipe->getObjectState(sO_Jar_4) == g_fullpipe->getObjectEnumState(sO_Jar_4, sO_UpsideDown)) {
+ if (g_fp->getObjectState(sO_Jar_4) == g_fp->getObjectEnumState(sO_Jar_4, sO_UpsideDown)) {
g_vars->scene04_bottleObjList.clear();
g_vars->scene04_kozyawkiObjList.clear();
@@ -101,8 +121,8 @@ void scene04_initScene(Scene *sc) {
sc->getPictureObjectById(PIC_SC4_MASK, 0)->_flags &= 0xfffb;
sc->getStaticANIObject1ById(ANI_SPRING, 0)->_flags &= 0xfffb;
- g_vars->scene04_var18 = 0;
- g_vars->scene04_var19 = 0;
+ g_vars->scene04_clockCanGo = false;
+ g_vars->scene04_objectIsTaken = false;
} else {
StaticANIObject *spring = sc->getStaticANIObject1ById(ANI_SPRING, -1);
@@ -136,118 +156,364 @@ void scene04_initScene(Scene *sc) {
}
sc->getPictureObjectById(PIC_SC4_BOTTLE2, 0)->_flags &= 0xfffb;
- g_vars->scene04_var18 = 1;
- g_vars->scene04_var19 = 1;
+ g_vars->scene04_clockCanGo = true;
+ g_vars->scene04_objectIsTaken = true;
}
- g_vars->scene04_var02 = 0;
- g_vars->scene04_soundPlaying = 0;
- g_vars->scene04_var04 = 0;
- g_vars->scene04_var05 = 0;
- g_vars->scene04_var06 = 2;
+ g_vars->scene04_bottleIsTaken = false;
+ g_vars->scene04_soundPlaying = false;
+ g_vars->scene04_kozyawkaOnLadder = false;
+ g_vars->scene04_walkingKozyawka = 0;
+ g_vars->scene04_bottleWeight = 2;
g_vars->scene04_dynamicPhaseIndex = 0;
g_vars->scene04_kozyawkiAni.clear();
- g_fullpipe->setObjectState(sO_LowerPipe, g_fullpipe->getObjectEnumState(sO_LowerPipe, sO_IsClosed));
+ g_fp->setObjectState(sO_LowerPipe, g_fp->getObjectEnumState(sO_LowerPipe, sO_IsClosed));
- g_vars->scene04_var07 = 0;
- g_vars->scene04_var08 = 0;
- g_vars->scene04_coinPut = 0;
- g_vars->scene04_var09 = 0;
- g_vars->scene04_var10 = 0;
- g_vars->scene04_var11 = 0;
- g_vars->scene04_var12 = 0;
- g_vars->scene04_var13 = 1;
- g_vars->scene04_var14 = 0;
- g_vars->scene04_var15 = 1;
+ g_vars->scene04_var07 = false;
+ g_vars->scene04_ladderClickable = false;
+ g_vars->scene04_coinPut = false;
+ g_vars->scene04_handIsDown = false;
+ g_vars->scene04_dudeInBottle = false;
+ g_vars->scene04_kozHeadRaised = false;
+ g_vars->scene04_bottleIsDropped = false;
+ g_vars->scene04_bigBallIn = true;
+ g_vars->scene04_bigBallCounter = 0;
+ g_vars->scene04_bigBallFromLeft = true;
- if (g_fullpipe->getObjectState(sO_BigMumsy) != g_fullpipe->getObjectEnumState(sO_BigMumsy, sO_Gone))
+ if (g_fp->getObjectState(sO_BigMumsy) != g_fp->getObjectEnumState(sO_BigMumsy, sO_IsGone))
g_vars->scene04_mamasha->hide();
g_vars->scene04_speaker = sc->getStaticANIObject1ById(ANI_SPEAKER_4, -1);
- g_vars->scene04_speaker->_callback2 = scene04_callback;
+ g_vars->scene04_speaker->_callback2 = scene04_speakerCallback;
g_vars->scene04_speaker->startAnim(MV_SPK4_PLAY, 0, -1);
- g_vars->scene04_var16 = 0;
- g_vars->scene04_var17 = 0;
+ g_vars->scene04_speakerVariant = 0;
+ g_vars->scene04_speakerPhase = 0;
- g_fullpipe->initArcadeKeys("SC_4");
+ g_fp->initArcadeKeys("SC_4");
}
bool sceneHandler04_friesAreWalking() {
- warning("STUB: sceneHandler04_friesAreWalking()");
+ if (g_vars->scene04_dudeOnLadder && g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
+ int col = g_vars->scene04_ladder->collisionDetection(g_fp->_aniMan);
+ if (col >= 3 && col <= 6 ) {
+ Movement *koz;
+
+ if (!g_vars->scene04_walkingKozyawka
+ || (koz = g_vars->scene04_walkingKozyawka->_movement) == 0
+ || koz->_id != MV_KZW_WALKPLANK
+ || koz->_currDynamicPhaseIndex < 10
+ || koz->_currDynamicPhaseIndex > 41)
+ return true;
+ }
+ }
return false;
}
int scene04_updateCursor() {
- g_fullpipe->updateCursorCommon();
+ g_fp->updateCursorCommon();
- if (g_fullpipe->_objectIdAtCursor == PIC_SC4_LRTRUBA) {
- if (!g_vars->scene04_var19) {
- g_fullpipe->_cursorId = PIC_CSR_DEFAULT;
+ if (g_fp->_objectIdAtCursor == PIC_SC4_LRTRUBA) {
+ if (!g_vars->scene04_objectIsTaken) {
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
- return g_fullpipe->_cursorId;
+ return g_fp->_cursorId;
}
- } else if (g_fullpipe->_objectIdAtCursor == ANI_PLANK || g_fullpipe->_objectIdAtCursor == PIC_SC4_PLANK) {
- if (g_fullpipe->_objectIdAtCursor == ANI_PLANK && g_fullpipe->_cursorId != PIC_CSR_ITN)
- return g_fullpipe->_cursorId;
+ } else if (g_fp->_objectIdAtCursor == ANI_PLANK || g_fp->_objectIdAtCursor == PIC_SC4_PLANK) {
+ if (g_fp->_objectIdAtCursor == ANI_PLANK && g_fp->_cursorId != PIC_CSR_ITN)
+ return g_fp->_cursorId;
- if (g_fullpipe->_objectIdAtCursor == ANI_PLANK || (g_fullpipe->_objectIdAtCursor == PIC_SC4_PLANK && g_fullpipe->_cursorId == PIC_CSR_DEFAULT)) {
+ if (g_fp->_objectIdAtCursor == ANI_PLANK || (g_fp->_objectIdAtCursor == PIC_SC4_PLANK && g_fp->_cursorId == PIC_CSR_DEFAULT)) {
if (sceneHandler04_friesAreWalking()) {
- g_fullpipe->_cursorId = PIC_CSR_ARCADE1;
- return g_fullpipe->_cursorId;
+ g_fp->_cursorId = PIC_CSR_ARCADE1;
+ return g_fp->_cursorId;
}
if (g_vars->scene04_soundPlaying) {
- g_fullpipe->_cursorId = PIC_CSR_DEFAULT;
- return g_fullpipe->_cursorId;
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
+ return g_fp->_cursorId;
}
}
}
- if (g_fullpipe->_objectIdAtCursor == PIC_CSR_ITN && g_fullpipe->_objectIdAtCursor == PIC_SC4_DOWNTRUBA)
- g_fullpipe->_cursorId = PIC_CSR_GOD;
+ if (g_fp->_objectIdAtCursor == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC4_DOWNTRUBA)
+ g_fp->_cursorId = PIC_CSR_GOD;
- return g_fullpipe->_cursorId;
+ return g_fp->_cursorId;
}
-void sceneHandlers_sub01(ExCommand *ex) {
- warning("sceneHandlers_sub01()");
+void sceneHandler04_checkBigBallClick() {
+ StaticANIObject *ball = g_fp->_currentScene->getStaticANIObject1ById(ANI_BIGBALL, -1);
+
+ if (ball)
+ for (uint i = 0; i < ball->_movements.size(); i++)
+ ((Movement *)ball->_movements[i])->_counterMax = 73;
+
+ g_vars->scene04_bigBallIn = true;
}
void sceneHandler04_clickBottle() {
- if (!g_vars->scene04_var02)
- g_vars->scene04_var20 += 5;
+ if (!g_vars->scene04_bottleIsTaken)
+ g_vars->scene04_springOffset += 5;
}
void sceneHandler04_clickButton() {
- warning("sceneHandler04_clickButton()");
+ StaticANIObject *but = g_fp->_currentScene->getStaticANIObject1ById(ANI_BUTTON, -1);
+
+ if (but) {
+ if (!g_vars->scene04_clock->_movement ||
+ (g_vars->scene04_clock->_movement->_id == MV_CLK_GO && g_vars->scene04_clock->_movement->_currDynamicPhaseIndex > 3 &&
+ g_vars->scene04_clock->_movement->_currDynamicPhaseIndex < 105)) {
+ if (!g_vars->scene04_hand->_movement && !g_vars->scene04_bottleIsTaken) {
+ but->startAnim(MV_BTN_CLICK, 0, -1);
+ g_vars->scene04_hand->startAnim(MV_HND_POINT, 0, -1);
+ }
+ }
+ }
+}
+
+void sceneHandler04_downLadder(int x, int y) {
+ g_vars->scene04_ladder->method34(g_fp->_aniMan, x + g_vars->scene04_ladder->_ladder_field_20, y + g_vars->scene04_ladder->_ladder_field_24, 0, 0);
+}
+
+void sceneHandler04_walkClimbLadder(ExCommand *ex) {
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ ExCommand *ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_TOLADDER, 0, 0, 0, 1, 0, 0, 0);
+
+ ex1->_keyCode = g_fp->_aniMan->_okeyCode;
+ ex1->_excFlags |= 2;
+
+ mq->addExCommandToEnd(ex1);
+
+ ExCommand *ex2 = new ExCommand(ANI_MAN, 1, MV_MAN_STOPLADDER, 0, 0, 0, 1, 0, 0, 0);
+
+ ex2->_keyCode = g_fp->_aniMan->_okeyCode;
+ ex2->_excFlags |= 2;
+
+ mq->addExCommandToEnd(ex2);
+
+ ExCommand *ex3;
+
+ if (ex) {
+ ex3 = ex->createClone();
+ } else {
+ ex3 = new ExCommand(0, 17, MSG_SC4_CLICKLADDER, 0, 0, 0, 1, 0, 0, 0);
+ ex3->_excFlags |= 3;
+ }
+
+ mq->addExCommandToEnd(ex3);
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ mq->chain(0);
+
+ g_vars->scene04_dudeOnLadder = 1;
+
+ g_vars->scene04_ladder = new MctlLadder;
+ g_vars->scene04_ladder->_ladderX = 1089;
+ g_vars->scene04_ladder->_ladderY = 406;
+ g_vars->scene04_ladder->_ladder_field_14 = 12;
+ g_vars->scene04_ladder->_width = 0;
+ g_vars->scene04_ladder->_height = -40;
+ g_vars->scene04_ladder->_ladder_field_20 = 0;
+ g_vars->scene04_ladder->_ladder_field_24 = -60;
+
+ g_vars->scene04_ladder->addObject(g_fp->_aniMan);
+
+ if (g_vars->scene04_soundPlaying) {
+ g_vars->scene04_ladder->_movements.front()->movVars->varUpStart = MV_MAN_STARTLADDER2;
+ g_vars->scene04_ladder->_movements.front()->movVars->varUpGo = MV_MAN_GOLADDER2;
+ g_vars->scene04_ladder->_movements.front()->movVars->varUpStop = MV_MAN_STOPLADDER2;
+ g_vars->scene04_ladder->_movements.front()->staticIds[2] = ST_MAN_GOLADDER2;
+ } else {
+ g_vars->scene04_ladder->_movements.front()->movVars->varUpStart = MV_MAN_STARTLADDER;
+ g_vars->scene04_ladder->_movements.front()->movVars->varUpGo = MV_MAN_GOLADDER;
+ g_vars->scene04_ladder->_movements.front()->movVars->varUpStop = MV_MAN_STOPLADDER;
+ g_vars->scene04_ladder->_movements.front()->staticIds[2] = ST_MAN_GOLADDER;
+ }
+
+ g_fp->_aniMan->_priority = 12;
+
+ getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
}
void sceneHandler04_clickLadder() {
- warning("sceneHandler04_clickLadder()");
+ g_vars->scene04_dudePosX = g_fp->_aniMan->_ox;
+ g_vars->scene04_dudePosY = g_fp->_aniMan->_oy;
+
+ if (g_vars->scene04_dudeOnLadder) {
+ if (!g_fp->_aniMan->isIdle() || (g_fp->_aniMan->_flags & 0x100)) {
+ g_vars->scene04_ladderClickable = true;
+ } else {
+ int h3 = 3 * g_vars->scene04_ladder->_height;
+ int half = abs(g_vars->scene04_ladder->_height) / 2;
+ int start = g_vars->scene04_ladder->_ladderY - g_vars->scene04_ladder->_ladder_field_24;
+ int min = 2 * h3 + start + half + 1;
+ int max = h3 + start - half - 1;
+
+ if (g_vars->scene04_sceneClickY > max)
+ g_vars->scene04_sceneClickY = max;
+
+ if (g_vars->scene04_sceneClickY < min)
+ g_vars->scene04_sceneClickY = min;
+
+ sceneHandler04_downLadder(g_vars->scene04_sceneClickX, g_vars->scene04_sceneClickY);
+
+ g_vars->scene04_ladderClickable = false;
+ }
+ } else {
+ if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
+ if (abs(1095 - g_vars->scene04_dudePosX) > 1 || abs(434 - g_vars->scene04_dudePosY) > 1) {
+ MessageQueue *mq = getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->method34(g_fp->_aniMan, 1095, 434, 1, ST_MAN_UP);
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC4_CLICKLADDER, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags = 3;
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, 1095, 434, 0, -1);
+ }
+ } else {
+ sceneHandler04_walkClimbLadder(0);
+ }
+ }
+ }
}
-void sceneHandler04_sub13() {
- warning("sceneHandler04_sub13()");
+void sceneHandler04_jumpOnLadder() {
+ if (g_fp->_aniMan->_movement && g_fp->_aniMan->_movement->_id != MV_MAN_LOOKLADDER)
+ return;
+
+ if (g_fp->_aniMan->_statics->_staticsId != ST_MAN_STANDLADDER && g_fp->_aniMan->_statics->_staticsId != ST_MAN_LADDERDOWN)
+ return;
+
+ g_fp->_aniMan->changeStatics2(ST_MAN_LADDERDOWN);
+
+ g_fp->_aniMan->_flags |= 1;
+
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_MAN);
+
+ mgminfo.ani = g_fp->_aniMan;
+ mgminfo.staticsId2 = ST_MAN_ONPLANK;
+ mgminfo.x1 = 938;
+ mgminfo.y1 = 442;
+ mgminfo.field_1C = 10;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_MAN_JUMPONPLANK;
+
+ MessageQueue *mq = mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ mq->_flags |= 1;
+
+ if (!mq->chain(g_fp->_aniMan))
+ delete mq;
+
+ g_fp->_aniMan->_priority = 10;
+ }
+
+ g_vars->scene04_ladderOffset = g_vars->scene04_ladder->collisionDetection(g_fp->_aniMan);
}
void sceneHandler04_clickPlank() {
if (sceneHandler04_friesAreWalking())
- sceneHandler04_sub13();
- else if (g_vars->scene04_var01)
- g_fullpipe->playSound(SND_4_033, 0);
+ sceneHandler04_jumpOnLadder();
+ else if (g_vars->scene04_dudeOnLadder)
+ g_fp->playSound(SND_4_033, 0);
else if (!g_vars->scene04_soundPlaying)
chainQueue(QU_PNK_CLICK, 0);
}
void sceneHandler04_dropBottle() {
- warning("sceneHandler04_dropBottle()");
+ g_vars->scene04_bottleIsDropped = true;
+ g_vars->scene04_bottleY = 10;
+ g_vars->scene04_bottleWeight = 0;
+
+ while (g_vars->scene04_kozyawkiAni.size()) {
+ StaticANIObject *koz = g_vars->scene04_kozyawkiAni.front();
+ g_vars->scene04_kozyawkiAni.pop_front();
+
+ for (Common::List<GameObject *>::iterator it = g_vars->scene04_bottleObjList.begin(); it != g_vars->scene04_bottleObjList.end(); ++it)
+ if (*it == koz) {
+ g_vars->scene04_bottleObjList.erase(it);
+ break;
+ }
+
+ koz->queueMessageQueue(0);
+ koz->hide();
+
+ g_vars->scene04_kozyawkiObjList.push_back(koz);
+ }
+
+ g_vars->scene04_hand->changeStatics2(ST_HND_EMPTY);
+
+ g_vars->scene04_hand->setOXY(429, 21);
+ g_vars->scene04_hand->_priority = 15;
}
-void sceneHandler04_gotoLadder(int par) {
- warning("sceneHandler04_gotoLadder()");
+void sceneHandler04_gotoLadder(ExCommand *ex) {
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_MAN);
+
+ mgminfo.ani = g_fp->_aniMan;
+ mgminfo.staticsId2 = ST_MAN_UP;
+ mgminfo.x1 = 1095;
+ mgminfo.y1 = 434;
+ mgminfo.field_1C = 12;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_MAN_PLANKTOLADDER;
+
+ MessageQueue *mq = mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ mq->deleteExCommandByIndex(mq->getCount() - 1, 1);
+
+ ExCommand *ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_TOLADDER, 0, 0, 0, 1, 0, 0, 0);
+ ex1->_excFlags = 2;
+ ex1->_field_24 = 1;
+ ex1->_keyCode = -1;
+ mq->addExCommandToEnd(ex1);
+
+ ExCommand *ex2 = new ExCommand(ANI_MAN, 1, MV_MAN_STOPLADDER, 0, 0, 0, 1, 0, 0, 0);
+ ex2->_excFlags = 2;
+ ex2->_field_24 = 1;
+ ex2->_keyCode = -1;
+ mq->addExCommandToEnd(ex2);
+
+ ExCommand *ex3 = new ExCommand(g_fp->_aniMan->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);
+ ex3->_field_14 = 256;
+ ex3->_messageNum = 0;
+ ex3->_excFlags |= 3;
+ mq->addExCommandToEnd(ex3);
+
+ if (ex) {
+ ExCommand *ex4 = ex->createClone();
+
+ mq->addExCommandToEnd(ex4);
+ }
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ if (mq->chain(g_fp->_aniMan)) {
+ g_fp->_aniMan->_priority = 12;
+ g_fp->_aniMan->_flags |= 1;
+ } else {
+ delete mq;
+ }
+ }
+
+ g_vars->scene04_kozyawkaOnLadder = false;
}
void sceneHandler04_lowerPlank() {
@@ -255,27 +521,355 @@ void sceneHandler04_lowerPlank() {
}
void sceneHandler04_manFromBottle() {
- warning("sceneHandler04_manFromBottle()");
+ for (Common::List<GameObject *>::iterator it = g_vars->scene04_bottleObjList.begin(); it != g_vars->scene04_bottleObjList.end(); ++it)
+ if (*it == g_fp->_aniMan) {
+ g_vars->scene04_bottleObjList.erase(it);
+ g_vars->scene04_bottleWeight -= 9;
+ break;
+ }
+
+ if (g_vars->scene04_ladder)
+ delete g_vars->scene04_ladder;
+
+ g_vars->scene04_ladder = 0;
+
+ getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
}
void sceneHandler04_manToBottle() {
- g_vars->scene04_bottleObjList.push_back(g_fullpipe->_aniMan);
- g_vars->scene04_var20 = 5;
- g_vars->scene04_var06 += 9;
- g_fullpipe->_aniMan2 = g_fullpipe->_aniMan;
- g_vars->scene04_var10 = 1;
+ g_vars->scene04_bottleObjList.push_back(g_fp->_aniMan);
+ g_vars->scene04_springOffset = 5;
+ g_vars->scene04_bottleWeight += 9;
+ g_fp->_aniMan2 = g_fp->_aniMan;
+ g_vars->scene04_dudeInBottle = 1;
}
void sceneHandler04_raisePlank() {
g_vars->scene04_plank->startAnim(MV_PNK_WEIGHTLEFT, 0, -1);
}
+MessageQueue *sceneHandler04_kozFly3(StaticANIObject *ani, double phase) {
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_KOZAWKA);
+
+ mgminfo.ani = ani;
+ mgminfo.staticsId2 = ST_KZW_SIT;
+ mgminfo.x1 = (int)(723.0 - phase * 185.0);
+ mgminfo.y1 = 486;
+ mgminfo.field_1C = 10;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_KZW_JUMP;
+
+ MessageQueue *mq = mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ ExCommand *ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_STANDUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_TURN, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ for (int i = 0; i < 5; i++) {
+ ex = new ExCommand(ANI_KOZAWKA, 1, rMV_KZW_GOR, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+ }
+
+ ex = new ExCommand(ANI_KOZAWKA, 6, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 17, MSG_KOZAWRESTART, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+ }
+
+ return mq;
+}
+
+MessageQueue *sceneHandler04_kozFly5(StaticANIObject *ani, double phase) {
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_KOZAWKA);
+
+ mgminfo.ani = ani;
+ mgminfo.staticsId2 = ST_KZW_JUMPOUT;
+ mgminfo.x1 = 525;
+ mgminfo.y1 = (int)(344.0 - (double)(320 - g_vars->scene04_bottle->_oy) * phase);
+ mgminfo.field_1C = 10;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_KZW_JUMPHIT;
+
+ MessageQueue *mq1 = mgm.genMovement(&mgminfo);
+
+ memset(&mgminfo, 0, sizeof(mgminfo));
+ mgminfo.ani = ani;
+ mgminfo.staticsId1 = ST_KZW_JUMPOUT;
+ mgminfo.staticsId2 = ST_KZW_SIT;
+ mgminfo.x2 = 525;
+ mgminfo.y2 = (int)(344.0 - (double)(320 - g_vars->scene04_bottle->_oy) * phase);
+ mgminfo.y1 = 486;
+ mgminfo.field_1C = 10;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 117;
+ mgminfo.movementId = MV_KZW_JUMPOUT;
+
+ MessageQueue *mq2 = mgm.genMovement(&mgminfo);
+
+ if (mq1 && mq2) {
+ mq1->addExCommandToEnd(mq2->getExCommandByIndex(0)->createClone());
+
+ delete mq2;
+
+ ExCommand *ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_STANDUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq1->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_TURN, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq1->addExCommandToEnd(ex);
+
+ for (int i = 0; i < 5; i++) {
+ ex = new ExCommand(ANI_KOZAWKA, 1, rMV_KZW_GOR, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq1->addExCommandToEnd(ex);
+ }
+
+ ex = new ExCommand(ANI_KOZAWKA, 6, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+ mq1->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 17, MSG_KOZAWRESTART, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+ mq1->addExCommandToEnd(ex);
+ }
+
+ return mq1;
+}
+
+MessageQueue *sceneHandler04_kozFly6(StaticANIObject *ani) {
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_KOZAWKA);
+
+ mgminfo.ani = ani;
+ mgminfo.staticsId2 = ST_KZW_SIT;
+ mgminfo.x1 = 397 - 4 * g_fp->_rnd->getRandomNumber(1);
+ mgminfo.field_1C = ani->_priority;
+ mgminfo.y1 = g_vars->scene04_bottle->_oy - 4 * g_fp->_rnd->getRandomNumber(1) + 109;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_KZW_JUMPROTATE;
+
+ MessageQueue *mq = mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ mq->deleteExCommandByIndex(mq->getCount() - 1, 1);
+
+ ExCommand *ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_STANDUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_GOR, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_RAISEHEAD, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ g_vars->scene04_kozHeadRaised = true;
+ }
+
+ return mq;
+}
+
+void sceneHandler04_kozMove(Movement *mov, int from, int to, Common::Point *points, double phase) {
+ for (int i = from; i < to; i++) {
+ mov->setDynamicPhaseIndex(i);
+
+ Common::Point *p;
+ if (mov->_framePosOffsets) {
+ p = mov->_framePosOffsets[mov->_currDynamicPhaseIndex];
+ } else {
+ p = &mov->_somePoint;
+ p->x = 0;
+ p->y = 0;
+ }
+
+ p->y = (int)((double)points[i].y * phase);
+ }
+}
+
+MessageQueue *sceneHandler04_kozFly7(StaticANIObject *ani, double phase) {
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_KOZAWKA);
+
+ mgminfo.ani = ani;
+ mgminfo.staticsId2 = 560;
+ mgminfo.x1 = (int)(250.0 - phase * 100.0);
+ mgminfo.y1 = 455;
+ mgminfo.field_1C = 10;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_KZW_JUMPROTATE;
+
+ MessageQueue *mq = mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ sceneHandler04_kozMove(ani->getMovementById(MV_KZW_JUMPROTATE), 1, 9, g_vars->scene04_jumpRotateKozyawki, phase * 0.5 + 1.5);
+
+ ani->_priority = 10;
+
+ ExCommand *ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_STANDUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 1, MV_KZW_TURN, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ for (int i = 0; i < 2; i++) {
+ ex = new ExCommand(ANI_KOZAWKA, 1, rMV_KZW_GOR, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+ }
+
+ ex = new ExCommand(ANI_KOZAWKA, 6, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_KOZAWKA, 17, MSG_KOZAWRESTART, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+ mq->addExCommandToEnd(ex);
+ }
+
+ return mq;
+}
+
+static const int kozTrajectory3[] = {
+ 3, 2, 0,
+ 3, 2, 0,
+ 3, 2, 0
+};
+
+static const int kozTrajectory4[] = {
+ 5, 3, 1,
+ 5, 4, 1,
+ 5, 3, 1
+};
+
+static const int kozTrajectory5[] = {
+ 6, 5, 4,
+ 6, 5, 4,
+ 6, 5, 4
+};
+
+static const int kozTrajectory6[] = {
+ 7, 6, 5,
+ 7, 6, 5,
+ 7, 6, 5
+};
+
void sceneHandler04_shootKozyawka() {
- warning("sceneHandler04_shootKozyawka()");
+ g_vars->scene04_plank->changeStatics2(ST_PNK_WEIGHTRIGHT);
+
+ if (!g_vars->scene04_walkingKozyawka)
+ return;
+
+ if (g_vars->scene04_walkingKozyawka->_movement) {
+ if (g_vars->scene04_walkingKozyawka->_movement->_id == MV_KZW_WALKPLANK) {
+ int dphase = g_vars->scene04_walkingKozyawka->_movement->_currDynamicPhaseIndex;
+
+ if (dphase < 41) {
+ int col = 3 * dphase / 15;
+ if (col > 2)
+ col = 2;
+
+ int row = g_vars->scene04_kozyawkiAni.size();
+ if (row > 2)
+ row = 2;
+
+ int idx = 3 * row + col;
+ int phase;
+
+ if (g_vars->scene04_ladderOffset == 3) {
+ phase = kozTrajectory3[idx];
+ } else if (g_vars->scene04_ladderOffset == 4) {
+ phase = kozTrajectory4[idx];
+ } else {
+ if (g_vars->scene04_ladderOffset == 5)
+ phase = kozTrajectory5[idx];
+ else
+ phase = kozTrajectory6[idx];
+ }
+
+ g_vars->scene04_walkingKozyawka->queueMessageQueue(0);
+ g_vars->scene04_walkingKozyawka->_movement = 0;
+ g_vars->scene04_walkingKozyawka->_statics = g_vars->scene04_walkingKozyawka->getStaticsById(ST_KZW_RIGHT);
+
+ MessageQueue *mq;
+
+ if (phase > 2) {
+ if (phase > 5) {
+ if (phase == 6)
+ mq = sceneHandler04_kozFly6(g_vars->scene04_walkingKozyawka);
+ else
+ mq = sceneHandler04_kozFly7(g_vars->scene04_walkingKozyawka, (double)(phase - 6) * 0.3333333333333333);
+ } else {
+ mq = sceneHandler04_kozFly5(g_vars->scene04_walkingKozyawka, (double)(phase - 2) * 0.3333333333333333);
+ }
+ } else {
+ mq = sceneHandler04_kozFly3(g_vars->scene04_walkingKozyawka, (double)phase * 0.5);
+ }
+
+ if (mq) {
+ g_vars->scene04_lastKozyawka = g_vars->scene04_walkingKozyawka;
+
+ if (!mq->chain(g_vars->scene04_walkingKozyawka) )
+ delete mq;
+ }
+ }
+ }
+ }
+
+ if (g_vars->scene04_ladderOffset > 3)
+ g_fp->_aniMan->changeStatics1(ST_MAN_LOOKPLANK);
+
+ g_vars->scene04_kozyawkaOnLadder = true;
}
void sceneHandler04_showCoin() {
- StaticANIObject *ani = g_fullpipe->_currentScene->getStaticANIObject1ById(ANI_SC4_COIN, -1);
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_SC4_COIN, -1);
if (ani) {
ani->show1(MV_BDG_OPEN, MV_MAN_GOU, MV_SC4_COIN_default, 0);
@@ -285,67 +879,401 @@ void sceneHandler04_showCoin() {
}
void sceneHandler04_stopSound() {
- warning("sceneHandler04_stopSound()");
+ g_vars->scene04_soundPlaying = false;
+
+ warning("STUB: sceneHandler04_stopSound()");
}
-void sceneHandler04_sub1(ExCommand *ex) {
- warning("sceneHandler04_sub1()");
+void sceneHandler04_animOutOfBottle(ExCommand *ex) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_SIT);
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC4_MANFROMBOTTLE), 0, 0);
+
+ if (ex) {
+ ExCommand *newex = ex->createClone();
+
+ mq->addExCommandToEnd(newex);
+ }
+
+ mq->_flags |= 1;
+ mq->chain(0);
+
+ g_vars->scene04_dudeInBottle = false;
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+}
+
+void sceneHandler04_walkKozyawka() {
+ if (g_vars->scene04_kozyawkiObjList.size()) {
+ g_vars->scene04_walkingKozyawka = g_vars->scene04_kozyawkiObjList.front();
+ g_vars->scene04_kozyawkiObjList.pop_front();
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_KOZAW_WALK), 0, 1);
+ mq->replaceKeyCode(-1, g_vars->scene04_walkingKozyawka->_okeyCode);
+ mq->chain(0);
+ }
+}
+
+void sceneHandler04_bottleUpdateObjects(int off) {
+ for (Common::List<GameObject *>::iterator it = g_vars->scene04_bottleObjList.begin(); it != g_vars->scene04_bottleObjList.end(); ++it) {
+ GameObject *obj = *it;
+
+ obj->setOXY(obj->_ox, off + obj->_oy);
+ }
+}
+
+void sceneHandler04_springWobble() {
+ int oldDynIndex = g_vars->scene04_dynamicPhaseIndex;
+ int newdelta = g_vars->scene04_springOffset + g_vars->scene04_dynamicPhaseIndex;
+
+ g_vars->scene04_dynamicPhaseIndex += g_vars->scene04_springOffset;
+
+ if (newdelta < 0) {
+ newdelta = 0;
+ g_vars->scene04_dynamicPhaseIndex = 0;
+ g_vars->scene04_springOffset = 0;
+ }
+
+ if (newdelta > 14) {
+ newdelta = 14;
+ g_vars->scene04_dynamicPhaseIndex = 14;
+ g_vars->scene04_springOffset = 0;
+ }
+
+ if (g_vars->scene04_bottleWeight > newdelta)
+ g_vars->scene04_springOffset++;
+
+ if (g_vars->scene04_bottleWeight < newdelta)
+ g_vars->scene04_springOffset--;
+
+ if ((oldDynIndex > g_vars->scene04_bottleWeight && newdelta > g_vars->scene04_bottleWeight) || newdelta <= g_vars->scene04_bottleWeight) {
+ g_vars->scene04_springDelay++;
+
+ if (g_vars->scene04_springOffset && g_vars->scene04_springDelay > 1) {
+ g_vars->scene04_springDelay = 0;
+ g_vars->scene04_springOffset = g_vars->scene04_springOffset - g_vars->scene04_springOffset / abs(g_vars->scene04_springOffset);
+ }
+ }
+
+ Common::Point point;
+
+ if (g_vars->scene04_dynamicPhaseIndex) {
+ if (!g_vars->scene04_spring->_movement)
+ g_vars->scene04_spring->startAnim(MV_SPR_LOWER, 0, -1);
+
+ g_vars->scene04_spring->_movement->setDynamicPhaseIndex(g_vars->scene04_dynamicPhaseIndex);
+ } else {
+ g_vars->scene04_spring->changeStatics2(ST_SPR_UP);
+ }
+
+ if (g_vars->scene04_dynamicPhaseIndex != oldDynIndex)
+ sceneHandler04_bottleUpdateObjects(oldDynIndex - g_vars->scene04_dynamicPhaseIndex);
}
-void sceneHandler04_sub3() {
- warning("sceneHandler04_sub3()");
+void sceneHandler04_leaveScene() {
+ g_fp->_aniMan2 = 0;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC4_MANTOBOTTLE), 0, 0);
+ ExCommand *ex = 0;
+
+ for (uint i = 0; i < mq->getCount(); i++) {
+ if (mq->getExCommandByIndex(i)->_messageKind == 27) {
+ ex = mq->getExCommandByIndex(i);
+ break;
+ }
+ }
+
+ if (!ex) {
+ error("sceneHandler04_leaveScene(): Cannot find exit");
+ }
+
+ ex->_y = g_vars->scene04_bottle->_oy - 304;
+
+ mq->chain(0);
+
+ g_vars->scene04_var07 = false;
+ g_vars->scene04_dudeOnLadder = 0;
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+
+ g_fp->updateMapPiece(PIC_MAP_P03, 1);
}
-void sceneHandler04_sub4() {
- warning("sceneHandler04_sub4()");
+void sceneHandler04_liftBottle() {
+ int newy = g_vars->scene04_bottleY + g_vars->scene04_spring->_oy;
+
+ g_vars->scene04_bottleY += 5;
+
+ sceneHandler04_bottleUpdateObjects(newy - g_vars->scene04_spring->_oy);
+
+ g_vars->scene04_spring->setOXY(g_vars->scene04_spring->_ox, newy);
+
+ if (g_vars->scene04_bottle->_oy >= 226) {
+ sceneHandler04_bottleUpdateObjects(226 - g_vars->scene04_bottle->_oy);
+
+ g_vars->scene04_spring->setOXY(g_vars->scene04_spring->_ox, 437);
+ g_vars->scene04_bottleIsDropped = false;
+ g_vars->scene04_handIsDown = false;
+ g_vars->scene04_objectIsTaken = true;
+ g_vars->scene04_bottleWeight = 2;
+ g_vars->scene04_springOffset = 10;
+ g_vars->scene04_bottleIsTaken = false;
+
+ g_fp->setObjectState(sO_LowerPipe, g_fp->getObjectEnumState(sO_LowerPipe, sO_IsClosed));
+ }
}
-void sceneHandler04_sub5() {
- warning("sceneHandler04_sub5()");
+void sceneHandler04_startSounds(const char *snd1, const char *snd2, const char *snd3) {
+ warning("STUB: sceneHandler04_startSounds()");
+
+ // playFile(snd1);
+ // playFile(snd2);
+ // playFile(snd3);
}
-void sceneHandler04_sub6() {
- warning("sceneHandler04_sub6()");
+void sceneHandler04_goClock() {
+ sceneHandler04_walkKozyawka();
+ chainQueue(QU_SC4_GOCLOCK, 0);
+ g_vars->scene04_soundPlaying = true;
+ g_vars->scene04_coinPut = false;
+
+ g_fp->stopAllSoundStreams();
+
+ sceneHandler04_startSounds("sc4_start.ogg", "sc4_loop.ogg", "sc4_stop2.ogg");
+
+ g_vars->scene04_bigBallCounter = 0;
}
-void sceneHandler04_sub7() {
- warning("sceneHandler04_sub7()");
+void sceneHandler04_bigBallOut() {
+ StaticANIObject *ball = g_fp->_currentScene->getStaticANIObject1ById(ANI_BIGBALL, -1);
+
+ if (ball && ball->_flags & 4)
+ for (uint i = 0; i < ball->_movements.size(); i++)
+ ((Movement *)ball->_movements[i])->_counterMax = 0;
+
+ g_vars->scene04_bigBallIn = false;
}
-void sceneHandler04_sub8(ExCommand *ex) {
- warning("sceneHandler04_sub8()");
+void sceneHandler04_leaveLadder(ExCommand *ex) {
+ if (!g_fp->_aniMan->isIdle())
+ return;
+
+ if (!(g_fp->_aniMan->_flags & 0x100)) {
+ if (getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->_objtype == kObjTypeMctlCompound) {
+ MctlCompound *mc = (MctlCompound *)getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId);
+
+ if (mc->_motionControllers[0]->_movGraphReactObj->pointInRegion(g_fp->_sceneRect.left + ex->_x, g_fp->_sceneRect.top + ex->_y)) {
+ if (g_vars->scene04_ladder->collisionDetection(g_fp->_aniMan)) {
+ MessageQueue *mq = g_vars->scene04_ladder->controllerWalkTo(g_fp->_aniMan, 0);
+
+ if (mq) {
+ mq->addExCommandToEnd(ex->createClone());
+
+ if (mq->chain(g_fp->_aniMan) )
+ ex->_messageKind = 0;
+ else
+ delete mq;
+
+ if (g_vars->scene04_bigBallIn) {
+ sceneHandler04_bigBallOut();
+ return;
+ }
+ }
+ } else {
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand *ex1;
+
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN_LADDERDOWN) {
+ ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_LOOKLADDERRV, 0, 0, 0, 1, 0, 0, 0);
+ ex1->_keyCode = g_fp->_aniMan->_okeyCode;
+ ex1->_excFlags |= 2;
+ mq->addExCommandToEnd(ex1);
+ }
+
+ ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_STARTLADDERD, 0, 0, 0, 1, 0, 0, 0);
+ ex1->_keyCode = g_fp->_aniMan->_okeyCode;
+ ex1->_excFlags |= 2;
+ mq->addExCommandToEnd(ex1);
+
+ ex1 = new ExCommand(ANI_MAN, 1, MV_MAN_FROMLADDER, 0, 0, 0, 1, 0, 0, 0);
+ ex1->_keyCode = g_fp->_aniMan->_okeyCode;
+ ex1->_excFlags |= 2;
+ mq->addExCommandToEnd(ex1);
+
+ ex1 = ex->createClone();
+ mq->addExCommandToEnd(ex1);
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ if (mq->chain(g_fp->_aniMan)) {
+ if (g_vars->scene04_ladder)
+ delete g_vars->scene04_ladder;
+
+ g_vars->scene04_ladder = 0;
+ g_vars->scene04_dudeOnLadder = 0;
+
+ ex->_messageKind = 0;
+
+ mc->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+ } else {
+ delete mq;
+ }
+
+ if (g_vars->scene04_bigBallIn) {
+ sceneHandler04_bigBallOut();
+ return;
+ }
+ }
+ }
+ }
+ }
}
-void sceneHandler04_sub9(StaticANIObject *ani) {
- warning("sceneHandler04_sub9()");
+void sceneHandler04_handTake() {
+ g_vars->scene04_clock->changeStatics2(ST_CLK_CLOSED);
+
+ if (g_vars->scene04_kozyawkiAni.size()) {
+ if (g_vars->scene04_kozyawkiAni.size() == 1) {
+ chainQueue(QU_HND_TAKE1, 0);
+ g_vars->scene04_objectIsTaken = false;
+ } else {
+ chainQueue((g_vars->scene04_kozyawkiAni.size() != 2) ? QU_HND_TAKEBOTTLE : QU_HND_TAKE2, 0);
+ g_vars->scene04_objectIsTaken = false;
+ }
+ } else {
+ chainQueue(QU_HND_TAKE0, 0);
+ g_vars->scene04_objectIsTaken = false;
+ }
}
-void sceneHandler04_sub15() {
- warning("sceneHandler04_sub15()");
+void sceneHandler04_putKozyawkaBack(StaticANIObject *ani) {
+ g_vars->scene04_bottleObjList.push_back(ani);
+ g_vars->scene04_kozyawkiAni.push_back(ani);
+
+ g_vars->scene04_bottleWeight += 2;
+ g_vars->scene04_walkingKozyawka = 0;
+ g_vars->scene04_lastKozyawka = 0;
+
+ if (g_vars->scene04_kozyawkiAni.size() > 1 )
+ g_vars->scene04_objectIsTaken = false;
+
+ if (g_vars->scene04_kozyawkiAni.size() <= 2 || g_vars->scene04_hand->_movement) {
+ sceneHandler04_walkKozyawka();
+ } else {
+ sceneHandler04_handTake();
+ sceneHandler04_stopSound();
+ }
}
-void sceneHandler04_sub17() {
- warning("sceneHandler04_sub17()");
+void sceneHandler04_bigBallWalkIn() {
+ StaticANIObject *ball = g_fp->_currentScene->getStaticANIObject1ById(ANI_BIGBALL, -1);
+
+ if (g_vars->scene04_dudeOnLadder
+ && (!ball || !(ball->_flags & 4))
+ && g_vars->scene04_ladder->collisionDetection(g_fp->_aniMan) > 3) {
+
+ if (!g_fp->_rnd->getRandomNumber(49)) {
+ if (g_vars->scene04_bigBallFromLeft)
+ chainQueue(QU_BALL_WALKR, 0);
+ else
+ chainQueue(QU_BALL_WALKL, 0);
+
+ g_vars->scene04_bigBallFromLeft = !g_vars->scene04_bigBallFromLeft;
+
+ sceneHandler04_checkBigBallClick();
+
+ g_vars->scene04_bigBallCounter = 0;
+ }
+ }
}
void sceneHandler04_takeBottle() {
- warning("sceneHandler04_takeBottle()");
+ g_vars->scene04_bottleIsTaken = true;
+ g_vars->scene04_hand->_priority = 5;
+
+ g_fp->setObjectState(sO_LowerPipe, g_fp->getObjectEnumState(sO_LowerPipe, sO_IsOpened));
}
void sceneHandler04_takeKozyawka() {
- warning("sceneHandler04_takeKozyawka()");
+ if (g_vars->scene04_kozyawkiAni.size() > 0) {
+ if (g_vars->scene04_kozyawkiAni.size() == 1)
+ g_vars->scene04_objectIsTaken = true;
+
+ StaticANIObject *koz = g_vars->scene04_kozyawkiAni.front();
+ g_vars->scene04_kozyawkiAni.pop_front();
+
+ if (koz) {
+ koz->queueMessageQueue(0);
+ koz->hide();
+
+ g_vars->scene04_kozyawkiObjList.push_back(koz);
+
+ for (Common::List<GameObject *>::iterator it = g_vars->scene04_bottleObjList.begin(); it != g_vars->scene04_bottleObjList.end(); ++it)
+ if (*it == koz) {
+ g_vars->scene04_bottleObjList.erase(it);
+ break;
+ }
+
+ g_vars->scene04_bottleWeight -= 2;
+ }
+ }
}
void sceneHandler04_testPlank(ExCommand *ex) {
- warning("sceneHandler04_testPlank()");
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(ex->_parId);
+
+ if (!mq)
+ return;
+
+ if (g_vars->scene04_plank->_movement || !g_vars->scene04_plank->_statics || g_vars->scene04_plank->_statics->_staticsId != ST_PNK_WEIGHTLEFT) {
+ mq->getExCommandByIndex(0)->_messageNum = MV_KZW_TOHOLERV;
+ } else {
+ mq->getExCommandByIndex(0)->_messageNum = MV_KZW_WALKPLANK;
+ }
}
void sceneHandler04_updateBottle() {
- warning("sceneHandler04_updateBottle()");
+ Common::Point point;
+
+ int yoff;
+
+ if (g_vars->scene04_hand->_movement)
+ yoff = g_vars->scene04_hand->_movement->_oy;
+ else
+ yoff = g_vars->scene04_hand->_oy;
+
+ int newy = g_vars->scene04_hand->getSomeXY(point)->y + yoff + 140;
+
+ sceneHandler04_bottleUpdateObjects(newy - g_vars->scene04_spring->_oy);
+
+ g_vars->scene04_spring->setOXY(g_vars->scene04_spring->_ox, newy);
}
void sceneHandler04_winArcade() {
- warning("sceneHandler04_winArcade()");
+ if (g_fp->getObjectState(sO_LowerPipe) == g_fp->getObjectEnumState(sO_LowerPipe, sO_IsClosed)
+ && g_vars->scene04_soundPlaying) {
+ g_vars->scene04_clock->changeStatics2(ST_CLK_CLOSED);
+ g_vars->scene04_hand->changeStatics2(ST_HND_EMPTY);
+
+ chainQueue(QU_HND_TAKEBOTTLE, 1);
+
+ if (g_vars->scene04_walkingKozyawka) {
+ g_vars->scene04_kozyawkiObjList.push_back(g_vars->scene04_walkingKozyawka);
+
+ g_vars->scene04_walkingKozyawka->changeStatics2(ST_KZW_EMPTY);
+ g_vars->scene04_walkingKozyawka->hide();
+ g_vars->scene04_walkingKozyawka = 0;
+ }
+
+ g_vars->scene04_objectIsTaken = false;
+ g_vars->scene04_soundPlaying = false;
+
+ getSc2MctlCompoundBySceneId(g_fp->_currentScene->_sceneId)->setEnabled();
+
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_fp->stopSoundStream2();
+ }
}
int sceneHandler04(ExCommand *ex) {
@@ -366,18 +1294,18 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_SHAKEBOTTLE:
- if (!g_vars->scene04_var02)
- ++g_vars->scene04_var20;
+ if (!g_vars->scene04_bottleIsTaken)
+ ++g_vars->scene04_springOffset;
break;
case MSG_STARTHAND:
- g_vars->scene04_var09 = 1;
- g_vars->scene04_coinPut = 0;
+ g_vars->scene04_handIsDown = true;
+ g_vars->scene04_coinPut = false;
- if (g_vars->scene04_var10)
- sceneHandler04_sub1(0);
+ if (g_vars->scene04_dudeInBottle)
+ sceneHandler04_animOutOfBottle(0);
- sceneHandler04_sub15();
+ sceneHandler04_handTake();
sceneHandler04_stopSound();
break;
@@ -398,13 +1326,14 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_KOZAWRESTART:
- if (g_vars->scene04_var05) {
- g_vars->scene04_kozyawkiObjList.push_back(g_vars->scene04_var05);
- g_vars->scene04_var05->hide();
- g_vars->scene04_var05 = 0;
+ if (g_vars->scene04_walkingKozyawka) {
+ g_vars->scene04_kozyawkiObjList.push_back(g_vars->scene04_walkingKozyawka);
+ g_vars->scene04_walkingKozyawka->hide();
+ g_vars->scene04_walkingKozyawka = 0;
}
+
if (g_vars->scene04_soundPlaying)
- sceneHandler04_sub3();
+ sceneHandler04_walkKozyawka();
break;
@@ -418,93 +1347,93 @@ int sceneHandler04(ExCommand *ex) {
case 33:
{
- g_vars->scene04_dudePosX = g_fullpipe->_aniMan->_ox;
- g_vars->scene04_dudePosY = g_fullpipe->_aniMan->_oy;
+ g_vars->scene04_dudePosX = g_fp->_aniMan->_ox;
+ g_vars->scene04_dudePosY = g_fp->_aniMan->_oy;
int res = 0;
- if (g_fullpipe->_aniMan2) {
- if (g_fullpipe->_aniMan->_ox < g_fullpipe->_sceneRect.left + 200) {
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan->_ox - g_fullpipe->_sceneRect.left - 300;
- g_fullpipe->_aniMan->_ox = g_vars->scene04_dudePosX;
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan->_ox < g_fp->_sceneRect.left + 200) {
+ g_fp->_currentScene->_x = g_fp->_aniMan->_ox - g_fp->_sceneRect.left - 300;
+ g_fp->_aniMan->_ox = g_vars->scene04_dudePosX;
}
- if (g_fullpipe->_aniMan->_ox > g_fullpipe->_sceneRect.right - 200) {
- g_fullpipe->_currentScene->_x = g_fullpipe->_aniMan->_ox - g_fullpipe->_sceneRect.right + 300;
+ if (g_fp->_aniMan->_ox > g_fp->_sceneRect.right - 200) {
+ g_fp->_currentScene->_x = g_fp->_aniMan->_ox - g_fp->_sceneRect.right + 300;
}
res = 1;
if (g_vars->scene04_soundPlaying) {
- if (g_fullpipe->_aniMan->_movement) {
- if (g_fullpipe->_aniMan->_movement->_id == MV_MAN_TOLADDER) {
- g_fullpipe->_aniMan2 = 0;
+ if (g_fp->_aniMan->_movement) {
+ if (g_fp->_aniMan->_movement->_id == MV_MAN_TOLADDER) {
+ g_fp->_aniMan2 = 0;
- if (g_fullpipe->_sceneRect.left > 380)
- g_fullpipe->_currentScene->_x = 380 - g_fullpipe->_sceneRect.left;
+ if (g_fp->_sceneRect.left > 380)
+ g_fp->_currentScene->_x = 380 - g_fp->_sceneRect.left;
}
}
}
} else {
- if (g_fullpipe->_aniMan->_movement && g_fullpipe->_aniMan->_movement->_id == MV_MAN_GOD)
- g_fullpipe->_aniMan2 = g_fullpipe->_aniMan;
+ if (g_fp->_aniMan->_movement && g_fp->_aniMan->_movement->_id == MV_MAN_GOD)
+ g_fp->_aniMan2 = g_fp->_aniMan;
}
- sceneHandler04_sub4();
+ sceneHandler04_springWobble();
- if (g_vars->scene04_var07 && !g_vars->scene04_var09)
- sceneHandler04_sub5();
+ if (g_vars->scene04_var07 && !g_vars->scene04_handIsDown)
+ sceneHandler04_leaveScene();
- if (g_vars->scene04_var12)
- sceneHandler04_sub6();
+ if (g_vars->scene04_bottleIsDropped)
+ sceneHandler04_liftBottle();
- if (g_vars->scene04_var08)
+ if (g_vars->scene04_ladderClickable)
sceneHandler04_clickLadder();
- if (g_vars->scene04_var10 && g_vars->scene04_hand->_movement)
- sceneHandler04_sub1(0);
+ if (g_vars->scene04_dudeInBottle && g_vars->scene04_hand->_movement)
+ sceneHandler04_animOutOfBottle(0);
- if (g_vars->scene04_coinPut && g_vars->scene04_var18 && !g_vars->scene04_var09 && !g_vars->scene04_soundPlaying)
- sceneHandler04_sub7();
+ if (g_vars->scene04_coinPut && g_vars->scene04_clockCanGo && !g_vars->scene04_handIsDown && !g_vars->scene04_soundPlaying)
+ sceneHandler04_goClock();
- if (g_vars->scene04_var01) {
+ if (g_vars->scene04_dudeOnLadder) {
if (!g_vars->scene04_soundPlaying) {
- g_fullpipe->startSceneTrack();
+ g_fp->startSceneTrack();
- g_fullpipe->_behaviorManager->updateBehaviors();
+ g_fp->_behaviorManager->updateBehaviors();
return res;
}
- g_vars->scene04_var14++;
+ g_vars->scene04_bigBallCounter++;
- if (g_vars->scene04_var14 > 600)
- sceneHandler04_sub17();
+ if (g_vars->scene04_bigBallCounter > 600)
+ sceneHandler04_bigBallWalkIn();
}
if (g_vars->scene04_soundPlaying) {
- g_fullpipe->_behaviorManager->updateBehaviors();
+ g_fp->_behaviorManager->updateBehaviors();
return res;
}
- g_fullpipe->startSceneTrack();
+ g_fp->startSceneTrack();
- g_fullpipe->_behaviorManager->updateBehaviors();
+ g_fp->_behaviorManager->updateBehaviors();
return res;
}
case 29:
{
- int picid = g_fullpipe->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY);
+ int picid = g_fp->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY);
- if (g_vars->scene04_var10) {
- sceneHandler04_sub1(ex);
+ if (g_vars->scene04_dudeInBottle) {
+ sceneHandler04_animOutOfBottle(ex);
break;
}
if (picid == PIC_SC4_LADDER) {
- if (!g_vars->scene04_var04) {
+ if (!g_vars->scene04_kozyawkaOnLadder) {
g_vars->scene04_sceneClickX = ex->_sceneClickX;
g_vars->scene04_sceneClickY = ex->_sceneClickY;
@@ -520,21 +1449,21 @@ int sceneHandler04(ExCommand *ex) {
break;
}
- StaticANIObject *ani = g_fullpipe->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
if ((ani && ani->_id == ANI_PLANK) || picid == PIC_SC4_PLANK) {
sceneHandler04_clickPlank();
ex->_messageKind = 0;
- } else if (g_vars->scene04_var01) {
- sceneHandler04_sub8(ex);
- } else if (!ani || !canInteractAny(g_fullpipe->_aniMan, ani, ex->_keyCode)) {
- PictureObject *pic = g_fullpipe->_currentScene->getPictureObjectById(picid, 0);
-
- if (!pic || !canInteractAny(g_fullpipe->_aniMan, pic,ex->_keyCode)) {
- if ((g_fullpipe->_sceneRect.right - ex->_sceneClickX < 47 && g_fullpipe->_sceneRect.right < g_fullpipe->_sceneWidth - 1)
- || (ex->_sceneClickX - g_fullpipe->_sceneRect.left < 47 && g_fullpipe->_sceneRect.left > 0))
- sceneHandlers_sub01(ex);
+ } else if (g_vars->scene04_dudeOnLadder) {
+ sceneHandler04_leaveLadder(ex);
+ } else if (!ani || !canInteractAny(g_fp->_aniMan, ani, ex->_keyCode)) {
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picid, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic,ex->_keyCode)) {
+ if ((g_fp->_sceneRect.right - ex->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (ex->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
+ g_fp->processArcade(ex);
}
}
}
@@ -550,8 +1479,8 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_SC4_HANDOVER:
- g_vars->scene04_var09 = 0;
- g_vars->scene04_var19 = 1;
+ g_vars->scene04_handIsDown = false;
+ g_vars->scene04_objectIsTaken = true;
break;
case MSG_SC4_DROPBOTTLE:
@@ -560,16 +1489,16 @@ int sceneHandler04(ExCommand *ex) {
case MSG_SC4_COINOUT:
g_vars->scene04_clock->changeStatics2(ST_CLK_CLOSED);
- g_vars->scene04_coinPut = 0;
+ g_vars->scene04_coinPut = false;
sceneHandler04_stopSound();
- if (g_vars->scene04_kozyawkiAni.size() && !g_vars->scene04_var02) {
- g_vars->scene04_var09 = 1;
+ if (g_vars->scene04_kozyawkiAni.size() && !g_vars->scene04_bottleIsTaken) {
+ g_vars->scene04_handIsDown = true;
- if (g_vars->scene04_var10)
- sceneHandler04_sub1(0);
+ if (g_vars->scene04_dudeInBottle)
+ sceneHandler04_animOutOfBottle(0);
- sceneHandler04_sub15();
+ sceneHandler04_handTake();
}
break;
@@ -578,10 +1507,10 @@ int sceneHandler04(ExCommand *ex) {
{
ExCommand *exnew;
- if (g_vars->scene04_var11) {
- sceneHandler04_sub9(g_vars->scene04_var24);
+ if (g_vars->scene04_kozHeadRaised) {
+ sceneHandler04_putKozyawkaBack(g_vars->scene04_lastKozyawka);
- g_vars->scene04_var11 = 0;
+ g_vars->scene04_kozHeadRaised = 0;
exnew = new ExCommand(0, 35, SND_4_010, 0, 0, 0, 1, 0, 0, 0);
} else {
@@ -619,7 +1548,7 @@ int sceneHandler04(ExCommand *ex) {
break;
case MSG_SC4_COINPUT:
- g_vars->scene04_coinPut = 1;
+ g_vars->scene04_coinPut = true;
break;
}
diff --git a/engines/fullpipe/scenes/scene05.cpp b/engines/fullpipe/scenes/scene05.cpp
new file mode 100644
index 0000000000..c6e21daf1e
--- /dev/null
+++ b/engines/fullpipe/scenes/scene05.cpp
@@ -0,0 +1,386 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objects.h"
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/messages.h"
+#include "fullpipe/floaters.h"
+#include "fullpipe/behavior.h"
+
+namespace Fullpipe {
+
+void scene05_initScene(Scene *sc) {
+ g_vars->scene05_handle = sc->getStaticANIObject1ById(ANI_HANDLE, -1);
+ g_vars->scene05_wacko = sc->getStaticANIObject1ById(ANI_OTMOROZ, -1);
+ g_vars->scene05_bigHatch = sc->getStaticANIObject1ById(ANI_BIGLUK, -1);
+
+
+ g_vars->scene05_wackoTicker = 0;
+ g_vars->scene05_handleFlipper = 1;
+ g_vars->scene05_floatersTicker = 1000;
+
+ Scene *oldscene = g_fp->_currentScene;
+
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_WeirdWacko) == g_fp->getObjectEnumState(sO_WeirdWacko, sO_InGlasses)) {
+ g_vars->scene05_wacko->changeStatics2(ST_OTM_GLS_LEFT);
+ g_vars->scene05_bigHatch->changeStatics2(ST_BLK_CLOSED);
+
+ g_vars->scene05_handle->changeStatics2(ST_HDL_UP);
+ g_vars->scene05_handle->_flags |= 4;
+ } else if (g_fp->getObjectState(sO_WeirdWacko) == g_fp->getObjectEnumState(sO_WeirdWacko, sO_WithDrawer)) {
+ g_vars->scene05_wacko->changeStatics2(ST_OTM_BOX_LEFT);
+ g_vars->scene05_bigHatch->changeStatics2(ST_BLK_CLOSED);
+ g_vars->scene05_handle->changeStatics2(ST_HDL_UP);
+ g_vars->scene05_handle->_flags |= 4;
+ } else {
+ g_vars->scene05_wacko->changeStatics2(ST_OTM_VNT_LEFT);
+
+ if (g_fp->getObjectState(sO_WeirdWacko) != g_fp->getObjectEnumState(sO_WeirdWacko, sO_WithPlunger)) {
+ g_vars->scene05_handle->changeStatics2(ST_HDL_BROKEN);
+ g_vars->scene05_bigHatch->changeStatics2(ST_BLK_CLOSED);
+ }
+ }
+
+ g_fp->_currentScene = oldscene;
+}
+
+void sceneHandler05_makeManFlight() {
+ int qid;
+
+ if (!g_vars->scene05_bigHatch->_statics || g_vars->scene05_bigHatch->_statics->_staticsId != ST_BLK_OPEN)
+ qid = QU_SC5_MANBUMP;
+ else
+ qid = QU_SC5_MANFLY;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(qid), 0, 0);
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ mq->chain(0);
+}
+
+void sceneHandler05_makeWackoFeedback() {
+ int staticsId1;
+ int staticsId2;
+
+ if (g_fp->getObjectState(sO_WeirdWacko) == g_fp->getObjectEnumState(sO_WeirdWacko, sO_InGlasses)) {
+ staticsId1 = ST_OTM_GLS_LEFT;
+ staticsId2 = (g_vars->scene05_handle->_statics->_staticsId == ST_HDL_DOWN) ? MV_OTM_HANDLEUP : MV_OTM_HANDLEDOWN;
+ } else if (g_fp->getObjectState(sO_WeirdWacko) != g_fp->getObjectEnumState(sO_WeirdWacko, sO_WithDrawer)) {
+ return;
+ } else {
+ staticsId1 = ST_OTM_BOX_LEFT;
+ staticsId2 = (g_vars->scene05_handle->_statics->_staticsId == ST_HDL_DOWN) ? MV_OTM_BOXHANDLEUP : MV_OTM_BOXHANDLEDOWN;
+ }
+
+ if (g_vars->scene05_wacko->_movement)
+ g_vars->scene05_wacko->changeStatics2(g_vars->scene05_wacko->_movement->_staticsObj2->_staticsId);
+
+ if (staticsId1 == g_vars->scene05_wacko->_statics->_staticsId) {
+ g_vars->scene05_wacko->startAnim(staticsId2, 0, -1);
+ } else {
+ MessageQueue *mq = g_vars->scene05_wacko->changeStatics1(staticsId1);
+
+ if (mq) {
+ mq->setFlags(mq->getFlags() | 1);
+
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC5_MAKEOTMFEEDBACK, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags |= 2;
+
+ mq->addExCommandToEnd(ex);
+ mq->_isFinished = 0;
+ }
+ }
+}
+
+void sceneHandler05_resetTicks() {
+ if (g_fp->_aniMan->_movement && (g_fp->_aniMan->_movement->_id == MV_MANHDL_HANDLEUP
+ || g_fp->_aniMan->_movement->_id == MV_MANHDL_HANDLEDOWN))
+ g_vars->scene05_wackoTicker = g_fp->_updateTicks;
+ else
+ g_vars->scene05_wackoTicker = 0;
+}
+
+void sceneHandler05_genFlies() {
+ if (g_vars->scene05_floatersTicker <= 1000)
+ return;
+
+ if (g_fp->_rnd->getRandomNumber(1)) {
+ int numFlies = g_fp->_rnd->getRandomNumber(3) + 1;
+
+ for (int i = 0; i < numFlies; i++) {
+ int x = g_fp->_rnd->getRandomNumber(55) + 538;
+ int y = g_fp->_rnd->getRandomNumber(60) + i * 30 + 520;
+
+ g_fp->_floaters->genFlies(g_fp->_currentScene, x, y, 5, 1);
+ g_fp->_floaters->_array2.back()->val2 = 585;
+ g_fp->_floaters->_array2.back()->val3 = -70;
+ g_fp->_floaters->_array2.back()->val11 = 8.0;
+ }
+ }
+
+ g_vars->scene05_floatersTicker = 0;
+}
+
+void sceneHandler05_showHandle() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_HANDLE, -1)->show1(-1, -1, -1, 0);
+}
+
+void sceneHandler05_handleDown() {
+ StaticANIObject *hatch = g_fp->_currentScene->getStaticANIObject1ById(ANI_BIGLUK, -1);
+
+ hatch->changeStatics2(ST_BLK_CLOSED);
+ hatch->startAnim(MV_BLK_OPEN, 0, -1);
+
+ sceneHandler05_resetTicks();
+ sceneHandler05_genFlies();
+}
+
+void sceneHandler05_hideHandle() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_HANDLE, -1)->hide();
+}
+
+void sceneHandler05_handleUp() {
+ StaticANIObject *hatch = g_fp->_currentScene->getStaticANIObject1ById(ANI_BIGLUK, -1);
+
+ hatch->changeStatics2(ST_BLK_OPEN);
+ hatch->startAnim(MV_BLK_CLOSE, 0, -1);
+
+ sceneHandler05_resetTicks();
+}
+
+void sceneHandler05_testHatch(ExCommand *inex) {
+ ExCommand *ex;
+
+ if (g_fp->_currentScene->getStaticANIObject1ById(ANI_BIGLUK, -1)->_statics->_staticsId == ST_BLK_CLOSED) {
+ ex = new ExCommand(SC_5, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaLeft;
+ ex->_excFlags |= 2;
+ ex->postMessage();
+
+ return;
+ }
+
+ StaticANIObject *wacko = g_fp->_currentScene->getStaticANIObject1ById(ANI_OTMOROZ, -1);
+
+ if (wacko->_movement)
+ wacko->changeStatics2(wacko->_movement->_staticsObj2->_staticsId);
+
+ if (g_fp->getObjectState(sO_WeirdWacko) == g_fp->getObjectEnumState(sO_WeirdWacko, sO_InGlasses)) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(inex->_parId);
+
+ if (mq)
+ mq->deleteExCommandByIndex(mq->getCount() - 1, 1);
+
+ if (wacko->_statics->_staticsId != ST_OTM_GLS_LEFT) {
+ mq = wacko->changeStatics1(ST_OTM_GLS_LEFT);
+
+ if (!mq) {
+ wacko->changeStatics2(ST_OTM_GLS_LEFT);
+ mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ }
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ ex = new ExCommand(ANI_OTMOROZ, 1, MV_OTM_HANDLEUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2u;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(SC_5, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaLeft;
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ mq->_isFinished = 0;
+ return;
+ }
+
+ mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ mq->setFlags(mq->getFlags() | 1);
+
+ ex = new ExCommand(ANI_OTMOROZ, 1, MV_OTM_HANDLEUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(SC_5, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaLeft;
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ if (!mq->chain(wacko))
+ delete mq;
+ } else if (g_fp->getObjectState(sO_WeirdWacko) == g_fp->getObjectEnumState(sO_WeirdWacko, sO_WithDrawer)) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(inex->_parId);
+
+ if (mq)
+ mq->deleteExCommandByIndex(mq->getCount() - 1, 1);
+
+ if (wacko->_statics->_staticsId != ST_OTM_BOX_LEFT) {
+ mq = wacko->changeStatics1(ST_OTM_BOX_LEFT);
+ if (!mq) {
+ wacko->changeStatics2(ST_OTM_BOX_LEFT);
+ mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ }
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ ex = new ExCommand(ANI_OTMOROZ, 1, MV_OTM_BOXHANDLEUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(SC_5, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaLeft;
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ mq->_isFinished = 0;
+
+ return;
+ }
+
+ mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ mq->setFlags(mq->getFlags() | 1);
+
+ ex = new ExCommand(ANI_OTMOROZ, 1, MV_OTM_BOXHANDLEUP, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(SC_5, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaLeft;
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ if (!mq->chain(wacko))
+ delete mq;
+
+ return;
+ } else {
+ ex = new ExCommand(SC_5, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaLeft;
+ ex->_excFlags |= 2;
+ ex->postMessage();
+
+ return;
+ }
+}
+
+
+int sceneHandler05(ExCommand *ex) {
+ if (ex->_messageKind != 17)
+ return 0;
+
+ switch (ex->_messageNum) {
+ case MSG_SC5_BGRSOUNDOFF:
+ g_fp->stopAllSoundInstances(SND_5_026);
+ break;
+
+ case MSG_SC5_BGRSOUNDON:
+ g_fp->playSound(SND_5_026, 1);
+ break;
+
+ case MSG_SC5_MAKEMANFLIGHT:
+ sceneHandler05_makeManFlight();
+ break;
+
+ case MSG_SC5_MAKEOTMFEEDBACK:
+ if (!g_fp->_aniMan->_movement || (g_fp->_aniMan->_movement->_id != MV_MANHDL_HANDLEUP
+ && g_fp->_aniMan->_movement->_id != MV_MANHDL_HANDLEDOWN)) {
+ sceneHandler05_makeWackoFeedback();
+ g_vars->scene05_wackoTicker = 0;
+ }
+ break;
+
+ case MSG_SC5_SHOWHANDLE:
+ sceneHandler05_showHandle();
+ break;
+
+ case MSG_SC5_HANDLEDOWN:
+ g_vars->scene05_handle->changeStatics2(ST_HDL_DOWN);
+ sceneHandler05_handleDown();
+ break;
+
+ case MSG_SC5_HIDEHANDLE:
+ sceneHandler05_hideHandle();
+ break;
+
+ case MSG_SC5_HANDLEUP:
+ g_vars->scene05_handle->changeStatics2(ST_HDL_UP);
+ sceneHandler05_handleUp();
+ break;
+
+ case MSG_SC5_TESTLUK:
+ sceneHandler05_testHatch(ex);
+ break;
+
+ case 33:
+ {
+ int res = 0;
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
+
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
+
+ res = 1;
+ }
+
+ if (g_vars->scene05_wackoTicker) {
+ if ((g_fp->_updateTicks - g_vars->scene05_wackoTicker) > 62) {
+ if (!g_fp->_aniMan->_movement || (g_fp->_aniMan->_movement->_id != MV_MANHDL_HANDLEUP
+ && g_fp->_aniMan->_movement->_id != MV_MANHDL_HANDLEDOWN)) {
+ if (g_vars->scene05_handleFlipper % 2)
+ sceneHandler05_makeWackoFeedback();
+
+ g_vars->scene05_wackoTicker = 0;
+
+ ++g_vars->scene05_handleFlipper;
+ }
+ }
+ }
+
+ ++g_vars->scene05_floatersTicker;
+
+ g_fp->_floaters->update();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ return res;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene06.cpp b/engines/fullpipe/scenes/scene06.cpp
new file mode 100644
index 0000000000..c352d27dd6
--- /dev/null
+++ b/engines/fullpipe/scenes/scene06.cpp
@@ -0,0 +1,770 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objects.h"
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/gfx.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/messages.h"
+#include "fullpipe/gameloader.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/interaction.h"
+
+namespace Fullpipe {
+
+void scene06_initMumsy() {
+ g_vars->scene06_mumsyJumpFw = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene06_mumsy, ST_MOM_STANDS, QU_MOM_JUMPFW);
+ g_vars->scene06_mumsyJumpBk = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene06_mumsy, ST_MOM_STANDS, QU_MOM_JUMPBK);
+ g_vars->scene06_mumsyJumpFwPercent = g_vars->scene06_mumsyJumpFw->_percent;
+ g_vars->scene06_mumsyJumpBkPercent = g_vars->scene06_mumsyJumpBk->_percent;
+}
+
+int scene06_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_vars->scene06_arcadeEnabled) {
+ if (g_vars->scene06_aimingBall) {
+ g_fp->_cursorId = PIC_CSR_ARCADE2_D;
+
+ return PIC_CSR_ARCADE2_D;
+ }
+ if (g_fp->_aniMan == (StaticANIObject *)g_fp->_objectAtCursor) {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN6_BALL && g_fp->_cursorId == PIC_CSR_DEFAULT) {
+ g_fp->_cursorId = PIC_CSR_ITN;
+
+ return PIC_CSR_ITN;
+ }
+ } else if (g_fp->_objectAtCursor && (StaticANIObject *)g_fp->_objectAtCursor == g_vars->scene06_currentBall
+ && g_fp->_cursorId == PIC_CSR_DEFAULT) {
+ g_fp->_cursorId = PIC_CSR_ITN;
+ }
+ }
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler06_setExits(Scene *sc) {
+ MotionController *mc = getSc2MctlCompoundBySceneId(sc->_sceneId);
+
+ mc->enableLinks(sO_CloseThing, (g_fp->getObjectState(sO_BigMumsy) != g_fp->getObjectEnumState(sO_BigMumsy, sO_IsGone)));
+ mc->enableLinks(sO_CloseThing2, g_vars->scene06_arcadeEnabled);
+}
+
+void sceneHandler06_winArcade() {
+ g_fp->setObjectState(sO_BigMumsy, g_fp->getObjectEnumState(sO_BigMumsy, sO_IsGone));
+
+ if (g_fp->getObjectState(sO_ClockAxis) == g_fp->getObjectEnumState(sO_ClockAxis, sO_IsNotAvailable))
+ g_fp->setObjectState(sO_ClockAxis, g_fp->getObjectEnumState(sO_ClockAxis, sO_WithoutHandle));
+
+ if (g_vars->scene06_arcadeEnabled) {
+ g_fp->_aniMan->_callback2 = 0;
+
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT | 0x4000);
+
+ if (g_vars->scene06_someBall) {
+ g_vars->scene06_someBall->_flags &= 0xFFFB;
+
+ g_vars->scene06_balls.push_back(g_vars->scene06_someBall);
+
+ g_vars->scene06_someBall = 0;
+ }
+
+ if (g_vars->scene06_flyingBall) {
+ g_vars->scene06_flyingBall->_flags &= 0xFFFB;
+
+ g_vars->scene06_balls.push_back(g_vars->scene06_flyingBall);
+
+ g_vars->scene06_flyingBall = 0;
+ }
+
+ if (g_vars->scene06_ballInHands) {
+ g_vars->scene06_ballInHands->_flags &= 0xFFFB;
+
+ g_vars->scene06_balls.push_back(g_vars->scene06_ballInHands);
+
+ g_vars->scene06_ballInHands = 0;
+ }
+
+ g_vars->scene06_arcadeEnabled = false;
+ g_vars->scene06_aimingBall = false;
+ }
+
+ g_vars->scene06_mumsy->_flags &= 0xFFFB;
+
+ sceneHandler06_setExits(g_fp->_currentScene);
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+}
+
+void sceneHandler06_enableDrops() {
+ chainQueue(QU_SC6_DROPS, 0);
+
+ g_vars->scene06_mumsy->changeStatics2(ST_MOM_SITS);
+ g_fp->setObjectState(sO_BigMumsy, g_fp->getObjectEnumState(sO_BigMumsy, sO_IsPlaying));
+
+ chainQueue(QU_MOM_STANDUP, 1);
+
+ g_vars->scene06_arcadeEnabled = true;
+ g_vars->scene06_numBallsGiven = 0;
+ g_vars->scene06_mumsyPos = 0;
+ g_vars->scene06_mumsyNumBalls = 0;
+ g_vars->scene06_mumsyGotBall = false;
+
+ sceneHandler06_setExits(g_fp->_currentScene);
+}
+
+void sceneHandler06_mumsyBallTake() {
+ int momAni = 0;
+
+ switch (g_vars->scene06_mumsyNumBalls) {
+ case 1:
+ momAni = MV_MOM_TAKE1;
+ break;
+ case 2:
+ momAni = MV_MOM_TAKE2;
+ break;
+ case 3:
+ momAni = MV_MOM_TAKE3;
+ break;
+ case 4:
+ momAni = MV_MOM_TAKE4;
+ break;
+ case 5:
+ momAni = MV_MOM_TAKE5;
+ break;
+ }
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ ExCommand *ex = new ExCommand(ANI_MAMASHA, 2, 50, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags = 2u;
+ mq->addExCommandToEnd(ex);
+
+ if (g_vars->scene06_mumsyNumBalls >= 5) {
+ g_fp->setObjectState(sO_BigMumsy, g_fp->getObjectEnumState(sO_BigMumsy, sO_IsGone));
+
+ if (g_fp->getObjectState(sO_ClockAxis) == g_fp->getObjectEnumState(sO_ClockAxis, sO_IsNotAvailable))
+ g_fp->setObjectState(sO_ClockAxis, g_fp->getObjectEnumState(sO_ClockAxis, sO_WithoutHandle));
+
+ ex = new ExCommand(ANI_MAMASHA, 1, momAni, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ if (g_vars->scene06_mumsyPos + 3 >= 0) {
+ ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_STARTBK, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2u;
+ mq->addExCommandToEnd(ex);
+
+ for (int i = 0; i < g_vars->scene06_mumsyPos + 3; i++) {
+ ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_CYCLEBK, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+ }
+
+ ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_STOPBK, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+ }
+
+ ex = new ExCommand(0, 18, QU_MOM_TOLIFT, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+ } else {
+ if (momAni) {
+ ex = new ExCommand(ANI_MAMASHA, 1, momAni, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+ }
+
+ if (g_vars->scene06_mumsyPos < 0) {
+ for (int i = 0; i > g_vars->scene06_mumsyPos; i--) {
+ ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_JUMPFW, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+ }
+ } else if (g_vars->scene06_mumsyPos > 0) {
+ for (int i = 0; i < g_vars->scene06_mumsyPos; i++) {
+ ex = new ExCommand(ANI_MAMASHA, 1, MV_MOM_JUMPBK, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+ }
+ }
+
+ ex = new ExCommand(0, 18, QU_MOM_SITDOWN, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3u;
+ mq->addExCommandToEnd(ex);
+ }
+
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_vars->scene06_mumsyNumBalls = 0;
+ g_vars->scene06_arcadeEnabled = false;
+
+ g_fp->_aniMan2 = 0;
+}
+
+void sceneHandler06_spinHandle() {
+ int tummy = g_fp->getObjectState(sO_TummyTrampie);
+
+ if (tummy == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsEating))
+ g_fp->setObjectState(sO_TummyTrampie, g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsSleeping));
+ else if (tummy == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsSleeping))
+ g_fp->setObjectState(sO_TummyTrampie, g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsDrinking));
+ else if (tummy == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsDrinking))
+ g_fp->setObjectState(sO_TummyTrampie, g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsScratchingBelly));
+ else if (tummy == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsScratchingBelly))
+ g_fp->setObjectState(sO_TummyTrampie, g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsEating));
+}
+
+void sceneHandler06_uPipeClick() {
+ if (getGameLoaderInteractionController()->_flag24)
+ handleObjectInteraction(g_fp->_aniMan2, g_fp->_currentScene->getPictureObjectById(PIC_SC6_LADDER, 0), 0);
+}
+
+void sceneHandler06_buttonPush() {
+ g_vars->scene06_invHandle = g_fp->_currentScene->getStaticANIObject1ById(ANI_INV_HANDLE, -1);
+
+ if (g_vars->scene06_invHandle)
+ if (g_vars->scene06_invHandle->_flags & 4)
+ if (g_vars->scene06_invHandle->_statics)
+ if (g_vars->scene06_invHandle->_statics->_staticsId == ST_HDL_PLUGGED)
+ chainQueue(QU_SC6_FALLHANDLE, 1);
+}
+
+void sceneHandler06_showNextBall() {
+ if (g_vars->scene06_balls.size()) {
+ g_vars->scene06_currentBall = new StaticANIObject(g_vars->scene06_balls.front());
+ g_vars->scene06_balls.remove_at(0);
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC6_SHOWNEXTBALL), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene06_currentBall->_okeyCode);
+ mq->chain(0);
+
+ ++g_vars->scene06_numBallsGiven;
+ }
+}
+
+void sceneHandler06_installHandle() {
+ chainQueue(QU_SC6_SHOWHANDLE, 0);
+}
+
+int sceneHandler06_updateScreenCallback() {
+ int res;
+
+ res = g_fp->drawArcadeOverlay(g_vars->scene06_arcadeEnabled);
+
+ if (!res)
+ g_fp->_updateScreenCallback = 0;
+
+ return res;
+}
+
+void sceneHandler06_startAiming() {
+ if (g_vars->scene06_currentBall) {
+ g_vars->scene06_currentBall->hide();
+
+ g_fp->_aniMan->startAnim(MV_MAN6_TAKEBALL, 0, -1);
+
+ g_vars->scene06_ballInHands = g_vars->scene06_currentBall;
+ g_vars->scene06_currentBall = 0;
+
+ if (getCurrSceneSc2MotionController()->_isEnabled)
+ g_fp->_updateScreenCallback = sceneHandler06_updateScreenCallback;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_vars->scene06_ballDrop->queueMessageQueue(0);
+ }
+}
+
+void sceneHandler06_takeBall() {
+ if (g_vars->scene06_currentBall && !g_vars->scene06_currentBall->_movement && g_vars->scene06_currentBall->_statics->_staticsId == ST_NBL_NORM) {
+ if (abs(1158 - g_fp->_aniMan->_ox) > 1
+ || abs(452 - g_fp->_aniMan->_oy) > 1
+ || g_fp->_aniMan->_movement
+ || g_fp->_aniMan->_statics->_staticsId != (0x4000 | ST_MAN_RIGHT)) {
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1158, 452, 1, (0x4000 | ST_MAN_RIGHT));
+
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC6_TAKEBALL, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, 1158, 452, 0, -1);
+ }
+ } else {
+ sceneHandler06_startAiming();
+ }
+ }
+}
+
+void sceneHandler06_aiming() {
+ if (g_vars->scene06_ballInHands) {
+ g_vars->scene06_ballDeltaX = 4 * g_fp->_aniMan->_movement->_currDynamicPhaseIndex + 16;
+ g_vars->scene06_ballDeltaY = 5 * (g_fp->_aniMan->_movement->_currDynamicPhaseIndex + 4);
+
+ if (g_fp->_aniMan->_movement->_currDynamicPhaseIndex < 4) {
+ g_fp->_aniMan->_movement->setDynamicPhaseIndex(11);
+
+ g_vars->scene06_aimingBall = false;
+
+ return;
+ }
+
+ g_fp->_aniMan->_movement->setDynamicPhaseIndex(9);
+ }
+
+ g_vars->scene06_aimingBall = false;
+}
+
+void sceneHandler06_ballStartFly() {
+ if (g_vars->scene06_ballInHands) {
+ g_vars->scene06_flyingBall = g_vars->scene06_ballInHands;
+ g_vars->scene06_ballInHands = 0;
+ g_vars->scene06_flyingBall->show1(g_fp->_aniMan->_ox - 60, g_fp->_aniMan->_oy - 60, -1, 0);
+
+ g_vars->scene06_flyingBall->_priority = 27;
+ }
+}
+
+void sceneHandler06_throwCallback(int *arg) {
+ if (g_vars->scene06_aimingBall) {
+ int dist = (g_fp->_mouseVirtY - g_vars->scene06_sceneClickY)
+ * (g_fp->_mouseVirtY - g_vars->scene06_sceneClickY)
+ + (g_fp->_mouseVirtX - g_vars->scene06_sceneClickX)
+ * (g_fp->_mouseVirtX - g_vars->scene06_sceneClickX);
+
+ *arg = (int)(sqrt((double)dist) * 0.1);
+
+ if (*arg > 8)
+ *arg = 8;
+ } else {
+ *arg = *arg + 1;
+ if (*arg == 12)
+ sceneHandler06_ballStartFly();
+ }
+}
+
+void sceneHandler06_throwBall() {
+ g_fp->_aniMan->_callback2 = sceneHandler06_throwCallback;
+ g_fp->_aniMan->startAnim(MV_MAN6_THROWBALL, 0, -1);
+
+ g_vars->scene06_aimingBall = true;
+}
+
+void sceneHandler06_eggieWalk() {
+ if (15 - g_vars->scene06_numBallsGiven >= 4 && !g_fp->_rnd->getRandomNumber(9)) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_EGGIE, -1);
+
+ if (!ani || !(ani->_flags & 4)) {
+ if (g_vars->scene06_eggieDirection)
+ chainQueue(QU_EGG6_GOR, 0);
+ else
+ chainQueue(QU_EGG6_GOL, 0);
+
+ g_vars->scene06_eggieTimeout = 0;
+ g_vars->scene06_eggieDirection = !g_vars->scene06_eggieDirection;
+ }
+ }
+}
+
+void sceneHandler06_dropBall() {
+ if (g_vars->scene06_numBallsGiven >= 15 || g_vars->scene06_mumsyNumBalls >= 5)
+ g_vars->scene06_ballDrop->hide();
+ else
+ chainQueue(QU_SC6_DROPS3, 0);
+}
+
+void sceneHandler06_fallBall() {
+ g_vars->scene06_ballY = 475;
+
+ g_vars->scene06_flyingBall->setOXY(g_vars->scene06_ballX, g_vars->scene06_ballY);
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC6_FALLBALL), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene06_flyingBall->_okeyCode);
+ mq->chain(0);
+
+ g_vars->scene06_balls.push_back(g_vars->scene06_flyingBall);
+
+ g_vars->scene06_flyingBall = 0;
+
+ sceneHandler06_dropBall();
+ sceneHandler06_eggieWalk();
+}
+
+void sceneHandler06_catchBall() {
+ if (g_vars->scene06_flyingBall) {
+ g_vars->scene06_flyingBall->hide();
+
+ g_vars->scene06_balls.push_back(g_vars->scene06_flyingBall);
+
+ g_vars->scene06_flyingBall = 0;
+
+ g_vars->scene06_mumsyNumBalls++;
+
+ if (g_vars->scene06_mumsy->_movement) {
+ Common::Point point;
+
+ if (g_vars->scene06_mumsy->_movement->_id == MV_MOM_JUMPFW) {
+ if (g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex <= 5) {
+ g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0);
+
+ point.x = -point.x;
+ point.y = -point.y;
+ } else {
+ g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1);
+
+ g_vars->scene06_mumsyPos++;
+ }
+ } else if (g_vars->scene06_mumsy->_movement->_id == MV_MOM_JUMPBK) {
+ if (g_vars->scene06_mumsy->_movement->_currDynamicPhaseIndex <= 4) {
+ g_vars->scene06_mumsy->_movement->calcSomeXY(point, 0);
+
+ point.x = -point.x;
+ point.y = -point.y;
+ } else {
+ g_vars->scene06_mumsy->_movement->calcSomeXY(point, 1);
+
+ g_vars->scene06_mumsyPos--;
+ }
+ }
+
+ g_vars->scene06_mumsy->changeStatics2(ST_MOM_STANDS);
+ g_vars->scene06_mumsy->setOXY(point.x + g_vars->scene06_mumsy->_ox,
+ point.y + g_vars->scene06_mumsy->_oy);
+ } else {
+ g_vars->scene06_mumsy->changeStatics2(ST_MOM_STANDS);
+ }
+
+ chainQueue(QU_MOM_PUTBALL, 1);
+ g_vars->scene06_mumsyGotBall = true;
+
+ sceneHandler06_dropBall();
+ }
+}
+
+void sceneHandler06_checkBallTarget(int par) {
+ int pixel;
+
+ if (g_vars->scene06_ballY <= 475) {
+ if (g_vars->scene06_mumsy->getPixelAtPos(g_vars->scene06_ballX, g_vars->scene06_ballY, &pixel)) {
+ if (pixel) {
+ chainObjQueue(g_vars->scene06_mumsy, QU_MOM_JUMPBK, 0);
+
+ sceneHandler06_catchBall();
+ }
+ }
+ } else {
+ sceneHandler06_fallBall();
+ }
+}
+
+void scene06_initScene(Scene *sc) {
+ g_vars->scene06_mumsy = sc->getStaticANIObject1ById(ANI_MAMASHA, -1);
+ g_vars->scene06_someBall = 0;
+ g_vars->scene06_invHandle = sc->getStaticANIObject1ById(ANI_INV_HANDLE, -1);
+ g_vars->scene06_liftButton = sc->getStaticANIObject1ById(ANI_BUTTON_6, -1);
+ g_vars->scene06_ballDrop = sc->getStaticANIObject1ById(ANI_BALLDROP, -1);
+ g_vars->scene06_arcadeEnabled = false;
+ g_vars->scene06_aimingBall = false;
+ g_vars->scene06_currentBall = 0;
+ g_vars->scene06_ballInHands = 0;
+ g_vars->scene06_flyingBall = 0;
+ g_vars->scene06_balls.clear();
+ g_vars->scene06_numBallsGiven = 0;
+ g_vars->scene06_mumsyNumBalls = 0;
+ g_vars->scene06_eggieTimeout = 0;
+ g_vars->scene06_eggieDirection = true;
+
+ StaticANIObject *ball = sc->getStaticANIObject1ById(ANI_NEWBALL, -1);
+
+ ball->hide();
+ ball->_statics = ball->getStaticsById(ST_NBL_NORM);
+ g_vars->scene06_balls.push_back(ball);
+
+ for (int i = 0; i < 3; i++) {
+ StaticANIObject *ball2 = new StaticANIObject(ball);
+
+ ball2->hide();
+ ball2->_statics = ball2->getStaticsById(ST_NBL_NORM);
+
+ sc->addStaticANIObject(ball2, 1);
+
+ g_vars->scene06_balls.push_back(ball2);
+ }
+
+ if (g_fp->getObjectState(sO_BigMumsy) == g_fp->getObjectEnumState(sO_BigMumsy, sO_IsPlaying))
+ g_fp->setObjectState(sO_BigMumsy, g_fp->getObjectEnumState(sO_BigMumsy, sO_IsSleeping));
+
+ if (g_fp->getObjectState(sO_BigMumsy) != g_fp->getObjectEnumState(sO_BigMumsy, sO_IsSleeping))
+ g_vars->scene06_mumsy->hide();
+
+ g_fp->lift_setButton(sO_Level3, ST_LBN_3N);
+ g_fp->lift_sub5(sc, QU_SC6_ENTERLIFT, QU_SC6_EXITLIFT);
+ g_fp->initArcadeKeys("SC_6");
+
+ sceneHandler06_setExits(sc);
+
+ g_fp->setArcadeOverlay(PIC_CSR_ARCADE2);
+}
+
+int sceneHandler06(ExCommand *ex) {
+ if (ex->_messageKind != 17)
+ return 0;
+
+ switch(ex->_messageNum) {
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(ex);
+ break;
+
+ case MSG_CMN_WINARCADE:
+ sceneHandler06_winArcade();
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_SC6_RESTORESCROLL:
+ g_fp->_aniMan2 = g_fp->_aniMan;
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+ sceneHandler06_setExits(g_fp->_currentScene);
+ break;
+
+ case MSG_SC6_STARTDROPS:
+ if (g_fp->getObjectState(sO_BigMumsy) == g_fp->getObjectEnumState(sO_BigMumsy, sO_IsSleeping))
+ sceneHandler06_enableDrops();
+ break;
+
+ case MSG_SC6_TESTNUMBALLS:
+ g_vars->scene06_mumsyGotBall = false;
+
+ if (g_vars->scene06_mumsyNumBalls < 5 || !g_vars->scene06_arcadeEnabled)
+ return 0;
+
+ sceneHandler06_mumsyBallTake();
+ break;
+
+ case MSG_SC6_JUMPFW:
+ ++g_vars->scene06_mumsyPos;
+ break;
+
+ case MSG_SC6_JUMPBK:
+ --g_vars->scene06_mumsyPos;
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SPINHANDLE:
+ sceneHandler06_spinHandle();
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_SC6_UTRUBACLICK:
+ sceneHandler06_uPipeClick();
+ break;
+
+ case MSG_SC6_BTNPUSH:
+ sceneHandler06_buttonPush();
+ break;
+
+ case MSG_SC6_SHOWNEXTBALL:
+ sceneHandler06_showNextBall();
+ break;
+
+ case MSG_SC6_INSTHANDLE:
+ sceneHandler06_installHandle();
+ break;
+
+ case MSG_SC6_ENABLEDROPS:
+ sceneHandler06_enableDrops();
+ break;
+
+ case 64:
+ g_fp->lift_sub05(ex);
+ break;
+
+ case MSG_SC6_TAKEBALL:
+ sceneHandler06_takeBall();
+ break;
+
+ case 30:
+ if (g_vars->scene06_aimingBall) {
+ sceneHandler06_aiming();
+ break;
+ }
+
+ if (!g_vars->scene06_arcadeEnabled) {
+ // Do nothing
+ break;
+ }
+ break;
+
+ case 29:
+ {
+ StaticANIObject *st = g_fp->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
+
+ if (st) {
+ if (!g_vars->scene06_arcadeEnabled && st->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(st);
+ ex->_messageKind = 0;
+ return 0;
+ }
+
+ if (g_vars->scene06_currentBall == st) {
+ if (g_vars->scene06_numBallsGiven == 1)
+ sceneHandler06_takeBall();
+
+ ex->_messageKind = 0;
+ } else if (g_vars->scene06_ballInHands && g_fp->_aniMan == st && !g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == ST_MAN6_BALL) {
+ g_vars->scene06_sceneClickX = ex->_sceneClickX;
+ g_vars->scene06_sceneClickY = ex->_sceneClickY;
+
+ sceneHandler06_throwBall();
+ }
+ }
+
+ if (!st || !canInteractAny(g_fp->_aniMan, st, ex->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, ex->_keyCode)) {
+ if ((g_fp->_sceneRect.right - ex->_sceneClickX < 47
+ && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (ex->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(ex);
+ return 0;
+ }
+ }
+ }
+ }
+
+ break;
+
+ case 33:
+ {
+ int res = 0;
+
+ if (g_fp->_aniMan2) {
+ int ox = g_fp->_aniMan2->_ox;
+ int oy = g_fp->_aniMan2->_oy;
+
+ g_vars->scene06_manX = ox;
+ g_vars->scene06_manY = oy;
+
+ if (g_vars->scene06_arcadeEnabled && oy <= 470 && ox >= 1088) {
+ if (ox < g_fp->_sceneRect.left + 600) {
+ g_fp->_currentScene->_x = ox - g_fp->_sceneRect.left - 700;
+ ox = g_vars->scene06_manX;
+ }
+
+ if (ox > g_fp->_sceneRect.right - 50)
+ g_fp->_currentScene->_x = ox - g_fp->_sceneRect.right + 70;
+ } else {
+ if (ox < g_fp->_sceneRect.left + 200) {
+ g_fp->_currentScene->_x = ox - g_fp->_sceneRect.left - 300;
+ ox = g_vars->scene06_manX;
+ }
+
+ if (ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = ox - g_fp->_sceneRect.right + 300;
+ }
+
+ res = 1;
+ }
+ if (g_vars->scene06_arcadeEnabled) {
+ if (g_vars->scene06_mumsyPos > -3)
+ g_vars->scene06_mumsyJumpBk->_percent = g_vars->scene06_mumsyJumpBkPercent;
+ else
+ g_vars->scene06_mumsyJumpBk->_percent = 0;
+
+ if (g_vars->scene06_mumsyPos < 4)
+ g_vars->scene06_mumsyJumpFw->_percent = g_vars->scene06_mumsyJumpFwPercent;
+ else
+ g_vars->scene06_mumsyJumpFw->_percent = 0;
+
+ if (g_vars->scene06_aimingBall) {
+ g_vars->scene06_eggieTimeout++;
+
+ if (g_vars->scene06_eggieTimeout >= 600)
+ sceneHandler06_eggieWalk();
+ }
+ } else {
+ g_vars->scene06_mumsyJumpFw->_percent = 0;
+ g_vars->scene06_mumsyJumpBk->_percent = 0;
+ }
+
+ if (g_vars->scene06_flyingBall) {
+ g_vars->scene06_ballX = g_vars->scene06_flyingBall->_ox - g_vars->scene06_ballDeltaX;
+ g_vars->scene06_ballY = g_vars->scene06_flyingBall->_oy - g_vars->scene06_ballDeltaY;
+
+ g_vars->scene06_flyingBall->setOXY(g_vars->scene06_ballX, g_vars->scene06_ballY);
+
+ if (g_vars->scene06_ballDeltaX >= 2)
+ g_vars->scene06_ballDeltaX -= 2;
+
+ g_vars->scene06_ballDeltaY -= 5;
+
+ sceneHandler06_checkBallTarget(g_vars->scene06_ballDeltaX);
+ }
+ if (g_vars->scene06_arcadeEnabled
+ && !g_vars->scene06_currentBall
+ && !g_vars->scene06_ballInHands
+ && !g_vars->scene06_flyingBall
+ && g_vars->scene06_numBallsGiven >= 15
+ && !g_vars->scene06_ballDrop->_movement
+ && !g_vars->scene06_mumsy->_movement
+ && !g_vars->scene06_mumsyGotBall)
+ sceneHandler06_mumsyBallTake();
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ return res;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene07.cpp b/engines/fullpipe/scenes/scene07.cpp
new file mode 100644
index 0000000000..207189d151
--- /dev/null
+++ b/engines/fullpipe/scenes/scene07.cpp
@@ -0,0 +1,175 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objects.h"
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/messages.h"
+#include "fullpipe/behavior.h"
+
+namespace Fullpipe {
+
+void scene07_initScene(Scene *sc) {
+ g_vars->scene07_lukeAnim = 0;
+ g_vars->scene07_lukePercent = 0;
+ g_vars->scene07_plusMinus = sc->getStaticANIObject1ById(ANI_PLUSMINUS, -1);
+
+ if (g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_Off))
+ g_vars->scene07_plusMinus->_statics = g_vars->scene07_plusMinus->getStaticsById(ST_PMS_MINUS);
+ else
+ g_vars->scene07_plusMinus->_statics = g_vars->scene07_plusMinus->getStaticsById(ST_PMS_PLUS);
+
+ if (g_fp->getObjectState(sO_HareTheNooksiter) == g_fp->getObjectEnumState(sO_HareTheNooksiter, sO_WithoutHandle)) {
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_fp->_currentScene = sc;
+
+ sc->getStaticANIObject1ById(ANI_CORNERSITTER, -1)->changeStatics2(ST_CST_HANDLELESS);
+
+ g_fp->_currentScene = oldsc;
+ }
+}
+
+void sceneHandler07_openLuke() {
+ StaticANIObject *luke = g_fp->_currentScene->getStaticANIObject1ById(ANI_LUKE, -1);
+
+ luke->changeStatics2(ST_LUK_OPEN);
+ luke->show1(-1, -1, -1, 0);
+
+ if (g_vars->scene07_lukeAnim) {
+ g_vars->scene07_lukeAnim->_percent = g_vars->scene07_lukePercent;
+ } else {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_CORNERSITTER, -1);
+
+ g_vars->scene07_lukeAnim = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(ani, ST_CST_HANDLELESS, QU_CST_CLOSELUKE);
+
+ g_vars->scene07_lukeAnim->_percent = g_vars->scene07_lukePercent;
+ }
+}
+
+void sceneHandler07_closeLuke() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_LUKE, -1)->changeStatics2(ST_LUK_CLOSED);
+
+ if (!g_vars->scene07_lukeAnim) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_CORNERSITTER, -1);
+
+ g_vars->scene07_lukeAnim = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(ani, ST_CST_HANDLELESS, QU_CST_CLOSELUKE);
+ }
+
+ g_vars->scene07_lukePercent = g_vars->scene07_lukeAnim->_percent;
+ g_vars->scene07_lukeAnim->_percent = 0;
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_HOOLIGAN, -1);
+
+ ani->changeStatics2(ST_HGN_LUKE);
+ ani->show1(-1, -1, -1, 0);
+}
+
+void sceneHandler07_hideLuke() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_LUKE, -1)->hide();
+
+ Movement *mov = g_fp->_currentScene->getStaticANIObject1ById(ANI_CORNERSITTER, -1)->_movement;
+
+ if (mov) {
+ if (mov->_id == MV_CST_CLOSELUKE) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_HOOLIGAN, -1);
+
+ ani->changeStatics2(ST_HGN_LOOK);
+ ani->_flags &= 0xFFFB;
+ }
+ }
+}
+
+void sceneHandler07_showBox() {
+ StaticANIObject *box = g_fp->_currentScene->getStaticANIObject1ById(ANI_SC7_BOX, -1);
+
+ box->show1(492, 474, MV_SC7_BOX_default, 0);
+ box->_priority = 25;
+}
+
+void sceneHandler07_hideBox() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_SC7_BOX, -1)->hide();
+}
+
+int sceneHandler07(ExCommand *ex) {
+ if (ex->_messageKind != 17)
+ return 0;
+
+ switch(ex->_messageNum) {
+ case MSG_SC7_OPENLUKE:
+ sceneHandler07_openLuke();
+ break;
+
+ case MSG_SC7_PULL:
+ if (g_vars->scene07_plusMinus->_statics->_staticsId == ST_PMS_MINUS)
+ g_vars->scene07_plusMinus->_statics = g_vars->scene07_plusMinus->getStaticsById(ST_PMS_PLUS);
+ else
+ g_vars->scene07_plusMinus->_statics = g_vars->scene07_plusMinus->getStaticsById(ST_PMS_MINUS);
+
+ break;
+
+ case MSG_SC7_CLOSELUKE:
+ sceneHandler07_closeLuke();
+ break;
+
+ case MSG_SC7_HIDELUKE:
+ sceneHandler07_hideLuke();
+ break;
+
+ case MSG_SC7_SHOWBOX:
+ sceneHandler07_showBox();
+ break;
+
+ case MSG_SC7_HIDEBOX:
+ sceneHandler07_hideBox();
+ break;
+
+ case 33:
+ {
+ int res = 0;
+
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
+
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
+
+ res = 1;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ return res;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene08.cpp b/engines/fullpipe/scenes/scene08.cpp
new file mode 100644
index 0000000000..716ca1f593
--- /dev/null
+++ b/engines/fullpipe/scenes/scene08.cpp
@@ -0,0 +1,546 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objects.h"
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/floaters.h"
+#include "fullpipe/gameloader.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/interaction.h"
+
+namespace Fullpipe {
+
+void scene08_initScene(Scene *sc) {
+ g_vars->scene08_inArcade = false;
+ g_vars->scene08_inAir = false;
+ g_vars->scene08_flyingUp = false;
+ g_vars->scene08_onBelly = false;
+ g_vars->scene08_batuta = sc->getStaticANIObject1ById(ANI_BATUTA, -1);
+ g_vars->scene08_vmyats = sc->getStaticANIObject1ById(ANI_VMYATS, -1);
+ g_vars->scene08_clock = sc->getStaticANIObject1ById(ANI_CLOCK_8, -1);
+ g_vars->scene08_stairsOffset = -37;
+ g_vars->scene08_snoringCountdown = -1;
+
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ int batuta = g_fp->getObjectState(sO_TummyTrampie);
+ MovGraphLink *lock = getSc2MctlCompoundBySceneId(sc->_sceneId)->getLinkByName(sO_CloseThing);
+
+ if (lock)
+ lock->_flags &= 0xDFFFFFFF;
+
+ if (batuta == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsEating)) {
+ g_vars->scene08_batuta->changeStatics2(ST_BTT_SPOON);
+ } else if (batuta == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsDrinking)) {
+ g_vars->scene08_batuta->changeStatics2(ST_BTT_NOSPOON);
+
+ g_vars->scene08_clock->startAnim(MV_CLK8_GO, 0, -1);
+ g_vars->scene08_clock->_movement->setDynamicPhaseIndex(3);
+ } else if (batuta== g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsScratchingBelly)) {
+ g_vars->scene08_batuta->changeStatics2(ST_BTT_CHESHET);
+
+ g_vars->scene08_clock->startAnim(MV_CLK8_GO, 0, -1);
+ g_vars->scene08_clock->_movement->setDynamicPhaseIndex(8);
+ } else if (batuta == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsSleeping)) {
+ g_vars->scene08_batuta->changeStatics2(ST_BTT_SLEEPS);
+
+ g_vars->scene08_clock->startAnim(MV_CLK8_GO, 0, -1);
+ g_vars->scene08_clock->_movement->setDynamicPhaseIndex(2);
+
+ if (lock)
+ lock->_flags |= 0x20000000;
+
+ g_vars->scene08_snoringCountdown = 71;
+ }
+
+ g_vars->scene08_clock->_callback2 = 0;
+
+ if (g_fp->getObjectState(sO_StairsUp_8) == g_fp->getObjectEnumState(sO_StairsUp_8, sO_Broken)) {
+ g_vars->scene08_stairsVisible = false;
+
+ sc->getPictureObjectById(PIC_SC8_LADDER, 0)->_flags &= 0xFFFB;
+
+ g_vars->scene08_stairsOffset = -39;
+ } else {
+ g_vars->scene08_stairsVisible = true;
+ }
+
+ sc->getPictureObjectById(PIC_SC8_ARCADENOW, 0)->_flags &= 0xFFFB;
+
+ g_fp->_currentScene = oldsc;
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_8"));
+ g_fp->_floaters->genFlies(sc, 100, 100, 0, 0);
+
+ g_fp->setArcadeOverlay(PIC_CSR_ARCADE3);
+}
+
+void scene08_setupMusic() {
+ if (g_fp->getObjectState(sO_TummyTrampie) == g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsSleeping))
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_8"), "MUSIC_ARCADE", 1);
+}
+
+int scene08_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_vars->scene08_inArcade) {
+ if (g_vars->scene08_onBelly) {
+ if (g_fp->_objectIdAtCursor == PIC_SC8_LADDERD && g_fp->_cursorId == PIC_CSR_ITN)
+ g_fp->_cursorId = PIC_CSR_GOU;
+ } else {
+ g_fp->_cursorId = -1;
+ }
+ } else {
+ if (g_fp->_objectIdAtCursor == PIC_SC8_LADDERD && g_fp->_cursorId == PIC_CSR_ITN) {
+ if (g_fp->_aniMan2->_oy >= 520) {
+ if (g_fp->_aniMan2->_oy <= 750)
+ g_fp->_cursorId = PIC_CSR_GOU;
+ } else {
+ g_fp->_cursorId = PIC_CSR_GOD;
+ }
+ }
+ }
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler08_enterUp() {
+ g_fp->_currentScene->getPictureObjectById(PIC_SC8_LADDER, 0)->_flags &= 0xFFFB;
+
+ g_fp->_aniMan->changeStatics2(ST_MAN8_HANDSUP);
+ g_fp->_aniMan->setOXY(386, 236);
+ g_fp->_aniMan->_priority = 10;
+ g_fp->_aniMan->_flags = 4;
+
+ chainObjQueue(g_fp->_aniMan, QU_SC8_FINISH, 1);
+
+ g_vars->scene08_inAir = false;
+}
+
+void sceneHandler08_winArcade() {
+ if (g_vars->scene08_inArcade) {
+ g_vars->scene08_inArcade = false;
+ g_fp->_sceneRect.top = 0;
+ g_fp->_sceneRect.bottom = 600;
+
+ sceneHandler08_enterUp();
+ }
+}
+
+void sceneHandler08_hideLadder() {
+ g_fp->_currentScene->getPictureObjectById(PIC_SC8_LADDER_D, 0)->_flags &= 0xFFFB;
+}
+
+void sceneHandler08_arcadeNow() {
+ MovGraphLink *lnk = getCurrSceneSc2MotionController()->getLinkByName(sO_Stairway);
+
+ g_fp->setObjectState(sO_TummyTrampie, g_fp->getObjectEnumState(sO_TummyTrampie, sO_IsSleeping));
+
+ g_vars->scene08_batuta->changeStatics2(ST_BTT_SLEEPS);
+
+ if (lnk)
+ lnk->_flags |= 0x20000000;
+}
+
+void sceneHandler08_resumeFlight() {
+ g_vars->scene08_manOffsetY = 3;
+ g_vars->scene08_stairsOffset = -39;
+ g_vars->scene08_inAir = true;
+ g_vars->scene08_stairsVisible = false;
+}
+
+int sceneHandler08_calcOffset(int off, int flag) {
+ if (off > 0) {
+ if (flag)
+ return off * 31 / 10; // off * 3.1
+ else
+ return 5 * off;
+ } else {
+ return 5 * off;
+ }
+}
+
+void sceneHandler08_pushCallback(int *par) {
+ Common::Point point;
+
+ int y = g_fp->_aniMan->_oy + g_fp->_aniMan->getSomeXY(point)->y;
+
+ if (g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN)
+ y -= 25;
+
+ *par = (y - 703) / 10;
+ if (*par > 11) {
+ *par = 11;
+ g_vars->scene08_manOffsetY = 0;
+ }
+ if (*par >= 0)
+ g_vars->scene08_manOffsetY -= sceneHandler08_calcOffset(*par, g_vars->scene08_manOffsetY < 0);
+ else
+ *par = 0;
+}
+
+int sceneHandler08_updateScreenCallback() {
+ int res;
+
+ res = g_fp->drawArcadeOverlay(g_vars->scene08_inArcade);
+
+ if (!res)
+ g_fp->_updateScreenCallback = 0;
+
+ return res;
+}
+
+void sceneHandler08_startArcade() {
+ g_vars->scene08_inArcade = true;
+ g_vars->scene08_inAir = true;
+ g_vars->scene08_flyingUp = false;
+ g_vars->scene08_onBelly = false;
+
+ getGameLoaderInteractionController()->disableFlag24();
+ getCurrSceneSc2MotionController()->clearEnabled();
+
+ g_vars->scene08_batuta->stopAnim_maybe();
+
+ g_vars->scene08_vmyats->_statics = g_vars->scene08_vmyats->getStaticsById(ST_VMT_MIN);
+ g_vars->scene08_vmyats->setOXY(382, 703);
+ g_vars->scene08_vmyats->_priority = 29;
+ g_vars->scene08_vmyats->_callback2 = sceneHandler08_pushCallback;
+
+ g_fp->_aniMan = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN, -1);
+
+ g_vars->scene08_manOffsetY = 15;
+
+ g_fp->_currentScene->_y = 0;
+
+ g_fp->_updateScreenCallback = sceneHandler08_updateScreenCallback;
+}
+
+void sceneHandler08_airMoves() {
+ if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_oy;
+ Common::Point point;
+
+ if (703 - g_fp->_aniMan->getSomeXY(point)->y - y < 150) {
+ if (g_fp->_aniMan->_statics) {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN) {
+ y -= 25;
+
+ g_fp->_aniMan->setOXY(x, y);
+ }
+ }
+
+ g_fp->_aniMan->changeStatics2(ST_MAN8_STAND);
+ g_fp->_aniMan->setOXY(380, y);
+ g_fp->_aniMan->startAnim(MV_MAN8_JUMP, 0, -1);
+
+ } else if (g_fp->_aniMan->_statics) {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYUP) {
+ g_fp->_aniMan->startAnim(MV_MAN8_DRYGUP, 0, -1);
+
+ } else if (g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN) {
+ g_fp->_aniMan->startAnim(MV_MAN8_DRYGDOWN, 0, -1);
+ }
+ }
+ }
+}
+
+void sceneHandler08_finishArcade() {
+ g_vars->scene08_inArcade = false;
+
+ getGameLoaderInteractionController()->enableFlag24();
+ getCurrSceneSc2MotionController()->setEnabled();
+}
+
+void sceneHandler08_jumpOff(ExCommand *cmd) {
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->setFlags(mq->getFlags() | 1);
+
+ g_fp->_globalMessageQueueList->addMessageQueue(mq);
+
+ g_fp->_aniMan->startAnim(MV_MAN8_JUMPOFF, mq->_id, -1);
+
+ sceneHandler08_finishArcade();
+}
+
+void sceneHandler08_standUp() {
+ chainQueue(QU_SC8_STANDUP, 1);
+ g_vars->scene08_onBelly = false;
+}
+
+void sceneHandler08_jumpLogic(ExCommand *cmd) {
+ if (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) == PIC_SC8_LADDERD) {
+ sceneHandler08_jumpOff(cmd);
+
+ cmd->_messageKind = 0;
+ } else {
+ sceneHandler08_standUp();
+ }
+}
+
+void sceneHandler08_badLuck() {
+ g_fp->_currentScene->getPictureObjectById(PIC_SC8_LADDER, 0)->_flags &= 0xFFFB;
+
+ g_fp->_aniMan->changeStatics2(ST_MAN8_HANDSUP);
+ g_fp->_aniMan->setOXY(376, 280);
+ g_fp->_aniMan->_priority = 10;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ ExCommand *ex = new ExCommand(g_fp->_aniMan->_id, 1, MV_MAN8_BADLUCK, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ ex->_keyCode = g_fp->_aniMan->_okeyCode;
+ mq->addExCommandToEnd(ex);
+
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_fp->setObjectState(sO_StairsUp_8, g_fp->getObjectEnumState(sO_StairsUp_8, sO_NotBroken));
+
+ g_vars->scene08_inAir = false;
+}
+
+void sceneHandler08_sitDown() {
+ g_fp->_aniMan->setOXY(380, g_fp->_aniMan->_oy);
+
+ g_fp->_aniMan->changeStatics2(ST_MAN8_FLYDOWN);
+ g_fp->_aniMan->startAnim(MV_MAN8_SITDOWN, 0, -1);
+
+ g_vars->scene08_vmyats->changeStatics2(ST_VMT_MIN);
+ g_vars->scene08_vmyats->hide();
+
+ g_vars->scene08_inAir = false;
+ g_vars->scene08_onBelly = true;
+}
+
+void sceneHandler08_calcFlight() {
+ Common::Point point;
+ int y = g_vars->scene08_manOffsetY + g_fp->_aniMan->_oy;
+
+ g_fp->_aniMan->setOXY(g_fp->_aniMan->_ox, y);
+
+ g_vars->scene08_manOffsetY += 2;
+
+ if (g_vars->scene08_manOffsetY < g_vars->scene08_stairsOffset)
+ g_vars->scene08_manOffsetY = g_vars->scene08_stairsOffset;
+
+ y = y + g_fp->_aniMan->getSomeXY(point)->y;
+
+ if (g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYDOWN)
+ y -= 25;
+
+ if (y <= g_vars->scene08_vmyats->_oy) {
+ g_vars->scene08_vmyats->hide();
+ } else {
+ g_vars->scene08_vmyats->show1(-1, -1, -1, 0);
+
+ if (!g_vars->scene08_vmyats->_movement)
+ g_vars->scene08_vmyats->startAnim(MV_VMT_DEF, 0, -1);
+ }
+
+ if (g_fp->_aniMan->_oy <= 280 && g_vars->scene08_stairsVisible
+ && g_fp->_aniMan->_statics && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_HANDSUP) {
+ sceneHandler08_badLuck();
+ } else if (g_fp->_aniMan->_oy > 236 || g_vars->scene08_stairsVisible
+ || !g_fp->_aniMan->_statics || g_fp->_aniMan->_statics->_staticsId != ST_MAN8_HANDSUP) {
+ if (g_fp->_aniMan->_movement || g_fp->_aniMan->_oy < 660
+ || (g_vars->scene08_vmyats->_movement && g_vars->scene08_vmyats->_movement->_currDynamicPhaseIndex > 0)
+ || abs(g_vars->scene08_manOffsetY) > 2) {
+ if (g_vars->scene08_manOffsetY >= 0 && !g_fp->_aniMan->_movement) {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN8_HANDSUP)
+ g_fp->_aniMan->startAnim(MV_MAN8_HANDSDOWN, 0, -1);
+ else
+ g_fp->_aniMan->changeStatics2(ST_MAN8_FLYDOWN);
+ }
+
+ if (g_fp->_aniMan->_oy < 500 && !g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == ST_MAN8_FLYUP && g_vars->scene08_manOffsetY < 0)
+ g_fp->_aniMan->startAnim(MV_MAN8_HANDSUP, 0, -1);
+ } else {
+ sceneHandler08_sitDown();
+ }
+ } else {
+ sceneHandler08_enterUp();
+ }
+}
+
+void sceneHandler08_checkEndArcade() {
+ if (g_vars->scene08_flyingUp) {
+ int x = g_fp->_aniMan->_ox;
+ int y = g_vars->scene08_manOffsetY + g_fp->_aniMan->_oy;
+
+ if (!((g_vars->scene08_manOffsetY + g_fp->_aniMan->_oy) % 3))
+ g_vars->scene08_manOffsetY--;
+
+ g_fp->_aniMan->setOXY(x, y);
+
+ if (y < 80) {
+ sceneHandler08_finishArcade();
+
+ ExCommand *ex = new ExCommand(SC_8, 17, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_messageNum = 61;
+ ex->_excFlags |= 2;
+ ex->_keyCode = TrubaUp;
+
+ ex->postMessage();
+ }
+ }
+}
+
+int sceneHandler08(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_CMN_WINARCADE:
+ sceneHandler08_winArcade();
+ break;
+
+ case MSG_SC8_ENTERUP:
+ sceneHandler08_enterUp();
+ break;
+
+ case MSG_SC8_HIDELADDER_D:
+ sceneHandler08_hideLadder();
+ break;
+
+ case MSG_SC8_STANDUP:
+ g_vars->scene08_manOffsetY = -10;
+ g_vars->scene08_vmyats->changeStatics2(ST_VMT_MIN);
+ g_vars->scene08_vmyats->setOXY(382, 703);
+ g_vars->scene08_vmyats->_priority = 29;
+ g_vars->scene08_vmyats->_callback2 = sceneHandler08_pushCallback;
+ g_vars->scene08_inAir = true;
+ break;
+
+ case MSG_SC8_ARCADENOW:
+ sceneHandler08_arcadeNow();
+ break;
+
+ case MSG_SC8_RESUMEFLIGHT:
+ sceneHandler08_resumeFlight();
+ break;
+
+ case MSG_SC8_GETHIMUP:
+ g_vars->scene08_manOffsetY = 0;
+ g_vars->scene08_flyingUp = true;
+ break;
+
+ case MSG_STARTARCADE:
+ sceneHandler08_startArcade();
+ break;
+
+ case 29:
+ if (g_vars->scene08_inArcade) {
+ if (g_vars->scene08_inAir) {
+ sceneHandler08_airMoves();
+ break;
+ }
+ if (g_vars->scene08_onBelly) {
+ sceneHandler08_jumpLogic(cmd);
+ break;
+ }
+ }
+ break;
+
+ case 33:
+ {
+ int res = 0;
+
+ if (g_fp->_aniMan2) {
+ if (g_vars->scene08_inArcade) {
+ int scHeight = g_fp->_sceneRect.bottom - g_fp->_sceneRect.top;
+
+ if (g_fp->_aniMan2->_oy < g_fp->_sceneRect.top + 200) {
+ g_fp->_sceneRect.top = g_fp->_aniMan2->_oy - 200;
+
+ if (g_fp->_sceneRect.top < 0)
+ g_fp->_sceneRect.top = 0;
+
+ g_fp->_sceneRect.bottom = scHeight + g_fp->_sceneRect.top;
+ }
+
+ if (g_fp->_aniMan2->_oy > g_fp->_sceneRect.bottom - 350) {
+ g_fp->_sceneRect.bottom = g_fp->_aniMan2->_oy + 350;
+ g_fp->_sceneRect.top = g_fp->_aniMan2->_oy + 350 - scHeight;
+ }
+ } else {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
+
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
+
+ res = 1;
+ }
+ }
+
+ g_fp->_floaters->update();
+
+ if (g_vars->scene08_inArcade) {
+ if (g_vars->scene08_inAir)
+ sceneHandler08_calcFlight();
+ } else {
+ Movement *mov = g_fp->_aniMan->_movement;
+
+ if (mov) {
+ if (mov->_id == MV_MAN_TOLADDERD && mov->_currDynamicPhaseIndex == 8)
+ g_fp->_aniMan->_priority = 2;
+
+ if (mov && mov->_id == MV_MAN_FROMLADDERUP && mov->_currDynamicPhaseIndex == 13)
+ g_fp->_aniMan->_priority = 20;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+ }
+
+ if (g_vars->scene08_flyingUp)
+ sceneHandler08_checkEndArcade();
+
+ if (g_vars->scene08_snoringCountdown > 0) {
+ g_vars->scene08_snoringCountdown--;
+
+ if (!g_vars->scene08_snoringCountdown) {
+ g_fp->playSound(SND_8_014, 0);
+
+ g_vars->scene08_snoringCountdown = 71;
+ }
+ }
+
+ return res;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene10.cpp b/engines/fullpipe/scenes/scene10.cpp
new file mode 100644
index 0000000000..f8d16b2759
--- /dev/null
+++ b/engines/fullpipe/scenes/scene10.cpp
@@ -0,0 +1,220 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/behavior.h"
+#include "fullpipe/interaction.h"
+
+namespace Fullpipe {
+
+void scene10_initScene(Scene *sc) {
+ g_vars->scene10_gum = sc->getStaticANIObject1ById(ANI_GUM, -1);
+ g_vars->scene10_packet = sc->getStaticANIObject1ById(ANI_PACHKA, -1);
+ g_vars->scene10_packet2 = sc->getStaticANIObject1ById(ANI_PACHKA2, -1);
+ g_vars->scene10_inflater = sc->getStaticANIObject1ById(ANI_NADUVATEL, -1);
+ g_vars->scene10_ladder = sc->getPictureObjectById(PIC_SC10_LADDER, 0);
+
+ g_fp->lift_setButton(sO_Level1, ST_LBN_1N);
+ g_fp->lift_sub5(sc, QU_SC10_ENTERLIFT, QU_SC10_EXITLIFT);
+
+ if (g_fp->getObjectState(sO_Inflater) == g_fp->getObjectEnumState(sO_Inflater, sO_WithGum)) {
+ g_vars->scene10_hasGum = 1;
+ } else {
+ g_vars->scene10_hasGum = 0;
+ g_vars->scene10_gum->hide();
+ }
+}
+
+bool sceneHandler10_inflaterIsBlind() {
+ return g_vars->scene10_inflater->_movement
+ && g_vars->scene10_inflater->_movement->_id == MV_NDV_BLOW2
+ && g_vars->scene10_inflater->_movement->_currDynamicPhaseIndex < 42;
+}
+
+int scene10_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor == ANI_PACHKA || g_fp->_objectIdAtCursor == ANI_GUM) {
+ if (g_fp->_cursorId == PIC_CSR_ITN) {
+ if (g_vars->scene10_hasGum)
+ g_fp->_cursorId = (sceneHandler10_inflaterIsBlind() != 0) ? PIC_CSR_ITN_RED : PIC_CSR_ITN_GREEN;
+ else
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
+ }
+ }
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler10_clickGum() {
+ if (g_vars->scene10_hasGum) {
+ if (sceneHandler10_inflaterIsBlind()) {
+ if (g_vars->scene10_hasGum) {
+ int x = g_vars->scene10_gum->_ox - 139;
+ int y = g_vars->scene10_gum->_oy - 48;
+
+ if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(y - g_fp->_aniMan->_oy) > 1) {
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_RIGHT);
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC10_CLICKGUM, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags = 2;
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, x, y, 0, -1);
+ }
+ } else {
+ g_vars->scene10_hasGum = 0;
+
+ chainQueue(QU_SC10_TAKEGUM, 1);
+ }
+ }
+ } else {
+ g_vars->scene10_inflater->changeStatics2(ST_NDV_SIT);
+
+ if (g_fp->getObjectState(sO_Inflater) == g_fp->getObjectEnumState(sO_Inflater, sO_WithGum))
+ g_vars->scene10_inflater->startAnim(MV_NDV_DENIES, 0, -1);
+ else
+ g_vars->scene10_inflater->startAnim(MV_NDV_DENY_NOGUM, 0, -1);
+ }
+ }
+}
+
+void sceneHandler10_hideGum() {
+ g_vars->scene10_gum->hide();
+ g_vars->scene10_packet->hide();
+ g_vars->scene10_packet2->hide();
+}
+
+void sceneHandler10_showGum() {
+ if (g_vars->scene10_hasGum)
+ g_vars->scene10_gum->show1(-1, -1, -1, 0);
+
+ g_vars->scene10_packet->show1(-1, -1, -1, 0);
+ g_vars->scene10_packet2->show1(-1, -1, -1, 0);
+}
+
+
+int sceneHandler10(ExCommand *ex) {
+ if (ex->_messageKind != 17)
+ return 0;
+
+ switch(ex->_messageNum) {
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(ex);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC10_LADDERTOBACK:
+ g_vars->scene10_ladder->_priority = 49;
+ break;
+
+ case MSG_SC10_LADDERTOFORE:
+ g_vars->scene10_ladder->_priority = 0;
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_SC10_CLICKGUM:
+ sceneHandler10_clickGum();
+
+ ex->_messageKind = 0;
+ break;
+
+ case MSG_SC10_HIDEGUM:
+ sceneHandler10_hideGum();
+ break;
+
+ case MSG_SC10_SHOWGUM:
+ sceneHandler10_showGum();
+ break;
+
+ case 64:
+ g_fp->lift_sub05(ex);
+ break;
+
+ case 29:
+ {
+ if (g_fp->_currentScene->getPictureObjectIdAtPos(ex->_sceneClickX, ex->_sceneClickY) == PIC_SC10_LADDER) {
+ handleObjectInteraction(g_fp->_aniMan, g_fp->_currentScene->getPictureObjectById(PIC_SC10_DTRUBA, 0), ex->_keyCode);
+ ex->_messageKind = 0;
+
+ return 0;
+ }
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
+
+ if (ani && ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+ ex->_messageKind = 0;
+
+ return 0;
+ }
+ }
+ break;
+
+ case 33:
+ {
+ int res = 0;
+
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
+
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
+
+ res = 1;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ return res;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene11.cpp b/engines/fullpipe/scenes/scene11.cpp
new file mode 100644
index 0000000000..e7ed947a00
--- /dev/null
+++ b/engines/fullpipe/scenes/scene11.cpp
@@ -0,0 +1,786 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene11_dudeSwingCallback(int *arg) {
+ int oldarg = *arg;
+
+ *arg = 45 - (int)(g_vars->scene11_swingAngle * -29.66666666666666);
+
+ if (*arg < 1)
+ *arg = 1;
+
+ if (*arg > 90)
+ *arg = 90;
+
+ g_vars->scene11_swingAngleDiff = (g_vars->scene11_swingAngle - g_vars->scene11_swingOldAngle) * -490.0000000000001;
+ g_vars->scene11_swingSpeed = g_vars->scene11_swingAngleDiff * 0.0042 + g_vars->scene11_swingSpeed - g_vars->scene11_swingInertia * (g_vars->scene11_swingAngleDiff * 0.0042 + g_vars->scene11_swingSpeed);
+ g_vars->scene11_swingAngle = g_vars->scene11_swingSpeed * 0.0042 + g_vars->scene11_swingAngle;
+
+ if (g_vars->scene11_swingAngle < -1.5) {
+ g_vars->scene11_swingAngle = -1.5; //1.0004882812500000;
+ g_vars->scene11_swingSpeed = 0.0;
+ g_vars->scene11_swingAngleDiff = 0.0;
+ }
+
+ if (g_vars->scene11_swingAngle > 1.5) {
+ g_vars->scene11_swingAngle = 1.5; //1.9990234375;
+ g_vars->scene11_swingSpeed = 0.0;
+ g_vars->scene11_swingAngleDiff = 0.0;
+ }
+
+ if (g_vars->scene11_swingMaxAngle == *arg && 0.0 != g_vars->scene11_swingSpeed && fabs(g_vars->scene11_swingSpeed) < 2.5) {
+ g_vars->scene11_swingSpeed = 0.0;
+ g_vars->scene11_swingAngleDiff = 0.0;
+ g_vars->scene11_swingAngle = g_vars->scene11_swingOldAngle;
+ }
+
+ g_vars->scene11_swingCounter++;
+
+ if (g_vars->scene11_arcadeIsOn) {
+ if (g_vars->scene11_hintCounter <= 720) {
+ g_vars->scene11_hintCounter++;
+
+ if (g_vars->scene11_hintCounter == 720)
+ g_vars->scene11_hint->_flags |= 4;
+ }
+ }
+
+ if ((oldarg >= 45) != (*arg >= 45) && g_vars->scene11_arcadeIsOn) {
+ if (oldarg >= *arg)
+ g_fp->playSound(SND_11_031, 0);
+ else
+ g_fp->playSound(SND_11_020, 0);
+ }
+}
+
+void scene11_setupMusic() {
+ if (g_fp->getObjectState(sO_DudeHasJumped) == g_fp->getObjectEnumState(sO_DudeHasJumped, sO_Yes))
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_11"), "MUSIC2", 1);
+}
+
+void scene11_initScene(Scene *sc) {
+ g_vars->scene11_swingie = sc->getStaticANIObject1ById(ANI_SWINGER, -1);
+ g_vars->scene11_boots = sc->getStaticANIObject1ById(ANI_BOOTS_11, -1);
+ g_vars->scene11_mgm.clear();
+ g_vars->scene11_dudeOnSwing = sc->getStaticANIObject1ById(ANI_MAN11, -1);
+ g_vars->scene11_dudeOnSwing->_callback2 = scene11_dudeSwingCallback;
+ g_vars->scene11_dudeOnSwing = sc->getStaticANIObject1ById(ANI_KACHELI, -1);
+ g_vars->scene11_dudeOnSwing->_callback2 = scene11_dudeSwingCallback;
+ g_vars->scene11_hint = sc->getPictureObjectById(PIC_SC11_HINT, 0);
+ g_vars->scene11_hint->_flags &= 0xFFFB;
+
+ g_vars->scene11_arcadeIsOn = false;
+ g_vars->scene11_scrollIsEnabled = false;
+ g_vars->scene11_scrollIsMaximized = false;
+ g_vars->scene11_hintCounter = 0;
+ g_vars->scene11_swingieScreenEdge = 0;
+ g_vars->scene11_crySound = 0;
+ g_vars->scene11_swingAngle = 0.0;
+ g_vars->scene11_swingOldAngle = 0.0;
+ g_vars->scene11_swingSpeed = 0.0;
+ g_vars->scene11_swingAngleDiff = 0.0;
+ g_vars->scene11_swingInertia = 1.28; //1.9849218750000000;
+ g_vars->scene11_swingCounter = 0;
+ g_vars->scene11_swingCounterPrevTurn = 0;
+ g_vars->scene11_swingDirection = 0;
+ g_vars->scene11_swingDirectionPrevTurn = 0;
+
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_fp->_currentScene = sc;
+
+ int swingie = g_fp->getObjectState(sO_Swingie);
+
+ if (swingie == g_fp->getObjectEnumState(sO_Swingie, sO_IsSwinging)
+ || swingie == g_fp->getObjectEnumState(sO_Swingie, sO_IsSwingingWithBoot)) {
+ g_vars->scene11_swingIsSwinging = true;
+ g_vars->scene11_swingieStands = false;
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing1, 1);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 1);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 0);
+
+ ((MctlCompound *)getCurrSceneSc2MotionController())->replaceNodeX(805, 905);
+
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->replaceNodeX(303, 353);
+ } else if (swingie == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInBoots)
+ || swingie == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInCorner)) {
+ g_vars->scene11_swingIsSwinging = false;
+ g_vars->scene11_swingieStands = true;
+
+ g_vars->scene11_swingie->changeStatics2(ST_SWR_STAND3);
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing1, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 1);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 0);
+
+ ((MctlCompound *)getCurrSceneSc2MotionController())->replaceNodeX(905, 805);
+ } else {
+ g_vars->scene11_swingIsSwinging = false;
+ g_vars->scene11_swingieStands = false;
+
+ if (swingie == g_fp->getObjectEnumState(sO_Swingie, sO_IsSitting)) {
+ g_vars->scene11_swingie->_movement = 0;
+ g_vars->scene11_swingie->_statics = g_vars->scene11_swingie->getStaticsById(ST_SWR_SIT);
+ g_vars->scene11_swingie->setOXY(144, 389);
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing1, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 1);
+ } else {
+ g_vars->scene11_swingie->_movement = 0;
+ g_vars->scene11_swingie->_statics = g_vars->scene11_swingie->getStaticsById(ST_SWR_SITBALD);
+ g_vars->scene11_swingie->setOXY(144, 415);
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing1, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 1);
+ }
+ }
+
+ if (!g_vars->scene11_swingIsSwinging) {
+ g_vars->scene11_dudeOnSwing->changeStatics2(ST_KCH_STATIC);
+ g_vars->scene11_dudeOnSwing->setOXY(691, 371);
+ g_vars->scene11_dudeOnSwing->_priority = 20;
+
+ g_vars->scene11_dudeOnSwing->_flags |= 4;
+ }
+
+ g_fp->_currentScene = oldsc;
+
+ g_fp->initArcadeKeys("SC_11");
+ g_fp->setArcadeOverlay(PIC_CSR_ARCADE5);
+}
+
+void sceneHandler11_restartMan() {
+ chainObjQueue(0, QU_SC11_RESTARTMAN, 1);
+
+ getGameLoaderInteractionController()->enableFlag24();
+ getCurrSceneSc2MotionController()->setEnabled();
+
+ g_vars->scene11_scrollIsEnabled = false;
+}
+
+void sceneHandler11_hitMan() {
+ if (g_fp->_aniMan->_ox > 345 && g_fp->_aniMan->_ox < 355) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC11_MANFALL), 0, 0);
+
+ mq->setFlags(mq->getFlags() | 1);
+ if (!mq->chain(g_fp->_aniMan))
+ delete mq;
+
+ getCurrSceneSc2MotionController()->replaceNodeX(353, 303);
+ }
+}
+
+int scene11_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_vars->scene11_arcadeIsOn) {
+ if (g_fp->_cursorId != PIC_CSR_DEFAULT_INV && g_fp->_cursorId != PIC_CSR_ITN_INV)
+ g_fp->_cursorId = -1;
+ } else if (g_vars->scene11_swingie == g_fp->_objectAtCursor && g_fp->_inventory->getSelectedItemId() == ANI_INV_BOOT)
+ g_fp->_cursorId = PIC_CSR_ITN_INV;
+
+ return g_fp->_cursorId;
+}
+
+int sceneHandler11_updateScreenCallback() {
+ int res = g_fp->drawArcadeOverlay(g_vars->scene11_arcadeIsOn);
+
+ if (!res)
+ g_fp->_updateScreenCallback = 0;
+
+ return res;
+}
+
+void sceneHandler11_manToSwing() {
+ g_vars->scene11_arcadeIsOn = true;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_fp->_aniMan2->hide();
+
+ g_vars->scene11_swingCounter = 0;
+ g_vars->scene11_swingInertia = 1.28; //1.9849218;
+
+ g_vars->scene11_dudeOnSwing->_flags &= 0xFFFB;
+ g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN11, -1);
+ g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
+ g_vars->scene11_dudeOnSwing->_movement = 0;
+ g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_0, 0);
+ g_vars->scene11_dudeOnSwing->_priority = 20;
+ g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_0, 0, -1);
+ g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(45);
+
+ g_vars->scene11_mgm.addItem(g_fp->_aniMan->_id);
+
+ g_fp->_currentScene->_x = 1400 - g_fp->_sceneRect.right;
+
+ g_vars->scene11_scrollIsEnabled = true;
+ g_fp->_updateScreenCallback = sceneHandler11_updateScreenCallback;
+}
+
+void sceneHandler11_putABoot() {
+ if (g_vars->scene11_boots->_flags & 4) {
+ if (g_vars->scene11_boots->_statics->_staticsId == ST_BTS11_ONE)
+ chainObjQueue(0, QU_SC11_PUTBOOT2, 1);
+ } else {
+ chainObjQueue(0, QU_SC11_PUTBOOT1, 1);
+ }
+}
+
+void sceneHandler11_putBoot() {
+ if (abs(353 - g_fp->_aniMan->_ox) > 1 || abs(498 - g_fp->_aniMan->_oy) > 1
+ || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 353, 498, 1, ST_MAN_RIGHT);
+
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC11_PUTBOOT, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, 353, 498, 0, -1);
+ }
+ } else {
+ sceneHandler11_putABoot();
+ }
+}
+
+void sceneHandler11_showSwing() {
+ g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_KACHELI, -1);
+ g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_KCH_0);
+ g_vars->scene11_dudeOnSwing->_movement = 0;
+ g_vars->scene11_dudeOnSwing->show1(691, 371, MV_KCH_START, 0);
+ g_vars->scene11_dudeOnSwing->_priority = 20;
+}
+
+void sceneHandler11_jumpFromSwing() {
+ g_vars->scene11_arcadeIsOn = false;
+ g_vars->scene11_hint->_flags &= 0xFFFB;
+ g_vars->scene11_scrollIsEnabled = false;
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_vars->scene11_swingOldAngle = 0.0;
+ g_vars->scene11_swingAngleDiff = 0.0;
+ g_vars->scene11_swingSpeed = 0.0;
+ g_vars->scene11_swingAngle = 0.0;
+
+ g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN11, -1);
+ g_vars->scene11_dudeOnSwing->_flags &= 0xFFFB;
+ g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_KACHELI, -1);
+ g_vars->scene11_dudeOnSwing->changeStatics2(ST_KCH_STATIC);
+ g_vars->scene11_dudeOnSwing->setOXY(691, 371);
+ g_vars->scene11_dudeOnSwing->_priority = 20;
+ g_vars->scene11_dudeOnSwing->_flags |= 4;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand *ex = new ExCommand(g_fp->_aniMan->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);
+ ex->_field_14 = 256;
+ ex->_messageNum = 0;
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+ mq->setFlags(mq->getFlags() | 1);
+
+ g_fp->_globalMessageQueueList->addMessageQueue(mq);
+
+ g_fp->_aniMan->_flags |= 0x104;
+ g_fp->_aniMan->changeStatics2(ST_MAN11_SWING);
+ g_fp->_aniMan->setOXY(685, 373);
+ g_fp->_aniMan->startAnim(MV_MAN11_JUMPFROMSWING, mq->_id, -1);
+
+ g_fp->_aniMan2 = g_fp->_aniMan;
+}
+
+void sceneHandler11_swing0() {
+ g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
+ g_vars->scene11_dudeOnSwing->_movement = 0;
+ g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_0, 0);
+ g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_0, 0, -1);
+ g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex);
+
+ g_vars->scene11_swingDirection = 0;
+ g_vars->scene11_swingMaxAngle = 45;
+ g_vars->scene11_swingOldAngle = 0.0;
+}
+
+void sceneHandler11_swing1() {
+ g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
+ g_vars->scene11_dudeOnSwing->_movement = 0;
+ g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_1, 0);
+ g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_1, 0, -1);
+ g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex);
+
+ g_vars->scene11_swingDirection = 1;
+ g_vars->scene11_swingMaxAngle = 42;
+ g_vars->scene11_swingOldAngle = -(fabs(g_vars->scene11_swingAngle) * 0.075 + 0.12);
+}
+
+void sceneHandler11_swing2() {
+ g_vars->scene11_dudeOnSwing->_statics = g_vars->scene11_dudeOnSwing->getStaticsById(ST_MAN11_EMPTY);
+ g_vars->scene11_dudeOnSwing->_movement = 0;
+ g_vars->scene11_dudeOnSwing->show1(690, 215, MV_MAN11_SWING_2, 0);
+ g_vars->scene11_dudeOnSwing->startAnim(MV_MAN11_SWING_2, 0, -1);
+ g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex);
+
+ g_vars->scene11_swingDirection = 2;
+ g_vars->scene11_swingMaxAngle = 48;
+ g_vars->scene11_swingOldAngle = fabs(g_vars->scene11_swingAngle) * 0.075 + 0.12;
+}
+
+void sceneHandler11_emptySwing() {
+ if (g_vars->scene11_swingDirection)
+ sceneHandler11_swing0();
+
+ g_vars->scene11_dudeOnSwing->stopAnim_maybe();
+ g_vars->scene11_dudeOnSwing->hide();
+ g_vars->scene11_dudeOnSwing = g_fp->_currentScene->getStaticANIObject1ById(ANI_KACHELI, -1);
+ g_vars->scene11_dudeOnSwing->show1(-1, -1, -1, 0);
+ g_vars->scene11_dudeOnSwing->changeStatics2(ST_KCH_EMPTY);
+ g_vars->scene11_dudeOnSwing->startAnim(MV_KCH_MOVE2, 0, -1);
+ g_vars->scene11_dudeOnSwing->_movement->setDynamicPhaseIndex(g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex);
+
+ g_vars->scene11_swingInertia = 0.03; //1.9881250;
+}
+
+void sceneHandler11_jumpHitAndWin() {
+ MGMInfo mgminfo;
+
+ sceneHandler11_emptySwing();
+
+ g_fp->_aniMan->show1(690 - (int)(sin(g_vars->scene11_swingAngle) * -267.0), 215 - (int)(cos(g_vars->scene11_swingAngle) * -267.0),
+ MV_MAN11_JUMPHIT, 0);
+ g_fp->_aniMan->_priority = 10;
+
+ mgminfo.field_1C = 10;
+ mgminfo.ani = g_fp->_aniMan;
+ mgminfo.staticsId2 = ST_MAN_1PIX;
+ mgminfo.x1 = 1400;
+ mgminfo.y1 = 0;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 66;
+ mgminfo.movementId = MV_MAN11_JUMPHIT;
+
+ MessageQueue *mq = g_vars->scene11_mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ g_vars->scene11_crySound = SND_11_024;
+ ExCommand *ex = new ExCommand(ANI_MAN, 2, 36, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = -1;
+ ex->_excFlags = 2;
+
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(SC_11, 17, 61, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = TrubaRight;
+ ex->_excFlags = 3;
+
+ mq->addExCommandToEnd(ex);
+
+ if (!mq->chain(g_fp->_aniMan))
+ delete mq;
+
+
+ if (g_fp->getObjectState(sO_Swingie) == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInCorner))
+ g_fp->setObjectState(sO_Swingie, g_fp->getObjectEnumState(sO_Swingie, sO_IsSitting));
+
+ g_fp->setObjectState(sO_DudeHasJumped, g_fp->getObjectEnumState(sO_DudeHasJumped, sO_Yes));
+ }
+}
+
+void sceneHandler11_jumpOver(double angle) {
+ MGMInfo mgminfo;
+
+ sceneHandler11_emptySwing();
+
+ g_fp->_aniMan->show1(690 - (int)(sin(g_vars->scene11_swingAngle) * -267.0), 215 - (int)(cos(g_vars->scene11_swingAngle) * -267.0),
+ MV_MAN11_JUMPOVER, 0);
+ g_fp->_aniMan->_priority = 0;
+
+ mgminfo.staticsId2 = ST_MAN_1PIX;
+ mgminfo.ani = g_fp->_aniMan;
+ mgminfo.x1 = 1163;
+ mgminfo.y1 = 837 - (int)(angle * 153.0);
+ mgminfo.field_1C = 0;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_MAN11_JUMPOVER;
+
+ MessageQueue *mq = g_vars->scene11_mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ g_vars->scene11_crySound = SND_11_022;
+
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC11_RESTARTMAN, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags = 2;
+
+ mq->addExCommandToEnd(ex);
+
+ if (!mq->chain(g_fp->_aniMan))
+ delete mq;
+ }
+}
+
+void sceneHandler11_jumpHit(double angle) {
+ MGMInfo mgminfo;
+
+ sceneHandler11_emptySwing();
+
+ if (angle >= 0.0) {
+ if (angle > 1.0)
+ angle = 1.0;
+ } else {
+ angle = 0.0;
+ }
+
+ g_fp->_aniMan->show1(690 - (int)(sin(g_vars->scene11_swingAngle) * -267.0), 215 - (int)(cos(g_vars->scene11_swingAngle) * -267.0),
+ MV_MAN11_JUMPOVER, 0);
+ g_fp->_aniMan->_priority = 0;
+
+ mgminfo.staticsId2 = ST_MAN_1PIX;
+ mgminfo.ani = g_fp->_aniMan;
+ mgminfo.x1 = 1017 - (int)(angle * -214.0);
+ mgminfo.y1 = 700;
+ mgminfo.field_1C = 0;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 78;
+ mgminfo.movementId = MV_MAN11_JUMPHIT;
+
+ MessageQueue *mq = g_vars->scene11_mgm.genMovement(&mgminfo);
+
+ if (mq) {
+ g_vars->scene11_crySound = SND_11_022;
+
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC11_RESTARTMAN, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags = 2;
+
+ mq->addExCommandToEnd(ex);
+
+ if (!mq->chain(g_fp->_aniMan))
+ delete mq;
+
+ }
+}
+
+void sceneHandler11_swingLogic() {
+ if (g_vars->scene11_dudeOnSwing->_movement) {
+ int ph = g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex;
+ if (ph > 53 && ph < 90) {
+ if (ph < 70 && g_vars->scene11_swingSpeed >= 22.0) {
+ sceneHandler11_jumpOver((double)ph * 0.01428571428571429); // = 1 / 70
+ } else if (ph <= 80 && g_vars->scene11_swingSpeed >= 22.0) {
+ sceneHandler11_jumpHitAndWin();
+ } else {
+ sceneHandler11_jumpHit((double)ph * g_vars->scene11_swingSpeed * 0.0006493506493506494); // = 1/1540
+ }
+
+ g_vars->scene11_arcadeIsOn = false;
+ g_vars->scene11_hint->_flags &= 0xFFFB;
+ return;
+ }
+
+ if (ph > 38 && ph < 53 && fabs(g_vars->scene11_swingSpeed) <= 5.0)
+ sceneHandler11_jumpFromSwing();
+ }
+}
+
+void sceneHandler11_setSwingDirection() {
+ if (g_vars->scene11_swingDirection == 2)
+ g_vars->scene11_swingDirectionPrevTurn = 1;
+ else if (g_vars->scene11_swingDirection == 1)
+ g_vars->scene11_swingDirectionPrevTurn = 2;
+ else
+ g_vars->scene11_swingDirectionPrevTurn = (g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex <= 45) + 1;
+}
+
+void sceneHandler11_swingieSit() {
+ if (g_fp->getObjectState(sO_Swingie) == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInBoots)) {
+ g_vars->scene11_swingIsSwinging = false;
+ g_vars->scene11_swingieStands = false;
+
+ g_vars->scene11_swingie->changeStatics2(ST_SWR_SIT);
+ g_vars->scene11_swingie->setOXY(144, 389);
+
+ g_fp->setObjectState(sO_Swingie, g_fp->getObjectEnumState(sO_Swingie, sO_IsSitting));
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing1, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 1);
+ }
+}
+
+void sceneHandler11_swingieJumpDown() {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SWR_JUMPDOWN), 0, 0);
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ if (!mq->chain(g_vars->scene11_swingie))
+ delete mq;
+
+ g_vars->scene11_swingIsSwinging = false;
+ g_vars->scene11_swingieStands = true;
+ g_vars->scene11_swingieScreenEdge = g_fp->_sceneRect.left;
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing1, 0);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing2, 1);
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing3, 0);
+
+ getCurrSceneSc2MotionController()->replaceNodeX(905, 805);
+}
+
+void sceneHandler11_winArcade() {
+ if (g_vars->scene11_arcadeIsOn) {
+ g_vars->scene11_arcadeIsOn = false;
+
+ sceneHandler11_emptySwing();
+
+ g_fp->_gameLoader->preloadScene(SC_11, TrubaRight);
+ }
+}
+
+int sceneHandler11(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_CMN_WINARCADE:
+ sceneHandler11_winArcade();
+ break;
+
+ case MSG_SC11_SITSWINGER:
+ if (g_fp->getObjectState(sO_Swingie) == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInBoots)
+ || g_fp->getObjectState(sO_Swingie) == g_fp->getObjectEnumState(sO_Swingie, sO_IsStandingInCorner)) {
+ g_fp->setObjectState(sO_Swingie, g_fp->getObjectEnumState(sO_Swingie, sO_IsSitting));
+ }
+ break;
+
+ case MSG_SC11_MANCRY:
+ g_fp->playSound(g_vars->scene11_crySound, 0);
+
+ g_vars->scene11_crySound = 0;
+ break;
+
+ case MSG_SC11_RESTARTMAN:
+ sceneHandler11_restartMan();
+ break;
+
+ case MSG_SC11_HITMAN:
+ sceneHandler11_hitMan();
+ break;
+
+ case MSG_SC11_MANTOSWING:
+ sceneHandler11_manToSwing();
+ break;
+
+ case MSG_SC11_PUTBOOT:
+ sceneHandler11_putBoot();
+ break;
+
+ case MSG_SC11_SHOWSWING:
+ sceneHandler11_showSwing();
+ break;
+
+ case 107:
+ if (g_vars->scene11_arcadeIsOn)
+ sceneHandler11_swingLogic();
+ break;
+
+ case 33:
+ {
+ int res = 0;
+ int x, y;
+
+ if (!g_fp->_aniMan2)
+ goto LABEL_27;
+
+ x = g_fp->_aniMan2->_ox;
+ y = g_fp->_aniMan2->_oy;
+
+ g_vars->scene11_dudeX = x;
+ g_vars->scene11_dudeY = y;
+
+ if (g_vars->scene11_scrollIsEnabled) {
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x - g_fp->_sceneRect.right + 300;
+ goto LABEL_26;
+ }
+
+ if (g_vars->scene11_scrollIsMaximized) {
+ g_fp->_currentScene->_x = g_fp->_sceneWidth - x;
+
+ if (g_vars->scene11_dudeX < 910)
+ g_vars->scene11_scrollIsMaximized = false;
+
+ LABEL_26:
+ res = 1;
+ LABEL_27:
+ if (g_vars->scene11_swingieStands) {
+ if (g_fp->_sceneRect.left >= 534 && g_vars->scene11_swingieScreenEdge < 534)
+ sceneHandler11_swingieSit();
+
+ g_vars->scene11_swingieScreenEdge = g_fp->_sceneRect.left;
+ }
+
+ if (!g_vars->scene11_arcadeIsOn)
+ goto LABEL_50;
+
+ if (g_vars->scene11_swingCounterPrevTurn <= 0 || g_vars->scene11_swingCounter - g_vars->scene11_swingCounterPrevTurn <= 72) {
+ } else {
+ sceneHandler11_swing0();
+ g_vars->scene11_swingDirectionPrevTurn = 0;
+ g_vars->scene11_swingCounterPrevTurn = 0;
+ }
+
+ if (!g_vars->scene11_arcadeIsOn)
+ goto LABEL_50;
+
+ if (g_vars->scene11_swingDirection == g_vars->scene11_swingDirectionPrevTurn || g_vars->scene11_swingCounterPrevTurn <= 0 || g_vars->scene11_swingCounter - g_vars->scene11_swingCounterPrevTurn <= 2) {
+ LABEL_49:
+ if (g_vars->scene11_arcadeIsOn) {
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+ return res;
+ }
+ LABEL_50:
+ if (g_vars->scene11_swingIsSwinging
+ || (0.0 == g_vars->scene11_swingSpeed
+ && g_vars->scene11_dudeOnSwing->_movement != 0
+ && g_vars->scene11_dudeOnSwing->_movement->_currDynamicPhaseIndex == 45
+ && (g_vars->scene11_dudeOnSwing->changeStatics2(ST_KCH_STATIC), !g_vars->scene11_arcadeIsOn)
+ && g_vars->scene11_swingIsSwinging)) {
+ if (!g_vars->scene11_swingie->_movement) {
+ if ((g_vars->scene11_boots->_flags & 4) && g_vars->scene11_boots->_statics->_staticsId == ST_BTS11_2) {
+ sceneHandler11_swingieJumpDown();
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+ return res;
+ }
+ g_vars->scene11_swingie->startAnim(MV_SWR_SWING, 0, -1);
+ }
+ }
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+ return res;
+ }
+
+ if (g_vars->scene11_swingDirectionPrevTurn == 1) {
+ if (!g_vars->scene11_swingDirection)
+ sceneHandler11_swing1();
+ else
+ sceneHandler11_swing0();
+ } else if (g_vars->scene11_swingDirectionPrevTurn == 2) {
+ if (!g_vars->scene11_swingDirection)
+ sceneHandler11_swing2();
+ else
+ sceneHandler11_swing0();
+ }
+
+ g_vars->scene11_swingCounterPrevTurn = g_vars->scene11_swingCounter;
+ goto LABEL_49;
+ }
+ if (x >= g_fp->_sceneRect.left + 200) {
+ if (x <= g_fp->_sceneRect.right - 200) {
+ LABEL_18:
+ if (y < g_fp->_sceneRect.top + 200) {
+ g_fp->_currentScene->_y = y - g_fp->_sceneRect.top - 300;
+ y = g_vars->scene11_dudeY;
+ x = g_vars->scene11_dudeX;
+ }
+ if (y > g_fp->_sceneRect.bottom - 300) {
+ g_fp->_currentScene->_y = y - g_fp->_sceneRect.bottom + 300;
+ x = g_vars->scene11_dudeX;
+ }
+ if (x >= 940)
+ g_vars->scene11_scrollIsMaximized = true;
+ goto LABEL_26;
+ }
+ g_fp->_currentScene->_x = x - g_fp->_sceneRect.right + 300;
+ } else {
+ g_fp->_currentScene->_x = x - g_fp->_sceneRect.left - 300;
+ }
+ y = g_vars->scene11_dudeY;
+ x = g_vars->scene11_dudeX;
+ goto LABEL_18;
+ }
+
+ break;
+
+ case 29:
+ if (g_vars->scene11_swingIsSwinging) {
+ if (g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y) == g_vars->scene11_swingie
+ && cmd->_keyCode == ANI_INV_BOOT)
+ sceneHandler11_putBoot();
+ } else {
+ if (g_vars->scene11_arcadeIsOn) {
+ sceneHandler11_setSwingDirection();
+
+ g_vars->scene11_swingCounterPrevTurn = g_vars->scene11_swingCounter;
+ }
+ }
+
+ if (!g_vars->scene11_arcadeIsOn) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+
+ return 0;
+ }
+ }
+ }
+ return 0;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene12.cpp b/engines/fullpipe/scenes/scene12.cpp
new file mode 100644
index 0000000000..0295efcaf5
--- /dev/null
+++ b/engines/fullpipe/scenes/scene12.cpp
@@ -0,0 +1,85 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objects.h"
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/scene.h"
+#include "fullpipe/floaters.h"
+#include "fullpipe/messages.h"
+#include "fullpipe/statics.h"
+#include "fullpipe/behavior.h"
+
+namespace Fullpipe {
+
+void scene12_initScene(Scene *sc) {
+ GameVar *var = g_fp->getGameLoaderGameVar()->getSubVarByName("SC_12");
+ g_fp->_floaters->init(var);
+
+ g_vars->scene12_fly = g_fp->getObjectState(sO_Fly_12);
+
+ if (g_vars->scene12_fly)
+ g_vars->scene12_flyCountdown = g_fp->_rnd->getRandomNumber(600) + 600;
+
+ g_fp->setObjectState(sO_Fly_12, g_fp->_rnd->getRandomNumber(1));
+}
+
+void sceneHandler12_updateFloaters() {
+ g_fp->_floaters->genFlies(g_fp->_currentScene, 397, -50, 100, 6);
+
+ g_fp->_floaters->_array2[0]->countdown = g_fp->_rnd->getRandomNumber(6) + 4;
+ g_fp->_floaters->_array2[0]->val6 = 397;
+ g_fp->_floaters->_array2[0]->val7 = -50;
+}
+
+int sceneHandler12(ExCommand *cmd) {
+ int res = 0;
+
+ if (cmd->_messageKind == 17 && cmd->_messageNum == 33) {
+ if (g_fp->_aniMan2) {
+ if (g_fp->_aniMan2->_ox < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.left - 300;
+
+ if (g_fp->_aniMan2->_ox > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = g_fp->_aniMan2->_ox - g_fp->_sceneRect.right + 300;
+
+ res = 1;
+ }
+
+ g_vars->scene12_flyCountdown--;
+
+ if (!g_vars->scene12_flyCountdown)
+ sceneHandler12_updateFloaters();
+
+ g_fp->_floaters->update();
+
+ g_fp->_behaviorManager->updateBehaviors();
+ }
+
+ return res;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene13.cpp b/engines/fullpipe/scenes/scene13.cpp
new file mode 100644
index 0000000000..0a0c2f3906
--- /dev/null
+++ b/engines/fullpipe/scenes/scene13.cpp
@@ -0,0 +1,380 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene13_initScene(Scene *sc) {
+ g_vars->scene13_whirlgig = sc->getStaticANIObject1ById(ANI_WHIRLGIG_13, -1);
+ g_vars->scene13_guard = sc->getStaticANIObject1ById(ANI_STOROZH, -1);
+ g_vars->scene13_handleR = sc->getStaticANIObject1ById(ANI_HANDLE_R, -1);
+ g_vars->scene13_handleL = sc->getStaticANIObject1ById(ANI_HANDLE_L, -1);
+ g_vars->scene13_bridge = sc->getStaticANIObject1ById(ANI_BRIDGE, -1);
+ g_vars->scene13_guardDirection = true;
+
+ MovGraphLink *lnk = getSc2MctlCompoundBySceneId(sc->_sceneId)->getLinkByName(sO_Bridge);
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_Bridge) == g_fp->getObjectEnumState(sO_Bridge, sO_Convoluted)) {
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_CLOSED);
+
+ lnk->_flags |= 0x20000000u;
+
+ g_fp->playSound(SND_13_018, 1);
+
+ g_vars->scene13_whirlgig->_callback2 = 0;
+ } else {
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_OPEN2);
+
+ lnk->_flags &= 0xDFFFFFFF;
+
+ g_vars->scene13_whirlgig->stopAnim_maybe();
+ g_vars->scene13_whirlgig->_callback2 = 0;
+ g_vars->scene13_whirlgig->startAnim(MV_WHR13_SPIN, 0, -1);
+
+ if (g_vars->scene13_whirlgig->_movement)
+ g_vars->scene13_whirlgig->_movement->setDynamicPhaseIndex(30);
+
+ g_fp->playSound(SND_13_037, 1);
+ }
+
+ g_vars->scene13_bridge->_flags &= 0xFFFD;
+
+ g_fp->_currentScene = oldsc;
+
+ g_fp->initArcadeKeys("SC_13");
+}
+
+void sceneHandler13_openBridge() {
+ Movement *mov = g_vars->scene13_bridge->_movement;
+
+ if (mov && mov->_id == MV_BDG_CLOSE) {
+ int sz;
+
+ if (mov->_currMovement)
+ sz = mov->_currMovement->_dynamicPhases.size();
+ else
+ sz = mov->_dynamicPhases.size();
+
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_CLOSED);
+ g_vars->scene13_bridge->startAnim(MV_BDG_OPEN, 0, -1);
+
+ mov->setDynamicPhaseIndex(sz - mov->_currDynamicPhaseIndex);
+ } else {
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_CLOSED);
+ g_vars->scene13_bridge->startAnim(MV_BDG_OPEN, 0, -1);
+ }
+}
+
+void sceneHandler13_testClose() {
+ int id = g_vars->scene13_handleL->_statics->_staticsId;
+
+ if (id == ST_HDLL_UP)
+ chainQueue(QU_SC13_CLOSEFAIL, 1);
+ else if (id == ST_HDLL_FIRECAN || id == ST_HDLL_HAMMER)
+ chainQueue(QU_SC13_CLOSESUCCESS, 1);
+}
+
+void sceneHandler13_testOpen() {
+ switch (g_vars->scene13_handleR->_statics->_staticsId) {
+ case ST_HDLR_DOWN:
+ chainQueue(QU_SC13_OPENFAIL, 1);
+ break;
+
+ case ST_HDLR_DOWN_GUM:
+ chainQueue(QU_SC13_OPENSUCCESS, 1);
+ break;
+
+ case ST_HDLR_GUM:
+ g_vars->scene13_handleR->changeStatics2(ST_HDLR_DOWN_GUM);
+
+ chainQueue(QU_SC13_OPENSUCCESS, 1);
+ break;
+ }
+}
+
+void sceneHandler13_closeBridge() {
+ Movement *mov = g_vars->scene13_bridge->_movement;
+
+ if (mov && mov->_id == MV_BDG_OPEN) {
+ int sz;
+
+ if (mov->_currMovement)
+ sz = mov->_currMovement->_dynamicPhases.size();
+ else
+ sz = mov->_dynamicPhases.size();
+
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_OPEN2);
+ g_vars->scene13_bridge->startAnim(MV_BDG_CLOSE, 0, -1);
+
+ mov->setDynamicPhaseIndex(sz - mov->_currDynamicPhaseIndex);
+ } else {
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_OPEN2);
+ g_vars->scene13_bridge->startAnim(MV_BDG_CLOSE, 0, -1);
+ }
+}
+
+void sceneHandler13_closeFast() {
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_OPEN2);
+ g_vars->scene13_bridge->startAnim(MV_BDG_CLOSE, 0, -1);
+ g_vars->scene13_bridge->_movement->setDynamicPhaseIndex(21);
+}
+
+void sceneHandler13_stopWhirlgig() {
+ g_vars->scene13_whirlgig->_callback2 = 0;
+
+ g_fp->stopAllSoundInstances(SND_13_018);
+ g_fp->playSound(SND_13_033, 0);
+ g_fp->playSound(SND_13_037, 1);
+}
+
+void sceneHandler13_startWhirlgig() {
+ g_vars->scene13_whirlgig->_callback2 = 0;
+
+ g_fp->playSound(SND_13_018, 1);
+ g_fp->playSound(SND_13_034, 0);
+
+ g_fp->stopAllSoundInstances(SND_13_037);
+}
+
+void sceneHandler13_openFast() {
+ g_vars->scene13_bridge->changeStatics2(ST_BDG_CLOSED);
+ g_vars->scene13_bridge->startAnim(MV_BDG_OPEN, 0, -1);
+ g_vars->scene13_bridge->_movement->setDynamicPhaseIndex(15);
+}
+
+void sceneHandler13_uneatGum() {
+ BehaviorEntryInfo *beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_RIGHT, QU_STR_CHEW);
+
+ if (beh) {
+ beh->_percent = 0;
+ beh->_delay = 36;
+ }
+
+ beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_RIGHT, QU_STR_PLUU);
+ if (beh) {
+ beh->_percent = 0;
+ beh->_delay = 36;
+ }
+}
+
+void sceneHandler13_eatGum() {
+ BehaviorEntryInfo *beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_RIGHT, QU_STR_CHEW);
+
+ if (beh) {
+ beh->_percent = 10922;
+ beh->_delay = 0;
+ }
+}
+
+void sceneHandler13_updateBridge() {
+ MovGraphLink *lnk = getCurrSceneSc2MotionController()->getLinkByName(sO_Bridge);
+
+ if (lnk) {
+ if (g_fp->getObjectState(sO_Bridge) == g_fp->getObjectEnumState(sO_Bridge, sO_Convoluted))
+ lnk->_flags |= 0x20000000;
+ else
+ lnk->_flags &= 0xDFFFFFFF;
+ }
+}
+
+void sceneHandler13_showGum() {
+ chainQueue(QU_SC13_SHOWGUM, 0);
+}
+
+void sceneHandler13_setBehFlag(BehaviorEntryInfo *beh, bool flag) {
+ if (!flag) {
+ beh->_percent = 327;
+ beh->_flags |= 1;
+ beh->_delay = 36;
+ } else {
+ beh->_percent = 0x7FFF;
+ beh->_flags &= 0xFFFFFFFE;
+ beh->_delay = 0;
+ }
+}
+
+void sceneHandler13_walkForward(bool flag) {
+ BehaviorEntryInfo *beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_RIGHT, QU_STR_RTOL);
+
+ sceneHandler13_setBehFlag(beh, flag);
+
+ beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_LEFT, QU_STR_TURNR);
+
+ sceneHandler13_setBehFlag(beh, flag);
+
+ beh->_flags &= 0xFE;
+}
+
+void sceneHandler13_walkBackward(bool flag) {
+ BehaviorEntryInfo *beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_RIGHT|0x4000, QU_STR_LTOR);
+
+ sceneHandler13_setBehFlag(beh, flag);
+
+ beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene13_guard, ST_STR_LEFT|0x4000, QU_STR_TURNR_L);
+
+ sceneHandler13_setBehFlag(beh, flag);
+
+ beh->_flags &= 0xFE;
+}
+
+int sceneHandler13(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_SC13_OPENBRIDGE:
+ sceneHandler13_openBridge();
+ break;
+
+ case MSG_SC13_TESTCLOSE:
+ sceneHandler13_testClose();
+ break;
+
+ case MSG_SC13_TESTOPEN:
+ sceneHandler13_testOpen();
+ break;
+
+ case MSG_SC13_CLOSEBRIDGE:
+ sceneHandler13_closeBridge();
+ break;
+
+ case MSG_SC13_CLOSEFAST:
+ sceneHandler13_closeFast();
+ break;
+
+ case MSG_SC13_STOPWHIRLGIG:
+ sceneHandler13_stopWhirlgig();
+ break;
+
+ case MSG_SC13_STARTWHIRLGIG:
+ sceneHandler13_startWhirlgig();
+ break;
+
+ case MSG_SC13_OPENFAST:
+ sceneHandler13_openFast();
+ break;
+
+ case MSG_SC13_UNEATGUM:
+ sceneHandler13_uneatGum();
+ break;
+
+ case MSG_SC13_EATGUM:
+ sceneHandler13_eatGum();
+ break;
+
+ case MSG_SC13_CHEW:
+ g_vars->scene13_guard->_flags &= 0xFF7Fu;
+ break;
+
+ case MSG_SC13_UPDATEBRIDGE:
+ sceneHandler13_updateBridge();
+ break;
+
+ case MSG_SC13_SHOWGUM:
+ sceneHandler13_showGum();
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47
+ && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+ }
+ }
+ }
+ break;
+ }
+
+ case 33:
+ {
+ int res = 0;
+ int x;
+
+ if (g_fp->_aniMan2) {
+ x = g_fp->_aniMan2->_ox;
+ g_vars->scene13_dudeX = x;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - g_fp->_sceneRect.left - 300;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x - g_fp->_sceneRect.right + 300;
+
+ res = 1;
+ } else {
+ x = g_vars->scene13_dudeX;
+ }
+
+ if (g_vars->scene13_guardDirection) {
+ if (x < 1022) {
+ sceneHandler13_walkForward(1);
+ sceneHandler13_walkBackward(0);
+
+ g_vars->scene13_guardDirection = false;
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ return res;
+ }
+ } else if (x > 1022) {
+ sceneHandler13_walkForward(0);
+ sceneHandler13_walkBackward(1);
+
+ g_vars->scene13_guardDirection = true;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ return res;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene14.cpp b/engines/fullpipe/scenes/scene14.cpp
new file mode 100644
index 0000000000..4a09bc9cb6
--- /dev/null
+++ b/engines/fullpipe/scenes/scene14.cpp
@@ -0,0 +1,849 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/input.h"
+
+namespace Fullpipe {
+
+void scene14_initScene(Scene *sc) {
+ g_vars->scene14_grandma = sc->getStaticANIObject1ById(ANI_GRANDMA, -1);
+ g_vars->scene14_sceneDeltaX = 200;
+ g_vars->scene14_sceneDeltaY = 200;
+ g_vars->scene14_arcadeIsOn = false;
+ g_vars->scene14_dudeIsKicking = false;
+ g_vars->scene14_ballIsFlying = false;
+ g_vars->scene14_dudeCanKick = false;
+ g_vars->scene14_sceneDiffX = 300;
+ g_vars->scene14_sceneDiffY = 300;
+ g_vars->scene14_pink = 0;
+ g_vars->scene14_flyingBall = 0;
+ g_vars->scene14_balls.clear();
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_In_14)) {
+ g_vars->scene14_grandmaIsHere = true;
+
+ StaticANIObject *ball = sc->getStaticANIObject1ById(ANI_BALL14, -1);
+
+ ball->_flags &= 0xFFFB;
+ g_vars->scene14_balls.push_back(ball);
+
+ for (uint i = 0; i < 3; i++) {
+ ball = new StaticANIObject(ball); // create a copy
+
+ ball->_flags &= 0xFFFB;
+ g_vars->scene14_balls.push_back(ball);
+
+ sc->addStaticANIObject(ball, 1);
+ }
+ } else {
+ g_vars->scene14_grandmaIsHere = false;
+ g_vars->scene14_grandma->hide();
+ }
+
+ g_fp->lift_setButton(sO_Level4, ST_LBN_4N);
+ g_fp->lift_sub5(sc, QU_SC14_ENTERLIFT, QU_SC14_EXITLIFT);
+
+ g_fp->initArcadeKeys("SC_14");
+ g_fp->setArcadeOverlay(PIC_CSR_ARCADE6);
+}
+
+void scene14_setupMusic() {
+ if (!g_vars->scene14_grandmaIsHere)
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_14"), "MUSIC2", 0);
+}
+
+int scene14_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_vars->scene14_arcadeIsOn) {
+ if (g_vars->scene14_dudeIsKicking) {
+ g_fp->_cursorId = PIC_CSR_ARCADE2_D;
+ } else {
+ if (g_fp->_aniMan != g_fp->_objectAtCursor || g_fp->_aniMan->_movement || g_fp->_cursorId != PIC_CSR_DEFAULT) {
+ if (g_fp->_cursorId != PIC_CSR_DEFAULT_INV && g_fp->_cursorId != PIC_CSR_ITN_INV) {
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
+ }
+ } else {
+ g_fp->_cursorId = PIC_CSR_ITN;
+ }
+ }
+ }
+
+ return g_fp->_cursorId;
+}
+
+int sceneHandler14_updateScreenCallback() {
+ int res;
+
+ res = g_fp->drawArcadeOverlay(g_vars->scene14_arcadeIsOn);
+ if (!res)
+ g_fp->_updateScreenCallback = 0;
+
+ return res;
+}
+
+void sceneHandler14_showBallGrandmaHit2() {
+ if (g_vars->scene14_flyingBall) {
+ g_vars->scene14_flyingBall->show1(g_vars->scene14_grandmaX + 223, g_vars->scene14_grandmaY + 35, MV_BAL14_SPIN, 0);
+ g_vars->scene14_flyingBall->_priority = 27;
+
+ g_vars->scene14_pink = g_vars->scene14_flyingBall;
+
+ g_vars->scene14_flyingBall = 0;
+ }
+}
+
+void sceneHandler14_showBallGrandmaDive() {
+ if (g_vars->scene14_flyingBall) {
+ g_vars->scene14_flyingBall->show1(g_vars->scene14_grandmaX + 506, g_vars->scene14_grandmaY - 29, -1, 0);
+
+ g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
+ g_vars->scene14_flyingBall = 0;
+ }
+
+ g_fp->_aniMan2 = g_fp->_aniMan;
+}
+
+void sceneHandler14_showBallGrandmaHit() {
+ if (g_vars->scene14_flyingBall) {
+ g_vars->scene14_flyingBall->show1(g_vars->scene14_grandmaX + 190, g_vars->scene14_grandmaY + 56, MV_BAL14_TOGMA, 0);
+ g_vars->scene14_flyingBall->_priority = 27;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand *ex = new ExCommand(ANI_BALL14, 1, MV_BAL14_TOGMA, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
+ ex->_excFlags |= 2;
+ ex->_field_24 = 1;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_BALL14, 6, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+ mq->chain(0);
+
+ g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
+ g_vars->scene14_flyingBall = 0;
+ }
+}
+
+void sceneHandler14_exitScene() {
+ g_vars->scene14_arcadeIsOn = false;
+
+ if (g_fp->_aniMan->_movement)
+ g_fp->_aniMan->_movement->gotoLastFrame();
+
+ g_fp->_aniMan->stopAnim_maybe();
+
+ handleObjectInteraction(g_fp->_aniMan, g_fp->_currentScene->getPictureObjectById(PIC_SC14_RTRUBA, 0), 0);
+
+ g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);
+
+ chainQueue(QU_SC14_ENDARCADE, 0);
+
+ getGameLoaderInteractionController()->disableFlag24();
+ getCurrSceneSc2MotionController()->clearEnabled();
+}
+
+void sceneHandler14_showBallMan() {
+ if (g_vars->scene14_flyingBall) {
+ g_vars->scene14_flyingBall->show1(g_vars->scene14_dudeX - 166, g_vars->scene14_dudeY + 40, MV_BAL14_TOGMA, 0);
+ g_vars->scene14_flyingBall->_priority = 27;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand *ex = new ExCommand(ANI_BALL14, 1, MV_BAL14_TOGMA, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
+ ex->_excFlags |= 2;
+ ex->_field_24 = 1;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_BALL14, 6, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+ mq->chain(0);
+
+ g_vars->scene14_flyingBall->startAnim(MV_BAL14_TOGMA, 0, -1);
+
+ g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
+ g_vars->scene14_flyingBall = 0;
+
+ if (g_vars->scene14_dudeX >= 1300)
+ sceneHandler14_exitScene();
+ }
+}
+
+void sceneHandler14_manKickBall() {
+ int val = (g_vars->scene14_grandmaX + 65 - (g_vars->scene14_dudeX - 85)) / -32;
+ int den = val;
+
+ g_vars->scene14_ballX = g_vars->scene14_dudeX - 85;
+ g_vars->scene14_ballY = g_vars->scene14_dudeY - 76;
+ g_vars->scene14_ballDeltaX = -32;
+
+ if (!val)
+ den = 1;
+
+ g_vars->scene14_ballDeltaY = (g_vars->scene14_grandmaY - 102 - val * val / 2 - (g_vars->scene14_dudeY - 76)) / den;
+
+ g_vars->scene14_flyingBall->show1(g_vars->scene14_dudeX - 85, g_vars->scene14_dudeY - 76, -1, 0);
+ g_vars->scene14_flyingBall->startAnim(MV_BAL14_SPIN, 0, -1);
+ g_vars->scene14_flyingBall->_priority = 5;
+
+ g_vars->scene14_ballIsFlying = true;
+}
+
+void sceneHandler14_showBallFly() {
+ if (g_vars->scene14_balls.size()) {
+ g_vars->scene14_flyingBall = g_vars->scene14_balls.front();
+ g_vars->scene14_balls.pop_front();
+ }
+
+ int x, y;
+
+ if (g_vars->scene14_grandma->_movement) {
+ x = g_vars->scene14_grandma->_movement->_ox;
+ g_vars->scene14_ballX = x;
+ y = g_vars->scene14_grandma->_movement->_oy;
+ } else {
+ x = g_vars->scene14_grandmaX;
+ y = g_vars->scene14_grandmaY;
+ }
+
+ x = x + 38;
+ y = y - 77;
+
+ g_vars->scene14_ballDeltaX = 32;
+
+ int dist = (g_vars->scene14_dudeX - 16 - x) / 32;
+ int den = dist;
+
+ if (!dist)
+ den = 1;
+
+ g_vars->scene14_ballX = x + 32;
+ g_vars->scene14_ballDeltaY = (g_vars->scene14_dudeY - 40 - dist * dist / 2 - y) / den;
+ g_vars->scene14_ballY = g_vars->scene14_ballDeltaY + y;
+
+ g_vars->scene14_flyingBall->show1(x + 32, g_vars->scene14_ballDeltaY + y, MV_BAL14_SPIN, 0);
+ g_vars->scene14_flyingBall->_priority = 5;
+ g_vars->scene14_flyingBall->startAnim(MV_BAL14_SPIN, 0, -1);
+
+ g_vars->scene14_ballIsFlying = true;
+}
+
+void sceneHandler14_grandmaJump() {
+ BehaviorEntryInfo *beh1 = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene14_grandma, ST_GMA_SIT, QU_GMA_JUMPFW);
+ BehaviorEntryInfo *beh2 = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene14_grandma, ST_GMA_SIT, QU_GMA_JUMPBK);
+
+ if (beh1) {
+ if (beh2) {
+ int p = beh1->_percent;
+ beh1->_percent = beh2->_percent;
+ beh2->_percent = p;
+ }
+ }
+}
+
+void sceneHandler14_endArcade() {
+ g_vars->scene14_arcadeIsOn = false;
+
+ setInputDisabled(0);
+
+ getGameLoaderInteractionController()->enableFlag24();
+ getCurrSceneSc2MotionController()->setEnabled();
+
+ BehaviorEntryInfo *beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene14_grandma, ST_GMA_SIT, QU_GMA_BLINK);
+ if (beh)
+ beh->_percent = 327;
+
+ beh = g_fp->_behaviorManager->getBehaviorEntryInfoByMessageQueueDataId(g_vars->scene14_grandma, ST_GMA_SIT, QU_GMA_THROW);
+ if (beh)
+ beh->_percent = 0;
+
+ g_vars->scene14_sceneDeltaX = 200;
+ g_vars->scene14_sceneDeltaY = 200;
+
+ g_fp->_aniMan2 = g_fp->_aniMan;
+
+ g_vars->scene14_sceneDiffX = 300;
+ g_vars->scene14_sceneDiffY = 300;
+}
+
+void sceneHandler14_winArcade() {
+ if (g_vars->scene14_arcadeIsOn) {
+ if (g_vars->scene14_dudeIsKicking) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ g_vars->scene14_dudeIsKicking = false;
+ }
+
+ if (g_vars->scene14_flyingBall) {
+ g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
+
+ g_vars->scene14_flyingBall->_flags &= 0xFFFB;
+ g_vars->scene14_flyingBall = 0;
+ }
+
+ g_vars->scene14_ballIsFlying = false;
+
+ sceneHandler14_endArcade();
+
+ g_vars->scene14_grandmaIsHere = false;
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_In_14)) {
+ g_fp->setObjectState(sO_Grandma, g_fp->getObjectEnumState(sO_Grandma, sO_In_15));
+ g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);
+ g_vars->scene14_grandma->_flags &= 0xFFFB;
+ }
+
+ if (g_fp->_currentScene->_messageQueueId) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(g_fp->_currentScene->_messageQueueId);
+ if (mq)
+ delete mq;
+
+ g_fp->_currentScene->_messageQueueId = 0;
+ }
+ }
+}
+
+void sceneHandler14_showBallLast() {
+ if (g_vars->scene14_pink) {
+ g_vars->scene14_pink->show1(693, 491, MV_BAL14_SPIN, 0);
+ g_vars->scene14_pink->_priority = 27;
+ }
+}
+
+void sceneHandler14_hideBallLast() {
+ if (g_vars->scene14_pink) {
+ g_vars->scene14_pink->hide();
+ g_vars->scene14_balls.push_back(g_vars->scene14_pink);
+ g_vars->scene14_pink = 0;
+ }
+}
+
+void sceneHandler14_startArcade() {
+ g_vars->scene14_arcadeIsOn = true;
+ g_vars->scene14_dudeCanKick = true;
+
+ if (g_fp->_aniMan->_movement) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT | 0x4000);
+ g_fp->_aniMan->setOXY(1237, 451);
+ g_fp->_aniMan->_priority = 25;
+ }
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_fp->_aniMan2 = 0;
+ g_vars->scene14_sceneDeltaX = 50;
+ g_vars->scene14_sceneDiffX = 100;
+ g_vars->scene14_hitsLeft = 4;
+ g_vars->scene14_pink = 0;
+
+ chainQueue(QU_SC14_STARTARCADE, 0);
+
+ g_fp->_updateScreenCallback = sceneHandler14_updateScreenCallback;
+}
+
+void sceneHandler14_clearCallback() {
+ g_fp->_aniMan->_callback2 = 0;
+ g_vars->scene14_dudeIsKicking = false;
+}
+
+void sceneHandler14_kickAnimation() {
+ if (g_fp->_aniMan->_movement) {
+ sceneHandler14_clearCallback();
+
+ if (g_vars->scene14_flyingBall && g_vars->scene14_dudeX - g_vars->scene14_flyingBall->_ox < 180) {
+ g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_movement->_staticsObj2->_staticsId);
+ g_fp->_aniMan->startAnim(MV_MAN14_KICK, 0, -1);
+
+ g_vars->scene14_ballIsFlying = false;
+
+ g_vars->scene14_flyingBall->stopAnim_maybe();
+ g_vars->scene14_flyingBall->hide();
+ } else {
+ g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_movement->_staticsObj2->_staticsId);
+ g_fp->_aniMan->startAnim(MV_MAN14_KICKAIR, 0, -1);
+ }
+ }
+}
+
+void sceneHandler14_declineCallback(int *arg) {
+ Common::Point point;
+
+ if (g_vars->scene14_dudeIsKicking) {
+ *arg = (int)(sqrt((double)(g_fp->_mouseVirtY - g_vars->scene14_mouseCursorPos.y)
+ * (g_fp->_mouseVirtY - g_vars->scene14_mouseCursorPos.y)
+ + (g_fp->_mouseVirtX - g_vars->scene14_mouseCursorPos.x)
+ * (g_fp->_mouseVirtX - g_vars->scene14_mouseCursorPos.x)) * 0.1);
+
+ if (*arg > 11)
+ *arg = 11;
+ } else {
+ ++*arg;
+ }
+}
+
+void sceneHandler14_dudeDecline() {
+ g_vars->scene14_mouseCursorPos.x = g_fp->_mouseVirtX;
+ g_vars->scene14_mouseCursorPos.y = g_fp->_mouseVirtY;
+
+ g_fp->_aniMan->_callback2 = sceneHandler14_declineCallback;
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+ g_fp->_aniMan->startAnim(MV_MAN14_DECLINE, 0, -1);
+
+ g_vars->scene14_dudeIsKicking = true;
+}
+
+bool sceneHandler14_arcadeProcessClick(ExCommand *cmd) {
+ if (!getCurrSceneSc2MotionController()->_isEnabled)
+ return 0;
+
+ if (!g_vars->scene14_grandmaIsHere) {
+ if (!cmd->_keyCode) {
+ if (g_vars->scene14_pink) {
+ if (g_vars->scene14_pink->_flags & 4) {
+ if (cmd->_sceneClickX < g_vars->scene14_pink->_ox + 40) {
+ handleObjectInteraction(g_fp->_aniMan, g_vars->scene14_pink, 0);
+ cmd->_messageKind = 0;
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ if (getCurrSceneSc2MotionController()->_objtype != kObjTypeMctlCompound)
+ return false;
+
+ if (!getCurrSceneSc2MotionController()->_motionControllers[0]->_movGraphReactObj->pointInRegion(cmd->_sceneClickX, cmd->_sceneClickY))
+ return false;
+
+ if (cmd->_sceneClickX > 1237)
+ return false;
+
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1237, 451, 1, 0);
+
+ if (!mq)
+ return false;
+
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC14_STARTARCADE, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+ mq->setFlags(mq->getFlags() | 1);
+
+ postExCommand(g_fp->_aniMan->_id, 2, 1237, 451, 0, -1);
+
+ cmd->_messageKind = 0;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+ return true;
+}
+
+void sceneHandler14_grandmaThrow() {
+ g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);
+
+ MessageQueue *mq = new MessageQueue;
+ ExCommand *ex = new ExCommand(ANI_GRANDMA, 2, 30, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ mq->chain(0);
+}
+
+void sceneHandler14_passToGrandma() {
+ g_vars->scene14_flyingBall->stopAnim_maybe();
+ g_vars->scene14_flyingBall->_priority = 27;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+ ExCommand *ex = new ExCommand(ANI_BALL14, 1, MV_BAL14_FALL, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
+ ex->_excFlags |= 2;
+ ex->_field_24 = 1;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_BALL14, 6, 0, 0, 0, 0, 1, 0, 0, 0);
+ ex->_keyCode = g_vars->scene14_flyingBall->_okeyCode;
+ ex->_excFlags |= 3;
+ mq->addExCommandToEnd(ex);
+ mq->chain(0);
+
+ g_vars->scene14_balls.push_back(g_vars->scene14_flyingBall);
+ g_vars->scene14_flyingBall = 0;
+
+ sceneHandler14_grandmaThrow();
+}
+
+void sceneHandler14_grandmaJumpThrow() {
+ g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);
+
+ MessageQueue *mq = new MessageQueue;
+ ExCommand *ex = new ExCommand(ANI_GRANDMA, 2, 30, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_JUMPFW, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ mq->chain(0);
+
+ g_vars->scene14_dude2X += 71;
+ g_fp->_currentScene->_x = 71;
+
+ g_fp->_aniMan2 = g_fp->_aniMan;
+}
+
+void sceneHandler14_dudeFall() {
+ if (!g_fp->_aniMan->_movement || g_fp->_aniMan->_movement->_id != MV_MAN14_FALL) {
+ sceneHandler14_clearCallback();
+
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+ g_fp->_aniMan->startAnim(MV_MAN14_FALL, 0, -1);
+ g_vars->scene14_flyingBall->stopAnim_maybe();
+ g_vars->scene14_flyingBall->hide();
+
+ sceneHandler14_grandmaJumpThrow();
+ }
+ ++g_vars->scene14_hitsLeft;
+}
+
+void sceneHandler14_grandmaStepForward() {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+ g_fp->_aniMan->startAnim(MV_MAN14_STEPFW, 0, -1);
+
+ g_vars->scene14_dude2X -= 71;
+
+ g_fp->_currentScene->_x = -71;
+ g_fp->_aniMan2 = g_vars->scene14_grandma;
+}
+
+void sceneHandler14_arcadeLogic() {
+ g_vars->scene14_flyingBall->stopAnim_maybe();
+ g_vars->scene14_flyingBall->hide();
+
+ if (g_vars->scene14_dudeIsKicking)
+ sceneHandler14_clearCallback();
+
+ if (g_vars->scene14_hitsLeft <= 1) {
+ setInputDisabled(1);
+
+ sceneHandler14_clearCallback();
+
+ g_vars->scene14_dudeCanKick = false;
+ g_fp->_aniMan2 = 0;
+
+ chainQueue(QU_SC14_WINARCADE, 1);
+
+ --g_vars->scene14_hitsLeft;
+ } else {
+ ExCommand *ex;
+
+ g_vars->scene14_grandma->changeStatics2(ST_GMA_SIT);
+
+ if (g_vars->scene14_hitsLeft != 3 || g_vars->scene14_pink) {
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_BACKOFF, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ mq->chain(0);
+ } else {
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_BACKOFF2, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ ex = new ExCommand(ANI_GRANDMA, 1, MV_GMA_THROW, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 2;
+ mq->addExCommandToEnd(ex);
+
+ mq->chain(0);
+ }
+
+ sceneHandler14_grandmaStepForward();
+ --g_vars->scene14_hitsLeft;
+ }
+}
+
+void sceneHandler14_animateBall() {
+ int x = g_vars->scene14_ballDeltaX + g_vars->scene14_ballX;
+ int y = g_vars->scene14_ballDeltaY + g_vars->scene14_ballY;
+
+ g_vars->scene14_ballX += g_vars->scene14_ballDeltaX;
+ g_vars->scene14_ballY += g_vars->scene14_ballDeltaY;
+
+ g_vars->scene14_ballDeltaY++;
+
+ if (g_vars->scene14_ballDeltaY - 1 + g_vars->scene14_ballY > 517) {
+ if (x <= g_vars->scene14_dudeX - 16 ) {
+ if ( g_vars->scene14_ballDeltaX >= 0 || x >= g_vars->scene14_grandmaX + 65 || x <= g_vars->scene14_grandmaX - 135 || y <= g_vars->scene14_grandmaY - 102 ) {
+ if (g_vars->scene14_flyingBall->_movement)
+ g_vars->scene14_flyingBall->_movement->setOXY(x, y);
+ else
+ g_vars->scene14_flyingBall->setOXY(x, y);
+ } else {
+ sceneHandler14_arcadeLogic();
+ g_vars->scene14_ballIsFlying = false;
+ }
+ } else {
+ sceneHandler14_dudeFall();
+ g_vars->scene14_ballIsFlying = false;
+ }
+ } else {
+ sceneHandler14_passToGrandma();
+ g_vars->scene14_ballIsFlying = false;
+ }
+}
+
+int sceneHandler14(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_SC14_SHOWBALLGMAHIT2:
+ sceneHandler14_showBallGrandmaHit2();
+ break;
+
+ case MSG_SC14_SHOWBALLGMADIVE:
+ sceneHandler14_showBallGrandmaDive();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC14_SHOWBALLGMAHIT:
+ sceneHandler14_showBallGrandmaHit();
+ break;
+
+ case MSG_SC14_SHOWBALLMAN:
+ sceneHandler14_showBallMan();
+ break;
+
+ case MSG_SC14_MANKICKBALL:
+ sceneHandler14_manKickBall();
+ break;
+
+ case MSG_SC14_SHOWBALLFLY:
+ sceneHandler14_showBallFly();
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_SC14_GMAJUMP:
+ sceneHandler14_grandmaJump();
+ break;
+
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_SC14_RESTORESCROLL:
+ g_fp->_aniMan2 = g_fp->_aniMan;
+ g_fp->_scrollSpeed = 8;
+ break;
+
+ case MSG_CMN_WINARCADE:
+ sceneHandler14_winArcade();
+ break;
+
+ case MSG_SC14_SCROLLLEFT:
+ g_fp->_aniMan2 = 0;
+ g_fp->_currentScene->_x = -g_fp->_sceneRect.left;
+ g_fp->_scrollSpeed = 24;
+ break;
+
+ case MSG_SC14_SHOWBALLLAST:
+ sceneHandler14_showBallLast();
+ break;
+
+ case MSG_SC14_HIDEBALLLAST:
+ sceneHandler14_hideBallLast();
+ break;
+
+ case MSG_SC14_HIDEPINK:
+ if (!g_vars->scene14_pink)
+ break;
+
+ g_vars->scene14_pink->hide();
+ break;
+
+ case MSG_SC14_GMATOTRUBA:
+ g_fp->_currentScene->_x = -g_fp->_sceneRect.left;
+ break;
+
+ case MSG_SC14_STARTARCADE:
+ sceneHandler14_startArcade();
+ break;
+
+ case MSG_SC14_ENDARCADE:
+ sceneHandler14_endArcade();
+
+ g_vars->scene14_grandmaIsHere = false;
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case 33:
+ {
+ Movement *mov = g_fp->_aniMan->_movement;
+
+ if (mov) {
+ g_vars->scene14_dudeX = mov->_ox;
+ g_vars->scene14_dudeY = mov->_oy;
+
+ if (mov->_id == MV_MAN14_KICK)
+ g_vars->scene14_dudeX = mov->_ox + 2 * g_fp->_aniMan->_movement->_currDynamicPhaseIndex;
+ } else {
+ g_vars->scene14_dudeX = g_fp->_aniMan->_ox;
+ g_vars->scene14_dudeY = g_fp->_aniMan->_oy;
+ }
+
+ mov = g_vars->scene14_grandma->_movement;
+ if (mov) {
+ g_vars->scene14_grandmaX = mov->_ox;
+ g_vars->scene14_grandmaY = mov->_oy;
+ } else {
+ g_vars->scene14_grandmaX = g_vars->scene14_grandma->_ox;
+ g_vars->scene14_grandmaY = g_vars->scene14_grandma->_oy;
+ }
+
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+ g_vars->scene14_dude2X = x;
+
+ if (x < g_fp->_sceneRect.left + g_vars->scene14_sceneDeltaX) {
+ g_fp->_currentScene->_x = x - g_vars->scene14_sceneDiffX - g_fp->_sceneRect.left;
+ x = g_vars->scene14_dude2X;
+ }
+
+ if (x > g_fp->_sceneRect.right - g_vars->scene14_sceneDeltaX)
+ g_fp->_currentScene->_x = x + g_vars->scene14_sceneDiffX - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene14_ballIsFlying)
+ sceneHandler14_animateBall();
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+ break;
+ }
+
+ case 30:
+ if (g_vars->scene14_dudeIsKicking) {
+ sceneHandler14_kickAnimation();
+ break;
+ }
+
+ if (!g_vars->scene14_arcadeIsOn) {
+ break;
+ }
+ break;
+
+ case 29:
+ if (g_vars->scene14_arcadeIsOn) {
+ int pixel;
+
+ if (g_vars->scene14_dudeCanKick && g_fp->_aniMan->getPixelAtPos(cmd->_sceneClickX, cmd->_sceneClickY, &pixel) && !g_fp->_aniMan->_movement) {
+ sceneHandler14_dudeDecline();
+ break;
+ }
+ } else {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani && ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (!sceneHandler14_arcadeProcessClick(cmd) && (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode))) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+ sceneHandler14_arcadeProcessClick(cmd);
+ break;
+ }
+ }
+ }
+ }
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene15.cpp b/engines/fullpipe/scenes/scene15.cpp
new file mode 100644
index 0000000000..046e9c9adc
--- /dev/null
+++ b/engines/fullpipe/scenes/scene15.cpp
@@ -0,0 +1,209 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene15_initScene(Scene *sc) {
+ g_vars->scene15_chantingCountdown = 0;
+
+ StaticANIObject *grandma = sc->getStaticANIObject1ById(ANI_GRANDMA_ASS, -1);
+
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ int grandmaState = g_fp->getObjectState(sO_Grandma);
+
+ if (grandmaState == g_fp->getObjectEnumState(sO_Grandma, sO_In_15)) {
+ grandma->changeStatics2(ST_GMS_BOOT);
+ grandma->setOXY(97, 399);
+ g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsClosed));
+ } else if (grandmaState == g_fp->getObjectEnumState(sO_Grandma, sO_In_15_1)) {
+ grandma->changeStatics2(ST_GMS_BOOT);
+ grandma->setOXY(86, 399);
+ g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsClosed));
+ } else if (grandmaState == g_fp->getObjectEnumState(sO_Grandma, sO_In_15_2)) {
+ grandma->changeStatics2(ST_GMS_BOOT);
+ grandma->setOXY(71, 399);
+ g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsClosed));
+ } else if (grandmaState == g_fp->getObjectEnumState(sO_Grandma, sO_In_15_3)) {
+ grandma->changeStatics2(ST_GMS_BOOT);
+ grandma->setOXY(49, 399);
+ g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsClosed));
+ } else if (grandmaState == g_fp->getObjectEnumState(sO_Grandma, sO_WithoutBoot)) {
+ grandma->changeStatics2(ST_GMS_BOOT);
+ grandma->setOXY(97, 399);
+ grandma->changeStatics2(ST_GMS_BOOTLESS2);
+ g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsClosed));
+ } else {
+ grandma->hide();
+ g_fp->setObjectState(sO_LeftPipe_15, g_fp->getObjectEnumState(sO_LeftPipe_15, sO_IsOpened));
+ }
+
+ g_vars->scene15_plusminus = sc->getStaticANIObject1ById(ANI_PLUSMINUS, -1);
+
+ if (g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_Off))
+ g_vars->scene15_plusminus->_statics = g_vars->scene15_plusminus->getStaticsById(ST_PMS_MINUS);
+ else
+ g_vars->scene15_plusminus->_statics = g_vars->scene15_plusminus->getStaticsById(ST_PMS_PLUS);
+
+ g_vars->scene15_ladder = sc->getPictureObjectById(PIC_SC15_LADDER, 0);
+ g_vars->scene15_boot = sc->getStaticANIObject1ById(ANI_BOOT_15, -1);
+
+ if (g_fp->getObjectState(sO_Boot_15) != g_fp->getObjectEnumState(sO_Boot_15, sO_IsPresent))
+ g_vars->scene15_boot->_flags &= 0xFFFB;
+
+ g_fp->_currentScene = oldsc;
+
+ g_fp->lift_setButton(sO_Level5, ST_LBN_5N);
+ g_fp->lift_sub5(sc, QU_SC15_ENTERLIFT, QU_SC15_EXITLIFT);
+}
+
+int scene15_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC15_LTRUBA)
+ g_fp->_cursorId = PIC_CSR_GOL;
+
+ return g_fp->_cursorId;
+}
+
+int sceneHandler15(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_SC4_HIDEBOOT:
+ g_vars->scene15_boot->_flags &= 0xFFFB;
+ break;
+
+ case MSG_SC15_STOPCHANTING:
+ g_fp->stopAllSoundInstances(SND_15_001);
+
+ g_vars->scene15_chantingCountdown = 120;
+ break;
+
+ case MSG_SC15_ASSDRYG:
+ if (g_fp->_rnd->getRandomNumber(1))
+ g_fp->playSound(SND_15_011, 0);
+ else
+ g_fp->playSound(SND_15_006, 0);
+
+ break;
+
+ case MSG_SC15_LADDERTOBACK:
+ g_vars->scene15_ladder->_priority = 60;
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC15_PULL:
+ if (g_vars->scene15_plusminus->_statics->_staticsId == ST_PMS_MINUS)
+ g_vars->scene15_plusminus->_statics = g_vars->scene15_plusminus->getStaticsById(ST_PMS_PLUS);
+ else
+ g_vars->scene15_plusminus->_statics = g_vars->scene15_plusminus->getStaticsById(ST_PMS_MINUS);
+
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case 29:
+ {
+ if (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) == PIC_SC15_LADDER) {
+ handleObjectInteraction(g_fp->_aniMan, g_fp->_currentScene->getPictureObjectById(PIC_SC15_DTRUBA, 0), cmd->_keyCode);
+ cmd->_messageKind = 0;
+
+ return 0;
+ }
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani && ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+
+ cmd->_messageKind = 0;
+ }
+ break;
+ }
+
+ case 30:
+ // nop
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene15_chantingCountdown > 0) {
+ g_vars->scene15_chantingCountdown--;
+
+ if (!g_vars->scene15_chantingCountdown)
+ g_fp->playSound(SND_15_001, 1);
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp
new file mode 100644
index 0000000000..b1e261287a
--- /dev/null
+++ b/engines/fullpipe/scenes/scene16.cpp
@@ -0,0 +1,484 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene16_initScene(Scene *sc) {
+ g_vars->scene16_figures.clear();
+ g_vars->scene16_walkingBoy = 0;
+ g_vars->scene16_walkingGirl = 0;
+ g_vars->scene16_walkingCount = 200;
+ g_vars->scene16_wire = sc->getStaticANIObject1ById(ANI_WIRE16, -1);
+ g_vars->scene16_mug = sc->getStaticANIObject1ById(ANI_MUG, -1);
+ g_vars->scene16_jettie = sc->getStaticANIObject1ById(ANI_JETTIE, -1);
+ g_vars->scene16_boot = sc->getStaticANIObject1ById(ANI_BOOT_16, -1);
+ g_vars->scene16_girlIsLaughing = false;
+ g_vars->scene16_sound = SND_16_034;
+
+ if (g_fp->getObjectState(sO_Bridge) == g_fp->getObjectEnumState(sO_Bridge, sO_Convoluted)) {
+ g_vars->scene16_placeIsOccupied = true;
+
+ StaticANIObject *boy[2];
+ boy[0] = sc->getStaticANIObject1ById(ANI_BOY, -1);
+ boy[0]->loadMovementsPixelData();
+
+ boy[1] = new StaticANIObject(boy[0]);
+ sc->addStaticANIObject(boy[1], 1);
+
+ int idx = 0;
+
+ for (int i = 0; i < 3; i++) {
+ g_vars->scene16_figures.push_back(boy[idx]);
+
+ idx++;
+
+ if (idx >= 2)
+ idx = 0;
+ }
+
+ g_vars->scene16_figures.push_back(sc->getStaticANIObject1ById(ANI_GIRL, -1));
+
+ for (int i = 0; i < 4; i++) {
+ g_vars->scene16_figures.push_back(boy[idx]);
+
+ idx++;
+
+ if (idx >= 2)
+ idx = 0;
+ }
+ } else {
+ g_fp->setObjectState(sO_Girl, g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging));
+
+ g_vars->scene16_placeIsOccupied = false;
+
+ StaticANIObject *ani = new StaticANIObject(g_fp->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_BEARDED_CMN, -1));
+ ani->_movement = 0;
+ ani->_statics = (Statics *)ani->_staticsList[0];
+ sc->addStaticANIObject(ani, 1);
+ }
+
+ if (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsLaughing)) {
+ StaticANIObject *girl = sc->getStaticANIObject1ById(ANI_GIRL, -1);
+
+ girl->show1(554, 432, MV_GRL_LAUGH_POPA, 0);
+ girl->_priority = 20;
+ }
+
+ if (g_fp->getObjectState(sO_Cup) == g_fp->getObjectEnumState(sO_Cup, sO_In_16)) {
+ g_vars->scene16_mug->_statics = g_vars->scene16_mug->getStaticsById(ST_MUG_EMPTY);
+ g_vars->scene16_mug->_movement = 0;
+ g_vars->scene16_mug->setOXY(409, 459);
+ g_vars->scene16_mug->_priority = 5;
+ g_vars->scene16_mug->_flags |= 4;
+ }
+}
+
+int scene16_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor == PIC_SC16_TUMBA) {
+ if (g_fp->_cursorId == PIC_CSR_DEFAULT)
+ g_fp->_cursorId = PIC_CSR_ITN;
+ } else {
+ if (g_fp->_objectIdAtCursor == ANI_MUG && g_fp->_cursorId == PIC_CSR_ITN && g_vars->scene16_mug->_statics->_staticsId == ST_MUG_FULL)
+ g_fp->_cursorId = PIC_CSR_ITN_GREEN;
+ }
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler16_laughSound() {
+ int snd = SND_16_035;
+
+ switch (g_vars->scene16_sound) {
+ case SND_16_034:
+ snd = SND_16_035;
+ break;
+
+ case SND_16_035:
+ snd = SND_16_037;
+ break;
+
+ case SND_16_037:
+ snd = SND_16_034;
+ break;
+ }
+
+ g_vars->scene16_sound = snd;
+
+ g_fp->playSound(snd, 0);
+}
+
+void sceneHandler16_showBearded() {
+ if (g_fp->getObjectState(sO_Bridge) == g_fp->getObjectEnumState(sO_Bridge, sO_Unconvoluted)) {
+ StaticANIObject *brd = g_fp->_currentScene->getStaticANIObject1ById(ANI_BEARDED_CMN, -1);
+
+ if (!brd || !(brd->_flags & 4))
+ chainQueue(QU_BRD16_STARTBEARDED, 0);
+ }
+}
+
+void sceneHandler16_showMugFull() {
+ g_vars->scene16_mug->changeStatics2(ST_MUG_FULL);
+}
+
+void sceneHandler16_fillMug() {
+ if (g_vars->scene16_mug->_flags & 4) {
+ g_vars->scene16_jettie->_priority = 2;
+ g_vars->scene16_jettie->startAnim(MV_JTI_FLOWIN, 0, -1);
+
+ if (g_fp->_aniMan->_movement) {
+ if (g_fp->_aniMan->_movement->_id == MV_MAN16_TAKEMUG) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
+
+ g_vars->scene16_mug->show1(-1, -1, -1, 0);
+
+ g_fp->setObjectState(sO_Cup, g_fp->getObjectEnumState(sO_Cup, sO_DudeHas));
+ }
+ }
+ return;
+ }
+
+ MessageQueue *mq;
+
+ if (!(g_vars->scene16_boot->_flags & 4)) {
+ g_vars->scene16_jettie->_priority = 15;
+ g_vars->scene16_jettie->startAnim(MV_JTI_FLOWBY, 0, -1);
+
+ if (g_vars->scene16_walkingBoy) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYOUT), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode);
+ if (mq->chain(g_vars->scene16_walkingBoy) || !mq)
+ return;
+ } else {
+ if (!g_vars->scene16_walkingGirl)
+ return;
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_GIRLOUT), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene16_walkingGirl->_okeyCode);
+ if (mq->chain(g_vars->scene16_walkingGirl))
+ return;
+ }
+ delete mq;
+
+ return;
+ }
+
+ g_vars->scene16_jettie->_priority = 15;
+
+ g_vars->scene16_boot->startAnim(MV_BT16_FILL, 0, -1);
+
+ StaticANIObject *ani;
+
+ if (g_vars->scene16_walkingBoy) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYOUT), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode);
+
+ ani = g_vars->scene16_walkingBoy;
+ } else {
+ if (!g_vars->scene16_walkingGirl)
+ return;
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_GIRLOUT), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene16_walkingGirl->_okeyCode);
+ ani = g_vars->scene16_walkingGirl;
+ }
+
+ if (!mq->chain(ani))
+ delete mq;
+}
+
+void sceneHandler16_startLaugh() {
+ StaticANIObject *girl = g_fp->_currentScene->getStaticANIObject1ById(ANI_GIRL, -1);
+
+ girl->changeStatics2(ST_GRL_STAND);
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_GIRLLAUGH), 0, 1);
+
+ mq->replaceKeyCode(-1, girl->_okeyCode);
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_fp->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->setSubVarAsInt(sO_DudeSwinged, 0);
+
+ g_vars->scene16_girlIsLaughing = true;
+}
+
+void sceneHandler16_drink() {
+ if (g_vars->scene16_mug->_flags & 4) {
+ if (!g_vars->scene16_jettie->_movement) {
+ if (!g_vars->scene16_walkingBoy || !g_vars->scene16_walkingBoy->_movement || g_vars->scene16_walkingBoy->_movement->_id != MV_BOY_DRINK) {
+ if (!g_vars->scene16_walkingGirl || !g_vars->scene16_walkingGirl->_movement || g_vars->scene16_walkingGirl->_movement->_id != MV_GRL_DRINK) {
+ if (g_vars->scene16_mug->_statics->_staticsId == ST_MUG_FULL) {
+ MessageQueue *mq;
+ ExCommand *ex;
+
+ if (g_vars->scene16_walkingBoy) {
+ g_fp->_aniMan->_flags |= 0x180;
+
+ g_vars->scene16_walkingBoy->changeStatics2(ST_BOY_STAND);
+ g_vars->scene16_walkingBoy->queueMessageQueue(0);
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_BOYKICK), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene16_walkingBoy->_okeyCode);
+
+ ex = new ExCommand(ANI_MAN, 34, 384, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3u;
+ ex->_field_14 = 384;
+ ex->_messageNum = 0;
+
+ mq->insertExCommandAt(2, ex);
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+ } else {
+ g_fp->_aniMan->_flags |= 1;
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_MANDRINK), 0, 1);
+
+ ex = new ExCommand(ANI_MAN, 34, 256, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3u;
+ ex->_field_14 = 256;
+ ex->_messageNum = 0;
+
+ mq->addExCommandToEnd(ex);
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_GIRL, -1)->changeStatics2(ST_GRL_STAND);
+ }
+
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_WIRE16, -1)->show1(-1, -1, -1, 0);
+ } else {
+ chainObjQueue(g_fp->_aniMan, QU_SC16_TAKEMUG, 1);
+ }
+ }
+ }
+ }
+ }
+}
+
+void sceneHandler16_mugClick() {
+ if (abs(310 - g_fp->_aniMan->_ox) >= 1 || abs(449 - g_fp->_aniMan->_oy) >= 1
+ || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 310, 449, 1, ST_MAN_RIGHT);
+
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC16_MUGCLICK, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags = 2;
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, 310, 449, 0, -1);
+ }
+ } else {
+ sceneHandler16_drink();
+ }
+}
+
+void sceneHandler16_showMan() {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
+ g_fp->_aniMan->show1(-1, -1, -1, 0);
+
+ g_vars->scene16_mug->show1(-1, -1, -1, 0);
+}
+
+void sceneHandler16_showMug() {
+ chainQueue(QU_SC16_SHOWMUG, 0);
+}
+
+void sceneHandler16_hideMan() {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
+ g_fp->_aniMan->hide();
+
+ g_vars->scene16_mug->hide();
+}
+
+void sceneHandler16_hideMug() {
+ g_vars->scene16_mug->hide();
+}
+
+void sceneHandler16_hideWire() {
+ g_vars->scene16_wire->hide();
+}
+
+void sceneHandler16_showWire() {
+ g_vars->scene16_wire->show1(-1, -1, -1, 0);
+}
+
+void sceneHandler16_putOnWheel() {
+ StaticANIObject *ani = g_vars->scene16_walkingBoy;
+
+ if (!ani)
+ ani = g_vars->scene16_walkingGirl;
+
+ if (ani)
+ g_vars->scene16_figures.push_back(ani);
+
+ ani = g_vars->scene16_figures.front();
+
+ g_vars->scene16_figures.pop_front();
+
+ if (ani) {
+ MessageQueue *mq;
+
+ if (ani->_id == ANI_BOY) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_GOBOY), 0, 1);
+
+ mq->replaceKeyCode(-1, ani->_okeyCode);
+ mq->chain(0);
+
+ g_vars->scene16_walkingBoy = ani;
+ g_vars->scene16_walkingGirl = 0;
+ } else if (ani->_id == ANI_GIRL) {
+ if (g_fp->getObjectState(sO_Girl) == g_fp->getObjectEnumState(sO_Girl, sO_IsSwinging)) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_GOGIRL), 0, 1);
+
+ mq->replaceKeyCode(-1, ani->_okeyCode);
+ mq->chain(0);
+
+ g_vars->scene16_walkingBoy = 0;
+ g_vars->scene16_walkingGirl = ani;
+ }
+ }
+ }
+}
+
+void sceneHandler16_girlROTFL() {
+ StaticANIObject *girl = g_fp->_currentScene->getStaticANIObject1ById(ANI_GIRL, -1);
+
+ girl->changeStatics2(ST_GRL_LAUGH);
+ girl->startAnim(MV_GRL_FALL, 0, -1);
+
+ g_vars->scene16_girlIsLaughing = false;
+}
+
+int sceneHandler16(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_SC16_LAUGHSOUND:
+ sceneHandler16_laughSound();
+ break;
+
+ case MSG_SC16_SHOWBEARDED:
+ sceneHandler16_showBearded();
+ break;
+
+ case MSG_SC16_SHOWMUGFULL:
+ sceneHandler16_showMugFull();
+ break;
+
+ case MSG_SC16_FILLMUG:
+ sceneHandler16_fillMug();
+ break;
+
+ case MSG_SC16_STARTLAUGH:
+ sceneHandler16_startLaugh();
+ break;
+
+ case MSG_SC16_MUGCLICK:
+ if (!g_fp->_aniMan->isIdle() || g_fp->_aniMan->_flags & 0x100)
+ cmd->_messageKind = 0;
+ else
+ sceneHandler16_mugClick();
+
+ break;
+
+ case MSG_SC16_SHOWMAN:
+ sceneHandler16_showMan();
+ break;
+
+ case MSG_SC16_SHOWMUG:
+ sceneHandler16_showMug();
+ break;
+
+ case MSG_SC16_HIDEMAN:
+ sceneHandler16_hideMan();
+ break;
+
+ case MSG_SC16_HIDEMUG:
+ sceneHandler16_hideMug();
+ break;
+
+ case MSG_SC16_HIDEWIRE:
+ sceneHandler16_hideWire();
+ break;
+
+ case MSG_SC16_SHOWWIRE:
+ sceneHandler16_showWire();
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene16_placeIsOccupied) {
+ g_vars->scene16_walkingCount++;
+
+ if (g_vars->scene16_walkingCount < 280) {
+ sceneHandler16_putOnWheel();
+
+ g_vars->scene16_walkingCount = 0;
+ }
+ }
+
+ if (g_vars->scene16_girlIsLaughing) {
+ if (g_fp->_aniMan->_movement)
+ if (g_fp->_aniMan->_movement->_id == MV_MAN_TURN_RL)
+ sceneHandler16_girlROTFL();
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene17.cpp b/engines/fullpipe/scenes/scene17.cpp
new file mode 100644
index 0000000000..73bf7ab1c0
--- /dev/null
+++ b/engines/fullpipe/scenes/scene17.cpp
@@ -0,0 +1,285 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/floaters.h"
+
+namespace Fullpipe {
+
+void scene17_initScene(Scene *sc) {
+ g_vars->scene17_flyState = 1;
+ g_vars->scene17_sugarIsShown = false;
+ g_vars->scene17_sceneOldEdgeX = 0;
+ g_vars->scene17_flyCountdown = 0;
+ g_vars->scene17_hand = sc->getStaticANIObject1ById(ANI_HAND17, -1);
+}
+
+void scene17_restoreState() {
+ if (g_fp->getObjectState(sO_UsherHand) == g_fp->getObjectEnumState(sO_UsherHand, sO_WithCoin)) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 0);
+
+ g_vars->scene17_handPhase = false;
+ } else {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 1);
+
+ g_vars->scene17_handPhase = true;
+ }
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_17"));
+
+ g_vars->scene17_flyState = g_fp->getObjectState(sO_Fly_17);
+
+ if (g_vars->scene17_flyState <= 0 ) {
+ g_vars->scene17_flyCountdown = g_fp->_rnd->getRandomNumber(600) + 600;
+
+ g_vars->scene17_flyState = g_fp->_rnd->getRandomNumber(4) + 1;
+ }
+
+ g_fp->setObjectState(sO_Fly_17, g_vars->scene17_flyState - 1);
+}
+
+int scene17_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor != PIC_SC17_RTRUBA2 && g_fp->_objectIdAtCursor != PIC_SC17_RTRUBA)
+ return g_fp->_cursorId;
+
+ if (!g_vars->scene17_handPhase)
+ return g_fp->_cursorId;
+
+ int item = g_fp->_inventory->getSelectedItemId();
+
+ if ((g_fp->_cursorId != PIC_CSR_DEFAULT_INV || item != ANI_INV_COIN) && item != ANI_INV_BOOT && item != ANI_INV_HAMMER)
+ ; // empty
+ else
+ g_fp->_cursorId = PIC_CSR_ITN_INV;
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler17_drop() {
+ StaticANIObject *mug = g_fp->_currentScene->getStaticANIObject1ById(ANI_MUG_17, -1);
+ StaticANIObject *jet = g_fp->_currentScene->getStaticANIObject1ById(ANI_JET_17, -1);
+
+ if (mug && mug->_flags & 4) {
+ mug->changeStatics2(ST_MUG17_EMPTY);
+ chainQueue(QU_SC17_FILLMUG_DROP, 0);
+ } else if (jet) {
+ jet->queueMessageQueue(0);
+ chainQueue(QU_JET17_DROP, 0);
+ }
+}
+
+void sceneHandler17_fillBottle() {
+ StaticANIObject *bottle = g_fp->_currentScene->getStaticANIObject1ById(ANI_INV_BOTTLE, -1);
+ StaticANIObject *mug = g_fp->_currentScene->getStaticANIObject1ById(ANI_MUG_17, -1);
+ StaticANIObject *boot = g_fp->_currentScene->getStaticANIObject1ById(ANI_BOOT_17, -1);
+
+ if (bottle && (bottle->_flags & 4))
+ chainQueue(QU_SC17_FILLBOTTLE, 1);
+ else if (mug && (mug->_flags & 4) && mug->_statics->_staticsId == ST_MUG17_EMPTY)
+ chainQueue(QU_SC17_FILLMUG, 1);
+ else if (boot && (boot->_flags & 4))
+ chainQueue(QU_SC17_FILLBOOT, 1);
+ else
+ chainQueue(QU_JET17_FLOW, 1);
+}
+
+void sceneHandler17_testTruba() {
+ if (g_vars->scene17_hand->isIdle()) {
+ if (!g_vars->scene17_hand->_movement || g_vars->scene17_hand->_movement->_id != MV_HND17_FIGA) {
+ g_vars->scene17_hand->changeStatics2(ST_HND17_EMPTY);
+ g_vars->scene17_hand->startAnim(MV_HND17_FIGA, 0, -1);
+ }
+ }
+}
+
+void sceneHandler17_showBottle() {
+ chainQueue(QU_SC17_SHOWBOTTLE, 0);
+}
+
+void sceneHandler17_hideSugar() {
+ StaticANIObject *sugar = g_fp->_currentScene->getStaticANIObject1ById(ANI_INV_SUGAR, -1);
+
+ if (sugar)
+ sugar->hide();
+}
+
+void sceneHandler17_showSugar() {
+ chainQueue(QU_SC17_SHOWSUGAR, 0);
+
+ g_vars->scene17_sugarIsShown = true;
+}
+
+void sceneHandler17_moonshineFill() {
+ StaticANIObject *moonshiner = g_fp->_currentScene->getStaticANIObject1ById(ANI_SAMOGONSHCHIK, -1);
+
+ if (!(moonshiner->_flags & 0x80)) {
+ moonshiner->changeStatics2(ST_SMG_SIT);
+ chainObjQueue(moonshiner, QU_SMG_FILLBOTTLE, 1);
+
+ g_vars->scene17_sugarIsShown = false;
+ }
+}
+
+void sceneHandler17_updateFlies() {
+ g_fp->_floaters->genFlies(g_fp->_currentScene, 239, -50, 20, 4);
+
+ g_fp->_floaters->_array2[0]->countdown = g_fp->_rnd->getRandomNumber(5) + 6;
+ g_fp->_floaters->_array2[0]->val6 = 239;
+ g_fp->_floaters->_array2[0]->val7 = -50;
+}
+
+
+int sceneHandler17(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC17_DROP:
+ sceneHandler17_drop();
+ break;
+
+ case MSG_SC17_UPDATEHAND:
+ if (g_fp->getObjectState(sO_UsherHand) == g_fp->getObjectEnumState(sO_UsherHand, sO_WithCoin)) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 0);
+
+ g_vars->scene17_handPhase = false;
+ } else {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 1);
+
+ g_vars->scene17_handPhase = true;
+ }
+ break;
+
+ case MSG_SC17_FILLBOTTLE:
+ sceneHandler17_fillBottle();
+ break;
+
+ case MSG_SC17_TESTTRUBA:
+ sceneHandler17_testTruba();
+ break;
+
+ case MSG_SC17_SHOWBOTTLE:
+ sceneHandler17_showBottle();
+ break;
+
+ case MSG_SC17_HIDESUGAR:
+ sceneHandler17_hideSugar();
+ break;
+
+ case MSG_SC17_SHOWSUGAR:
+ sceneHandler17_showSugar();
+ break;
+
+ case 29:
+ {
+ int pic = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (pic == PIC_SC17_RTRUBA2 || pic == PIC_SC17_RTRUBA) {
+ if (cmd->_keyCode == ANI_INV_COIN || cmd->_keyCode == ANI_INV_BOOT || cmd->_keyCode == ANI_INV_HAMMER) {
+ if (g_vars->scene17_handPhase) {
+ if (g_fp->_aniMan->isIdle()) {
+ if (!(g_fp->_aniMan->_flags & 0x100)) {
+ handleObjectInteraction(g_fp->_aniMan, g_vars->scene17_hand, cmd->_keyCode);
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case 33:
+ {
+ int x = g_vars->scene17_sceneEdgeX;
+ g_vars->scene17_sceneOldEdgeX = g_vars->scene17_sceneEdgeX;
+
+ if (g_fp->_aniMan2) {
+ x = g_fp->_aniMan2->_ox;
+
+ g_vars->scene17_sceneEdgeX = x;
+
+ if (x < g_fp->_sceneRect.left + 200) {
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ x = g_vars->scene17_sceneEdgeX;
+ }
+
+ if (x > g_fp->_sceneRect.right - 200) {
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ x = g_vars->scene17_sceneEdgeX;
+ }
+ }
+
+ if (g_vars->scene17_sugarIsShown) {
+ sceneHandler17_moonshineFill();
+ x = g_vars->scene17_sceneEdgeX;
+ }
+
+ if (g_vars->scene17_handPhase) {
+ if (g_vars->scene17_sceneOldEdgeX < 410 && x >= 410) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_ATTRACT, QU_HND17_ATTRACT, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 1);
+ } else if (g_vars->scene17_sceneOldEdgeX > 410 && x <= 410) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_TOCYCLE, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_ATTRACT, QU_HND17_ATTRACT, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene17_hand, ST_HND17_EMPTY, QU_HND17_ASK, 0);
+ }
+ }
+
+ --g_vars->scene17_flyCountdown;
+
+ if (!g_vars->scene17_flyCountdown)
+ sceneHandler17_updateFlies();
+
+ g_fp->_floaters->update();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
new file mode 100644
index 0000000000..a965cfb98e
--- /dev/null
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -0,0 +1,49 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene18_preload() {
+ warning("WARNING: scene18_preload()");
+}
+
+void scene19_preload(Scene *sc, int key) {
+ warning("WARNING: scene19_preload()");
+}
+
+
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene20.cpp b/engines/fullpipe/scenes/scene20.cpp
new file mode 100644
index 0000000000..5fed24aabd
--- /dev/null
+++ b/engines/fullpipe/scenes/scene20.cpp
@@ -0,0 +1,155 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/floaters.h"
+
+namespace Fullpipe {
+
+void scene20_setExits(Scene *sc) {
+ int thingpar;
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_OnStool)
+ || g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_OnTheFloor))
+ thingpar = 1;
+ else if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_NearPipe)
+ || g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_NearPipeWithStool)) {
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->enableLinks(sO_CloseThing, 1);
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->enableLinks(sO_CloseThing2, 1);
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->enableLinks(sO_CloseThing3, 0);
+
+ return;
+ } else {
+ thingpar = 0;
+ }
+
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->enableLinks(sO_CloseThing, thingpar);
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->enableLinks(sO_CloseThing2, 0);
+ getSc2MctlCompoundBySceneId(sc->_sceneId)->enableLinks(sO_CloseThing3, 1);
+}
+
+void scene20_initScene(Scene *sc) {
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_vars->scene20_grandma = sc->getStaticANIObject1ById(ANI_GRANDMA_20, -1);
+
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_OnTheFloor))
+ g_fp->setObjectState(sO_Grandma, g_fp->getObjectEnumState(sO_Grandma, sO_NearPipe));
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_OnStool)) {
+ g_vars->scene20_grandma->changeStatics2(ST_GMA20_STOOL);
+ } else if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_OnTheFloor)) {
+ g_vars->scene20_grandma->changeStatics2(ST_GMA20_FLOOR);
+ } else if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_NearPipe)
+ || g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_NearPipeWithStool)) {
+ g_vars->scene20_grandma->changeStatics2(ST_GMA20_STAND);
+ } else {
+ g_vars->scene20_grandma->hide();
+ }
+
+ scene20_setExits(sc);
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_20"));
+
+ for (int i = 0; i < 3; i++) {
+ g_fp->_floaters->genFlies(sc, g_fp->_rnd->getRandomNumber(101) + 70, g_fp->_rnd->getRandomNumber(51) + 175, 100, 0);
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val13 = g_fp->_rnd->getRandomNumber(9);
+ }
+
+ g_fp->_currentScene = oldsc;
+
+ g_vars->scene20_fliesCountdown = g_fp->_rnd->getRandomNumber(200) + 400;
+}
+
+void sceneHandler20_updateFlies() {
+ int sz = g_fp->_floaters->_array2.size();
+
+ if (sz < 3) {
+ g_fp->_floaters->genFlies(g_fp->_currentScene, 253, 650, 200, 0);
+ g_fp->_floaters->_array2[sz - 1]->val2 = 250;
+ g_fp->_floaters->_array2[sz - 1]->val3 = 200;
+ } else {
+ int idx = g_fp->_rnd->getRandomNumber(sz);
+
+ g_fp->_floaters->_array2[idx]->countdown = 0;
+ g_fp->_floaters->_array2[idx]->fflags |= 4u;
+ g_fp->_floaters->_array2[idx]->val2 = 250;
+ g_fp->_floaters->_array2[idx]->val3 = 200;
+ g_fp->_floaters->_array2[idx]->val6 = 253;
+ g_fp->_floaters->_array2[idx]->val7 = 650;
+ g_fp->_floaters->_array2[idx]->ani->_priority = 200;
+ }
+
+ g_vars->scene20_fliesCountdown = g_fp->_rnd->getRandomNumber(200) + 400;
+}
+
+int sceneHandler20(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC20_UPDATELOCKABLE:
+ scene20_setExits(g_fp->_currentScene);
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ --g_vars->scene20_fliesCountdown;
+
+ if (g_vars->scene20_fliesCountdown <= 0)
+ sceneHandler20_updateFlies();
+
+ g_fp->_floaters->update();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene21.cpp b/engines/fullpipe/scenes/scene21.cpp
new file mode 100644
index 0000000000..5a6509964d
--- /dev/null
+++ b/engines/fullpipe/scenes/scene21.cpp
@@ -0,0 +1,148 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene21_initScene(Scene *sc) {
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_vars->scene21_giraffeBottom = sc->getStaticANIObject1ById(ANI_GIRAFFE_BOTTOM, -1);
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_LowerPipe_21) == g_fp->getObjectEnumState(sO_LowerPipe_21, sO_IsOpened)) {
+ g_vars->scene21_giraffeBottom->changeStatics2(ST_GRFB_HANG);
+ g_vars->scene21_pipeIsOpen = true;
+ g_vars->scene21_wigglePos = 0.0;
+ g_vars->scene21_giraffeBottomX = g_vars->scene21_giraffeBottom->_ox;
+ g_vars->scene21_giraffeBottomY = g_vars->scene21_giraffeBottom->_oy;
+ g_vars->scene21_wiggleTrigger = false;
+ } else {
+ g_vars->scene21_pipeIsOpen = false;
+ }
+ g_fp->_currentScene = oldsc;
+ g_fp->initArcadeKeys("SC_21");
+}
+
+int scene21_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC21_DTRUBA)
+
+ g_fp->_cursorId = PIC_CSR_GOD;
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler21_doWiggle() {
+ g_vars->scene21_giraffeBottom->setOXY((int)(cos(g_vars->scene21_wigglePos) * 4.0) + g_vars->scene21_giraffeBottom->_ox,
+ g_vars->scene21_giraffeBottom->_oy);
+
+ g_vars->scene21_wigglePos += 0.19635;
+
+ if (g_vars->scene21_wigglePos > 6.2831853) {
+ g_vars->scene21_wigglePos = 0;
+
+ if (!g_vars->scene21_giraffeBottom->_movement)
+ g_vars->scene21_giraffeBottom->setOXY(g_vars->scene21_giraffeBottomX, g_vars->scene21_giraffeBottomY);
+ }
+}
+
+int sceneHandler21(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC21_UPDATEASS:
+ if (g_fp->getObjectState(sO_LowerPipe_21) == g_fp->getObjectEnumState(sO_LowerPipe_21, sO_IsOpened)) {
+ g_vars->scene21_giraffeBottom->changeStatics2(ST_GRFB_HANG);
+ g_vars->scene21_giraffeBottom->setOXY(g_vars->scene21_giraffeBottomX, g_vars->scene21_giraffeBottomY);
+ g_vars->scene21_giraffeBottom->changeStatics2(ST_GRFB_SIT);
+
+ g_vars->scene21_pipeIsOpen = false;
+
+ g_fp->setObjectState(sO_LowerPipe_21, g_fp->getObjectEnumState(sO_LowerPipe_21, sO_IsClosed));
+ }
+
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode) ) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
+ g_fp->processArcade(cmd);
+ }
+ }
+
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x <= g_fp->_sceneWidth - 460) {
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+ } else {
+ g_fp->_currentScene->_x = g_fp->_sceneWidth - x;
+ }
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene21_pipeIsOpen && !g_vars->scene21_wiggleTrigger)
+ sceneHandler21_doWiggle();
+
+ g_vars->scene21_wiggleTrigger = !g_vars->scene21_wiggleTrigger;
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene22.cpp b/engines/fullpipe/scenes/scene22.cpp
new file mode 100644
index 0000000000..13c9ab36e9
--- /dev/null
+++ b/engines/fullpipe/scenes/scene22.cpp
@@ -0,0 +1,395 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene22_initScene(Scene *sc) {
+ g_vars->scene22_bag = sc->getStaticANIObject1ById(ANI_MESHOK, -1);
+
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ g_vars->scene22_giraffeMiddle = sc->getStaticANIObject1ById(ANI_GIRAFFE_MIDDLE, -1);
+ g_vars->scene22_dudeIsOnStool = false;
+ g_vars->scene22_interactionIsDisabled = false;
+ g_vars->scene22_craneIsOut = true;
+
+ if (g_fp->getObjectState(sO_Bag_22) == g_fp->getObjectEnumState(sO_Bag_22, sO_NotFallen))
+ g_vars->scene22_numBagFalls = 0;
+ else if (g_fp->getObjectState(sO_Bag_22) == g_fp->getObjectEnumState(sO_Bag_22, sO_FallenOnce))
+ g_vars->scene22_numBagFalls = 1;
+ else if ( g_fp->getObjectState(sO_Bag_22) == g_fp->getObjectEnumState(sO_Bag_22, sO_FallenTwice))
+ g_vars->scene22_numBagFalls = 2;
+ else {
+ g_vars->scene22_numBagFalls = 3;
+ g_vars->scene22_craneIsOut = false;
+ }
+
+
+ if ( g_fp->getObjectState(sO_LowerPipe_21) == g_fp->getObjectEnumState(sO_LowerPipe_21, sO_IsOpened))
+ g_vars->scene22_giraffeMiddle->changeStatics2(ST_GRFM_AFTER);
+ else
+ g_vars->scene22_giraffeMiddle->changeStatics2(ST_GRFM_NORM);
+
+ g_fp->_currentScene = oldsc;
+
+ g_fp->initArcadeKeys("SC_22");
+}
+
+int scene22_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor != ANI_HANDLE_L)
+ return g_fp->_cursorId;
+
+ int sel = g_fp->_inventory->getSelectedItemId();
+
+ if (!sel) {
+ g_fp->_cursorId = PIC_CSR_ITN;
+ return g_fp->_cursorId;
+ }
+
+ if (g_vars->scene22_dudeIsOnStool || (sel != ANI_INV_STOOL && sel != ANI_INV_BOX))
+ ; //empty
+ else
+ g_fp->_cursorId = PIC_CSR_ITN_INV;
+
+ return g_fp->_cursorId;
+}
+
+void scene22_setBagState() {
+ if (g_vars->scene22_craneIsOut) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene22_bag, ST_MSH_SIT, QU_MSH_CRANEOUT, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene22_bag, ST_MSH_SIT, QU_MSH_MOVE, 0);
+ } else {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene22_bag, ST_MSH_SIT, QU_MSH_CRANEOUT, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene22_bag, ST_MSH_SIT, QU_MSH_MOVE, 1);
+ }
+}
+
+void sceneHandler22_showStool() {
+ chainQueue(QU_SC22_SHOWSTOOL, 0);
+}
+
+void sceneHandler22_hideStool() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_TABURETTE, -1)->hide();
+}
+
+void sceneHandler22_handleDown() {
+ if (g_vars->scene22_bag->_statics->_staticsId == ST_MSH_SIT) {
+ chainQueue(QU_MSH_CRANEOUT, 1);
+ g_vars->scene22_interactionIsDisabled = false;
+ } else {
+ ++g_vars->scene22_numBagFalls;
+
+ int qid;
+
+ if (g_vars->scene22_numBagFalls == 3) {
+ chainQueue(QU_SC22_FALLSACK_GMA, 1);
+ qid = QU_SC22_FALLBROOM;
+ } else {
+ qid = QU_SC22_FALLSACK;
+ }
+
+ chainQueue(qid, 1);
+
+ int state;
+
+ if (g_vars->scene22_numBagFalls) {
+ if (g_vars->scene22_numBagFalls == 1) {
+ state = g_fp->getObjectEnumState(sO_Bag_22, sO_FallenOnce);
+ } else if (g_vars->scene22_numBagFalls == 2) {
+ state = g_fp->getObjectEnumState(sO_Bag_22, sO_FallenTwice);
+ } else {
+ state = g_fp->getObjectEnumState(sO_Bag_22, sO_BrushHasFallen);
+ }
+ } else {
+ state = g_fp->getObjectEnumState(sO_Bag_22, sO_NotFallen);
+ }
+
+ g_fp->setObjectState(sO_Bag_22, state);
+ }
+
+ g_vars->scene22_craneIsOut = true;
+
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene22_bag, ST_MSH_SIT, QU_MSH_CRANEOUT, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene22_bag, ST_MSH_SIT, QU_MSH_MOVE, 0);
+}
+
+void sceneHandler22_fromStool(ExCommand *cmd) {
+ if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC22_FROMSTOOL), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+ }
+}
+
+void sceneHandler22_stoolLogic(ExCommand *cmd) {
+ StaticANIObject *ani;
+ MessageQueue *mq;
+ int xpos;
+ int manId;
+
+ if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
+ if (cmd->_keyCode == ANI_INV_STOOL) {
+ if (abs(841 - g_fp->_aniMan->_ox) <= 1) {
+ if (abs(449 - g_fp->_aniMan->_oy) <= 1) {
+ chainQueue(QU_SC22_PUTSTOOL, 1);
+ g_vars->scene22_interactionIsDisabled = true;
+
+ return;
+ }
+ }
+ goto LABEL_13;
+ }
+
+ if (cmd->_keyCode == ANI_INV_BOX) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_TABURETTE, -1);
+ if (!ani || !(ani->_flags & 4)) {
+ if (abs(841 - g_fp->_aniMan->_ox) <= 1) {
+ if (abs(449 - g_fp->_aniMan->_oy) <= 1) {
+ chainObjQueue(g_fp->_aniMan, QU_SC22_TRYBOX, 1);
+ return;
+ }
+ }
+ LABEL_13:
+ xpos = 841;
+ manId = ST_MAN_RIGHT;
+ LABEL_31:
+ mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, xpos, 449, 1, manId);
+
+ if (!mq)
+ return;
+
+ mq->addExCommandToEnd(cmd->createClone());
+
+ postExCommand(g_fp->_aniMan->_id, 2, 841, 449, 0, -1);
+ return;
+ }
+ } else {
+ if (cmd->_keyCode)
+ return;
+
+ if (g_vars->scene22_dudeIsOnStool) {
+ if (g_fp->_aniMan->_movement)
+ return;
+
+ chainQueue(QU_SC22_HANDLEDOWN, 1);
+
+ g_vars->scene22_interactionIsDisabled = true;
+ return;
+ }
+
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_TABURETTE, -1);
+ if (ani && (ani->_flags & 4)) {
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_ox;
+
+ if (sqrt((double)((841 - x) * (841 - x) + (449 - y) * (449 - y)))
+ < sqrt((double)((1075 - x) * (1075 - x) + (449 - y) * (449 - y)))) {
+ if (abs(841 - x) <= 1) {
+ if (abs(449 - y) <= 1) {
+ chainQueue(QU_SC22_TOSTOOL, 1);
+
+ g_vars->scene22_interactionIsDisabled = true;
+ return;
+ }
+ }
+ goto LABEL_13;
+ }
+
+ if (abs(1075 - x) > 1 || abs(449 - y) > 1) {
+ xpos = 1075;
+ manId = ST_MAN_RIGHT | 0x4000;
+ goto LABEL_31;
+ }
+
+ MGM mgm;
+ MGMInfo mgminfo;
+
+ mgm.addItem(ANI_MAN);
+ mgminfo.ani = g_fp->_aniMan;
+ mgminfo.staticsId2 = ST_MAN_RIGHT;
+ mgminfo.x1 = 934;
+ mgminfo.y1 = 391;
+ mgminfo.field_1C = 10;
+ mgminfo.staticsId1 = 0x4145;
+ mgminfo.x2 = 981;
+ mgminfo.y2 = 390;
+ mgminfo.field_10 = 1;
+ mgminfo.flags = 127;
+ mgminfo.movementId = rMV_MAN_TURN_SRL;
+
+ mq = mgm.genMovement(&mgminfo);
+
+ ExCommand *ex = mq->getExCommandByIndex(0);
+
+ mq->deleteExCommandByIndex(0, 0);
+
+ delete mq;
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC22_TOSTOOL_R), 0, 0);
+
+ mq->insertExCommandAt(2, ex);
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_vars->scene22_interactionIsDisabled = true;
+ } else {
+ if (abs(1010 - g_fp->_aniMan->_ox) <= 1) {
+ if (abs(443 - g_fp->_aniMan->_oy) <= 1) {
+ chainQueue(QU_SC22_TRYHANDLE, 1);
+ return;
+ }
+ }
+
+ mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 1010, 443, 1, ST_MAN_UP);
+
+ if (mq) {
+ mq->addExCommandToEnd(cmd->createClone());
+
+ postExCommand(g_fp->_aniMan->_id, 2, 1010, 443, 0, -1);
+ return;
+ }
+ }
+ }
+ }
+}
+
+int sceneHandler22(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC22_CRANEOUT_GMA:
+ chainQueue(QU_MSH_CRANEOUT_GMA, 1);
+ break;
+
+ case MSG_SC22_CHECKGMABOOT:
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_In_15))
+ g_fp->setObjectState(sO_Boot_15, g_fp->getObjectEnumState(sO_Boot_15, sO_IsPresent));
+
+ break;
+
+ case MSG_SC22_SHOWSTOOL:
+ sceneHandler22_showStool();
+ break;
+
+ case MSG_SC22_HIDESTOOL:
+ sceneHandler22_hideStool();
+ break;
+
+ case MSG_SC22_FROMSTOOL:
+ g_vars->scene22_dudeIsOnStool = false;
+ g_vars->scene22_interactionIsDisabled = false;
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+ break;
+
+ case MSG_SC22_ONSTOOL:
+ g_vars->scene22_dudeIsOnStool = true;
+ getCurrSceneSc2MotionController()->clearEnabled();
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+ break;
+
+ case MSG_SC22_HANDLEDOWN:
+ sceneHandler22_handleDown();
+ break;
+
+ case 29:
+ if (!g_vars->scene22_interactionIsDisabled) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani && ani->_id == ANI_HANDLE_L) {
+ sceneHandler22_stoolLogic(cmd);
+ return 0;
+ }
+
+ if (!g_vars->scene22_dudeIsOnStool) {
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+ return 0;
+ }
+ }
+ }
+ return 0;
+ }
+
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN_RIGHT && !g_fp->_aniMan->_movement) {
+ sceneHandler22_fromStool(cmd);
+
+ return 0;
+ }
+ }
+
+ cmd->_messageKind = 0;
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x <= g_fp->_sceneWidth - 460) {
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+ } else {
+ g_fp->_currentScene->_x = g_fp->_sceneWidth - x;
+ }
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+ }
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene23.cpp b/engines/fullpipe/scenes/scene23.cpp
new file mode 100644
index 0000000000..1f2587eba4
--- /dev/null
+++ b/engines/fullpipe/scenes/scene23.cpp
@@ -0,0 +1,555 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/floaters.h"
+
+namespace Fullpipe {
+
+bool sceneHandler23_testCalendar() {
+ int cal0, cal1, cal2, cal3;
+
+ if (g_vars->scene23_calend0->_movement)
+ cal0 = g_vars->scene23_calend0->_movement->_staticsObj2->_staticsId;
+ else
+ cal0 = g_vars->scene23_calend0->_statics->_staticsId;
+
+ if (g_vars->scene23_calend1->_movement)
+ cal1 = g_vars->scene23_calend1->_movement->_staticsObj2->_staticsId;
+ else
+ cal1 = g_vars->scene23_calend1->_statics->_staticsId;
+
+ if (g_vars->scene23_calend2->_movement)
+ cal2 = g_vars->scene23_calend2->_movement->_staticsObj2->_staticsId;
+ else
+ cal2 = g_vars->scene23_calend2->_statics->_staticsId;
+
+ if (g_vars->scene23_calend3->_movement)
+ cal3 = g_vars->scene23_calend3->_movement->_staticsObj2->_staticsId;
+ else
+ cal3 = g_vars->scene23_calend3->_statics->_staticsId;
+
+ return (cal0 == ST_CND_1 && cal1 == ST_CND_4 && cal2 == ST_CND_0 && cal3 == ST_CND_2 && (g_vars->scene23_giraffee->_flags & 4));
+}
+
+void scene23_initScene(Scene *sc) {
+ g_vars->scene23_calend0 = sc->getStaticANIObject1ById(ANI_CALENDWHEEL, 0);
+ g_vars->scene23_calend1 = sc->getStaticANIObject1ById(ANI_CALENDWHEEL, 1);
+ g_vars->scene23_calend2 = sc->getStaticANIObject1ById(ANI_CALENDWHEEL, 2);
+ g_vars->scene23_calend3 = sc->getStaticANIObject1ById(ANI_CALENDWHEEL, 3);
+ g_vars->scene23_topReached = false;
+ g_vars->scene23_isOnStool = false;
+ g_vars->scene23_someVar = 0;
+ g_vars->scene23_giraffeTop = sc->getStaticANIObject1ById(ANI_GIRAFFE_TOP, -1);
+ g_vars->scene23_giraffee = sc->getStaticANIObject1ById(ANI_GIRAFFEE, -1);
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_23"));
+
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_UpperHatch_23) == g_fp->getObjectEnumState(sO_UpperHatch_23, sO_Opened)) {
+ sc->getPictureObjectById(PIC_SC23_BOXOPEN, 0)->_flags |= 4;
+ sc->getPictureObjectById(PIC_SC23_BOXCLOSED, 0)->_flags &= 0xFFFB;
+ sc->getPictureObjectById(PIC_SC23_BTN1, 0)->_flags |= 4;
+ sc->getPictureObjectById(PIC_SC23_BTN2, 0)->_flags |= 4;
+ sc->getPictureObjectById(PIC_SC23_BTN3, 0)->_flags |= 4;
+ sc->getPictureObjectById(PIC_SC23_BTN4, 0)->_flags |= 4;
+
+ if (g_vars->scene23_giraffee->_statics->_staticsId == ST_GRFG_EMPTY || !(g_vars->scene23_giraffee->_flags & 4)) {
+ g_vars->scene23_giraffee->changeStatics2(ST_GRFG_BALD);
+ g_vars->scene23_giraffee->_flags |= 4;
+ }
+ g_vars->scene23_calend0->show1(-1, -1, -1, 0);
+ g_vars->scene23_calend1->show1(-1, -1, -1, 0);
+ g_vars->scene23_calend2->show1(-1, -1, -1, 0);
+ g_vars->scene23_calend3->show1(-1, -1, -1, 0);
+
+ sc->getStaticANIObject1ById(ANI_LUK23_U, -1)->changeStatics2(ST_LUK23U_OPEN);
+ } else {
+ sc->getPictureObjectById(PIC_SC23_BOXOPEN, 0)->_flags &= 0xFFFB;
+ sc->getPictureObjectById(PIC_SC23_BOXCLOSED, 0)->_flags |= 4;
+ sc->getPictureObjectById(PIC_SC23_BTN1, 0)->_flags &= 0xFFFB;
+ sc->getPictureObjectById(PIC_SC23_BTN2, 0)->_flags &= 0xFFFB;
+ sc->getPictureObjectById(PIC_SC23_BTN3, 0)->_flags &= 0xFFFB;
+ sc->getPictureObjectById(PIC_SC23_BTN4, 0)->_flags &= 0xFFFB;
+
+ g_vars->scene23_giraffee->hide();
+ g_vars->scene23_calend0->hide();
+ g_vars->scene23_calend1->hide();
+ g_vars->scene23_calend2->hide();
+ g_vars->scene23_calend3->hide();
+
+ sc->getStaticANIObject1ById(ANI_LUK23_U, -1)->changeStatics2(ST_LUK23U_CLOSED);
+
+ g_fp->_floaters->genFlies(sc, 600, 90, 0, 0);
+ }
+
+ if (g_fp->getObjectState(sO_LowerHatch_23) == g_fp->getObjectEnumState(sO_LowerHatch_23, sO_Opened)) {
+ g_vars->scene23_giraffeTop->show1(-1, -1, -1, 0);
+ g_vars->scene23_giraffeTop->changeStatics2(ST_GRFU_UP);
+
+ if (g_fp->getObjectState(sO_LowerPipe_21) == g_fp->getObjectEnumState(sO_LowerPipe_21, sO_IsOpened)) {
+ g_vars->scene23_giraffeTop->changeStatics2(ST_GRFU_KISS);
+ g_vars->scene23_giraffee->hide();
+ } else {
+ if (g_fp->getObjectState(sO_UpperHatch_23) == g_fp->getObjectEnumState(sO_UpperHatch_23, sO_Opened)
+ && (g_vars->scene23_giraffee->_flags & 4))
+ g_vars->scene23_giraffeTop->setOXY(614, 362);
+ else
+ g_vars->scene23_giraffeTop->setOXY(618, 350);
+
+ if (sceneHandler23_testCalendar())
+ g_vars->scene23_calend1->_statics = g_vars->scene23_calend1->getStaticsById(ST_CND_5);
+ }
+
+ sc->getStaticANIObject1ById(ANI_LUK23_D, -1)->changeStatics2(ST_LUK23_OPEN);
+
+ if (g_fp->getObjectState(sO_Lever_23) == g_fp->getObjectEnumState(sO_Lever_23, sO_Taken))
+ sc->getStaticANIObject1ById(ANI_INV_LEVERHANDLE, -1)->hide();
+
+ sc->getStaticANIObject1ById(ANI_HANDLE23, -1)->hide();
+ } else {
+ g_vars->scene23_giraffeTop->hide();
+
+ sc->getStaticANIObject1ById(ANI_LUK23_D, -1)->changeStatics2(ST_LUK23_WHANDLE2);
+
+ sc->getStaticANIObject1ById(ANI_INV_LEVERHANDLE, -1)->hide();
+ }
+
+ g_fp->_currentScene = oldsc;
+}
+
+void scene23_setGiraffeState() {
+ if (g_fp->getObjectState(sO_UpperHatch_23) == g_fp->getObjectEnumState(sO_UpperHatch_23, sO_Opened)) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene23_giraffeTop, ST_GRFU_UP, QU_GRFU_TURN_UL, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene23_giraffeTop, ST_GRFU_UP, QU_GRFU_TURN_UD, 0);
+ }
+}
+
+int scene23_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor == PIC_SC23_LADDERU) {
+ if (g_vars->scene23_topReached)
+ return g_fp->_cursorId;
+
+ g_fp->_cursorId = getGameLoaderInventory()->getSelectedItemId() ? PIC_CSR_GOU : PIC_CSR_ITN; // FIXME check
+ }
+
+ if (g_fp->_objectIdAtCursor == PIC_SC23_BTN1 || g_fp->_objectIdAtCursor == PIC_SC23_BTN2
+ || g_fp->_objectIdAtCursor == PIC_SC23_BTN3 || g_fp->_objectIdAtCursor == PIC_SC23_BTN4
+ || g_fp->_objectIdAtCursor == ANI_CALENDWHEEL)
+ g_fp->_cursorId = PIC_CSR_LIFT;
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler23_showStool() {
+ chainQueue(QU_SC23_SHOWSTOOL, 0);
+}
+
+void sceneHandler23_hideStool() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_TABURETTE, -1)->hide();
+}
+
+void sceneHandler23_startKiss() {
+ g_vars->scene23_giraffeTop->changeStatics2(ST_GRFU_UP);
+ g_vars->scene23_giraffeTop->startMQIfIdle(QU_SC23_STARTKISS, 0);
+}
+
+void sceneHandler23_spinWheel1() {
+ int mv = 0;
+
+ switch (g_vars->scene23_calend0->_statics->_staticsId) {
+ case ST_CND_0:
+ mv = MV_CND_0_1;
+ break;
+
+ case ST_CND_1:
+ mv = MV_CND_1_2;
+ break;
+
+ case ST_CND_2:
+ mv = MV_CND_2_3;
+ break;
+
+ case ST_CND_3:
+ g_vars->scene23_calend0->changeStatics2(ST_CND_9);
+ mv = MV_CND_9_0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (mv)
+ g_vars->scene23_calend0->startAnim(mv, 0, -1);
+
+ if (sceneHandler23_testCalendar())
+ sceneHandler23_startKiss();
+}
+
+void sceneHandler23_spinWheel2and4(StaticANIObject *ani) {
+ int mv = 0;
+
+ switch (ani->_statics->_staticsId) {
+ case ST_CND_0:
+ mv = MV_CND_0_1;
+ break;
+
+ case ST_CND_1:
+ mv = MV_CND_1_2;
+ break;
+
+ case ST_CND_2:
+ mv = MV_CND_2_3;
+ break;
+
+ case ST_CND_3:
+ mv = MV_CND_3_4;
+ break;
+
+ case ST_CND_4:
+ mv = MV_CND_4_5;
+ break;
+
+ case ST_CND_5:
+ mv = MV_CND_5_6;
+ break;
+
+ case ST_CND_6:
+ mv = MV_CND_6_7;
+ break;
+
+ case ST_CND_7:
+ mv = MV_CND_7_8;
+ break;
+
+ case ST_CND_8:
+ mv = MV_CND_8_9;
+ break;
+
+ case ST_CND_9:
+ mv = MV_CND_9_0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (mv)
+ ani->startAnim(mv, 0, -1);
+
+ if (sceneHandler23_testCalendar())
+ sceneHandler23_startKiss();
+}
+
+void sceneHandler23_spinWheel3() {
+ if (g_vars->scene23_calend2->_statics->_staticsId == ST_CND_0) {
+ g_vars->scene23_calend2->startAnim(MV_CND_0_1, 0, -1);
+ } else if (g_vars->scene23_calend2->_statics->_staticsId == ST_CND_1) {
+ g_vars->scene23_calend2->changeStatics2(ST_CND_9);
+ g_vars->scene23_calend2->startAnim(MV_CND_9_0, 0, -1);
+ }
+
+ if (sceneHandler23_testCalendar())
+ sceneHandler23_startKiss();
+}
+
+void sceneHandler23_pushButton(ExCommand *cmd) {
+ if (g_fp->_aniMan->isIdle() || !(g_fp->_aniMan->_flags & 0x100)) {
+ if (!g_vars->scene23_topReached) {
+ if (g_fp->_aniMan->_ox != 405 || g_fp->_aniMan->_oy != 220) {
+ if (g_fp->_aniMan->_ox != 276 || g_fp->_aniMan->_oy != 438
+ || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_RIGHT) {
+ if (g_fp->_msgX == 276 && g_fp->_msgY == 438 )
+ return;
+
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, 276, 438, 1, ST_MAN_RIGHT);
+
+ if (mq) {
+ mq->addExCommandToEnd(cmd->createClone());;
+
+ postExCommand(g_fp->_aniMan->_id, 2, 276, 438, 0, -1);
+ }
+ } else {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC23_TOCALENDAR), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());;
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+ }
+
+ if (!g_vars->scene23_topReached)
+ return;
+ } else {
+ g_vars->scene23_topReached = true;
+ }
+ }
+
+ if (!g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == ST_MAN_STANDLADDER) {
+ int mv = 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC23_CLICKBTN1:
+ mv = MV_MAN23_PUSH1;
+ break;
+
+ case MSG_SC23_CLICKBTN2:
+ mv = MV_MAN23_PUSH2;
+ break;
+
+ case MSG_SC23_CLICKBTN3:
+ mv = MV_MAN23_PUSH3;
+ break;
+
+ case MSG_SC23_CLICKBTN4:
+ mv = MV_MAN23_PUSH4;
+ break;
+
+ default:
+ return;
+ }
+
+ if (mv)
+ g_fp->_aniMan->startAnim(mv, 0, -1);
+
+ }
+ }
+}
+
+void sceneHandler23_sendClick(StaticANIObject *ani) {
+ int msg = 0;
+ switch (ani->_okeyCode) {
+ case 0:
+ msg = MSG_SC23_CLICKBTN1;
+ break;
+ case 1:
+ msg = MSG_SC23_CLICKBTN2;
+ break;
+ case 2:
+ msg = MSG_SC23_CLICKBTN3;
+ break;
+ case 3:
+ msg = MSG_SC23_CLICKBTN4;
+ break;
+ default:
+ break;
+ }
+
+ ExCommand *ex = new ExCommand(0, 17, msg, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+
+ ex->postMessage();
+}
+
+void sceneHandler23_checkReachingTop() {
+ if (g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_STANDLADDER
+ || g_fp->_aniMan->_ox != 405 || g_fp->_aniMan->_oy != 220)
+ g_vars->scene23_topReached = false;
+ else
+ g_vars->scene23_topReached = true;
+}
+
+void sceneHandler23_exitCalendar() {
+ if (!g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == ST_MAN_STANDLADDER
+ && !g_fp->_aniMan->getMessageQueue() && !(g_fp->_aniMan->_flags & 0x100)) {
+ chainQueue(QU_SC23_FROMCALENDAREXIT, 1);
+ g_vars->scene23_someVar = 2;
+ }
+}
+
+void sceneHandler23_fromCalendar(ExCommand *cmd) {
+ if (!g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == ST_MAN_STANDLADDER
+ && !g_fp->_aniMan->getMessageQueue() && !(g_fp->_aniMan->_flags & 0x100)) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC23_FROMCALENDAR), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_vars->scene23_topReached = false;
+ g_vars->scene23_someVar = 0;
+ }
+}
+
+void sceneHandler23_fromStool(ExCommand *cmd) {
+ if (!g_fp->_aniMan->getMessageQueue() && !(g_fp->_aniMan->_flags & 0x100)) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC23_FROMSTOOL), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ cmd->_messageKind = 0;
+ }
+}
+
+int sceneHandler23(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC23_FROMSTOOL:
+ g_vars->scene23_isOnStool = false;
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+ break;
+
+ case MSG_SC23_HIDEGIRAFFEE:
+ g_vars->scene23_giraffee->queueMessageQueue(0);
+ g_vars->scene23_giraffee->_flags &= 0xFFFB;
+ break;
+
+ case MSG_SC23_ONSTOOL:
+ g_vars->scene23_isOnStool = true;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+ break;
+
+ case MSG_SC22_SHOWSTOOL:
+ sceneHandler23_showStool();
+ break;
+
+ case MSG_SC22_HIDESTOOL:
+ sceneHandler23_hideStool();
+ break;
+
+ case MSG_SC23_SPINWHEEL1:
+ sceneHandler23_spinWheel1();
+ break;
+
+ case MSG_SC23_SPINWHEEL2:
+ sceneHandler23_spinWheel2and4(g_vars->scene23_calend1);
+ break;
+
+ case MSG_SC23_SPINWHEEL3:
+ sceneHandler23_spinWheel3();
+ break;
+
+ case MSG_SC23_SPINWHEEL4:
+ sceneHandler23_spinWheel2and4(g_vars->scene23_calend3);
+ break;
+
+ case MSG_SC23_CLICKBTN1:
+ case MSG_SC23_CLICKBTN2:
+ case MSG_SC23_CLICKBTN3:
+ case MSG_SC23_CLICKBTN4:
+ sceneHandler23_pushButton(cmd);
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ g_fp->_floaters->update();
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ int picId;
+
+ if (ani && ani->_id == ANI_CALENDWHEEL) {
+ sceneHandler23_sendClick(ani);
+ cmd->_messageKind = 0;
+ }
+
+ sceneHandler23_checkReachingTop();
+
+ if (g_vars->scene23_topReached) {
+ picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (picId == PIC_SC23_LADDER) {
+ sceneHandler23_exitCalendar();
+
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (cmd->_sceneClickY > 450) {
+ sceneHandler23_fromCalendar(cmd);
+
+ cmd->_messageKind = 0;
+ break;
+ }
+ break;
+ }
+
+ if (!g_vars->scene23_isOnStool) {
+ picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (picId == PIC_SC23_LADDERU && !g_vars->scene23_topReached) {
+ sceneHandler23_pushButton(cmd);
+
+ cmd->_messageKind = 0;
+ break;
+ }
+ break;
+ }
+
+ if (ani && ani->_id == ANI_HANDLE23) {
+ handleObjectInteraction(g_fp->_aniMan, ani, cmd->_keyCode);
+ cmd->_messageKind = 0;
+ } else {
+ sceneHandler23_fromStool(cmd);
+
+ cmd->_messageKind = 0;
+ }
+
+ break;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene24.cpp b/engines/fullpipe/scenes/scene24.cpp
new file mode 100644
index 0000000000..508f776573
--- /dev/null
+++ b/engines/fullpipe/scenes/scene24.cpp
@@ -0,0 +1,129 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene24_initScene(Scene *sc) {
+ g_vars->scene24_water = sc->getStaticANIObject1ById(ANI_WATER24, -1);
+ g_vars->scene24_jet = sc->getStaticANIObject1ById(ANI_JET24, -1);
+ g_vars->scene24_drop = sc->getStaticANIObject1ById(ANI_DROP_24, -1);
+
+ g_vars->scene24_water->setAlpha(0xa0);
+ g_vars->scene24_jet->setAlpha(0xa0);
+ g_vars->scene24_drop->setAlpha(0xa0);
+
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Overfull)) {
+ g_vars->scene24_jetIsOn = true;
+ g_vars->scene24_flowIsLow = false;
+ } else {
+ g_vars->scene24_jet->hide();
+
+ g_vars->scene24_jetIsOn = false;
+
+ g_vars->scene24_water->changeStatics2(ST_WTR24_FLOWLOWER);
+
+ g_vars->scene24_flowIsLow = true;
+ }
+
+ if (g_fp->getObjectState(sO_Pool) < g_fp->getObjectEnumState(sO_Pool, sO_Full)) {
+ g_vars->scene24_waterIsOn = false;
+
+ g_vars->scene24_water->hide();
+
+ g_fp->setObjectState(sO_StairsDown_24, g_fp->getObjectEnumState(sO_StairsDown_24, sO_IsOpened));
+ } else {
+ g_vars->scene24_waterIsOn = true;
+
+ g_fp->setObjectState(sO_StairsDown_24, g_fp->getObjectEnumState(sO_StairsDown_24, sO_IsClosed));
+ }
+
+ g_fp->_currentScene = oldsc;
+}
+
+void scene24_setPoolState() {
+ if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Overfull)) {
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_vars->scene24_drop, 0);
+
+ g_fp->playSound(SND_24_007, 1);
+ } else if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Full)) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOFLOOR, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOWATER, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOWATER2, 0);
+
+ g_fp->playSound(SND_24_006, 1);
+ } else if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_HalfFull)) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOFLOOR, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOWATER, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOWATER2, 1);
+ } else {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOFLOOR, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOWATER, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene24_drop, ST_DRP24_EMPTY, QU_DRP24_TOWATER2, 0);
+ }
+}
+
+int sceneHandler24(ExCommand *cmd) {
+ if (cmd->_messageKind == 17 && cmd->_messageNum == 33) {
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200) {
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+ }
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene24_waterIsOn && !g_vars->scene24_water->_movement) {
+ if (g_vars->scene24_flowIsLow)
+ g_vars->scene24_water->startAnim(MV_WTR24_FLOWLOWER, 0, -1);
+ else
+ g_vars->scene24_water->startAnim(MV_WTR24_FLOW, 0, -1);
+ }
+
+ if (g_vars->scene24_jetIsOn && !g_vars->scene24_jet->_movement)
+ g_vars->scene24_jet->startAnim(MV_JET24_FLOW, 0, -1);
+
+ g_fp->_behaviorManager->updateBehaviors();
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp
new file mode 100644
index 0000000000..ba07c3e5b9
--- /dev/null
+++ b/engines/fullpipe/scenes/scene25.cpp
@@ -0,0 +1,723 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene25_showBoardOnRightFar() {
+ g_vars->scene25_board->show1(453, 557, MV_BRD25_RIGHT, 0);
+ g_vars->scene25_board->_priority = 28;
+}
+
+void scene25_showBoardOnRightClose() {
+ g_vars->scene25_board->show1(632, 557, rMV_BRD25_RIGHT, 0);
+ g_vars->scene25_board->_priority = 28;
+}
+
+void scene25_initScene(Scene *sc, int entranceId) {
+ g_vars->scene25_water = sc->getStaticANIObject1ById(ANI_WATER25, -1);
+ g_vars->scene25_board = sc->getStaticANIObject1ById(ANI_BOARD25, -1);
+ g_vars->scene25_drop = sc->getStaticANIObject1ById(ANI_DROP_25, -1);
+ g_vars->scene25_water->setAlpha(0xa0);
+ g_vars->scene25_drop->setAlpha(0xa0);
+ g_vars->scene25_dudeIsOnBoard = false;
+
+ if (g_fp->getObjectState(sO_Pool) < g_fp->getObjectEnumState(sO_Pool, sO_HalfFull)) {
+ g_vars->scene25_waterIsPresent = false;
+
+ g_vars->scene25_water->hide();
+ } else {
+ g_vars->scene25_waterIsPresent = true;
+
+ g_fp->playSound(SND_25_006, 1);
+ }
+
+ int boardState = g_fp->getObjectState(sO_Board_25);
+
+ if (entranceId == TrubaRight) {
+ if (boardState == g_fp->getObjectEnumState(sO_Board_25, sO_FarAway)) {
+ scene25_showBoardOnRightFar();
+
+ g_fp->playSound(SND_25_029, 0);
+
+ g_vars->scene25_boardIsSelectable = false;
+ } else {
+ if (boardState == g_fp->getObjectEnumState(sO_Board_25, sO_Nearby)
+ || boardState == g_fp->getObjectEnumState(sO_Board_25, sO_WithDudeOnRight))
+ scene25_showBoardOnRightClose();
+ g_vars->scene25_boardIsSelectable = false;
+ }
+ } else {
+ if (boardState == g_fp->getObjectEnumState(sO_Board_25, sO_WithDudeOnLeft)) {
+ if (!getGameLoaderInventory()->getCountItemsWithId(ANI_INV_BOARD)) {
+ getGameLoaderInventory()->addItem(ANI_INV_BOARD, 1);
+ getGameLoaderInventory()->rebuildItemRects();
+ }
+ } else {
+ g_vars->scene25_boardIsSelectable = true;
+ }
+ }
+
+ g_vars->scene25_beardersAreThere = false;
+ g_vars->scene25_beardersCounter = 0;
+}
+
+int scene25_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_vars->scene25_waterIsPresent) {
+ int inv = getGameLoaderInventory()->getSelectedItemId();
+
+ if (g_fp->_objectIdAtCursor == ANI_WATER25) {
+ if ((g_vars->scene25_boardIsSelectable && (!inv || inv == ANI_INV_BOARD)) || (g_vars->scene25_dudeIsOnBoard && (inv == ANI_INV_LOPAT || !inv)))
+ g_fp->_cursorId = (g_fp->_cursorId != PIC_CSR_DEFAULT) ? PIC_CSR_ITN : PIC_CSR_ITN_INV; // FIXME check
+ } else if (g_fp->_objectIdAtCursor == ANI_BOARD25 && (!inv || inv == ANI_INV_SWAB || inv == ANI_INV_BROOM || inv == ANI_INV_LOPAT)) {
+ g_fp->_cursorId = (g_fp->_cursorId != PIC_CSR_DEFAULT) ? PIC_CSR_ITN : PIC_CSR_ITN_INV;
+ }
+ }
+
+ return g_fp->_cursorId;
+}
+
+void scene25_setupWater(Scene *a1, int entranceId) {
+ if (g_vars->scene25_waterIsPresent) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene25_drop, ST_DRP25_EMPTY, QU_DRP25_TOFLOOR, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene25_drop, ST_DRP25_EMPTY, QU_DRP25_TOWATER, 1);
+
+ if (entranceId != TrubaRight)
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_25"), "MUSIC2", 0);
+ } else {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene25_drop, ST_DRP25_EMPTY, QU_DRP25_TOFLOOR, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene25_drop, ST_DRP25_EMPTY, QU_DRP25_TOWATER, 0);
+ }
+}
+
+void sceneHandler25_stopBearders() {
+ g_vars->scene25_beardersAreThere = false;
+
+ g_vars->scene25_bearders.clear();
+}
+
+void sceneHandler25_startBearders() {
+ g_vars->scene25_bearders.clear();
+ g_vars->scene25_beardersCounter = 0;
+
+ StaticANIObject *bearded = g_fp->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_BEARDED_CMN, -1);
+
+ for (int i = 0; i < 3; i++) {
+ StaticANIObject *ani = new StaticANIObject(bearded);
+
+ g_vars->scene25_bearders.push_back(ani);
+
+ ani->_statics = ani->getStaticsById(ST_BRDCMN_EMPTY);
+
+ g_fp->_currentScene->addStaticANIObject(ani, 1);
+ }
+
+ g_vars->scene25_beardersAreThere = true;
+}
+
+void sceneHandler25_enterMan() {
+ if (g_vars->scene25_waterIsPresent) {
+ chainQueue(QU_SC25_ENTERUP_WATER, 1);
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ } else {
+ chainQueue(QU_SC25_ENTERUP_FLOOR, 1);
+ }
+}
+
+void sceneHandler25_enterTruba() {
+ PicAniInfo info;
+
+ g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->_messageQueueId = 0;
+ g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
+
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_oy;
+
+ g_fp->_aniMan->setPicAniInfo(&info);
+
+ int id = g_fp->_aniMan->_statics->_staticsId;
+ int qid = 0;
+
+ if (id == ST_MAN25_ONBOARD && x == 634 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD);
+
+ qid = QU_SC25_MANTOTRUBA;
+ } else if (id == (ST_MAN25_ONBOARD|0x4000) && x == 632 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD|0x4000);
+
+ qid = QU_SC25_MANTOTRUBA_R;
+ }
+
+ if (qid) {
+ chainQueue(qid, 1);
+ g_vars->scene25_sneezeFlipper = false;
+ }
+}
+
+void sceneHandler25_saveEntrance(int value) {
+ g_fp->getGameLoaderGameVar()->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME")->setSubVarAsInt("Entrance", value);
+}
+
+void sceneHandler25_toLadder() {
+ PicAniInfo info;
+
+ g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->_messageQueueId = 0;
+ g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
+
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_oy;
+
+ g_fp->_aniMan->setPicAniInfo(&info);
+
+ int id = g_fp->_aniMan->_statics->_staticsId;
+ int qid = 0;
+
+ if (id == ST_MAN25_ONBOARD && x == 307 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD);
+
+ qid = QU_SC25_BACKTOLADDER;
+ } else if (id == (ST_MAN25_ONBOARD|0x4000) && x == 192 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD|0x4000);
+
+ qid = QU_SC25_BOARDTOLADDER;
+ }
+
+ if (qid) {
+ chainQueue(qid, 1);
+ g_vars->scene25_dudeIsOnBoard = false;
+ g_vars->scene25_boardIsSelectable = true;
+ g_vars->scene25_sneezeFlipper = false;
+
+ sceneHandler25_saveEntrance(TrubaUp);
+ }
+}
+
+void sceneHandler25_animateBearders() {
+ if (g_fp->_rnd->getRandomNumber(32767) < 218) {
+ MessageQueue *mq;
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC25_BEARDED), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene25_bearders[0]->_okeyCode);
+ mq->getExCommandByIndex(0)->_x = g_fp->_rnd->getRandomNumber(650) + 100;
+ mq->chain(0);
+
+ g_vars->scene25_beardersCounter = 0;
+
+ if (g_fp->_rnd->getRandomNumber(32767) < 0x1FFF) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC25_BEARDED2), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene25_bearders[1]->_okeyCode);
+ mq->getExCommandByIndex(0)->_x = g_fp->_rnd->getRandomNumber(650) + 100;
+ mq->chain(0);
+
+ if (g_fp->_rnd->getRandomNumber(32767) < 8191) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC25_BEARDED3), 0, 1);
+
+ mq->replaceKeyCode(-1, g_vars->scene25_bearders[2]->_okeyCode);
+ mq->getExCommandByIndex(0)->_x = g_fp->_rnd->getRandomNumber(650) + 100;
+ mq->chain(0);
+ }
+ }
+ }
+}
+
+void sceneHandler25_sneeze() {
+ if (g_fp->_rnd->getRandomNumber(32767) % 10) {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN25_ONBOARD) {
+ g_fp->_aniMan->startAnim(MV_MAN25_ONBOARD, 0, -1);
+ } else if (g_fp->_aniMan->_statics->_staticsId == (ST_MAN25_ONBOARD|0x4000)) {
+ g_fp->_aniMan->startAnim(rMV_MAN25_ONBOARD, 0, -1);
+ }
+ } else if (g_fp->_aniMan->_statics->_staticsId == ST_MAN25_ONBOARD) {
+ g_fp->_aniMan->startAnim(MV_MAN25_CHIH, 0, -1);
+ } else if (g_fp->_aniMan->_statics->_staticsId == (ST_MAN25_ONBOARD|0x4000)) {
+ g_fp->_aniMan->startAnim(rMV_MAN25_CHIH, 0, -1);
+ }
+}
+
+void sceneHandler25_rowShovel() {
+ PicAniInfo info;
+
+ g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->_messageQueueId = 0;
+ g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
+
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_oy;
+
+ g_fp->_aniMan->setPicAniInfo(&info);
+
+ int id = g_fp->_aniMan->_statics->_staticsId;
+ int qid = 0;
+
+ if (id == ST_MAN25_ONBOARD && x == 370 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD);
+
+ qid = QU_SC25_ROWTOTRUBA;
+ } else if (id == (ST_MAN25_ONBOARD|0x4000) && x == 632 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD|0x4000);
+
+ qid = QU_SC25_ROWTOLADDER;
+
+ g_fp->playSound(SND_25_030, 0);
+ }
+
+ if (qid) {
+ chainQueue(qid, 1);
+
+ g_vars->scene25_sneezeFlipper = false;
+ }
+}
+
+void sceneHandler25_rowHand() {
+ PicAniInfo info;
+
+ g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->_messageQueueId = 0;
+ g_fp->_aniMan->changeStatics2(g_fp->_aniMan->_statics->_staticsId);
+
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_oy;
+
+ g_fp->_aniMan->setPicAniInfo(&info);
+
+ int id = g_fp->_aniMan->_statics->_staticsId;
+ int qid = 0;
+
+ if (id == ST_MAN25_ONBOARD && x == 370 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD);
+
+ qid = QU_SC25_TRYROWHAND;
+ } else if (id == (ST_MAN25_ONBOARD|0x4000) && x == 632 && y == 502) {
+ g_fp->_aniMan->changeStatics2(ST_MAN25_ONBOARD|0x4000);
+
+ qid = QU_SC25_TRYROWHAND_R;
+ }
+
+ if (qid) {
+ chainObjQueue(g_fp->_aniMan, qid, 1);
+ g_vars->scene25_sneezeFlipper = false;
+ }
+}
+
+void sceneHandler25_putBoard() {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN_STANDLADDER
+ || g_fp->_aniMan->_statics->_staticsId == ST_MAN_LADDERDOWN_R) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_STANDLADDER);
+ g_fp->_aniMan->setOXY(281, 481);
+
+ chainQueue(QU_SC25_PUTBOARD, 1);
+
+ g_vars->scene25_dudeIsOnBoard = true;
+ g_vars->scene25_sneezeFlipper = false;
+ g_vars->scene25_boardIsSelectable = false;
+ }
+}
+
+void sceneHandler25_tryWater() {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN_STANDLADDER
+ || g_fp->_aniMan->_statics->_staticsId == ST_MAN_LADDERDOWN_R) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_STANDLADDER);
+
+ chainQueue(QU_SC25_TRYWATER, 1);
+ }
+}
+
+void sceneHandler25_tryRow(int obj) {
+ PicAniInfo info;
+
+ g_fp->_aniMan->getPicAniInfo(&info);
+ g_fp->_aniMan->_messageQueueId = 0;
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ int x = g_fp->_aniMan->_ox;
+ int y = g_fp->_aniMan->_oy;
+
+ g_fp->_aniMan->setPicAniInfo(&info);
+
+ int qid = 0;
+
+ if (x == 788 && y == 468) {
+ if (g_vars->scene25_board->_statics->_staticsId == ST_BRD25_RIGHT2) {
+ if (obj == ANI_INV_BROOM) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ qid = QU_SC25_TRYBROOM;
+ }
+ if (obj == ANI_INV_LOPAT) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ qid = QU_SC25_TRYSPADE;
+ }
+
+ if (qid) {
+ chainQueue(qid, 1);
+
+ g_fp->playSound(SND_25_028, 0);
+
+ return;
+ }
+
+ if (obj == ANI_INV_SWAB) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ chainQueue(QU_SC25_TRYSWAB, 1);
+ } else if (!obj) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ chainObjQueue(g_fp->_aniMan, QU_SC25_TRYHAND, 1);
+
+ g_fp->playSound(SND_25_028, 0);
+ }
+ } else if (g_vars->scene25_board->_statics->_staticsId == (ST_MAN_RIGHT|0x4000) && !obj) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ chainQueue(QU_SC25_TRUBATOBOARD, 1);
+
+ g_vars->scene25_dudeIsOnBoard = true;
+ }
+ }
+}
+
+void sceneHandler25_ladderUp() {
+ if (g_fp->_aniMan->_statics->_staticsId == ST_MAN_STANDLADDER
+ || g_fp->_aniMan->_statics->_staticsId == ST_MAN_LADDERDOWN_R) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_STANDLADDER);
+
+ chainQueue(QU_SC25_LADDERUP, 1);
+ }
+}
+
+void sceneHandler25_backToPipe() {
+ if (!g_fp->_aniMan->_movement && g_fp->_aniMan->_statics->_staticsId == (ST_MAN_RIGHT|0x4000)) {
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT|0x4000);
+
+ chainQueue(QU_SC25_BACKTOTRUBA, 1);
+ }
+}
+
+void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, MessageQueue *mq, int flag) {
+ int aniY = ani->_oy;
+ int newx = 0, newy = 0;
+ Common::Point point;
+ ExCommand *ex;
+
+ if (flag) {
+ if (ani->_movement) {
+ ani->_movement->calcSomeXY(point, 0);
+ newx = point.x;
+ aniY = ani->_oy - point.y;
+ }
+ }
+
+ int pntx = pnt->x;
+ int pnty = pnt->y;
+ int numObsolete = -1;
+ int minDistance = 20000;
+ ExCommand *lastEx = 0;
+
+ for (uint i = 0; i < mq->getCount(); i++) {
+ int curDistance = abs(pnty - aniY);
+
+ ex = mq->getExCommandByIndex(i);
+
+ if (ex->_messageKind == 1 && ani->_id == ex->_parentId) {
+ if (ex->_excFlags & 0x10000) {
+ if (ex->_messageNum == MV_MAN_TOLADDER)
+ ex->_messageNum = MV_MAN_TOLADDER2;
+ if (ex->_messageNum == MV_MAN_STARTLADDER)
+ ex->_messageNum = MV_MAN_STARTLADDER2;
+ if (ex->_messageNum == MV_MAN_GOLADDER)
+ ex->_messageNum = MV_MAN_GOLADDER2;
+ if (ex->_messageNum == MV_MAN_STOPLADDER)
+ ex->_messageNum = MV_MAN_STOPLADDER2;
+ }
+
+ if (curDistance < minDistance || numObsolete < 0) {
+ numObsolete = i;
+ minDistance = curDistance;
+ lastEx = ex;
+ newx = pntx;
+ newy = pnty;
+ }
+
+ ani->getMovementById(ex->_messageNum)->calcSomeXY(point, 0);
+ pntx += point.x;
+ pnty += point.y;
+ }
+ }
+
+ for (int i = 0; i < numObsolete; i++)
+ mq->deleteExCommandByIndex(0, 1);
+
+ ex = new ExCommand(ani->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_field_14 = 256;
+ ex->_messageNum = 0;
+ ex->_excFlags |= 3;
+
+ mq->addExCommandToEnd(ex);
+
+ if (flag && ani->_movement && ani->_movement->_id == mq->getExCommandByIndex(0)->_messageNum) {
+ mq->deleteExCommandByIndex(0, 1);
+
+ int movId = ani->_movement->_id;
+ int idx = ani->_movement->_currDynamicPhaseIndex;
+
+ ani->changeStatics2(ani->_movement->_staticsObj1->_staticsId);
+ ani->setOXY(newx, newy);
+
+ ani->startAnim(movId, mq->_id, -1);
+
+ ani->_movement->setDynamicPhaseIndex(idx);
+ } else {
+ if (!lastEx)
+ error("sceneHandler25_walkOnLadder(): Incorrect state. Please report this to sev");
+
+ ani->changeStatics2(ani->getMovementById(lastEx->_messageNum)->_staticsObj1->_staticsId);
+ ani->setOXY(newx, newy);
+ ani->restartMessageQueue(mq);
+ }
+
+ ani->_flags |= 1;
+}
+
+bool sceneHandler25_isOnLadder(ExCommand *cmd) {
+ if ((g_fp->_aniMan->_movement && g_fp->_aniMan->_movement->_id == MV_MAN_GOLADDERDOWN)
+ || g_fp->_aniMan->_statics->_staticsId == ST_MAN_GOLADDERD) {
+ Interaction *inter = getGameLoaderInteractionController()->getInteractionByObjectIds(PIC_SC25_LADDERDOWN, ANI_MAN, cmd->_keyCode);
+
+ if (!inter)
+ return 0;
+
+ MessageQueue *mq = new MessageQueue(inter->_messageQueue, 0, 1);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(PIC_SC25_LADDERDOWN, 0);
+ Common::Point point;
+
+ point.x = inter->_xOffs + pic->_ox;
+ point.y = inter->_yOffs + pic->_oy;
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ sceneHandler25_walkOnLadder(g_fp->_aniMan, &point, mq, 0);
+
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void sceneHandler25_sub03() {
+ warning("STUB: sceneHandler25_sub03()");
+}
+
+int sceneHandler25(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC25_STOPBEARDEDS:
+ sceneHandler25_stopBearders();
+ break;
+
+ case MSG_SC25_STARTBEARDEDS:
+ sceneHandler25_startBearders();
+ break;
+
+ case MSG_SC25_ENTERMAN:
+ sceneHandler25_enterMan();
+ break;
+
+ case MSG_SC25_ENTERTRUBA:
+ sceneHandler25_enterTruba();
+ break;
+
+ case MSG_SC25_TOLADDER:
+ sceneHandler25_toLadder();
+ break;
+
+ case MSG_BRD_TURN:
+ switch (g_fp->_rnd->getRandomNumber(3)) {
+ case 0:
+ g_fp->playSound(SND_25_025, 0);
+ break;
+
+ case 1:
+ g_fp->playSound(SND_25_026, 0);
+ break;
+
+ default:
+ g_fp->playSound(SND_25_027, 0);
+ break;
+ }
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+ int y = g_fp->_aniMan2->_oy;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+
+ if (!g_vars->scene25_waterIsPresent) {
+ if (y < g_fp->_sceneRect.top + 200)
+ g_fp->_currentScene->_y = y - 300 - g_fp->_sceneRect.top;
+
+ if (y > g_fp->_sceneRect.bottom - 200)
+ g_fp->_currentScene->_y = y + 300 - g_fp->_sceneRect.bottom;
+ }
+ }
+
+ if (g_vars->scene25_beardersAreThere) {
+ g_vars->scene25_beardersCounter++;
+
+ if (g_vars->scene25_beardersCounter >= 120)
+ sceneHandler25_animateBearders();
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ if (g_vars->scene25_waterIsPresent && !g_vars->scene25_water->_movement)
+ g_vars->scene25_water->startAnim(MV_WTR25_FLOW, 0, -1);
+
+ if (g_vars->scene25_dudeIsOnBoard && !g_fp->_aniMan->_movement && g_vars->scene25_sneezeFlipper)
+ sceneHandler25_sneeze();
+
+ g_vars->scene25_sneezeFlipper = true;
+
+ if (g_vars->scene25_board->_flags & 4) {
+ if (!g_vars->scene25_board->_movement) {
+ if (g_vars->scene25_board->_statics->_staticsId & 0x4000)
+ g_vars->scene25_board->startAnim(rMV_BRD25_RIGHT, 0, -1);
+ else
+ g_vars->scene25_board->startAnim(MV_BRD25_RIGHT, 0, -1);
+ }
+ }
+ break;
+
+ case 29:
+ {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (!g_vars->scene25_waterIsPresent) {
+ if ((picId == PIC_SC25_LADDERUP || picId == PIC_SC25_LADDERDOWN) && sceneHandler25_isOnLadder(cmd))
+ cmd->_messageKind = 0;
+
+ break;
+ }
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani) {
+ if (g_fp->_aniMan != ani) {
+ if (g_fp->_aniMan->isIdle()) {
+ if (!(g_fp->_aniMan->_flags & 0x100)) {
+ if (ani->_id == ANI_WATER25) {
+ if (g_vars->scene25_dudeIsOnBoard) {
+ if (cmd->_keyCode == ANI_INV_LOPAT)
+ sceneHandler25_rowShovel();
+
+ if (!cmd->_keyCode)
+ sceneHandler25_rowHand();
+ } else {
+ if (cmd->_keyCode == ANI_INV_BOARD)
+ sceneHandler25_putBoard();
+
+ if (!cmd->_keyCode)
+ sceneHandler25_tryWater();
+ }
+ } else if (ani->_id == ANI_BOARD25) {
+ sceneHandler25_tryRow(cmd->_keyCode);
+ break;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ if (picId == PIC_SC25_LADDERUP && sceneHandler25_isOnLadder(cmd))
+ cmd->_messageKind = 0;
+
+ if (!g_fp->_aniMan->isIdle() || (g_fp->_aniMan->_flags & 0x100))
+ break;
+
+ if (g_vars->scene25_dudeIsOnBoard) {
+ if (picId == PIC_SC25_RTRUBA && !cmd->_keyCode) {
+ sceneHandler25_enterTruba();
+ break;
+ }
+ } else {
+ if (picId != PIC_SC25_RTRUBA) {
+ if (picId == PIC_SC25_LADDERUP && !cmd->_keyCode)
+ sceneHandler25_ladderUp();
+ break;
+ }
+
+ if (!cmd->_keyCode) {
+ sceneHandler25_backToPipe();
+ break;
+ }
+ }
+ if (g_vars->scene25_dudeIsOnBoard) {
+ if (picId != PIC_SC25_LADDERUP || cmd->_keyCode)
+ break;
+
+ sceneHandler25_toLadder();
+ break;
+ }
+
+ if (picId == PIC_SC25_LADDERUP && !cmd->_keyCode)
+ sceneHandler25_ladderUp();
+
+ break;
+ }
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene26.cpp b/engines/fullpipe/scenes/scene26.cpp
new file mode 100644
index 0000000000..91679347e6
--- /dev/null
+++ b/engines/fullpipe/scenes/scene26.cpp
@@ -0,0 +1,355 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene26_initScene(Scene *sc) {
+ g_vars->scene26_chhi = sc->getStaticANIObject1ById(ANI_CHHI, -1);
+ g_vars->scene26_drop = sc->getStaticANIObject1ById(ANI_DROP_26, -1);
+ g_vars->scene26_sockPic = sc->getPictureObjectById(PIC_SC26_SOCK, 0);
+ g_vars->scene26_sock = sc->getStaticANIObject1ById(ANI_SOCK_26, -1);
+
+ if (g_fp->getObjectState(sO_Hatch_26) == g_fp->getObjectEnumState(sO_Hatch_26, sO_WithSock)) {
+ g_fp->setObjectState(sO_Hatch_26, g_fp->getObjectEnumState(sO_Hatch_26, sO_Closed));
+ g_fp->setObjectState(sO_Sock_26, g_fp->getObjectEnumState(sO_Sock_26, sO_HangsOnPipe));
+ }
+
+ Interaction *inter = getGameLoaderInteractionController()->getInteractionByObjectIds(ANI_LUK26, ANI_MAN, ANI_INV_SOCK);
+
+ if (getGameLoaderInventory()->getCountItemsWithId(ANI_INV_VENT) == 0)
+ inter->_flags &= 0xFFFDFFFF;
+ else
+ inter->_flags |= 0x20000;
+
+ if (g_fp->getObjectState(sO_Sock_26) == g_fp->getObjectEnumState(sO_Sock_26, sO_HangsOnPipe))
+ g_vars->scene26_sockPic->_flags |= 4;
+ else
+ g_vars->scene26_sockPic->_flags &= 0xFFFB;
+
+ if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Opened))
+ g_fp->playSound(SND_26_018, 1);
+}
+
+int scene26_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor != ANI_VENT || g_fp->_cursorId != PIC_CSR_DEFAULT) {
+ if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC26_LTRUBA)
+ g_fp->_cursorId = PIC_CSR_GOL;
+ } else {
+ g_fp->_cursorId = PIC_CSR_ITN;
+ }
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler26_updateDrop() {
+ if (g_fp->getObjectState(sO_Valve5_26) == g_fp->getObjectEnumState(sO_Valve5_26, sO_Closed))
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_vars->scene26_drop, 0);
+ else
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_vars->scene26_drop, 1);
+}
+
+void scene26_setupDrop(Scene *sc) {
+ sceneHandler26_updateDrop();
+}
+
+void sceneHandler26_showChi() {
+ g_vars->scene26_chhi->changeStatics2(ST_CHI_EMPTY);
+
+ chainQueue(QU_CHI_SHOW, 1);
+}
+
+void sceneHandler26_updatePool() {
+ if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Valve1_26))
+ g_fp->setObjectState(sO_Pool, g_fp->getObjectEnumState(sO_Pool, sO_Overfull));
+ else if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Overfull))
+ g_fp->setObjectState(sO_Pool, g_fp->getObjectEnumState(sO_Pool, sO_Full));
+
+ if (g_fp->getObjectState(sO_Valve2_26) == g_fp->getObjectEnumState(sO_Valve2_26, sO_Valve1_26)) {
+ if (g_fp->getObjectState(sO_Pool) >= g_fp->getObjectEnumState(sO_Pool, sO_Full))
+ g_fp->setObjectState(sO_Pool, g_fp->getObjectEnumState(sO_Pool, sO_HalfFull));
+ }
+
+ if (g_fp->getObjectState(sO_Valve3_26) == g_fp->getObjectEnumState(sO_Valve3_26, sO_Valve1_26)) {
+ if (g_fp->getObjectState(sO_Pool) >= g_fp->getObjectEnumState(sO_Pool, sO_HalfFull))
+ g_fp->setObjectState(sO_Pool, g_fp->getObjectEnumState(sO_Pool, sO_Empty));
+ }
+}
+
+void sceneHandler26_hideChi() {
+ g_vars->scene26_chhi->changeStatics2(ST_CHI_NORM);
+
+ chainQueue(QU_CHI_HIDE, 1);
+}
+
+void sceneHandler26_testVent() {
+ if (!g_vars->scene26_activeVent)
+ return;
+
+ if (g_vars->scene26_activeVent->_okeyCode == 0) {
+ if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Opened))
+ g_fp->stopAllSoundInstances(SND_26_018);
+ else
+ g_fp->playSound(SND_26_018, 1);
+
+ if (g_fp->getObjectState(sO_Valve2_26) == g_fp->getObjectEnumState(sO_Valve2_26, sO_Opened)) {
+ chainQueue(QU_SC26_AUTOCLOSE2, 0);
+
+ g_fp->playSound(SND_26_020, 0);
+ }
+
+ if (g_fp->getObjectState(sO_Valve3_26) == g_fp->getObjectEnumState(sO_Valve3_26, sO_Opened)) {
+ chainQueue(QU_SC26_AUTOCLOSE3, 0);
+
+ g_fp->playSound(SND_26_020, 0);
+ }
+ } else if (g_vars->scene26_activeVent->_okeyCode == 1) {
+ if (g_fp->getObjectState(sO_Valve2_26) == g_fp->getObjectEnumState(sO_Valve2_26, sO_Opened))
+ g_fp->playSound(SND_26_020, 0);
+ else
+ g_fp->playSound(SND_26_019, 0);
+
+ if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Overfull)
+ || g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Full))
+ g_fp->playSound(SND_26_003, 0);
+
+ if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Opened)) {
+ g_fp->stopAllSoundInstances(SND_26_018);
+
+ chainQueue(QU_SC26_AUTOCLOSE1, 0);
+ }
+ } else if (g_vars->scene26_activeVent->_okeyCode == 2) {
+ if (g_fp->getObjectState(sO_Valve3_26) == g_fp->getObjectEnumState(sO_Valve3_26, sO_Opened))
+ g_fp->playSound(SND_26_020, 0);
+ else
+ g_fp->playSound(SND_26_019, 0);
+
+ if (g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Overfull)
+ || g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_Full)
+ || g_fp->getObjectState(sO_Pool) == g_fp->getObjectEnumState(sO_Pool, sO_HalfFull))
+ g_fp->playSound(SND_26_003, 0);
+
+ if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Opened)) {
+ g_fp->stopAllSoundInstances(SND_26_018);
+
+ chainQueue(QU_SC26_AUTOCLOSE1, 0);
+ }
+ }
+}
+
+void sceneHandler26_showVent() {
+ if (g_vars->scene26_activeVent) {
+ int id = g_vars->scene26_activeVent->_statics->_staticsId;
+
+ if (id == ST_VNT26_UP2) {
+ g_vars->scene26_activeVent->changeStatics2(ST_VNT26_RIGHT2);
+ } else {
+ if (id != ST_VNT26_RIGHT2)
+ return;
+
+ g_vars->scene26_activeVent->changeStatics2(ST_VNT26_UP2);
+ }
+ g_vars->scene26_activeVent->show1(-1, -1, -1, 0);
+ }
+}
+
+void sceneHandler26_hideVent() {
+ if (g_vars->scene26_activeVent)
+ g_vars->scene26_activeVent->hide();
+}
+
+void sceneHandler26_animateVents(StaticANIObject *ani) {
+ int qId = 0;
+
+ switch (ani->_okeyCode) {
+ case 0:
+ if (g_fp->getObjectState(sO_Valve1_26) == g_fp->getObjectEnumState(sO_Valve1_26, sO_Closed))
+ qId = QU_SC26_OPEN1;
+ else
+ qId = QU_SC26_CLOSE1;
+
+ break;
+
+ case 1:
+ if (g_fp->getObjectState(sO_Valve2_26) == g_fp->getObjectEnumState(sO_Valve2_26, sO_Closed))
+ qId = QU_SC26_OPEN2;
+ else
+ qId = QU_SC26_CLOSE2;
+
+ break;
+
+ case 2:
+ if (g_fp->getObjectState(sO_Valve3_26) == g_fp->getObjectEnumState(sO_Valve3_26, sO_Closed))
+ qId = QU_SC26_OPEN3;
+ else
+ qId = QU_SC26_CLOSE3;
+
+ break;
+
+ case 3:
+ if (g_fp->getObjectState(sO_Valve4_26) == g_fp->getObjectEnumState(sO_Valve4_26, sO_Closed))
+ qId = QU_SC26_OPEN4;
+ else
+ qId = QU_SC26_CLOSE4;
+
+ break;
+
+ case 4:
+ if (g_fp->getObjectState(sO_Valve5_26) == g_fp->getObjectEnumState(sO_Valve5_26, sO_Closed))
+ qId = QU_SC26_OPEN5;
+ else
+ qId = QU_SC26_CLOSE5;
+
+ break;
+
+ default:
+ return;
+ }
+
+ if (qId) {
+ MessageQueue *mq = g_fp->_currentScene->getMessageQueueById(qId);
+
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+ }
+}
+
+void sceneHandler26_clickVent(StaticANIObject *ani, ExCommand *cmd) {
+ if (ani->_okeyCode || g_fp->getObjectState(sO_Hatch_26) == g_fp->getObjectEnumState(sO_Hatch_26, sO_Opened)) {
+ if (g_fp->_aniMan->isIdle() && !(g_fp->_aniMan->_flags & 0x100)) {
+ g_vars->scene26_activeVent = ani;
+
+ int x = ani->_ox - 20;
+ int y = ani->_oy + 61;
+
+ if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(y - g_fp->_aniMan->_oy) > 1 || g_fp->_aniMan->_movement || g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) {
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, y, 1, ST_MAN_UP);
+
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC26_CLICKVENT, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags |= 3;
+ ex->_keyCode = ani->_okeyCode;
+
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, x, y, 0, -1);
+ }
+ } else {
+ sceneHandler26_animateVents(ani);
+ }
+ }
+ }
+
+ cmd->_messageKind = 0;
+}
+
+int sceneHandler26(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC26_UPDATEDROP:
+ sceneHandler26_updateDrop();
+ break;
+
+ case MSG_SC26_SHOWCHI:
+ sceneHandler26_showChi();
+ break;
+
+ case MSG_SC26_UPDATEPOOL:
+ sceneHandler26_updatePool();
+ break;
+
+ case MSG_SC26_HIDECHI:
+ sceneHandler26_hideChi();
+ break;
+
+ case MSG_SC26_TESTVENT:
+ sceneHandler26_testVent();
+ break;
+
+ case MSG_SC26_SHOWVENT:
+ sceneHandler26_showVent();
+ break;
+
+ case MSG_SC26_CLICKVENT:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT, cmd->_keyCode);
+
+ if (ani && ani->_id == ANI_VENT)
+ sceneHandler26_clickVent(ani, cmd);
+
+ break;
+ }
+
+ case MSG_SC26_HIDEVENT:
+ sceneHandler26_hideVent();
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani && ani->_id == ANI_VENT)
+ sceneHandler26_clickVent(ani, cmd);
+
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene28.cpp b/engines/fullpipe/scenes/scene28.cpp
new file mode 100644
index 0000000000..62afd128c2
--- /dev/null
+++ b/engines/fullpipe/scenes/scene28.cpp
@@ -0,0 +1,474 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/floaters.h"
+
+namespace Fullpipe {
+
+void scene28_initScene(Scene *sc) {
+ g_vars->scene28_fliesArePresent = true;
+ g_vars->scene28_beardedDirection = true;
+ g_vars->scene28_darkeningObject = 0;
+ g_vars->scene28_lighteningObject = 0;
+ g_vars->scene28_headDirection = false;
+ g_vars->scene28_headBeardedFlipper = false;
+ g_vars->scene28_lift6inside = false;
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_28"));
+
+ g_fp->initArcadeKeys("SC_28");
+}
+
+int scene28_updateCursor() {
+ g_fp->updateCursorCommon();
+ if (g_fp->_objectIdAtCursor == ANI_LIFT || g_fp->_objectIdAtCursor == ANI_LIFT_28)
+ if (g_fp->_cursorId == PIC_CSR_DEFAULT)
+ g_fp->_cursorId = PIC_CSR_ITN;
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler28_lift1ShowAfter() {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN_28, -1);
+
+ g_fp->_aniMan->_statics = g_fp->_aniMan->getStaticsById(ST_MAN_SIT|0x4000);
+ g_fp->_aniMan->setOXY(ani->_ox + 7, ani->_oy);
+ g_fp->_aniMan->_priority = ani->_priority;
+ g_fp->_aniMan->show1(-1, -1, -1, 0);
+}
+
+void sceneHandler28_makeFaces(ExCommand *cmd) {
+ g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK4, 0)->_flags &= 0xFFFB;
+
+ g_vars->scene28_lighteningObject = 0;
+
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(cmd->_parId);
+ if (mq) {
+ int frames[5];
+
+ frames[0] = MV_WMN28_IN_1;
+ frames[1] = MV_WMN28_IN_2;
+ frames[2] = MV_WMN28_IN_3;
+ frames[3] = MV_WMN28_IN_4;
+ frames[4] = MV_WMN28_IN_5;
+
+ for (int i = 0; i < 5; i++) {
+ int pos;
+
+ while (frames[pos = g_fp->_rnd->getRandomNumber(4)] == 0)
+ ;
+
+ mq->getExCommandByIndex(i)->_messageNum = frames[pos];
+
+ frames[pos] = 0;
+ }
+ }
+}
+
+void sceneHandler28_trySecondaryPers() {
+ MessageQueue *mq;
+ int x;
+
+ if (g_vars->scene28_headBeardedFlipper) {
+ if (g_vars->scene28_beardedDirection) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_BRD28_GOR), 0, 1);
+
+ mq->getExCommandByIndex(0)->_x = g_fp->_sceneRect.left - 20;
+ mq->getExCommandByIndex(0)->_keyCode = 1;
+ mq->replaceKeyCode(-1, 1);
+ mq->chain(0);
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_BRD28_GOR), 0, 1);
+
+ mq->getExCommandByIndex(0)->_x = g_fp->_sceneRect.left - 40;
+ mq->getExCommandByIndex(0)->_y += 20;
+ mq->getExCommandByIndex(0)->_keyCode = 2;
+ mq->replaceKeyCode(-1, 2);
+ mq->chain(0);
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_BRD28_GOR), 0, 1);
+
+ x = g_fp->_sceneRect.left - 60;
+ } else {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_BRD28_GOL), 0, 1);
+
+ mq->getExCommandByIndex(0)->_x = g_fp->_sceneRect.right + 20;
+ mq->getExCommandByIndex(0)->_keyCode = 1;
+ mq->replaceKeyCode(-1, 1);
+ mq->chain(0);
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_BRD28_GOL), 0, 1);
+
+ mq->getExCommandByIndex(0)->_x = g_fp->_sceneRect.right + 40;
+ mq->getExCommandByIndex(0)->_y += 20;
+ mq->getExCommandByIndex(0)->_keyCode = 2;
+ mq->replaceKeyCode(-1, 2);
+ mq->chain(0);
+
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_BRD28_GOL), 0, 1);
+
+ x = g_fp->_sceneRect.right + 60;
+ }
+
+ mq->getExCommandByIndex(0)->_x = x;
+ mq->getExCommandByIndex(0)->_y += 40;
+ mq->getExCommandByIndex(0)->_keyCode = 3;
+ mq->replaceKeyCode(-1, 3);
+ mq->chain( 0);
+
+ g_vars->scene28_beardedDirection = !g_vars->scene28_beardedDirection;
+ } else {
+ if (g_vars->scene28_headDirection) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_GLV28_GOR), 0, 1);
+
+ x = g_fp->_sceneRect.left - 40;
+ } else {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_GLV28_GOL), 0, 1);
+
+ x = g_fp->_sceneRect.right + 40;
+ }
+
+ mq->getExCommandByIndex(0)->_x = x;
+ mq->chain(0);
+
+ g_vars->scene28_headDirection = !g_vars->scene28_headDirection;
+ }
+
+ g_vars->scene28_headBeardedFlipper = !g_vars->scene28_headBeardedFlipper;
+}
+
+void sceneHandler28_turnOn2() {
+ if (g_vars->scene28_fliesArePresent) {
+ g_fp->_floaters->genFlies(g_fp->_currentScene, 1013, 329, 60, 4);
+
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val15 = 30;
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->countdown = g_fp->_rnd->getRandomNumber(12) + 12;
+
+ g_fp->_floaters->genFlies(g_fp->_currentScene, 1074, 311, 60, 4);
+
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val15 = 30;
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->countdown = g_fp->_rnd->getRandomNumber(12) + 12;
+ }
+
+ g_vars->scene28_fliesArePresent = false;
+}
+
+void sceneHandler28_startWork1() {
+ g_fp->_aniMan->hide();
+
+ StaticANIObject *man = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN_28, -1);
+
+ man->_statics = man->getStaticsById(ST_MAN28_RIGHT);
+ man->setOXY(g_fp->_aniMan->_ox, g_fp->_aniMan->_oy);
+ man->_priority = g_fp->_aniMan->_priority;
+ man->show1(-1, -1, -1, 0);
+
+ chainQueue(QU_SC28_LIFT1_WORK, 1);
+}
+
+void sceneHandler28_lift0Start() {
+ chainQueue(QU_SC28_LIFT0_START, 1);
+}
+
+void sceneHandler28_lift1Start() {
+ g_fp->_aniMan->_flags |= 1;
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+
+ chainQueue(QU_SC28_LIFT1_START, 1);
+}
+
+void sceneHandler28_lift2Start() {
+ chainQueue(QU_SC28_LIFT2_START, 1);
+}
+
+void sceneHandler28_lift3Start() {
+ chainQueue(QU_SC28_LIFT3_START, 1);
+}
+
+void sceneHandler28_lift4Start() {
+ g_fp->_aniMan->_flags |= 1;
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+
+ chainQueue(QU_SC28_WMN_START, 1);
+}
+
+void sceneHandler28_lift5Start() {
+ chainQueue(QU_SC28_LIFT5_START, 1);
+}
+
+void sceneHandler28_lift6Start() {
+ g_fp->_aniMan->_flags |= 1;
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+
+ StaticANIObject *woman = g_fp->_currentScene->getStaticANIObject1ById(ANI_TIOTIA, -1);
+
+ if (woman && (woman->_flags & 4))
+ chainQueue(QU_SC28_LIFT6_START2, 1);
+ else
+ chainQueue(QU_SC28_LIFT6_START, 1);
+}
+
+void sceneHandler28_clickLift(int keycode) {
+ int x = 0;
+
+ switch (keycode) {
+ case 0: x = 600; break;
+ case 1: x = 824; break;
+ case 2: x = 1055; break;
+ case 3: x = 1286; break;
+ case 4: x = 1517; break;
+ case 5: x = 1748; break;
+ case 6: x = 1979; break;
+ }
+
+ if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(472 - g_fp->_aniMan->_oy) > 1
+ || g_fp->_aniMan->_movement
+ || g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) {
+ MessageQueue *mq = getCurrSceneSc2MotionController()->method34(g_fp->_aniMan, x, 472, 1, ST_MAN_UP);
+ if (mq) {
+ ExCommand *ex = new ExCommand(0, 17, MSG_SC28_CLICKLIFT, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags |= 3;
+
+ mq->addExCommandToEnd(ex);
+
+ postExCommand(g_fp->_aniMan->_id, 2, x, 472, 0, -1);
+ }
+ } else {
+ switch (keycode) {
+ case 0:
+ sceneHandler28_lift0Start();
+ break;
+ case 1:
+ sceneHandler28_lift1Start();
+ break;
+ case 2:
+ sceneHandler28_lift2Start();
+ break;
+ case 3:
+ sceneHandler28_lift3Start();
+ break;
+ case 4:
+ sceneHandler28_lift4Start();
+ break;
+ case 5:
+ sceneHandler28_lift5Start();
+ break;
+ case 6:
+ sceneHandler28_lift6Start();
+ break;
+ default:
+ return;
+ }
+ }
+}
+
+int sceneHandler28(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC28_LIFT6MUSIC:
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_28"), "MUSIC_TIOTIA", 1);
+ break;
+
+ case MSG_SC28_LIFT6INSIDE:
+ g_vars->scene28_lift6inside = true;
+ break;
+
+ case MSG_SC28_LIFT1_SHOWAFTER:
+ sceneHandler28_lift1ShowAfter();
+ break;
+
+ case MSG_SC28_MAKEFACES:
+ sceneHandler28_makeFaces(cmd);
+ break;
+
+ case MSG_SC28_TRYVTORPERS:
+ sceneHandler28_trySecondaryPers();
+ break;
+
+ case MSG_SC28_TURNOFF_0:
+ g_vars->scene28_lighteningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK0, 0);
+ g_vars->scene28_lighteningObject->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_0:
+ g_vars->scene28_darkeningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK0, 0);
+ break;
+
+ case MSG_SC28_TURNON_1:
+ g_vars->scene28_darkeningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK1, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_1:
+ g_vars->scene28_lighteningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK1, 0);
+ g_vars->scene28_lighteningObject->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_2:
+ g_vars->scene28_darkeningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK2, 0);
+ sceneHandler28_turnOn2();
+ break;
+
+ case MSG_SC28_TURNOFF_2:
+ g_vars->scene28_lighteningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK2, 0);
+ g_vars->scene28_lighteningObject->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_3:
+ g_vars->scene28_darkeningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK3, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_3:
+ g_vars->scene28_lighteningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK3, 0);
+ g_vars->scene28_lighteningObject->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_4:
+ g_vars->scene28_darkeningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK4, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_4:
+ g_vars->scene28_lighteningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK4, 0);
+ g_vars->scene28_lighteningObject->_flags |= 4;
+ break;
+
+ case MSG_SC28_TURNON_6:
+ g_vars->scene28_darkeningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK6, 0);
+ break;
+
+ case MSG_SC28_TURNOFF_6:
+ g_vars->scene28_lighteningObject = g_fp->_currentScene->getPictureObjectById(PIC_SC28_DARK6, 0);
+ g_vars->scene28_lighteningObject->_flags |= 4;
+ break;
+
+ case MSG_SC28_STARTWORK1:
+ sceneHandler28_startWork1();
+ break;
+
+ case MSG_SC28_CLICKLIFT:
+ sceneHandler28_clickLift(cmd->_keyCode);
+ break;
+
+ case MSG_SC28_ENDLIFT1:
+ case MSG_SC28_ENDLIFT6:
+ case MSG_SC28_ENDCABIN:
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+ g_fp->_aniMan->_flags &= 0xFEFF;
+ break;
+
+ case 29:
+ {
+ if (g_vars->scene28_lift6inside) {
+ chainObjQueue(g_fp->_aniMan, QU_SC28_LIFT6_END, 1);
+
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_28"), "MUSIC", 1);
+
+ g_vars->scene28_lift6inside = false;
+ }
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani)
+ if (ani->_id == ANI_LIFT || ani->_id == ANI_LIFT_28 ) {
+ sceneHandler28_clickLift(ani->_okeyCode);
+
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
+ g_fp->processArcade(cmd);
+ }
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene28_darkeningObject) {
+ if (g_vars->scene28_darkeningObject->_picture->getAlpha() > 10) {
+ g_vars->scene28_darkeningObject->_picture->setAlpha(g_vars->scene28_darkeningObject->_picture->getAlpha() - 10);
+ } else {
+ g_vars->scene28_darkeningObject->_flags &= 0xFFFB;
+
+ g_vars->scene28_darkeningObject = 0;
+ }
+ }
+
+ if (g_vars->scene28_lighteningObject) {
+ if (g_vars->scene28_lighteningObject->_picture->getAlpha() < 0xF9u) {
+ g_vars->scene28_lighteningObject->_picture->setAlpha(g_vars->scene28_lighteningObject->_picture->getAlpha() + 6);
+ } else {
+ g_vars->scene28_lighteningObject->_picture->setAlpha(0xff);
+
+ g_vars->scene28_lighteningObject = 0;
+ }
+ }
+
+ g_fp->_floaters->update();
+
+ for (uint i = 0; i < g_fp->_floaters->_array2.size(); i++)
+ if (g_fp->_floaters->_array2[i]->val13 == 1)
+ g_fp->_floaters->_array2[i]->ani->_priority = 15;
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene30.cpp b/engines/fullpipe/scenes/scene30.cpp
new file mode 100644
index 0000000000..59cb83efcd
--- /dev/null
+++ b/engines/fullpipe/scenes/scene30.cpp
@@ -0,0 +1,152 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene30_enablePass(Scene *sc) {
+ MovGraphLink *lnk = getSc2MctlCompoundBySceneId(sc->_sceneId)->getLinkByName(sO_WayToPipe);
+
+ if (g_fp->getObjectState(sO_Leg) == g_fp->getObjectEnumState(sO_Leg, sO_WithAll))
+ lnk->_flags &= 0xDFFFFFFF;
+ else
+ lnk->_flags |= 0x20000000;
+}
+
+void scene30_initScene(Scene *sc, int flag) {
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_vars->scene30_leg = sc->getStaticANIObject1ById(ANI_LEG, -1);
+ g_fp->_currentScene = sc;
+
+ if (g_fp->getObjectState(sO_Leg) == g_fp->getObjectEnumState(sO_Leg, sO_ShowingHeel))
+ g_vars->scene30_leg->changeStatics2(ST_LEG_UP);
+ else if (g_fp->getObjectState(sO_Leg) == g_fp->getObjectEnumState(sO_Leg, sO_WithoutJugs))
+ g_vars->scene30_leg->changeStatics2(ST_LEG_DOWN);
+ else if (g_fp->getObjectState(sO_Leg) == g_fp->getObjectEnumState(sO_Leg, sO_WithBig))
+ g_vars->scene30_leg->changeStatics2(ST_LEG_DOWN1);
+ else if (g_fp->getObjectState(sO_Leg) == g_fp->getObjectEnumState(sO_Leg, sO_WithSmall))
+ g_vars->scene30_leg->changeStatics2(ST_LEG_DOWN2);
+ else if (g_fp->getObjectState(sO_Leg) == g_fp->getObjectEnumState(sO_Leg, sO_WithAll))
+ g_vars->scene30_leg->changeStatics2(ST_LEG_EMPTY);
+
+ g_fp->_currentScene = oldsc;
+
+ scene30_enablePass(sc);
+
+ if (flag == LiftUp || flag == LiftDown)
+ g_vars->scene30_liftFlag = 0;
+ else
+ g_vars->scene30_liftFlag = 1;
+
+ g_fp->lift_setButton(sO_Level8, ST_LBN_8N);
+
+ g_fp->lift_sub5(sc, QU_SC30_ENTERLIFT, QU_SC30_EXITLIFT);
+}
+
+int scene30_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC30_LTRUBA) {
+ g_fp->_cursorId = PIC_CSR_GOL;
+ }
+ return g_fp->_cursorId;
+}
+
+int sceneHandler30(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC30_UPDATEPATH:
+ scene30_enablePass(g_fp->_currentScene);
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
+
+ if (ani && ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+
+ cmd->_messageKind = 0;
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene31.cpp b/engines/fullpipe/scenes/scene31.cpp
new file mode 100644
index 0000000000..587fc6aaef
--- /dev/null
+++ b/engines/fullpipe/scenes/scene31.cpp
@@ -0,0 +1,126 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene31_initScene(Scene *sc) {
+ g_vars->scene31_chantingCountdown = 0;
+ g_vars->scene31_cactus = sc->getStaticANIObject1ById(ANI_CACTUS_31, -1);
+
+ if (g_fp->getObjectState(sO_Cactus) == g_fp->getObjectEnumState(sO_Cactus, sO_HasGrown)) {
+ Scene *oldsc = g_fp->_currentScene;
+ g_fp->_currentScene = sc;
+
+ g_vars->scene31_cactus->changeStatics2(ST_CTS31_GROWN2);
+ g_vars->scene31_cactus->_priority = 22;
+
+ g_fp->_currentScene = oldsc;
+ } else {
+ g_vars->scene31_cactus->hide();
+ }
+
+ g_vars->scene31_plusMinus = sc->getStaticANIObject1ById(ANI_PLUSMINUS, -1);
+
+ if (g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_Off))
+ g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_MINUS);
+ else
+ g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_PLUS);
+}
+
+void sceneHandler31_testCactus(ExCommand *cmd) {
+ if ((g_vars->scene31_cactus->_flags & 4) && g_vars->scene31_cactus->_statics->_staticsId == ST_CTS31_GROWN2) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(cmd->_parId);
+
+ if (mq) {
+ mq->getExCommandByIndex(0)->_messageKind = 0;
+ mq->getExCommandByIndex(0)->_excFlags |= 1;
+
+ mq->getExCommandByIndex(1)->_messageKind = 0;
+ mq->getExCommandByIndex(1)->_excFlags |= 1;
+ }
+ }
+}
+
+int sceneHandler31(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC31_TESTCACTUS:
+ sceneHandler31_testCactus(cmd);
+ break;
+
+ case MSG_SC15_STOPCHANTING:
+ g_fp->stopAllSoundInstances(SND_31_001);
+
+ g_vars->scene31_chantingCountdown = 120;
+ break;
+
+ case MSG_SC31_PULL:
+ if ( g_vars->scene31_plusMinus->_statics->_staticsId == ST_PMS_MINUS)
+ g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_PLUS);
+ else
+ g_vars->scene31_plusMinus->_statics = g_vars->scene31_plusMinus->getStaticsById(ST_PMS_MINUS);
+
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene31_chantingCountdown > 0) {
+ --g_vars->scene31_chantingCountdown;
+
+ if (!g_vars->scene31_chantingCountdown)
+ g_fp->playSound(SND_31_001, 1);
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene32.cpp b/engines/fullpipe/scenes/scene32.cpp
new file mode 100644
index 0000000000..c93e888e51
--- /dev/null
+++ b/engines/fullpipe/scenes/scene32.cpp
@@ -0,0 +1,431 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene32_initScene(Scene *sc) {
+ g_vars->scene32_flagIsWaving = false;
+ g_vars->scene32_flagNeedsStopping = false;
+ g_vars->scene32_dudeIsSitting = false;
+ g_vars->scene32_cactusCounter = -1;
+ g_vars->scene32_dudeOnLadder = false;
+ g_vars->scene32_cactusIsGrowing = false;
+ g_vars->scene32_flag = sc->getStaticANIObject1ById(ANI_FLAG, -1);
+ g_vars->scene32_cactus = sc->getStaticANIObject1ById(ANI_CACTUS, -1);
+ g_vars->scene32_massOrange = sc->getStaticANIObject1ById(ANI_TESTO_ORANGE, -1);
+ g_vars->scene32_massBlue = sc->getStaticANIObject1ById(ANI_TESTO_BLUE, -1);
+ g_vars->scene32_massGreen = sc->getStaticANIObject1ById(ANI_TESTO_GREEN, -1);
+ g_vars->scene32_button = sc->getStaticANIObject1ById(ANI_BUTTON_32, -1);
+
+ g_vars->scene32_massOrange->startAnim(MV_TSTO_FLOW, 0, -1);
+ g_vars->scene32_massOrange->_movement->setDynamicPhaseIndex(15);
+
+ g_vars->scene32_massGreen->startAnim(MV_TSTG_FLOW, 0, -1);
+ g_vars->scene32_massGreen->_movement->setDynamicPhaseIndex(26);
+
+ Scene *oldsc = g_fp->_currentScene;
+ StaticANIObject *ani;
+
+ if (g_fp->getObjectState(sO_ClockHandle) == g_fp->getObjectEnumState(sO_ClockHandle, sO_In_32_Lies)) {
+ ani = sc->getStaticANIObject1ById(ANI_INV_HANDLE, -1);
+ if (ani) {
+ g_fp->_currentScene = sc;
+
+ ani->changeStatics2(ST_HDL_LAID);
+ }
+ } else {
+ if (g_fp->getObjectState(sO_ClockHandle) == g_fp->getObjectEnumState(sO_ClockHandle, sO_In_32_Sticks)) {
+ ani = sc->getStaticANIObject1ById(ANI_INV_HANDLE, -1);
+
+ g_fp->_currentScene = sc;
+
+ if (ani)
+ ani->changeStatics2(ST_HDL_PLUGGED);
+
+ g_vars->scene32_button->changeStatics2(ST_BTN32_ON);
+ }
+ }
+
+ g_fp->_currentScene = oldsc;
+
+ if (g_fp->getObjectState(sO_Cube) == g_fp->getObjectEnumState(sO_Cube, sO_In_32)) {
+ MessageQueue *mq = new MessageQueue(sc->getMessageQueueById(QU_KBK32_START), 0, 0);
+
+ mq->sendNextCommand();
+ }
+
+ g_fp->lift_setButton(sO_Level9, ST_LBN_9N);
+ g_fp->lift_sub5(sc, QU_SC32_ENTERLIFT, QU_SC32_EXITLIFT);
+
+ g_fp->initArcadeKeys("SC_32");
+}
+
+void scene32_setupMusic() {
+ if (g_fp->lift_checkButton(sO_Level6))
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_32"), "MUSIC2", 1);
+}
+
+int scene32_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor == PIC_SC32_LADDER && g_fp->_cursorId == PIC_CSR_ITN)
+ g_fp->_cursorId = g_vars->scene32_dudeOnLadder ? PIC_CSR_GOD : PIC_CSR_GOU; // TODO FIXME doublecheck
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler32_tryCube() {
+ if (g_fp->getObjectState(sO_Cube) == g_fp->getObjectEnumState(sO_Cube, sO_In_33))
+ chainQueue(QU_KBK32_GO, 0);
+}
+
+void sceneHandler32_startCactus() {
+ g_vars->scene32_cactusCounter = 48;
+ g_vars->scene32_cactusIsGrowing = false;
+}
+
+void sceneHandler32_spin(ExCommand *cmd) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(cmd->_parId);
+
+ if (!mq || mq->getCount() == 0)
+ return;
+
+ ExCommand *ex = mq->getExCommandByIndex(0);
+ ExCommand *newex;
+
+ if ((g_vars->scene32_cactus->_movement && g_vars->scene32_cactus->_movement->_id == MV_CTS_DEFAULT)
+ || g_vars->scene32_cactus->_statics->_staticsId == ST_CTS_GROWUP) {
+ for (int i = 0; i < 12; i++) {
+ newex = ex->createClone();
+ newex->_excFlags |= 2;
+ mq->insertExCommandAt(1, newex);
+ }
+
+ g_vars->scene32_cactus->changeStatics2(ST_CTS_GROWUP);
+
+ chainQueue(QU_CTS_BACK, 1);
+
+ g_vars->scene32_cactusIsGrowing = false;
+
+ return;
+ }
+
+ if (g_vars->scene32_cactus->_statics->_staticsId == ST_CTS_EMPTY && g_vars->scene32_cactusCounter < 0) {
+ for (int i = 0; i < 2; i++) {
+ newex = ex->createClone();
+ newex->_excFlags |= 2;
+ mq->insertExCommandAt(1, newex);
+ }
+
+ chainQueue(QU_KDK_DRIZZLE, 0);
+ }
+}
+
+void sceneHandler32_startFlagLeft() {
+ g_vars->scene32_flag->changeStatics2(ST_FLG_NORM);
+ g_vars->scene32_flag->startAnim(MV_FLG_STARTL, 0, -1);
+
+ g_vars->scene32_flagIsWaving = true;
+}
+
+void sceneHandler32_startFlagRight() {
+ g_vars->scene32_flag->changeStatics2(ST_FLG_NORM);
+ g_vars->scene32_flag->startAnim(MV_FLG_STARTR, 0, -1);
+
+ g_vars->scene32_flagIsWaving = true;
+}
+
+void sceneHandler32_trySit(ExCommand *cmd) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(cmd->_parId);
+
+ if (!mq || mq->getCount() == 0)
+ return;
+
+ ExCommand *ex = mq->getExCommandByIndex(0);
+
+ if (g_vars->scene32_cactusIsGrowing || g_vars->scene32_cactus->_movement
+ || g_vars->scene32_cactus->_statics->_staticsId != ST_CTS_EMPTY
+ || (g_vars->scene32_cactusCounter >= 0 && g_vars->scene32_cactusCounter <= 20)) {
+ ex->_messageKind = 0;
+ ex->_excFlags |= 1;
+ } else {
+ ex->_parentId = ANI_MAN;
+ ex->_messageKind = 1;
+ ex->_messageNum = MV_MAN32_SITDOWN;
+ ex->_keyCode = g_fp->_aniMan->_okeyCode;
+
+ g_vars->scene32_dudeIsSitting = true;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+ }
+}
+
+void sceneHandler32_buttonPush() {
+ if (g_fp->getObjectState(sO_ClockHandle) == g_fp->getObjectEnumState(sO_ClockHandle, sO_In_32_Sticks)) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_INV_HANDLE, -1);
+ if (ani)
+ ani->changeStatics2(ST_HDL_PLUGGED);
+
+ chainQueue(QU_SC32_FALLHANDLE, 1);
+
+ g_vars->scene32_button->changeStatics2(ST_BTN32_OFF);
+ }
+}
+
+void sceneHandler32_installHandle() {
+ chainQueue(QU_SC32_SHOWHANDLE, 0);
+
+ g_vars->scene32_button->changeStatics2(ST_BTN32_ON);
+}
+
+void sceneHandler32_animateCactus() {
+ if (g_fp->_aniMan->_statics->_staticsId != ST_MAN32_SIT)
+ chainQueue(QU_CTS_GROW, 1);
+ else
+ chainQueue(QU_CTS_GROWMAN, 1);
+
+ g_vars->scene32_cactusCounter = -1;
+ g_vars->scene32_cactusIsGrowing = true;
+}
+
+void sceneHandler32_ladderLogic(ExCommand *cmd) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC32_FROMLADDER), 0, 0);
+
+ if (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) != PIC_SC32_LADDER)
+ mq->addExCommandToEnd(cmd->createClone());
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ g_fp->_aniMan->changeStatics2(ST_MAN_STANDLADDER);
+ if (!mq->chain(g_fp->_aniMan))
+ delete mq;
+
+ g_vars->scene32_dudeOnLadder = false;
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+}
+
+void sceneHandler32_potLogic(ExCommand *cmd) {
+ if (g_vars->scene32_cactusCounter < 0 || g_vars->scene32_cactusCounter > 20) {
+ MessageQueue *mq = new MessageQueue(g_fp->_globalMessageQueueList->compact());
+
+ ExCommand *ex = new ExCommand(ANI_MAN, 1, MV_MAN32_STANDUP, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_excFlags |= 2;
+
+ mq->addExCommandToEnd(ex);
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (!ani || ani->_id != ANI_KADKA)
+ mq->addExCommandToEnd(cmd->createClone());
+
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_vars->scene32_dudeIsSitting = false;
+ }
+}
+
+int sceneHandler32(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_SC32_TRUBATOBACK:
+ g_fp->_currentScene->getPictureObjectById(PIC_SC32_RTRUBA, 0)->_priority = 20;
+ break;
+
+ case MSG_SC32_TRUBATOFRONT:
+ g_fp->_currentScene->getPictureObjectById(PIC_SC32_RTRUBA, 0)->_priority = 0;
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC33_TRYKUBIK:
+ sceneHandler32_tryCube();
+ break;
+
+ case MSG_SC32_STARTCACTUS:
+ sceneHandler32_startCactus();
+ break;
+
+ case MSG_SC32_STOPFLAG:
+ g_vars->scene32_flagIsWaving = false;
+ g_vars->scene32_flagNeedsStopping = true;
+ break;
+
+ case MSG_SC32_SPIN:
+ sceneHandler32_spin(cmd);
+ break;
+
+ case MSG_SC32_STARTFLAGLEFT :
+ sceneHandler32_startFlagLeft();
+ break;
+
+ case MSG_SC32_STARTFLAGRIGHT:
+ sceneHandler32_startFlagRight();
+ break;
+
+ case MSG_SC32_TRYSIT:
+ sceneHandler32_trySit(cmd);
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_SC32_ONLADDER:
+ g_vars->scene32_dudeOnLadder = true;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+ break;
+
+ case MSG_SC6_BTNPUSH:
+ sceneHandler32_buttonPush();
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case MSG_SC6_INSTHANDLE:
+ sceneHandler32_installHandle();
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (!g_vars->scene32_flag->_movement) {
+ if (g_vars->scene32_flagIsWaving) {
+ if (g_vars->scene32_flag->_statics->_staticsId == ST_FLG_RIGHT)
+ g_vars->scene32_flag->startAnim(MV_FLG_CYCLER, 0, -1);
+ else if (g_vars->scene32_flag->_statics->_staticsId == ST_FLG_LEFT)
+ g_vars->scene32_flag->startAnim(MV_FLG_CYCLEL, 0, -1);
+ }
+
+ if (g_vars->scene32_flagNeedsStopping && !g_vars->scene32_flagIsWaving) {
+ if (g_vars->scene32_flag->_statics->_staticsId == ST_FLG_RIGHT)
+ g_vars->scene32_flag->startAnim(MV_FLG_STOPR, 0, -1);
+ else if (g_vars->scene32_flag->_statics->_staticsId == ST_FLG_LEFT)
+ g_vars->scene32_flag->startAnim(MV_FLG_STOPL, 0, -1);
+
+ g_vars->scene32_flagNeedsStopping = false;
+ }
+ }
+
+ if (g_vars->scene32_cactusCounter) {
+ if (g_vars->scene32_cactusCounter > 0)
+ --g_vars->scene32_cactusCounter;
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+ } else {
+ sceneHandler32_animateCactus();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ }
+ break;
+
+ case 29:
+ if (g_vars->scene32_dudeOnLadder) {
+ sceneHandler32_ladderLogic(cmd);
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (!g_vars->scene32_dudeIsSitting || g_fp->_aniMan->_movement) {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (ani && ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (g_fp->_cursorId == PIC_CSR_GOFAR_R || g_fp->_cursorId == PIC_CSR_GOFAR_L) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
+ g_fp->processArcade(cmd);
+ }
+ break;
+ }
+
+ if (!g_vars->scene32_cactusIsGrowing)
+ sceneHandler32_potLogic(cmd);
+
+ cmd->_messageKind = 0;
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene33.cpp b/engines/fullpipe/scenes/scene33.cpp
new file mode 100644
index 0000000000..209198c0f3
--- /dev/null
+++ b/engines/fullpipe/scenes/scene33.cpp
@@ -0,0 +1,314 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+const int ventsInit[9] = { 0, 0, 1, 0, 0, 1, 0, 0, 1 };
+
+void scene33_initScene(Scene *sc) {
+ g_vars->scene33_mug = sc->getStaticANIObject1ById(ANI_MUG_33, -1);
+ g_vars->scene33_jettie = sc->getStaticANIObject1ById(ANI_JETTIE_FLOW, -1);
+ g_vars->scene33_cube = 0;
+ g_vars->scene33_cubeX = -1;
+ g_vars->scene33_handleIsDown = false;
+
+ if (g_fp->getObjectState(sO_Cube) == g_fp->getObjectEnumState(sO_Cube, sO_In_33)) {
+ MessageQueue *mq = new MessageQueue(sc->getMessageQueueById(QU_KBK33_START), 0, 0);
+
+ mq->sendNextCommand();
+ }
+
+
+ for (int i = 0; i < 9; i++) {
+ g_vars->scene33_ventsX[i] = sc->getStaticANIObject1ById(ANI_VENT_33, i)->_ox;
+
+ g_vars->scene33_ventsState[i] = ventsInit[i];
+ }
+
+ g_fp->initArcadeKeys("SC_33");
+}
+
+void scene33_setupMusic() {
+ if (g_fp->lift_checkButton(sO_Level6))
+ g_fp->playTrack(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_33"), "MUSIC2", 1);
+}
+
+int scene33_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_objectIdAtCursor == PIC_SC33_ZONES && g_fp->_cursorId == PIC_CSR_DEFAULT)
+ g_fp->_cursorId = PIC_CSR_ITN;
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler33_processJettie(ExCommand *cmd) {
+ MessageQueue *mq = g_fp->_globalMessageQueueList->getMessageQueueById(cmd->_parId);
+
+ if (mq && g_vars->scene33_jettie->_movement) {
+ ExCommand *ex = mq->getExCommandByIndex(0);
+
+ if (ex) {
+ ex->_messageKind = 0;
+ ex->_excFlags |= 1;
+ }
+
+ ex = mq->getExCommandByIndex(1);
+
+ if (ex) {
+ ex->_messageKind = 0;
+ ex->_excFlags |= 1;
+ }
+ }
+}
+
+void sceneHandler33_switchVent(StaticANIObject *ani) {
+ int mv = 0;
+
+ if (ani->_statics->_staticsId == ST_VNT33_DOWN)
+ mv = MV_VNT33_TURNR;
+
+ if (ani->_statics->_staticsId == ST_VNT33_RIGHT)
+ mv = MV_VNT33_TURND;
+
+ if (mv)
+ ani->startAnim(mv, 0, -1);
+
+ g_vars->scene33_ventsState[ani->_okeyCode] = !g_vars->scene33_ventsState[ani->_okeyCode];
+}
+
+void sceneHandler33_processVents() {
+ for (int i = 0; i < 9; i++)
+ if (((g_vars->scene33_cubeX < g_vars->scene33_ventsX[i]) != (g_vars->scene33_cube->_ox < g_vars->scene33_ventsX[i]))
+ && g_vars->scene33_ventsState[i] != ventsInit[i])
+ sceneHandler33_switchVent(g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, i));
+
+ g_vars->scene33_cubeX = g_vars->scene33_cube->_ox;
+}
+
+void sceneHandler33_tryCube() {
+ if (g_fp->getObjectState(sO_Cube) == g_fp->getObjectEnumState(sO_Cube, sO_In_32))
+ chainQueue(QU_KBK33_GO, 0);
+}
+
+void sceneHandler33_pour() {
+ bool solved = true;
+
+ for (int i = 0; i < 9; i++)
+ if (g_vars->scene33_ventsState[i] != ventsInit[i])
+ solved = false;
+
+ if (solved) {
+ if ((g_vars->scene33_mug->_flags & 4) && g_vars->scene33_mug->_statics->_staticsId == ST_MUG33_EMPTY) {
+ g_vars->scene33_jettie->startAnim(MV_JTI33_POUR, 0, -1);
+
+ g_vars->scene33_handleIsDown = false;
+
+ return;
+ }
+
+ if ((g_vars->scene33_mug->_flags & 4) && g_vars->scene33_mug->_statics->_staticsId == ST_MUG33_FULL) {
+ g_vars->scene33_jettie->startAnim(MV_JTI33_POURFULL, 0, -1);
+
+ g_vars->scene33_handleIsDown = false;
+
+ return;
+ }
+
+ g_vars->scene33_jettie->startAnim(MV_JTI33_FLOW, 0, -1);
+ }
+
+ g_vars->scene33_handleIsDown = false;
+}
+
+void sceneHandler33_handleDown() {
+ if (!g_vars->scene33_handleIsDown && !g_vars->scene33_jettie->_movement && !g_vars->scene33_jettie->getMessageQueue() ) {
+ chainQueue(QU_SC33_STARTWATER, 0);
+
+ g_vars->scene33_handleIsDown = true;
+ }
+}
+
+void sceneHandler33_zoneClickProcess(StaticANIObject *ani) {
+ if (!ani->_movement) {
+ sceneHandler33_switchVent(ani);
+
+ StaticANIObject *vent1 = 0;
+ StaticANIObject *vent2 = 0;
+
+ switch (ani->_okeyCode) {
+ case 0:
+ vent1 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 2);
+ vent2 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 3);
+ break;
+
+ case 1:
+ vent1 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 3);
+ vent2 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 4);
+ break;
+
+ case 2:
+ vent1 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 4);
+ vent2 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 0);
+ break;
+
+ case 3:
+ vent1 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 0);
+ vent2 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 1);
+ break;
+
+ case 4:
+ vent1 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 1);
+ vent2 = g_fp->_currentScene->getStaticANIObject1ById(ANI_VENT_33, 2);
+ break;
+
+ default:
+ return;
+ }
+
+ if (vent1) {
+ sceneHandler33_switchVent(vent1);
+ sceneHandler33_switchVent(vent2);
+ }
+ }
+}
+
+void sceneHandler33_clickZones(ExCommand *cmd) {
+ StaticANIObject *closest = 0;
+ double mindist = 1e10;
+
+ for (uint i = 0; i < g_fp->_currentScene->_staticANIObjectList1.size(); i++) {
+ StaticANIObject *ani = (StaticANIObject *)g_fp->_currentScene->_staticANIObjectList1[i];
+
+ if (ani->_id == ANI_VENT_33) {
+ int dx = ani->_ox - cmd->_sceneClickX;
+ int dy = ani->_oy - cmd->_sceneClickY;
+ double dist = sqrt((double)(dx * dx + dy * dy));
+
+ if (dist < mindist) {
+ mindist = dist;
+ closest = ani;
+ }
+ }
+ }
+
+ if (closest)
+ sceneHandler33_zoneClickProcess(closest);
+}
+
+int sceneHandler33(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC32_TRUBATOFRONT:
+ g_fp->_currentScene->getPictureObjectById(PIC_SC33_LTRUBA, 0)->_priority = 0;
+ break;
+
+ case MSG_SC32_TRUBATOBACK:
+ g_fp->_currentScene->getPictureObjectById(PIC_SC33_LTRUBA, 0)->_priority = 20;
+ break;
+
+ case MSG_SC33_TESTMUG:
+ sceneHandler33_processJettie(cmd);
+ break;
+
+ case MSG_SC33_UPDATEKUBIK:
+ g_vars->scene33_cube = g_fp->_currentScene->getStaticANIObject1ById(ANI_KUBIK, -1);
+
+ if (g_vars->scene33_cube)
+ g_vars->scene33_cubeX = g_vars->scene33_cube->_ox;
+
+ break;
+
+ case MSG_SC33_TRYKUBIK:
+ sceneHandler33_tryCube();
+ break;
+
+ case MSG_SC33_POUR:
+ sceneHandler33_pour();
+ break;
+
+ case MSG_SC33_HANDLEDOWN:
+ sceneHandler33_handleDown();
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (pic && pic->_id == PIC_SC33_ZONES) {
+ sceneHandler33_clickZones(cmd);
+ break;
+ }
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1) || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0))
+ g_fp->processArcade(cmd);
+ }
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene33_cube)
+ sceneHandler33_processVents();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene34.cpp b/engines/fullpipe/scenes/scene34.cpp
new file mode 100644
index 0000000000..942a0abc6b
--- /dev/null
+++ b/engines/fullpipe/scenes/scene34.cpp
@@ -0,0 +1,479 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+#include "fullpipe/floaters.h"
+
+namespace Fullpipe {
+
+void sceneHandler34_setExits() {
+ int state;
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_NearPipeWithStool)) {
+ if (g_fp->getObjectState(sO_Hatch_34) == g_fp->getObjectEnumState(sO_Hatch_34, sO_Closed))
+ state = g_fp->getObjectEnumState(sO_Plank_34, sO_ClosedWithBoot);
+ else
+ state = g_fp->getObjectEnumState(sO_Plank_34, sO_OpenedWithBoot);
+ } else {
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_OnStool)) {
+ if (g_fp->getObjectState(sO_Hatch_34) == g_fp->getObjectEnumState(sO_Hatch_34, sO_Closed))
+ state = g_fp->getObjectEnumState(sO_Plank_34, sO_IsClosed);
+ else
+ state = g_fp->getObjectEnumState(sO_Plank_34, sO_IsOpened);
+ } else {
+ state = g_fp->getObjectEnumState(sO_Plank_34, sO_Passive);
+ }
+ }
+
+ g_fp->setObjectState(sO_Plank_34, state);
+}
+
+void scene34_initScene(Scene *sc) {
+ g_vars->scene34_cactus = sc->getStaticANIObject1ById(ANI_CACTUS_34, -1);
+ g_vars->scene34_vent = sc->getStaticANIObject1ById(ANI_VENT_34, -1);
+ g_vars->scene34_hatch = sc->getStaticANIObject1ById(ANI_LUK_34, -1);
+ g_vars->scene34_boot = sc->getStaticANIObject1ById(ANI_BOOT_34, -1);
+
+ if (g_fp->getObjectState(sO_Cactus) == g_fp->getObjectEnumState(sO_Cactus, sO_HasGrown)) {
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_fp->_currentScene = sc;
+
+ g_vars->scene34_cactus->changeStatics2(ST_CTS34_EMPTY);
+ g_vars->scene34_cactus->setOXY(506, 674);
+ g_vars->scene34_cactus->_priority = 30;
+
+ g_vars->scene34_cactus->changeStatics2(ST_CTS34_GROWNEMPTY2);
+ g_vars->scene34_cactus->_flags |= 4;
+
+ g_fp->_currentScene = oldsc;
+ }
+
+ if (g_fp->getObjectState(sO_Grandma) == g_fp->getObjectEnumState(sO_Grandma, sO_Strolling))
+ g_fp->setObjectState(sO_Grandma, g_fp->getObjectEnumState(sO_Grandma, sO_OnStool));
+
+ sceneHandler34_setExits();
+
+ g_vars->scene34_dudeClimbed = false;
+ g_vars->scene34_dudeOnBoard = false;
+ g_vars->scene34_dudeOnCactus = false;
+ g_vars->scene34_fliesCountdown = g_fp->_rnd->getRandomNumber(500) + 500;
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_34"));
+
+ g_fp->lift_setButton(sO_Level7, ST_LBN_7N);
+ g_fp->lift_sub5(sc, QU_SC34_ENTERLIFT, QU_SC34_EXITLIFT);
+
+ g_fp->initArcadeKeys("SC_34");
+}
+
+void scene34_initBeh() {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene34_cactus, ST_CTS34_GROWNEMPTY2, QU_CTS34_FALLEFT, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene34_cactus, ST_CTS34_GROWNEMPTY2, QU_CTS34_FALLRIGHT, 0);
+}
+
+int scene34_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if ((g_fp->_objectIdAtCursor != ANI_STOOL_34 || getGameLoaderInventory()->getSelectedItemId() != ANI_INV_BOX)
+ && (g_fp->_objectIdAtCursor != ANI_BOX_34 || getGameLoaderInventory()->getSelectedItemId() != ANI_INV_STOOL))
+ ; // emtpy
+ else
+ g_fp->_cursorId = PIC_CSR_ITN_INV;
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler34_leaveBoard() {
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+
+ g_vars->scene34_dudeOnBoard = false;
+}
+
+void sceneHandler34_onBoard() {
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+
+ g_vars->scene34_dudeOnBoard = true;
+}
+
+void sceneHandler34_testVent() {
+ if (g_fp->_aniMan->_movement->_id == MV_MAN34_TURNVENT_R) {
+ g_vars->scene34_hatch->changeStatics2(ST_LUK34_CLOSED);
+
+ chainQueue(QU_LUK34_OPEN, 0);
+ } else if (g_fp->_aniMan->_movement->_id == MV_MAN34_TURNVENT_L) {
+ g_vars->scene34_hatch->changeStatics2(ST_LUK34_OPEN);
+
+ chainQueue(QU_LUK34_CLOSE, 0);
+ }
+}
+
+void sceneHandler34_hideStool() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_STOOL_34, -1)->hide();
+}
+
+void sceneHandler34_climb() {
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+
+ g_vars->scene34_dudeClimbed = true;
+}
+
+void sceneHandler34_genFlies() {
+ g_fp->_floaters->genFlies(g_fp->_currentScene, 1072, -50, 100, 4);
+
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->countdown = 1;
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val6 = 1072;
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val7 = -50;
+
+ g_vars->scene34_fliesCountdown = g_fp->_rnd->getRandomNumber(500) + 500;
+}
+
+void sceneHandler34_fromCactus(ExCommand *cmd) {
+ if (g_fp->_aniMan->_movement || g_vars->scene34_cactus->_movement || (g_fp->_aniMan->_flags & 0x100)) {
+ cmd->_messageKind = 0;
+
+ return;
+ }
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC34_FROMCACTUS), 0, 0);
+
+ ExCommand *ex = new ExCommand(ANI_MAN, 34, 256, 0, 0, 0, 1, 0, 0, 0);
+
+ ex->_messageNum = 0;
+ ex->_excFlags |= 3;
+ ex->_field_14 = 256;
+ mq->addExCommandToEnd(ex);
+
+ ex = cmd->createClone();
+ mq->addExCommandToEnd(ex);
+
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+
+ g_fp->_aniMan->_flags |= 1;
+}
+
+void sceneHandler34_animateLeaveBoard(ExCommand *cmd) {
+ if (!g_fp->_aniMan->_movement) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC34_LEAVEBOARD), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->setFlags(mq->getFlags() | 1);
+ mq->chain(0);
+ }
+
+ cmd->_messageKind = 0;
+}
+
+void sceneHandler34_animateAction(ExCommand *cmd) {
+ if (g_fp->_aniMan->_movement)
+ return;
+
+ int ox = g_fp->_aniMan->_ox;
+ int oy = g_fp->_aniMan->_oy;
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
+
+ if (!ani || ani->_id != ANI_VENT_34) {
+ int qId = 0;
+
+ if (ox == 887) {
+ if (oy != 370)
+ return;
+
+ qId = QU_SC34_FROMSTOOL;
+ } else {
+ if (ox != 916)
+ return;
+
+ if (oy == 286) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC34_FROMBOX), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->chain(0);
+
+ sceneHandler34_setExits();
+
+ return;
+ }
+
+ if (oy != 345)
+ return;
+
+ qId = QU_SC34_FROMBOX_FLOOR;
+ }
+
+ if (qId) {
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(qId), 0, 0);
+
+ mq->addExCommandToEnd(cmd->createClone());
+ mq->chain(0);
+ }
+
+ return;
+ }
+
+ if (ox == 887) {
+ if (oy == 370)
+ g_fp->_aniMan->startAnim(MV_MAN34_TRYTABUR, 0, -1);
+
+ } else if (ox == 916) {
+ if (oy == 286) {
+ int id = g_vars->scene34_vent->_statics->_staticsId;
+ if (id == ST_VNT34_UP2) {
+ g_fp->_aniMan->startAnim(MV_MAN34_TURNVENT_R, 0, -1);
+ } else if (id == ST_VNT34_RIGHT3) {
+ g_fp->_aniMan->startAnim(MV_MAN34_TURNVENT_L, 0, -1);
+ }
+ } else if (oy == 345) {
+ g_fp->_aniMan->startAnim(MV_MAN34_TRY, 0, -1);
+ }
+ }
+}
+
+void sceneHandler34_showVent() {
+ if (g_vars->scene34_vent->_statics->_staticsId == ST_VNT34_UP2)
+ g_vars->scene34_vent->changeStatics2(ST_VNT34_RIGHT3);
+ else if (g_vars->scene34_vent->_statics->_staticsId == ST_VNT34_RIGHT3)
+ g_vars->scene34_vent->changeStatics2(ST_VNT34_UP2);
+
+ g_vars->scene34_vent->show1(-1, -1, -1, 0);
+}
+
+void sceneHandler34_showBox() {
+ g_fp->_currentScene->getStaticANIObject1ById(ANI_STOOL_34, -1)->changeStatics2(ST_STL34_BOX2);
+}
+
+void sceneHandler34_showStool() {
+ chainQueue(QU_SC34_SHOWSTOOL, 0);
+}
+
+void sceneHandler34_unclimb() {
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+
+ g_vars->scene34_dudeClimbed = false;
+}
+
+int sceneHandler34(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_SC4_HIDEBOOT:
+ g_vars->scene34_boot->_flags &= 0xFFFB;
+ break;
+
+ case MSG_SC34_LEAVEBOARD:
+ sceneHandler34_leaveBoard();
+ break;
+
+ case MSG_SC34_ONBOARD:
+ sceneHandler34_onBoard();
+ break;
+
+ case MSG_SC34_TESTVENT:
+ sceneHandler34_testVent();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC34_FROMCACTUS:
+ g_vars->scene34_dudeOnCactus = false;
+
+ getCurrSceneSc2MotionController()->setEnabled();
+ getGameLoaderInteractionController()->enableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 1);
+
+ break;
+
+ case MSG_SC34_RETRYVENT:
+ if (!g_fp->_aniMan->isIdle())
+ break;
+
+ g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
+ g_fp->_aniMan->_flags &= 0xFEFF;
+
+ getGameLoaderInteractionController()->handleInteraction(g_fp->_aniMan, g_vars->scene34_vent, cmd->_keyCode);
+
+ break;
+
+ case MSG_SC34_ONBUMP:
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene34_cactus, ST_CTS34_GROWNEMPTY2, QU_CTS34_FALLEFT, 1);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene34_cactus, ST_CTS34_GROWNEMPTY2, QU_CTS34_FALLRIGHT, 1);
+ break;
+
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_SC22_HIDESTOOL:
+ sceneHandler34_hideStool();
+ break;
+
+ case MSG_SC34_CLIMB:
+ sceneHandler34_climb();
+ break;
+
+ case MSG_SC34_UNCLIMB:
+ sceneHandler34_unclimb();
+ break;
+
+ case MSG_SC22_SHOWSTOOL:
+ sceneHandler34_showStool();
+ break;
+
+ case MSG_SC34_SHOWBOX:
+ sceneHandler34_showBox();
+ break;
+
+ case MSG_SC34_ONCACTUS:
+ g_vars->scene34_dudeOnCactus = true;
+
+ getCurrSceneSc2MotionController()->clearEnabled();
+ getGameLoaderInteractionController()->disableFlag24();
+
+ g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
+ break;
+
+ case MSG_SC34_SHOWVENT:
+ sceneHandler34_showVent();
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case 29:
+ {
+ if (g_vars->scene34_dudeClimbed) {
+ sceneHandler34_animateAction(cmd);
+ break;
+ }
+
+ if (g_vars->scene34_dudeOnBoard) {
+ sceneHandler34_animateLeaveBoard(cmd);
+ break;
+ }
+
+ if (g_vars->scene34_dudeOnCactus) {
+ sceneHandler34_fromCactus(cmd);
+ break;
+ }
+
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
+
+ if (ani) {
+ if ((ani->_id == ANI_STOOL_34 && cmd->_keyCode == ANI_INV_BOX) || (ani->_id == ANI_BOX_34 && cmd->_keyCode == ANI_INV_STOOL)) {
+ getGameLoaderInteractionController()->handleInteraction(g_fp->_aniMan, g_vars->scene34_vent, cmd->_keyCode);
+
+ cmd->_messageKind = 0;
+ }
+
+ if (ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+
+ cmd->_messageKind = 0;
+
+ break;
+ }
+ }
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1) || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ --g_vars->scene34_fliesCountdown;
+
+ if (!g_vars->scene34_fliesCountdown)
+ sceneHandler34_genFlies();
+
+ g_fp->_floaters->update();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene35.cpp b/engines/fullpipe/scenes/scene35.cpp
new file mode 100644
index 0000000000..290213c453
--- /dev/null
+++ b/engines/fullpipe/scenes/scene35.cpp
@@ -0,0 +1,264 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+#include "fullpipe/floaters.h"
+
+namespace Fullpipe {
+
+void scene35_initScene(Scene *sc) {
+ g_vars->scene35_hose = sc->getStaticANIObject1ById(ANI_HOSE, -1);
+ g_vars->scene35_bellyInflater = sc->getStaticANIObject1ById(ANI_PUZODUV, -1);
+ g_vars->scene35_flowCounter = 0;
+ g_vars->scene35_fliesCounter = 0;
+
+ MovGraphLink *lnk = getSc2MctlCompoundBySceneId(sc->_sceneId)->getLinkByName(sO_CloseThing);
+
+ if (g_vars->scene35_bellyInflater->_statics->_staticsId == ST_PDV_LARGE)
+ lnk->_flags |= 0x20000000;
+ else
+ lnk->_flags &= 0xDFFFFFFF;
+
+ int sndId = 0;
+
+ if (g_fp->getObjectState(sO_Valve_35) == g_fp->getObjectEnumState(sO_Valve_35, sO_TurnedOn)) {
+ if ((g_vars->scene35_hose->_flags & 4) && g_vars->scene35_hose->_statics->_staticsId == ST_HZE_NORM) {
+ sndId = SND_35_012;
+ } else if (g_vars->scene35_bellyInflater->_statics->_staticsId == ST_PDV_SMALL) {
+ sndId = SND_35_011;
+ }
+ }
+
+ if (sndId)
+ g_fp->playSound(sndId, 1);
+
+ g_fp->lift_setButton(sO_Level6, ST_LBN_6N);
+ g_fp->lift_sub5(sc, QU_SC35_ENTERLIFT, QU_SC35_EXITLIFT);
+
+ g_fp->initArcadeKeys("SC_35");
+
+ g_fp->_floaters->init(g_fp->getGameLoaderGameVar()->getSubVarByName("SC_35"));
+}
+
+void sceneHandler35_stopFlow() {
+ g_fp->setObjectState(sO_Valve_35, g_fp->getObjectEnumState(sO_Valve_35, sO_TurnedOff));
+ g_fp->stopAllSoundInstances(SND_35_011);
+ g_fp->playSound(SND_35_026, 0);
+}
+
+void sceneHandler35_shrink() {
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing, 0);
+}
+
+void sceneHandler35_startFlow() {
+ if (g_fp->getObjectState(sO_Valve_35) == g_fp->getObjectEnumState(sO_Valve_35, sO_TurnedOn)) {
+ if ((g_vars->scene35_hose->_flags & 4) && g_vars->scene35_hose->_statics->_staticsId == ST_HZE_NORM) {
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene35_bellyInflater, ST_PDV_SMALL, QU_PDV_SML_BLINK, 0);
+ g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene35_bellyInflater, ST_PDV_SMALL, QU_PDV_SML_TRY, 0);
+
+ g_vars->scene35_bellyInflater->changeStatics2(ST_PDV_SMALL);
+ g_vars->scene35_bellyInflater->_flags &= 0xFEFF;
+
+ MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC35_EATHOZE), 0, 0);
+
+ mq->setFlags(mq->getFlags() | 1);
+
+ ExCommand *cmd = new ExCommand(g_vars->scene35_bellyInflater->_id, 34, 256, 0, 0, 0, 1, 0, 0, 0);
+
+ cmd->_excFlags |= 3;
+ cmd->_field_14 = 256;
+ cmd->_messageNum = 0;
+
+ mq->addExCommandToEnd(cmd);
+
+ if (!mq->chain(g_vars->scene35_bellyInflater))
+ delete mq;
+
+ g_vars->scene35_bellyInflater->_flags |= 1;
+
+ getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing, 1);
+
+ g_fp->playSound(SND_35_012, 1);
+ } else {
+ if (!g_vars->scene35_flowCounter)
+ g_vars->scene35_flowCounter = 98;
+
+ g_fp->playSound(SND_35_011, 1);
+ }
+ }
+}
+
+void sceneHandler35_genFlies() {
+ StaticANIObject *fly = g_fp->_currentScene->getStaticANIObject1ById(ANI_FLY, -1);
+
+ int xoff = 0;
+ if ((!fly || !(fly->_flags & 4)) && !(g_fp->_rnd->getRandomNumber(32767) % 30)) {
+ int x, y;
+
+ if (g_fp->_rnd->getRandomNumber(1)) {
+ x = 600;
+ y = 0;
+ } else {
+ x = 0;
+ y = 600;
+ }
+
+ int numFlies = g_fp->_rnd->getRandomNumber(3) + 1;
+
+ while (numFlies--) {
+ g_fp->_floaters->genFlies(g_fp->_currentScene, g_fp->_rnd->getRandomNumber(55) + 1057, g_fp->_rnd->getRandomNumber(60) + x + xoff, 4, 1);
+
+ xoff += 40;
+
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val2 = 1084;
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val3 = y;
+ g_fp->_floaters->_array2[g_fp->_floaters->_array2.size() - 1]->val11 = 8.0;
+ }
+
+ g_vars->scene35_fliesCounter = 0;
+ }
+}
+
+int sceneHandler35(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC35_STOPFLOW:
+ sceneHandler35_stopFlow();
+ break;
+
+ case MSG_SC35_CHECKPIPESOUND:
+ if (g_fp->getObjectState(sO_Valve_35) == g_fp->getObjectEnumState(sO_Valve_35, sO_TurnedOn)) {
+ g_fp->stopAllSoundInstances(SND_35_011);
+ g_fp->playSound(SND_35_012, 1);
+
+ g_vars->scene35_flowCounter = 0;
+ break;
+ }
+ break;
+
+ case MSG_SC35_SHRINK:
+ sceneHandler35_shrink();
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_SC35_STARTFLOW:
+ case MSG_SC35_PLUGHOSE:
+ sceneHandler35_startFlow();
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
+
+ if (ani)
+ if (ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+ cmd->_messageKind = 0;
+ break;
+ }
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1) || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ if (g_vars->scene35_flowCounter > 0) {
+ --g_vars->scene35_flowCounter;
+
+ if (!g_vars->scene35_flowCounter)
+ sceneHandler35_stopFlow();
+ }
+
+ g_vars->scene35_fliesCounter++;
+
+ if (g_vars->scene35_fliesCounter >= 160)
+ sceneHandler35_genFlies();
+
+ g_fp->_floaters->update();
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene36.cpp b/engines/fullpipe/scenes/scene36.cpp
new file mode 100644
index 0000000000..7d237fd395
--- /dev/null
+++ b/engines/fullpipe/scenes/scene36.cpp
@@ -0,0 +1,94 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene36_initScene(Scene *sc) {
+ g_vars->scene36_rotohrust = sc->getStaticANIObject1ById(ANI_ROTOHRUST, -1);
+ g_vars->scene36_scissors = sc->getStaticANIObject1ById(ANI_SCISSORS_36, -1);
+}
+
+int scene36_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_cursorId != PIC_CSR_ITN || g_fp->_objectIdAtCursor != ANI_ROTOHRUST) {
+ if (g_fp->_objectIdAtCursor == PIC_SC36_MASK && g_fp->_cursorId == PIC_CSR_DEFAULT && (g_vars->scene36_scissors->_flags & 4))
+ g_fp->_cursorId = PIC_CSR_ITN;
+ } else if (g_vars->scene36_rotohrust->_statics->_staticsId == ST_RHT_OPEN)
+ g_fp->_cursorId = PIC_CSR_GOL;
+
+ return g_fp->_cursorId;
+}
+
+int sceneHandler36(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case 29:
+ if (g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY) == PIC_SC36_MASK)
+ if (g_vars->scene36_scissors)
+ if (g_vars->scene36_scissors->_flags & 4)
+ if (g_fp->_aniMan->isIdle())
+ if (!(g_fp->_aniMan->_flags & 0x100) && g_fp->_msgObjectId2 != g_vars->scene36_scissors->_id ) {
+ handleObjectInteraction(g_fp->_aniMan, g_vars->scene36_scissors, cmd->_keyCode);
+
+ cmd->_messageKind = 0;
+ }
+
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene37.cpp b/engines/fullpipe/scenes/scene37.cpp
new file mode 100644
index 0000000000..8324e00af7
--- /dev/null
+++ b/engines/fullpipe/scenes/scene37.cpp
@@ -0,0 +1,316 @@
+/* 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+Ring::Ring() {
+ ani = 0;
+ x = 0;
+ y = 0;
+ numSubRings = 0;
+
+ for (int i = 0; i < 10; i++)
+ subRings[i] = 0;
+
+ state = false;
+}
+
+void scene37_initScene(Scene *sc) {
+ Ring *ring;
+ StaticANIObject *ani;
+
+ g_vars->scene37_lastDudeX = -1;
+
+ ring = new Ring();
+ ani = sc->getStaticANIObject1ById(ANI_GUARD_37, 0);
+ ring->ani = ani;
+ ring->x = ani->_ox - 40;
+ ring->y = ani->_ox + 40;
+ ring->numSubRings = 3;
+ ring->subRings[0] = 1;
+ ring->subRings[1] = 4;
+ ring->subRings[2] = 8;
+ ring->state = false;
+ g_vars->scene37_rings.push_back(ring);
+
+ ring = new Ring();
+ ani = sc->getStaticANIObject1ById(ANI_GUARD_37, 1);
+ ring->ani = ani;
+ ring->x = ani->_ox - 40;
+ ring->y = ani->_ox + 40;
+ ring->numSubRings = 3;
+ ring->subRings[0] = 2;
+ ring->subRings[1] = 5;
+ ring->subRings[2] = 9;
+ ring->state = false;
+ g_vars->scene37_rings.push_back(ring);
+
+ ring = new Ring();
+ ani = sc->getStaticANIObject1ById(ANI_GUARD_37, 2);
+ ring->ani = ani;
+ ring->x = ani->_ox - 40;
+ ring->y = ani->_ox + 40;
+ ring->numSubRings = 3;
+ ring->subRings[0] = 3;
+ ring->subRings[1] = 7;
+ ring->subRings[2] = 11;
+ ring->state = false;
+ g_vars->scene37_rings.push_back(ring);
+
+ g_fp->setObjectState(sO_LeftPipe_37, g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsClosed));
+
+ Scene *oldsc = g_fp->_currentScene;
+
+ g_fp->_currentScene = sc;
+
+ g_vars->scene37_cursorIsLocked = false;
+
+ g_vars->scene37_plusMinus1 = sc->getStaticANIObject1ById(ANI_PLUSMINUS, 1);
+
+ for (int i = 0; i < g_vars->scene37_rings[0]->numSubRings; i++) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[0]->subRings[i]);
+
+ if (g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_On)) {
+ g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_PLUS);
+ ani->changeStatics2(ST_RNG_OPEN);
+ } else {
+ g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_MINUS);
+ ani->changeStatics2(ST_RNG_CLOSED2);
+ }
+ }
+
+ g_vars->scene37_plusMinus2 = sc->getStaticANIObject1ById(ANI_PLUSMINUS, 2);
+
+ for (int i = 0; i < g_vars->scene37_rings[1]->numSubRings; i++) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[1]->subRings[i]);
+
+ if (g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_On)) {
+ g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_PLUS);
+ ani->changeStatics2(ST_RNG_OPEN);
+ } else {
+ g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_MINUS);
+ ani->changeStatics2(ST_RNG_CLOSED2);
+ }
+ }
+
+ g_vars->scene37_plusMinus3 = sc->getStaticANIObject1ById(ANI_PLUSMINUS, 3);
+
+ for (int i = 0; i < g_vars->scene37_rings[2]->numSubRings; i++) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[2]->subRings[i]);
+
+ if (g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_On)) {
+ g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_PLUS);
+ ani->changeStatics2(ST_RNG_OPEN);
+ } else {
+ g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_MINUS);
+ ani->changeStatics2(ST_RNG_CLOSED2);
+ }
+ }
+
+ g_fp->_currentScene = oldsc;
+
+ g_fp->initArcadeKeys("SC_37");
+}
+
+int scene37_updateCursor() {
+ g_fp->updateCursorCommon();
+
+ if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC37_MASK) {
+ if (g_vars->scene37_cursorIsLocked)
+ g_fp->_cursorId = PIC_CSR_GOL;
+ }
+
+ return g_fp->_cursorId;
+}
+
+void sceneHandler37_updateRing(int ringNum) {
+ g_vars->scene37_rings[ringNum]->ani->changeStatics2(ST_GRD37_STAND);
+ g_vars->scene37_rings[ringNum]->ani->startAnim(MV_GRD37_PULL, 0, -1);
+ g_vars->scene37_rings[ringNum]->state = !g_vars->scene37_rings[ringNum]->state;
+
+ StaticANIObject *ani;
+
+ for (int i = 0; i < g_vars->scene37_rings[ringNum]->numSubRings; i++) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[ringNum]->subRings[i]);
+
+ if ((ani->_movement && ani->_movement->_id != MV_RNG_CLOSE) || ani->_statics->_staticsId != ST_RNG_CLOSED2) {
+ ani->changeStatics2(ST_RNG_OPEN);
+ ani->startAnim(MV_RNG_CLOSE, 0, -1);
+ } else {
+ ani->changeStatics2(ST_RNG_CLOSED2);
+ ani->startAnim(MV_RNG_OPEN, 0, -1);
+ }
+ }
+
+ g_vars->scene37_cursorIsLocked = true;
+
+ for (uint j = 0; j < g_vars->scene37_rings.size(); j++) {
+ for (int i = 0; i < g_vars->scene37_rings[ringNum]->numSubRings; i++) {
+ ani = g_fp->_currentScene->getStaticANIObject1ById(ANI_RING, g_vars->scene37_rings[j]->subRings[i]);
+
+ if ((ani->_movement && ani->_movement->_id != MV_RNG_CLOSE) || ani->_statics->_staticsId != ST_RNG_CLOSED2)
+ g_vars->scene37_cursorIsLocked = false;
+ }
+ }
+
+ int state;
+
+ if (g_vars->scene37_cursorIsLocked)
+ state = g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsOpened);
+ else
+ state = g_fp->getObjectEnumState(sO_LeftPipe_37, sO_IsClosed);
+
+ g_fp->setObjectState(sO_LeftPipe_37, state);
+}
+
+void sceneHandler37_setRingsState() {
+ if (g_vars->scene37_lastDudeX == -1) {
+ g_vars->scene37_lastDudeX = g_vars->scene37_dudeX;
+ } else {
+ for (uint i = 0; i < g_vars->scene37_rings.size(); i++) {
+ int x = g_vars->scene37_rings[i]->x;
+
+ if (g_vars->scene37_lastDudeX > x && g_vars->scene37_dudeX <= x && !g_vars->scene37_rings[i]->state)
+ sceneHandler37_updateRing(i);
+
+ x = g_vars->scene37_rings[i]->y;
+
+ if (g_vars->scene37_lastDudeX < x && g_vars->scene37_dudeX >= x) {
+ if (g_vars->scene37_rings[i]->state)
+ sceneHandler37_updateRing(i);
+ }
+ }
+
+ g_vars->scene37_lastDudeX = g_vars->scene37_dudeX;
+ }
+}
+
+int sceneHandler37(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch(cmd->_messageNum) {
+ case MSG_SC37_EXITLEFT:
+ sceneHandler37_updateRing(0);
+ sceneHandler37_updateRing(1);
+ sceneHandler37_updateRing(2);
+
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+
+ if (!ani || !canInteractAny(g_fp->_aniMan, ani, cmd->_keyCode)) {
+ int picId = g_fp->_currentScene->getPictureObjectIdAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
+ PictureObject *pic = g_fp->_currentScene->getPictureObjectById(picId, 0);
+
+ if (!pic || !canInteractAny(g_fp->_aniMan, pic, cmd->_keyCode)) {
+ if ((g_fp->_sceneRect.right - cmd->_sceneClickX < 47 && g_fp->_sceneRect.right < g_fp->_sceneWidth - 1)
+ || (cmd->_sceneClickX - g_fp->_sceneRect.left < 47 && g_fp->_sceneRect.left > 0)) {
+ g_fp->processArcade(cmd);
+ break;
+ }
+ }
+ }
+ }
+
+ break;
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ g_vars->scene37_dudeX = x;
+
+ if (x >= 500) {
+ if (x < g_fp->_sceneRect.left + 200)
+ g_fp->_currentScene->_x = x - 300 - g_fp->_sceneRect.left;
+ } else {
+ g_fp->_currentScene->_x = -g_fp->_sceneRect.left;
+ }
+ x = g_vars->scene37_dudeX;
+
+ if (x > g_fp->_sceneRect.right - 200)
+ g_fp->_currentScene->_x = x + 300 - g_fp->_sceneRect.right;
+ }
+
+ sceneHandler37_setRingsState();
+
+ g_fp->_behaviorManager->updateBehaviors();
+ g_fp->startSceneTrack();
+
+ ++g_vars->scene37_soundFlipper;
+
+ break;
+
+ case MSG_SC37_PULL:
+ if (g_vars->scene37_rings[0]->ani->_movement && g_vars->scene37_rings[0]->ani->_movement->_id == MV_GRD37_PULL) {
+ if ((g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_On) && !g_vars->scene37_rings[0]->state)
+ || (g_fp->getObjectState(sO_Guard_1) == g_fp->getObjectEnumState(sO_Guard_1, sO_Off) && g_vars->scene37_rings[0]->state)) {
+ g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_PLUS);
+ } else {
+ g_vars->scene37_plusMinus1->_statics = g_vars->scene37_plusMinus1->getStaticsById(ST_PMS_MINUS);
+ }
+ } else if (g_vars->scene37_rings[1]->ani->_movement && g_vars->scene37_rings[1]->ani->_movement->_id == MV_GRD37_PULL) {
+ if ((g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_On) && !g_vars->scene37_rings[1]->state)
+ || (g_fp->getObjectState(sO_Guard_2) == g_fp->getObjectEnumState(sO_Guard_2, sO_Off) && g_vars->scene37_rings[1]->state)) {
+ g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_PLUS);
+ } else {
+ g_vars->scene37_plusMinus2->_statics = g_vars->scene37_plusMinus2->getStaticsById(ST_PMS_MINUS);
+ }
+ } else if (g_vars->scene37_rings[2]->ani->_movement && g_vars->scene37_rings[2]->ani->_movement->_id == MV_GRD37_PULL) {
+ if ((g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_On) && !g_vars->scene37_rings[2]->state)
+ || (g_fp->getObjectState(sO_Guard_3) == g_fp->getObjectEnumState(sO_Guard_3, sO_Off) && g_vars->scene37_rings[2]->state)) {
+ g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_PLUS);
+ } else {
+ g_vars->scene37_plusMinus3->_statics = g_vars->scene37_plusMinus3->getStaticsById(ST_PMS_MINUS);
+ }
+ }
+
+ if (g_vars->scene37_soundFlipper) {
+ g_fp->playSound(SND_37_007, 0);
+
+ g_vars->scene37_soundFlipper = 0;
+ }
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/scene38.cpp b/engines/fullpipe/scenes/scene38.cpp
new file mode 100644
index 0000000000..22ae370391
--- /dev/null
+++ b/engines/fullpipe/scenes/scene38.cpp
@@ -0,0 +1,417 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 "fullpipe/fullpipe.h"
+
+#include "fullpipe/objectnames.h"
+#include "fullpipe/constants.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
+#include "fullpipe/scenes.h"
+#include "fullpipe/statics.h"
+
+#include "fullpipe/interaction.h"
+#include "fullpipe/behavior.h"
+
+
+namespace Fullpipe {
+
+void scene38_setBottleState(Scene *sc) {
+ ExCommand *ex = sc->getMessageQueueById(QU_SC38_SHOWBOTTLE_ONTABLE)->getExCommandByIndex(0);
+
+ if (g_vars->scene38_bottle->_ox == ex->_x && g_vars->scene38_bottle->_oy == ex->_y) {
+ if (g_fp->lift_checkButton(sO_Level5) ) {
+ ex = sc->getMessageQueueById(QU_SC38_SHOWBOTTLE)->getExCommandByIndex(0);
+
+ g_vars->scene38_bottle->setOXY(ex->_x, ex->_y);
+ g_vars->scene38_bottle->_priority = ex->_field_14;
+
+ g_fp->setObjectState(sO_Bottle_38, g_fp->getObjectEnumState(sO_Bottle_38, sO_Blocked));
+ }
+ }
+}
+
+void scene38_initScene(Scene *sc) {
+ g_vars->scene38_var01 = 200;
+ g_vars->scene38_var02 = 200;
+ g_vars->scene38_var03 = 300;
+ g_vars->scene38_var04 = 300;
+ g_vars->scene38_boss = sc->getStaticANIObject1ById(ANI_GLAVAR, -1);
+ g_vars->scene38_tally = sc->getStaticANIObject1ById(ANI_DYLDA, -1);
+ g_vars->scene38_shorty = sc->getStaticANIObject1ById(ANI_MALYSH, -1);
+ g_vars->scene38_domino0 = sc->getStaticANIObject1ById(ANI_DOMINO38, 0);
+ g_vars->scene38_dominos = sc->getStaticANIObject1ById(ANI_DOMINOS, 0);
+ g_vars->scene38_domino1 = sc->getStaticANIObject1ById(ANI_DOMINO38, 1);
+ g_vars->scene38_bottle = sc->getStaticANIObject1ById(ANI_BOTTLE38, 0);
+ g_vars->scene38_var05 = 0;
+ g_vars->scene38_var06 = 0;
+ g_vars->scene38_var07 = 0;
+ g_vars->scene38_var08 = 15;
+ g_vars->scene38_var09 = 0;
+ g_vars->scene38_var10 = 0;
+ g_vars->scene38_var11 = 30;
+ g_vars->scene38_var12 = 0;
+ g_vars->scene38_var13 = 0;
+
+ scene38_setBottleState(sc);
+
+ if (g_fp->getObjectState(sO_Boss) == g_fp->getObjectEnumState(sO_Boss, sO_IsSleeping)) {
+ g_vars->scene38_shorty->_flags &= 0xFFFB;
+
+ g_vars->scene38_tally->stopAnim_maybe();
+ g_vars->scene38_tally->_flags &= 0xFFFB;
+
+ g_vars->scene38_domino0->_flags &= 0xFFFB;
+ g_vars->scene38_dominos->_flags &= 0xFFFB;
+ g_vars->scene38_domino1->_flags &= 0xFFFB;
+ }
+
+ g_fp->lift_sub5(sc, QU_SC38_ENTERLIFT, QU_SC38_EXITLIFT);
+ g_fp->lift_sub7(sc, ST_LBN_0N);
+}
+
+void sceneHandler38_tryTakeBottle() {
+ g_vars->scene38_boss->changeStatics2(ST_GLV_NOHAMMER);
+ g_vars->scene38_boss->startAnim(MV_GLV_LOOKMAN, 0, -1);
+
+ g_vars->scene38_var05 = 0;
+}
+
+void sceneHandler38_postHammerKick() {
+ g_vars->scene38_domino1->setOXY(g_vars->scene38_domino1->_ox, g_vars->scene38_domino1->_oy + 2);
+}
+
+void sceneHandler38_propose() {
+ if (!g_vars->scene38_tally->_movement) {
+ if (g_vars->scene38_tally->_flags & 4) {
+ if (!(g_vars->scene38_tally->_flags & 2) && g_vars->scene38_var08 > 0
+ && g_fp->_rnd->getRandomNumber(32767) < 32767) {
+ chainQueue(QU_DLD_DENY, 0);
+ g_vars->scene38_var08 = 0;
+ }
+ }
+ }
+}
+
+void sceneHandler38_point() {
+ if ((!g_vars->scene38_boss->_movement && ((g_vars->scene38_boss->_flags & 4) || !(g_vars->scene38_boss->_flags & 2)))
+ && g_vars->scene38_var05 > 0
+ && g_fp->_rnd->getRandomNumber(32767) < 32767) {
+ if (g_vars->scene38_boss->_statics->_staticsId == ST_GLV_HAMMER) {
+ chainQueue(QU_GLV_TOSMALL, 0);
+ g_vars->scene38_var05 = 0;
+ } else {
+ if (g_vars->scene38_boss->_statics->_staticsId == ST_GLV_NOHAMMER)
+ chainQueue(QU_GLV_TOSMALL_NOHMR, 0);
+
+ g_vars->scene38_var05 = 0;
+ }
+ }
+}
+
+void sceneHandler38_hammerKick() {
+ if (!g_vars->scene38_shorty->_movement) {
+ if (g_vars->scene38_shorty->_flags & 4) {
+ if (!(g_vars->scene38_shorty->_flags & 2) && g_vars->scene38_var11 > 1
+ && g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2
+ && g_fp->_rnd->getRandomNumber(32767) < 3276) {
+ chainQueue(QU_MLS_TURNR, 0);
+ g_vars->scene38_var11 = 0;
+ }
+ }
+ }
+
+ g_vars->scene38_domino1->setOXY(g_vars->scene38_domino1->_ox, g_vars->scene38_domino1->_oy - 2);
+
+ if (g_vars->scene38_dominos->_statics->_staticsId == ST_DMS_3)
+ g_vars->scene38_dominos->startAnim(MV_DMS_THREE, 0, -1);
+ else if (g_vars->scene38_dominos->_statics->_staticsId == ST_DMS_4)
+ g_vars->scene38_dominos->startAnim(MV_DMS_FOUR, 0, -1);
+}
+
+void sceneHandler38_drink() {
+ if (!g_vars->scene38_shorty->_movement) {
+ if (g_vars->scene38_shorty->_flags & 4) {
+ if (!(g_vars->scene38_shorty->_flags & 2) && g_vars->scene38_var11 > 0
+ && g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2
+ && g_fp->_rnd->getRandomNumber(32767) < 3276) {
+ chainQueue(QU_MLS_TURNR, 0);
+ g_vars->scene38_var11 = 0;
+ }
+ }
+ }
+}
+
+void sceneHandler38_animateAlcoholics() {
+ warning("STUB: sceneHandler38_animateAlcoholics()");
+
+#if 0
+ MessageQueue *mq;
+
+ if (g_vars->scene38_boss->_movement || !(g_vars->scene38_boss->_flags & 4) || (g_vars->scene38_boss->_flags & 2)) {
+ g_vars->scene38_var05 = 0;
+ } else {
+ g_vars->scene38_var05++;
+ }
+
+ if (g_vars->scene38_var05 >= 50) {
+ int bossSt = g_vars->scene38_boss->_statics->_staticsId;
+
+ if (bossSt == ST_GLV_SLEEP2) {
+ g_vars->scene38_var05 = 0;
+ } else if ((g_vars->scene38_domino0->_flags & 4) && g_vars->scene38_domino0->_statics->_staticsId == ST_DMN38_6) {
+ if (bossSt == ST_GLV_HAMMER) {
+ chainQueue(QU_GLV_TAKEDOMINO, 1);
+ g_vars->scene38_var05 = 0;
+ }
+
+ if (bossSt == ST_GLV_NOHAMMER) {
+ chainQueue(QU_GLV_TAKEDOMINO_NOHMR, 1);
+ g_vars->scene38_var05 = 0;
+ }
+ } else {
+ if ((g_vars->scene38_bottle->_flags & 4) && g_vars->scene38_bottle->_statics->_staticsId == ST_BTL38_FULL && bossSt == ST_GLV_NOHAMMER) {
+ chainQueue(QU_GLV_DRINKBOTTLE, 1);
+ g_vars->scene38_var05 = 0;
+ } else {
+ int bossAnim = 0;
+
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310 || g_vars->scene38_boss->_statics->_staticsId != ST_GLV_HAMMER) {
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
+ if (g_fp->_rnd->getRandomNumber(32767) < 1310) {
+ if (bossSt == ST_GLV_HAMMER)
+ bossAnim = QU_GLV_DRINK;
+ else if (bossSt == ST_GLV_NOHAMMER)
+ bossAnim = QU_GLV_DRINK_NOHMR;
+ }
+ } else {
+ if (bossSt == ST_GLV_HAMMER)
+ bossAnim = QU_GLV_PROPOSE;
+ else if (bossSt == ST_GLV_NOHAMMER)
+ bossAnim = QU_GLV_PROPOSE_NOHMR;
+ }
+ } else {
+ bossAnim = QU_GLV_HMRKICK;
+ }
+
+ if (g_vars->scene38_var06 == bossAnim) {
+ g_vars->scene38_var07++;
+
+ if (g_vars->scene38_var07 > 2)
+ bossAnim = 0;
+ } else {
+ g_vars->scene38_var06 = bossAnim;
+ g_vars->scene38_var07 = 1;
+ }
+
+ if (bossAnim > 0) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(bossAnim), 0, 0);
+
+ mq->chain(0);
+
+ g_vars->scene38_var05 = 0;
+ }
+ }
+ }
+ }
+
+ if (g_vars->scene38_tally->_movement || !(g_vars->scene38_tally->_flags & 4) || (g_vars->scene38_tally->_flags & 2)) {
+ g_vars->scene38_var08 = 0;
+ } else {
+ g_vars->scene38_var08++;
+ }
+
+ if (g_vars->scene38_var08 >= 50) {
+ int tallyAnim = 0;
+
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
+ if (g_fp->_rnd->getRandomNumber(32767) < 1310)
+ tallyAnim = QU_DLD_ICK;
+ } else {
+ tallyAnim = QU_DLD_GLOT;
+ }
+ } else {
+ tallyAnim = QU_DLD_BLINK;
+ }
+ } else {
+ if (g_vars->scene38_domino1->_statics->_staticsId == ST_DMN38_NORM3) {
+ tallyAnim = QU_DLD_TAKE1;
+ } else if (g_vars->scene38_domino1->_statics->_staticsId == ST_DMN38_NORM4) {
+ tallyAnim = QU_DLD_TAKE2;
+ }
+ }
+
+ if (g_vars->scene38_var09 == tallyAnim) {
+ g_vars->scene38_var10++;
+
+ if (g_vars->scene38_var10++ > 2)
+ tallyAnim = 0;
+ } else {
+ g_vars->scene38_var09 = tallyAnim;
+ g_vars->scene38_var10 = 1;
+ }
+ if (tallyAnim > 0) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(tallyAnim), 0, 0);
+
+ mq->chain(0);
+ g_vars->scene38_var08 = 0;
+ }
+ }
+
+ if (g_vars->scene38_shorty->_movement || !(g_vars->scene38_shorty->_flags & 4) || (g_vars->scene38_shorty->_flags & 2)) {
+ g_vars->scene38_var11 = 0;
+ return;
+ }
+
+ g_vars->scene38_var11++;
+
+ if (g_vars->scene38_var11 < 50)
+ return;
+
+ int shortyAnim = 0;
+
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310) {
+ if (g_fp->_rnd->getRandomNumber(32767) >= 1310 || g_vars->scene38_shorty->_statics->_staticsId != ST_MLS_LEFT2) {
+ if (g_vars->scene38_boss->_statics->_staticsId != ST_GLV_SLEEP2 && g_vars->scene38_var05 > 30 && g_fp->_rnd->getRandomNumber(32767) < 0x3FFF && g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2)
+ shortyAnim = QU_MLS_HAND;
+ } else {
+ shortyAnim = QU_MLS_BLINK;
+ }
+ } else {
+ if (g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_RIGHT2) {
+ shortyAnim = QU_MLS_TURNL;
+ } else if (g_vars->scene38_shorty->_statics->_staticsId == ST_MLS_LEFT2) {
+ shortyAnim = QU_MLS_TURNR;
+ }
+ }
+
+ if (g_vars->scene38_var12 == shortyAnim) {
+ g_vars->scene38_var13++;
+ if (g_vars->scene38_var13 > 2)
+ return;
+ } else {
+ g_vars->scene38_var12 = shortyAnim;
+ g_vars->scene38_var13 = 1;
+ }
+
+ if (shortyAnim > 0) {
+ mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(shortyAnim), 0, 0);
+
+ mq->chain(0);
+
+ g_vars->scene38_var11 = 0;
+ }
+#endif
+}
+
+int sceneHandler38(ExCommand *cmd) {
+ if (cmd->_messageKind != 17)
+ return 0;
+
+ switch (cmd->_messageNum) {
+ case MSG_LIFT_EXITLIFT:
+ g_fp->lift_exitSeq(cmd);
+ break;
+
+ case MSG_LIFT_CLOSEDOOR:
+ g_fp->lift_closedoorSeq();
+ break;
+
+ case MSG_LIFT_STARTEXITQUEUE:
+ g_fp->lift_startExitQueue();
+ break;
+
+ case MSG_SC38_TRYTAKEBOTTLE:
+ sceneHandler38_tryTakeBottle();
+ break;
+
+ case MSG_SC38_POSTHMRKICK:
+ sceneHandler38_postHammerKick();
+ break;
+
+ case MSG_SC38_PROPOSE:
+ sceneHandler38_propose();
+ break;
+
+ case MSG_LIFT_CLICKBUTTON:
+ g_fp->lift_animation3();
+ break;
+
+ case MSG_SC38_POINT:
+ sceneHandler38_point();
+ break;
+
+ case MSG_LIFT_GO:
+ g_fp->lift_goAnimation();
+ break;
+
+ case MSG_SC38_HMRKICK:
+ sceneHandler38_hammerKick();
+ break;
+
+ case MSG_SC38_DRINK:
+ sceneHandler38_drink();
+ break;
+
+ case 64:
+ g_fp->lift_sub05(cmd);
+ break;
+
+ case 29:
+ {
+ StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
+
+ if (ani && ani->_id == ANI_LIFTBUTTON) {
+ g_fp->lift_sub1(ani);
+
+ cmd->_messageKind = 0;
+ }
+ break;
+ }
+
+ case 33:
+ if (g_fp->_aniMan2) {
+ int x = g_fp->_aniMan2->_ox;
+
+ if (x < g_fp->_sceneRect.left + g_vars->scene38_var01)
+ g_fp->_currentScene->_x = x - g_vars->scene38_var03 - g_fp->_sceneRect.left;
+
+ if (x > g_fp->_sceneRect.right - g_vars->scene38_var01)
+ g_fp->_currentScene->_x = x + g_vars->scene38_var03 - g_fp->_sceneRect.right;
+ }
+
+ sceneHandler38_animateAlcoholics();
+
+ g_fp->_behaviorManager->updateBehaviors();
+
+ g_fp->startSceneTrack();
+
+ break;
+ }
+
+ return 0;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/scenes/sceneDbg.cpp b/engines/fullpipe/scenes/sceneDbg.cpp
index 83f3b64ee5..4a3751940f 100644
--- a/engines/fullpipe/scenes/sceneDbg.cpp
+++ b/engines/fullpipe/scenes/sceneDbg.cpp
@@ -25,6 +25,7 @@
#include "fullpipe/constants.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/statics.h"
#include "fullpipe/input.h"
@@ -40,9 +41,9 @@ void sceneDbgMenu_initScene(Scene *sc) {
}
GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) {
- if (g_fullpipe->_currentScene)
- for (uint i = 0; i < g_fullpipe->_currentScene->_picObjList.size(); i++) {
- PictureObject *pic = (PictureObject *)g_fullpipe->_currentScene->_picObjList[i];
+ if (g_fp->_currentScene)
+ for (uint i = 0; i < g_fp->_currentScene->_picObjList.size(); i++) {
+ PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i];
if (x >= pic->_ox && y >= pic->_oy) {
Common::Point point;
@@ -61,8 +62,8 @@ int sceneHandlerDbgMenu(ExCommand *ex) {
if (ex->_messageKind != 17)
return 0;
- int mx = g_fullpipe->_mouseScreenPos.x + g_fullpipe->_sceneRect.left;
- int my = g_fullpipe->_mouseScreenPos.y + g_fullpipe->_sceneRect.top;
+ int mx = g_fp->_mouseScreenPos.x + g_fp->_sceneRect.left;
+ int my = g_fp->_mouseScreenPos.y + g_fp->_sceneRect.top;
if (ex->_messageNum == 29) {
GameObject *obj = sceneHandlerDbgMenu_getObjectAtXY(mx, my);
@@ -74,18 +75,18 @@ int sceneHandlerDbgMenu(ExCommand *ex) {
}
if (ex->_messageNum != 33) {
if (ex->_messageNum == MSG_RESTARTGAME) {
- g_fullpipe->_needRestart = true;
+ g_fp->_needRestart = true;
return 0;
}
return 0;
}
- g_fullpipe->_cursorId = PIC_CSR_DEFAULT;
- GameObject *obj = g_fullpipe->_currentScene->getStaticANIObjectAtPos(mx, my);
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
+ GameObject *obj = g_fp->_currentScene->getStaticANIObjectAtPos(mx, my);
if (obj) {
if (canInteractAny(0, obj, -3)) {
- g_fullpipe->_cursorId = PIC_CSR_DEFAULT;
- g_fullpipe->setCursor(PIC_CSR_DEFAULT);
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
+ g_fp->setCursor(PIC_CSR_DEFAULT);
return 0;
}
} else {
@@ -93,13 +94,13 @@ int sceneHandlerDbgMenu(ExCommand *ex) {
if (obj && canInteractAny(0, obj, -3) ) {
g_vars->selector->_flags |= 4;
g_vars->selector->setOXY(obj->_ox, obj->_oy);
- g_fullpipe->_cursorId = PIC_CSR_DEFAULT;
- g_fullpipe->setCursor(PIC_CSR_DEFAULT);
+ g_fp->_cursorId = PIC_CSR_DEFAULT;
+ g_fp->setCursor(PIC_CSR_DEFAULT);
return 0;
}
g_vars->selector->_flags &= 0xFFFB;
}
- g_fullpipe->setCursor(g_fullpipe->_cursorId);
+ g_fp->setCursor(g_fp->_cursorId);
return 0;
}
diff --git a/engines/fullpipe/scenes/sceneIntro.cpp b/engines/fullpipe/scenes/sceneIntro.cpp
index d60f90faf7..c9f19f3724 100644
--- a/engines/fullpipe/scenes/sceneIntro.cpp
+++ b/engines/fullpipe/scenes/sceneIntro.cpp
@@ -24,6 +24,7 @@
#include "fullpipe/constants.h"
#include "fullpipe/gameloader.h"
+#include "fullpipe/motion.h"
#include "fullpipe/scenes.h"
#include "fullpipe/modal.h"
#include "fullpipe/statics.h"
@@ -31,13 +32,13 @@
namespace Fullpipe {
int sceneIntro_updateCursor() {
- g_fullpipe->_cursorId = 0;
+ g_fp->_cursorId = 0;
return 0;
}
void sceneIntro_initScene(Scene *sc) {
- g_fullpipe->_gameLoader->loadScene(SC_INTRO2);
+ g_fp->_gameLoader->loadScene(SC_INTRO2);
g_vars->sceneIntro_aniin1man = sc->getStaticANIObject1ById(ANI_IN1MAN, -1);
g_vars->sceneIntro_needSleep = true;
@@ -45,19 +46,19 @@ void sceneIntro_initScene(Scene *sc) {
g_vars->sceneIntro_playing = true;
g_vars->sceneIntro_needBlackout = false;
- if (g_fullpipe->_recordEvents || g_fullpipe->_inputArFlag)
+ if (g_fp->_recordEvents || g_fp->_inputArFlag)
g_vars->sceneIntro_skipIntro = false;
- g_fullpipe->_modalObject = new ModalIntro;
+ g_fp->_modalObject = new ModalIntro;
}
void sceneHandlerIntro_part1() {
- g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO1);
+ g_fp->_currentScene = g_fp->accessScene(SC_INTRO1);
chainQueue(QU_INTR_FINISH, 0);
}
void sceneHandlerIntro_part2() {
- g_fullpipe->_currentScene = g_fullpipe->accessScene(SC_INTRO2);
+ g_fp->_currentScene = g_fp->accessScene(SC_INTRO2);
chainQueue(QU_IN2_DO, 0);
}
@@ -101,7 +102,7 @@ int sceneHandlerIntro(ExCommand *ex) {
chainQueue(QU_INTR_GETUPMAN, 0);
}
- g_fullpipe->startSceneTrack();
+ g_fp->startSceneTrack();
return 0;
}
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 6da848a621..cf66cb40a1 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -23,8 +23,13 @@
#include "fullpipe/fullpipe.h"
#include "fullpipe/objects.h"
+#include "fullpipe/scene.h"
#include "fullpipe/sound.h"
#include "fullpipe/ngiarchive.h"
+#include "common/memstream.h"
+#include "audio/audiostream.h"
+#include "audio/decoders/vorbis.h"
+#include "audio/decoders/wave.h"
namespace Fullpipe {
@@ -77,6 +82,9 @@ Sound::Sound() {
_description = 0;
}
+Sound::~Sound() {
+ warning("STUB: Sound::~Sound()");
+}
bool Sound::load(MfcArchive &file, NGIArchive *archive) {
debug(5, "Sound::load()");
@@ -86,7 +94,7 @@ bool Sound::load(MfcArchive &file, NGIArchive *archive) {
_id = file.readUint32LE();
_description = file.readPascalString();
- assert(g_fullpipe->_gameProjectVersion >= 6);
+ assert(g_fp->_gameProjectVersion >= 6);
_objectId = file.readUint16LE();
@@ -113,14 +121,36 @@ void Sound::setPanAndVolumeByStaticAni() {
void FullpipeEngine::setSceneMusicParameters(GameVar *var) {
warning("STUB: FullpipeEngine::setSceneMusicParameters()");
+ // TODO: Finish this (MINDELAY, MAXDELAY, LOCAL, SEQUENCE, STARTDELAY etc)
+ stopAllSoundStreams();
+ _musicGameVar = var;
}
void FullpipeEngine::startSceneTrack() {
- debug(3, "STUB: FullpipeEngine::startSceneTrack()");
+ // TODO: Finish this
+#ifdef USE_VORBIS
+ if (g_fp->_mixer->isSoundHandleActive(_sceneTrackHandle))
+ return;
+
+ GameVar *musicTrackVar = _musicGameVar->getSubVarByName("MUSIC")->getSubVarByName("TRACKS")->_subVars;
+ if (!musicTrackVar)
+ return;
+
+ char *trackName = musicTrackVar->_varName;
+ Common::File *track = new Common::File();
+ if (!track->open(trackName)) {
+ warning("Could not open %s", trackName);
+ delete track;
+ return;
+ }
+ Audio::RewindableAudioStream *ogg = Audio::makeVorbisStream(track, DisposeAfterUse::YES);
+ g_fp->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_sceneTrackHandle, ogg);
+#endif
}
void FullpipeEngine::stopAllSounds() {
- warning("STUB: FullpipeEngine::stopAllSounds()");
+ // TODO: Differences from stopAllSoundStreams()
+ g_fp->_mixer->stopAll();
}
void FullpipeEngine::toggleMute() {
@@ -128,13 +158,45 @@ void FullpipeEngine::toggleMute() {
}
void FullpipeEngine::playSound(int id, int flag) {
- warning("STUB: FullpipeEngine::playSounds(%d, %d)", id, flag);
+ SoundList *soundList = g_fp->_currentScene->_soundList;
+ Sound *sound = soundList->getSoundById(id);
+ if (!sound) {
+ warning("playSound: Can't find sound with ID %d", id);
+ return;
+ }
+ byte *soundData = sound->loadData();
+ Common::MemoryReadStream *dataStream = new Common::MemoryReadStream(soundData, sound->getDataSize());
+ Audio::RewindableAudioStream *wav = Audio::makeWAVStream(dataStream, DisposeAfterUse::YES);
+ Audio::AudioStream *audioStream = new Audio::LoopingAudioStream(wav, (flag == 1) ? 0 : 1);
+ Audio::SoundHandle handle = sound->getHandle();
+ g_fp->_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, audioStream);
+}
+
+void FullpipeEngine::playTrack(GameVar *sceneVar, const char *name, bool delayed) {
+ warning("STUB: FullpipeEngine::playTrack(var, %s, %d)", name, delayed);
}
void global_messageHandler_handleSound(ExCommand *cmd) {
debug(0, "STUB: global_messageHandler_handleSound()");
}
+void FullpipeEngine::stopSoundStream2() {
+ warning("STUB: FullpipeEngine::stopSoundStream2()");
+}
+
+void FullpipeEngine::stopAllSoundStreams() {
+ // TODO: Differences from stopAllSounds()
+ g_fp->_mixer->stopAll();
+}
+void FullpipeEngine::stopAllSoundInstances(int id) {
+ SoundList *soundList = g_fp->_currentScene->_soundList;
+ for (int i = 0; i < soundList->getCount(); i++) {
+ Sound *sound = soundList->getSoundByIndex(i);
+ if (sound->getId() == id) {
+ g_fp->_mixer->stopHandle(sound->getHandle());
+ }
+ }
+}
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/sound.h b/engines/fullpipe/sound.h
index e2b271fe2c..ca64832c04 100644
--- a/engines/fullpipe/sound.h
+++ b/engines/fullpipe/sound.h
@@ -32,12 +32,17 @@ class Sound : public MemoryObject {
int _directSoundBuffer;
int _directSoundBuffers[7];
byte *_soundData;
+ Audio::SoundHandle _handle;
- public:
+public:
Sound();
+ virtual ~Sound();
+
virtual bool load(MfcArchive &file, NGIArchive *archive);
virtual bool load(MfcArchive &file) { assert(0); return false; } // Disable base class
void updateVolume();
+ int getId() const { return _id; }
+ Audio::SoundHandle getHandle() const { return _handle; }
void setPanAndVolumeByStaticAni();
};
@@ -55,6 +60,13 @@ class SoundList : public CObject {
int getCount() { return _soundItemsCount; }
Sound *getSoundByIndex(int idx) { return _soundItems[idx]; }
+ Sound *getSoundById(int id) {
+ for (int i = 0; i < _soundItemsCount; i++) {
+ if (_soundItems[i]->getId() == id)
+ return _soundItems[i];
+ }
+ return NULL;
+ }
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 747015e9a1..ccf77ff81a 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -31,6 +31,7 @@
#include "fullpipe/scene.h"
#include "fullpipe/statics.h"
#include "fullpipe/interaction.h"
+#include "fullpipe/gameloader.h"
#include "fullpipe/constants.h"
@@ -82,8 +83,11 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) {
setMusicAllowed(_gameLoader->_gameVar->getSubVarAsInt("MUSIC_ALLOWED"));
if (scene) {
- _gameLoader->loadScene(scene);
- _gameLoader->gotoScene(scene, TrubaLeft);
+ _gameLoader->loadScene(726);
+ _gameLoader->gotoScene(726, TrubaLeft);
+
+ if (scene != 726)
+ _gameLoader->preloadScene(726, getSceneEntrance(scene));
} else {
if (_flgPlayIntro) {
_gameLoader->loadScene(SC_INTRO1);
@@ -115,25 +119,25 @@ bool GameProject::load(MfcArchive &file) {
_headerFilename = 0;
_field_10 = 12;
- g_fullpipe->_gameProjectVersion = file.readUint32LE();
- g_fullpipe->_pictureScale = file.readUint16LE();
- g_fullpipe->_scrollSpeed = file.readUint32LE();
+ g_fp->_gameProjectVersion = file.readUint32LE();
+ g_fp->_pictureScale = file.readUint16LE();
+ g_fp->_scrollSpeed = file.readUint32LE();
_headerFilename = file.readPascalString();
- debug(1, "_gameProjectVersion = %d", g_fullpipe->_gameProjectVersion);
- debug(1, "_pictureScale = %d", g_fullpipe->_pictureScale);
- debug(1, "_scrollSpeed = %d", g_fullpipe->_scrollSpeed);
+ debug(1, "_gameProjectVersion = %d", g_fp->_gameProjectVersion);
+ debug(1, "_pictureScale = %d", g_fp->_pictureScale);
+ debug(1, "_scrollSpeed = %d", g_fp->_scrollSpeed);
debug(1, "_headerFilename = %s", _headerFilename);
_sceneTagList = new SceneTagList();
_sceneTagList->load(file);
- if (g_fullpipe->_gameProjectVersion >= 3)
+ if (g_fp->_gameProjectVersion >= 3)
_field_4 = file.readUint32LE();
- if (g_fullpipe->_gameProjectVersion >= 5) {
+ if (g_fp->_gameProjectVersion >= 5) {
file.readUint32LE();
file.readUint32LE();
}
@@ -143,6 +147,8 @@ bool GameProject::load(MfcArchive &file) {
GameProject::~GameProject() {
free(_headerFilename);
+
+ delete _sceneTagList;
}
GameVar::GameVar() {
@@ -156,6 +162,10 @@ GameVar::GameVar() {
_varName = 0;
}
+GameVar::~GameVar() {
+ warning("STUB: GameVar::~GameVar()");
+}
+
bool GameVar::load(MfcArchive &file) {
_varName = file.readPascalString();
_varType = file.readUint32LE();
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index c86d5abd08..10d9b4dfdf 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -27,6 +27,7 @@
#include "fullpipe/statics.h"
#include "fullpipe/messages.h"
#include "fullpipe/interaction.h"
+#include "fullpipe/motion.h"
#include "fullpipe/constants.h"
#include "fullpipe/objectnames.h"
@@ -126,6 +127,10 @@ StaticANIObject::StaticANIObject() {
_objtype = kObjTypeStaticANIObject;
}
+StaticANIObject::~StaticANIObject() {
+ warning("STUB: StaticANIObject::~StaticANIObject()");
+}
+
StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
_shadowsOn = src->_shadowsOn;
_field_30 = src->_field_30;
@@ -152,15 +157,19 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
_statics = 0;
for (uint i = 0; i < src->_movements.size(); i++) {
- Movement *mov;
- if (((Movement *)src->_movements[i])->_currMovement) {
- mov = new Movement(getMovementById(src->getMovementIdById(((Movement *)src->_movements[i])->_id)), this);
- mov->_id = ((Movement *)src->_movements[i])->_id;
+ Movement *newmov;
+ Movement *mov = (Movement *)src->_movements[i];
+
+ if (mov->_currMovement) {
+ // WORKAROUND: Original uses weird construction here:
+ // new Movement(getMovementById(src->getMovementIdById(mov->_id)), this);
+ newmov = new Movement(src->getMovementById(src->getMovementIdById(mov->_id)), this);
+ newmov->_id = mov->_id;
} else {
- mov = new Movement(((Movement *)src->_movements[i]), 0, -1, this);
+ newmov = new Movement(mov, 0, -1, this);
}
- _movements.push_back(mov);
+ _movements.push_back(newmov);
}
}
@@ -186,7 +195,7 @@ bool StaticANIObject::load(MfcArchive &file) {
char *movname = genFileName(_id, movNum, "mov");
- Common::SeekableReadStream *f = g_fullpipe->_currArchive->createReadStreamForMember(movname);
+ Common::SeekableReadStream *f = g_fp->_currArchive->createReadStreamForMember(movname);
Movement *mov = new Movement();
@@ -244,11 +253,11 @@ void StaticANIObject::setFlags40(bool state) {
void StaticANIObject::deleteFromGlobalMessageQueue() {
while (_messageQueueId) {
- if (g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId)) {
+ if (g_fp->_globalMessageQueueList->getMessageQueueById(_messageQueueId)) {
if (!isIdle())
return;
- g_fullpipe->_globalMessageQueueList->deleteQueueById(_messageQueueId);
+ g_fp->_globalMessageQueueList->deleteQueueById(_messageQueueId);
} else {
_messageQueueId = 0;
}
@@ -276,11 +285,34 @@ void StaticANIObject::queueMessageQueue(MessageQueue *mq) {
}
}
+void StaticANIObject::restartMessageQueue(MessageQueue *mq) {
+ ExCommand *ex = mq->getExCommandByIndex(0);
+ if (ex) {
+ while (ex->_messageKind != 1 || ex->_parentId != _id) {
+ ex->_parId = 0;
+ ex->_excFlags |= 2;
+ ex->handleMessage();
+
+ mq->deleteExCommandByIndex(0, 0);
+
+ ex = mq->getExCommandByIndex(0);
+
+ if (!ex)
+ return;
+ }
+
+ if (ex) {
+ startAnim(ex->_messageNum, mq->_id, -1);
+ mq->deleteExCommandByIndex(0, 1);
+ }
+ }
+}
+
MessageQueue *StaticANIObject::getMessageQueue() {
if (this->_messageQueueId <= 0)
return 0;
- return g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
+ return g_fp->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
}
bool StaticANIObject::trySetMessageQueue(int msgNum, int qId) {
@@ -297,9 +329,13 @@ bool StaticANIObject::trySetMessageQueue(int msgNum, int qId) {
return true;
}
+void StaticANIObject::startMQIfIdle(int qId, int flag) {
+ warning("STUB: StaticANIObject::startMQIfIdle()");
+}
+
bool StaticANIObject::isIdle() {
if (_messageQueueId) {
- MessageQueue *m = g_fullpipe->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
+ MessageQueue *m = g_fp->_globalMessageQueueList->getMessageQueueById(_messageQueueId);
if (m && m->getFlags() & 1)
return false;
@@ -424,7 +460,7 @@ void Movement::draw(bool flipFlag, int angle) {
int y = _oy - point.y;
if (_currDynamicPhase->getPaletteData())
- g_fullpipe->_globalPalette = _currDynamicPhase->getPaletteData();
+ g_fp->_globalPalette = _currDynamicPhase->getPaletteData();
if (_currDynamicPhase->getAlpha() < 0xFF) {
warning("Movement::draw: alpha < 0xff: %d", _currDynamicPhase->getAlpha());
@@ -492,9 +528,9 @@ void StaticANIObject::draw() {
Common::Point point;
Common::Rect rect;
- debug(0, "StaticANIObject::draw() (%s) [%d] [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
+ debug(6, "StaticANIObject::draw() (%s) [%d] [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
- if (_shadowsOn && g_fullpipe->_currentScene && g_fullpipe->_currentScene->_shadows
+ if (_shadowsOn && g_fp->_currentScene && g_fp->_currentScene->_shadows
&& (getCurrDimensions(point)->x != 1 || getCurrDimensions(point)->y != 1)) {
DynamicPhase *dyn;
@@ -512,7 +548,7 @@ void StaticANIObject::draw() {
if (dyn->getDynFlags() & 4) {
rect = *dyn->_rect;
- DynamicPhase *shd = g_fullpipe->_currentScene->_shadows->findSize(rect.width(), rect.height());
+ DynamicPhase *shd = g_fp->_currentScene->_shadows->findSize(rect.width(), rect.height());
if (shd) {
shd->getDimensions(&point);
int midx = _ox - point.x / 2 - dyn->_someX;
@@ -552,7 +588,7 @@ void StaticANIObject::draw() {
}
void StaticANIObject::draw2() {
- debug(0, "StatciANIObject::draw2(): id: (%s) %d [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
+ debug(6, "StatciANIObject::draw2(): id: (%s) %d [%d, %d]", transCyrillic((byte *)_objectName), _id, _ox, _oy);
if ((_flags & 4) && (_flags & 0x10)) {
if (_movement) {
@@ -568,7 +604,7 @@ void StaticANIObject::draw2() {
}
MovTable *StaticANIObject::countMovements() {
- GameVar *preloadSubVar = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("PRELOAD");
+ GameVar *preloadSubVar = g_fp->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("PRELOAD");
if (!preloadSubVar || preloadSubVar->getSubVarsCount() == 0)
return 0;
@@ -594,7 +630,7 @@ MovTable *StaticANIObject::countMovements() {
}
void StaticANIObject::setSpeed(int speed) {
- GameVar *var = g_fullpipe->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("SpeedUp");
+ GameVar *var = g_fp->getGameLoaderGameVar()->getSubVarByName(getName())->getSubVarByName("SpeedUp");
if (!var)
return;
@@ -627,6 +663,19 @@ void StaticANIObject::initMovements() {
((Movement *)_movements[i])->removeFirstPhase();
}
+void StaticANIObject::preloadMovements(MovTable *mt) {
+ if ( mt ) {
+ for (uint i = 0; i < _movements.size(); i++) {
+ Movement *mov = (Movement *)_movements[i];
+
+ if (mt->movs[i] == 1)
+ mov->loadPixelData();
+ else if (mt->movs[i] == 2)
+ mov->freePixelData();
+ }
+ }
+}
+
Common::Point *StaticANIObject::getCurrDimensions(Common::Point &p) {
Picture *pic;
@@ -703,7 +752,7 @@ void StaticANIObject::update(int counterdiff) {
ex = dyn->getExCommand();
if (ex && ex->_messageKind != 35) {
- newex = new ExCommand(ex);
+ newex = ex->createClone();
newex->_excFlags |= 2;
if (newex->_messageKind == 17) {
newex->_parentId = _id;
@@ -736,7 +785,7 @@ void StaticANIObject::update(int counterdiff) {
ex = dyn->getExCommand();
if (ex) {
if (ex->_messageKind == 35) {
- newex = new ExCommand(ex);
+ newex = ex->createClone();
newex->_excFlags |= 2;
newex->sendMessage();
}
@@ -798,6 +847,44 @@ void StaticANIObject::updateStepPos() {
setOXY(ox + x, oy + y);
}
+Common::Point *StaticANIObject::calcNextStep(Common::Point *pRes) {
+ if (!_movement) {
+ pRes->x = 0;
+ pRes->y = 0;
+
+ return pRes;
+ }
+
+ Common::Point point;
+
+ _movement->calcSomeXY(point, 1);
+
+ int resX = point.x;
+ int resY = point.y;
+
+ int pointN, offset;
+
+ if (_someDynamicPhaseIndex <= 0) {
+ pointN = _stepArray.getCurrPointIndex();
+ offset = _stepArray.getPointsCount() - _stepArray.getCurrPointIndex();
+ } else {
+ pointN = _stepArray.getCurrPointIndex();
+ offset = 1 - _movement->_currDynamicPhaseIndex + _someDynamicPhaseIndex;
+ }
+
+ if (pointN >= 0) {
+ _stepArray.getPoint(&point, pointN, offset);
+
+ resX += point.x;
+ resY += point.y;
+ }
+
+ pRes->x = resX;
+ pRes->y = resY;
+
+ return pRes;
+}
+
void StaticANIObject::stopAnim_maybe() {
debug(6, "StaticANIObject::stopAnim_maybe()");
@@ -866,7 +953,24 @@ void StaticANIObject::stopAnim_maybe() {
}
void StaticANIObject::adjustSomeXY() {
- warning("STUB: StaticANIObject::adjustSomeXY()");
+ if (_movement) {
+ Common::Point point;
+
+ _movement->calcSomeXY(point, 0);
+
+ int diff = abs(point.y) - abs(point.x);
+
+ _movement->calcSomeXY(point, 1);
+
+ if (diff > 0)
+ _ox += point.x;
+ else
+ _oy += point.y;
+
+ _statics = _movement->_staticsObj2;
+ _movement = 0;
+ _someDynamicPhaseIndex = -1;
+ }
}
MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
@@ -876,7 +980,23 @@ MessageQueue *StaticANIObject::changeStatics1(int msgNum) {
}
void StaticANIObject::changeStatics2(int objId) {
- warning("STUB: StaticANIObject::changeStatics2(%d)", objId);
+ _animExFlag = 0;
+
+ deleteFromGlobalMessageQueue();
+
+ if (_movement || _statics) {
+ g_fp->_mgm->addItem(_id);
+ g_fp->_mgm->updateAnimStatics(this, objId);
+ } else {
+ _statics = getStaticsById(objId);
+ }
+
+ if (_messageQueueId) {
+ if (g_fp->_globalMessageQueueList->getMessageQueueById(_messageQueueId))
+ g_fp->_globalMessageQueueList->deleteQueueById(_messageQueueId);
+
+ _messageQueueId = 0;
+ }
}
void StaticANIObject::hide() {
@@ -887,7 +1007,7 @@ void StaticANIObject::hide() {
}
void StaticANIObject::show1(int x, int y, int movId, int mqId) {
- debug(0, "StaticANIObject::show1(%d, %d, %d, %d)", x, y, movId, mqId);
+ debug(6, "StaticANIObject::show1(%d, %d, %d, %d)", x, y, movId, mqId);
if (_messageQueueId)
return;
@@ -994,20 +1114,17 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
int newy = _oy;
Common::Point point;
- debug(0, "0 %d %d", newx, newy);
if (_movement) {
_movement->getCurrDynamicPhaseXY(point);
newx -= point.x;
newy -= point.y;
- debug(0, "1 %d %d", newx, newy);
} else if (_statics) {
_statics->getSomeXY(point);
newx -= point.x;
newy -= point.y;
- debug(0, "2 %d %d - %d %d assa", newx, newy, point.x, point.y);
}
_movement = mov;
@@ -1025,13 +1142,12 @@ bool StaticANIObject::startAnim(int movementId, int messageQueueId, int dynPhase
newx += point.x + _movement->_mx;
newy += point.y + _movement->_my;
- debug(0, "3 %d %d", newx, newy);
_stepArray.gotoNextPoint();
ExCommand *ex = _movement->_currDynamicPhase->getExCommand();
if (ex) {
if (ex->_messageKind == 35) {
- ExCommand *newex = new ExCommand(ex);
+ ExCommand *newex = ex->createClone();
newex->_excFlags |= 2;
newex->sendMessage();
}
@@ -1166,6 +1282,10 @@ Movement::Movement() {
_somePoint.y = 0;
}
+Movement::~Movement() {
+ warning("STUB: Movement::~Movement()");
+}
+
Movement::Movement(Movement *src, StaticANIObject *ani) {
_lastFrameSpecialFlag = 0;
_flipFlag = src->_flipFlag;
@@ -1231,7 +1351,7 @@ Movement::Movement(Movement *src, int *oldIdxs, int newSize, StaticANIObject *an
_m2y = src->_m2y;
if (newSize != -1) {
- if (newSize >= src->_dynamicPhases.size() + 1)
+ if (newSize >= (int)src->_dynamicPhases.size() + 1)
newSize = src->_dynamicPhases.size() + 1;
} else {
newSize = src->_dynamicPhases.size();
@@ -1359,10 +1479,10 @@ bool Movement::load(MfcArchive &file, StaticANIObject *ani) {
_flipFlag = 1;
}
- if (g_fullpipe->_gameProjectVersion >= 8)
+ if (g_fp->_gameProjectVersion >= 8)
_field_50 = file.readUint32LE();
- if (g_fullpipe->_gameProjectVersion < 12)
+ if (g_fp->_gameProjectVersion < 12)
_counterMax = 83;
else
_counterMax = file.readUint32LE();
@@ -1511,6 +1631,25 @@ int Movement::calcDuration() {
return res;
}
+int Movement::countPhasesWithFlag(int maxidx, int flag) {
+ int res = 0;
+ int sz;
+
+ if (_currMovement)
+ sz = _currMovement->_dynamicPhases.size();
+ else
+ sz = _dynamicPhases.size();
+
+ if (maxidx < 0)
+ maxidx = sz;
+
+ for (int i = 0; i < maxidx && i < sz; i++)
+ if (getDynamicPhaseByIndex(i)->_dynFlags & flag)
+ res++;
+
+ return res;
+}
+
void Movement::setDynamicPhaseIndex(int index) {
debug(7, "Movement::setDynamicPhaseIndex(%d)", index);
while (_currDynamicPhaseIndex < index)
@@ -1550,6 +1689,15 @@ void Movement::loadPixelData() {
mov->_staticsObj1->getPixelData();
}
+void Movement::freePixelData() {
+ if (!_currMovement)
+ for (uint i = 0; i < _dynamicPhases.size(); i++)
+ ((DynamicPhase *)_dynamicPhases[i])->freePixelData();
+
+ if (_staticsObj1)
+ _staticsObj1->freePixelData();
+}
+
void Movement::removeFirstPhase() {
if (_updateFlag1) {
if (!_currDynamicPhaseIndex)
@@ -1570,7 +1718,7 @@ void Movement::removeFirstPhase() {
_updateFlag1 = 0;
}
-bool Movement::gotoNextFrame(int callback1, void (*callback2)(int *)) {
+bool Movement::gotoNextFrame(void (*callback1)(int, Common::Point *point, int, int), void (*callback2)(int *)) {
debug(8, "Movement::gotoNextFrame()");
if (!callback2) {
@@ -1622,7 +1770,7 @@ bool Movement::gotoNextFrame(int callback1, void (*callback2)(int *)) {
if (_currMovement->_framePosOffsets) {
if (callback1) {
point = *_currMovement->_framePosOffsets[_currDynamicPhaseIndex];
- //callback1(_currDynamicPhaseIndex, &point, _ox, _oy);
+ callback1(_currDynamicPhaseIndex, &point, _ox, _oy);
_ox += deltax - point.x;
_oy += point.y;
@@ -1664,7 +1812,7 @@ bool Movement::gotoNextFrame(int callback1, void (*callback2)(int *)) {
point.x = _framePosOffsets[_currDynamicPhaseIndex]->x;
point.y = _framePosOffsets[_currDynamicPhaseIndex]->y;
- //callback1(_currDynamicPhaseIndex, &point, _ox, _oy);
+ callback1(_currDynamicPhaseIndex, &point, _ox, _oy);
_ox += point.x;
_oy += point.y;
} else if (oldDynIndex >= _currDynamicPhaseIndex) {
@@ -1790,7 +1938,7 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
_field_7E = 0;
_rect = new Common::Rect();
- debug(0, "DynamicPhase::DynamicPhase(src, %d)", reverse);
+ debug(1, "DynamicPhase::DynamicPhase(src, %d)", reverse);
if (reverse) {
if (!src->_bitmap)
@@ -1800,9 +1948,9 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
_data = _bitmap->_pixels;
_dataSize = src->_dataSize;
- if (g_fullpipe->_currArchive) {
+ if (g_fp->_currArchive) {
_mfield_14 = 0;
- _libHandle = g_fullpipe->_currArchive;
+ _libHandle = g_fp->_currArchive;
}
_mflags |= 1;
@@ -1835,7 +1983,7 @@ DynamicPhase::DynamicPhase(DynamicPhase *src, bool reverse) {
_field_7C = src->_field_7C;
if (src->getExCommand())
- _exCommand = new ExCommand(src->getExCommand());
+ _exCommand = src->getExCommand()->createClone();
else
_exCommand = 0;
@@ -1860,12 +2008,12 @@ bool DynamicPhase::load(MfcArchive &file) {
_rect->right = file.readUint32LE();
_rect->bottom = file.readUint32LE();
- assert (g_fullpipe->_gameProjectVersion >= 1);
+ assert (g_fp->_gameProjectVersion >= 1);
_someX = file.readUint32LE();
_someY = file.readUint32LE();
- assert (g_fullpipe->_gameProjectVersion >= 12);
+ assert (g_fp->_gameProjectVersion >= 12);
_dynFlags = file.readUint32LE();
@@ -1892,13 +2040,15 @@ bool StaticPhase::load(MfcArchive &file) {
_initialCountdown = file.readUint16LE();
_field_6A = file.readUint16LE();
- if (g_fullpipe->_gameProjectVersion >= 12) {
+ if (g_fp->_gameProjectVersion >= 12) {
_exCommand = (ExCommand *)file.readClass();
return true;
}
- assert (g_fullpipe->_gameProjectVersion >= 12);
+ assert (g_fp->_gameProjectVersion >= 12);
+
+ warning("StaticPhase::load(): Code continues here");
return true;
}
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 15de4ab3be..a620daa528 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -132,6 +132,8 @@ class Movement : public GameObject {
public:
Movement();
+ virtual ~Movement();
+
Movement(Movement *src, StaticANIObject *ani);
Movement(Movement *src, int *flag1, int flag2, StaticANIObject *ani);
@@ -153,14 +155,16 @@ class Movement : public GameObject {
DynamicPhase *getDynamicPhaseByIndex(int idx);
int calcDuration();
+ int countPhasesWithFlag(int maxidx, int flag);
void removeFirstPhase();
- bool gotoNextFrame(int callback1, void (*callback2)(int *));
+ bool gotoNextFrame(void (*_callback1)(int, Common::Point *point, int, int), void (*callback2)(int *));
bool gotoPrevFrame();
void gotoFirstFrame();
void gotoLastFrame();
void loadPixelData();
+ void freePixelData();
void draw(bool flipFlag, int angle);
};
@@ -174,7 +178,7 @@ class StaticANIObject : public GameObject {
int16 _field_32;
int _field_34;
int _initialCounter;
- int _callback1;
+ void (*_callback1)(int, Common::Point *point, int, int);
void (*_callback2)(int *);
PtrList _movements;
PtrList _staticsList;
@@ -186,11 +190,12 @@ class StaticANIObject : public GameObject {
int _counter;
int _someDynamicPhaseIndex;
- public:
+public:
int16 _sceneId;
- public:
+public:
StaticANIObject();
+ virtual ~StaticANIObject();
StaticANIObject(StaticANIObject *src);
virtual bool load(MfcArchive &file);
@@ -212,11 +217,14 @@ class StaticANIObject : public GameObject {
void deleteFromGlobalMessageQueue();
void queueMessageQueue(MessageQueue *msg);
+ void restartMessageQueue(MessageQueue *msg);
MessageQueue *getMessageQueue();
bool trySetMessageQueue(int msgNum, int qId);
+ void startMQIfIdle(int qId, int flag);
void initMovements();
void loadMovementsPixelData();
+ void preloadMovements(MovTable *mt);
void setSomeDynamicPhaseIndex(int val) { _someDynamicPhaseIndex = val; }
void adjustSomeXY();
@@ -240,6 +248,7 @@ class StaticANIObject : public GameObject {
void updateStepPos();
void stopAnim_maybe();
+ Common::Point *calcNextStep(Common::Point *point);
MessageQueue *changeStatics1(int msgNum);
void changeStatics2(int objId);
@@ -250,6 +259,9 @@ class StaticANIObject : public GameObject {
struct MovTable {
int count;
int16 *movs;
+
+ MovTable() { count = 0; movs = 0; }
+ ~MovTable() { free(movs); }
};
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index 3304a93667..b3668ea362 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -138,9 +138,9 @@ bool MemoryObject::load(MfcArchive &file) {
}
}
- if (g_fullpipe->_currArchive) {
+ if (g_fp->_currArchive) {
_mfield_14 = 0;
- _libHandle = g_fullpipe->_currArchive;
+ _libHandle = g_fp->_currArchive;
}
return true;
@@ -148,8 +148,17 @@ bool MemoryObject::load(MfcArchive &file) {
void MemoryObject::loadFile(char *filename) {
debug(5, "MemoryObject::loadFile(<%s>)", filename);
+
+ if (!*filename)
+ return;
+
if (!_data) {
- Common::SeekableReadStream *s = g_fullpipe->_currArchive->createReadStreamForMember(filename);
+ NGIArchive *arr = g_fp->_currArchive;
+
+ if (g_fp->_currArchive != _libHandle && _libHandle)
+ g_fp->_currArchive = _libHandle;
+
+ Common::SeekableReadStream *s = g_fp->_currArchive->createReadStreamForMember(filename);
if (s) {
assert(s->size() > 0);
@@ -161,7 +170,11 @@ void MemoryObject::loadFile(char *filename) {
s->read(_data, _dataSize);
delete s;
+ } else {
+ warning("MemoryObject::loadFile(): reading failure");
}
+
+ g_fp->_currArchive = arr;
}
}
@@ -181,6 +194,8 @@ byte *MemoryObject::loadData() {
}
void MemoryObject::freeData() {
+ debug(8, "MemoryObject::freeData(): file: %s", _memfilename);
+
if (_data)
free(_data);
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h
index 64f56ced0a..5714fd3b4c 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -66,6 +66,8 @@ class MfcArchive : public Common::SeekableReadStream {
enum ObjType {
kObjTypeDefault,
+ kObjTypeExCommand,
+ kObjTypeExCommand2,
kObjTypeMovGraph,
kObjTypeMovGraphLink,
kObjTypeMovGraphNode,
@@ -115,6 +117,7 @@ class MemoryObject : CObject {
void load() { loadFile(_memfilename); }
byte *getData();
byte *loadData();
+ int getDataSize() const { return _dataSize; }
bool testFlags();
diff --git a/engines/gob/configure.engine b/engines/gob/configure.engine
new file mode 100644
index 0000000000..8e012f5815
--- /dev/null
+++ b/engines/gob/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 gob "Gobli*ns" yes
diff --git a/engines/groovie/configure.engine b/engines/groovie/configure.engine
new file mode 100644
index 0000000000..84e95a70df
--- /dev/null
+++ b/engines/groovie/configure.engine
@@ -0,0 +1,4 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine groovie "Groovie" yes "groovie2" "7th Guest"
+add_engine groovie2 "Groovie 2 games" no "" "" "jpeg"
diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp
index d29c22dd02..a55d8fad95 100644
--- a/engines/groovie/font.cpp
+++ b/engines/groovie/font.cpp
@@ -112,7 +112,7 @@ bool T7GFont::load(Common::SeekableReadStream &stream) {
return true;
}
-void T7GFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const {
+void T7GFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const {
// We ignore the color, as the font is already colored
const Glyph *glyph = getGlyph(chr);
const byte *src = glyph->pixels;
@@ -125,7 +125,7 @@ void T7GFont::drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 co
}
}
-const T7GFont::Glyph *T7GFont::getGlyph(byte chr) const {
+const T7GFont::Glyph *T7GFont::getGlyph(uint32 chr) const {
assert (chr < 128);
byte numGlyph = _mapChar2Glyph[chr];
diff --git a/engines/groovie/font.h b/engines/groovie/font.h
index 20aaa4cf23..49cf4b7b06 100644
--- a/engines/groovie/font.h
+++ b/engines/groovie/font.h
@@ -37,8 +37,8 @@ public:
int getFontHeight() const { return _maxHeight; }
int getMaxCharWidth() const { return _maxWidth; }
- int getCharWidth(byte chr) const { return getGlyph(chr)->width; }
- void drawChar(Graphics::Surface *dst, byte chr, int x, int y, uint32 color) const;
+ int getCharWidth(uint32 chr) const { return getGlyph(chr)->width; }
+ void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const;
private:
int _maxHeight, _maxWidth;
@@ -55,7 +55,7 @@ private:
byte _mapChar2Glyph[128];
Glyph *_glyphs;
- const Glyph *getGlyph(byte chr) const;
+ const Glyph *getGlyph(uint32 chr) const;
};
} // End of Groovie namespace
diff --git a/engines/hopkins/configure.engine b/engines/hopkins/configure.engine
new file mode 100644
index 0000000000..c38ecd4cd2
--- /dev/null
+++ b/engines/hopkins/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 hopkins "Hopkins FBI" yes "" "" "16bit"
diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp
index 51c66c4f92..d0c1dcea4d 100644
--- a/engines/hopkins/events.cpp
+++ b/engines/hopkins/events.cpp
@@ -271,7 +271,7 @@ void EventsManager::pollEvents() {
_mouseButton = 0;
return;
default:
- break;
+ break;
}
}
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index de9f043763..a64e81fcc9 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -1359,7 +1359,7 @@ void GraphicsManager::drawCompressedSprite(byte *surface, const byte *srcData, i
_posYClipped = 0;
_clipX1 = 0;
_clipY1 = 0;
- if ((xp300 <= _minX) || (yp300 <= _minY) || (xp300 >= _maxX + 300) || (yp300 >= _maxY + 300))
+ if ((xp300 <= _minX) || (yp300 <= _minY) || (xp300 >= _maxX + 300) || (yp300 >= _maxY + 300))
return;
// Clipped values are greater or equal to zero, thanks to the previous test
@@ -1781,7 +1781,7 @@ void GraphicsManager::initScreen(const Common::String &file, int mode, bool init
do {
int dataVal1 = _vm->_script->handleOpcode(ptr + 20 * dataOffset);
- if (_vm->shouldQuit())
+ if (dataVal1 == -1 || _vm->shouldQuit())
return;
if (dataVal1 == 2)
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index adf7580e6b..0e86fa26a9 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -1923,7 +1923,6 @@ void HopkinsEngine::bombExplosion() {
}
void HopkinsEngine::restoreSystem() {
- quitGame();
_events->refreshEvents();
}
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index d8c30e5004..615eace374 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -48,6 +48,7 @@
#include "common/util.h"
#include "engines/engine.h"
#include "graphics/surface.h"
+#include "gui/debugger.h"
/**
* This is the namespace of the Hopkins engine.
@@ -59,10 +60,6 @@
*/
namespace Hopkins {
-#define DEBUG_BASIC 1
-#define DEBUG_INTERMEDIATE 2
-#define DEBUG_DETAILED 3
-
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
@@ -136,6 +133,8 @@ protected:
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
+ GUI::Debugger *getDebugger() { return _debug; }
+
public:
AnimationManager *_animMan;
ComputerManager *_computer;
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index f2f547557f..347a6aabe8 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -2629,7 +2629,7 @@ void ObjectsManager::loadObjectIniFile() {
for (;;) {
int opcodeType = _vm->_script->handleOpcode(data + 20 * lastOpcodeResult);
- if (_vm->shouldQuit())
+ if (opcodeType == -1 || _vm->shouldQuit())
return;
if (opcodeType == 2)
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 1bb6701fc8..c80ea15554 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -266,7 +266,7 @@ int TalkManager::dialogQuestion(bool animatedFl) {
int retVal = -1;
bool loopCond = false;
- do {
+ do {
int mousePosY = _vm->_events->getMouseY();
if (sentence1PosY < mousePosY && mousePosY < (sentence2PosY - 1)) {
_vm->_fontMan->setOptimalColor(6, 7, 8, 5);
@@ -825,7 +825,7 @@ void TalkManager::handleAnswer(int zone, int verb) {
int lastOpcodeResult = 1;
do {
int opcodeType = _vm->_script->handleOpcode(ptr + 20 * lastOpcodeResult);
- if (_vm->shouldQuit())
+ if (opcodeType == -1 || _vm->shouldQuit())
return;
if (opcodeType == 2)
diff --git a/engines/hugo/configure.engine b/engines/hugo/configure.engine
new file mode 100644
index 0000000000..9ab5c54e1e
--- /dev/null
+++ b/engines/hugo/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 hugo "Hugo Trilogy" yes
diff --git a/engines/kyra/configure.engine b/engines/kyra/configure.engine
new file mode 100644
index 0000000000..b7d6334fcc
--- /dev/null
+++ b/engines/kyra/configure.engine
@@ -0,0 +1,5 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine kyra "Kyra" yes "lol eob" "Legend of Kyrandia 1-3"
+add_engine lol "Lands of Lore" yes
+add_engine eob "Eye of the Beholder" yes
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 48ba96ec8b..a485ae47e4 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -378,7 +378,6 @@ void KyraEngine_MR::playVQA(const char *name) {
_screen->fadeToBlack(60);
_screen->clearPage(0);
- vqa.setDrawPage(0);
vqa.play();
vqa.close();
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index c52b0a04ad..522e12faa4 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -1172,7 +1172,7 @@ void GUI_LoK::initStaticResource() {
GUI_V1_MENU_ITEM(_menu[5].item[2], 1, 0, 0, 0, 0xA5, 0, 0x40, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x42, 0, 0);
GUI_V1_MENU_ITEM(_menu[5].item[3], 1, 0, 0, 0, 0xA5, 0, 0x51, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x53, 0, 0);
GUI_V1_MENU_ITEM(_menu[5].item[4], 1, 0, 0, 0, 0xA5, 0, 0x62, 0x80, 0x0F, 252, 253, 5, 0, 248, 249, 250, -1, 0, 0x10, 0x65, 0, 0);
- GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0, -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, -0, 0, 0, 0, 0);
+ GUI_V1_MENU_ITEM(_menu[5].item[5], 1, 0, 0, 0, -1, 0, 0x7F, 0x6C, 0x0F, 252, 253, -1, 255, 248, 249, 250, -1, 0, 0, 0, 0, 0);
_menu[5].item[0].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeMusic);
_menu[5].item[1].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeSounds);
_menu[5].item[2].callback = BUTTON_FUNCTOR(GUI_LoK, this, &GUI_LoK::controlsChangeWalk);
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp
index 081d94a050..d9564e1306 100644
--- a/engines/kyra/vqa.cpp
+++ b/engines/kyra/vqa.cpp
@@ -28,644 +28,606 @@
//
// The jung2.vqa movie does work, but only thanks to a grotesque hack.
-
+#include "kyra/kyra_v1.h"
#include "kyra/vqa.h"
-#include "kyra/resource.h"
-
-#include "common/system.h"
+#include "kyra/screen.h"
#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "audio/decoders/raw.h"
-namespace Kyra {
-
-VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) {
- _system = system;
- _vm = vm;
- _screen = _vm->screen();
- _opened = false;
- _x = _y = _drawPage = -1;
- _frame = 0;
- _vectorPointers = 0;
- _numPartialCodeBooks = 0;
- _partialCodeBookSize = 0;
- _compressedCodeBook = 0;
- _partialCodeBook = 0;
- _codeBook = 0;
- _frameInfo = 0;
- memset(_buffers, 0, sizeof(_buffers));
-}
-
-VQAMovie::~VQAMovie() {
- close();
-}
-
-void VQAMovie::initBuffers() {
- for (int i = 0; i < ARRAYSIZE(_buffers); i++) {
- _buffers[i].data = 0;
- _buffers[i].size = 0;
- }
-}
-
-void *VQAMovie::allocBuffer(int num, uint32 size) {
- assert(num >= 0 && num < ARRAYSIZE(_buffers));
- assert(size > 0);
-
- if (size > _buffers[num].size) {
- /*
- * We could use realloc() here, but we don't actually need the
- * old contents of the buffer.
- */
- delete[] _buffers[num].data;
- _buffers[num].data = new uint8[size];
- _buffers[num].size = size;
- }
-
- assert(_buffers[num].data);
+#include "common/system.h"
+#include "common/events.h"
- return _buffers[num].data;
-}
+#include "graphics/palette.h"
+#include "graphics/surface.h"
-void VQAMovie::freeBuffers() {
- for (int i = 0; i < ARRAYSIZE(_buffers); i++) {
- delete[] _buffers[i].data;
- _buffers[i].data = NULL;
- _buffers[i].size = 0;
- }
-}
+namespace Kyra {
-uint32 VQAMovie::readTag() {
+static uint32 readTag(Common::SeekableReadStream *stream) {
// Some tags have to be on an even offset, so they are padded with a
// zero byte. Skip that.
- uint32 tag = _file->readUint32BE();
+ uint32 tag = stream->readUint32BE();
- if (_file->eos())
+ if (stream->eos())
return 0;
if (!(tag & 0xFF000000)) {
- tag = (tag << 8) | _file->readByte();
+ tag = (tag << 8) | stream->readByte();
}
return tag;
}
-void VQAMovie::decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsize) {
- const int8 WSTable2Bit[] = { -2, -1, 0, 1 };
- const int8 WSTable4Bit[] = {
- -9, -8, -6, -5, -4, -3, -2, -1,
- 0, 1, 2, 3, 4, 5, 6, 8
- };
-
- byte code;
- int8 count;
- uint16 input;
-
- int16 curSample = 0x80;
-
- while (outsize > 0) {
- input = *inbuf++ << 2;
- code = (input >> 8) & 0xFF;
- count = (input & 0xFF) >> 2;
-
- switch (code) {
- case 2:
- if (count & 0x20) {
- /* NOTE: count is signed! */
- count <<= 3;
- curSample += (count >> 3);
- *outbuf++ = curSample;
- outsize--;
- } else {
- for (; count >= 0; count--) {
- *outbuf++ = *inbuf++;
- outsize--;
- }
- curSample = *(outbuf - 1);
- }
- break;
- case 1:
- for (; count >= 0; count--) {
- code = *inbuf++;
-
- curSample += WSTable4Bit[code & 0x0F];
- curSample = CLIP<int16>(curSample, 0, 255);
- *outbuf++ = curSample;
-
- curSample += WSTable4Bit[code >> 4];
- curSample = CLIP<int16>(curSample, 0, 255);
- *outbuf++ = curSample;
-
- outsize -= 2;
- }
- break;
- case 0:
- for (; count >= 0; count--) {
- code = *inbuf++;
-
- curSample += WSTable2Bit[code & 0x03];
- curSample = CLIP<int16>(curSample, 0, 255);
- *outbuf++ = curSample;
-
- curSample += WSTable2Bit[(code >> 2) & 0x03];
- curSample = CLIP<int16>(curSample, 0, 255);
- *outbuf++ = curSample;
-
- curSample += WSTable2Bit[(code >> 4) & 0x03];
- curSample = CLIP<int16>(curSample, 0, 255);
- *outbuf++ = curSample;
-
- curSample += WSTable2Bit[(code >> 6) & 0x03];
- curSample = CLIP<int16>(curSample, 0, 255);
- *outbuf++ = curSample;
-
- outsize -= 4;
- }
- break;
- default:
- for (; count >= 0; count--) {
- *outbuf++ = curSample;
- outsize--;
- }
- }
- }
+VQADecoder::VQADecoder() {
+ memset(&_header, 0, sizeof(_header));
}
-bool VQAMovie::open(const char *filename) {
+VQADecoder::~VQADecoder() {
close();
+ delete[] _frameInfo;
+}
- _file = _vm->resource()->createReadStream(filename);
- if (!_file)
- return false;
+bool VQADecoder::loadStream(Common::SeekableReadStream *stream) {
+ close();
+ _fileStream = stream;
- if (_file->readUint32BE() != MKTAG('F','O','R','M')) {
- warning("VQAMovie::open: Cannot find `FORM' tag");
+ if (_fileStream->readUint32BE() != MKTAG('F','O','R','M')) {
+ warning("VQADecoder::loadStream(): Cannot find `FORM' tag");
return false;
}
- // For now, we ignore the size of the FORM chunk.
- _file->readUint32BE();
+ // Ignore the size of the FORM chunk. We're only interested in its
+ // children.
+ _fileStream->readUint32BE();
- if (_file->readUint32BE() != MKTAG('W','V','Q','A')) {
- warning("WQAMovie::open: Cannot find `WVQA' tag");
+ if (_fileStream->readUint32BE() != MKTAG('W','V','Q','A')) {
+ warning("VQADecoder::loadStream(): Cannot find `WVQA' tag");
return false;
}
- bool foundHeader = false;
- bool foundFrameInfo = false;
+ // We want to find both a VQHD chunk containing the header, and a FINF
+ // chunk containing the frame offsets.
+
+ bool foundVQHD = false;
+ bool foundFINF = false;
+
+ VQAAudioTrack *audioTrack = NULL;
// The information we need is stored in two chunks: VQHD and FINF. We
// need both of them before we can begin decoding the movie.
- while (!foundHeader || !foundFrameInfo) {
- uint32 tag = readTag();
- uint32 size = _file->readUint32BE();
+ while (!foundVQHD || !foundFINF) {
+ uint32 tag = readTag(stream);
+ uint32 size = _fileStream->readUint32BE();
switch (tag) {
- case MKTAG('V','Q','H','D'): // VQA header
- _header.version = _file->readUint16LE();
- _header.flags = _file->readUint16LE();
- _header.numFrames = _file->readUint16LE();
- _header.width = _file->readUint16LE();
- _header.height = _file->readUint16LE();
- _header.blockW = _file->readByte();
- _header.blockH = _file->readByte();
- _header.frameRate = _file->readByte();
- _header.cbParts = _file->readByte();
- _header.colors = _file->readUint16LE();
- _header.maxBlocks = _file->readUint16LE();
- _header.unk1 = _file->readUint32LE();
- _header.unk2 = _file->readUint16LE();
- _header.freq = _file->readUint16LE();
- _header.channels = _file->readByte();
- _header.bits = _file->readByte();
- _header.unk3 = _file->readUint32LE();
- _header.unk4 = _file->readUint16LE();
- _header.maxCBFZSize = _file->readUint32LE();
- _header.unk5 = _file->readUint32LE();
-
- // Kyrandia 3 uses version 1 VQA files, and is the only
- // known game to do so. This version of the format has
- // some implicit default values.
-
- if (_header.version == 1) {
- if (_header.freq == 0)
- _header.freq = 22050;
- if (_header.channels == 0)
- _header.channels = 1;
- if (_header.bits == 0)
- _header.bits = 8;
- }
-
- _x = (Screen::SCREEN_W - _header.width) / 2;
- _y = (Screen::SCREEN_H - _header.height) / 2;
-
- _frameInfo = new uint32[_header.numFrames];
- _frame = new byte[_header.width * _header.height];
-
- _codeBookSize = 0xF00 * _header.blockW * _header.blockH;
- _codeBook = new byte[_codeBookSize];
- _partialCodeBook = new byte[_codeBookSize];
- memset(_codeBook, 0, _codeBookSize);
- memset(_partialCodeBook, 0, _codeBookSize);
-
- _numVectorPointers = (_header.width / _header.blockW) * (_header.height * _header.blockH);
- _vectorPointers = new uint16[_numVectorPointers];
- memset(_vectorPointers, 0, _numVectorPointers * sizeof(uint16));
-
- _partialCodeBookSize = 0;
- _numPartialCodeBooks = 0;
-
+ case MKTAG('V','Q','H','D'):
+ handleVQHD(_fileStream);
if (_header.flags & 1) {
- // This VQA movie has sound. Kyrandia 3 uses
- // 8-bit sound, and so far testing indicates
- // that it's all mono.
- //
- // This is good, because it means we won't have
- // to worry about the confusing parts of the
- // VQA spec, where 8- and 16-bit data have
- // different signedness and stereo sample
- // layout varies between different games.
-
- assert(_header.bits == 8);
- assert(_header.channels == 1);
-
- _stream = Audio::makeQueuingAudioStream(_header.freq, false);
- } else {
- _stream = NULL;
+ audioTrack = new VQAAudioTrack(&_header);
+ addTrack(audioTrack);
}
-
- foundHeader = true;
+ foundVQHD = true;
break;
-
- case MKTAG('F','I','N','F'): // Frame info
- if (!foundHeader) {
- warning("VQAMovie::open: Found `FINF' before `VQHD'");
+ case MKTAG('F','I','N','F'):
+ if (!foundVQHD) {
+ warning("VQADecoder::loadStream(): Found `FINF' before `VQHD'");
return false;
}
-
- if (size != 4 * (uint32)_header.numFrames) {
- warning("VQAMovie::open: Expected size %d for `FINF' chunk, but got %u", 4 * _header.numFrames, size);
+ if (size != 4 * getFrameCount()) {
+ warning("VQADecoder::loadStream(): Expected size %d for `FINF' chunk, but got %u", 4 * getFrameCount(), size);
return false;
}
+ handleFINF(_fileStream);
+ foundFINF = true;
+ break;
+ default:
+ warning("VQADecoder::loadStream(): Unknown tag `%s'", tag2str(tag));
+ _fileStream->seek(size, SEEK_CUR);
+ break;
+ }
+ }
- foundFrameInfo = true;
+ return true;
+}
- for (int i = 0; i < _header.numFrames; i++) {
- _frameInfo[i] = 2 * _file->readUint32LE();
- }
+void VQADecoder::handleVQHD(Common::SeekableReadStream *stream) {
+ _header.version = stream->readUint16LE();
+ _header.flags = stream->readUint16LE();
+ _header.numFrames = stream->readUint16LE();
+ _header.width = stream->readUint16LE();
+ _header.height = stream->readUint16LE();
+ _header.blockW = stream->readByte();
+ _header.blockH = stream->readByte();
+ _header.frameRate = stream->readByte();
+ _header.cbParts = stream->readByte();
+ _header.colors = stream->readUint16LE();
+ _header.maxBlocks = stream->readUint16LE();
+ _header.unk1 = stream->readUint32LE();
+ _header.unk2 = stream->readUint16LE();
+ _header.freq = stream->readUint16LE();
+ _header.channels = stream->readByte();
+ _header.bits = stream->readByte();
+ _header.unk3 = stream->readUint32LE();
+ _header.unk4 = stream->readUint16LE();
+ _header.maxCBFZSize = stream->readUint32LE();
+ _header.unk5 = stream->readUint32LE();
+
+ _frameInfo = new uint32[_header.numFrames + 1];
+
+ VQAVideoTrack *videoTrack = new VQAVideoTrack(&_header);
+ addTrack(videoTrack);
+
+ // Kyrandia 3 uses version 1 VQA files, and is the only known game to
+ // do so. This version of the format has some implicit default values.
+
+ if (_header.version == 1) {
+ if (_header.freq == 0)
+ _header.freq = 22050;
+ if (_header.channels == 0)
+ _header.channels = 1;
+ if (_header.bits == 0)
+ _header.bits = 8;
+ }
- // HACK: This flag is set in jung2.vqa, and its
- // purpose, if it has one, is unknown. It can't be a
- // general purpose flag, because in large movies the
- // frame offsets can be large enough to set this flag,
- // though of course never for the first frame.
- //
- // At least in my copy of Kyrandia 3, _frameInfo[0] is
- // 0x81000098, and the desired index is 0x4716. So the
- // value should be 0x80004716, but I don't want to
- // hard-code it. Instead, scan the file for the offset
- // to the first VQFR chunk.
-
- if (_frameInfo[0] & 0x01000000) {
- uint32 oldPos = _file->pos();
-
- while (1) {
- uint32 scanTag = readTag();
- uint32 scanSize = _file->readUint32BE();
-
- if (_file->eos())
- break;
-
- if (scanTag == MKTAG('V','Q','F','R')) {
- _frameInfo[0] = (_file->pos() - 8) | 0x80000000;
- break;
- }
+ if (_header.flags & 1) {
+ // Kyrandia 3 uses 8-bit sound, and so far testing indicates
+ // that it's all mono.
+ //
+ // This is good, because it means we won't have to worry about
+ // the confusing parts of the VQA spec, where 8- and 16-bit
+ // data have different signedness and stereo sample layout
+ // varies between different games.
+
+ assert(_header.bits == 8);
+ assert(_header.channels == 1);
+ }
+}
- _file->seek(scanSize, SEEK_CUR);
- }
+void VQADecoder::handleFINF(Common::SeekableReadStream *stream) {
+ for (int i = 0; i < _header.numFrames; i++) {
+ _frameInfo[i] = 2 * stream->readUint32LE();
+ }
- _file->seek(oldPos);
- }
+ // HACK: This flag is set in jung2.vqa, and its purpose - if it has
+ // one - is currently unknown. It can't be a general purpose flag,
+ // because in large movies the frame offset can be large enough to
+ // set this flag, though of course never for the first frame.
+ //
+ // At least in my copy of Kyrandia 3, _frameInfo[0] is 0x81000098, and
+ // the desired index is 0x4716. So the value should be 0x80004716, but
+ // I don't want to hard-code it. Instead, scan the file for the offset
+ // to the first VQFR chunk.
- break;
+ if (_frameInfo[0] & 0x01000000) {
+ uint32 oldPos = stream->pos();
- default:
- warning("VQAMovie::open: Unknown tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF));
- _file->seek(size, SEEK_CUR);
- }
- }
+ while (1) {
+ uint32 scanTag = readTag(stream);
+ uint32 scanSize = stream->readUint32BE();
- initBuffers();
+ if (stream->eos())
+ break;
- _opened = true;
- return true;
-}
+ if (scanTag == MKTAG('V','Q','F','R')) {
+ _frameInfo[0] = (stream->pos() - 8) | 0x80000000;
+ break;
+ }
-void VQAMovie::close() {
- if (_opened) {
- delete[] _frameInfo;
- delete[] _frame;
- delete[] _codeBook;
- delete[] _partialCodeBook;
- delete[] _vectorPointers;
-
- if (_vm->_mixer->isSoundHandleActive(_sound))
- _vm->_mixer->stopHandle(_sound);
-
- _frameInfo = NULL;
- _frame = NULL;
- _codeBookSize = 0;
- _codeBook = NULL;
- _partialCodeBook = NULL;
- _vectorPointers = NULL;
- _stream = NULL;
-
- delete _file;
- _file = 0;
-
- freeBuffers();
-
- _opened = false;
+ stream->seek(scanSize, SEEK_CUR);
+ }
+
+ stream->seek(oldPos);
}
+
+ _frameInfo[_header.numFrames] = 0x7FFFFFFF;
}
-void VQAMovie::displayFrame(uint frameNum) {
- if (frameNum >= _header.numFrames || !_opened)
- return;
+void VQADecoder::readNextPacket() {
+ VQAVideoTrack *videoTrack = (VQAVideoTrack *)getTrack(0);
+ VQAAudioTrack *audioTrack = (VQAAudioTrack *)getTrack(1);
- bool foundSound = !_stream;
- bool foundFrame = false;
- uint i;
+ assert(videoTrack);
- _file->seek(_frameInfo[frameNum] & 0x7FFFFFFF);
+ int curFrame = videoTrack->getCurFrame();
- while (!foundSound || !foundFrame) {
- uint32 tag = readTag();
- uint32 size = _file->readUint32BE();
+ // Stop if reading the tag is enough to put us ahead of the next frame
+ int32 end = (_frameInfo[curFrame + 1] & 0x7FFFFFFF) - 7;
- if (_file->eos()) {
- // This happens at the last frame. Apparently it has
- // no sound?
- break;
+ // At this point, we probably only need to adjust for the offset in the
+ // stream to be even. But we may as well do this to really make sure
+ // we have the correct offset.
+ if (curFrame >= 0) {
+ _fileStream->seek(_frameInfo[curFrame] & 0x7FFFFFFF);
+ if (_frameInfo[curFrame] & 0x80000000) {
+ videoTrack->setHasDirtyPalette();
}
+ }
- byte *inbuf, *outbuf;
- uint32 insize, outsize;
- int32 end;
+ while (!_fileStream->eos() && _fileStream->pos() < end) {
+ uint32 tag = readTag(_fileStream);
+ uint32 size;
switch (tag) {
case MKTAG('S','N','D','0'): // Uncompressed sound
- foundSound = true;
- inbuf = (byte *)malloc(size);
- _file->read(inbuf, size);
- assert(_stream);
- _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
+ assert(audioTrack);
+ audioTrack->handleSND0(_fileStream);
break;
-
case MKTAG('S','N','D','1'): // Compressed sound, almost like AUD
- foundSound = true;
- outsize = _file->readUint16LE();
- insize = _file->readUint16LE();
-
- inbuf = (byte *)malloc(insize);
- _file->read(inbuf, insize);
-
- if (insize == outsize) {
- assert(_stream);
- _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
- } else {
- outbuf = (byte *)malloc(outsize);
- decodeSND1(inbuf, insize, outbuf, outsize);
- assert(_stream);
- _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
- free(inbuf);
- }
+ assert(audioTrack);
+ audioTrack->handleSND1(_fileStream);
break;
-
case MKTAG('S','N','D','2'): // Compressed sound
- foundSound = true;
- warning("VQAMovie::displayFrame: `SND2' is not implemented");
- _file->seek(size, SEEK_CUR);
+ assert(audioTrack);
+ audioTrack->handleSND2(_fileStream);
break;
-
case MKTAG('V','Q','F','R'):
- foundFrame = true;
- end = _file->pos() + size - 8;
-
- while (_file->pos() < end) {
- tag = readTag();
- size = _file->readUint32BE();
-
- switch (tag) {
- case MKTAG('C','B','F','0'): // Full codebook
- _file->read(_codeBook, size);
- break;
+ videoTrack->handleVQFR(_fileStream);
+ break;
+ case MKTAG('C','M','D','S'):
+ // The purpose of this is unknown, but it's known to
+ // exist so don't warn about it.
+ size = _fileStream->readUint32BE();
+ _fileStream->seek(size, SEEK_CUR);
+ break;
+ default:
+ warning("VQADecoder::readNextPacket(): Unknown tag `%s'", tag2str(tag));
+ size = _fileStream->readUint32BE();
+ _fileStream->seek(size, SEEK_CUR);
+ break;
+ }
+ }
+}
- case MKTAG('C','B','F','Z'): // Full codebook
- inbuf = (byte *)allocBuffer(0, size);
- _file->read(inbuf, size);
- Screen::decodeFrame4(inbuf, _codeBook, _codeBookSize);
- break;
+// -----------------------------------------------------------------------
- case MKTAG('C','B','P','0'): // Partial codebook
- _compressedCodeBook = false;
- _file->read(_partialCodeBook + _partialCodeBookSize, size);
- _partialCodeBookSize += size;
- _numPartialCodeBooks++;
- break;
+VQADecoder::VQAAudioTrack::VQAAudioTrack(const VQAHeader *header) {
+ _audioStream = Audio::makeQueuingAudioStream(header->freq, false);
+}
- case MKTAG('C','B','P','Z'): // Partial codebook
- _compressedCodeBook = true;
- _file->read(_partialCodeBook + _partialCodeBookSize, size);
- _partialCodeBookSize += size;
- _numPartialCodeBooks++;
- break;
+VQADecoder::VQAAudioTrack::~VQAAudioTrack() {
+ delete _audioStream;
+}
- case MKTAG('C','P','L','0'): // Palette
- assert(size <= 3 * 256);
- _file->read(_screen->getPalette(0).getData(), size);
- break;
+Audio::AudioStream *VQADecoder::VQAAudioTrack::getAudioStream() const {
+ return _audioStream;
+}
- case MKTAG('C','P','L','Z'): // Palette
- inbuf = (byte *)allocBuffer(0, size);
- _file->read(inbuf, size);
- Screen::decodeFrame4(inbuf, _screen->getPalette(0).getData(), 768);
- break;
+void VQADecoder::VQAAudioTrack::handleSND0(Common::SeekableReadStream *stream) {
+ uint32 size = stream->readUint32BE();
+ byte *buf = (byte *)malloc(size);
+ stream->read(buf, size);
+ _audioStream->queueBuffer(buf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
+}
- case MKTAG('V','P','T','0'): // Frame data
- assert(size / 2 <= _numVectorPointers);
+void VQADecoder::VQAAudioTrack::handleSND1(Common::SeekableReadStream *stream) {
+ stream->readUint32BE();
+ uint16 outsize = stream->readUint16LE();
+ uint16 insize = stream->readUint16LE();
+ byte *inbuf = (byte *)malloc(insize);
+
+ stream->read(inbuf, insize);
+
+ if (insize == outsize) {
+ _audioStream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
+ } else {
+ const int8 WSTable2Bit[] = { -2, -1, 0, 1 };
+ const int8 WSTable4Bit[] = {
+ -9, -8, -6, -5, -4, -3, -2, -1,
+ 0, 1, 2, 3, 4, 5, 6, 8
+ };
+
+ byte *outbuf = (byte *)malloc(outsize);
+ byte *in = inbuf;
+ byte *out = outbuf;
+ int16 curSample = 0x80;
+ uint16 bytesLeft = outsize;
+
+ while (bytesLeft > 0) {
+ uint16 input = *in++ << 2;
+ byte code = (input >> 8) & 0xFF;
+ int8 count = (input & 0xFF) >> 2;
+ int i;
+
+ switch (code) {
+ case 2:
+ if (count & 0x20) {
+ /* NOTE: count is signed! */
+ count <<= 3;
+ curSample += (count >> 3);
+ *out++ = curSample;
+ bytesLeft--;
+ } else {
+ for (; count >= 0; count--) {
+ *out++ = *in++;
+ bytesLeft--;
+ }
+ curSample = *(out - 1);
+ }
+ break;
+ case 1:
+ for (; count >= 0; count--) {
+ code = *in++;
- for (i = 0; i < size / 2; i++)
- _vectorPointers[i] = _file->readUint16LE();
- break;
+ for (i = 0; i < 2; i++) {
+ curSample += WSTable4Bit[code & 0x0F];
+ curSample = CLIP<int16>(curSample, 0, 255);
+ code >>= 4;
+ *out++ = curSample;
+ }
- case MKTAG('V','P','T','Z'): // Frame data
- inbuf = (byte *)allocBuffer(0, size);
- outbuf = (byte *)allocBuffer(1, 2 * _numVectorPointers);
+ bytesLeft -= 2;
+ }
+ break;
+ case 0:
+ for (; count >= 0; count--) {
+ code = *in++;
- _file->read(inbuf, size);
- size = Screen::decodeFrame4(inbuf, outbuf, 2 * _numVectorPointers);
+ for (i = 0; i < 4; i++) {
+ curSample += WSTable2Bit[code & 0x03];
+ curSample = CLIP<int16>(curSample, 0, 255);
+ code >>= 2;
+ *out++ = curSample;
+ }
- assert(size / 2 <= _numVectorPointers);
+ bytesLeft -= 4;
+ }
+ break;
+ default:
+ for (; count >= 0; count--) {
+ *out++ = curSample;
+ bytesLeft--;
+ }
+ break;
+ }
+ }
+ _audioStream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
+ free(inbuf);
+ }
+}
- for (i = 0; i < size / 2; i++)
- _vectorPointers[i] = READ_LE_UINT16(outbuf + 2 * i);
- break;
+void VQADecoder::VQAAudioTrack::handleSND2(Common::SeekableReadStream *stream) {
+ uint32 size = stream->readUint32BE();
+ warning("VQADecoder::VQAAudioTrack::handleSND2(): `SND2' is not implemented");
+ stream->seek(size, SEEK_CUR);
+}
- default:
- warning("VQAMovie::displayFrame: Unknown `VQFR' sub-tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF));
- _file->seek(size, SEEK_CUR);
- }
+// -----------------------------------------------------------------------
- }
+VQADecoder::VQAVideoTrack::VQAVideoTrack(const VQAHeader *header) {
+ memset(_palette, 0, sizeof(_palette));
+ _dirtyPalette = false;
- break;
+ _width = header->width;
+ _height = header->height;
+ _blockW = header->blockW;
+ _blockH = header->blockH;
+ _cbParts = header->cbParts;
- default:
- warning("VQAMovie::displayFrame: Unknown tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF));
- _file->seek(size, SEEK_CUR);
- }
- }
+ _newFrame = false;
- // The frame has been decoded
+ _curFrame = -1;
+ _frameCount = header->numFrames;
+ _frameRate = header->frameRate;
- if (_frameInfo[frameNum] & 0x80000000)
- _screen->setScreenPalette(_screen->getPalette(0));
+ _codeBookSize = 0xF00 * header->blockW * header->blockH;
+ _compressedCodeBook = false;
+ _codeBook = new byte[_codeBookSize];
+ _partialCodeBookSize = 0;
+ _numPartialCodeBooks = 0;
+ _partialCodeBook = new byte[_codeBookSize];
+ _numVectorPointers = (header->width / header->blockW) * (header->height * header->blockH);
+ _vectorPointers = new uint16[_numVectorPointers];
- int blockPitch = _header.width / _header.blockW;
+ memset(_codeBook, 0, _codeBookSize);
+ memset(_partialCodeBook, 0, _codeBookSize);
+ memset(_vectorPointers, 0, _numVectorPointers);
- for (int by = 0; by < _header.height / _header.blockH; by++) {
- for (int bx = 0; bx < blockPitch; bx++) {
- byte *dst = _frame + by * _header.width * _header.blockH + bx * _header.blockW;
- int val = _vectorPointers[by * blockPitch + bx];
+ _surface = new Graphics::Surface();
+ _surface->create(header->width, header->height, Graphics::PixelFormat::createFormatCLUT8());
+}
- if ((val & 0xFF00) == 0xFF00) {
- // Solid color
- for (i = 0; i < _header.blockH; i++) {
- memset(dst, 255 - (val & 0xFF), _header.blockW);
- dst += _header.width;
- }
- } else {
- // Copy data from _vectorPointers. I'm not sure
- // why we don't use the three least significant
- // bits of 'val'.
- byte *src = &_codeBook[(val >> 3) * _header.blockW * _header.blockH];
-
- for (i = 0; i < _header.blockH; i++) {
- memcpy(dst, src, _header.blockW);
- src += _header.blockW;
- dst += _header.width;
- }
- }
- }
- }
+VQADecoder::VQAVideoTrack::~VQAVideoTrack() {
+ _surface->free();
+ delete _surface;
+ delete[] _codeBook;
+ delete[] _partialCodeBook;
+ delete[] _vectorPointers;
+}
- if (_numPartialCodeBooks == _header.cbParts) {
- if (_compressedCodeBook) {
- Screen::decodeFrame4(_partialCodeBook, _codeBook, _codeBookSize);
- } else {
- memcpy(_codeBook, _partialCodeBook, _partialCodeBookSize);
- }
- _numPartialCodeBooks = 0;
- _partialCodeBookSize = 0;
- }
+uint16 VQADecoder::VQAVideoTrack::getWidth() const {
+ return _width;
+}
- _screen->copyBlockToPage(_drawPage, _x, _y, _header.width, _header.height, _frame);
+uint16 VQADecoder::VQAVideoTrack::getHeight() const {
+ return _height;
}
-void VQAMovie::play() {
- uint32 startTick;
+Graphics::PixelFormat VQADecoder::VQAVideoTrack::getPixelFormat() const {
+ return _surface->format;
+}
- if (!_opened)
- return;
+int VQADecoder::VQAVideoTrack::getCurFrame() const {
+ return _curFrame;
+}
- startTick = _system->getMillis();
+int VQADecoder::VQAVideoTrack::getFrameCount() const {
+ return _frameCount;
+}
- // First, handle any sound chunk that appears before the first frame.
- // At least in some versions, it will contain half a second of audio,
- // presumably to lessen the risk of audio underflow.
- //
- // In most movies, we will find a CMDS tag. The purpose of this is
- // currently unknown.
- //
- // In cow1_0.vqa, cow1_1.vqa, jung0.vqa, and jung1.vqa we will find a
- // VQFR tag. A frame before the first frame? Weird. It doesn't seem to
- // be needed, though.
+Common::Rational VQADecoder::VQAVideoTrack::getFrameRate() const {
+ return _frameRate;
+}
- byte *inbuf, *outbuf;
- uint32 insize, outsize;
+void VQADecoder::VQAVideoTrack::setHasDirtyPalette() {
+ _dirtyPalette = true;
+}
- if (_stream) {
- while ((uint)_file->pos() < (_frameInfo[0] & 0x7FFFFFFF)) {
- uint32 tag = readTag();
- uint32 size = _file->readUint32BE();
+bool VQADecoder::VQAVideoTrack::hasDirtyPalette() const {
+ return _dirtyPalette;
+}
- if (_file->eos()) {
- warning("VQAMovie::play: Unexpected EOF");
- break;
- }
+const byte *VQADecoder::VQAVideoTrack::getPalette() const {
+ _dirtyPalette = false;
+ return _palette;
+}
- switch (tag) {
- case MKTAG('S','N','D','0'): // Uncompressed sound
- inbuf = (byte *)malloc(size);
- _file->read(inbuf, size);
- _stream->queueBuffer(inbuf, size, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
- break;
+const Graphics::Surface *VQADecoder::VQAVideoTrack::decodeNextFrame() {
+ if (_newFrame) {
+ _newFrame = false;
- case MKTAG('S','N','D','1'): // Compressed sound
- outsize = _file->readUint16LE();
- insize = _file->readUint16LE();
+ int blockPitch = _width / _blockW;
- inbuf = (byte *)malloc(insize);
- _file->read(inbuf, insize);
+ for (int by = 0; by < _height / _blockH; by++) {
+ for (int bx = 0; bx < blockPitch; bx++) {
+ byte *dst = (byte *)_surface->getBasePtr(bx * _blockW, by * _blockH);
+ int val = _vectorPointers[by * blockPitch + bx];
+ int i;
- if (insize == outsize) {
- _stream->queueBuffer(inbuf, insize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
+ if ((val & 0xFF00) == 0xFF00) {
+ // Solid color
+ for (i = 0; i < _blockH; i++) {
+ memset(dst, 255 - (val & 0xFF), _blockW);
+ dst += _width;
+ }
} else {
- outbuf = (byte *)malloc(outsize);
- decodeSND1(inbuf, insize, outbuf, outsize);
- _stream->queueBuffer(outbuf, outsize, DisposeAfterUse::YES, Audio::FLAG_UNSIGNED);
- free(inbuf);
+ // Copy data from _vectorPointers. I'm not sure
+ // why we don't use the three least significant
+ // bits of 'val'.
+ byte *src = &_codeBook[(val >> 3) * _blockW * _blockH];
+
+ for (i = 0; i < _blockH; i++) {
+ memcpy(dst, src, _blockW);
+ src += _blockW;
+ dst += _width;
+ }
}
- break;
+ }
+ }
- case MKTAG('S','N','D','2'): // Compressed sound
- warning("VQAMovie::play: `SND2' is not implemented");
- _file->seek(size, SEEK_CUR);
- break;
+ if (_numPartialCodeBooks == _cbParts) {
+ if (_compressedCodeBook) {
+ Screen::decodeFrame4(_partialCodeBook, _codeBook, _codeBookSize);
+ } else {
+ memcpy(_codeBook, _partialCodeBook, _partialCodeBookSize);
+ }
+ _numPartialCodeBooks = 0;
+ _partialCodeBookSize = 0;
+ }
+ }
- case MKTAG('C','M','D','S'): // Unused tag, always empty in kyra3
- _file->seek(size, SEEK_CUR);
- break;
+ _curFrame++;
+ return _surface;
+}
- default:
- warning("VQAMovie::play: Unknown tag `%c%c%c%c'", char((tag >> 24) & 0xFF), char((tag >> 16) & 0xFF), char((tag >> 8) & 0xFF), char(tag & 0xFF));
- _file->seek(size, SEEK_CUR);
- }
+void VQADecoder::VQAVideoTrack::handleVQFR(Common::SeekableReadStream *stream) {
+ uint32 size = stream->readUint32BE();
+ int32 end = stream->pos() + size - 8;
+ byte *inbuf;
+
+ _newFrame = true;
+
+ while (stream->pos() < end) {
+ uint32 tag = readTag(stream);
+ uint32 i;
+ size = stream->readUint32BE();
+
+ switch (tag) {
+ case MKTAG('C','B','F','0'): // Full codebook
+ stream->read(_codeBook, size);
+ break;
+ case MKTAG('C','B','F','Z'): // Full codebook
+ inbuf = (byte *)malloc(size);
+ stream->read(inbuf, size);
+ Screen::decodeFrame4(inbuf, _codeBook, _codeBookSize);
+ free(inbuf);
+ break;
+ case MKTAG('C','B','P','0'): // Partial codebook
+ _compressedCodeBook = false;
+ stream->read(_partialCodeBook + _partialCodeBookSize, size);
+ _partialCodeBookSize += size;
+ _numPartialCodeBooks++;
+ break;
+ case MKTAG('C','B','P','Z'): // Partial codebook
+ _compressedCodeBook = true;
+ stream->read(_partialCodeBook + _partialCodeBookSize, size);
+ _partialCodeBookSize += size;
+ _numPartialCodeBooks++;
+ break;
+ case MKTAG('C','P','L','0'): // Palette
+ assert(size <= 3 * 256);
+ stream->read(_palette, size);
+ break;
+ case MKTAG('C','P','L','Z'): // Palette
+ inbuf = (byte *)malloc(size);
+ stream->read(inbuf, size);
+ Screen::decodeFrame4(inbuf, _palette, 3 * 256);
+ free(inbuf);
+ break;
+ case MKTAG('V','P','T','0'): // Frame data
+ assert(size / 2 <= _numVectorPointers);
+ for (i = 0; i < size / 2; i++)
+ _vectorPointers[i] = stream->readUint16LE();
+ break;
+ case MKTAG('V','P','T','Z'): // Frame data
+ inbuf = (byte *)malloc(size);
+ stream->read(inbuf, size);
+ size = Screen::decodeFrame4(inbuf, (uint8 *)_vectorPointers, 2 * _numVectorPointers);
+ for (i = 0; i < size / 2; i++)
+ _vectorPointers[i] = TO_LE_16(_vectorPointers[i]);
+ free(inbuf);
+ break;
+ default:
+ warning("VQADecoder::VQAVideoTrack::handleVQFR(): Unknown `VQFR' sub-tag `%s'", tag2str(tag));
+ stream->seek(size, SEEK_CUR);
+ break;
}
}
+}
- _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sound, _stream);
- Common::EventManager *eventMan = _vm->getEventManager();
+// -----------------------------------------------------------------------
- for (uint i = 0; i < _header.numFrames; i++) {
- displayFrame(i);
+VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) {
+ _system = system;
+ _vm = vm;
+ _screen = _vm->screen();
+ _decoder = new VQADecoder();
+}
- // TODO: Implement frame skipping?
+VQAMovie::~VQAMovie() {
+ close();
+ delete _decoder;
+}
- while (1) {
- uint32 elapsedTime;
+bool VQAMovie::open(const char *filename) {
+ if (_file.open(filename)) {
+ return true;
+ }
+ return false;
+}
+
+void VQAMovie::close() {
+ if (_file.isOpen()) {
+ _file.close();
+ }
+}
+
+void VQAMovie::play() {
+ if (_decoder->loadStream(&_file)) {
+ Common::EventManager *eventMan = _vm->getEventManager();
+ int width = _decoder->getWidth();
+ int height = _decoder->getHeight();
+ int x = (Screen::SCREEN_W - width) / 2;
+ int y = (Screen::SCREEN_H - height) / 2;
- if (_vm->_mixer->isSoundHandleActive(_sound))
- elapsedTime = _vm->_mixer->getSoundElapsedTime(_sound);
- else
- elapsedTime = _system->getMillis() - startTick;
+ _decoder->start();
- if (elapsedTime >= (i * 1000) / _header.frameRate)
- break;
+ // Note that decoding starts at frame -1. That's because there
+ // is usually sound data before the first frame, probably to
+ // avoid sound underflow.
+ while (!_decoder->endOfVideo()) {
Common::Event event;
while (eventMan->pollEvent(event)) {
switch (event.type) {
@@ -673,23 +635,32 @@ void VQAMovie::play() {
if (event.kbd.keycode == Common::KEYCODE_ESCAPE)
return;
break;
-
case Common::EVENT_RTL:
case Common::EVENT_QUIT:
return;
-
default:
break;
}
}
+ if (_decoder->needsUpdate()) {
+ const Graphics::Surface *surface = _decoder->decodeNextFrame();
+ if (_decoder->hasDirtyPalette()) {
+ const byte *decoderPalette = _decoder->getPalette();
+ byte systemPalette[256 * 3];
+ for (int i = 0; i < ARRAYSIZE(systemPalette); i++) {
+ systemPalette[i] = (decoderPalette[i] * 0xFF) / 0x3F;
+ }
+ _system->getPaletteManager()->setPalette(systemPalette, 0, 256);
+ }
+
+ _system->copyRectToScreen((const byte *)surface->getBasePtr(0, 0), surface->pitch, x, y, width, height);
+ }
+
+ _system->updateScreen();
_system->delayMillis(10);
}
-
- _screen->updateScreen();
}
-
- // TODO: Wait for the sound to finish?
}
} // End of namespace Kyra
diff --git a/engines/kyra/vqa.h b/engines/kyra/vqa.h
index 839bf5ac48..f3890107a8 100644
--- a/engines/kyra/vqa.h
+++ b/engines/kyra/vqa.h
@@ -23,9 +23,9 @@
#ifndef KYRA_VQA_H
#define KYRA_VQA_H
-#include "common/scummsys.h"
-
-#include "audio/mixer.h"
+#include "video/video_decoder.h"
+#include "common/file.h"
+#include "common/rational.h"
class OSystem;
@@ -33,40 +33,24 @@ namespace Audio {
class QueuingAudioStream;
} // End of namespace Audio
-namespace Common {
-class SeekableReadStream;
-} // End of namespace Common
-
namespace Kyra {
class KyraEngine_v1;
class Screen;
-class VQAMovie {
+class VQADecoder : public Video::VideoDecoder {
public:
- VQAMovie(KyraEngine_v1 *vm, OSystem *system);
- ~VQAMovie();
+ VQADecoder();
+ virtual ~VQADecoder();
- bool opened() { return _opened; }
- int frames() { return _opened ? _header.numFrames : -1; }
+ bool loadStream(Common::SeekableReadStream *stream);
+ void readNextPacket();
- // It's unlikely that we ever want to change the movie position from
- // its default.
+private:
+ Common::SeekableReadStream *_fileStream;
- void setDrawPage(int page) { _drawPage = page; }
-
- bool open(const char *filename);
- void close();
- void play();
-
-protected:
- OSystem *_system;
- KyraEngine_v1 *_vm;
- Screen *_screen;
-
- bool _opened;
- int _x, _y;
- int _drawPage;
+ void handleVQHD(Common::SeekableReadStream *stream);
+ void handleFINF(Common::SeekableReadStream *stream);
struct VQAHeader {
uint16 version;
@@ -91,40 +75,85 @@ protected:
uint32 unk5;
};
- struct Buffer {
- uint8 *data;
- uint32 size;
- };
-
- Buffer _buffers[2];
-
- void initBuffers();
- void *allocBuffer(int num, uint32 size);
- void freeBuffers();
+ VQAHeader _header;
+ uint32 *_frameInfo;
- void decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsize);
+ class VQAAudioTrack : public AudioTrack {
+ public:
+ VQAAudioTrack(const VQAHeader *header);
+ ~VQAAudioTrack();
- void displayFrame(uint frameNum);
+ void handleSND0(Common::SeekableReadStream *stream);
+ void handleSND1(Common::SeekableReadStream *stream);
+ void handleSND2(Common::SeekableReadStream *stream);
- Common::SeekableReadStream *_file;
+ protected:
+ Audio::AudioStream *getAudioStream() const;
- VQAHeader _header;
- uint32 *_frameInfo;
- uint32 _codeBookSize;
- byte *_codeBook;
- byte *_partialCodeBook;
- bool _compressedCodeBook;
- int _partialCodeBookSize;
- int _numPartialCodeBooks;
- uint32 _numVectorPointers;
- uint16 *_vectorPointers;
+ private:
+ Audio::QueuingAudioStream *_audioStream;
+ };
- byte *_frame;
+ class VQAVideoTrack : public FixedRateVideoTrack {
+ public:
+ VQAVideoTrack(const VQAHeader *header);
+ ~VQAVideoTrack();
+
+ uint16 getWidth() const;
+ uint16 getHeight() const;
+ Graphics::PixelFormat getPixelFormat() const;
+ int getCurFrame() const;
+ int getFrameCount() const;
+ const Graphics::Surface *decodeNextFrame();
+
+ void setHasDirtyPalette();
+ bool hasDirtyPalette() const;
+ const byte *getPalette() const;
+
+ void handleVQFR(Common::SeekableReadStream *stream);
+
+ protected:
+ Common::Rational getFrameRate() const;
+
+ private:
+ Graphics::Surface *_surface;
+ byte _palette[3 * 256];
+ mutable bool _dirtyPalette;
+
+ bool _newFrame;
+
+ uint16 _width, _height;
+ uint8 _blockW, _blockH;
+ uint8 _cbParts;
+ int _frameCount;
+ int _curFrame;
+ byte _frameRate;
+
+ uint32 _codeBookSize;
+ bool _compressedCodeBook;
+ byte *_codeBook;
+ int _partialCodeBookSize;
+ int _numPartialCodeBooks;
+ byte *_partialCodeBook;
+ uint32 _numVectorPointers;
+ uint16 *_vectorPointers;
+ };
+};
- Audio::QueuingAudioStream *_stream;
- Audio::SoundHandle _sound;
+class VQAMovie {
+public:
+ VQAMovie(KyraEngine_v1 *vm, OSystem *system);
+ ~VQAMovie();
- uint32 readTag();
+ bool open(const char *filename);
+ void close();
+ void play();
+private:
+ OSystem *_system;
+ KyraEngine_v1 *_vm;
+ Screen *_screen;
+ VQADecoder *_decoder;
+ Common::File _file;
};
} // End of namespace Kyra
diff --git a/engines/lastexpress/configure.engine b/engines/lastexpress/configure.engine
new file mode 100644
index 0000000000..807b1a088b
--- /dev/null
+++ b/engines/lastexpress/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 lastexpress "The Last Express" no "" "" "16bit"
diff --git a/engines/lastexpress/entities/abbot.cpp b/engines/lastexpress/entities/abbot.cpp
index 406b017d3a..cdd9d8e712 100644
--- a/engines/lastexpress/entities/abbot.cpp
+++ b/engines/lastexpress/entities/abbot.cpp
@@ -57,42 +57,42 @@ Abbot::Abbot(LastExpressEngine *engine) : Entity(engine, kEntityAbbot) {
ADD_CALLBACK_FUNCTION(Abbot, chapter1);
ADD_CALLBACK_FUNCTION(Abbot, chapter2);
ADD_CALLBACK_FUNCTION(Abbot, chapter3);
- ADD_CALLBACK_FUNCTION(Abbot, chapter3Handler);
- ADD_CALLBACK_FUNCTION(Abbot, conversationWithBoutarel);
+ ADD_CALLBACK_FUNCTION(Abbot, inKitchen);
+ ADD_CALLBACK_FUNCTION(Abbot, openCompartment);
ADD_CALLBACK_FUNCTION(Abbot, readPaper);
ADD_CALLBACK_FUNCTION(Abbot, goToLunch);
ADD_CALLBACK_FUNCTION(Abbot, haveLunch);
- ADD_CALLBACK_FUNCTION(Abbot, function23);
- ADD_CALLBACK_FUNCTION(Abbot, function24);
- ADD_CALLBACK_FUNCTION(Abbot, function25);
- ADD_CALLBACK_FUNCTION(Abbot, function26);
- ADD_CALLBACK_FUNCTION(Abbot, function27);
- ADD_CALLBACK_FUNCTION(Abbot, function28);
- ADD_CALLBACK_FUNCTION(Abbot, function29);
- ADD_CALLBACK_FUNCTION(Abbot, function30);
- ADD_CALLBACK_FUNCTION(Abbot, function31);
- ADD_CALLBACK_FUNCTION(Abbot, function32);
- ADD_CALLBACK_FUNCTION(Abbot, function33);
- ADD_CALLBACK_FUNCTION(Abbot, function34);
- ADD_CALLBACK_FUNCTION(Abbot, function35);
- ADD_CALLBACK_FUNCTION(Abbot, function36);
- ADD_CALLBACK_FUNCTION(Abbot, function37);
- ADD_CALLBACK_FUNCTION(Abbot, function38);
+ ADD_CALLBACK_FUNCTION(Abbot, leaveLunch);
+ ADD_CALLBACK_FUNCTION(Abbot, closedCompartment);
+ ADD_CALLBACK_FUNCTION(Abbot, goSalon1);
+ ADD_CALLBACK_FUNCTION(Abbot, inSalon1);
+ ADD_CALLBACK_FUNCTION(Abbot, goCompartment);
+ ADD_CALLBACK_FUNCTION(Abbot, openCompartment2);
+ ADD_CALLBACK_FUNCTION(Abbot, goWander);
+ ADD_CALLBACK_FUNCTION(Abbot, goSalon2);
+ ADD_CALLBACK_FUNCTION(Abbot, inSalon2);
+ ADD_CALLBACK_FUNCTION(Abbot, goCompartment3);
+ ADD_CALLBACK_FUNCTION(Abbot, openCompartment3);
+ ADD_CALLBACK_FUNCTION(Abbot, goSalon3);
+ ADD_CALLBACK_FUNCTION(Abbot, inSalon3);
+ ADD_CALLBACK_FUNCTION(Abbot, withAugust);
+ ADD_CALLBACK_FUNCTION(Abbot, goCompartment4);
+ ADD_CALLBACK_FUNCTION(Abbot, inCompartment4);
ADD_CALLBACK_FUNCTION(Abbot, chapter4);
- ADD_CALLBACK_FUNCTION(Abbot, function40);
+ ADD_CALLBACK_FUNCTION(Abbot, doWalkSearchingForCath);
ADD_CALLBACK_FUNCTION(Abbot, chapter4Handler);
- ADD_CALLBACK_FUNCTION(Abbot, function42);
- ADD_CALLBACK_FUNCTION(Abbot, function43);
+ ADD_CALLBACK_FUNCTION(Abbot, leaveDinner);
+ ADD_CALLBACK_FUNCTION(Abbot, inCompartment);
ADD_CALLBACK_FUNCTION(Abbot, function44);
- ADD_CALLBACK_FUNCTION(Abbot, function45);
- ADD_CALLBACK_FUNCTION(Abbot, function46);
- ADD_CALLBACK_FUNCTION(Abbot, drinkAfterDefuse);
- ADD_CALLBACK_FUNCTION(Abbot, function48);
- ADD_CALLBACK_FUNCTION(Abbot, pickBomb);
+ ADD_CALLBACK_FUNCTION(Abbot, conferring);
+ ADD_CALLBACK_FUNCTION(Abbot, goSalon4);
+ ADD_CALLBACK_FUNCTION(Abbot, beforeBomb);
+ ADD_CALLBACK_FUNCTION(Abbot, afterBomb);
+ ADD_CALLBACK_FUNCTION(Abbot, catchCath);
ADD_CALLBACK_FUNCTION(Abbot, chapter5);
ADD_CALLBACK_FUNCTION(Abbot, chapter5Handler);
ADD_CALLBACK_FUNCTION(Abbot, function52);
- ADD_CALLBACK_FUNCTION(Abbot, function53);
+ ADD_CALLBACK_FUNCTION(Abbot, runningTrain);
}
//////////////////////////////////////////////////////////////////////////
@@ -196,7 +196,7 @@ IMPLEMENT_FUNCTION(17, Abbot, chapter3)
break;
case kActionNone:
- setup_chapter3Handler();
+ setup_inKitchen();
break;
case kActionDefault:
@@ -213,7 +213,7 @@ IMPLEMENT_FUNCTION(17, Abbot, chapter3)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(18, Abbot, chapter3Handler)
+IMPLEMENT_FUNCTION(18, Abbot, inKitchen)
switch (savepoint.action) {
default:
break;
@@ -259,7 +259,7 @@ IMPLEMENT_FUNCTION(18, Abbot, chapter3Handler)
getData()->entityPosition = kPosition_6470;
getData()->location = kLocationInsideCompartment;
- setup_conversationWithBoutarel();
+ setup_openCompartment();
break;
}
break;
@@ -272,7 +272,7 @@ IMPLEMENT_FUNCTION(18, Abbot, chapter3Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(19, Abbot, conversationWithBoutarel)
+IMPLEMENT_FUNCTION(19, Abbot, openCompartment)
switch (savepoint.action) {
default:
break;
@@ -419,7 +419,7 @@ IMPLEMENT_FUNCTION(22, Abbot, haveLunch)
if (getState()->time > kTime1989000 && getEntities()->isSomebodyInsideRestaurantOrSalon()) {
getData()->inventoryItem = kItemNone;
- setup_function23();
+ setup_leaveLunch();
}
break;
@@ -456,7 +456,7 @@ IMPLEMENT_FUNCTION(22, Abbot, haveLunch)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(23, Abbot, function23)
+IMPLEMENT_FUNCTION(23, Abbot, leaveLunch)
switch (savepoint.action) {
default:
break;
@@ -500,7 +500,7 @@ IMPLEMENT_FUNCTION(23, Abbot, function23)
case 4:
getData()->location = kLocationInsideCompartment;
- setup_function24();
+ setup_closedCompartment();
break;
}
break;
@@ -508,7 +508,7 @@ IMPLEMENT_FUNCTION(23, Abbot, function23)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(24, Abbot, function24)
+IMPLEMENT_FUNCTION(24, Abbot, closedCompartment)
switch (savepoint.action) {
default:
break;
@@ -517,7 +517,7 @@ IMPLEMENT_FUNCTION(24, Abbot, function24)
if (!Entity::updateParameter(params->param1, getState()->time, 900))
break;
- setup_function25();
+ setup_goSalon1();
break;
case kActionKnock:
@@ -561,7 +561,7 @@ IMPLEMENT_FUNCTION(24, Abbot, function24)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(25, Abbot, function25)
+IMPLEMENT_FUNCTION(25, Abbot, goSalon1)
switch (savepoint.action) {
default:
break;
@@ -602,7 +602,7 @@ IMPLEMENT_FUNCTION(25, Abbot, function25)
getData()->location = kLocationInsideCompartment;
getScenes()->loadSceneFromItemPosition(kItem3);
- setup_function26();
+ setup_inSalon1();
break;
}
break;
@@ -610,7 +610,7 @@ IMPLEMENT_FUNCTION(25, Abbot, function25)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(26, Abbot, function26)
+IMPLEMENT_FUNCTION(26, Abbot, inSalon1)
switch (savepoint.action) {
default:
break;
@@ -620,7 +620,7 @@ IMPLEMENT_FUNCTION(26, Abbot, function26)
break;
if (getEntities()->isSomebodyInsideRestaurantOrSalon())
- setup_function27();
+ setup_goCompartment();
break;
case kActionDefault:
@@ -636,7 +636,7 @@ IMPLEMENT_FUNCTION(26, Abbot, function26)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(27, Abbot, function27)
+IMPLEMENT_FUNCTION(27, Abbot, goCompartment)
switch (savepoint.action) {
default:
break;
@@ -677,7 +677,7 @@ IMPLEMENT_FUNCTION(27, Abbot, function27)
getData()->entityPosition = kPosition_6470;
getData()->location = kLocationInsideCompartment;
- setup_function28();
+ setup_openCompartment2();
break;
}
break;
@@ -685,13 +685,13 @@ IMPLEMENT_FUNCTION(27, Abbot, function27)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(28, Abbot, function28)
+IMPLEMENT_FUNCTION(28, Abbot, openCompartment2)
switch (savepoint.action) {
default:
break;
case kActionNone:
- Entity::timeCheckCallback(kTime2052000, params->param1, 1, WRAP_SETUP_FUNCTION(Abbot, setup_function29));
+ Entity::timeCheckCallback(kTime2052000, params->param1, 1, WRAP_SETUP_FUNCTION(Abbot, setup_goWander));
break;
case kActionDefault:
@@ -708,12 +708,12 @@ IMPLEMENT_FUNCTION(28, Abbot, function28)
break;
case kAction222609266:
- setup_function30();
+ setup_goSalon2();
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(29, Abbot, function29)
+IMPLEMENT_FUNCTION(29, Abbot, goWander)
switch (savepoint.action) {
default:
break;
@@ -778,7 +778,7 @@ IMPLEMENT_FUNCTION(29, Abbot, function29)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(30, Abbot, function30)
+IMPLEMENT_FUNCTION(30, Abbot, goSalon2)
switch (savepoint.action) {
default:
break;
@@ -826,7 +826,7 @@ switch (savepoint.action) {
getScenes()->loadSceneFromItemPosition(kItem3);
getData()->location = kLocationInsideCompartment;
- setup_function31();
+ setup_inSalon2();
break;
}
break;
@@ -834,7 +834,7 @@ switch (savepoint.action) {
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(31, Abbot, function31)
+IMPLEMENT_FUNCTION(31, Abbot, inSalon2)
switch (savepoint.action) {
default:
break;
@@ -936,7 +936,7 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
break;
case 7:
- setup_function32();
+ setup_goCompartment3();
break;
}
break;
@@ -944,7 +944,7 @@ IMPLEMENT_FUNCTION(31, Abbot, function31)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(32, Abbot, function32)
+IMPLEMENT_FUNCTION(32, Abbot, goCompartment3)
switch (savepoint.action) {
default:
break;
@@ -972,7 +972,7 @@ IMPLEMENT_FUNCTION(32, Abbot, function32)
getData()->location = kLocationInsideCompartment;
getSavePoints()->push(kEntityAbbot, kEntityBoutarel, kAction122358304);
- setup_function33();
+ setup_openCompartment3();
break;
}
break;
@@ -980,7 +980,7 @@ IMPLEMENT_FUNCTION(32, Abbot, function32)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(33, Abbot, function33)
+IMPLEMENT_FUNCTION(33, Abbot, openCompartment3)
switch (savepoint.action) {
default:
break;
@@ -1012,13 +1012,13 @@ IMPLEMENT_FUNCTION(33, Abbot, function33)
break;
case kAction123712592:
- setup_function34();
+ setup_goSalon3();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(34, Abbot, function34)
+IMPLEMENT_FUNCTION(34, Abbot, goSalon3)
switch (savepoint.action) {
default:
break;
@@ -1066,7 +1066,7 @@ IMPLEMENT_FUNCTION(34, Abbot, function34)
getScenes()->loadSceneFromItemPosition(kItem3);
getData()->location = kLocationInsideCompartment;
- setup_function35();
+ setup_inSalon3();
break;
}
break;
@@ -1074,7 +1074,7 @@ IMPLEMENT_FUNCTION(34, Abbot, function34)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(35, Abbot, function35)
+IMPLEMENT_FUNCTION(35, Abbot, inSalon3)
switch (savepoint.action) {
default:
break;
@@ -1128,7 +1128,7 @@ IMPLEMENT_FUNCTION(35, Abbot, function35)
getInventory()->setLocationAndProcess(kItem3, kObjectLocation1);
getData()->location = kLocationInsideCompartment;
- setup_function36();
+ setup_withAugust();
break;
}
break;
@@ -1136,7 +1136,7 @@ IMPLEMENT_FUNCTION(35, Abbot, function35)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(36, Abbot, function36)
+IMPLEMENT_FUNCTION(36, Abbot, withAugust)
switch (savepoint.action) {
default:
break;
@@ -1198,14 +1198,14 @@ IMPLEMENT_FUNCTION(36, Abbot, function36)
case kActionCallback:
if (getCallback() == 1) {
getEntities()->updatePositionExit(kEntityAbbot, kCarRestaurant, 57);
- setup_function37();
+ setup_goCompartment4();
}
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(37, Abbot, function37)
+IMPLEMENT_FUNCTION(37, Abbot, goCompartment4)
switch (savepoint.action) {
default:
break;
@@ -1233,7 +1233,7 @@ IMPLEMENT_FUNCTION(37, Abbot, function37)
getData()->location = kLocationInsideCompartment;
getSavePoints()->push(kEntityAbbot, kEntityBoutarel, kAction122358304);
- setup_function38();
+ setup_inCompartment4();
break;
}
break;
@@ -1241,7 +1241,7 @@ IMPLEMENT_FUNCTION(37, Abbot, function37)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(38, Abbot, function38)
+IMPLEMENT_FUNCTION(38, Abbot, inCompartment4)
switch (savepoint.action) {
default:
break;
@@ -1283,7 +1283,7 @@ IMPLEMENT_FUNCTION(39, Abbot, chapter4)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_II(40, Abbot, function40, CarIndex, EntityPosition)
+IMPLEMENT_FUNCTION_II(40, Abbot, doWalkSearchingForCath, CarIndex, EntityPosition)
switch (savepoint.action) {
default:
break;
@@ -1327,7 +1327,7 @@ IMPLEMENT_FUNCTION(41, Abbot, chapter4Handler)
Entity::timeCheckSavepoint(kTime2358000, params->param1, kEntityAbbot, kEntityServers0, kAction218128129);
if (getState()->time > kTime2389500 && getEntities()->isSomebodyInsideRestaurantOrSalon())
- setup_function42();
+ setup_leaveDinner();
break;
@@ -1348,7 +1348,7 @@ IMPLEMENT_FUNCTION(41, Abbot, chapter4Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(42, Abbot, function42)
+IMPLEMENT_FUNCTION(42, Abbot, leaveDinner)
switch (savepoint.action) {
default:
break;
@@ -1392,7 +1392,7 @@ IMPLEMENT_FUNCTION(42, Abbot, function42)
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityAbbot);
- setup_function43();
+ setup_inCompartment();
break;
}
break;
@@ -1400,7 +1400,7 @@ IMPLEMENT_FUNCTION(42, Abbot, function42)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(43, Abbot, function43)
+IMPLEMENT_FUNCTION(43, Abbot, inCompartment)
switch (savepoint.action) {
default:
break;
@@ -1531,13 +1531,13 @@ IMPLEMENT_FUNCTION(44, Abbot, function44)
break;
case kAction104060776:
- setup_function45();
+ setup_conferring();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(45, Abbot, function45)
+IMPLEMENT_FUNCTION(45, Abbot, conferring)
switch (savepoint.action) {
default:
break;
@@ -1570,7 +1570,7 @@ IMPLEMENT_FUNCTION(45, Abbot, function45)
getEntities()->exitCompartment(kEntityAbbot, kObjectCompartmentC, true);
getSavePoints()->push(kEntityAbbot, kEntityVerges, kAction125233040);
- setup_function46();
+ setup_goSalon4();
break;
}
break;
@@ -1578,7 +1578,7 @@ IMPLEMENT_FUNCTION(45, Abbot, function45)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(46, Abbot, function46)
+IMPLEMENT_FUNCTION(46, Abbot, goSalon4)
switch (savepoint.action) {
default:
break;
@@ -1587,18 +1587,18 @@ IMPLEMENT_FUNCTION(46, Abbot, function46)
getData()->entityPosition = kPosition_6471;
setCallback(1);
- setup_function40(kCarRestaurant, kPosition_850);
+ setup_doWalkSearchingForCath(kCarRestaurant, kPosition_850);
break;
case kActionCallback:
if (getCallback() == 1)
- setup_drinkAfterDefuse();
+ setup_beforeBomb();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(47, Abbot, drinkAfterDefuse)
+IMPLEMENT_FUNCTION(47, Abbot, beforeBomb)
switch (savepoint.action) {
default:
break;
@@ -1642,7 +1642,7 @@ IMPLEMENT_FUNCTION(47, Abbot, drinkAfterDefuse)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(48, Abbot, function48)
+IMPLEMENT_FUNCTION(48, Abbot, afterBomb)
switch (savepoint.action) {
default:
break;
@@ -1749,7 +1749,7 @@ IMPLEMENT_FUNCTION(48, Abbot, function48)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(49, Abbot, pickBomb)
+IMPLEMENT_FUNCTION(49, Abbot, catchCath)
switch (savepoint.action) {
default:
break;
@@ -1791,7 +1791,7 @@ IMPLEMENT_FUNCTION(49, Abbot, pickBomb)
break;
case 1:
- getAction()->playAnimation(getObjects()->get(kObjectCompartment2).location2 < kObjectLocation2 ? kEventAbbotWrongCompartmentBed : kEventAbbotWrongCompartment);
+ getAction()->playAnimation(getObjects()->get(kObjectCompartment2).model < kObjectModel2 ? kEventAbbotWrongCompartmentBed : kEventAbbotWrongCompartment);
getEntities()->updateEntity(kEntityAbbot, kCarRedSleeping, kPosition_6470);
getSound()->playSound(kEntityPlayer, "LIB015");
getScenes()->loadSceneFromObject(kObjectCompartment2, true);
@@ -1810,7 +1810,7 @@ IMPLEMENT_FUNCTION(49, Abbot, pickBomb)
getEntities()->clearSequences(kEntityAbbot);
getObjects()->update(kObjectCompartmentC, kEntityAbbot, kObjectLocation1, kCursorHandKnock, kCursorHand);
- setup_function43();
+ setup_inCompartment();
break;
}
break;
@@ -1860,13 +1860,13 @@ IMPLEMENT_FUNCTION(52, Abbot, function52)
break;
case kAction135600432:
- setup_function53();
+ setup_runningTrain();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(53, Abbot, function53)
+IMPLEMENT_FUNCTION(53, Abbot, runningTrain)
switch (savepoint.action) {
default:
break;
diff --git a/engines/lastexpress/entities/abbot.h b/engines/lastexpress/entities/abbot.h
index dc3e86db54..ba993fdbc9 100644
--- a/engines/lastexpress/entities/abbot.h
+++ b/engines/lastexpress/entities/abbot.h
@@ -155,27 +155,27 @@ public:
/**
* Handle Chapter 3 events
*/
- DECLARE_FUNCTION(chapter3Handler)
- DECLARE_FUNCTION(conversationWithBoutarel)
+ DECLARE_FUNCTION(inKitchen)
+ DECLARE_FUNCTION(openCompartment)
DECLARE_FUNCTION(readPaper)
DECLARE_FUNCTION(goToLunch)
DECLARE_FUNCTION(haveLunch)
- DECLARE_FUNCTION(function23)
- DECLARE_FUNCTION(function24)
- DECLARE_FUNCTION(function25)
- DECLARE_FUNCTION(function26)
- DECLARE_FUNCTION(function27)
- DECLARE_FUNCTION(function28)
- DECLARE_FUNCTION(function29)
- DECLARE_FUNCTION(function30)
- DECLARE_FUNCTION(function31)
- DECLARE_FUNCTION(function32)
- DECLARE_FUNCTION(function33)
- DECLARE_FUNCTION(function34)
- DECLARE_FUNCTION(function35)
- DECLARE_FUNCTION(function36)
- DECLARE_FUNCTION(function37)
- DECLARE_FUNCTION(function38)
+ DECLARE_FUNCTION(leaveLunch)
+ DECLARE_FUNCTION(closedCompartment)
+ DECLARE_FUNCTION(goSalon1)
+ DECLARE_FUNCTION(inSalon1)
+ DECLARE_FUNCTION(goCompartment)
+ DECLARE_FUNCTION(openCompartment2)
+ DECLARE_FUNCTION(goWander)
+ DECLARE_FUNCTION(goSalon2)
+ DECLARE_FUNCTION(inSalon2)
+ DECLARE_FUNCTION(goCompartment3)
+ DECLARE_FUNCTION(openCompartment3)
+ DECLARE_FUNCTION(goSalon3)
+ DECLARE_FUNCTION(inSalon3)
+ DECLARE_FUNCTION(withAugust)
+ DECLARE_FUNCTION(goCompartment4)
+ DECLARE_FUNCTION(inCompartment4)
/**
* Setup Chapter 4
@@ -183,25 +183,25 @@ public:
DECLARE_FUNCTION(chapter4)
/**
- * ???
+ * Search Cath by walking around
*
* @param car The car
* @param entityPosition The entity position
*/
- DECLARE_FUNCTION_2(function40, CarIndex car, EntityPosition position)
+ DECLARE_FUNCTION_2(doWalkSearchingForCath, CarIndex car, EntityPosition position)
/**
* Handle Chapter 4 events
*/
DECLARE_FUNCTION(chapter4Handler)
- DECLARE_FUNCTION(function42)
- DECLARE_FUNCTION(function43)
+ DECLARE_FUNCTION(leaveDinner)
+ DECLARE_FUNCTION(inCompartment)
DECLARE_FUNCTION(function44)
- DECLARE_FUNCTION(function45)
- DECLARE_FUNCTION(function46)
- DECLARE_FUNCTION(drinkAfterDefuse)
- DECLARE_FUNCTION(function48)
- DECLARE_FUNCTION(pickBomb)
+ DECLARE_FUNCTION(conferring)
+ DECLARE_FUNCTION(goSalon4)
+ DECLARE_FUNCTION(beforeBomb)
+ DECLARE_FUNCTION(afterBomb)
+ DECLARE_FUNCTION(catchCath)
/**
* Setup Chapter 5
@@ -213,7 +213,7 @@ public:
*/
DECLARE_FUNCTION(chapter5Handler)
DECLARE_FUNCTION(function52)
- DECLARE_FUNCTION(function53)
+ DECLARE_FUNCTION(runningTrain)
};
} // End of namespace LastExpress
diff --git a/engines/lastexpress/entities/alexei.cpp b/engines/lastexpress/entities/alexei.cpp
index 115c890f6f..b8ae62e7c4 100644
--- a/engines/lastexpress/entities/alexei.cpp
+++ b/engines/lastexpress/entities/alexei.cpp
@@ -48,40 +48,40 @@ Alexei::Alexei(LastExpressEngine *engine) : Entity(engine, kEntityAlexei) {
ADD_CALLBACK_FUNCTION(Alexei, updateEntity);
ADD_CALLBACK_FUNCTION(Alexei, draw2);
ADD_CALLBACK_FUNCTION(Alexei, callbackActionRestaurantOrSalon);
- ADD_CALLBACK_FUNCTION(Alexei, function13);
- ADD_CALLBACK_FUNCTION(Alexei, function14);
- ADD_CALLBACK_FUNCTION(Alexei, function15);
- ADD_CALLBACK_FUNCTION(Alexei, function16);
+ ADD_CALLBACK_FUNCTION(Alexei, enterComparment);
+ ADD_CALLBACK_FUNCTION(Alexei, exitCompartment);
+ ADD_CALLBACK_FUNCTION(Alexei, pacingAtWindow);
+ ADD_CALLBACK_FUNCTION(Alexei, compartmentLogic);
ADD_CALLBACK_FUNCTION(Alexei, chapter1);
- ADD_CALLBACK_FUNCTION(Alexei, chapter1Handler);
- ADD_CALLBACK_FUNCTION(Alexei, function19);
- ADD_CALLBACK_FUNCTION(Alexei, function20);
- ADD_CALLBACK_FUNCTION(Alexei, function21);
- ADD_CALLBACK_FUNCTION(Alexei, function22);
- ADD_CALLBACK_FUNCTION(Alexei, function23);
- ADD_CALLBACK_FUNCTION(Alexei, function24);
- ADD_CALLBACK_FUNCTION(Alexei, function25);
+ ADD_CALLBACK_FUNCTION(Alexei, atDinner);
+ ADD_CALLBACK_FUNCTION(Alexei, returnCompartment);
+ ADD_CALLBACK_FUNCTION(Alexei, goSalon);
+ ADD_CALLBACK_FUNCTION(Alexei, sitting);
+ ADD_CALLBACK_FUNCTION(Alexei, standingAtWindow);
+ ADD_CALLBACK_FUNCTION(Alexei, waitingForTatiana);
+ ADD_CALLBACK_FUNCTION(Alexei, upset);
+ ADD_CALLBACK_FUNCTION(Alexei, returnCompartmentNight);
ADD_CALLBACK_FUNCTION(Alexei, function26);
ADD_CALLBACK_FUNCTION(Alexei, function27);
ADD_CALLBACK_FUNCTION(Alexei, chapter2);
- ADD_CALLBACK_FUNCTION(Alexei, chapter2Handler);
- ADD_CALLBACK_FUNCTION(Alexei, function30);
- ADD_CALLBACK_FUNCTION(Alexei, function31);
+ ADD_CALLBACK_FUNCTION(Alexei, inCompartment2);
+ ADD_CALLBACK_FUNCTION(Alexei, atBreakfast);
+ ADD_CALLBACK_FUNCTION(Alexei, returnCompartment2);
ADD_CALLBACK_FUNCTION(Alexei, chapter3);
- ADD_CALLBACK_FUNCTION(Alexei, chapter3Handler);
- ADD_CALLBACK_FUNCTION(Alexei, function34);
- ADD_CALLBACK_FUNCTION(Alexei, function35);
- ADD_CALLBACK_FUNCTION(Alexei, function36);
+ ADD_CALLBACK_FUNCTION(Alexei, playingChess);
+ ADD_CALLBACK_FUNCTION(Alexei, inPart3);
+ ADD_CALLBACK_FUNCTION(Alexei, pacing3);
+ ADD_CALLBACK_FUNCTION(Alexei, goSalon3);
ADD_CALLBACK_FUNCTION(Alexei, chapter4);
- ADD_CALLBACK_FUNCTION(Alexei, chapter4Handler);
- ADD_CALLBACK_FUNCTION(Alexei, function39);
- ADD_CALLBACK_FUNCTION(Alexei, function40);
- ADD_CALLBACK_FUNCTION(Alexei, function41);
- ADD_CALLBACK_FUNCTION(Alexei, function42);
- ADD_CALLBACK_FUNCTION(Alexei, function43);
- ADD_CALLBACK_FUNCTION(Alexei, function44);
- ADD_CALLBACK_FUNCTION(Alexei, function45);
- ADD_CALLBACK_FUNCTION(Alexei, function46);
+ ADD_CALLBACK_FUNCTION(Alexei, inCompartment4);
+ ADD_CALLBACK_FUNCTION(Alexei, meetTatiana);
+ ADD_CALLBACK_FUNCTION(Alexei, leavePlatform);
+ ADD_CALLBACK_FUNCTION(Alexei, inCompartmentAgain);
+ ADD_CALLBACK_FUNCTION(Alexei, goSalon4);
+ ADD_CALLBACK_FUNCTION(Alexei, pacing);
+ ADD_CALLBACK_FUNCTION(Alexei, goToPlatform);
+ ADD_CALLBACK_FUNCTION(Alexei, returnCompartment4);
+ ADD_CALLBACK_FUNCTION(Alexei, bombPlanB);
ADD_CALLBACK_FUNCTION(Alexei, function47);
ADD_CALLBACK_FUNCTION(Alexei, chapter5);
}
@@ -169,7 +169,7 @@ IMPLEMENT_FUNCTION(12, Alexei, callbackActionRestaurantOrSalon)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(13, Alexei, function13)
+IMPLEMENT_FUNCTION(13, Alexei, enterComparment)
switch (savepoint.action) {
default:
break;
@@ -216,7 +216,7 @@ IMPLEMENT_FUNCTION(13, Alexei, function13)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(14, Alexei, function14)
+IMPLEMENT_FUNCTION(14, Alexei, exitCompartment)
switch (savepoint.action) {
default:
break;
@@ -245,7 +245,7 @@ IMPLEMENT_FUNCTION(14, Alexei, function14)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(15, Alexei, function15)
+IMPLEMENT_FUNCTION(15, Alexei, pacingAtWindow)
switch (savepoint.action) {
default:
break;
@@ -297,7 +297,7 @@ IMPLEMENT_FUNCTION(15, Alexei, function15)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_IS(16, Alexei, function16, TimeValue)
+IMPLEMENT_FUNCTION_IS(16, Alexei, compartmentLogic, TimeValue)
switch (savepoint.action) {
default:
break;
@@ -446,7 +446,7 @@ IMPLEMENT_FUNCTION(17, Alexei, chapter1)
break;
case kActionNone:
- Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Alexei, setup_chapter1Handler));
+ Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Alexei, setup_atDinner));
break;
case kActionDefault:
@@ -462,7 +462,7 @@ IMPLEMENT_FUNCTION(17, Alexei, chapter1)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(18, Alexei, chapter1Handler)
+IMPLEMENT_FUNCTION(18, Alexei, atDinner)
switch (savepoint.action) {
default:
break;
@@ -519,7 +519,7 @@ IMPLEMENT_FUNCTION(18, Alexei, chapter1Handler)
case 1:
getEntities()->updatePositionExit(kEntityAlexei, kCarRestaurant, 63);
- setup_function19();
+ setup_returnCompartment();
break;
case 2:
@@ -533,7 +533,7 @@ IMPLEMENT_FUNCTION(18, Alexei, chapter1Handler)
getInventory()->get(kItem17)->location = kObjectLocation1;
getScenes()->loadSceneFromPosition(kCarRestaurant, 63);
- setup_function19();
+ setup_returnCompartment();
break;
}
break;
@@ -553,7 +553,7 @@ IMPLEMENT_FUNCTION(18, Alexei, chapter1Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(19, Alexei, function19)
+IMPLEMENT_FUNCTION(19, Alexei, returnCompartment)
switch (savepoint.action) {
default:
break;
@@ -620,7 +620,7 @@ IMPLEMENT_FUNCTION(19, Alexei, function19)
case 9:
setCallback(10);
- setup_function13();
+ setup_enterComparment();
break;
case 10:
@@ -628,11 +628,11 @@ IMPLEMENT_FUNCTION(19, Alexei, function19)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(11);
- setup_function16(kTime1098000, "411");
+ setup_compartmentLogic(kTime1098000, "411");
break;
case 11:
- setup_function20();
+ setup_goSalon();
break;
}
break;
@@ -640,14 +640,14 @@ IMPLEMENT_FUNCTION(19, Alexei, function19)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(20, Alexei, function20)
+IMPLEMENT_FUNCTION(20, Alexei, goSalon)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function14();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -683,7 +683,7 @@ IMPLEMENT_FUNCTION(20, Alexei, function20)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(21, Alexei, function21)
+IMPLEMENT_FUNCTION(21, Alexei, sitting)
switch (savepoint.action) {
default:
break;
@@ -720,7 +720,7 @@ IMPLEMENT_FUNCTION(21, Alexei, function21)
case 1:
getData()->location = kLocationInsideCompartment;
- setup_function22();
+ setup_standingAtWindow();
break;
case 2:
@@ -745,7 +745,7 @@ IMPLEMENT_FUNCTION(21, Alexei, function21)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(22, Alexei, function22)
+IMPLEMENT_FUNCTION(22, Alexei, standingAtWindow)
switch (savepoint.action) {
default:
break;
@@ -779,7 +779,7 @@ IMPLEMENT_FUNCTION(22, Alexei, function22)
getData()->inventoryItem = kItemNone;
- setup_function23();
+ setup_waitingForTatiana();
break;
case kAction1:
@@ -801,7 +801,7 @@ IMPLEMENT_FUNCTION(22, Alexei, function22)
case 1:
getData()->location = kLocationInsideCompartment;
- setup_function21();
+ setup_sitting();
break;
case 2:
@@ -821,7 +821,7 @@ IMPLEMENT_FUNCTION(22, Alexei, function22)
getEntities()->updatePositionExit(kEntityAlexei, kCarRestaurant, 52);
getData()->location = kLocationInsideCompartment;
- setup_function21();
+ setup_standingAtWindow();
break;
}
break;
@@ -829,7 +829,7 @@ IMPLEMENT_FUNCTION(22, Alexei, function22)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(23, Alexei, function23)
+IMPLEMENT_FUNCTION(23, Alexei, waitingForTatiana)
switch (savepoint.action) {
default:
break;
@@ -861,7 +861,7 @@ IMPLEMENT_FUNCTION(23, Alexei, function23)
getEntities()->drawSequenceLeft(kEntityAlexei, "103F");
getScenes()->processScene();
- setup_function24();
+ setup_upset();
break;
case 2:
@@ -879,18 +879,18 @@ IMPLEMENT_FUNCTION(23, Alexei, function23)
setCallback(1);
setup_savegame(kSavegameTypeEvent, kEventAlexeiSalonVassili);
} else {
- setup_function24();
+ setup_upset();
}
break;
case kAction188784532:
- setup_function24();
+ setup_upset();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(24, Alexei, function24)
+IMPLEMENT_FUNCTION(24, Alexei, upset)
switch (savepoint.action) {
default:
break;
@@ -917,11 +917,11 @@ IMPLEMENT_FUNCTION(24, Alexei, function24)
getData()->entityPosition = kPosition_9460;
getEntities()->clearSequences(kEntityAlexei);
getScenes()->loadSceneFromPosition(kCarRestaurant, 55);
- setup_function25();
+ setup_returnCompartmentNight();
break;
case 2:
- setup_function25();
+ setup_returnCompartmentNight();
break;
}
break;
@@ -935,14 +935,14 @@ IMPLEMENT_FUNCTION(24, Alexei, function24)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(25, Alexei, function25)
+IMPLEMENT_FUNCTION(25, Alexei, returnCompartmentNight)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function13();
+ setup_enterComparment();
break;
case kActionCallback:
@@ -955,12 +955,12 @@ IMPLEMENT_FUNCTION(25, Alexei, function25)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(2);
- setup_function16(kTime1179000, "411");
+ setup_compartmentLogic(kTime1179000, "411");
break;
case 2:
setCallback(3);
- setup_function16(kTime1323000, "412");
+ setup_compartmentLogic(kTime1323000, "412");
break;
case 3:
@@ -1017,7 +1017,7 @@ IMPLEMENT_FUNCTION(28, Alexei, chapter2)
break;
case kActionNone:
- setup_chapter2Handler();
+ setup_inCompartment2();
break;
case kActionDefault:
@@ -1037,14 +1037,14 @@ IMPLEMENT_FUNCTION(28, Alexei, chapter2)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(29, Alexei, chapter2Handler)
+IMPLEMENT_FUNCTION(29, Alexei, inCompartment2)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function16(kTime1791000, "411");
+ setup_compartmentLogic(kTime1791000, "411");
break;
case kActionCallback:
@@ -1054,7 +1054,7 @@ IMPLEMENT_FUNCTION(29, Alexei, chapter2Handler)
case 1:
setCallback(2);
- setup_function14();
+ setup_exitCompartment();
break;
case 2:
@@ -1085,7 +1085,7 @@ IMPLEMENT_FUNCTION(29, Alexei, chapter2Handler)
case 6:
getEntities()->updatePositionExit(kEntityAlexei, kCarRestaurant, 63);
getSavePoints()->push(kEntityAlexei, kEntityTatiana, kAction290869168);
- setup_function30();
+ setup_atBreakfast();
break;
}
break;
@@ -1093,7 +1093,7 @@ IMPLEMENT_FUNCTION(29, Alexei, chapter2Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(30, Alexei, function30)
+IMPLEMENT_FUNCTION(30, Alexei, atBreakfast)
switch (savepoint.action) {
default:
break;
@@ -1134,7 +1134,7 @@ IMPLEMENT_FUNCTION(30, Alexei, function30)
case 3:
getEntities()->updatePositionExit(kEntityAlexei, kCarRestaurant, 63);
- setup_function31();
+ setup_returnCompartment2();
break;
}
break;
@@ -1154,7 +1154,7 @@ IMPLEMENT_FUNCTION(30, Alexei, function30)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(31, Alexei, function31)
+IMPLEMENT_FUNCTION(31, Alexei, returnCompartment2)
switch (savepoint.action) {
default:
break;
@@ -1175,7 +1175,7 @@ IMPLEMENT_FUNCTION(31, Alexei, function31)
case 1:
setCallback(2);
- setup_function13();
+ setup_enterComparment();
break;
case 2:
@@ -1183,7 +1183,7 @@ IMPLEMENT_FUNCTION(31, Alexei, function31)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(3);
- setup_function16(kTimeEnd, "411");
+ setup_compartmentLogic(kTimeEnd, "411");
break;
}
break;
@@ -1197,7 +1197,7 @@ IMPLEMENT_FUNCTION(32, Alexei, chapter3)
break;
case kActionNone:
- setup_chapter3Handler();
+ setup_playingChess();
break;
case kActionDefault:
@@ -1216,14 +1216,14 @@ IMPLEMENT_FUNCTION(32, Alexei, chapter3)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(33, Alexei, chapter3Handler)
+IMPLEMENT_FUNCTION(33, Alexei, playingChess)
switch (savepoint.action) {
default:
break;
case kActionCallback:
if (getCallback() == 1)
- setup_function34();
+ setup_inPart3();
break;
case kAction122288808:
@@ -1232,7 +1232,7 @@ IMPLEMENT_FUNCTION(33, Alexei, chapter3Handler)
getData()->car = kCarRedSleeping;
setCallback(1);
- setup_function13();
+ setup_enterComparment();
break;
case kAction122358304:
@@ -1242,7 +1242,7 @@ IMPLEMENT_FUNCTION(33, Alexei, chapter3Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(34, Alexei, function34)
+IMPLEMENT_FUNCTION(34, Alexei, inPart3)
switch (savepoint.action) {
default:
break;
@@ -1252,7 +1252,7 @@ IMPLEMENT_FUNCTION(34, Alexei, function34)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(1);
- setup_function16(kTime2083500, "411");
+ setup_compartmentLogic(kTime2083500, "411");
break;
case kActionCallback:
@@ -1262,7 +1262,7 @@ IMPLEMENT_FUNCTION(34, Alexei, function34)
case 1:
setCallback(2);
- setup_function14();
+ setup_exitCompartment();
break;
case 2:
@@ -1285,12 +1285,12 @@ IMPLEMENT_FUNCTION(34, Alexei, function34)
case 5:
setCallback(6);
- setup_function35();
+ setup_pacing3();
break;
case 6:
setCallback(7);
- setup_function13();
+ setup_enterComparment();
break;
case 7:
@@ -1299,17 +1299,17 @@ IMPLEMENT_FUNCTION(34, Alexei, function34)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 66);
setCallback(8);
- setup_function16(kTime2124000, "NONE");
+ setup_compartmentLogic(kTime2124000, "NONE");
break;
case 8:
setCallback(9);
- setup_function14();
+ setup_exitCompartment();
break;
case 9:
setCallback(10);
- setup_function36();
+ setup_goSalon3();
break;
case 10:
@@ -1318,7 +1318,7 @@ IMPLEMENT_FUNCTION(34, Alexei, function34)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(11);
- setup_function16(kTime16451100, "411");
+ setup_compartmentLogic(kTime16451100, "411");
break;
}
break;
@@ -1326,7 +1326,7 @@ IMPLEMENT_FUNCTION(34, Alexei, function34)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(35, Alexei, function35)
+IMPLEMENT_FUNCTION(35, Alexei, pacing3)
switch (savepoint.action) {
default:
break;
@@ -1345,7 +1345,7 @@ IMPLEMENT_FUNCTION(35, Alexei, function35)
if (Entity::updateParameter(params->param3, getState()->time, params->param1)) {
if (getEntities()->isSomebodyInsideRestaurantOrSalon()) {
setCallback(3);
- setup_function15();
+ setup_pacingAtWindow();
break;
}
}
@@ -1392,7 +1392,7 @@ label_callback_3:
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(36, Alexei, function36)
+IMPLEMENT_FUNCTION(36, Alexei, goSalon3)
switch (savepoint.action) {
default:
break;
@@ -1457,7 +1457,7 @@ IMPLEMENT_FUNCTION(36, Alexei, function36)
case kAction122288808:
setCallback(4);
- setup_function13();
+ setup_enterComparment();
break;
case kAction122358304:
@@ -1474,7 +1474,7 @@ IMPLEMENT_FUNCTION(37, Alexei, chapter4)
break;
case kActionNone:
- setup_chapter4Handler();
+ setup_inCompartment4();
break;
case kActionDefault:
@@ -1493,25 +1493,25 @@ IMPLEMENT_FUNCTION(37, Alexei, chapter4)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(38, Alexei, chapter4Handler)
+IMPLEMENT_FUNCTION(38, Alexei, inCompartment4)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function16(kTime2354400, "411");
+ setup_compartmentLogic(kTime2354400, "411");
break;
case kActionCallback:
if (getCallback() == 1)
- setup_function39();
+ setup_meetTatiana();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(39, Alexei, function39)
+IMPLEMENT_FUNCTION(39, Alexei, meetTatiana)
switch (savepoint.action) {
default:
break;
@@ -1547,7 +1547,7 @@ IMPLEMENT_FUNCTION(39, Alexei, function39)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 72);
}
- setup_function40();
+ setup_leavePlatform();
}
break;
@@ -1571,7 +1571,7 @@ IMPLEMENT_FUNCTION(39, Alexei, function39)
break;
}
- setup_function40();
+ setup_leavePlatform();
}
break;
@@ -1616,7 +1616,7 @@ IMPLEMENT_FUNCTION(39, Alexei, function39)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(40, Alexei, function40)
+IMPLEMENT_FUNCTION(40, Alexei, leavePlatform)
switch (savepoint.action) {
default:
break;
@@ -1653,7 +1653,7 @@ IMPLEMENT_FUNCTION(40, Alexei, function40)
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityAlexei);
- setup_function41();
+ setup_inCompartmentAgain();
break;
}
break;
@@ -1661,7 +1661,7 @@ IMPLEMENT_FUNCTION(40, Alexei, function40)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(41, Alexei, function41)
+IMPLEMENT_FUNCTION(41, Alexei, inCompartmentAgain)
switch (savepoint.action) {
default:
break;
@@ -1671,25 +1671,25 @@ IMPLEMENT_FUNCTION(41, Alexei, function41)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(1);
- setup_function16(kTime2403000, "411");
+ setup_compartmentLogic(kTime2403000, "411");
break;
case kActionCallback:
if (getCallback() == 1)
- setup_function42();
+ setup_goSalon4();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(42, Alexei, function42)
+IMPLEMENT_FUNCTION(42, Alexei, goSalon4)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function14();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -1711,7 +1711,7 @@ IMPLEMENT_FUNCTION(42, Alexei, function42)
case 3:
getData()->location = kLocationInsideCompartment;
- setup_function43();
+ setup_pacing();
break;
}
break;
@@ -1719,7 +1719,7 @@ IMPLEMENT_FUNCTION(42, Alexei, function42)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(43, Alexei, function43)
+IMPLEMENT_FUNCTION(43, Alexei, pacing)
switch (savepoint.action) {
default:
break;
@@ -1731,7 +1731,7 @@ IMPLEMENT_FUNCTION(43, Alexei, function43)
if (getEntities()->isSomebodyInsideRestaurantOrSalon()) {
setCallback(1);
- setup_function15();
+ setup_pacingAtWindow();
break;
}
}
@@ -1768,7 +1768,7 @@ label_callback_1:
break;
case 3:
- setup_function44();
+ setup_goToPlatform();
break;
}
break;
@@ -1776,7 +1776,7 @@ label_callback_1:
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(44, Alexei, function44)
+IMPLEMENT_FUNCTION(44, Alexei, goToPlatform)
switch (savepoint.action) {
default:
break;
@@ -1794,7 +1794,7 @@ IMPLEMENT_FUNCTION(44, Alexei, function44)
if (getEntities()->isPlayerPosition(kCarGreenSleeping, 62))
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 72);
- setup_function45();
+ setup_returnCompartment4();
}
}
break;
@@ -1843,14 +1843,14 @@ IMPLEMENT_FUNCTION(44, Alexei, function44)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(45, Alexei, function45)
+IMPLEMENT_FUNCTION(45, Alexei, returnCompartment4)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function13();
+ setup_enterComparment();
break;
case kActionCallback:
@@ -1859,10 +1859,10 @@ IMPLEMENT_FUNCTION(45, Alexei, function45)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
if (getInventory()->hasItem(kItemBomb)) {
- setup_function46();
+ setup_bombPlanB();
} else {
setCallback(2);
- setup_function16(kTimeEnd, "412");
+ setup_compartmentLogic(kTimeEnd, "412");
}
}
break;
@@ -1870,7 +1870,7 @@ IMPLEMENT_FUNCTION(45, Alexei, function45)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(46, Alexei, function46)
+IMPLEMENT_FUNCTION(46, Alexei, bombPlanB)
switch (savepoint.action) {
default:
break;
@@ -1899,12 +1899,12 @@ IMPLEMENT_FUNCTION(46, Alexei, function46)
}
setCallback(4);
- setup_function13();
+ setup_enterComparment();
break;
case kActionDefault:
setCallback(1);
- setup_function16(kTime2488500, "411");
+ setup_compartmentLogic(kTime2488500, "411");
break;
case kActionCallback:
@@ -1914,7 +1914,7 @@ IMPLEMENT_FUNCTION(46, Alexei, function46)
case 1:
setCallback(2);
- setup_function14();
+ setup_exitCompartment();
break;
case 2:
@@ -1927,7 +1927,7 @@ IMPLEMENT_FUNCTION(46, Alexei, function46)
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
setCallback(5);
- setup_function16(kTime2507400, "412");
+ setup_compartmentLogic(kTime2507400, "412");
break;
case 5:
diff --git a/engines/lastexpress/entities/alexei.h b/engines/lastexpress/entities/alexei.h
index 9792385863..9a316ec574 100644
--- a/engines/lastexpress/entities/alexei.h
+++ b/engines/lastexpress/entities/alexei.h
@@ -123,9 +123,9 @@ public:
*/
DECLARE_FUNCTION(callbackActionRestaurantOrSalon)
- DECLARE_FUNCTION(function13)
- DECLARE_FUNCTION(function14)
- DECLARE_FUNCTION(function15)
+ DECLARE_FUNCTION(enterComparment)
+ DECLARE_FUNCTION(exitCompartment)
+ DECLARE_FUNCTION(pacingAtWindow)
/**
* ???
@@ -133,7 +133,7 @@ public:
* @param timeValue The time value
* @param sequence The sequence to draw
*/
- DECLARE_FUNCTION_2(function16, TimeValue timeValue, const char *sequence)
+ DECLARE_FUNCTION_2(compartmentLogic, TimeValue timeValue, const char *sequence)
/**
* Setup Chapter 1
@@ -143,14 +143,14 @@ public:
/**
* Handle Chapter 1 events
*/
- DECLARE_FUNCTION(chapter1Handler)
- DECLARE_FUNCTION(function19)
- DECLARE_FUNCTION(function20)
- DECLARE_FUNCTION(function21)
- DECLARE_FUNCTION(function22)
- DECLARE_FUNCTION(function23)
- DECLARE_FUNCTION(function24)
- DECLARE_FUNCTION(function25)
+ DECLARE_FUNCTION(atDinner)
+ DECLARE_FUNCTION(returnCompartment)
+ DECLARE_FUNCTION(goSalon)
+ DECLARE_FUNCTION(sitting)
+ DECLARE_FUNCTION(standingAtWindow)
+ DECLARE_FUNCTION(waitingForTatiana)
+ DECLARE_FUNCTION(upset)
+ DECLARE_FUNCTION(returnCompartmentNight)
DECLARE_FUNCTION(function26)
DECLARE_FUNCTION(function27)
@@ -162,9 +162,9 @@ public:
/**
* Handle Chapter 2 events
*/
- DECLARE_FUNCTION(chapter2Handler)
- DECLARE_FUNCTION(function30)
- DECLARE_FUNCTION(function31)
+ DECLARE_FUNCTION(inCompartment2)
+ DECLARE_FUNCTION(atBreakfast)
+ DECLARE_FUNCTION(returnCompartment2)
/**
* Setup Chapter 3
@@ -174,10 +174,10 @@ public:
/**
* Handle Chapter 3 events
*/
- DECLARE_FUNCTION(chapter3Handler)
- DECLARE_FUNCTION(function34)
- DECLARE_FUNCTION(function35)
- DECLARE_FUNCTION(function36)
+ DECLARE_FUNCTION(playingChess)
+ DECLARE_FUNCTION(inPart3)
+ DECLARE_FUNCTION(pacing3)
+ DECLARE_FUNCTION(goSalon3)
/**
* Setup Chapter 4
@@ -187,15 +187,15 @@ public:
/**
* Handle Chapter 4 events
*/
- DECLARE_FUNCTION(chapter4Handler)
- DECLARE_FUNCTION(function39)
- DECLARE_FUNCTION(function40)
- DECLARE_FUNCTION(function41)
- DECLARE_FUNCTION(function42)
- DECLARE_FUNCTION(function43)
- DECLARE_FUNCTION(function44)
- DECLARE_FUNCTION(function45)
- DECLARE_FUNCTION(function46)
+ DECLARE_FUNCTION(inCompartment4)
+ DECLARE_FUNCTION(meetTatiana)
+ DECLARE_FUNCTION(leavePlatform)
+ DECLARE_FUNCTION(inCompartmentAgain)
+ DECLARE_FUNCTION(goSalon4)
+ DECLARE_FUNCTION(pacing)
+ DECLARE_FUNCTION(goToPlatform)
+ DECLARE_FUNCTION(returnCompartment4)
+ DECLARE_FUNCTION(bombPlanB)
DECLARE_FUNCTION(function47)
/**
diff --git a/engines/lastexpress/entities/alouan.cpp b/engines/lastexpress/entities/alouan.cpp
index e834e1f7cb..86d5512cb9 100644
--- a/engines/lastexpress/entities/alouan.cpp
+++ b/engines/lastexpress/entities/alouan.cpp
@@ -38,10 +38,10 @@ Alouan::Alouan(LastExpressEngine *engine) : Entity(engine, kEntityAlouan) {
ADD_CALLBACK_FUNCTION(Alouan, playSound);
ADD_CALLBACK_FUNCTION(Alouan, updateFromTime);
ADD_CALLBACK_FUNCTION(Alouan, updateEntity);
- ADD_CALLBACK_FUNCTION(Alouan, compartment6);
- ADD_CALLBACK_FUNCTION(Alouan, compartment8);
- ADD_CALLBACK_FUNCTION(Alouan, compartment6to8);
- ADD_CALLBACK_FUNCTION(Alouan, compartment8to6);
+ ADD_CALLBACK_FUNCTION(Alouan, peekF);
+ ADD_CALLBACK_FUNCTION(Alouan, peekH);
+ ADD_CALLBACK_FUNCTION(Alouan, goFtoH);
+ ADD_CALLBACK_FUNCTION(Alouan, goHtoF);
ADD_CALLBACK_FUNCTION(Alouan, chapter1);
ADD_CALLBACK_FUNCTION(Alouan, chapter1Handler);
ADD_CALLBACK_FUNCTION(Alouan, function12);
@@ -55,7 +55,7 @@ Alouan::Alouan(LastExpressEngine *engine) : Entity(engine, kEntityAlouan) {
ADD_CALLBACK_FUNCTION(Alouan, chapter5);
ADD_CALLBACK_FUNCTION(Alouan, chapter5Handler);
ADD_CALLBACK_FUNCTION(Alouan, function22);
- ADD_CALLBACK_FUNCTION(Alouan, function23);
+ ADD_CALLBACK_FUNCTION(Alouan, hiding);
ADD_NULL_FUNCTION();
}
@@ -85,22 +85,22 @@ IMPLEMENT_FUNCTION_II(5, Alouan, updateEntity, CarIndex, EntityPosition)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(6, Alouan, compartment6)
+IMPLEMENT_FUNCTION(6, Alouan, peekF)
Entity::goToCompartment(savepoint, kObjectCompartment6, kPosition_4070, "621Cf", "621Df");
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(7, Alouan, compartment8)
+IMPLEMENT_FUNCTION(7, Alouan, peekH)
Entity::goToCompartment(savepoint, kObjectCompartment8, kPosition_2740, "621Ch", "621Dh");
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(8, Alouan, compartment6to8)
+IMPLEMENT_FUNCTION(8, Alouan, goFtoH)
Entity::goToCompartmentFromCompartment(savepoint, kObjectCompartment6, kPosition_4070, "621Bf", kObjectCompartment8, kPosition_2740, "621Ah");
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(9, Alouan, compartment8to6)
+IMPLEMENT_FUNCTION(9, Alouan, goHtoF)
Entity::goToCompartmentFromCompartment(savepoint, kObjectCompartment8, kPosition_2740, "621Bh", kObjectCompartment6, kPosition_4070, "621Af");
IMPLEMENT_FUNCTION_END
@@ -131,7 +131,7 @@ IMPLEMENT_FUNCTION(11, Alouan, chapter1Handler)
case kActionNone:
- if (Entity::timeCheckCallback(kTime1096200, params->param1, 1, WRAP_SETUP_FUNCTION(Alouan, setup_compartment8to6)))
+ if (Entity::timeCheckCallback(kTime1096200, params->param1, 1, WRAP_SETUP_FUNCTION(Alouan, setup_goHtoF)))
break;
label_callback1:
@@ -146,7 +146,7 @@ label_callback1:
getSavePoints()->push(kEntityAlouan, kEntityTrain, kAction191070912, kPosition_4840);
setCallback(2);
- setup_compartment6to8();
+ setup_goFtoH();
}
break;
@@ -215,9 +215,9 @@ IMPLEMENT_FUNCTION(14, Alouan, chapter2Handler)
setCallback(params->param1 ? 1 : 2);
if (params->param1)
- setup_compartment8();
+ setup_peekH();
else
- setup_compartment6();
+ setup_peekF();
break;
case kActionDefault:
@@ -249,7 +249,7 @@ IMPLEMENT_FUNCTION(14, Alouan, chapter2Handler)
case kAction189489753:
setCallback(3);
- setup_compartment8to6();
+ setup_goHtoF();
break;
}
IMPLEMENT_FUNCTION_END
@@ -282,12 +282,12 @@ IMPLEMENT_FUNCTION(16, Alouan, chapter3Handler)
break;
case kActionNone:
- if (Entity::timeCheckCallback(kTimeCitySalzbourg, params->param1, 1, WRAP_SETUP_FUNCTION(Alouan, setup_compartment8to6)))
+ if (Entity::timeCheckCallback(kTimeCitySalzbourg, params->param1, 1, WRAP_SETUP_FUNCTION(Alouan, setup_goHtoF)))
break;
label_callback1:
if (params->param2 != kTimeInvalid && getState()->time > kTime1989000) {
- if (Entity::timeCheckCar(kTime2119500, params->param5, 5, WRAP_SETUP_FUNCTION(Alouan, setup_compartment8)))
+ if (Entity::timeCheckCar(kTime2119500, params->param5, 5, WRAP_SETUP_FUNCTION(Alouan, setup_peekH)))
break;
}
@@ -296,12 +296,12 @@ label_callback2:
break;
label_callback3:
- if (Entity::timeCheckCallback(kTime2133000, params->param4, 4, WRAP_SETUP_FUNCTION(Alouan, setup_compartment6to8)))
+ if (Entity::timeCheckCallback(kTime2133000, params->param4, 4, WRAP_SETUP_FUNCTION(Alouan, setup_goFtoH)))
break;
label_callback4:
if (params->param5 != kTimeInvalid && getState()->time > kTime2151000) {
- if (Entity::timeCheckCar(kTime2241000, params->param5, 5, WRAP_SETUP_FUNCTION(Alouan, setup_compartment8)))
+ if (Entity::timeCheckCar(kTime2241000, params->param5, 5, WRAP_SETUP_FUNCTION(Alouan, setup_peekH)))
break;
}
break;
@@ -361,12 +361,12 @@ IMPLEMENT_FUNCTION(18, Alouan, chapter4Handler)
case kActionNone:
if (params->param1 != kTimeInvalid) {
- if (Entity::timeCheckCar(kTime2443500, params->param1, 1, WRAP_SETUP_FUNCTION(Alouan, setup_compartment8)))
+ if (Entity::timeCheckCar(kTime2443500, params->param1, 1, WRAP_SETUP_FUNCTION(Alouan, setup_peekH)))
break;
}
label_callback1:
- if (Entity::timeCheckCallback(kTime2455200, params->param2, 2, WRAP_SETUP_FUNCTION(Alouan, setup_compartment8to6)))
+ if (Entity::timeCheckCallback(kTime2455200, params->param2, 2, WRAP_SETUP_FUNCTION(Alouan, setup_goHtoF)))
break;
label_callback2:
@@ -375,7 +375,7 @@ label_callback2:
getSavePoints()->push(kEntityAlouan, kEntityTrain, kAction191070912, kPosition_4840);
setCallback(3);
- setup_compartment6to8();
+ setup_goFtoH();
}
break;
@@ -452,7 +452,7 @@ IMPLEMENT_FUNCTION(22, Alouan, function22)
if (!Entity::updateParameter(params->param1, getState()->time, 2700))
break;
- setup_function23();
+ setup_hiding();
break;
case kActionDefault:
@@ -463,13 +463,13 @@ IMPLEMENT_FUNCTION(22, Alouan, function22)
case kActionDrawScene:
if (getEntities()->isInsideTrainCar(kEntityPlayer, kCarGreenSleeping))
- setup_function23();
+ setup_hiding();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(23, Alouan, function23)
+IMPLEMENT_FUNCTION(23, Alouan, hiding)
switch (savepoint.action) {
default:
break;
diff --git a/engines/lastexpress/entities/alouan.h b/engines/lastexpress/entities/alouan.h
index 91254a449a..371e4f20d9 100644
--- a/engines/lastexpress/entities/alouan.h
+++ b/engines/lastexpress/entities/alouan.h
@@ -69,10 +69,10 @@ public:
*/
DECLARE_FUNCTION_2(updateEntity, CarIndex car, EntityPosition entityPosition)
- DECLARE_FUNCTION(compartment6)
- DECLARE_FUNCTION(compartment8)
- DECLARE_FUNCTION(compartment6to8)
- DECLARE_FUNCTION(compartment8to6)
+ DECLARE_FUNCTION(peekF)
+ DECLARE_FUNCTION(peekH)
+ DECLARE_FUNCTION(goFtoH)
+ DECLARE_FUNCTION(goHtoF)
/**
* Setup Chapter 1
@@ -126,7 +126,7 @@ public:
*/
DECLARE_FUNCTION(chapter5Handler)
DECLARE_FUNCTION(function22)
- DECLARE_FUNCTION(function23)
+ DECLARE_FUNCTION(hiding)
DECLARE_NULL_FUNCTION()
};
diff --git a/engines/lastexpress/entities/anna.cpp b/engines/lastexpress/entities/anna.cpp
index f8768032b5..4889f66c69 100644
--- a/engines/lastexpress/entities/anna.cpp
+++ b/engines/lastexpress/entities/anna.cpp
@@ -51,76 +51,76 @@ Anna::Anna(LastExpressEngine *engine) : Entity(engine, kEntityAnna) {
ADD_CALLBACK_FUNCTION(Anna, savegame);
ADD_CALLBACK_FUNCTION(Anna, updateEntity);
ADD_CALLBACK_FUNCTION(Anna, updateFromTime);
- ADD_CALLBACK_FUNCTION(Anna, function12);
+ ADD_CALLBACK_FUNCTION(Anna, practiceMusic);
ADD_CALLBACK_FUNCTION(Anna, draw2);
ADD_CALLBACK_FUNCTION(Anna, updateFromTicks);
- ADD_CALLBACK_FUNCTION(Anna, function15);
+ ADD_CALLBACK_FUNCTION(Anna, compartmentLogic);
ADD_CALLBACK_FUNCTION(Anna, chapter1);
- ADD_CALLBACK_FUNCTION(Anna, function17);
- ADD_CALLBACK_FUNCTION(Anna, function18);
- ADD_CALLBACK_FUNCTION(Anna, chapter1Handler);
- ADD_CALLBACK_FUNCTION(Anna, function20);
- ADD_CALLBACK_FUNCTION(Anna, function21);
+ ADD_CALLBACK_FUNCTION(Anna, doWalkP1);
+ ADD_CALLBACK_FUNCTION(Anna, diningLogic);
+ ADD_CALLBACK_FUNCTION(Anna, fleeTyler);
+ ADD_CALLBACK_FUNCTION(Anna, waitDinner);
+ ADD_CALLBACK_FUNCTION(Anna, goDinner);
ADD_CALLBACK_FUNCTION(Anna, function22);
- ADD_CALLBACK_FUNCTION(Anna, function23);
- ADD_CALLBACK_FUNCTION(Anna, function24);
- ADD_CALLBACK_FUNCTION(Anna, function25);
- ADD_CALLBACK_FUNCTION(Anna, function26);
- ADD_CALLBACK_FUNCTION(Anna, function27);
- ADD_CALLBACK_FUNCTION(Anna, function28);
- ADD_CALLBACK_FUNCTION(Anna, function29);
+ ADD_CALLBACK_FUNCTION(Anna, waitingDinner);
+ ADD_CALLBACK_FUNCTION(Anna, waitingDinner2);
+ ADD_CALLBACK_FUNCTION(Anna, eatingDinner);
+ ADD_CALLBACK_FUNCTION(Anna, leaveDinner);
+ ADD_CALLBACK_FUNCTION(Anna, freshenUp);
+ ADD_CALLBACK_FUNCTION(Anna, goSalon);
+ ADD_CALLBACK_FUNCTION(Anna, waitAugust);
ADD_CALLBACK_FUNCTION(Anna, function30);
- ADD_CALLBACK_FUNCTION(Anna, function31);
- ADD_CALLBACK_FUNCTION(Anna, function32);
- ADD_CALLBACK_FUNCTION(Anna, function33);
- ADD_CALLBACK_FUNCTION(Anna, function34);
- ADD_CALLBACK_FUNCTION(Anna, function35);
- ADD_CALLBACK_FUNCTION(Anna, function36);
+ ADD_CALLBACK_FUNCTION(Anna, leaveAugust);
+ ADD_CALLBACK_FUNCTION(Anna, returnCompartment);
+ ADD_CALLBACK_FUNCTION(Anna, readyForBed);
+ ADD_CALLBACK_FUNCTION(Anna, asleep);
+ ADD_CALLBACK_FUNCTION(Anna, wakeNight);
+ ADD_CALLBACK_FUNCTION(Anna, goVassili);
ADD_CALLBACK_FUNCTION(Anna, function37);
- ADD_CALLBACK_FUNCTION(Anna, function38);
- ADD_CALLBACK_FUNCTION(Anna, function39);
- ADD_CALLBACK_FUNCTION(Anna, function40);
- ADD_CALLBACK_FUNCTION(Anna, function41);
+ ADD_CALLBACK_FUNCTION(Anna, speakTatiana);
+ ADD_CALLBACK_FUNCTION(Anna, doWalk1019);
+ ADD_CALLBACK_FUNCTION(Anna, leaveTatiana);
+ ADD_CALLBACK_FUNCTION(Anna, goBackToSleep);
ADD_CALLBACK_FUNCTION(Anna, chapter2);
- ADD_CALLBACK_FUNCTION(Anna, chapter2Handler);
+ ADD_CALLBACK_FUNCTION(Anna, inPart2);
ADD_CALLBACK_FUNCTION(Anna, chapter3);
- ADD_CALLBACK_FUNCTION(Anna, function45);
- ADD_CALLBACK_FUNCTION(Anna, chapter3Handler);
- ADD_CALLBACK_FUNCTION(Anna, function47);
- ADD_CALLBACK_FUNCTION(Anna, function48);
+ ADD_CALLBACK_FUNCTION(Anna, exitCompartment);
+ ADD_CALLBACK_FUNCTION(Anna, practicing);
+ ADD_CALLBACK_FUNCTION(Anna, goLunch);
+ ADD_CALLBACK_FUNCTION(Anna, lunch);
ADD_CALLBACK_FUNCTION(Anna, leaveTableWithAugust);
- ADD_CALLBACK_FUNCTION(Anna, function50);
- ADD_CALLBACK_FUNCTION(Anna, function51);
- ADD_CALLBACK_FUNCTION(Anna, function52);
- ADD_CALLBACK_FUNCTION(Anna, function53);
- ADD_CALLBACK_FUNCTION(Anna, function54);
- ADD_CALLBACK_FUNCTION(Anna, function55);
- ADD_CALLBACK_FUNCTION(Anna, function56);
- ADD_CALLBACK_FUNCTION(Anna, function57);
- ADD_CALLBACK_FUNCTION(Anna, function58);
- ADD_CALLBACK_FUNCTION(Anna, function59);
- ADD_CALLBACK_FUNCTION(Anna, function60);
- ADD_CALLBACK_FUNCTION(Anna, function61);
+ ADD_CALLBACK_FUNCTION(Anna, leaveLunch);
+ ADD_CALLBACK_FUNCTION(Anna, afterLunch);
+ ADD_CALLBACK_FUNCTION(Anna, returnCompartment3);
+ ADD_CALLBACK_FUNCTION(Anna, dressing);
+ ADD_CALLBACK_FUNCTION(Anna, giveMaxToConductor2);
+ ADD_CALLBACK_FUNCTION(Anna, goConcert);
+ ADD_CALLBACK_FUNCTION(Anna, concert);
+ ADD_CALLBACK_FUNCTION(Anna, leaveConcert);
+ ADD_CALLBACK_FUNCTION(Anna, leaveConcertCathInCompartment);
+ ADD_CALLBACK_FUNCTION(Anna, afterConcert);
+ ADD_CALLBACK_FUNCTION(Anna, giveMaxBack);
+ ADD_CALLBACK_FUNCTION(Anna, goBaggageCompartment);
ADD_CALLBACK_FUNCTION(Anna, function62);
- ADD_CALLBACK_FUNCTION(Anna, function63);
- ADD_CALLBACK_FUNCTION(Anna, baggage);
- ADD_CALLBACK_FUNCTION(Anna, function65);
+ ADD_CALLBACK_FUNCTION(Anna, deadBaggageCompartment);
+ ADD_CALLBACK_FUNCTION(Anna, baggageFight);
+ ADD_CALLBACK_FUNCTION(Anna, prepareVienna);
ADD_CALLBACK_FUNCTION(Anna, chapter4);
- ADD_CALLBACK_FUNCTION(Anna, chapter4Handler);
- ADD_CALLBACK_FUNCTION(Anna, function68);
- ADD_CALLBACK_FUNCTION(Anna, function69);
- ADD_CALLBACK_FUNCTION(Anna, function70);
- ADD_CALLBACK_FUNCTION(Anna, function71);
- ADD_CALLBACK_FUNCTION(Anna, function72);
- ADD_CALLBACK_FUNCTION(Anna, function73);
+ ADD_CALLBACK_FUNCTION(Anna, reading);
+ ADD_CALLBACK_FUNCTION(Anna, sulking);
+ ADD_CALLBACK_FUNCTION(Anna, goSalon4);
+ ADD_CALLBACK_FUNCTION(Anna, returnCompartment4);
+ ADD_CALLBACK_FUNCTION(Anna, enterCompartmentCathFollowsAnna);
+ ADD_CALLBACK_FUNCTION(Anna, doWalkCathFollowsAnna);
+ ADD_CALLBACK_FUNCTION(Anna, letDownHair);
ADD_CALLBACK_FUNCTION(Anna, chapter5);
- ADD_CALLBACK_FUNCTION(Anna, chapter5Handler);
+ ADD_CALLBACK_FUNCTION(Anna, tiedUp);
ADD_CALLBACK_FUNCTION(Anna, function76);
- ADD_CALLBACK_FUNCTION(Anna, function77);
- ADD_CALLBACK_FUNCTION(Anna, function78);
- ADD_CALLBACK_FUNCTION(Anna, function79);
- ADD_CALLBACK_FUNCTION(Anna, function80);
+ ADD_CALLBACK_FUNCTION(Anna, readyToScore);
+ ADD_CALLBACK_FUNCTION(Anna, kidnapped);
+ ADD_CALLBACK_FUNCTION(Anna, waiting);
ADD_CALLBACK_FUNCTION(Anna, finalSequence);
+ ADD_CALLBACK_FUNCTION(Anna, openFirebird);
}
//////////////////////////////////////////////////////////////////////////
@@ -188,7 +188,7 @@ IMPLEMENT_FUNCTION_I(11, Anna, updateFromTime, uint32)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(12, Anna, function12)
+IMPLEMENT_FUNCTION(12, Anna, practiceMusic)
switch (savepoint.action) {
default:
break;
@@ -411,7 +411,7 @@ IMPLEMENT_FUNCTION_I(14, Anna, updateFromTicks, uint32)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_IS(15, Anna, function15, TimeValue)
+IMPLEMENT_FUNCTION_IS(15, Anna, compartmentLogic, TimeValue)
switch (savepoint.action) {
default:
break;
@@ -547,7 +547,7 @@ IMPLEMENT_FUNCTION(16, Anna, chapter1)
break;
case kActionNone:
- Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Anna, setup_chapter1Handler));
+ Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Anna, setup_fleeTyler));
break;
case kActionDefault:
@@ -567,7 +567,7 @@ IMPLEMENT_FUNCTION(16, Anna, chapter1)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_II(17, Anna, function17, uint32, uint32)
+IMPLEMENT_FUNCTION_II(17, Anna, doWalkP1, uint32, uint32)
switch (savepoint.action) {
default:
break;
@@ -656,7 +656,7 @@ IMPLEMENT_FUNCTION_II(17, Anna, function17, uint32, uint32)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_I(18, Anna, function18, TimeValue)
+IMPLEMENT_FUNCTION_I(18, Anna, diningLogic, TimeValue)
switch (savepoint.action) {
default:
break;
@@ -764,7 +764,7 @@ IMPLEMENT_FUNCTION_I(18, Anna, function18, TimeValue)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(19, Anna, chapter1Handler)
+IMPLEMENT_FUNCTION(19, Anna, fleeTyler)
switch (savepoint.action) {
default:
break;
@@ -797,7 +797,7 @@ IMPLEMENT_FUNCTION(19, Anna, chapter1Handler)
getData()->entityPosition = kPosition_4070;
getData()->location = kLocationInsideCompartment;
- setup_function20();
+ setup_waitDinner();
break;
}
break;
@@ -805,14 +805,14 @@ IMPLEMENT_FUNCTION(19, Anna, chapter1Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(20, Anna, function20)
+IMPLEMENT_FUNCTION(20, Anna, waitDinner)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function15(kTime1093500, "NONE");
+ setup_compartmentLogic(kTime1093500, "NONE");
break;
case kActionCallback:
@@ -828,7 +828,7 @@ IMPLEMENT_FUNCTION(20, Anna, function20)
case 2:
getData()->location = kLocationOutsideCompartment;
getSavePoints()->push(kEntityAnna, kEntityMax, kAction71277948);
- setup_function21();
+ setup_goDinner();
break;
}
break;
@@ -836,14 +836,14 @@ IMPLEMENT_FUNCTION(20, Anna, function20)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(21, Anna, function21)
+IMPLEMENT_FUNCTION(21, Anna, goDinner)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function17(kCarRestaurant, kPosition_850);
+ setup_doWalkP1(kCarRestaurant, kPosition_850);
break;
case kActionCallback:
@@ -894,13 +894,13 @@ IMPLEMENT_FUNCTION(22, Anna, function22)
case kAction157370960:
getData()->location = kLocationInsideCompartment;
- setup_function23();
+ setup_waitingDinner();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(23, Anna, function23)
+IMPLEMENT_FUNCTION(23, Anna, waitingDinner)
switch (savepoint.action) {
default:
break;
@@ -911,7 +911,7 @@ IMPLEMENT_FUNCTION(23, Anna, function23)
getSavePoints()->push(kEntityAnna, kEntityTables0, kAction136455232);
setCallback(1);
- setup_function18(kTimeNone);
+ setup_diningLogic(kTimeNone);
break;
case kActionCallback:
@@ -932,7 +932,7 @@ IMPLEMENT_FUNCTION(23, Anna, function23)
case 3:
getSavePoints()->push(kEntityAnna, kEntityServers0, kAction203859488);
- setup_function24();
+ setup_waitingDinner2();
break;
}
break;
@@ -940,7 +940,7 @@ IMPLEMENT_FUNCTION(23, Anna, function23)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(24, Anna, function24)
+IMPLEMENT_FUNCTION(24, Anna, waitingDinner2)
switch (savepoint.action) {
default:
break;
@@ -949,7 +949,7 @@ IMPLEMENT_FUNCTION(24, Anna, function24)
getEntities()->drawSequenceLeft(kEntityAnna, "001G");
setCallback(1);
- setup_function18(kTimeNone);
+ setup_diningLogic(kTimeNone);
break;
case kActionCallback:
@@ -965,7 +965,7 @@ IMPLEMENT_FUNCTION(24, Anna, function24)
case 2:
getSavePoints()->push(kEntityAnna, kEntityServers0, kAction136702400);
- setup_function25();
+ setup_eatingDinner();
break;
}
break;
@@ -973,7 +973,7 @@ IMPLEMENT_FUNCTION(24, Anna, function24)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(25, Anna, function25)
+IMPLEMENT_FUNCTION(25, Anna, eatingDinner)
switch (savepoint.action) {
default:
break;
@@ -983,7 +983,7 @@ IMPLEMENT_FUNCTION(25, Anna, function25)
getProgress().field_28 = 1;
setCallback(1);
- setup_function18(kTimeNone);
+ setup_diningLogic(kTimeNone);
break;
case kActionCallback:
@@ -996,7 +996,7 @@ IMPLEMENT_FUNCTION(25, Anna, function25)
break;
case 3:
- setup_function26();
+ setup_leaveDinner();
break;
}
break;
@@ -1008,13 +1008,13 @@ IMPLEMENT_FUNCTION(25, Anna, function25)
case kAction201437056:
getEntities()->drawSequenceLeft(kEntityAnna, "001J");
setCallback(2);
- setup_function18(kTime1138500);
+ setup_diningLogic(kTime1138500);
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(26, Anna, function26)
+IMPLEMENT_FUNCTION(26, Anna, leaveDinner)
switch (savepoint.action) {
default:
break;
@@ -1046,7 +1046,7 @@ IMPLEMENT_FUNCTION(26, Anna, function26)
case 2:
setCallback(3);
- setup_function17(kCarRedSleeping, kPosition_4070);
+ setup_doWalkP1(kCarRedSleeping, kPosition_4070);
break;
case 3:
@@ -1059,7 +1059,7 @@ IMPLEMENT_FUNCTION(26, Anna, function26)
getData()->entityPosition = kPosition_4070;
getData()->location = kLocationInsideCompartment;
- setup_function27();
+ setup_freshenUp();
break;
}
break;
@@ -1067,7 +1067,7 @@ IMPLEMENT_FUNCTION(26, Anna, function26)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(27, Anna, function27)
+IMPLEMENT_FUNCTION(27, Anna, freshenUp)
switch (savepoint.action) {
default:
break;
@@ -1075,7 +1075,7 @@ IMPLEMENT_FUNCTION(27, Anna, function27)
case kActionDefault:
getSavePoints()->push(kEntityAnna, kEntityMax, kAction101687594);
setCallback(1);
- setup_function15(kTime1156500, "NONE");
+ setup_compartmentLogic(kTime1156500, "NONE");
break;
case kActionCallback:
@@ -1088,7 +1088,7 @@ IMPLEMENT_FUNCTION(27, Anna, function27)
if (getProgress().field_14 == 29) {
params->param1 = (uint)(getState()->time + 900);
setCallback(2);
- setup_function15((TimeValue)params->param1, "NONE");
+ setup_compartmentLogic((TimeValue)params->param1, "NONE");
} else {
setCallback(3);
setup_enterExitCompartment("618Bf", kObjectCompartmentF);
@@ -1098,7 +1098,7 @@ IMPLEMENT_FUNCTION(27, Anna, function27)
case 3:
getData()->location = kLocationOutsideCompartment;
getSavePoints()->push(kEntityAnna, kEntityMax, kAction71277948);
- setup_function28();
+ setup_goSalon();
break;
}
break;
@@ -1106,14 +1106,14 @@ IMPLEMENT_FUNCTION(27, Anna, function27)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(28, Anna, function28)
+IMPLEMENT_FUNCTION(28, Anna, goSalon)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function17(kCarRestaurant, kPosition_850);
+ setup_doWalkP1(kCarRestaurant, kPosition_850);
break;
case kActionCallback:
@@ -1137,7 +1137,7 @@ IMPLEMENT_FUNCTION(28, Anna, function28)
case 3:
getData()->location = kLocationInsideCompartment;
- setup_function29();
+ setup_waitAugust();
break;
}
break;
@@ -1145,7 +1145,7 @@ IMPLEMENT_FUNCTION(28, Anna, function28)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(29, Anna, function29)
+IMPLEMENT_FUNCTION(29, Anna, waitAugust)
switch (savepoint.action) {
default:
break;
@@ -1268,7 +1268,7 @@ IMPLEMENT_FUNCTION(30, Anna, function30)
if (getState()->time > kTime1192500) {
params->param4 = kTimeInvalid;
- setup_function30();
+ setup_leaveAugust();
break;
}
@@ -1277,7 +1277,7 @@ IMPLEMENT_FUNCTION(30, Anna, function30)
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
- setup_function30();
+ setup_leaveAugust();
break;
}
}
@@ -1308,7 +1308,7 @@ IMPLEMENT_FUNCTION(30, Anna, function30)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(31, Anna, function31)
+IMPLEMENT_FUNCTION(31, Anna, leaveAugust)
switch (savepoint.action) {
default:
break;
@@ -1343,7 +1343,7 @@ IMPLEMENT_FUNCTION(31, Anna, function31)
getInventory()->setLocationAndProcess(kItem3, kObjectLocation1);
getSavePoints()->push(kEntityAnna, kEntityAugust, kAction159332865);
- setup_function32();
+ setup_returnCompartment();
break;
}
break;
@@ -1351,14 +1351,14 @@ IMPLEMENT_FUNCTION(31, Anna, function31)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(32, Anna, function32)
+IMPLEMENT_FUNCTION(32, Anna, returnCompartment)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function17(kCarRedSleeping, kPosition_4070);
+ setup_doWalkP1(kCarRedSleeping, kPosition_4070);
break;
case kActionCallback:
@@ -1377,7 +1377,7 @@ IMPLEMENT_FUNCTION(32, Anna, function32)
getData()->entityPosition = kPosition_4070;
getData()->location = kLocationInsideCompartment;
- setup_function33();
+ setup_readyForBed();
break;
}
break;
@@ -1385,7 +1385,7 @@ IMPLEMENT_FUNCTION(32, Anna, function32)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(33, Anna, function33)
+IMPLEMENT_FUNCTION(33, Anna, readyForBed)
switch (savepoint.action) {
default:
break;
@@ -1395,20 +1395,20 @@ IMPLEMENT_FUNCTION(33, Anna, function33)
params->param1 = (uint)(getState()->time + 4500);
setCallback(1);
- setup_function15((TimeValue)params->param1, "NONE");
+ setup_compartmentLogic((TimeValue)params->param1, "NONE");
break;
case kActionCallback:
if (getCallback() == 1) {
- getObjects()->updateLocation2(kObjectCompartmentF, kObjectLocation1);
- setup_function34();
+ getObjects()->updateModel(kObjectCompartmentF, kObjectModel1);
+ setup_asleep();
}
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(34, Anna, function34)
+IMPLEMENT_FUNCTION(34, Anna, asleep)
switch (savepoint.action) {
default:
break;
@@ -1423,7 +1423,7 @@ IMPLEMENT_FUNCTION(34, Anna, function34)
}
label_callback_1:
- Entity::timeCheck(kTime1489500, params->param3, WRAP_SETUP_FUNCTION(Anna, setup_function35));
+ Entity::timeCheck(kTime1489500, params->param3, WRAP_SETUP_FUNCTION(Anna, setup_wakeNight));
break;
case kActionKnock:
@@ -1480,7 +1480,7 @@ label_callback_1:
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(35, Anna, function35)
+IMPLEMENT_FUNCTION(35, Anna, wakeNight)
switch (savepoint.action) {
default:
break;
@@ -1561,11 +1561,11 @@ IMPLEMENT_FUNCTION(35, Anna, function35)
getSavePoints()->push(kEntityAnna, kEntityCoudert, kAction339669520);
getSavePoints()->push(kEntityAnna, kEntityMax, kAction71277948);
- setup_function36();
+ setup_goVassili();
break;
case 2:
- setup_function36();
+ setup_goVassili();
break;
}
break;
@@ -1585,7 +1585,7 @@ IMPLEMENT_FUNCTION(35, Anna, function35)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(36, Anna, function36)
+IMPLEMENT_FUNCTION(36, Anna, goVassili)
switch (savepoint.action) {
default:
break;
@@ -1634,13 +1634,13 @@ IMPLEMENT_FUNCTION(37, Anna, function37)
break;
case kAction191477936:
- setup_function38();
+ setup_speakTatiana();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(38, Anna, function38)
+IMPLEMENT_FUNCTION(38, Anna, speakTatiana)
switch (savepoint.action) {
default:
break;
@@ -1655,14 +1655,14 @@ IMPLEMENT_FUNCTION(38, Anna, function38)
case kActionCallback:
if (getCallback() == 1) {
getSound()->playSound(kEntityPlayer, "MUS043");
- setup_function40();
+ setup_leaveTatiana();
}
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_II(39, Anna, function39, CarIndex, EntityPosition)
+IMPLEMENT_FUNCTION_II(39, Anna, doWalk1019, CarIndex, EntityPosition)
switch (savepoint.action) {
default:
break;
@@ -1708,7 +1708,7 @@ IMPLEMENT_FUNCTION_II(39, Anna, function39, CarIndex, EntityPosition)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(40, Anna, function40)
+IMPLEMENT_FUNCTION(40, Anna, leaveTatiana)
switch (savepoint.action) {
default:
break;
@@ -1727,7 +1727,7 @@ IMPLEMENT_FUNCTION(40, Anna, function40)
getData()->location = kLocationOutsideCompartment;
setCallback(2);
- setup_function39(kCarRedSleeping, kPosition_4070);
+ setup_doWalk1019(kCarRedSleeping, kPosition_4070);
break;
case 2:
@@ -1752,7 +1752,7 @@ IMPLEMENT_FUNCTION(40, Anna, function40)
getData()->location = kLocationOutsideCompartment;
setCallback(6);
- setup_function39(kCarRedSleeping, kPosition_7500);
+ setup_doWalk1019(kCarRedSleeping, kPosition_7500);
break;
case 6:
@@ -1777,7 +1777,7 @@ IMPLEMENT_FUNCTION(40, Anna, function40)
getData()->location = kLocationOutsideCompartment;
setCallback(10);
- setup_function39(kCarRedSleeping, kPosition_4070);
+ setup_doWalk1019(kCarRedSleeping, kPosition_4070);
break;
case 10:
@@ -1790,7 +1790,7 @@ IMPLEMENT_FUNCTION(40, Anna, function40)
getData()->location = kLocationInsideCompartment;
getData()->entityPosition = kPosition_4070;
- setup_function41();
+ setup_goBackToSleep();
break;
}
break;
@@ -1798,7 +1798,7 @@ IMPLEMENT_FUNCTION(40, Anna, function40)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(41, Anna, function41)
+IMPLEMENT_FUNCTION(41, Anna, goBackToSleep)
switch (savepoint.action) {
default:
break;
@@ -1875,7 +1875,7 @@ IMPLEMENT_FUNCTION(42, Anna, chapter2)
break;
case kActionNone:
- setup_chapter2Handler();
+ setup_inPart2();
break;
case kActionDefault:
@@ -1892,7 +1892,7 @@ IMPLEMENT_FUNCTION(42, Anna, chapter2)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(43, Anna, chapter2Handler)
+IMPLEMENT_FUNCTION(43, Anna, inPart2)
switch (savepoint.action) {
default:
break;
@@ -1901,7 +1901,7 @@ IMPLEMENT_FUNCTION(43, Anna, chapter2Handler)
getObjects()->update(kObjectOutsideAnnaCompartment, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
setCallback(1);
- setup_function12();
+ setup_practiceMusic();
break;
case kActionCallback:
@@ -1911,27 +1911,27 @@ IMPLEMENT_FUNCTION(43, Anna, chapter2Handler)
case 1:
setCallback(2);
- setup_function15(kTime1786500, "418C");
+ setup_compartmentLogic(kTime1786500, "418C");
break;
case 2:
setCallback(3);
- setup_function12();
+ setup_practiceMusic();
break;
case 3:
setCallback(4);
- setup_function15(kTime1818000, "418C");
+ setup_compartmentLogic(kTime1818000, "418C");
break;
case 4:
setCallback(5);
- setup_function12();
+ setup_practiceMusic();
break;
case 5:
setCallback(6);
- setup_function15(kTimeEnd, "418C");
+ setup_compartmentLogic(kTimeEnd, "418C");
break;
}
break;
@@ -1945,7 +1945,7 @@ IMPLEMENT_FUNCTION(44, Anna, chapter3)
break;
case kActionNone:
- setup_chapter3Handler();
+ setup_practicing();
break;
case kActionDefault:
@@ -1965,7 +1965,7 @@ IMPLEMENT_FUNCTION(44, Anna, chapter3)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_I(45, Anna, function45, bool)
+IMPLEMENT_FUNCTION_I(45, Anna, exitCompartment, bool)
switch (savepoint.action) {
default:
break;
@@ -2004,7 +2004,7 @@ IMPLEMENT_FUNCTION_I(45, Anna, function45, bool)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(46, Anna, chapter3Handler)
+IMPLEMENT_FUNCTION(46, Anna, practicing)
switch (savepoint.action) {
default:
break;
@@ -2014,16 +2014,16 @@ IMPLEMENT_FUNCTION(46, Anna, chapter3Handler)
getScenes()->loadSceneFromPosition(kCarRedSleeping, 49);
setCallback(1);
- setup_function12();
+ setup_practiceMusic();
break;
case kActionCallback:
if (getCallback() == 1 || getCallback() == 2) {
if (ENTITY_PARAM(0, 1)) {
- setup_function47();
+ setup_goLunch();
} else {
setCallback(2);
- setup_function15((TimeValue)(getState()->time + 4500), "418C");
+ setup_compartmentLogic((TimeValue) (getState()->time + 4500), "418C");
}
}
break;
@@ -2031,7 +2031,7 @@ IMPLEMENT_FUNCTION(46, Anna, chapter3Handler)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(47, Anna, function47)
+IMPLEMENT_FUNCTION(47, Anna, goLunch)
switch (savepoint.action) {
default:
break;
@@ -2080,7 +2080,7 @@ IMPLEMENT_FUNCTION(47, Anna, function47)
case 5:
getEntities()->drawSequenceLeft(kEntityAugust, "BLANK");
- setup_function48();
+ setup_lunch();
break;
}
break;
@@ -2088,7 +2088,7 @@ IMPLEMENT_FUNCTION(47, Anna, function47)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(48, Anna, function48)
+IMPLEMENT_FUNCTION(48, Anna, lunch)
switch (savepoint.action) {
default:
break;
@@ -2121,7 +2121,7 @@ label_callback_4:
params->param4 = kTimeInvalid;
- setup_function50();
+ setup_leaveLunch();
}
}
break;
@@ -2213,7 +2213,7 @@ IMPLEMENT_FUNCTION(49, Anna, leaveTableWithAugust)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(50, Anna, function50)
+IMPLEMENT_FUNCTION(50, Anna, leaveLunch)
switch (savepoint.action) {
default:
break;
@@ -2240,7 +2240,7 @@ IMPLEMENT_FUNCTION(50, Anna, function50)
break;
case 3:
- setup_function51();
+ setup_afterLunch();
break;
}
break;
@@ -2248,7 +2248,7 @@ IMPLEMENT_FUNCTION(50, Anna, function50)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(51, Anna, function51)
+IMPLEMENT_FUNCTION(51, Anna, afterLunch)
switch (savepoint.action) {
default:
break;
@@ -2291,7 +2291,7 @@ IMPLEMENT_FUNCTION(51, Anna, function51)
case 2:
getSavePoints()->push(kEntityAnna, kEntityAugust, kAction122288808);
- setup_function52();
+ setup_returnCompartment3();
break;
case 3:
@@ -2348,7 +2348,7 @@ IMPLEMENT_FUNCTION(51, Anna, function51)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(52, Anna, function52)
+IMPLEMENT_FUNCTION(52, Anna, returnCompartment3)
switch (savepoint.action) {
default:
break;
@@ -2360,7 +2360,7 @@ IMPLEMENT_FUNCTION(52, Anna, function52)
getEntities()->clearSequences(kEntityAnna);
- setup_function53();
+ setup_dressing();
break;
case kActionDefault:
@@ -2385,7 +2385,7 @@ IMPLEMENT_FUNCTION(52, Anna, function52)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(53, Anna, function53)
+IMPLEMENT_FUNCTION(53, Anna, dressing)
switch (savepoint.action) {
default:
break;
@@ -2393,7 +2393,7 @@ IMPLEMENT_FUNCTION(53, Anna, function53)
case kActionNone:
if (getProgress().field_48 && params->param5 != kTimeInvalid) {
if (Entity::updateParameterTime(kTime2065500, !getEntities()->isPlayerInCar(kCarRedSleeping), params->param5, 150)) {
- setup_function54();
+ setup_giveMaxToConductor2();
break;
}
}
@@ -2537,14 +2537,14 @@ IMPLEMENT_FUNCTION(53, Anna, function53)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(54, Anna, function54)
+IMPLEMENT_FUNCTION(54, Anna, giveMaxToConductor2)
switch (savepoint.action) {
default:
break;
case kActionNone:
if (params->param3) {
- if (Entity::timeCheck(kTime2079000, params->param5, WRAP_SETUP_FUNCTION(Anna, setup_function55)))
+ if (Entity::timeCheck(kTime2079000, params->param5, WRAP_SETUP_FUNCTION(Anna, setup_goConcert)))
break;
if (Entity::updateParameter(params->param6, getState()->time, 9000)) {
@@ -2702,7 +2702,7 @@ IMPLEMENT_FUNCTION(54, Anna, function54)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(55, Anna, function55)
+IMPLEMENT_FUNCTION(55, Anna, goConcert)
switch (savepoint.action) {
default:
break;
@@ -2718,7 +2718,7 @@ IMPLEMENT_FUNCTION(55, Anna, function55)
getInventory()->setLocationAndProcess(kItemKey, kObjectLocation1);
setCallback(1);
- setup_function45(true);
+ setup_exitCompartment(true);
break;
case kActionCallback:
@@ -2733,7 +2733,7 @@ IMPLEMENT_FUNCTION(55, Anna, function55)
break;
case 2:
- setup_function56();
+ setup_concert();
break;
}
break;
@@ -2741,7 +2741,7 @@ IMPLEMENT_FUNCTION(55, Anna, function55)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(56, Anna, function56)
+IMPLEMENT_FUNCTION(56, Anna, concert)
switch (savepoint.action) {
default:
break;
@@ -2754,13 +2754,13 @@ IMPLEMENT_FUNCTION(56, Anna, function56)
break;
case kAction191668032:
- setup_function57();
+ setup_leaveConcert();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(57, Anna, function57)
+IMPLEMENT_FUNCTION(57, Anna, leaveConcert)
switch (savepoint.action) {
default:
break;
@@ -2820,7 +2820,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57)
getEntities()->exitCompartment(kEntityAnna, kObjectCompartmentF, true);
getSavePoints()->push(kEntityAnna, kEntityAugust, kAction122288808);
- setup_function59();
+ setup_afterConcert();
break;
}
break;
@@ -2841,7 +2841,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57)
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarRedSleeping, kPosition_4070)
|| getEntities()->isInsideCompartment(kEntityPlayer, kCarRedSleeping, kPosition_4455)) {
getEntities()->exitCompartment(kEntityAnna, kObjectCompartmentF, true);
- setup_function58();
+ setup_leaveConcertCathInCompartment();
} else {
setCallback(3);
setup_enterExitCompartment("625Ff", kObjectCompartmentF);
@@ -2851,7 +2851,7 @@ IMPLEMENT_FUNCTION(57, Anna, function57)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(58, Anna, function58)
+IMPLEMENT_FUNCTION(58, Anna, leaveConcertCathInCompartment)
switch (savepoint.action) {
default:
break;
@@ -2868,14 +2868,14 @@ IMPLEMENT_FUNCTION(58, Anna, function58)
getScenes()->loadSceneFromPosition(kCarRedSleeping, 8);
getSound()->playSound(kEntityAnna, "lib015");
getSavePoints()->push(kEntityAnna, kEntityAugust, kAction122288808);
- setup_function59();
+ setup_afterConcert();
}
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(59, Anna, function59)
+IMPLEMENT_FUNCTION(59, Anna, afterConcert)
switch (savepoint.action) {
default:
break;
@@ -2884,7 +2884,7 @@ IMPLEMENT_FUNCTION(59, Anna, function59)
if (getInventory()->hasItem(kItemKey) && params->param4 != kTimeInvalid && getState()->time > kTime2218500) {
if (getState()->time > kTime2248200) {
params->param4 = kTimeInvalid;
- setup_function61();
+ setup_goBaggageCompartment();
break;
}
@@ -2897,7 +2897,7 @@ IMPLEMENT_FUNCTION(59, Anna, function59)
if (params->param4 < getState()->time) {
params->param4 = kTimeInvalid;
- setup_function61();
+ setup_goBaggageCompartment();
break;
}
}
@@ -2996,7 +2996,7 @@ IMPLEMENT_FUNCTION(59, Anna, function59)
case kAction156622016:
if (params->param3) {
setCallback(8);
- setup_function60();
+ setup_giveMaxBack();
}
break;
@@ -3017,7 +3017,7 @@ IMPLEMENT_FUNCTION(59, Anna, function59)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(60, Anna, function60)
+IMPLEMENT_FUNCTION(60, Anna, giveMaxBack)
switch (savepoint.action) {
default:
break;
@@ -3063,7 +3063,7 @@ IMPLEMENT_FUNCTION(60, Anna, function60)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(61, Anna, function61)
+IMPLEMENT_FUNCTION(61, Anna, goBaggageCompartment)
switch (savepoint.action) {
default:
break;
@@ -3084,7 +3084,7 @@ IMPLEMENT_FUNCTION(61, Anna, function61)
getObjects()->update(kObject53, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
setCallback(2);
- setup_function45(false);
+ setup_exitCompartment(false);
break;
case 2:
@@ -3135,7 +3135,7 @@ IMPLEMENT_FUNCTION(62, Anna, function62)
if (getState()->time > kTime2259000 && !params->param2) {
params->param2 = 1;
getSavePoints()->push(kEntityAnna, kEntityVesna, kAction189299008);
- setup_function63();
+ setup_deadBaggageCompartment();
}
break;
@@ -3151,7 +3151,7 @@ IMPLEMENT_FUNCTION(62, Anna, function62)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(63, Anna, function63)
+IMPLEMENT_FUNCTION(63, Anna, deadBaggageCompartment)
switch (savepoint.action) {
default:
break;
@@ -3180,7 +3180,7 @@ IMPLEMENT_FUNCTION(63, Anna, function63)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(64, Anna, baggage)
+IMPLEMENT_FUNCTION(64, Anna, baggageFight)
switch (savepoint.action) {
default:
break;
@@ -3224,7 +3224,7 @@ IMPLEMENT_FUNCTION(64, Anna, baggage)
getProgress().field_54 = 0;
getState()->time = kTime2266200;
- setup_function65();
+ setup_prepareVienna();
break;
}
break;
@@ -3232,7 +3232,7 @@ IMPLEMENT_FUNCTION(64, Anna, baggage)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(65, Anna, function65)
+IMPLEMENT_FUNCTION(65, Anna, prepareVienna)
if (savepoint.action == kActionDefault) {
getData()->entityPosition = kPosition_4070;
getData()->location = kLocationInsideCompartment;
@@ -3243,7 +3243,7 @@ IMPLEMENT_FUNCTION(65, Anna, function65)
getObjects()->update(kObjectOutsideAnnaCompartment, kEntityPlayer, kObjectLocation1, kCursorKeepValue, kCursorKeepValue);
setCallback(1);
- setup_function15(kTimeEnd, "NONE");
+ setup_compartmentLogic(kTimeEnd, "NONE");
}
IMPLEMENT_FUNCTION_END
@@ -3254,7 +3254,7 @@ IMPLEMENT_FUNCTION(66, Anna, chapter4)
break;
case kActionNone:
- setup_chapter4Handler();
+ setup_reading();
break;
case kActionDefault:
@@ -3271,7 +3271,7 @@ IMPLEMENT_FUNCTION(66, Anna, chapter4)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(67, Anna, chapter4Handler)
+IMPLEMENT_FUNCTION(67, Anna, reading)
switch (savepoint.action) {
default:
break;
@@ -3344,7 +3344,7 @@ label_next:
getSound()->playSound(kEntityPlayer, "LIB015");
getScenes()->loadSceneFromPosition(kCarRedSleeping, 8);
- setup_function68();
+ setup_sulking();
break;
case 2:
@@ -3369,7 +3369,7 @@ label_next:
getObjects()->update(kObjectCompartmentF, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
getData()->inventoryItem = kItemNone;
- setup_function69();
+ setup_goSalon4();
break;
case kAction219971920:
@@ -3379,7 +3379,7 @@ label_next:
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(68, Anna, function68)
+IMPLEMENT_FUNCTION(68, Anna, sulking)
switch (savepoint.action) {
default:
break;
@@ -3387,7 +3387,7 @@ IMPLEMENT_FUNCTION(68, Anna, function68)
case kActionNone:
if (!params->param1) {
setCallback(1);
- setup_function15(kTime2511900, "NONE");
+ setup_compartmentLogic(kTime2511900, "NONE");
}
break;
@@ -3402,7 +3402,7 @@ IMPLEMENT_FUNCTION(68, Anna, function68)
case kAction191001984:
getObjects()->update(kObjectCompartmentF, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
- setup_function69();
+ setup_goSalon4();
break;
case kAction201431954:
@@ -3412,7 +3412,7 @@ IMPLEMENT_FUNCTION(68, Anna, function68)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(69, Anna, function69)
+IMPLEMENT_FUNCTION(69, Anna, goSalon4)
switch (savepoint.action) {
default:
break;
@@ -3426,7 +3426,7 @@ IMPLEMENT_FUNCTION(69, Anna, function69)
getData()->entityPosition = kPosition_9270;
getData()->location = kLocationOutsideCompartment;
- setup_function70();
+ setup_returnCompartment4();
break;
}
@@ -3448,7 +3448,7 @@ IMPLEMENT_FUNCTION(69, Anna, function69)
getData()->entityPosition = kPosition_8200;
getData()->location = kLocationOutsideCompartment;
- setup_function70();
+ setup_returnCompartment4();
}
break;
@@ -3484,7 +3484,7 @@ IMPLEMENT_FUNCTION(69, Anna, function69)
break;
case 5:
- setup_function70();
+ setup_returnCompartment4();
break;
}
break;
@@ -3506,14 +3506,14 @@ IMPLEMENT_FUNCTION(69, Anna, function69)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(70, Anna, function70)
+IMPLEMENT_FUNCTION(70, Anna, returnCompartment4)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function72(kCarRedSleeping, kPosition_4070);
+ setup_doWalkCathFollowsAnna(kCarRedSleeping, kPosition_4070);
break;
case kActionCallback:
@@ -3523,13 +3523,13 @@ IMPLEMENT_FUNCTION(70, Anna, function70)
case 1:
setCallback(2);
- setup_function71();
+ setup_enterCompartmentCathFollowsAnna();
break;
case 2:
getData()->location = kLocationOutsideCompartment;
getEntities()->clearSequences(kEntityAnna);
- setup_function73();
+ setup_letDownHair();
break;
}
break;
@@ -3537,7 +3537,7 @@ IMPLEMENT_FUNCTION(70, Anna, function70)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(71, Anna, function71)
+IMPLEMENT_FUNCTION(71, Anna, enterCompartmentCathFollowsAnna)
switch (savepoint.action) {
default:
break;
@@ -3589,7 +3589,7 @@ IMPLEMENT_FUNCTION(71, Anna, function71)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_II(72, Anna, function72, CarIndex, EntityPosition)
+IMPLEMENT_FUNCTION_II(72, Anna, doWalkCathFollowsAnna, CarIndex, EntityPosition)
switch (savepoint.action) {
default:
break;
@@ -3631,7 +3631,7 @@ IMPLEMENT_FUNCTION_II(72, Anna, function72, CarIndex, EntityPosition)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(73, Anna, function73)
+IMPLEMENT_FUNCTION(73, Anna, letDownHair)
switch (savepoint.action) {
default:
break;
@@ -3712,7 +3712,7 @@ IMPLEMENT_FUNCTION(74, Anna, chapter5)
break;
case kActionNone:
- setup_chapter5Handler();
+ setup_tiedUp();
break;
case kActionDefault:
@@ -3731,7 +3731,7 @@ IMPLEMENT_FUNCTION(74, Anna, chapter5)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(75, Anna, chapter5Handler)
+IMPLEMENT_FUNCTION(75, Anna, tiedUp)
switch (savepoint.action) {
default:
break;
@@ -3758,11 +3758,11 @@ IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
IMPLEMENT_FUNCTION(76, Anna, function76)
if (savepoint.action == kAction158480160)
- setup_function77();
+ setup_readyToScore();
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(77, Anna, function77)
+IMPLEMENT_FUNCTION(77, Anna, readyToScore)
switch (savepoint.action) {
default:
break;
@@ -3818,7 +3818,7 @@ IMPLEMENT_FUNCTION(77, Anna, function77)
break;
case 3:
- setup_function78();
+ setup_kidnapped();
break;
}
break;
@@ -3826,14 +3826,14 @@ IMPLEMENT_FUNCTION(77, Anna, function77)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(78, Anna, function78)
+IMPLEMENT_FUNCTION(78, Anna, kidnapped)
switch (savepoint.action) {
default:
break;
case kActionDrawScene:
if ((getEntities()->isInRestaurant(kEntityPlayer) || getEntities()->isInSalon(kEntityPlayer)) && getInventory()->hasItem(kItemFirebird)) {
- setup_function80();
+ setup_finalSequence();
break;
}
@@ -3857,7 +3857,7 @@ IMPLEMENT_FUNCTION(78, Anna, function78)
getAction()->playAnimation(kEventKronosHostageAnna);
getScenes()->loadSceneFromPosition(kCarRestaurant, 61);
getSound()->playSound(kEntityAnna, "Mus024", kFlagDefault);
- setup_function79();
+ setup_waiting();
break;
}
break;
@@ -3865,7 +3865,7 @@ IMPLEMENT_FUNCTION(78, Anna, function78)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(79, Anna, function79)
+IMPLEMENT_FUNCTION(79, Anna, waiting)
switch (savepoint.action) {
default:
break;
@@ -3878,7 +3878,7 @@ IMPLEMENT_FUNCTION(79, Anna, function79)
case kActionDrawScene:
if (getEntities()->isInRestaurant(kEntityPlayer) && getInventory()->hasItem(kItemFirebird)) {
- setup_function80();
+ setup_finalSequence();
break;
}
@@ -3918,7 +3918,7 @@ IMPLEMENT_FUNCTION(79, Anna, function79)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(80, Anna, function80)
+IMPLEMENT_FUNCTION(80, Anna, finalSequence)
switch (savepoint.action) {
default:
break;
@@ -3973,7 +3973,7 @@ IMPLEMENT_FUNCTION(80, Anna, function80)
getAction()->playAnimation(kEventKronosOpenFirebird);
getScenes()->loadSceneFromPosition(kCarRestaurant, 3);
- setup_finalSequence();
+ setup_openFirebird();
break;
}
break;
@@ -3988,7 +3988,7 @@ IMPLEMENT_FUNCTION(80, Anna, function80)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(81, Anna, finalSequence)
+IMPLEMENT_FUNCTION(81, Anna, openFirebird)
switch (savepoint.action) {
default:
break;
diff --git a/engines/lastexpress/entities/anna.h b/engines/lastexpress/entities/anna.h
index 205ff9d42c..de79ccb826 100644
--- a/engines/lastexpress/entities/anna.h
+++ b/engines/lastexpress/entities/anna.h
@@ -113,7 +113,7 @@ public:
*/
DECLARE_FUNCTION_1(updateFromTime, uint32 time)
- DECLARE_FUNCTION(function12)
+ DECLARE_FUNCTION(practiceMusic)
/**
* Draws the entity along with another one
@@ -131,43 +131,43 @@ public:
*/
DECLARE_FUNCTION_1(updateFromTicks, uint32 ticks)
- DECLARE_FUNCTION_2(function15, TimeValue timeValue, const char *sequence)
+ DECLARE_FUNCTION_2(compartmentLogic, TimeValue timeValue, const char *sequence)
/**
* Setup Chapter 1
*/
DECLARE_FUNCTION(chapter1)
- DECLARE_FUNCTION_2(function17, uint32, uint32)
+ DECLARE_FUNCTION_2(doWalkP1, uint32, uint32)
- DECLARE_FUNCTION_1(function18, TimeValue timeValue)
+ DECLARE_FUNCTION_1(diningLogic, TimeValue timeValue)
/**
* Handle Chapter 1 events
*/
- DECLARE_FUNCTION(chapter1Handler)
- DECLARE_FUNCTION(function20)
- DECLARE_FUNCTION(function21)
+ DECLARE_FUNCTION(fleeTyler)
+ DECLARE_FUNCTION(waitDinner)
+ DECLARE_FUNCTION(goDinner)
DECLARE_FUNCTION(function22)
- DECLARE_FUNCTION(function23)
- DECLARE_FUNCTION(function24)
- DECLARE_FUNCTION(function25)
- DECLARE_FUNCTION(function26)
- DECLARE_FUNCTION(function27)
- DECLARE_FUNCTION(function28)
- DECLARE_FUNCTION(function29)
+ DECLARE_FUNCTION(waitingDinner)
+ DECLARE_FUNCTION(waitingDinner2)
+ DECLARE_FUNCTION(eatingDinner)
+ DECLARE_FUNCTION(leaveDinner)
+ DECLARE_FUNCTION(freshenUp)
+ DECLARE_FUNCTION(goSalon)
+ DECLARE_FUNCTION(waitAugust)
DECLARE_FUNCTION(function30)
- DECLARE_FUNCTION(function31)
- DECLARE_FUNCTION(function32)
- DECLARE_FUNCTION(function33)
- DECLARE_FUNCTION(function34)
- DECLARE_FUNCTION(function35)
- DECLARE_FUNCTION(function36)
+ DECLARE_FUNCTION(leaveAugust)
+ DECLARE_FUNCTION(returnCompartment)
+ DECLARE_FUNCTION(readyForBed)
+ DECLARE_FUNCTION(asleep)
+ DECLARE_FUNCTION(wakeNight)
+ DECLARE_FUNCTION(goVassili)
DECLARE_FUNCTION(function37)
- DECLARE_FUNCTION(function38)
- DECLARE_FUNCTION_2(function39, CarIndex car, EntityPosition entityPosition)
- DECLARE_FUNCTION(function40)
- DECLARE_FUNCTION(function41)
+ DECLARE_FUNCTION(speakTatiana)
+ DECLARE_FUNCTION_2(doWalk1019, CarIndex car, EntityPosition entityPosition)
+ DECLARE_FUNCTION(leaveTatiana)
+ DECLARE_FUNCTION(goBackToSleep)
/**
* Setup Chapter 2
@@ -177,37 +177,37 @@ public:
/**
* Handle Chapter 2 events
*/
- DECLARE_FUNCTION(chapter2Handler)
+ DECLARE_FUNCTION(inPart2)
/**
* Setup Chapter 3
*/
DECLARE_FUNCTION(chapter3)
- DECLARE_FUNCTION_1(function45, bool useAction1)
/**
* Handle Chapter 3 events
*/
- DECLARE_FUNCTION(chapter3Handler)
- DECLARE_FUNCTION(function47)
- DECLARE_FUNCTION(function48)
+ DECLARE_FUNCTION_1(exitCompartment, bool useAction1)
+ DECLARE_FUNCTION(practicing)
+ DECLARE_FUNCTION(goLunch)
+ DECLARE_FUNCTION(lunch)
DECLARE_FUNCTION(leaveTableWithAugust)
- DECLARE_FUNCTION(function50)
- DECLARE_FUNCTION(function51)
- DECLARE_FUNCTION(function52)
- DECLARE_FUNCTION(function53)
- DECLARE_FUNCTION(function54)
- DECLARE_FUNCTION(function55)
- DECLARE_FUNCTION(function56)
- DECLARE_FUNCTION(function57)
- DECLARE_FUNCTION(function58)
- DECLARE_FUNCTION(function59)
- DECLARE_FUNCTION(function60)
- DECLARE_FUNCTION(function61)
+ DECLARE_FUNCTION(leaveLunch)
+ DECLARE_FUNCTION(afterLunch)
+ DECLARE_FUNCTION(returnCompartment3)
+ DECLARE_FUNCTION(dressing)
+ DECLARE_FUNCTION(giveMaxToConductor2)
+ DECLARE_FUNCTION(goConcert)
+ DECLARE_FUNCTION(concert)
+ DECLARE_FUNCTION(leaveConcert)
+ DECLARE_FUNCTION(leaveConcertCathInCompartment)
+ DECLARE_FUNCTION(afterConcert)
+ DECLARE_FUNCTION(giveMaxBack)
+ DECLARE_FUNCTION(goBaggageCompartment)
DECLARE_FUNCTION(function62)
- DECLARE_FUNCTION(function63)
- DECLARE_FUNCTION(baggage)
- DECLARE_FUNCTION(function65)
+ DECLARE_FUNCTION(deadBaggageCompartment)
+ DECLARE_FUNCTION(baggageFight)
+ DECLARE_FUNCTION(prepareVienna)
/**
* Setup Chapter 4
@@ -217,14 +217,13 @@ public:
/**
* Handle Chapter 4 events
*/
- DECLARE_FUNCTION(chapter4Handler)
-
- DECLARE_FUNCTION(function68)
- DECLARE_FUNCTION(function69)
- DECLARE_FUNCTION(function70)
- DECLARE_FUNCTION(function71)
- DECLARE_FUNCTION_2(function72, CarIndex car, EntityPosition entityPosition)
- DECLARE_FUNCTION(function73)
+ DECLARE_FUNCTION(reading)
+ DECLARE_FUNCTION(sulking)
+ DECLARE_FUNCTION(goSalon4)
+ DECLARE_FUNCTION(returnCompartment4)
+ DECLARE_FUNCTION(enterCompartmentCathFollowsAnna)
+ DECLARE_FUNCTION_2(doWalkCathFollowsAnna, CarIndex car, EntityPosition entityPosition)
+ DECLARE_FUNCTION(letDownHair)
/**
* Setup Chapter 5
@@ -234,13 +233,13 @@ public:
/**
* Handle Chapter 5 events
*/
- DECLARE_FUNCTION(chapter5Handler)
+ DECLARE_FUNCTION(tiedUp)
DECLARE_FUNCTION(function76)
- DECLARE_FUNCTION(function77)
- DECLARE_FUNCTION(function78)
- DECLARE_FUNCTION(function79)
- DECLARE_FUNCTION(function80)
+ DECLARE_FUNCTION(readyToScore)
+ DECLARE_FUNCTION(kidnapped)
+ DECLARE_FUNCTION(waiting)
DECLARE_FUNCTION(finalSequence)
+ DECLARE_FUNCTION(openFirebird)
};
} // End of namespace LastExpress
diff --git a/engines/lastexpress/entities/august.cpp b/engines/lastexpress/entities/august.cpp
index b0bc0732d4..11f72ecfe8 100644
--- a/engines/lastexpress/entities/august.cpp
+++ b/engines/lastexpress/entities/august.cpp
@@ -640,7 +640,7 @@ label_continue:
break;
case 6:
- getAction()->playAnimation(getObjects()->get(kObjectCompartment3).location2 == kObjectLocation1 ? kEventMeetAugustHisCompartmentBed : kEventMeetAugustHisCompartment);
+ getAction()->playAnimation(getObjects()->get(kObjectCompartment3).model == kObjectModel1 ? kEventMeetAugustHisCompartmentBed : kEventMeetAugustHisCompartment);
getProgress().eventMetAugust = true;
getObjects()->update(kObjectCompartment3, kEntityAugust, kObjectLocation1, kCursorNormal, kCursorNormal);
@@ -840,11 +840,11 @@ label_callback_9:
if (CURRENT_PARAM(1, 1) >= getState()->timeTicks)
break;
- if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1) {
+ if (getObjects()->get(kObjectCompartment1).status == kObjectLocation1) {
if (!Entity::updateParameter(CURRENT_PARAM(1, 2), getState()->timeTicks, 75))
break;
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
params->param6++;
@@ -866,7 +866,7 @@ label_callback_9:
params->param8++;
if (params->param8 >= 3) {
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
}
@@ -874,12 +874,12 @@ label_callback_9:
params->param6 = 0;
}
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, params->param4 ? kCursorNormal : kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, params->param4 ? kCursorNormal : kCursorTalk, kCursorHand);
CURRENT_PARAM(1, 2) = 0;
} else {
if (getProgress().eventCorpseMovedFromFloor && getProgress().jacket != kJacketBlood) {
- params->param7 = (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) ? 8 : 7;
+ params->param7 = (getObjects()->get(kObjectCompartment1).model == kObjectModel1) ? 8 : 7;
getObjects()->update(kObjectOutsideTylerCompartment, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
setCallback(4);
@@ -900,7 +900,7 @@ label_callback_9:
setCallback(15);
setup_playSound("LIB012");
} else if (!params->param4) {
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
setCallback(17);
setup_playSound("AUG1002A");
@@ -912,9 +912,9 @@ label_callback_9:
if (params->param3) {
getData()->location = kLocationInsideCompartment;
- params->param7 = (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) ? kEventMeetAugustHisCompartmentBed : kEventMeetAugustHisCompartment;
+ params->param7 = (getObjects()->get(kObjectCompartment1).model == kObjectModel1) ? kEventMeetAugustHisCompartmentBed : kEventMeetAugustHisCompartment;
} else {
- params->param7 = (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) ? kEventMeetAugustTylerCompartmentBed : kEventMeetAugustTylerCompartment;
+ params->param7 = (getObjects()->get(kObjectCompartment1).model == kObjectModel1) ? kEventMeetAugustTylerCompartmentBed : kEventMeetAugustTylerCompartment;
}
setCallback(14);
@@ -931,14 +931,14 @@ label_callback_9:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_8200)
|| getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_7850)
|| getEntities()->isOutsideAlexeiWindow()) {
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
if (getEntities()->isOutsideAlexeiWindow())
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
getSound()->playSound(kEntityPlayer, "LIB012");
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, kCursorTalk, kCursorHand);
params->param2 = 1;
} else {
@@ -996,7 +996,7 @@ label_callback_9:
case 6:
case 7:
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, params->param4 ? kCursorNormal : kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, params->param4 ? kCursorNormal : kCursorTalk, kCursorHand);
ENTITY_PARAM(1, 2) = 0;
break;
@@ -1032,7 +1032,7 @@ label_callback_9:
break;
case 13:
- getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).location == kObjectLocation1 ? "LIB032" : "LIB014");
+ getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).status == kObjectLocation1 ? "LIB032" : "LIB014");
getAction()->playAnimation(kEventAugustFindCorpse);
if (getEvent(kEventDinerAugustOriginalJacket))
@@ -1045,7 +1045,7 @@ label_callback_9:
case 14:
if (!params->param2)
- getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).location == kObjectLocation1 ? "LIB032" : "LIB014");
+ getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).status == kObjectLocation1 ? "LIB032" : "LIB014");
getObjects()->update(kObjectCompartment1, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
getObjects()->update(kObjectOutsideTylerCompartment, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
@@ -1070,7 +1070,7 @@ label_callback_9:
case 17:
params->param4 = 1;
- getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityAugust, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorHand);
break;
}
break;
@@ -3249,7 +3249,7 @@ IMPLEMENT_FUNCTION(63, August, function63)
case kAction1:
if (getEntities()->isInSalon(kEntityAlexei)) {
- RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_function44);
+ RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_goToPlatform);
}
getData()->inventoryItem = kItemNone;
diff --git a/engines/lastexpress/entities/chapters.cpp b/engines/lastexpress/entities/chapters.cpp
index d373432710..6c8f7ca41c 100644
--- a/engines/lastexpress/entities/chapters.cpp
+++ b/engines/lastexpress/entities/chapters.cpp
@@ -221,7 +221,7 @@ IMPLEMENT_FUNCTION(6, Chapters, chapter1End)
RESET_ENTITY_STATE(kEntityKronos, Kronos, setup_function10);
RESET_ENTITY_STATE(kEntityKahina, Kahina, setup_function13);
- RESET_ENTITY_STATE(kEntityAnna, Anna, setup_function34);
+ RESET_ENTITY_STATE(kEntityAnna, Anna, setup_asleep);
RESET_ENTITY_STATE(kEntityAugust, August, setup_function34);
RESET_ENTITY_STATE(kEntityTatiana, Tatiana, setup_function24);
RESET_ENTITY_STATE(kEntityVassili, Vassili, setup_function7);
@@ -349,19 +349,19 @@ IMPLEMENT_FUNCTION(7, Chapters, chapter1Init)
getObjects()->update(kObjectOutsideTylerCompartment, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
for (uint i = kObjectCompartment1; i <= kObjectCompartment8; i++) {
- getObjects()->updateLocation2((ObjectIndex)i, kObjectLocation2);
+ getObjects()->updateModel((ObjectIndex) i, kObjectModel2);
}
for (uint i = kObjectCompartmentA; i <= kObjectCompartmentH; i++) {
- getObjects()->updateLocation2((ObjectIndex)i, kObjectLocation2);
+ getObjects()->updateModel((ObjectIndex) i, kObjectModel2);
}
params->param1 = 40;
- getObjects()->updateLocation2(kObject25, kObjectLocation1);
- getObjects()->updateLocation2(kObjectTrainTimeTable, kObjectLocation1);
- getObjects()->updateLocation2(kObject98, kObjectLocation1);
- getObjects()->updateLocation2(kObjectRestaurantCar, kObjectLocation1);
+ getObjects()->updateModel(kObject25, kObjectModel1);
+ getObjects()->updateModel(kObjectTrainTimeTable, kObjectModel1);
+ getObjects()->updateModel(kObject98, kObjectModel1);
+ getObjects()->updateModel(kObjectRestaurantCar, kObjectModel1);
getObjects()->update(kObject25, kEntityPlayer, kObjectLocationNone, kCursorNormal, kCursorForward);
getObjects()->update(kObjectTrainTimeTable, kEntityPlayer, kObjectLocationNone, kCursorNormal, kCursorForward);
@@ -792,11 +792,11 @@ IMPLEMENT_FUNCTION(11, Chapters, chapter2Init)
getInventory()->setLocationAndProcess(kItem3, kObjectLocation1);
for (uint i = 1; i < 9; i++) {
- getObjects()->updateLocation2((ObjectIndex)i, kObjectLocation2);
+ getObjects()->updateModel((ObjectIndex) i, kObjectModel2);
}
for (uint i = 33; i < 40; i++) {
- getObjects()->updateLocation2((ObjectIndex)i, kObjectLocation2);
+ getObjects()->updateModel((ObjectIndex) i, kObjectModel2);
}
params->param1 = 40;
@@ -893,7 +893,7 @@ IMPLEMENT_FUNCTION(14, Chapters, chapter3Init)
getObjects()->update(kObjectHandleOutsideRight, kEntityPlayer, kObjectLocation1, kCursorNormal, kCursorHand);
getInventory()->setLocationAndProcess(kItemBriefcase, kObjectLocation1);
getInventory()->setLocationAndProcess(kItem3, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartment1, kObjectLocation2);
+ getObjects()->updateModel(kObjectCompartment1, kObjectModel2);
getObjects()->update(kObject107, kEntityPlayer, kObjectLocation3, kCursorKeepValue, kCursorKeepValue);
if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) {
@@ -1204,7 +1204,7 @@ IMPLEMENT_FUNCTION(18, Chapters, chapter4Init)
if (getInventory()->get(kItemBeetle)->location == kObjectLocation3)
getScenes()->loadSceneFromItemPosition(kItemBeetle);
- getObjects()->updateLocation2(kObject25, kObjectLocation2);
+ getObjects()->updateModel(kObject25, kObjectModel2);
getObjects()->update(kObject107, kEntityPlayer, kObjectLocation3, kCursorKeepValue, kCursorKeepValue);
if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) {
@@ -1265,7 +1265,7 @@ label_exitPozsony:
break;
label_enterGalanta:
- if (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) {
+ if (getObjects()->get(kObjectCompartment1).model == kObjectModel1) {
if (getState()->time > kTime2403000 && !CURRENT_PARAM(1, 2)) {
CURRENT_PARAM(1, 2) = 1;
getProgress().field_18 = 2;
@@ -1440,7 +1440,7 @@ label_callback_4:
case 10:
getAction()->playAnimation(kEventDefuseBomb);
- RESET_ENTITY_STATE(kEntityAbbot, Abbot, setup_function48);
+ RESET_ENTITY_STATE(kEntityAbbot, Abbot, setup_afterBomb);
getSavePoints()->push(kEntityChapters, kEntityAnna, kAction191001984);
getSavePoints()->push(kEntityChapters, kEntityCoudert, kAction191001984);
getScenes()->loadSceneFromItemPosition(kItem2);
@@ -1514,7 +1514,7 @@ label_callback_4:
if (getInventory()->hasItem(kItemBomb)) {
RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_function47);
- RESET_ENTITY_STATE(kEntityAnna, Anna, setup_function68);
+ RESET_ENTITY_STATE(kEntityAnna, Anna, setup_sulking);
RESET_ENTITY_STATE(kEntityAugust, August, setup_function65);
RESET_ENTITY_STATE(kEntityMertens, Mertens, setup_function48);
RESET_ENTITY_STATE(kEntityCoudert, Coudert, setup_function53);
@@ -1675,8 +1675,8 @@ IMPLEMENT_FUNCTION(21, Chapters, chapter5Init)
getObjects()->update(kObject94, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
getObjects()->update(kObject101, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
- getObjects()->updateLocation2(kObject98, kObjectLocation2);
- getObjects()->updateLocation2(kObjectRestaurantCar, kObjectLocation2);
+ getObjects()->updateModel(kObject98, kObjectModel2);
+ getObjects()->updateModel(kObjectRestaurantCar, kObjectModel2);
if (ENTITY_PARAM(0, 2) || ENTITY_PARAM(0, 3)) {
getSoundQueue()->removeFromQueue(kEntityChapters);
diff --git a/engines/lastexpress/entities/coudert.cpp b/engines/lastexpress/entities/coudert.cpp
index b604277903..ebe2a930a5 100644
--- a/engines/lastexpress/entities/coudert.cpp
+++ b/engines/lastexpress/entities/coudert.cpp
@@ -915,7 +915,7 @@ IMPLEMENT_FUNCTION_II(20, Coudert, function20, ObjectIndex, ObjectIndex)
if (!Entity::updateParameter(CURRENT_PARAM(1, 4), getState()->time, 900))
break;
- getObjects()->updateLocation2((ObjectIndex)params->param1, kObjectLocation1);
+ getObjects()->updateModel((ObjectIndex) params->param1, kObjectModel1);
if (params->param4 != kObjectLocation2)
getObjects()->update((ObjectIndex)params->param1, (EntityIndex)params->param3, (ObjectLocation)params->param4, (CursorStyle)params->param5, (CursorStyle)params->param6);
@@ -938,15 +938,15 @@ IMPLEMENT_FUNCTION_II(20, Coudert, function20, ObjectIndex, ObjectIndex)
case kActionDefault:
params->param3 = getObjects()->get((ObjectIndex)params->param1).entity;
- params->param4 = getObjects()->get((ObjectIndex)params->param1).location;
- params->param5 = getObjects()->get((ObjectIndex)params->param1).cursor;
- params->param6 = getObjects()->get((ObjectIndex)params->param1).cursor2;
+ params->param4 = getObjects()->get((ObjectIndex)params->param1).status;
+ params->param5 = getObjects()->get((ObjectIndex)params->param1).windowCursor;
+ params->param6 = getObjects()->get((ObjectIndex)params->param1).handleCursor;
if (params->param2) {
params->param7 = getObjects()->get((ObjectIndex)params->param2).entity;
- params->param8 = getObjects()->get((ObjectIndex)params->param2).location;
- CURRENT_PARAM(1, 1) = getObjects()->get((ObjectIndex)params->param2).cursor;
- CURRENT_PARAM(1, 2) = getObjects()->get((ObjectIndex)params->param2).cursor2;
+ params->param8 = getObjects()->get((ObjectIndex)params->param2).status;
+ CURRENT_PARAM(1, 1) = getObjects()->get((ObjectIndex)params->param2).windowCursor;
+ CURRENT_PARAM(1, 2) = getObjects()->get((ObjectIndex)params->param2).handleCursor;
getObjects()->update((ObjectIndex)params->param2, kEntityCoudert, kObjectLocation1, kCursorHandKnock, kCursorHand);
}
@@ -1580,7 +1580,7 @@ IMPLEMENT_FUNCTION_I(30, Coudert, function30, ObjectIndex)
case 2:
if (getEntities()->checkFields19(kEntityPlayer, kCarRedSleeping, (EntityPosition)parameters->param3)
|| ((parameters->param1 == kObjectCompartmentE || parameters->param1 == kObjectCompartmentF) && getEntities()->isOutsideAnnaWindow())) {
- getObjects()->update((ObjectIndex)parameters->param1, kEntityPlayer, getObjects()->get((ObjectIndex)parameters->param1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update((ObjectIndex)parameters->param1, kEntityPlayer, getObjects()->get((ObjectIndex)parameters->param1).status, kCursorNormal, kCursorNormal);
parameters->param5 = true;
}
@@ -1598,7 +1598,7 @@ IMPLEMENT_FUNCTION_I(30, Coudert, function30, ObjectIndex)
case 4:
if (parameters->param5)
- getObjects()->update((ObjectIndex)parameters->param1, kEntityPlayer, getObjects()->get((ObjectIndex)parameters->param1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update((ObjectIndex)parameters->param1, kEntityPlayer, getObjects()->get((ObjectIndex)parameters->param1).status, kCursorHandKnock, kCursorHand);
getEntities()->exitCompartment(kEntityCoudert, (ObjectIndex)parameters->param1, true);
@@ -1991,7 +1991,7 @@ IMPLEMENT_FUNCTION(36, Coudert, chapter1)
getData()->location = kLocationOutsideCompartment;
getData()->car = kCarRedSleeping;
- getObjects()->updateLocation2(kObject111, kObjectLocation1);
+ getObjects()->updateModel(kObject111, kObjectModel1);
break;
case kActionCallback:
@@ -2294,9 +2294,9 @@ label_callback_10:
if (!ENTITY_PARAM(0, 2))
break;
- timeCheckObject(kTime1107000, params->param4, kObject111, kObjectLocation2);
- timeCheckObject(kTime1161000, params->param5, kObject111, kObjectLocation3);
- timeCheckObject(kTime1206000, params->param6, kObject111, kObjectLocation4);
+ timeCheckObject(kTime1107000, params->param4, kObject111, kObjectModel2);
+ timeCheckObject(kTime1161000, params->param5, kObject111, kObjectModel3);
+ timeCheckObject(kTime1206000, params->param6, kObject111, kObjectModel4);
break;
case kAction1:
@@ -2577,7 +2577,7 @@ IMPLEMENT_FUNCTION(42, Coudert, chapter2)
ENTITY_PARAM(2, 4) = 0;
- getObjects()->updateLocation2(kObject111, kObjectLocation5);
+ getObjects()->updateModel(kObject111, kObjectModel5);
break;
case kActionCallback:
@@ -2716,7 +2716,7 @@ IMPLEMENT_FUNCTION(44, Coudert, chapter3)
ENTITY_PARAM(2, 4) = 0;
ENTITY_PARAM(2, 5) = 0;
- getObjects()->updateLocation2(kObject111, kObjectLocation6);
+ getObjects()->updateModel(kObject111, kObjectModel6);
break;
case kActionCallback:
@@ -2850,9 +2850,9 @@ label_callback_18:
label_callback_19:
if (ENTITY_PARAM(0, 2)) {
- timeCheckObject(kTime2025000, params->param7, kObject111, kObjectLocation7);
- timeCheckObject(kTime2133000, params->param8, kObject111, kObjectLocation8);
- timeCheckObject(kTime2173500, CURRENT_PARAM(1, 1), kObject111, kObjectLocation9);
+ timeCheckObject(kTime2025000, params->param7, kObject111, kObjectModel7);
+ timeCheckObject(kTime2133000, params->param8, kObject111, kObjectModel8);
+ timeCheckObject(kTime2173500, CURRENT_PARAM(1, 1), kObject111, kObjectModel9);
}
break;
@@ -3498,7 +3498,7 @@ IMPLEMENT_FUNCTION(52, Coudert, chapter4)
ENTITY_PARAM(2, 3) = 0;
ENTITY_PARAM(2, 4) = 0;
- getObjects()->updateLocation2(kObject111, kObjectLocation10);
+ getObjects()->updateModel(kObject111, kObjectModel10);
break;
case kActionCallback:
@@ -3523,14 +3523,14 @@ IMPLEMENT_FUNCTION(53, Coudert, function53)
params->param1 = 1;
- getObjects()->updateLocation2(kObjectCompartmentA, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentB, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentC, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentD, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentE, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentF, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentG, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartmentH, kObjectLocation1);
+ getObjects()->updateModel(kObjectCompartmentA, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentB, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentC, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentD, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentE, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentF, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentG, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartmentH, kObjectModel1);
ENTITY_PARAM(2, 3) = 0;
diff --git a/engines/lastexpress/entities/entity.cpp b/engines/lastexpress/entities/entity.cpp
index dad5e67392..b2fc30829f 100644
--- a/engines/lastexpress/entities/entity.cpp
+++ b/engines/lastexpress/entities/entity.cpp
@@ -943,10 +943,10 @@ void Entity::timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityInde
}
}
-void Entity::timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex object, ObjectLocation location) const {
+void Entity::timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex object, ObjectModel model) const {
if (getState()->time > timeValue && !parameter) {
parameter = 1;
- getObjects()->updateLocation2(object, location);
+ getObjects()->updateModel(object, model);
}
}
diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h
index 5aa7c1be5a..634c854d05 100644
--- a/engines/lastexpress/entities/entity.h
+++ b/engines/lastexpress/entities/entity.h
@@ -818,9 +818,9 @@ public:
/**
* Synchronizes a string.
*
- * @param s The Common::Serializer to use.
- * @param string The string.
- * @param length Length of the string.
+ * @param s The Common::Serializer to use.
+ * @param string The string.
+ * @param length Length of the string.
*/
void syncString(Common::Serializer &s, Common::String &string, uint length) const;
@@ -921,7 +921,7 @@ protected:
/**
* Play sound
*
- * @param savepoint The savepoint
+ * @param savepoint The savepoint
* - Sound filename
* @param resetItem true to reset item.
* @param flag sound flag
@@ -931,9 +931,9 @@ protected:
/**
* Draws the entity
*
- * @param savepoint The savepoint
- * - Sequence
- * - ExcuseMe flag
+ * @param savepoint The savepoint
+ * - Sequence
+ * - ExcuseMe flag
* @param handleExcuseMe true to handle excuseMeCath action
*/
void draw(const SavePoint &savepoint, bool handleExcuseMe = false);
@@ -941,7 +941,7 @@ protected:
/**
* Draws the entity along with another one
*
- * @param savepoint The savepoint.
+ * @param savepoint The savepoint.
* - Sequence 1
* - Sequence 2
* - EntityIndex
@@ -976,23 +976,23 @@ protected:
/**
* Process callback action when the entity direction is not kDirectionRight
*
- * @param savepoint The savepoint.
+ * @param savepoint The savepoint.
*/
void callbackActionOnDirection(const SavePoint &savepoint);
/**
* Process callback action when somebody is standing in the restaurant or salon.
*
- * @param savepoint The savepoint.
+ * @param savepoint The savepoint.
*/
void callbackActionRestaurantOrSalon(const SavePoint &savepoint);
/**
* Updates the entity
*
- * @param savepoint The savepoint.
- * - CarIndex
- * - EntityPosition
+ * @param savepoint The savepoint.
+ * - CarIndex
+ * - EntityPosition
* @param handleExcuseMe true to handle the kActionExcuseMe/kActionExcuseMeCath actions.
*/
void updateEntity(const SavePoint &savepoint, bool handleExcuseMe = false);
@@ -1000,11 +1000,11 @@ protected:
/**
* Call a specific savepoint (or draw sequence in default case)
*
- * @param savepoint The savepoint.
- * - Sequence to draw in default case
- * - EntityIndex
- * - ActionIndex
- * - Sequence for the savepoint
+ * @param savepoint The savepoint.
+ * - Sequence to draw in default case
+ * - EntityIndex
+ * - ActionIndex
+ * - Sequence for the savepoint
* @param handleExcuseMe true to handle excuse me.
*/
void callSavepoint(const SavePoint &savepoint, bool handleExcuseMe = false);
@@ -1012,36 +1012,36 @@ protected:
/**
* Handles entering/exiting a compartment.
*
- * @param savepoint The savepoint.
- * @param position1 The first position.
- * @param position2 The second position.
- * @param car The car.
- * @param compartment The compartment.
- * @param alternate true to use the alternate version of SceneManager::loadSceneFromObject()
+ * @param savepoint The savepoint.
+ * @param position1 The first position.
+ * @param position2 The second position.
+ * @param car The car.
+ * @param compartment The compartment.
+ * @param alternate true to use the alternate version of SceneManager::loadSceneFromObject()
*/
void enterExitCompartment(const SavePoint &savepoint, EntityPosition position1 = kPositionNone, EntityPosition position2 = kPositionNone, CarIndex car = kCarNone, ObjectIndex compartment = kObjectNone, bool alternate = false, bool updateLocation = false);
/**
* Go to compartment.
*
- * @param savepoint The savepoint.
- * @param compartmentFrom The compartment from.
- * @param positionFrom The position from.
- * @param sequenceFrom The sequence from.
- * @param sequenceTo The sequence to.
+ * @param savepoint The savepoint.
+ * @param compartmentFrom The compartment from.
+ * @param positionFrom The position from.
+ * @param sequenceFrom The sequence from.
+ * @param sequenceTo The sequence to.
*/
void goToCompartment(const SavePoint &savepoint, ObjectIndex compartmentFrom, EntityPosition positionFrom, Common::String sequenceFrom, Common::String sequenceTo);
/**
* Go to compartment from compartment.
*
- * @param savepoint The savepoint.
- * @param compartmentFrom The compartment from.
- * @param positionFrom The position from.
- * @param sequenceFrom The sequence from.
- * @param compartmentTo The compartment to.
- * @param positionTo The position to.
- * @param sequenceTo The sequence to.
+ * @param savepoint The savepoint.
+ * @param compartmentFrom The compartment from.
+ * @param positionFrom The position from.
+ * @param sequenceFrom The sequence from.
+ * @param compartmentTo The compartment to.
+ * @param positionTo The position to.
+ * @param sequenceTo The sequence to.
*/
void goToCompartmentFromCompartment(const SavePoint &savepoint, ObjectIndex compartmentFrom, EntityPosition positionFrom, Common::String sequenceFrom, ObjectIndex compartmentTo, EntityPosition positionTo, Common::String sequenceTo);
@@ -1095,7 +1095,7 @@ protected:
bool timeCheckCallbackInventory(TimeValue timeValue, uint &parameter, byte callback, Common::Functor0<void> *function);
bool timeCheckCar(TimeValue timeValue, uint &parameter, byte callback, Common::Functor0<void> *function);
void timeCheckSavepoint(TimeValue timeValue, uint &parameter, EntityIndex entity1, EntityIndex entity2, ActionIndex action) const;
- void timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex index, ObjectLocation location) const;
+ void timeCheckObject(TimeValue timeValue, uint &parameter, ObjectIndex index, ObjectModel model) const;
bool timeCheckCallbackAction(TimeValue timeValue, uint &parameter);
bool timeCheckPlaySoundUpdatePosition(TimeValue timeValue, uint &parameter, byte callback, const char* sound, EntityPosition position);
diff --git a/engines/lastexpress/entities/francois.cpp b/engines/lastexpress/entities/francois.cpp
index d2bbc9854c..12ce16a32b 100644
--- a/engines/lastexpress/entities/francois.cpp
+++ b/engines/lastexpress/entities/francois.cpp
@@ -44,22 +44,22 @@ Francois::Francois(LastExpressEngine *engine) : Entity(engine, kEntityFrancois)
ADD_CALLBACK_FUNCTION(Francois, enterExitCompartment2);
ADD_CALLBACK_FUNCTION(Francois, playSound);
ADD_CALLBACK_FUNCTION(Francois, savegame);
- ADD_CALLBACK_FUNCTION(Francois, updateEntity);
- ADD_CALLBACK_FUNCTION(Francois, function9);
- ADD_CALLBACK_FUNCTION(Francois, function10);
- ADD_CALLBACK_FUNCTION(Francois, function11);
- ADD_CALLBACK_FUNCTION(Francois, function12);
- ADD_CALLBACK_FUNCTION(Francois, function13);
- ADD_CALLBACK_FUNCTION(Francois, function14);
- ADD_CALLBACK_FUNCTION(Francois, function15);
- ADD_CALLBACK_FUNCTION(Francois, function16);
+ ADD_CALLBACK_FUNCTION(Francois, doWalk);
+ ADD_CALLBACK_FUNCTION(Francois, exitCompartment);
+ ADD_CALLBACK_FUNCTION(Francois, enterCompartment);
+ ADD_CALLBACK_FUNCTION(Francois, rampage);
+ ADD_CALLBACK_FUNCTION(Francois, takeWalk);
+ ADD_CALLBACK_FUNCTION(Francois, haremVisit);
+ ADD_CALLBACK_FUNCTION(Francois, chaseBeetle);
+ ADD_CALLBACK_FUNCTION(Francois, findCath);
+ ADD_CALLBACK_FUNCTION(Francois, letsGo);
ADD_CALLBACK_FUNCTION(Francois, chapter1);
ADD_CALLBACK_FUNCTION(Francois, chapter1Handler);
- ADD_CALLBACK_FUNCTION(Francois, function19);
+ ADD_CALLBACK_FUNCTION(Francois, inCompartment);
ADD_CALLBACK_FUNCTION(Francois, function20);
ADD_CALLBACK_FUNCTION(Francois, chapter2);
- ADD_CALLBACK_FUNCTION(Francois, chapter2Handler);
- ADD_CALLBACK_FUNCTION(Francois, function23);
+ ADD_CALLBACK_FUNCTION(Francois, atBreakfast);
+ ADD_CALLBACK_FUNCTION(Francois, withMama);
ADD_CALLBACK_FUNCTION(Francois, chapter3);
ADD_CALLBACK_FUNCTION(Francois, chapter3Handler);
ADD_CALLBACK_FUNCTION(Francois, chapter4);
@@ -106,7 +106,7 @@ IMPLEMENT_FUNCTION_II(7, Francois, savegame, SavegameType, uint32)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_II(8, Francois, updateEntity, CarIndex, EntityPosition)
+IMPLEMENT_FUNCTION_II(8, Francois, doWalk, CarIndex, EntityPosition)
switch (savepoint.action) {
default:
break;
@@ -196,13 +196,13 @@ IMPLEMENT_FUNCTION_II(8, Francois, updateEntity, CarIndex, EntityPosition)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(9, Francois, function9)
+IMPLEMENT_FUNCTION(9, Francois, exitCompartment)
switch (savepoint.action) {
default:
break;
case kActionDefault:
- if (getObjects()->get(kObjectCompartmentD).location == kObjectLocation2) {
+ if (getObjects()->get(kObjectCompartmentD).status == kObjectLocation2) {
getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
getSavePoints()->push(kEntityFrancois, kEntityMmeBoutarel, kAction134289824);
setCallback(1);
@@ -232,13 +232,13 @@ IMPLEMENT_FUNCTION(9, Francois, function9)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(10, Francois, function10)
+IMPLEMENT_FUNCTION(10, Francois, enterCompartment)
switch (savepoint.action) {
default:
break;
case kActionDefault:
- if (getObjects()->get(kObjectCompartmentD).location == kObjectLocation2) {
+ if (getObjects()->get(kObjectCompartmentD).status == kObjectLocation2) {
getObjects()->update(kObjectCompartmentD, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
setCallback(1);
setup_enterExitCompartment2("605Bd", kObjectCompartmentD);
@@ -270,7 +270,7 @@ IMPLEMENT_FUNCTION(10, Francois, function10)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_I(11, Francois, function11, TimeValue)
+IMPLEMENT_FUNCTION_I(11, Francois, rampage, TimeValue)
switch (savepoint.action) {
default:
break;
@@ -375,7 +375,7 @@ label_callback:
getSoundQueue()->processEntry(kEntityFrancois);
setCallback(4);
- setup_updateEntity(kCarRedSleeping, kPosition_5790);
+ setup_doWalk(kCarRedSleeping, kPosition_5790);
}
break;
@@ -400,7 +400,7 @@ label_callback:
case kActionDefault:
setCallback(1);
- setup_function9();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -437,7 +437,7 @@ label_callback:
case 4:
setCallback(5);
- setup_function10();
+ setup_enterCompartment();
break;
case 5:
@@ -477,14 +477,14 @@ label_callback:
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(12, Francois, function12)
+IMPLEMENT_FUNCTION(12, Francois, takeWalk)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function9();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -494,7 +494,7 @@ IMPLEMENT_FUNCTION(12, Francois, function12)
case 1:
setCallback(2);
- setup_updateEntity(kCarRedSleeping, kPosition_9460);
+ setup_doWalk(kCarRedSleeping, kPosition_9460);
break;
case 2:
@@ -504,7 +504,7 @@ IMPLEMENT_FUNCTION(12, Francois, function12)
case 3:
setCallback(4);
- setup_updateEntity(kCarRedSleeping, kPosition_540);
+ setup_doWalk(kCarRedSleeping, kPosition_540);
break;
case 4:
@@ -514,12 +514,12 @@ IMPLEMENT_FUNCTION(12, Francois, function12)
case 5:
setCallback(6);
- setup_updateEntity(kCarRedSleeping, kPosition_5790);
+ setup_doWalk(kCarRedSleeping, kPosition_5790);
break;
case 6:
setCallback(7);
- setup_function10();
+ setup_enterCompartment();
break;
case 7:
@@ -531,14 +531,14 @@ IMPLEMENT_FUNCTION(12, Francois, function12)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(13, Francois, function13)
+IMPLEMENT_FUNCTION(13, Francois, haremVisit)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function9();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -548,12 +548,12 @@ IMPLEMENT_FUNCTION(13, Francois, function13)
case 1:
setCallback(2);
- setup_updateEntity(kCarRedSleeping, kPosition_540);
+ setup_doWalk(kCarRedSleeping, kPosition_540);
break;
case 2:
setCallback(3);
- setup_updateEntity(kCarGreenSleeping, kPosition_4070);
+ setup_doWalk(kCarGreenSleeping, kPosition_4070);
break;
case 3:
@@ -577,13 +577,13 @@ IMPLEMENT_FUNCTION(13, Francois, function13)
getData()->location = kLocationOutsideCompartment;
setCallback(7);
- setup_updateEntity(kCarGreenSleeping, kPosition_4840);
+ setup_doWalk(kCarGreenSleeping, kPosition_4840);
break;
case 7:
if (getInventory()->hasItem(kItemWhistle) || getInventory()->get(kItemWhistle)->location == kObjectLocation3) {
setCallback(10);
- setup_updateEntity(kCarGreenSleeping, kPosition_5790);
+ setup_doWalk(kCarGreenSleeping, kPosition_5790);
break;
}
@@ -599,12 +599,12 @@ IMPLEMENT_FUNCTION(13, Francois, function13)
getEntities()->exitCompartment(kEntityFrancois, kObjectCompartmentE, true);
setCallback(10);
- setup_updateEntity(kCarGreenSleeping, kPosition_5790);
+ setup_doWalk(kCarGreenSleeping, kPosition_5790);
break;
case 10:
setCallback(11);
- setup_function10();
+ setup_enterCompartment();
break;
case 11:
@@ -621,7 +621,7 @@ IMPLEMENT_FUNCTION(13, Francois, function13)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
+IMPLEMENT_FUNCTION_IIS(14, Francois, chaseBeetle, ObjectIndex, EntityPosition)
// Expose parameters as IISS and ignore the default exposed parameters
EntityData::EntityParametersIISS *parameters = (EntityData::EntityParametersIISS*)_data->getCurrentParameters();
@@ -634,7 +634,7 @@ IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
strcat((char *)&parameters->seq2, (char *)&parameters->seq1);
setCallback(1);
- setup_function9();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -644,7 +644,7 @@ IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
case 1:
setCallback(2);
- setup_updateEntity(kCarRedSleeping, (EntityPosition)parameters->param2);
+ setup_doWalk(kCarRedSleeping, (EntityPosition)parameters->param2);
break;
case 2:
@@ -657,10 +657,10 @@ IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
} else {
if (parameters->param2 >= kPosition_5790) {
setCallback(10);
- setup_updateEntity(kCarRedSleeping, kPosition_9460);
+ setup_doWalk(kCarRedSleeping, kPosition_9460);
} else {
setCallback(9);
- setup_updateEntity(kCarRedSleeping, kPosition_540);
+ setup_doWalk(kCarRedSleeping, kPosition_540);
}
}
break;
@@ -688,7 +688,7 @@ IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
case 9:
setCallback(10);
- setup_updateEntity(kCarRedSleeping, kPosition_9460);
+ setup_doWalk(kCarRedSleeping, kPosition_9460);
break;
case 10:
@@ -698,12 +698,12 @@ IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
case 11:
setCallback(12);
- setup_updateEntity(kCarRedSleeping, kPosition_5790);
+ setup_doWalk(kCarRedSleeping, kPosition_5790);
break;
case 12:
setCallback(13);
- setup_function10();
+ setup_enterCompartment();
break;
case 13:
@@ -715,14 +715,14 @@ IMPLEMENT_FUNCTION_IIS(14, Francois, function14, ObjectIndex, EntityPosition)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(15, Francois, function15)
+IMPLEMENT_FUNCTION(15, Francois, findCath)
switch (savepoint.action) {
default:
break;
case kActionDefault:
setCallback(1);
- setup_function9();
+ setup_exitCompartment();
break;
case kActionCallback:
@@ -733,10 +733,10 @@ IMPLEMENT_FUNCTION(15, Francois, function15)
case 1:
if (getData()->entityPosition >= getEntityData(kEntityPlayer)->entityPosition) {
setCallback(3);
- setup_updateEntity(kCarRedSleeping, kPosition_540);
+ setup_doWalk(kCarRedSleeping, kPosition_540);
} else {
setCallback(2);
- setup_updateEntity(kCarRedSleeping, kPosition_9460);
+ setup_doWalk(kCarRedSleeping, kPosition_9460);
}
break;
@@ -748,12 +748,12 @@ IMPLEMENT_FUNCTION(15, Francois, function15)
case 4:
setCallback(5);
- setup_updateEntity(kCarRedSleeping, kPosition_5790);
+ setup_doWalk(kCarRedSleeping, kPosition_5790);
break;
case 5:
setCallback(6);
- setup_function10();
+ setup_enterCompartment();
break;
case 6:
@@ -780,7 +780,7 @@ IMPLEMENT_FUNCTION(15, Francois, function15)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(16, Francois, function16)
+IMPLEMENT_FUNCTION(16, Francois, letsGo)
switch (savepoint.action) {
default:
break;
@@ -809,7 +809,7 @@ IMPLEMENT_FUNCTION(16, Francois, function16)
getSavePoints()->push(kEntityFrancois, kEntityMmeBoutarel, kAction101107728);
setCallback(2);
- setup_updateEntity(kCarRestaurant, kPosition_850);
+ setup_doWalk(kCarRestaurant, kPosition_850);
break;
case 2:
@@ -836,7 +836,7 @@ IMPLEMENT_FUNCTION(16, Francois, function16)
case kAction100901266:
setCallback(3);
- setup_updateEntity(kCarRedSleeping, kPosition_5790);
+ setup_doWalk(kCarRedSleeping, kPosition_5790);
break;
}
IMPLEMENT_FUNCTION_END
@@ -871,24 +871,24 @@ IMPLEMENT_FUNCTION(18, Francois, chapter1Handler)
case kActionCallback:
if (getCallback() == 1)
- setup_function19();
+ setup_inCompartment();
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(19, Francois, function19)
+IMPLEMENT_FUNCTION(19, Francois, inCompartment)
switch (savepoint.action) {
default:
break;
case kActionNone:
- Entity::timeCheckCallback(kTime1161000, params->param1, 2, WRAP_SETUP_FUNCTION(Francois, setup_function12));
+ Entity::timeCheckCallback(kTime1161000, params->param1, 2, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk));
break;
case kAction101107728:
setCallback(1);
- setup_function16();
+ setup_letsGo();
break;
}
IMPLEMENT_FUNCTION_END
@@ -911,7 +911,7 @@ IMPLEMENT_FUNCTION(21, Francois, chapter2)
break;
case kActionNone:
- setup_chapter2Handler();
+ setup_atBreakfast();
break;
case kActionDefault:
@@ -927,7 +927,7 @@ IMPLEMENT_FUNCTION(21, Francois, chapter2)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(22, Francois, chapter2Handler)
+IMPLEMENT_FUNCTION(22, Francois, atBreakfast)
switch (savepoint.action) {
default:
break;
@@ -948,20 +948,20 @@ IMPLEMENT_FUNCTION(22, Francois, chapter2Handler)
getData()->entityPosition = kPosition_5790;
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityFrancois);
- setup_function23();
+ setup_withMama();
break;
}
break;
case kAction100901266:
setCallback(1);
- setup_updateEntity(kCarRedSleeping, kPosition_5790);
+ setup_doWalk(kCarRedSleeping, kPosition_5790);
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(23, Francois, function23)
+IMPLEMENT_FUNCTION(23, Francois, withMama)
switch (savepoint.action) {
default:
break;
@@ -973,7 +973,7 @@ IMPLEMENT_FUNCTION(23, Francois, function23)
if (ENTITY_PARAM(0, 1) && getEntities()->isPlayerInCar(kCarRedSleeping)) {
setCallback(1);
- setup_function15();
+ setup_findCath();
break;
}
@@ -982,7 +982,7 @@ label_callback_1:
break;
label_callback_2:
- if (Entity::timeCheckCallback(kTime1800000, params->param2, 3, WRAP_SETUP_FUNCTION(Francois, setup_function13)))
+ if (Entity::timeCheckCallback(kTime1800000, params->param2, 3, WRAP_SETUP_FUNCTION(Francois, setup_haremVisit)))
break;
label_callback_3:
@@ -1085,36 +1085,36 @@ IMPLEMENT_FUNCTION(25, Francois, chapter3Handler)
if (ENTITY_PARAM(0, 1) && getEntities()->isPlayerInCar(kCarRedSleeping)) {
setCallback(2);
- setup_function15();
+ setup_findCath();
break;
}
label_callback_2:
- if (Entity::timeCheckCallback(kTime2025000, params->param3, 3, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2025000, params->param3, 3, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_3:
- if (Entity::timeCheckCallback(kTime2052000, params->param4, 4, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2052000, params->param4, 4, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_4:
- if (Entity::timeCheckCallback(kTime2079000, params->param5, 5, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2079000, params->param5, 5, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_5:
- if (Entity::timeCheckCallback(kTime2092500, params->param6, 6, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2092500, params->param6, 6, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_6:
- if (Entity::timeCheckCallback(kTime2173500, params->param7, 7, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2173500, params->param7, 7, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_7:
- if (Entity::timeCheckCallback(kTime2182500, params->param8, 8, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2182500, params->param8, 8, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_8:
- if (Entity::timeCheckCallback(kTime2241000, CURRENT_PARAM(1, 1), 9, WRAP_SETUP_FUNCTION(Francois, setup_function12)))
+ if (Entity::timeCheckCallback(kTime2241000, CURRENT_PARAM(1, 1), 9, WRAP_SETUP_FUNCTION(Francois, setup_takeWalk)))
break;
label_callback_9:
@@ -1208,7 +1208,7 @@ label_callback_14:
case kAction101107728:
setCallback(1);
- setup_function16();
+ setup_letsGo();
break;
case kAction189872836:
@@ -1246,7 +1246,7 @@ IMPLEMENT_FUNCTION_END
IMPLEMENT_FUNCTION(27, Francois, chapter4Handler)
if (savepoint.action == kAction101107728) {
setCallback(1);
- setup_function16();
+ setup_letsGo();
}
IMPLEMENT_FUNCTION_END
@@ -1314,7 +1314,7 @@ bool Francois::timeCheckCallbackCompartment(TimeValue timeValue, uint &parameter
if (getState()->time > timeValue && !parameter) {
parameter = 1;
setCallback(callback);
- setup_function14(compartment, position, sequenceSuffix);
+ setup_chaseBeetle(compartment, position, sequenceSuffix);
return true;
}
@@ -1326,7 +1326,7 @@ bool Francois::timeCheckCallback(TimeValue timeValue, uint &parameter, byte call
if (getState()->time > timeValue && !parameter) {
parameter = 1;
setCallback(callback);
- setup_function11(timeValue2);
+ setup_rampage(timeValue2);
return true;
}
diff --git a/engines/lastexpress/entities/francois.h b/engines/lastexpress/entities/francois.h
index 51270fa4b6..3118faf867 100644
--- a/engines/lastexpress/entities/francois.h
+++ b/engines/lastexpress/entities/francois.h
@@ -85,21 +85,21 @@ public:
DECLARE_FUNCTION_2(savegame, SavegameType savegameType, uint32 param)
/**
- * Updates the entity
+ * Walk
*
* @param car The car
* @param entityPosition The entity position
*/
- DECLARE_FUNCTION_2(updateEntity, CarIndex car, EntityPosition entityPosition)
+ DECLARE_FUNCTION_2(doWalk, CarIndex car, EntityPosition entityPosition)
- DECLARE_FUNCTION(function9)
- DECLARE_FUNCTION(function10)
- DECLARE_FUNCTION_1(function11, TimeValue timeValue)
- DECLARE_FUNCTION(function12)
- DECLARE_FUNCTION(function13)
- DECLARE_FUNCTION_3(function14, ObjectIndex compartment, EntityPosition entityPosition, const char *str)
- DECLARE_FUNCTION(function15)
- DECLARE_FUNCTION(function16)
+ DECLARE_FUNCTION(exitCompartment)
+ DECLARE_FUNCTION(enterCompartment)
+ DECLARE_FUNCTION_1(rampage, TimeValue timeValue)
+ DECLARE_FUNCTION(takeWalk)
+ DECLARE_FUNCTION(haremVisit)
+ DECLARE_FUNCTION_3(chaseBeetle, ObjectIndex compartment, EntityPosition entityPosition, const char *str)
+ DECLARE_FUNCTION(findCath)
+ DECLARE_FUNCTION(letsGo)
/**
* Setup Chapter 1
@@ -110,8 +110,7 @@ public:
* Handle Chapter 1 events
*/
DECLARE_FUNCTION(chapter1Handler)
-
- DECLARE_FUNCTION(function19)
+ DECLARE_FUNCTION(inCompartment)
DECLARE_FUNCTION(function20)
/**
@@ -122,9 +121,8 @@ public:
/**
* Handle Chapter 2 events
*/
- DECLARE_FUNCTION(chapter2Handler)
-
- DECLARE_FUNCTION(function23)
+ DECLARE_FUNCTION(atBreakfast)
+ DECLARE_FUNCTION(withMama)
/**
* Setup Chapter 3
@@ -155,7 +153,6 @@ public:
* Handle Chapter 5 events
*/
DECLARE_FUNCTION(chapter5Handler)
-
DECLARE_FUNCTION(function30)
DECLARE_NULL_FUNCTION()
diff --git a/engines/lastexpress/entities/gendarmes.cpp b/engines/lastexpress/entities/gendarmes.cpp
index a912fa4ecb..2ff34ef4c9 100644
--- a/engines/lastexpress/entities/gendarmes.cpp
+++ b/engines/lastexpress/entities/gendarmes.cpp
@@ -250,7 +250,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje
if (!params->param5)
params->param5 = getState()->timeTicks + 75;
- if (!getEntities()->isOutsideAlexeiWindow() && getObjects()->get((ObjectIndex)params->param3).location != kObjectLocation1) {
+ if (!getEntities()->isOutsideAlexeiWindow() && getObjects()->get((ObjectIndex)params->param3).status != kObjectLocation1) {
setCallback(2);
setup_savegame(kSavegameTypeEvent, kEventGendarmesArrestation);
break;
@@ -284,7 +284,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje
break;
case kActionKnock:
- getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).location, kCursorNormal, kCursorNormal);
+ getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).status, kCursorNormal, kCursorNormal);
setCallback(5);
setup_arrestPlaysound16("POL1046B");
@@ -296,7 +296,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje
break;
case kActionDefault:
- getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).location, kCursorNormal, kCursorNormal);
+ getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).status, kCursorNormal, kCursorNormal);
setCallback(1);
setup_arrestPlaysound16("POL1046");
@@ -308,7 +308,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje
break;
case 1:
- getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).location, kCursorTalk, kCursorNormal);
+ getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).status, kCursorTalk, kCursorNormal);
break;
case 2:
@@ -334,7 +334,7 @@ IMPLEMENT_FUNCTION_III(10, Gendarmes, function10, CarIndex, EntityPosition, Obje
break;
case 5:
- getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).location, kCursorNormal, kCursorHand);
+ getObjects()->update((ObjectIndex)params->param3, kEntityGendarmes, getObjects()->get((ObjectIndex)params->param3).status, kCursorNormal, kCursorHand);
break;
case 6:
diff --git a/engines/lastexpress/entities/kahina.cpp b/engines/lastexpress/entities/kahina.cpp
index 467c8d8b3c..29e9a90d41 100644
--- a/engines/lastexpress/entities/kahina.cpp
+++ b/engines/lastexpress/entities/kahina.cpp
@@ -503,16 +503,16 @@ IMPLEMENT_FUNCTION(15, Kahina, function15)
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityKahina);
- getObjects()->update(kObjectCompartmentC, kEntityPlayer, getObjects()->get(kObjectCompartmentC).location, kCursorNormal, kCursorNormal);
- getObjects()->update(kObject50, kEntityPlayer, getObjects()->get(kObject50).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartmentC, kEntityPlayer, getObjects()->get(kObjectCompartmentC).status, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObject50, kEntityPlayer, getObjects()->get(kObject50).status, kCursorNormal, kCursorNormal);
setCallback(13);
setup_updateFromTime(900);
break;
case 13:
- getObjects()->update(kObjectCompartmentC, kEntityPlayer, getObjects()->get(kObjectCompartmentC).location, kCursorHandKnock, kCursorHand);
- getObjects()->update(kObject50, kEntityPlayer, getObjects()->get(kObject50).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartmentC, kEntityPlayer, getObjects()->get(kObjectCompartmentC).status, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObject50, kEntityPlayer, getObjects()->get(kObject50).status, kCursorHandKnock, kCursorHand);
setCallback(14);
setup_enterExitCompartment("616Bc", kObjectCompartmentC);
@@ -1088,16 +1088,16 @@ IMPLEMENT_FUNCTION(23, Kahina, function23)
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityKahina);
- getObjects()->update(kObjectCompartmentF, kEntityPlayer, getObjects()->get(kObjectCompartmentF).location, kCursorNormal, kCursorNormal);
- getObjects()->update(kObject53, kEntityPlayer, getObjects()->get(kObject53).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartmentF, kEntityPlayer, getObjects()->get(kObjectCompartmentF).status, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObject53, kEntityPlayer, getObjects()->get(kObject53).status, kCursorNormal, kCursorNormal);
setCallback(3);
setup_updateFromTime(900);
break;
case 3:
- getObjects()->update(kObjectCompartmentF, kEntityPlayer, getObjects()->get(kObjectCompartmentF).location, kCursorHandKnock, kCursorHand);
- getObjects()->update(kObject53, kEntityPlayer, getObjects()->get(kObject53).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartmentF, kEntityPlayer, getObjects()->get(kObjectCompartmentF).status, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObject53, kEntityPlayer, getObjects()->get(kObject53).status, kCursorHandKnock, kCursorHand);
setCallback(4);
setup_enterExitCompartment("616Df", kObjectCompartmentF);
@@ -1436,16 +1436,16 @@ IMPLEMENT_FUNCTION(26, Kahina, function26)
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityKahina);
- getObjects()->update(kObjectCompartmentA, kEntityPlayer, getObjects()->get(kObjectCompartmentA).location, kCursorNormal, kCursorNormal);
- getObjects()->update(kObject48, kEntityPlayer, getObjects()->get(kObject48).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartmentA, kEntityPlayer, getObjects()->get(kObjectCompartmentA).status, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObject48, kEntityPlayer, getObjects()->get(kObject48).status, kCursorNormal, kCursorNormal);
setCallback(7);
setup_updateFromTime(900);
break;
case 7:
- getObjects()->update(kObjectCompartmentA, kEntityPlayer, getObjects()->get(kObjectCompartmentA).location, kCursorHandKnock, kCursorHand);
- getObjects()->update(kObject48, kEntityPlayer, getObjects()->get(kObject48).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartmentA, kEntityPlayer, getObjects()->get(kObjectCompartmentA).status, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObject48, kEntityPlayer, getObjects()->get(kObject48).status, kCursorHandKnock, kCursorHand);
if (getInventory()->get(kItemFirebird)->location == kObjectLocation1 || getInventory()->get(kItemFirebird)->location == kObjectLocation2) {
getScenes()->loadSceneFromItemPosition(kItemFirebird);
diff --git a/engines/lastexpress/entities/kronos.cpp b/engines/lastexpress/entities/kronos.cpp
index 26ce3ca424..38a685ec19 100644
--- a/engines/lastexpress/entities/kronos.cpp
+++ b/engines/lastexpress/entities/kronos.cpp
@@ -399,7 +399,7 @@ IMPLEMENT_FUNCTION(18, Kronos, function18)
case kActionNone:
if (getState()->time > kTime2079000 && !params->param2) {
- getObjects()->updateLocation2(kObjectCompartmentKronos, kObjectLocation3);
+ getObjects()->updateModel(kObjectCompartmentKronos, kObjectModel3);
getObjects()->update(kObjectCompartmentKronos, kEntityPlayer, kObjectLocation3, kCursorHandKnock, kCursorHand);
params->param1 = 1;
params->param2 = 1;
@@ -462,7 +462,7 @@ IMPLEMENT_FUNCTION(19, Kronos, function19)
RESET_ENTITY_STATE(kEntityRebecca, Rebecca, setup_function39);
RESET_ENTITY_STATE(kEntitySophie, Sophie, setup_chaptersHandler);
RESET_ENTITY_STATE(kEntityAugust, August, setup_function50);
- RESET_ENTITY_STATE(kEntityAnna, Anna, setup_function56);
+ RESET_ENTITY_STATE(kEntityAnna, Anna, setup_concert);
RESET_ENTITY_STATE(kEntityTatiana, Tatiana, setup_function35);
setup_function20();
diff --git a/engines/lastexpress/entities/mertens.cpp b/engines/lastexpress/entities/mertens.cpp
index 97dd293793..f484d00a2c 100644
--- a/engines/lastexpress/entities/mertens.cpp
+++ b/engines/lastexpress/entities/mertens.cpp
@@ -1067,7 +1067,7 @@ IMPLEMENT_FUNCTION_II(21, Mertens, function21, ObjectIndex, ObjectIndex)
break;
// Update objects
- getObjects()->updateLocation2((ObjectIndex)params->param1, kObjectLocation1);
+ getObjects()->updateModel((ObjectIndex)params->param1, kObjectModel1);
if (params->param5 != kObjectLocation2)
getObjects()->update((ObjectIndex)params->param1, (EntityIndex)params->param4, (ObjectLocation)params->param5, (CursorStyle)params->param6, (CursorStyle)params->param7);
@@ -1090,15 +1090,15 @@ IMPLEMENT_FUNCTION_II(21, Mertens, function21, ObjectIndex, ObjectIndex)
case kActionDefault:
params->param3 = 1;
params->param4 = getObjects()->get((ObjectIndex)params->param1).entity;
- params->param5 = getObjects()->get((ObjectIndex)params->param1).location;
- params->param6 = getObjects()->get((ObjectIndex)params->param1).cursor;
- params->param7 = getObjects()->get((ObjectIndex)params->param1).cursor2;
+ params->param5 = getObjects()->get((ObjectIndex)params->param1).status;
+ params->param6 = getObjects()->get((ObjectIndex)params->param1).windowCursor;
+ params->param7 = getObjects()->get((ObjectIndex)params->param1).handleCursor;
if (params->param2) {
- params->param8 = getObjects()->get((ObjectIndex)params->param2).entity;
- CURRENT_PARAM(1, 1) = getObjects()->get((ObjectIndex)params->param2).location;
- CURRENT_PARAM(1, 2) = getObjects()->get((ObjectIndex)params->param2).cursor;
- CURRENT_PARAM(1, 3) = getObjects()->get((ObjectIndex)params->param2).cursor2;
+ params->param8 = getObjects()->get((ObjectIndex)params->param2).entity;
+ CURRENT_PARAM(1, 1) = getObjects()->get((ObjectIndex)params->param2).status;
+ CURRENT_PARAM(1, 2) = getObjects()->get((ObjectIndex)params->param2).windowCursor;
+ CURRENT_PARAM(1, 3) = getObjects()->get((ObjectIndex)params->param2).handleCursor;
getObjects()->update((ObjectIndex)params->param2, kEntityMertens, kObjectLocation1, kCursorHandKnock, kCursorHand);
}
@@ -1506,7 +1506,7 @@ IMPLEMENT_FUNCTION_I(26, Mertens, function26, bool)
getData()->location = kLocationInsideCompartment;
getEntities()->clearSequences(kEntityMertens);
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
setCallback(3);
setup_playSound16("ZNU1001");
@@ -1522,14 +1522,14 @@ IMPLEMENT_FUNCTION_I(26, Mertens, function26, bool)
break;
case 1:
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
setCallback(2);
setup_playSound16("CON1062");
break;
case 2:
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
@@ -1617,7 +1617,7 @@ IMPLEMENT_FUNCTION_I(27, Mertens, tylerCompartment, MertensActionType)
}
if (Entity::updateParameter(params->param2, getState()->timeTicks, 150)) {
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
setCallback(10);
setup_playSound16("CON1018A");
@@ -1683,7 +1683,7 @@ label_callback11:
} else {
params->param3 = kTimeInvalid;
- if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1) {
+ if (getObjects()->get(kObjectCompartment1).status == kObjectLocation1) {
getObjects()->update(kObjectCompartment1, kEntityPlayer, kObjectLocation1, kCursorNormal, kCursorNormal);
setCallback(11);
@@ -1742,11 +1742,11 @@ label_callback11:
case kActionKnock:
if (params->param1) {
- getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
switch (params->param1) {
default:
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
@@ -1774,7 +1774,7 @@ label_callback11:
break;
case kActionOpenDoor:
- getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).location == kObjectLocation1 ? "LIB012" : "LIB014");
+ getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).status == kObjectLocation1 ? "LIB012" : "LIB014");
if (getProgress().eventCorpseMovedFromFloor) {
@@ -1828,7 +1828,7 @@ label_callback11:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_8200)
|| getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_7850)
|| getEntities()->isOutsideAlexeiWindow()) {
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
if (getEntities()->isOutsideAlexeiWindow())
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
@@ -1920,15 +1920,15 @@ label_callback11:
case 8:
case 9:
- getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).location, kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).status, kCursorTalk, kCursorHand);
break;
case 10:
- getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).location, kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).status, kCursorTalk, kCursorHand);
goto label_callback10;
case 11:
- getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).location, kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMertens, getObjects()->get(kObjectCompartment1).status, kCursorTalk, kCursorHand);
goto label_callback11;
case 13:
@@ -1971,20 +1971,20 @@ label_callback11:
case 23:
getProgress().eventMertensAugustWaiting = true;
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
case 24:
getProgress().eventMertensKronosInvitation = true;
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
case 25:
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
@@ -2182,7 +2182,7 @@ IMPLEMENT_FUNCTION_I(30, Mertens, function30, MertensActionType)
case 2:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_7500)) {
- getObjects()->update(kObjectCompartment2, kEntityPlayer, getObjects()->get(kObjectCompartment2).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment2, kEntityPlayer, getObjects()->get(kObjectCompartment2).status, kCursorNormal, kCursorNormal);
params->param3 = 1;
}
@@ -2192,7 +2192,7 @@ IMPLEMENT_FUNCTION_I(30, Mertens, function30, MertensActionType)
case 3:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_6470)) {
- getObjects()->update(kObjectCompartment3, kEntityPlayer, getObjects()->get(kObjectCompartment3).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment3, kEntityPlayer, getObjects()->get(kObjectCompartment3).status, kCursorNormal, kCursorNormal);
params->param3 = 1;
}
@@ -2220,7 +2220,7 @@ IMPLEMENT_FUNCTION_I(30, Mertens, function30, MertensActionType)
case 5:
if (params->param3)
- getObjects()->update(kObjectCompartment2, kEntityPlayer, getObjects()->get(kObjectCompartment2).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment2, kEntityPlayer, getObjects()->get(kObjectCompartment2).status, kCursorHandKnock, kCursorHand);
getEntities()->exitCompartment(kEntityMertens, kObjectCompartment2);
@@ -2241,7 +2241,7 @@ IMPLEMENT_FUNCTION_I(30, Mertens, function30, MertensActionType)
case 7:
if (params->param3)
- getObjects()->update(kObjectCompartment3, kEntityPlayer, getObjects()->get(kObjectCompartment3).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment3, kEntityPlayer, getObjects()->get(kObjectCompartment3).status, kCursorHandKnock, kCursorHand);
getEntities()->exitCompartment(kEntityMertens, kObjectCompartment3);
@@ -3688,9 +3688,9 @@ IMPLEMENT_FUNCTION(48, Mertens, function48)
if (ENTITY_PARAM(2, 3)) {
params->param1 = 1;
- getObjects()->updateLocation2(kObjectCompartment2, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartment3, kObjectLocation1);
- getObjects()->updateLocation2(kObjectCompartment4, kObjectLocation1);
+ getObjects()->updateModel(kObjectCompartment2, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartment3, kObjectModel1);
+ getObjects()->updateModel(kObjectCompartment4, kObjectModel1);
ENTITY_PARAM(1, 4) = 0;
ENTITY_PARAM(1, 5) = 0;
diff --git a/engines/lastexpress/entities/milos.cpp b/engines/lastexpress/entities/milos.cpp
index 519a613497..76dc0aa0a0 100644
--- a/engines/lastexpress/entities/milos.cpp
+++ b/engines/lastexpress/entities/milos.cpp
@@ -433,16 +433,16 @@ IMPLEMENT_FUNCTION(14, Milos, function14)
if (CURRENT_PARAM(1, 1) < getState()->timeTicks) {
- if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1) {
+ if (getObjects()->get(kObjectCompartment1).status == kObjectLocation1) {
if (!Entity::updateParameter(CURRENT_PARAM(1, 2), getState()->timeTicks, 75))
break;
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
++params->param5;
switch (params->param5) {
default:
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, params->param3 < 1 ? kCursorTalk : kCursorNormal, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, params->param3 < 1 ? kCursorTalk : kCursorNormal, kCursorHand);
CURRENT_PARAM(1, 2) = 0;
break;
@@ -466,19 +466,19 @@ IMPLEMENT_FUNCTION(14, Milos, function14)
if (params->param7 < 3) {
params->param5 = 1;
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, params->param3 < 1 ? kCursorTalk : kCursorNormal, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, params->param3 < 1 ? kCursorTalk : kCursorNormal, kCursorHand);
CURRENT_PARAM(1, 2) = 0;
break;
}
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
callbackAction();
break;
}
} else {
if (getProgress().eventCorpseMovedFromFloor && getProgress().jacket != kJacketBlood) {
- params->param6 = (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) ? kEventMilosTylerCompartmentBedVisit : kEventMilosTylerCompartmentVisit;
+ params->param6 = (getObjects()->get(kObjectCompartment1).model == kObjectModel1) ? kEventMilosTylerCompartmentBedVisit : kEventMilosTylerCompartmentVisit;
setCallback(3);
setup_savegame(kSavegameTypeEvent, kEventMilosTylerCompartmentVisit);
@@ -538,7 +538,7 @@ label_callback_12:
setCallback(20);
setup_playSound("LIB012");
} else if (!params->param3) {
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
setCallback(22);
setup_playSound16("MIL1032");
@@ -549,9 +549,9 @@ label_callback_12:
if (getProgress().eventCorpseMovedFromFloor && getProgress().jacket != kJacketBlood) {
if (params->param2) {
getEntityData(kEntityPlayer)->location = kLocationInsideCompartment;
- params->param6 = (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) ? kEventMilosTylerCompartmentBed : kEventMilosTylerCompartment;
+ params->param6 = (getObjects()->get(kObjectCompartment1).model == kObjectModel1) ? kEventMilosTylerCompartmentBed : kEventMilosTylerCompartment;
} else {
- params->param6 = (getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) ? kEventMilosTylerCompartmentBedVisit : kEventMilosTylerCompartmentVisit;
+ params->param6 = (getObjects()->get(kObjectCompartment1).model == kObjectModel1) ? kEventMilosTylerCompartmentBedVisit : kEventMilosTylerCompartmentVisit;
}
setCallback(17);
@@ -568,14 +568,14 @@ label_callback_12:
if (getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_8200)
|| getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_7850)
|| getEntities()->isOutsideAlexeiWindow()) {
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorNormal);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorNormal);
if (getEntities()->isOutsideAlexeiWindow())
getScenes()->loadSceneFromPosition(kCarGreenSleeping, 49);
getSound()->playSound(kEntityPlayer, "LIB012");
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, kCursorTalk, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, kCursorTalk, kCursorHand);
params->param1 = 1;
} else {
@@ -644,7 +644,7 @@ label_callback_12:
case 7:
case 9:
case 11:
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, params->param3 < 1 ? kCursorTalk : kCursorNormal, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, params->param3 < 1 ? kCursorTalk : kCursorNormal, kCursorHand);
CURRENT_PARAM(1, 2) = 0;
break;
@@ -682,13 +682,13 @@ label_callback_12:
break;
case 16:
- getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).location == kObjectLocation1 ? "LIB032" : "LIB014");
+ getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).status == kObjectLocation1 ? "LIB032" : "LIB014");
getAction()->playAnimation(kEventMilosCorpseFloor);
getLogic()->gameOver(kSavegameTypeIndex, 1, getProgress().eventCorpseMovedFromFloor ? kSceneGameOverBloodJacket : kSceneGameOverPolice1, true);
break;
case 17:
- getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).location == kObjectLocation1 ? "LIB032" : "LIB014");
+ getSound()->playSound(kEntityPlayer, getObjects()->get(kObjectCompartment1).status == kObjectLocation1 ? "LIB032" : "LIB014");
getObjects()->update(kObjectCompartment1, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
getObjects()->update(kObjectOutsideTylerCompartment, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
getAction()->playAnimation((EventIndex)params->param6);
@@ -708,7 +708,7 @@ label_callback_12:
case 22:
params->param3 = 1;
- getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityMilos, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorHand);
break;
}
break;
diff --git a/engines/lastexpress/entities/rebecca.cpp b/engines/lastexpress/entities/rebecca.cpp
index 5bcb6aef85..8c779baeba 100644
--- a/engines/lastexpress/entities/rebecca.cpp
+++ b/engines/lastexpress/entities/rebecca.cpp
@@ -665,7 +665,7 @@ IMPLEMENT_FUNCTION(21, Rebecca, chapter1)
getObjects()->update(kObject52, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
getObjects()->update(kObjectOutsideBetweenCompartments, kEntityPlayer, kObjectLocationNone, kCursorKeepValue, kCursorKeepValue);
- getObjects()->updateLocation2(kObject110, kObjectLocation1);
+ getObjects()->updateModel(kObject110, kObjectModel1);
getData()->entityPosition = kPosition_2830;
getData()->location = kLocationInsideCompartment;
@@ -1051,7 +1051,7 @@ IMPLEMENT_FUNCTION(28, Rebecca, chapter2)
getObjects()->update(kObjectCompartmentE, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
getObjects()->update(kObject52, kEntityPlayer, kObjectLocation1, kCursorHandKnock, kCursorHand);
- getObjects()->updateLocation2(kObject110, kObjectLocation2);
+ getObjects()->updateModel(kObject110, kObjectModel2);
ENTITY_PARAM(0, 2) = 1;
break;
@@ -1574,7 +1574,7 @@ IMPLEMENT_FUNCTION(42, Rebecca, chapter4)
getData()->clothes = kClothesDefault;
getData()->inventoryItem = kItemNone;
- getObjects()->updateLocation2(kObject110, kObjectLocation3);
+ getObjects()->updateModel(kObject110, kObjectModel3);
ENTITY_PARAM(0, 1) = 0;
ENTITY_PARAM(0, 2) = 1;
@@ -1750,7 +1750,7 @@ IMPLEMENT_FUNCTION(46, Rebecca, chapter5)
getData()->car = kCarRestaurant;
getData()->inventoryItem = kItemNone;
- getObjects()->updateLocation2(kObject110, kObjectLocation4);
+ getObjects()->updateModel(kObject110, kObjectModel4);
break;
}
IMPLEMENT_FUNCTION_END
diff --git a/engines/lastexpress/entities/servers0.cpp b/engines/lastexpress/entities/servers0.cpp
index 73e0d34722..6323ef0ca8 100644
--- a/engines/lastexpress/entities/servers0.cpp
+++ b/engines/lastexpress/entities/servers0.cpp
@@ -115,7 +115,7 @@ IMPLEMENT_FUNCTION_NOSETUP(5, Servers0, callbackActionOnDirection)
case kActionExitCompartment:
callbackAction();
- break;
+ break;
case kActionExcuseMeCath:
if (!params->param1) {
@@ -445,7 +445,7 @@ IMPLEMENT_FUNCTION(24, Servers0, chapter2Handler)
HANDLE_TABLE(1, 3, 1, setup_function25);
HANDLE_TABLE(1, 4, 2, setup_function26);
- break;
+ break;
case kActionCallback:
if (getCallback() == 1)
diff --git a/engines/lastexpress/entities/tatiana.cpp b/engines/lastexpress/entities/tatiana.cpp
index 432def6253..d6bf4479e9 100644
--- a/engines/lastexpress/entities/tatiana.cpp
+++ b/engines/lastexpress/entities/tatiana.cpp
@@ -835,7 +835,7 @@ IMPLEMENT_FUNCTION(27, Tatiana, function27)
break;
case 1:
- RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_function30);
+ RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_atBreakfast);
getAction()->playAnimation(kEventTatianaBreakfastAlexei);
getInventory()->addItem(kItemParchemin);
getInventory()->setLocationAndProcess(kItem11, kObjectLocation1);
@@ -843,7 +843,7 @@ IMPLEMENT_FUNCTION(27, Tatiana, function27)
break;
case 2:
- RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_function30);
+ RESET_ENTITY_STATE(kEntityAlexei, Alexei, setup_atBreakfast);
getAction()->playAnimation(kEventTatianaBreakfast);
if (getInventory()->hasItem(kItemParchemin)) {
getAction()->playAnimation(kEventTatianaBreakfastGivePoem);
@@ -1917,7 +1917,7 @@ IMPLEMENT_FUNCTION(47, Tatiana, function47)
case 3:
case 4:
- if (ENTITY_PARAM(0, 1) && getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1) {
+ if (ENTITY_PARAM(0, 1) && getObjects()->get(kObjectCompartment1).model == kObjectModel1) {
setup_function48();
} else {
setCallback(4);
@@ -1940,7 +1940,7 @@ IMPLEMENT_FUNCTION(48, Tatiana, function48)
if (!getEvent(kEventTatianaTylerCompartment) && getEntities()->isInsideCompartment(kEntityPlayer, kCarGreenSleeping, kPosition_8200)) {
params->param1 = 1;
getProgress().field_E4 = 1;
- getObjects()->update(kObjectCompartment1, kEntityTatiana, getObjects()->get(kObjectCompartment1).location, kCursorNormal, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityTatiana, getObjects()->get(kObjectCompartment1).status, kCursorNormal, kCursorHand);
}
if (!params->param1)
@@ -1948,7 +1948,7 @@ IMPLEMENT_FUNCTION(48, Tatiana, function48)
}
if (!getEntities()->checkFields19(kEntityPlayer, kCarGreenSleeping, kPosition_7850)) {
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
params->param1 = 0;
}
@@ -1964,7 +1964,7 @@ IMPLEMENT_FUNCTION(48, Tatiana, function48)
label_end:
if (getEvent(kEventTatianaTylerCompartment) || getState()->time > kTime2475000) {
if (params->param1)
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
getProgress().field_E4 = 0;
getEntities()->exitCompartment(kEntityTatiana, kObjectCompartment2, true);
@@ -2040,7 +2040,7 @@ label_end:
case kAction238790488:
params->param1 = 0;
- getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).location, kCursorHandKnock, kCursorHand);
+ getObjects()->update(kObjectCompartment1, kEntityPlayer, getObjects()->get(kObjectCompartment1).status, kCursorHandKnock, kCursorHand);
getEntities()->exitCompartment(kEntityTatiana, kObjectCompartment2, true);
getEntities()->clearSequences(kEntityTatiana);
diff --git a/engines/lastexpress/entities/vassili.cpp b/engines/lastexpress/entities/vassili.cpp
index 4695f8831f..67135c426f 100644
--- a/engines/lastexpress/entities/vassili.cpp
+++ b/engines/lastexpress/entities/vassili.cpp
@@ -112,7 +112,7 @@ IMPLEMENT_FUNCTION(5, Vassili, chapter1Handler)
break;
}
- if (!params->param2 && getObjects()->get(kObjectCompartmentA).location == kObjectLocation1) {
+ if (!params->param2 && getObjects()->get(kObjectCompartmentA).status == kObjectLocation1) {
params->param2 = 1;
getEntities()->drawSequenceLeft(kEntityVassili, "303A");
getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
@@ -289,7 +289,7 @@ IMPLEMENT_FUNCTION(9, Vassili, function9)
case kActionDefault:
case kActionDrawScene:
- if ((getObjects()->get(kObjectCompartmentA).location == kObjectLocation2 && getEntities()->isPlayerPosition(kCarRedSleeping, 17))
+ if ((getObjects()->get(kObjectCompartmentA).status == kObjectLocation2 && getEntities()->isPlayerPosition(kCarRedSleeping, 17))
|| getEntities()->isPlayerPosition(kCarRedSleeping, 18)
|| getEntities()->isPlayerPosition(kCarRedSleeping, 37)
|| getEntities()->isPlayerPosition(kCarRedSleeping, 38)
@@ -388,7 +388,7 @@ IMPLEMENT_FUNCTION(12, Vassili, chapter2)
getData()->inventoryItem = kItemNone;
getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
- getObjects()->updateLocation2(kObjectCompartmentA, kObjectLocation1);
+ getObjects()->updateModel(kObjectCompartmentA, kObjectModel1);
break;
}
IMPLEMENT_FUNCTION_END
@@ -532,7 +532,7 @@ IMPLEMENT_FUNCTION(16, Vassili, chapter4)
getData()->inventoryItem = kItemNone;
getObjects()->update(kObjectCompartmentA, kEntityPlayer, kObjectLocationNone, kCursorHandKnock, kCursorHand);
- getObjects()->updateLocation2(kObjectCompartmentA, kObjectLocation1);
+ getObjects()->updateModel(kObjectCompartmentA, kObjectModel1);
break;
}
IMPLEMENT_FUNCTION_END
diff --git a/engines/lastexpress/entities/verges.cpp b/engines/lastexpress/entities/verges.cpp
index d9ddb0a4d1..f1e980842e 100644
--- a/engines/lastexpress/entities/verges.cpp
+++ b/engines/lastexpress/entities/verges.cpp
@@ -105,7 +105,7 @@ IMPLEMENT_FUNCTION(3, Verges, callbackActionOnDirection)
case kActionExitCompartment:
callbackAction();
- break;
+ break;
case kActionExcuseMeCath:
if (!params->param1) {
@@ -1816,7 +1816,7 @@ IMPLEMENT_FUNCTION(41, Verges, askPassengersToStayInCompartments)
break;
case kActionDefault:
- getObjects()->updateLocation2(kObjectRestaurantCar, kObjectLocation3);
+ getObjects()->updateModel(kObjectRestaurantCar, kObjectModel3);
getData()->car = kCarRedSleeping;
getData()->entityPosition = kPosition_9460;
getData()->location = kLocationInsideCompartment;
diff --git a/engines/lastexpress/entities/yasmin.cpp b/engines/lastexpress/entities/yasmin.cpp
index 1d280f51e0..67963e50f6 100644
--- a/engines/lastexpress/entities/yasmin.cpp
+++ b/engines/lastexpress/entities/yasmin.cpp
@@ -39,22 +39,22 @@ Yasmin::Yasmin(LastExpressEngine *engine) : Entity(engine, kEntityYasmin) {
ADD_CALLBACK_FUNCTION(Yasmin, playSound);
ADD_CALLBACK_FUNCTION(Yasmin, updateFromTime);
ADD_CALLBACK_FUNCTION(Yasmin, updateEntity);
- ADD_CALLBACK_FUNCTION(Yasmin, function6);
- ADD_CALLBACK_FUNCTION(Yasmin, function7);
+ ADD_CALLBACK_FUNCTION(Yasmin, goEtoG);
+ ADD_CALLBACK_FUNCTION(Yasmin, goGtoE);
ADD_CALLBACK_FUNCTION(Yasmin, chapter1);
- ADD_CALLBACK_FUNCTION(Yasmin, chapter1Handler);
+ ADD_CALLBACK_FUNCTION(Yasmin, part1);
ADD_CALLBACK_FUNCTION(Yasmin, function10);
ADD_CALLBACK_FUNCTION(Yasmin, chapter2);
- ADD_CALLBACK_FUNCTION(Yasmin, chapter2Handler);
+ ADD_CALLBACK_FUNCTION(Yasmin, part2);
ADD_CALLBACK_FUNCTION(Yasmin, chapter3);
- ADD_CALLBACK_FUNCTION(Yasmin, chapter3Handler);
+ ADD_CALLBACK_FUNCTION(Yasmin, part3);
ADD_CALLBACK_FUNCTION(Yasmin, chapter4);
- ADD_CALLBACK_FUNCTION(Yasmin, chapter4Handler);
+ ADD_CALLBACK_FUNCTION(Yasmin, part4);
ADD_CALLBACK_FUNCTION(Yasmin, function17);
ADD_CALLBACK_FUNCTION(Yasmin, chapter5);
- ADD_CALLBACK_FUNCTION(Yasmin, chapter5Handler);
+ ADD_CALLBACK_FUNCTION(Yasmin, part5);
ADD_CALLBACK_FUNCTION(Yasmin, function20);
- ADD_CALLBACK_FUNCTION(Yasmin, function21);
+ ADD_CALLBACK_FUNCTION(Yasmin, hiding);
ADD_NULL_FUNCTION();
}
@@ -98,7 +98,7 @@ IMPLEMENT_FUNCTION_II(5, Yasmin, updateEntity, CarIndex, EntityPosition)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(6, Yasmin, function6)
+IMPLEMENT_FUNCTION(6, Yasmin, goEtoG)
switch (savepoint.action) {
default:
break;
@@ -138,7 +138,7 @@ IMPLEMENT_FUNCTION(6, Yasmin, function6)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(7, Yasmin, function7)
+IMPLEMENT_FUNCTION(7, Yasmin, goGtoE)
switch (savepoint.action) {
default:
break;
@@ -184,7 +184,7 @@ IMPLEMENT_FUNCTION(8, Yasmin, chapter1)
break;
case kActionNone:
- Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Yasmin, setup_chapter1Handler));
+ Entity::timeCheck(kTimeChapter1, params->param1, WRAP_SETUP_FUNCTION(Yasmin, setup_part1));
break;
case kActionDefault:
@@ -196,16 +196,16 @@ IMPLEMENT_FUNCTION(8, Yasmin, chapter1)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(9, Yasmin, chapter1Handler)
+IMPLEMENT_FUNCTION(9, Yasmin, part1)
switch (savepoint.action) {
default:
break;
case kActionNone:
- if (Entity::timeCheckCallback(kTime1093500, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_function6)))
+ if (Entity::timeCheckCallback(kTime1093500, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG)))
break;
- if (Entity::timeCheckCallback(kTime1161000, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_function7)))
+ if (Entity::timeCheckCallback(kTime1161000, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_goGtoE)))
break;
if (Entity::timeCheckPlaySoundUpdatePosition(kTime1162800, params->param3, 4, "Har1102", kPosition_4070))
@@ -217,7 +217,7 @@ IMPLEMENT_FUNCTION(9, Yasmin, chapter1Handler)
if (Entity::timeCheckCallback(kTime1174500, params->param5, 6, "Har1106", WRAP_SETUP_FUNCTION_S(Yasmin, setup_playSound)))
break;
- Entity::timeCheckCallback(kTime1183500, params->param6, 7, WRAP_SETUP_FUNCTION(Yasmin, setup_function6));
+ Entity::timeCheckCallback(kTime1183500, params->param6, 7, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG));
break;
case kActionCallback:
@@ -232,7 +232,7 @@ IMPLEMENT_FUNCTION(9, Yasmin, chapter1Handler)
break;
case 2:
- if (Entity::timeCheckCallback(kTime1161000, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_function7)))
+ if (Entity::timeCheckCallback(kTime1161000, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_goGtoE)))
break;
// Fallback to case 3
@@ -252,7 +252,7 @@ IMPLEMENT_FUNCTION(9, Yasmin, chapter1Handler)
// Fallback to case 6
case 6:
- Entity::timeCheckCallback(kTime1183500, params->param6, 7, WRAP_SETUP_FUNCTION(Yasmin, setup_function6));
+ Entity::timeCheckCallback(kTime1183500, params->param6, 7, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG));
break;
}
break;
@@ -282,18 +282,18 @@ IMPLEMENT_FUNCTION(11, Yasmin, chapter2)
getData()->clothes = kClothesDefault;
getData()->inventoryItem = kItemNone;
- setup_chapter2Handler();
+ setup_part2();
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(12, Yasmin, chapter2Handler)
+IMPLEMENT_FUNCTION(12, Yasmin, part2)
switch (savepoint.action) {
default:
break;
case kActionNone:
- if (Entity::timeCheckCallback(kTime1759500, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_function7)))
+ if (Entity::timeCheckCallback(kTime1759500, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_goGtoE)))
break;
if (getState()->time > kTime1800000 && !params->param2) {
@@ -327,7 +327,7 @@ IMPLEMENT_FUNCTION(13, Yasmin, chapter3)
break;
case kActionNone:
- setup_chapter3Handler();
+ setup_part3();
break;
case kActionDefault:
@@ -341,19 +341,19 @@ IMPLEMENT_FUNCTION(13, Yasmin, chapter3)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(14, Yasmin, chapter3Handler)
+IMPLEMENT_FUNCTION(14, Yasmin, part3)
switch (savepoint.action) {
default:
break;
case kActionNone:
- if (Entity::timeCheckCallback(kTime2062800, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_function6)))
+ if (Entity::timeCheckCallback(kTime2062800, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG)))
break;
- if (Entity::timeCheckCallback(kTime2106000, params->param2, 2, WRAP_SETUP_FUNCTION(Yasmin, setup_function7)))
+ if (Entity::timeCheckCallback(kTime2106000, params->param2, 2, WRAP_SETUP_FUNCTION(Yasmin, setup_goGtoE)))
break;
- Entity::timeCheckCallback(kTime2160000, params->param3, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_function6));
+ Entity::timeCheckCallback(kTime2160000, params->param3, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG));
break;
case kActionCallback:
@@ -362,12 +362,12 @@ IMPLEMENT_FUNCTION(14, Yasmin, chapter3Handler)
break;
case 1:
- if (Entity::timeCheckCallback(kTime2106000, params->param2, 2, WRAP_SETUP_FUNCTION(Yasmin, setup_function7)))
+ if (Entity::timeCheckCallback(kTime2106000, params->param2, 2, WRAP_SETUP_FUNCTION(Yasmin, setup_goGtoE)))
break;
// Fallback to case 2
case 2:
- Entity::timeCheckCallback(kTime2160000, params->param3, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_function6));
+ Entity::timeCheckCallback(kTime2160000, params->param3, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG));
break;
}
break;
@@ -381,7 +381,7 @@ IMPLEMENT_FUNCTION(15, Yasmin, chapter4)
break;
case kActionNone:
- setup_chapter4Handler();
+ setup_part4();
break;
case kActionDefault:
@@ -393,16 +393,16 @@ IMPLEMENT_FUNCTION(15, Yasmin, chapter4)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(16, Yasmin, chapter4Handler)
+IMPLEMENT_FUNCTION(16, Yasmin, part4)
switch (savepoint.action) {
default:
break;
case kActionNone:
- if (Entity::timeCheckCallback(kTime2457000, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_function7)))
+ if (Entity::timeCheckCallback(kTime2457000, params->param1, 1, WRAP_SETUP_FUNCTION(Yasmin, setup_goGtoE)))
break;
- Entity::timeCheckCallback(kTime2479500, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_function6));
+ Entity::timeCheckCallback(kTime2479500, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG));
break;
case kActionCallback:
@@ -417,7 +417,7 @@ IMPLEMENT_FUNCTION(16, Yasmin, chapter4Handler)
break;
case 2:
- Entity::timeCheckCallback(kTime2479500, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_function6));
+ Entity::timeCheckCallback(kTime2479500, params->param2, 3, WRAP_SETUP_FUNCTION(Yasmin, setup_goEtoG));
break;
}
break;
@@ -437,7 +437,7 @@ IMPLEMENT_FUNCTION(18, Yasmin, chapter5)
break;
case kActionNone:
- setup_chapter5Handler();
+ setup_part5();
break;
case kActionDefault:
@@ -453,7 +453,7 @@ IMPLEMENT_FUNCTION(18, Yasmin, chapter5)
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(19, Yasmin, chapter5Handler)
+IMPLEMENT_FUNCTION(19, Yasmin, part5)
if (savepoint.action == kActionProceedChapter5)
setup_function20();
IMPLEMENT_FUNCTION_END
@@ -468,7 +468,7 @@ IMPLEMENT_FUNCTION(20, Yasmin, function20)
if (!Entity::updateParameter(params->param1, getState()->time, 2700))
break;
- setup_function21();
+ setup_hiding();
break;
case kActionDefault:
@@ -479,14 +479,14 @@ IMPLEMENT_FUNCTION(20, Yasmin, function20)
case kActionDrawScene:
if (getEntities()->isInsideTrainCar(kEntityPlayer, kCarGreenSleeping)) {
- setup_function21();
+ setup_hiding();
}
break;
}
IMPLEMENT_FUNCTION_END
//////////////////////////////////////////////////////////////////////////
-IMPLEMENT_FUNCTION(21, Yasmin, function21)
+IMPLEMENT_FUNCTION(21, Yasmin, hiding)
switch (savepoint.action) {
default:
break;
diff --git a/engines/lastexpress/entities/yasmin.h b/engines/lastexpress/entities/yasmin.h
index b1413f5c2f..8fa8c10bb1 100644
--- a/engines/lastexpress/entities/yasmin.h
+++ b/engines/lastexpress/entities/yasmin.h
@@ -70,8 +70,8 @@ public:
*/
DECLARE_FUNCTION_2(updateEntity, CarIndex car, EntityPosition entityPosition)
- DECLARE_FUNCTION(function6)
- DECLARE_FUNCTION(function7)
+ DECLARE_FUNCTION(goEtoG)
+ DECLARE_FUNCTION(goGtoE)
/**
* Setup Chapter 1
@@ -81,7 +81,7 @@ public:
/**
* Handle Chapter 1 events
*/
- DECLARE_FUNCTION(chapter1Handler)
+ DECLARE_FUNCTION(part1)
DECLARE_FUNCTION(function10)
@@ -93,7 +93,7 @@ public:
/**
* Handle Chapter 2 events
*/
- DECLARE_FUNCTION(chapter2Handler)
+ DECLARE_FUNCTION(part2)
/**
* Setup Chapter 3
@@ -103,7 +103,7 @@ public:
/**
* Handle Chapter 3 events
*/
- DECLARE_FUNCTION(chapter3Handler)
+ DECLARE_FUNCTION(part3)
/**
* Setup Chapter 4
@@ -113,7 +113,7 @@ public:
/**
* Handle Chapter 4 events
*/
- DECLARE_FUNCTION(chapter4Handler)
+ DECLARE_FUNCTION(part4)
DECLARE_FUNCTION(function17)
@@ -125,10 +125,10 @@ public:
/**
* Handle Chapter 5 events
*/
- DECLARE_FUNCTION(chapter5Handler)
+ DECLARE_FUNCTION(part5)
DECLARE_FUNCTION(function20)
- DECLARE_FUNCTION(function21)
+ DECLARE_FUNCTION(hiding)
DECLARE_NULL_FUNCTION()
};
diff --git a/engines/lastexpress/fight/fight.cpp b/engines/lastexpress/fight/fight.cpp
index 49a9b85657..944b1cb4ac 100644
--- a/engines/lastexpress/fight/fight.cpp
+++ b/engines/lastexpress/fight/fight.cpp
@@ -222,7 +222,7 @@ Fight::FightEndType Fight::setup(FightType type) {
break;
case kFightMilos:
- sceneIndex = (getObjects()->get(kObjectCompartment1).location2 < kObjectLocation3) ? kSceneFightMilos : kSceneFightMilosBedOpened;
+ sceneIndex = (getObjects()->get(kObjectCompartment1).model < kObjectModel3) ? kSceneFightMilos : kSceneFightMilosBedOpened;
break;
case kFightAnna:
diff --git a/engines/lastexpress/game/action.cpp b/engines/lastexpress/game/action.cpp
index 796abf2ce7..c6ea6f6c8a 100644
--- a/engines/lastexpress/game/action.cpp
+++ b/engines/lastexpress/game/action.cpp
@@ -351,42 +351,42 @@ Action::Action(LastExpressEngine *engine) : _engine(engine) {
ADD_ACTION(savePoint);
ADD_ACTION(playSound);
ADD_ACTION(playMusic);
- ADD_ACTION(knock);
+ ADD_ACTION(knock); // 5
ADD_ACTION(compartment);
ADD_ACTION(playSounds);
ADD_ACTION(playAnimation);
ADD_ACTION(openCloseObject);
- ADD_ACTION(updateObjetLocation2);
- ADD_ACTION(setItemLocation);
- ADD_ACTION(knockNoSound);
+ ADD_ACTION(setModel); // 10
+ ADD_ACTION(setItem);
+ ADD_ACTION(knockInside);
ADD_ACTION(pickItem);
ADD_ACTION(dropItem);
- ADD_ACTION(dummy);
+ ADD_ACTION(dummy); // 15
ADD_ACTION(enterCompartment);
ADD_ACTION(dummy);
- ADD_ACTION(getOutsideTrain);
- ADD_ACTION(slip);
- ADD_ACTION(getInsideTrain);
- ADD_ACTION(climbUpTrain);
+ ADD_ACTION(leanOutWindow);
+ ADD_ACTION(almostFall);
+ ADD_ACTION(climbInWindow); // 20
+ ADD_ACTION(climbLadder);
ADD_ACTION(climbDownTrain);
- ADD_ACTION(jumpUpDownTrain);
- ADD_ACTION(unbound);
- ADD_ACTION(25);
- ADD_ACTION(26);
+ ADD_ACTION(kronosSanctum);
+ ADD_ACTION(escapeBaggage);
+ ADD_ACTION(enterBaggage); // 25
+ ADD_ACTION(bombPuzzle);
ADD_ACTION(27);
- ADD_ACTION(concertSitCough);
+ ADD_ACTION(kronosConcert);
ADD_ACTION(29);
- ADD_ACTION(catchBeetle);
+ ADD_ACTION(catchBeetle); // 30
ADD_ACTION(exitCompartment);
- ADD_ACTION(32);
- ADD_ACTION(useWhistle);
+ ADD_ACTION(outsideTrain);
+ ADD_ACTION(firebirdPuzzle);
ADD_ACTION(openMatchBox);
- ADD_ACTION(openBed);
+ ADD_ACTION(openBed); // 35
ADD_ACTION(dummy);
ADD_ACTION(dialog);
ADD_ACTION(eggBox);
ADD_ACTION(39);
- ADD_ACTION(bed);
+ ADD_ACTION(bed); // 40
ADD_ACTION(playMusicChapter);
ADD_ACTION(playMusicChapterSetupTrain);
ADD_ACTION(switchChapter);
@@ -521,7 +521,7 @@ IMPLEMENT_ACTION(compartment)
return kSceneNone;
}
- ObjectLocation location = getObjects()->get(compartment).location;
+ ObjectLocation location = getObjects()->get(compartment).status;
if (location == kObjectLocation1 || location == kObjectLocation3 || getEntities()->checkFields2(compartment)) {
if (location != kObjectLocation1 || getEntities()->checkFields2(compartment)
@@ -625,14 +625,14 @@ IMPLEMENT_ACTION(openCloseObject)
//////////////////////////////////////////////////////////////////////////
// Action 10
-IMPLEMENT_ACTION(updateObjetLocation2)
+IMPLEMENT_ACTION(setModel)
ObjectIndex object = (ObjectIndex)hotspot.param1;
- ObjectLocation location = (ObjectLocation)hotspot.param2;
+ ObjectModel model = (ObjectModel)hotspot.param2;
if (object >= kObjectMax)
return kSceneInvalid;
- getObjects()->updateLocation2(object, location);
+ getObjects()->updateModel(object, model);
if (object != kObject112 || getSoundQueue()->isBuffered("LIB096")) {
if (object == 1)
@@ -646,13 +646,13 @@ IMPLEMENT_ACTION(updateObjetLocation2)
//////////////////////////////////////////////////////////////////////////
// Action 11
-IMPLEMENT_ACTION(setItemLocation)
+IMPLEMENT_ACTION(setItem)
InventoryItem item = (InventoryItem)hotspot.param1;
if (item >= kPortraitOriginal)
return kSceneInvalid;
Inventory::InventoryEntry *entry = getInventory()->get(item);
- if (entry->isPresent)
+ if (entry->inPocket)
return kSceneInvalid;
entry->location = (ObjectLocation)hotspot.param2;
@@ -667,7 +667,7 @@ IMPLEMENT_ACTION(setItemLocation)
//////////////////////////////////////////////////////////////////////////
// Action 12
-IMPLEMENT_ACTION(knockNoSound)
+IMPLEMENT_ACTION(knockInside)
ObjectIndex object = (ObjectIndex)hotspot.param1;
if (object >= kObjectMax)
return kSceneInvalid;
@@ -726,7 +726,7 @@ IMPLEMENT_ACTION(pickItem)
break;
case kItemBomb:
- RESET_ENTITY_STATE(kEntityAbbot, Abbot, setup_pickBomb);
+ RESET_ENTITY_STATE(kEntityAbbot, Abbot, setup_catchCath);
break;
case kItemBriefcase:
@@ -808,7 +808,7 @@ IMPLEMENT_ACTION(dropItem)
//////////////////////////////////////////////////////////////////////////
// Action 16
IMPLEMENT_ACTION(enterCompartment)
- if (getObjects()->get(kObjectCompartment1).location == kObjectLocation1 || getObjects()->get(kObjectCompartment1).location == kObjectLocation3 || getInventory()->getSelectedItem() == kItemKey)
+ if (getObjects()->get(kObjectCompartment1).status == kObjectLocation1 || getObjects()->get(kObjectCompartment1).status == kObjectLocation3 || getInventory()->getSelectedItem() == kItemKey)
return action_compartment(hotspot);
if (getProgress().eventCorpseFound) {
@@ -842,12 +842,12 @@ IMPLEMENT_ACTION(enterCompartment)
//////////////////////////////////////////////////////////////////////////
// Action 18
-IMPLEMENT_ACTION(getOutsideTrain)
+IMPLEMENT_ACTION(leanOutWindow)
ObjectIndex object = (ObjectIndex)hotspot.param1;
- if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1)
+ if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).model == kObjectModel1)
&& getProgress().isTrainRunning
- && (object != kObjectOutsideAnnaCompartment || (!getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).location == kObjectLocation2))
+ && (object != kObjectOutsideAnnaCompartment || (!getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).status == kObjectLocation2))
&& getInventory()->getSelectedItem() != kItemFirebird
&& getInventory()->getSelectedItem() != kItemBriefcase) {
@@ -887,7 +887,7 @@ IMPLEMENT_ACTION(getOutsideTrain)
//////////////////////////////////////////////////////////////////////////
// Action 19
-IMPLEMENT_ACTION(slip)
+IMPLEMENT_ACTION(almostFall)
switch((ObjectIndex)hotspot.param1) {
default:
return kSceneInvalid;
@@ -911,7 +911,7 @@ IMPLEMENT_ACTION(slip)
//////////////////////////////////////////////////////////////////////////
// Action 20
-IMPLEMENT_ACTION(getInsideTrain)
+IMPLEMENT_ACTION(climbInWindow)
switch ((ObjectIndex)hotspot.param1) {
default:
return kSceneInvalid;
@@ -937,7 +937,7 @@ IMPLEMENT_ACTION(getInsideTrain)
//////////////////////////////////////////////////////////////////////////
// Action 21
-IMPLEMENT_ACTION(climbUpTrain)
+IMPLEMENT_ACTION(climbLadder)
byte action = hotspot.param1;
if (action != 1 && action != 2)
@@ -999,7 +999,7 @@ IMPLEMENT_ACTION(climbDownTrain)
//////////////////////////////////////////////////////////////////////////
// Action 23
-IMPLEMENT_ACTION(jumpUpDownTrain)
+IMPLEMENT_ACTION(kronosSanctum)
switch (hotspot.param1) {
default:
break;
@@ -1038,7 +1038,7 @@ IMPLEMENT_ACTION(jumpUpDownTrain)
//////////////////////////////////////////////////////////////////////////
// Action 24
-IMPLEMENT_ACTION(unbound)
+IMPLEMENT_ACTION(escapeBaggage)
byte action = hotspot.param1;
switch (action) {
@@ -1086,7 +1086,7 @@ IMPLEMENT_ACTION(unbound)
//////////////////////////////////////////////////////////////////////////
// Action 25
-IMPLEMENT_ACTION(25)
+IMPLEMENT_ACTION(enterBaggage)
switch(hotspot.param1) {
default:
break;
@@ -1103,7 +1103,7 @@ IMPLEMENT_ACTION(25)
case 3:
getSound()->playSoundEvent(kEntityPlayer, 43);
if (!getInventory()->hasItem(kItemKey) && !getEvent(kEventAnnaBaggageArgument)) {
- RESET_ENTITY_STATE(kEntityAnna, Anna, setup_baggage);
+ RESET_ENTITY_STATE(kEntityAnna, Anna, setup_baggageFight);
return kSceneNone;
}
break;
@@ -1114,7 +1114,7 @@ IMPLEMENT_ACTION(25)
//////////////////////////////////////////////////////////////////////////
// Action 26
-IMPLEMENT_ACTION(26)
+IMPLEMENT_ACTION(bombPuzzle)
switch(hotspot.param1) {
default:
return kSceneInvalid;
@@ -1168,7 +1168,7 @@ IMPLEMENT_ACTION(27)
//////////////////////////////////////////////////////////////////////////
// Action 28
-IMPLEMENT_ACTION(concertSitCough)
+IMPLEMENT_ACTION(kronosConcert)
switch(hotspot.param1) {
default:
return kSceneInvalid;
@@ -1224,7 +1224,7 @@ IMPLEMENT_ACTION(exitCompartment)
getProgress().field_30 = 1;
}
- getObjects()->updateLocation2(kObjectCompartment1, (ObjectLocation)hotspot.param2);
+ getObjects()->updateModel(kObjectCompartment1, (ObjectModel)hotspot.param2);
// fall to case enterCompartment action
return action_enterCompartment(hotspot);
@@ -1232,7 +1232,7 @@ IMPLEMENT_ACTION(exitCompartment)
//////////////////////////////////////////////////////////////////////////
// Action 32
-IMPLEMENT_ACTION(32)
+IMPLEMENT_ACTION(outsideTrain)
switch(hotspot.param1) {
default:
break;
@@ -1273,7 +1273,7 @@ IMPLEMENT_ACTION(32)
//////////////////////////////////////////////////////////////////////////
// Action 33
-IMPLEMENT_ACTION(useWhistle)
+IMPLEMENT_ACTION(firebirdPuzzle)
EventIndex evt = kEventNone;
SceneIndex sceneIndex = kSceneInvalid;
@@ -1335,7 +1335,7 @@ IMPLEMENT_ACTION(useWhistle)
IMPLEMENT_ACTION(openMatchBox)
// If the match is already in the inventory, do nothing
if (!getInventory()->get(kItemMatch)->location
- || getInventory()->get(kItemMatch)->isPresent)
+ || getInventory()->get(kItemMatch)->inPocket)
return kSceneInvalid;
getInventory()->addItem(kItemMatch);
@@ -1392,7 +1392,7 @@ IMPLEMENT_ACTION(39)
IMPLEMENT_ACTION(bed)
getSound()->playSoundEvent(kEntityPlayer, 85);
// falls to case knockNoSound
- return action_knockNoSound(hotspot);
+ return action_knockInside(hotspot);
}
//////////////////////////////////////////////////////////////////////////
@@ -1724,7 +1724,7 @@ bool Action::handleOtherCompartment(ObjectIndex object, bool doPlaySound, bool d
}
void Action::playCompartmentSoundEvents(ObjectIndex object) const {
- if (getObjects()->get(object).location == kObjectLocation1 || getObjects()->get(object).location == kObjectLocation3 || getEntities()->checkFields2(object)) {
+ if (getObjects()->get(object).status == kObjectLocation1 || getObjects()->get(object).status == kObjectLocation3 || getEntities()->checkFields2(object)) {
getSound()->playSoundEvent(kEntityPlayer, 13);
} else {
getSound()->playSoundEvent(kEntityPlayer, 14);
@@ -1757,7 +1757,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (object >= kObjectMax)
return kCursorNormal;
else
- return (CursorStyle)getObjects()->get(object).cursor;
+ return (CursorStyle)getObjects()->get(object).windowCursor;
case SceneHotspot::kAction12:
debugC(2, kLastExpressDebugScenes, "================================= OBJECT %03d =================================", object);
@@ -1765,7 +1765,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
return kCursorNormal;
if (getObjects()->get(object).entity)
- return (CursorStyle)getObjects()->get(object).cursor;
+ return (CursorStyle)getObjects()->get(object).windowCursor;
else
return kCursorNormal;
@@ -1774,7 +1774,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (object >= kObjectCompartmentA)
return kCursorNormal;
- if ((!getInventory()->getSelectedItem() || getInventory()->getSelectedEntry()->manualSelect)
+ if ((!getInventory()->getSelectedItem() || getInventory()->getSelectedEntry()->floating)
&& (object != kObject21 || getProgress().eventCorpseMovedFromFloor))
return kCursorHand;
else
@@ -1806,8 +1806,8 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
return kCursorNormal;
case SceneHotspot::kActionEnterCompartment:
- if ((getInventory()->getSelectedItem() != kItemKey || getObjects()->get(kObjectCompartment1).location)
- && (getObjects()->get(kObjectCompartment1).location != 1 || !getInventory()->hasItem(kItemKey)
+ if ((getInventory()->getSelectedItem() != kItemKey || getObjects()->get(kObjectCompartment1).status)
+ && (getObjects()->get(kObjectCompartment1).status != 1 || !getInventory()->hasItem(kItemKey)
|| (getInventory()->getSelectedItem() != kItemFirebird && getInventory()->getSelectedItem() != kItemBriefcase)))
goto LABEL_KEY;
@@ -1817,13 +1817,13 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (getProgress().jacket != kJacketGreen)
return kCursorNormal;
- if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).location2 == kObjectLocation1)
+ if ((getEvent(kEventCathLookOutsideWindowDay) || getEvent(kEventCathLookOutsideWindowNight) || getObjects()->get(kObjectCompartment1).model == kObjectModel1)
&& getProgress().isTrainRunning
- && (object != kObjectOutsideAnnaCompartment || (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).location == 2))
+ && (object != kObjectOutsideAnnaCompartment || (getEntities()->isInsideCompartment(kEntityRebecca, kCarRedSleeping, kPosition_4840) && getObjects()->get(kObjectOutsideBetweenCompartments).status == 2))
&& getInventory()->getSelectedItem() != kItemBriefcase && getInventory()->getSelectedItem() != kItemFirebird)
return kCursorForward;
- return (getObjects()->get(kObjectCompartment1).location2 < kObjectLocation2) ? kCursorNormal : kCursorMagnifier;
+ return (getObjects()->get(kObjectCompartment1).model < kObjectModel2) ? kCursorNormal : kCursorMagnifier;
case SceneHotspot::kActionSlip:
return (getProgress().field_C8 < 1) ? kCursorNormal : kCursorLeft;
@@ -1841,7 +1841,7 @@ CursorStyle Action::getCursor(const SceneHotspot &hotspot) const {
if (object != kObjectCompartment1)
return kCursorNormal;
- return (getObjects()->get(kObjectCeiling).location < kObjectLocation1) ? kCursorHand : kCursorNormal;
+ return (getObjects()->get(kObjectCeiling).status < kObjectLocation1) ? kCursorHand : kCursorNormal;
case SceneHotspot::kActionUnbound:
if (hotspot.param2 != 2)
@@ -1904,11 +1904,11 @@ LABEL_KEY:
if (getInventory()->getSelectedItem() != kItemKey
|| getObjects()->get(object).entity
- || getObjects()->get(object).location != 1
- || !getObjects()->get(object).cursor2
+ || getObjects()->get(object).status != 1
+ || !getObjects()->get(object).handleCursor
|| getEntities()->isInsideCompartments(kEntityPlayer)
|| getEntities()->checkFields2(object))
- return (CursorStyle)getObjects()->get(object).cursor2;
+ return (CursorStyle)getObjects()->get(object).handleCursor;
else
return (CursorStyle)getInventory()->get(kItemKey)->cursor;
}
diff --git a/engines/lastexpress/game/action.h b/engines/lastexpress/game/action.h
index e1a4a53224..3dad51d0d3 100644
--- a/engines/lastexpress/game/action.h
+++ b/engines/lastexpress/game/action.h
@@ -82,28 +82,28 @@ private:
DECLARE_ACTION(playSounds);
DECLARE_ACTION(playAnimation);
DECLARE_ACTION(openCloseObject);
- DECLARE_ACTION(updateObjetLocation2);
- DECLARE_ACTION(setItemLocation);
- DECLARE_ACTION(knockNoSound);
+ DECLARE_ACTION(setModel);
+ DECLARE_ACTION(setItem);
+ DECLARE_ACTION(knockInside);
DECLARE_ACTION(pickItem);
DECLARE_ACTION(dropItem);
DECLARE_ACTION(enterCompartment);
- DECLARE_ACTION(getOutsideTrain);
- DECLARE_ACTION(slip);
- DECLARE_ACTION(getInsideTrain);
- DECLARE_ACTION(climbUpTrain);
+ DECLARE_ACTION(leanOutWindow);
+ DECLARE_ACTION(almostFall);
+ DECLARE_ACTION(climbInWindow);
+ DECLARE_ACTION(climbLadder);
DECLARE_ACTION(climbDownTrain);
- DECLARE_ACTION(jumpUpDownTrain);
- DECLARE_ACTION(unbound);
- DECLARE_ACTION(25);
- DECLARE_ACTION(26);
+ DECLARE_ACTION(kronosSanctum);
+ DECLARE_ACTION(escapeBaggage);
+ DECLARE_ACTION(enterBaggage);
+ DECLARE_ACTION(bombPuzzle);
DECLARE_ACTION(27);
- DECLARE_ACTION(concertSitCough);
+ DECLARE_ACTION(kronosConcert);
DECLARE_ACTION(29);
DECLARE_ACTION(catchBeetle);
DECLARE_ACTION(exitCompartment);
- DECLARE_ACTION(32);
- DECLARE_ACTION(useWhistle);
+ DECLARE_ACTION(outsideTrain);
+ DECLARE_ACTION(firebirdPuzzle);
DECLARE_ACTION(openMatchBox);
DECLARE_ACTION(openBed);
DECLARE_ACTION(dialog);
diff --git a/engines/lastexpress/game/entities.h b/engines/lastexpress/game/entities.h
index 81aed627aa..cacbc408c9 100644
--- a/engines/lastexpress/game/entities.h
+++ b/engines/lastexpress/game/entities.h
@@ -110,7 +110,7 @@ public:
* Query if 'entity' is inside a compartment
*
* @param entity The entity.
- * @param car The car.
+ * @param car The car.
* @param position The position.
*
* @return true if inside the compartment, false if not.
@@ -247,7 +247,7 @@ public:
/**
* Query if nobody is in a compartment at that position.
*
- * @param car The car.
+ * @param car The car.
* @param position The position.
*
* @return true if nobody is in a compartment, false if not.
@@ -334,8 +334,8 @@ private:
static const int _compartmentsCount = 16;
static const int _positionsCount = 100 * 10; // 100 positions per train car
- LastExpressEngine *_engine;
- EntityData *_header;
+ LastExpressEngine *_engine;
+ EntityData *_header;
Common::Array<Entity *> _entities;
// Compartments & positions
diff --git a/engines/lastexpress/game/inventory.cpp b/engines/lastexpress/game/inventory.cpp
index 2f1b0a8e76..11a76a77f0 100644
--- a/engines/lastexpress/game/inventory.cpp
+++ b/engines/lastexpress/game/inventory.cpp
@@ -97,19 +97,19 @@ void Inventory::init() {
_entries[kItemPassengerList].isSelectable = true;
// Auto selection
- _entries[kItem2].manualSelect = false;
- _entries[kItem3].manualSelect = false;
- _entries[kItem5].manualSelect = false;
- _entries[kItem7].manualSelect = false;
- _entries[kItem9].manualSelect = false;
- _entries[kItem11].manualSelect = false;
- _entries[kItemBeetle].manualSelect = false;
- _entries[kItem17].manualSelect = false;
- _entries[kItemFirebird].manualSelect = false;
- _entries[kItemBriefcase].manualSelect = false;
- _entries[kItemCorpse].manualSelect = false;
- _entries[kItemGreenJacket].manualSelect = false;
- _entries[kItem22].manualSelect = false;
+ _entries[kItem2].floating = false;
+ _entries[kItem3].floating = false;
+ _entries[kItem5].floating = false;
+ _entries[kItem7].floating = false;
+ _entries[kItem9].floating = false;
+ _entries[kItem11].floating = false;
+ _entries[kItemBeetle].floating = false;
+ _entries[kItem17].floating = false;
+ _entries[kItemFirebird].floating = false;
+ _entries[kItemBriefcase].floating = false;
+ _entries[kItemCorpse].floating = false;
+ _entries[kItemGreenJacket].floating = false;
+ _entries[kItem22].floating = false;
// Scene
_entries[kItemMatchBox].scene = kSceneMatchbox;
@@ -123,8 +123,8 @@ void Inventory::init() {
_entries[kItemBriefcase].scene = kSceneBriefcase;
// Has item
- _entries[kItemTelegram].isPresent = true;
- _entries[kItemArticle].isPresent = true;
+ _entries[kItemTelegram].inPocket = true;
+ _entries[kItemArticle].inPocket = true;
_selectedItem = kItemNone;
}
@@ -298,7 +298,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) {
getScenes()->loadScene(entry.scene);
}
- if (entry.field_2)
+ if (entry.usable)
selectItem((InventoryItem)index);
else
drawSelectedItem();
@@ -346,7 +346,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) {
if (!getProgress().field_84
&& getEntityData(kEntityPlayer)->location != kLocationOutsideTrain
&& getProgress().field_18 != 4
- && (_selectedItem == kItemNone || get(_selectedItem)->manualSelect || getState()->sceneUseBackup)) {
+ && (_selectedItem == kItemNone || get(_selectedItem)->floating || getState()->sceneUseBackup)) {
// Draw inventory contents when clicking on portrait
if (ev.type == Common::EVENT_LBUTTONDOWN) {
@@ -363,7 +363,7 @@ void Inventory::handleMouseEvent(const Common::Event &ev) {
close();
// Select item
- if (_selectedItem == kItemNone || get(_selectedItem)->manualSelect) {
+ if (_selectedItem == kItemNone || get(_selectedItem)->floating) {
_selectedItem = getFirstExaminableItem();
if (_selectedItem != kItemNone)
@@ -447,11 +447,11 @@ void Inventory::addItem(InventoryItem item) {
if (item >= kPortraitOriginal)
return;
- get(item)->isPresent = true;
+ get(item)->inPocket = true;
get(item)->location = kObjectLocationNone;
// Auto-select item if necessary
- if (get(item)->cursor && !get(item)->manualSelect) {
+ if (get(item)->cursor && !get(item)->floating) {
_selectedItem = item;
drawItem(get(_selectedItem)->cursor, 44, 0);
askForRedraw();
@@ -462,7 +462,7 @@ void Inventory::removeItem(InventoryItem item, ObjectLocation newLocation) {
if (item >= kPortraitOriginal)
return;
- get(item)->isPresent = false;
+ get(item)->inPocket = false;
get(item)->location = newLocation;
if (get(item)->cursor == get(_selectedItem)->cursor) {
@@ -473,7 +473,7 @@ void Inventory::removeItem(InventoryItem item, ObjectLocation newLocation) {
}
bool Inventory::hasItem(InventoryItem item) {
- if (get(item)->isPresent && item < kPortraitOriginal)
+ if (get(item)->inPocket && item < kPortraitOriginal)
return true;
return false;
@@ -537,7 +537,7 @@ InventoryItem Inventory::getFirstExaminableItem() const {
int index = 0;
InventoryEntry entry = _entries[index];
- while (!entry.isPresent || !entry.cursor || entry.manualSelect) {
+ while (!entry.inPocket || !entry.cursor || entry.floating) {
index++;
entry = _entries[index];
@@ -676,7 +676,7 @@ void Inventory::drawItem(CursorStyle id, uint16 x, uint16 y, int16 brightnessInd
void Inventory::drawSelectedItem() {
// Draw the selected item if any
- if (!_selectedItem || get(_selectedItem)->manualSelect) {
+ if (!_selectedItem || get(_selectedItem)->floating) {
_selectedItem = getFirstExaminableItem();
if (_selectedItem) {
@@ -703,10 +703,10 @@ void Inventory::open() {
// Draw at most 11 items in the inventory
_itemsShown = 0;
for (int i = 1; i < ARRAYSIZE(_entries); i++) {
- if (!_entries[i].isPresent)
+ if (!_entries[i].inPocket)
continue;
- if (!_entries[i].manualSelect)
+ if (!_entries[i].floating)
continue;
if (_itemsShown < 11) {
@@ -747,10 +747,10 @@ uint32 Inventory::getItemIndex(uint32 currentIndex) const {
uint32 count = 0;
for (uint32 i = 1; i < ARRAYSIZE(_entries); i++) {
- if (!_entries[i].isPresent)
+ if (!_entries[i].inPocket)
continue;
- if (!_entries[i].manualSelect)
+ if (!_entries[i].floating)
continue;
if (count < 11) {
diff --git a/engines/lastexpress/game/inventory.h b/engines/lastexpress/game/inventory.h
index b1019a43c6..242dfc30cc 100644
--- a/engines/lastexpress/game/inventory.h
+++ b/engines/lastexpress/game/inventory.h
@@ -56,33 +56,33 @@ public:
struct InventoryEntry : Common::Serializable {
CursorStyle cursor;
SceneIndex scene;
- byte field_2;
+ byte usable;
bool isSelectable;
- bool isPresent;
- bool manualSelect;
+ bool inPocket;
+ bool floating;
ObjectLocation location;
InventoryEntry() {
cursor = kCursorNormal;
scene = kSceneNone;
- field_2 = 0;
+ usable = 0;
isSelectable = false;
- isPresent = false;
- manualSelect = true;
+ inPocket = false;
+ floating = true;
location = kObjectLocationNone;
}
Common::String toString() {
- return Common::String::format("{ %d - %d - %d - %d - %d - %d - %d }", cursor, scene, field_2, isSelectable, isPresent, manualSelect, location);
+ return Common::String::format("{ %d - %d - %d - %d - %d - %d - %d }", cursor, scene, usable, isSelectable, inPocket, floating, location);
}
void saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsByte(cursor);
s.syncAsByte(scene);
- s.syncAsByte(field_2);
+ s.syncAsByte(usable);
s.syncAsByte(isSelectable);
- s.syncAsByte(isPresent);
- s.syncAsByte(manualSelect);
+ s.syncAsByte(inPocket);
+ s.syncAsByte(floating);
s.syncAsByte(location);
}
};
diff --git a/engines/lastexpress/game/logic.cpp b/engines/lastexpress/game/logic.cpp
index 09104d1bf9..1a9c6b4123 100644
--- a/engines/lastexpress/game/logic.cpp
+++ b/engines/lastexpress/game/logic.cpp
@@ -413,8 +413,8 @@ void Logic::resetState() {
/**
* Handle game over
*
- * @param type The savegame type.
- * @param value The value (event, time, index, ...)
+ * @param type The savegame type.
+ * @param value The value (event, time, index, ...)
* @param sceneIndex Index of the scene to show.
* @param showScene true to show a scene, false to return to menu directly
*/
@@ -468,7 +468,7 @@ void Logic::switchChapter() const {
case kChapter3:
getInventory()->get(kItemFirebird)->location = kObjectLocation4;
- getInventory()->get(kItemFirebird)->isPresent = false;
+ getInventory()->get(kItemFirebird)->inPocket = false;
getInventory()->get(kItem11)->location = kObjectLocation1;
getInventory()->addItem(kItemWhistle);
getInventory()->addItem(kItemKey);
diff --git a/engines/lastexpress/game/logic.h b/engines/lastexpress/game/logic.h
index efb8f1e1a3..b2d08cb06f 100644
--- a/engines/lastexpress/game/logic.h
+++ b/engines/lastexpress/game/logic.h
@@ -54,7 +54,7 @@ public:
void playFinalSequence() const;
void updateCursor(bool redraw = true) const;
- Action *getGameAction() { return _action; }
+ Action *getGameAction() { return _action; }
Beetle *getGameBeetle() { return _beetle; }
Entities *getGameEntities() { return _entities; }
Fight *getGameFight() { return _fight; }
diff --git a/engines/lastexpress/game/object.cpp b/engines/lastexpress/game/object.cpp
index 48df91ea6d..ad13a65199 100644
--- a/engines/lastexpress/game/object.cpp
+++ b/engines/lastexpress/game/object.cpp
@@ -32,7 +32,7 @@
namespace LastExpress {
Common::String Objects::Object::toString() {
- return Common::String::format("{ %s - %d - %d - %d - %d }", ENTITY_NAME(entity), location, cursor, cursor2, location2);
+ return Common::String::format("{ %s - %d - %d - %d - %d }", ENTITY_NAME(entity), status, windowCursor, handleCursor, model);
}
Objects::Objects(LastExpressEngine *engine) : _engine(engine) {}
@@ -44,24 +44,24 @@ const Objects::Object Objects::get(ObjectIndex index) const {
return _objects[index];
}
-void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation location, CursorStyle cursor, CursorStyle cursor2) {
+void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation status, CursorStyle windowCursor, CursorStyle handleCursor) {
if (index >= kObjectMax)
return;
Object *object = &_objects[index];
// Store original location
- ObjectLocation original_location = object->location;
+ ObjectLocation original_status = object->status;
// Update entity
object->entity = entity;
- object->location = location;
+ object->status = status;
- if (cursor != kCursorKeepValue || cursor2 != kCursorKeepValue) {
- if (cursor != kCursorKeepValue)
- object->cursor = cursor;
- if (cursor2 != kCursorKeepValue)
- object->cursor2 = cursor2;
+ if (windowCursor != kCursorKeepValue || handleCursor != kCursorKeepValue) {
+ if (windowCursor != kCursorKeepValue)
+ object->windowCursor = windowCursor;
+ if (handleCursor != kCursorKeepValue)
+ object->handleCursor = handleCursor;
getLogic()->updateCursor();
}
@@ -69,18 +69,19 @@ void Objects::update(ObjectIndex index, EntityIndex entity, ObjectLocation locat
getFlags()->flag_3 = true;
// Compartments
- if (original_location != location && (original_location == kObjectLocation2 || location == kObjectLocation2))
+ if (original_status != status && (original_status == kObjectLocation2 || status == kObjectLocation2)) {
if ((index >= kObjectCompartment1 && index <= kObjectCompartment8)
- || (index >= kObjectCompartmentA && index <= kObjectCompartmentF)) {
- getScenes()->updateDoorsAndClock();
+ || (index >= kObjectCompartmentA && index <= kObjectCompartmentF)) {
+ getScenes()->updateDoorsAndClock();
}
+ }
}
-void Objects::updateLocation2(ObjectIndex index, ObjectLocation location2) {
+void Objects::updateModel(ObjectIndex index, ObjectModel model) {
if (index >= kObjectMax)
return;
- _objects[index].location2 = location2;
+ _objects[index].model = model;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/game/object.h b/engines/lastexpress/game/object.h
index 87c9d7d407..be9d63d6c5 100644
--- a/engines/lastexpress/game/object.h
+++ b/engines/lastexpress/game/object.h
@@ -37,17 +37,17 @@ public:
struct Object : Common::Serializable { // All fields should be saved as bytes
EntityIndex entity;
- ObjectLocation location;
- CursorStyle cursor;
- CursorStyle cursor2;
- ObjectLocation location2;
+ ObjectLocation status;
+ CursorStyle windowCursor;
+ CursorStyle handleCursor;
+ ObjectModel model;
Object() {
entity = kEntityPlayer;
- location = kObjectLocationNone;
- cursor = kCursorHandKnock;
- cursor2 = kCursorHandKnock;
- location2 = kObjectLocationNone;
+ status = kObjectLocationNone;
+ windowCursor = kCursorHandKnock;
+ handleCursor = kCursorHandKnock;
+ model = kObjectModelNone;
}
Common::String toString();
@@ -55,18 +55,18 @@ public:
// Serializable
void saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsByte(entity);
- s.syncAsByte(location);
- s.syncAsByte(cursor);
- s.syncAsByte(cursor2);
- s.syncAsByte(location2);
+ s.syncAsByte(status);
+ s.syncAsByte(windowCursor);
+ s.syncAsByte(handleCursor);
+ s.syncAsByte(model);
}
};
Objects(LastExpressEngine *engine);
const Object get(ObjectIndex index) const;
- void update(ObjectIndex index, EntityIndex entity, ObjectLocation location, CursorStyle cursor, CursorStyle cursor2);
- void updateLocation2(ObjectIndex index, ObjectLocation location2);
+ void update(ObjectIndex index, EntityIndex entity, ObjectLocation status, CursorStyle cursor, CursorStyle cursor2);
+ void updateModel(ObjectIndex index, ObjectModel model);
// Serializable
void saveLoadWithSerializer(Common::Serializer &s);
diff --git a/engines/lastexpress/game/savegame.h b/engines/lastexpress/game/savegame.h
index 361957227e..7e8095fde1 100644
--- a/engines/lastexpress/game/savegame.h
+++ b/engines/lastexpress/game/savegame.h
@@ -40,32 +40,32 @@
Game data Format
-----------------
- uint32 {4} - entity
- uint32 {4} - current time
- uint32 {4} - time delta (how much a tick is in "real" time)
- uint32 {4} - time ticks
- uint32 {4} - scene Index max: 2500
- byte {1} - use backup scene
- uint32 {4} - backup Scene Index 1 max: 2500
- uint32 {4} - backup Scene Index 2 max: 2500
- uint32 {4} - selected inventory item max: 32
- uint32 {4*100*10} - positions (by car)
- uint32 {4*16} - compartments
- uint32 {4*16} - compartments ??
- uint32 {4*128} - game progress
- byte {512} - game events
- byte {7*32} - inventory
- byte {5*128} - objects
- byte {1262*40} - entities (characters and train entities)
-
- uint32 {4} - sound queue state
- uint32 {4} - ??
- uint32 {4} - number of sound entries
- byte {count*68} - sound entries
-
- byte {16*128} - save point data
- uint32 {4} - number of save points (max: 128)
- byte {count*16} - save points
+ uint32 {4} - entity
+ uint32 {4} - current time
+ uint32 {4} - time delta (how much a tick is in "real" time)
+ uint32 {4} - time ticks
+ uint32 {4} - scene Index max: 2500
+ byte {1} - use backup scene
+ uint32 {4} - backup Scene Index 1 max: 2500
+ uint32 {4} - backup Scene Index 2 max: 2500
+ uint32 {4} - selected inventory item max: 32
+ uint32 {4*100*10} - positions by car(BlockedView)
+ uint32 {4*16} - compartments (BlockedX)
+ uint32 {4*16} - compartments? (SoftBlockedX)
+ uint32 {4*128} - game progress
+ byte {512} - game events
+ byte {7*32} - inventory
+ byte {5*128} - objects
+ byte {1262*40} - entities (characters and train entities)
+
+ uint32 {4} - sound queue state
+ uint32 {4} - ??
+ uint32 {4} - number of sound entries
+ byte {count*68} - sound entries
+
+ byte {16*128} - save point data
+ uint32 {4} - number of save points (max: 128)
+ byte {count*16} - save points
... more unknown stuff
@@ -167,7 +167,7 @@ public:
bool isGameFinished(uint32 menuIndex, uint32 savegameIndex);
// Accessors
- uint32 getTime(uint32 index) { return getEntry(index)->time; }
+ uint32 getTime(uint32 index) { return getEntry(index)->time; }
ChapterIndex getChapter(uint32 index) { return getEntry(index)->chapter; }
uint32 getValue(uint32 index) { return getEntry(index)->value; }
uint32 getLastSavegameTicks() const { return _gameTicksLastSavegame; }
diff --git a/engines/lastexpress/game/scenes.cpp b/engines/lastexpress/game/scenes.cpp
index 82688fff2e..0d8f51af6e 100644
--- a/engines/lastexpress/game/scenes.cpp
+++ b/engines/lastexpress/game/scenes.cpp
@@ -579,7 +579,7 @@ void SceneManager::updateDoorsAndClock() {
for (ObjectIndex index = firstIndex; index < (ObjectIndex)(firstIndex + 8); index = (ObjectIndex)(index + 1)) {
// Doors is not open, nothing to do
- if (getObjects()->get(index).location != kObjectLocation2)
+ if (getObjects()->get(index).status != kObjectLocation2)
continue;
// Load door sequence
@@ -842,11 +842,11 @@ void SceneManager::preProcessScene(SceneIndex *index) {
if (object >= kObjectMax)
break;
- if (getObjects()->get(object).location == kObjectLocationNone)
+ if (getObjects()->get(object).status == kObjectLocationNone)
break;
for (Common::Array<SceneHotspot *>::iterator it = scene->getHotspots()->begin(); it != scene->getHotspots()->end(); ++it) {
- if (getObjects()->get(object).location != (*it)->location)
+ if (getObjects()->get(object).status != (*it)->location)
continue;
PROCESS_HOTSPOT_SCENE(*it, index);
@@ -920,7 +920,7 @@ void SceneManager::preProcessScene(SceneIndex *index) {
int location = kObjectLocationNone;
- if (getObjects()->get(object).location == kObjectLocation2)
+ if (getObjects()->get(object).status == kObjectLocation2)
location = kObjectLocation1;
if (getInventory()->get(item)->location != kObjectLocationNone)
@@ -933,7 +933,7 @@ void SceneManager::preProcessScene(SceneIndex *index) {
if (location != (*it)->location)
continue;
- if (getObjects()->get(object).location != (*it)->param1)
+ if (getObjects()->get(object).status != (*it)->param1)
continue;
if (getInventory()->get(item)->location != (*it)->param2)
@@ -994,7 +994,7 @@ void SceneManager::preProcessScene(SceneIndex *index) {
bool found = false;
for (Common::Array<SceneHotspot *>::iterator it = scene->getHotspots()->begin(); it != scene->getHotspots()->end(); ++it) {
- if (getObjects()->get(object).location2 != (*it)->location)
+ if (getObjects()->get(object).model != (*it)->location)
continue;
PROCESS_HOTSPOT_SCENE(*it, index);
diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h
index 944f6d47b1..83d528d346 100644
--- a/engines/lastexpress/game/state.h
+++ b/engines/lastexpress/game/state.h
@@ -657,12 +657,12 @@ private:
// Timer
int _timer;
- Flags *_flags; ///< Flags
- Inventory *_inventory; ///< Inventory
- Objects *_objects; ///< Objects
- SavePoints *_savepoints; ///< SavePoints
- GameState *_state; ///< State
- Common::Point _coords; ///< Current coordinates
+ Flags *_flags; ///< Flags
+ Inventory *_inventory; ///< Inventory
+ Objects *_objects; ///< Objects
+ SavePoints *_savepoints; ///< SavePoints
+ GameState *_state; ///< State
+ Common::Point _coords; ///< Current coordinates
};
} // End of namespace LastExpress
diff --git a/engines/lastexpress/shared.h b/engines/lastexpress/shared.h
index 56cf730e24..dae7928043 100644
--- a/engines/lastexpress/shared.h
+++ b/engines/lastexpress/shared.h
@@ -755,7 +755,7 @@ enum ClothesIndex {
};
//////////////////////////////////////////////////////////////////////////
-// Location of objects
+// Objects (doors)
//////////////////////////////////////////////////////////////////////////
enum ObjectLocation {
kObjectLocationNone = 0,
@@ -763,13 +763,27 @@ enum ObjectLocation {
kObjectLocation2 = 2, // Bed ?
kObjectLocation3 = 3,
kObjectLocation4 = 4, // Window ?
- kObjectLocation5 = 5,
- kObjectLocation6 = 6,
- kObjectLocation7 = 7,
- kObjectLocation8 = 8,
- kObjectLocation9 = 9,
- kObjectLocation10 = 10,
- kObjectLocation18 = 18
+ kObjectLocation5 = 5,
+ kObjectLocation6 = 6,
+ kObjectLocation7 = 7,
+ kObjectLocation8 = 8,
+ kObjectLocation9 = 9,
+ kObjectLocation10 = 10,
+ kObjectLocation18 = 18
+};
+
+enum ObjectModel {
+ kObjectModelNone = 0,
+ kObjectModel1 = 1,
+ kObjectModel2 = 2,
+ kObjectModel3 = 3,
+ kObjectModel4 = 4,
+ kObjectModel5 = 5,
+ kObjectModel6 = 6,
+ kObjectModel7 = 7,
+ kObjectModel8 = 8,
+ kObjectModel9 = 9,
+ kObjectModel10 = 10
};
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/lastexpress/sound/sound.cpp b/engines/lastexpress/sound/sound.cpp
index 319f7cd4f4..ad61c2e0d9 100644
--- a/engines/lastexpress/sound/sound.cpp
+++ b/engines/lastexpress/sound/sound.cpp
@@ -1323,7 +1323,7 @@ void SoundManager::playLoopingSound(int param) {
break;
if (getEntities()->isInsideCompartment(kEntityPlayer, getEntityData(kEntityPlayer)->car, positions[pos])) {
numLoops[0] = 1;
- partNumber = (getObjects()->get((ObjectIndex)objNum).location - 2) < 1 ? 6 : 1;
+ partNumber = (getObjects()->get((ObjectIndex)objNum).status - 2) < 1 ? 6 : 1;
}
objNum++;
}
diff --git a/engines/lure/configure.engine b/engines/lure/configure.engine
new file mode 100644
index 0000000000..e9f92893e3
--- /dev/null
+++ b/engines/lure/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 lure "Lure of the Temptress" yes
diff --git a/engines/made/configure.engine b/engines/made/configure.engine
new file mode 100644
index 0000000000..2266712338
--- /dev/null
+++ b/engines/made/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 made "MADE" yes
diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp
index e8b755cb40..c2c866ff34 100644
--- a/engines/made/detection.cpp
+++ b/engines/made/detection.cpp
@@ -211,77 +211,77 @@ static const MadeGameDescription gameDescriptions[] = {
3,
},
- {
- // Return to Zork - Italian CD version 1.2 3/31/95 (installed)
+ {
+ // Return to Zork - Italian CD version 1.2 3/31/95 (installed)
// Patch #2685032 submitted by goodoldgeorg
- {
- "rtz",
- "V1.2, 3/31/95, installed, CD",
- AD_ENTRY1s("rtzcd.dat", "5b86035aed0277f96e3d173542b5364a", 523776),
- Common::IT_ITA,
- Common::kPlatformDOS,
+ {
+ "rtz",
+ "V1.2, 3/31/95, installed, CD",
+ AD_ENTRY1s("rtzcd.dat", "5b86035aed0277f96e3d173542b5364a", 523776),
+ Common::IT_ITA,
+ Common::kPlatformDOS,
ADGF_CD,
GUIO0()
- },
- GID_RTZ,
- 0,
- GF_CD,
- 3,
- },
+ },
+ GID_RTZ,
+ 0,
+ GF_CD,
+ 3,
+ },
{
- // Return to Zork - Italian CD version 1.2 3/31/95
+ // Return to Zork - Italian CD version 1.2 3/31/95
// Patch #2685032 submitted by goodoldgeorg
- {
- "rtz",
- "V1.2, 3/31/95, CD",
- AD_ENTRY1s("rtzcd.red", "946997d8b0aa6cb4e848bad02a1fc3d2", 354971),
- Common::IT_ITA,
- Common::kPlatformDOS,
+ {
+ "rtz",
+ "V1.2, 3/31/95, CD",
+ AD_ENTRY1s("rtzcd.red", "946997d8b0aa6cb4e848bad02a1fc3d2", 354971),
+ Common::IT_ITA,
+ Common::kPlatformDOS,
ADGF_CD,
GUIO0()
- },
- GID_RTZ,
- 0,
- GF_CD_COMPRESSED,
- 3,
- },
-
- {
- // Return to Zork - French CD version 1.2 5/13/95 (installed)
+ },
+ GID_RTZ,
+ 0,
+ GF_CD_COMPRESSED,
+ 3,
+ },
+
+ {
+ // Return to Zork - French CD version 1.2 5/13/95 (installed)
// Patch #2685032 submitted by goodoldgeorg
- {
- "rtz",
- "V1.2, 5/13/95, installed, CD",
- AD_ENTRY1s("rtzcd.dat", "bde8251a8e34e87c54e3f93147d56c9e", 523776),
- Common::FR_FRA,
- Common::kPlatformDOS,
+ {
+ "rtz",
+ "V1.2, 5/13/95, installed, CD",
+ AD_ENTRY1s("rtzcd.dat", "bde8251a8e34e87c54e3f93147d56c9e", 523776),
+ Common::FR_FRA,
+ Common::kPlatformDOS,
ADGF_CD,
GUIO0()
- },
- GID_RTZ,
- 0,
- GF_CD,
- 3,
- },
-
- {
- // Return to Zork - French CD version 1.2 5/13/95
+ },
+ GID_RTZ,
+ 0,
+ GF_CD,
+ 3,
+ },
+
+ {
+ // Return to Zork - French CD version 1.2 5/13/95
// Patch #2685032 submitted by goodoldgeorg
- {
- "rtz",
- "V1.2, 3/31/95, CD",
- AD_ENTRY1s("rtzcd.red", "946997d8b0aa6cb4e848bad02a1fc3d2", 354614),
- Common::FR_FRA,
- Common::kPlatformDOS,
+ {
+ "rtz",
+ "V1.2, 3/31/95, CD",
+ AD_ENTRY1s("rtzcd.red", "946997d8b0aa6cb4e848bad02a1fc3d2", 354614),
+ Common::FR_FRA,
+ Common::kPlatformDOS,
ADGF_CD,
GUIO0()
- },
- GID_RTZ,
- 0,
- GF_CD_COMPRESSED,
- 3,
- },
+ },
+ GID_RTZ,
+ 0,
+ GF_CD_COMPRESSED,
+ 3,
+ },
{
// Return to Zork - English floppy version
diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp
index d069308a4b..b89b3af802 100644
--- a/engines/made/screenfx.cpp
+++ b/engines/made/screenfx.cpp
@@ -165,7 +165,7 @@ void ScreenEffects::flash(int flashCount, byte *palette, int colorCount) {
_screen->setRGBPalette(_fxPalette, 0, colorCount);
_screen->updateScreenAndWait(20);
_screen->setRGBPalette(palette, 0, colorCount);
- _screen->updateScreenAndWait(20);
+ _screen->updateScreenAndWait(20);
}
}
diff --git a/engines/made/sound.cpp b/engines/made/sound.cpp
index f73c580560..176f8688bd 100644
--- a/engines/made/sound.cpp
+++ b/engines/made/sound.cpp
@@ -228,7 +228,7 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou
break;
default:
- return;
+ return;
}
diff --git a/engines/mohawk/configure.engine b/engines/mohawk/configure.engine
new file mode 100644
index 0000000000..fa9d15cffc
--- /dev/null
+++ b/engines/mohawk/configure.engine
@@ -0,0 +1,6 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine mohawk "Mohawk" yes "cstime myst riven" "Living Books"
+add_engine cstime "Where in Time is Carmen Sandiego?" no
+add_engine riven "Riven: The Sequel to Myst" no "" "" "16bit"
+add_engine myst "Myst" no "" "" "16bit"
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index b68dd48b0f..c5d55066ba 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -40,7 +40,7 @@ namespace Mortevielle {
* @remarks Originally called 'taller'
*/
void MortevielleEngine::fctMove() {
- int oldMenu = (_menu._moveMenu[6]._menuId << 8) | _menu._moveMenu[6]._actionId;
+ int oldMenu = (_menu->_moveMenu[6]._menuId << 8) | _menu->_moveMenu[6]._actionId;
if ((_coreVar._currPlace == ROOM26) && (_currAction == oldMenu)) {
_coreVar._currPlace = LANDING;
_caff = _coreVar._currPlace;
@@ -65,10 +65,10 @@ void MortevielleEngine::fctMove() {
if (_num == 1) {
_coreVar._currPlace = OWN_ROOM;
- _menu.setDestinationText(OWN_ROOM);
+ _menu->setDestinationText(OWN_ROOM);
} else if (_num == 7) {
_coreVar._currPlace = ATTIC;
- _menu.setDestinationText(ATTIC);
+ _menu->setDestinationText(ATTIC);
} else if (_num != 6)
_coreVar._currPlace = ROOM26;
@@ -85,10 +85,10 @@ void MortevielleEngine::fctMove() {
}
exitRoom();
int menuChoice = 1;
- oldMenu = (_menu._moveMenu[menuChoice]._menuId << 8) | _menu._moveMenu[menuChoice]._actionId;
+ oldMenu = (_menu->_moveMenu[menuChoice]._menuId << 8) | _menu->_moveMenu[menuChoice]._actionId;
while (oldMenu != _currAction) {
++menuChoice;
- oldMenu = (_menu._moveMenu[menuChoice]._menuId << 8) | _menu._moveMenu[menuChoice]._actionId;
+ oldMenu = (_menu->_moveMenu[menuChoice]._menuId << 8) | _menu->_moveMenu[menuChoice]._actionId;
}
switch (_coreVar._currPlace) {
@@ -97,14 +97,14 @@ void MortevielleEngine::fctMove() {
gotoManorFront();
else if (menuChoice == 2)
checkManorDistance();
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
return;
case INSIDE_WELL:
if (menuChoice == 1)
floodedInWell();
else if (menuChoice == 2)
gotoManorBack();
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
return;
case BUREAU:
if (menuChoice == 1)
@@ -193,7 +193,7 @@ void MortevielleEngine::fctMove() {
if ((menuChoice < 5) || (menuChoice == 13) || (menuChoice == 14))
prepareDisplayText();
resetRoomVariables(_coreVar._currPlace);
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
}
/**
@@ -208,23 +208,32 @@ void MortevielleEngine::fctTake() {
if (_currBitIndex > 0)
_coreVar._faithScore += 3;
if (_obpart) {
- if (_coreVar._currPlace == PURPLE_ROOM)
+ switch (_coreVar._currPlace) {
+ case PURPLE_ROOM:
_coreVar._purpleRoomObjectId = 0;
- if (_coreVar._currPlace == ATTIC) {
+ break;
+ case ATTIC:
if (_coreVar._atticBallHoleObjectId == _caff)
_coreVar._atticBallHoleObjectId = 0;
if (_coreVar._atticRodHoleObjectId == _caff)
_coreVar._atticRodHoleObjectId = 0;
- }
- if (_coreVar._currPlace == CELLAR)
+ break;
+ case CELLAR:
_coreVar._cellarObjectId = 0;
- if (_coreVar._currPlace == CRYPT)
+ break;
+ case CRYPT:
_coreVar._cryptObjectId = 0;
- if (_coreVar._currPlace == SECRET_PASSAGE)
+ break;
+ case SECRET_PASSAGE:
_coreVar._secretPassageObjectId = 0;
- if (_coreVar._currPlace == WELL)
+ break;
+ case WELL:
_coreVar._wellObjectId = 0;
- _menu.unsetSearchMenu();
+ break;
+ default:
+ break;
+ }
+ _menu->unsetSearchMenu();
_obpart = false;
prepareDisplayText();
} else {
@@ -258,38 +267,54 @@ void MortevielleEngine::fctTake() {
if (_currBitIndex > 0)
_coreVar._faithScore += 3;
_crep = 997;
- if ((_coreVar._currPlace == PURPLE_ROOM) && (_coreVar._purpleRoomObjectId != 0))
- putInHand(_coreVar._purpleRoomObjectId);
- if ((_coreVar._currPlace == ATTIC) && (_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
- putInHand(_coreVar._atticBallHoleObjectId);
- if ((_crep != 997) && (_crep != 139))
- displayAnimFrame(2, 7);
- }
- if ((_coreVar._currPlace == ATTIC) && (_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
- putInHand(_coreVar._atticRodHoleObjectId);
- if ((_crep != 997) && (_crep != 139))
- displayAnimFrame(2, 6);
- }
- if ((_coreVar._currPlace == CELLAR) && (_coreVar._cellarObjectId != 0)) {
- putInHand(_coreVar._cellarObjectId);
- if ((_crep != 997) && (_crep != 139))
- displayAnimFrame(2, 2);
- }
- if ((_coreVar._currPlace == CRYPT) && (_coreVar._cryptObjectId != 0))
- putInHand(_coreVar._cryptObjectId);
-
- if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId != 0)) {
- putInHand(_coreVar._secretPassageObjectId);
- if ((_crep != 997) && (_crep != 139)) {
- _crep = 182;
- displayAnimFrame(2, 1);
+
+ switch (_coreVar._currPlace) {
+ case PURPLE_ROOM:
+ if (_coreVar._purpleRoomObjectId != 0)
+ putInHand(_coreVar._purpleRoomObjectId);
+ break;
+ case ATTIC:
+ if ((_num == 1) && (_coreVar._atticBallHoleObjectId != 0)) {
+ putInHand(_coreVar._atticBallHoleObjectId);
+ if ((_crep != 997) && (_crep != 139))
+ displayAnimFrame(2, 7);
+ } else if ((_num == 2) && (_coreVar._atticRodHoleObjectId != 0)) {
+ putInHand(_coreVar._atticRodHoleObjectId);
+ if ((_crep != 997) && (_crep != 139))
+ displayAnimFrame(2, 6);
}
+ break;
+ case CELLAR:
+ if (_coreVar._cellarObjectId != 0) {
+ putInHand(_coreVar._cellarObjectId);
+ if ((_crep != 997) && (_crep != 139))
+ displayAnimFrame(2, 2);
+ }
+ break;
+ case CRYPT:
+ if (_coreVar._cryptObjectId != 0)
+ putInHand(_coreVar._cryptObjectId);
+ break;
+ case SECRET_PASSAGE:
+ if (_coreVar._secretPassageObjectId != 0) {
+ putInHand(_coreVar._secretPassageObjectId);
+ if ((_crep != 997) && (_crep != 139)) {
+ _crep = 182;
+ displayAnimFrame(2, 1);
+ }
+ }
+ break;
+ case WELL:
+ if (_coreVar._wellObjectId != 0) {
+ putInHand(_coreVar._wellObjectId);
+ if ((_crep != 997) && (_crep != 139))
+ displayAnimFrame(2, 1);
+ }
+ break;
+ default:
+ break;
}
- if ((_coreVar._currPlace == WELL) && (_coreVar._wellObjectId != 0)) {
- putInHand(_coreVar._wellObjectId);
- if ((_crep != 997) && (_crep != 139))
- displayAnimFrame(2, 1);
- }
+
if ((_crep != 997) && (_crep != 182) && (_crep != 139))
_crep = 999;
}
@@ -325,7 +350,7 @@ void MortevielleEngine::fctInventoryTake() {
int oldMenu = 0;
do {
++inventIndex;
- oldMenu = (_menu._inventoryMenu[inventIndex]._menuId << 8) | _menu._inventoryMenu[inventIndex]._actionId;
+ oldMenu = (_menu->_inventoryMenu[inventIndex]._menuId << 8) | _menu->_inventoryMenu[inventIndex]._actionId;
} while (oldMenu != _currAction);
int cz = 0;
int cy = 0;
@@ -336,7 +361,7 @@ void MortevielleEngine::fctInventoryTake() {
} while (cz != inventIndex);
cz = _coreVar._inventory[cy];
_coreVar._inventory[cy] = 0;
- _menu.setInventoryText();
+ _menu->setInventoryText();
putInHand(cz);
_crep = 998;
clearDescriptionBar();
@@ -536,7 +561,7 @@ void MortevielleEngine::fctSearch() {
if (_curSearchObjId != 0) {
_searchCount = 0;
_heroSearching = true;
- _menu.setSearchMenu();
+ _menu->setSearchMenu();
prepareNextObject();
} else
_crep = 997;
@@ -607,7 +632,7 @@ void MortevielleEngine::fctOpen() {
if (_caff == ROOM26) {
if (_roomDoorId != OWN_ROOM) {
- _currAction = _menu._opcodeEnter;
+ _currAction = _menu->_opcodeEnter;
_syn = true;
} else
_crep = 997;
@@ -663,11 +688,11 @@ void MortevielleEngine::fctOpen() {
|| (_coreVar._currPlace == PURPLE_ROOM)
|| (_coreVar._currPlace == BLUE_ROOM)) {
if (getRandomNumber(1, 4) == 3)
- _soundManager.startSpeech(7, 9, 1);
+ _soundManager->startSpeech(7, 9, 1);
}
_openObjects[i] = _num;
displayAnimFrame(1, _num);
- _soundManager.waitSpeech();
+ _soundManager->waitSpeech();
}
int tmpPlace = _coreVar._currPlace;
if (_coreVar._currPlace == CRYPT)
@@ -731,21 +756,21 @@ void MortevielleEngine::fctPlace() {
displayAnimFrame(1, 1);
handleDescriptionText(2, 165);
displayEmptyHand();
- _soundManager.startSpeech(6, -9, 1);
+ _soundManager->startSpeech(6, -9, 1);
// Do you want to enter the hidden passage?
- int answer = _dialogManager.show(getEngineString(S_YES_NO));
+ int answer = _dialogManager->show(getEngineString(S_YES_NO));
if (answer == 1) {
Common::String alertTxt = getString(582);
- _dialogManager.show(alertTxt);
+ _dialogManager->show(alertTxt);
- bool enterPassageFl = _dialogManager.showKnowledgeCheck();
- _mouse.hideMouse();
+ bool enterPassageFl = _dialogManager->showKnowledgeCheck();
+ _mouse->hideMouse();
clearScreen();
drawRightFrame();
clearDescriptionBar();
clearVerbBar();
- _mouse.showMouse();
+ _mouse->showMouse();
prepareRoom();
drawClock();
if (_currBitIndex != 0)
@@ -753,18 +778,18 @@ void MortevielleEngine::fctPlace() {
else
displayAloneText();
- _menu.displayMenu();
+ _menu->displayMenu();
if (enterPassageFl) {
_coreVar._currPlace = SECRET_PASSAGE;
- _menu.setDestinationText(SECRET_PASSAGE);
+ _menu->setDestinationText(SECRET_PASSAGE);
} else {
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
setPal(14);
drawPicture();
displayAnimFrame(1, 2);
displayAnimFrame(1, 1);
alertTxt = getString(577);
- _dialogManager.show(alertTxt);
+ _dialogManager->show(alertTxt);
displayAnimFrame(2, 1);
_crep = 166;
}
@@ -832,8 +857,8 @@ void MortevielleEngine::fctTurn() {
_crep = 997;
if ((_coreVar._currPlace == ATTIC) && (_coreVar._atticRodHoleObjectId == 159) && (_coreVar._atticBallHoleObjectId == 141)) {
handleDescriptionText(2, 167);
- _soundManager.startSpeech(7, 9, 1);
- int answer = _dialogManager.show(getEngineString(S_YES_NO));
+ _soundManager->startSpeech(7, 9, 1);
+ int answer = _dialogManager->show(getEngineString(S_YES_NO));
if (answer == 1)
_endGame = true;
else
@@ -842,8 +867,8 @@ void MortevielleEngine::fctTurn() {
if ((_coreVar._currPlace == SECRET_PASSAGE) && (_coreVar._secretPassageObjectId == 143)) {
handleDescriptionText(2, 175);
clearVerbBar();
- _soundManager.startSpeech(6, -9, 1);
- int answer = _dialogManager.show(getEngineString(S_YES_NO));
+ _soundManager->startSpeech(6, -9, 1);
+ int answer = _dialogManager->show(getEngineString(S_YES_NO));
if (answer == 1) {
_coreVar._currPlace = CRYPT;
prepareDisplayText();
@@ -949,7 +974,7 @@ void MortevielleEngine::fctKnock() {
displayTextInVerbBar(getEngineString(S_HIT));
if (_coreVar._currPlace == LANDING) {
- _dialogManager.show(getEngineString(S_BEFORE_USE_DEP_MENU));
+ _dialogManager->show(getEngineString(S_BEFORE_USE_DEP_MENU));
return;
}
@@ -967,7 +992,7 @@ void MortevielleEngine::fctKnock() {
if (_coreVar._currPlace == ROOM26) {
int rand = (getRandomNumber(0, 8)) - 4;
- _soundManager.startSpeech(11, rand, 1);
+ _soundManager->startSpeech(11, rand, 1);
int pres = getPresenceStats(rand, _coreVar._faithScore, _roomDoorId);
if (_roomDoorId != OWN_ROOM) {
if (pres != -500) {
@@ -1132,7 +1157,7 @@ void MortevielleEngine::fctEat() {
_coreVar._currPlace = DINING_ROOM;
_caff = DINING_ROOM;
resetRoomVariables(_coreVar._currPlace);
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
int day, hour, minute;
updateHour(day, hour, minute);
@@ -1168,7 +1193,7 @@ void MortevielleEngine::fctEat() {
void MortevielleEngine::fctEnter() {
if ((_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) {
gotoDiningRoom();
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
} else if (_coreVar._currPlace == LANDING)
showMoveMenuAlert();
else if (_roomDoorId == OWN_ROOM)
@@ -1178,22 +1203,22 @@ void MortevielleEngine::fctEnter() {
_coreVar._availableQuestion[8] = '*';
} else {
int pres = 0;
- if (!_blo)
+ if (!_outsideOnlyFl)
pres = getPresence(_roomDoorId);
if (pres != 0) {
if ((_roomDoorId == TOILETS) || (_roomDoorId == BATHROOM))
_crep = 179;
else {
int randVal = (getRandomNumber(0, 10)) - 5;
- _soundManager.startSpeech(7, randVal, 1);
+ _soundManager->startSpeech(7, randVal, 1);
displayAnimFrame(1, 1);
- _soundManager.waitSpeech();
+ _soundManager->waitSpeech();
int charIndex = convertBitIndexToCharacterIndex(pres);
++_coreVar._faithScore;
_coreVar._currPlace = LANDING;
_currMenu = MENU_DISCUSS;
- _currAction = (_menu._discussMenu[charIndex]._menuId << 8) | _menu._discussMenu[charIndex]._actionId;
+ _currAction = (_menu->_discussMenu[charIndex]._menuId << 8) | _menu->_discussMenu[charIndex]._actionId;
_syn = true;
if (_roomDoorId == JULIA_ROOM) {
_col = true;
@@ -1207,14 +1232,14 @@ void MortevielleEngine::fctEnter() {
}
} else {
int randVal = (getRandomNumber(0, 10)) - 5;
- _soundManager.startSpeech(7, randVal, 1);
+ _soundManager->startSpeech(7, randVal, 1);
displayAnimFrame(1, 1);
- _soundManager.waitSpeech();
+ _soundManager->waitSpeech();
_coreVar._currPlace = _roomDoorId;
prepareDisplayText();
resetRoomVariables(_coreVar._currPlace);
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
_roomDoorId = OWN_ROOM;
_savedBitIndex = 0;
_currBitIndex = 0;
@@ -1237,7 +1262,7 @@ void MortevielleEngine::fctSleep() {
prepareDisplayText();
drawPictureWithText();
resetRoomVariables(_coreVar._currPlace);
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
}
clearVerbBar();
clearDescriptionBar();
@@ -1261,7 +1286,7 @@ void MortevielleEngine::fctSleep() {
if (hour > 23)
hour = 0;
prepareRoom();
- answer = _dialogManager.show(getEngineString(S_YES_NO));
+ answer = _dialogManager->show(getEngineString(S_YES_NO));
_anyone = false;
} while (answer != 1);
_crep = 998;
@@ -1321,7 +1346,7 @@ void MortevielleEngine::fctLeave() {
if (_crep == 0)
_crep = nextPlace;
resetRoomVariables(nextPlace);
- _menu.setDestinationText(nextPlace);
+ _menu->setDestinationText(nextPlace);
}
}
@@ -1337,7 +1362,7 @@ void MortevielleEngine::fctWait() {
do {
++_currentHourCount;
prepareRoom();
- if (!_blo)
+ if (!_outsideOnlyFl)
getPresence(_coreVar._currPlace);
if ((_currBitIndex != 0) && (_savedBitIndex == 0)) {
_crep = 998;
@@ -1351,7 +1376,7 @@ void MortevielleEngine::fctWait() {
return;
}
handleDescriptionText(2, 102);
- answer = _dialogManager.show(getEngineString(S_YES_NO));
+ answer = _dialogManager->show(getEngineString(S_YES_NO));
} while (answer != 2);
_crep = 998;
if (!_anyone)
@@ -1394,7 +1419,7 @@ void MortevielleEngine::fctDiscuss() {
int oldMenu;
do {
++cx;
- oldMenu = (_menu._discussMenu[cx]._menuId << 8) | _menu._discussMenu[cx]._actionId;
+ oldMenu = (_menu->_discussMenu[cx]._menuId << 8) | _menu->_discussMenu[cx]._actionId;
} while (oldMenu != _currAction);
_caff = 69 + cx;
drawPictureWithText();
@@ -1403,7 +1428,7 @@ void MortevielleEngine::fctDiscuss() {
}
testKey(false);
menuUp();
- _mouse.hideMouse();
+ _mouse->hideMouse();
clearScreen();
drawDiscussionBox();
startDialog(displId);
@@ -1417,13 +1442,13 @@ void MortevielleEngine::fctDiscuss() {
}
lib[46] = lib[45];
lib[45] = ' ';
- _mouse.showMouse();
+ _mouse->showMouse();
do {
choice = 0;
int posX = 0;
int posY = 0;
for (int icm = 1; icm < 43; icm++) {
- _screenSurface.putxy(posX, posY);
+ _screenSurface->putxy(posX, posY);
if (_coreVar._availableQuestion[icm] == '*') {
// If question already asked, write it in reverse video
if (questionAsked[icm])
@@ -1438,17 +1463,17 @@ void MortevielleEngine::fctDiscuss() {
} else
posY += 8;
}
- _screenSurface.putxy(320, 176);
+ _screenSurface->putxy(320, 176);
displayQuestionText(lib[46], 0);
char retKey = '\0';
bool click;
do {
bool dummyFl;
- _mouse.moveMouse(dummyFl, retKey);
+ _mouse->moveMouse(dummyFl, retKey);
if (shouldQuit())
return;
- _mouse.getMousePosition(x, y, click);
+ _mouse->getMousePosition(x, y, click);
x *= (3 - kResolutionScaler);
if (x > 319)
cx = 41;
@@ -1462,7 +1487,7 @@ void MortevielleEngine::fctDiscuss() {
posX = 320;
else
posX = 0;
- _screenSurface.putxy(posX, posY);
+ _screenSurface->putxy(posX, posY);
if (questionAsked[choice])
displayQuestionText(lib[choice], 0);
else
@@ -1481,7 +1506,7 @@ void MortevielleEngine::fctDiscuss() {
posX = 320;
else
posX = 0;
- _screenSurface.putxy(posX, posY);
+ _screenSurface->putxy(posX, posY);
if (questionAsked[choice])
displayQuestionText(lib[choice], 0);
else
@@ -1494,7 +1519,7 @@ void MortevielleEngine::fctDiscuss() {
posX = 320;
else
posX = 0;
- _screenSurface.putxy(posX, posY);
+ _screenSurface->putxy(posX, posY);
if (questionAsked[ix])
displayQuestionText(lib[ix], 0);
else
@@ -1533,11 +1558,11 @@ void MortevielleEngine::fctDiscuss() {
_coreVar._faithScore += 3;
displId = 139;
}
- _mouse.hideMouse();
+ _mouse->hideMouse();
clearScreen();
drawDiscussionBox();
startDialog(displId);
- _mouse.showMouse();
+ _mouse->showMouse();
if ((displId == 84) || (displId == 86)) {
_coreVar._pctHintFound[5] = '*';
_coreVar._availableQuestion[7] = '*';
@@ -1551,32 +1576,32 @@ void MortevielleEngine::fctDiscuss() {
_coreVar._pctHintFound[8] = '*';
_coreVar._availableQuestion[32] = '*';
}
- _mouse.hideMouse();
+ _mouse->hideMouse();
clearScreen();
- _mouse.showMouse();
+ _mouse->showMouse();
}
} while ((choice != 46) && (displId != 138));
if (_col) {
_coreVar._faithScore += (3 * (_coreVar._faithScore / 10));
- _mouse.hideMouse();
+ _mouse->hideMouse();
clearScreen();
drawDiscussionBox();
startDialog(138);
- _mouse.showMouse();
+ _mouse->showMouse();
_col = false;
_coreVar._currPlace = LANDING;
}
_controlMenu = 0;
- _mouse.hideMouse();
+ _mouse->hideMouse();
clearScreen();
drawRightFrame();
- _mouse.showMouse();
+ _mouse->showMouse();
showPeoplePresent(_currBitIndex);
prepareRoom();
drawClock();
prepareDisplayText();
/* chech;*/
- _menu.setDestinationText(_coreVar._currPlace);
+ _menu->setDestinationText(_coreVar._currPlace);
clearVerbBar();
}
@@ -1625,13 +1650,13 @@ void MortevielleEngine::endGame() {
clearVerbBar();
handleDescriptionText(9, 1509);
testKey(false);
- _mouse.hideMouse();
+ _mouse->hideMouse();
_caff = 70;
- _text.taffich();
+ _text->taffich();
clearScreen();
drawDiscussionBox();
startDialog(141);
- _mouse.showMouse();
+ _mouse->showMouse();
clearUpperLeftPart();
handleDescriptionText(9, 1509);
handleDescriptionText(2, 142);
@@ -1667,7 +1692,7 @@ void MortevielleEngine::askRestart() {
_day = 0;
handleDescriptionText(2, 180);
- int answer = _dialogManager.show(getEngineString(S_YES_NO));
+ int answer = _dialogManager->show(getEngineString(S_YES_NO));
_quitGame = (answer != 1);
}
diff --git a/engines/mortevielle/configure.engine b/engines/mortevielle/configure.engine
new file mode 100644
index 0000000000..a7fb2ccda6
--- /dev/null
+++ b/engines/mortevielle/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 mortevielle "Mortevielle" yes
diff --git a/engines/mortevielle/debugger.cpp b/engines/mortevielle/debugger.cpp
index 4ef5151c81..4b39462cde 100644
--- a/engines/mortevielle/debugger.cpp
+++ b/engines/mortevielle/debugger.cpp
@@ -25,7 +25,8 @@
namespace Mortevielle {
-Debugger::Debugger() : GUI::Debugger() {
+Debugger::Debugger(MortevielleEngine *vm) : GUI::Debugger() {
+ _vm = vm;
DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("show_questions", WRAP_METHOD(Debugger, Cmd_showAllQuestions));
DCmd_Register("reset_parano", WRAP_METHOD(Debugger, Cmd_resetParano));
@@ -52,8 +53,4 @@ bool Debugger::Cmd_resetParano(int argc, const char **argv) {
return true;
}
-void Debugger::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
-
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/debugger.h b/engines/mortevielle/debugger.h
index 9041d90110..6e1006681c 100644
--- a/engines/mortevielle/debugger.h
+++ b/engines/mortevielle/debugger.h
@@ -39,9 +39,8 @@ protected:
bool Cmd_resetParano(int argc, const char **argv);
public:
- Debugger();
+ Debugger(MortevielleEngine *vm);
virtual ~Debugger() {}
- void setParent(MortevielleEngine *vm);
};
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/dialogs.cpp b/engines/mortevielle/dialogs.cpp
index 9a2ade60ab..09a4227cc0 100644
--- a/engines/mortevielle/dialogs.cpp
+++ b/engines/mortevielle/dialogs.cpp
@@ -35,15 +35,19 @@
namespace Mortevielle {
+DialogManager::DialogManager(MortevielleEngine *vm) {
+ _vm = vm;
+}
+
/**
* Alert function - Show
* @remarks Originally called 'do_alert'
*/
int DialogManager::show(const Common::String &msg) {
// Make a copy of the current screen surface for later restore
- _vm->_backgroundSurface.copyFrom(_vm->_screenSurface);
+ _vm->_backgroundSurface.copyFrom(*_vm->_screenSurface);
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
while (_vm->keyPressed())
_vm->getChar();
@@ -63,7 +67,7 @@ int DialogManager::show(const Common::String &msg) {
} else {
drawAlertBox(8, 7, colNumb);
int i = 0;
- _vm->_screenSurface._textPos.y = 70;
+ _vm->_screenSurface->_textPos.y = 70;
do {
curPos.x = 320;
Common::String displayStr = "";
@@ -72,9 +76,9 @@ int DialogManager::show(const Common::String &msg) {
displayStr += alertStr[i];
curPos.x -= 3;
}
- _vm->_screenSurface.putxy(curPos.x, _vm->_screenSurface._textPos.y);
- _vm->_screenSurface._textPos.y += 6;
- _vm->_screenSurface.drawString(displayStr, 4);
+ _vm->_screenSurface->putxy(curPos.x, _vm->_screenSurface->_textPos.y);
+ _vm->_screenSurface->_textPos.y += 6;
+ _vm->_screenSurface->drawString(displayStr, 4);
++i;
} while (alertStr[i] != ']');
}
@@ -99,17 +103,17 @@ int DialogManager::show(const Common::String &msg) {
limit[2][1] = ((uint)(320 + ((uint)esp >> 1)) / 2) * kResolutionScaler;
limit[2][2] = (limit[2][1]) + 40;
}
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
int id = 0;
bool dummyFl = false;
bool test3;
do {
char dummyKey = '\377';
- _vm->_mouse.moveMouse(dummyFl, dummyKey);
+ _vm->_mouse->moveMouse(dummyFl, dummyKey);
if (_vm->shouldQuit())
return 0;
- curPos = _vm->_mouse._pos;
+ curPos = _vm->_mouse->_pos;
bool newaff = false;
if ((curPos.y > 95) && (curPos.y < 105)) {
bool test1 = (curPos.x > limit[1][1]) && (curPos.x < limit[1][2]);
@@ -125,56 +129,56 @@ int DialogManager::show(const Common::String &msg) {
else
ix = 2;
if (ix != id) {
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
if (id != 0) {
setPosition(id, coldep, esp);
Common::String tmpStr(" ");
tmpStr += buttonStr[id];
tmpStr += " ";
- _vm->_screenSurface.drawString(tmpStr, 0);
+ _vm->_screenSurface->drawString(tmpStr, 0);
}
setPosition(ix, coldep, esp);
Common::String tmp2 = " ";
tmp2 += buttonStr[ix];
tmp2 += " ";
- _vm->_screenSurface.drawString(tmp2, 1);
+ _vm->_screenSurface->drawString(tmp2, 1);
id = ix;
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
}
}
}
if ((id != 0) && !newaff) {
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
setPosition(id, coldep, esp);
Common::String tmp3(" ");
tmp3 += buttonStr[id];
tmp3 += " ";
- _vm->_screenSurface.drawString(tmp3, 0);
+ _vm->_screenSurface->drawString(tmp3, 0);
id = 0;
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
}
test3 = (curPos.y > 95) && (curPos.y < 105) && (((curPos.x > limit[1][1]) && (curPos.x < limit[1][2]))
|| ((curPos.x > limit[2][1]) && (curPos.x < limit[2][2])));
} while (!_vm->getMouseClick());
_vm->setMouseClick(false);
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
if (!test3) {
id = 1;
setPosition(1, coldep, esp);
Common::String tmp4(" ");
tmp4 += buttonStr[1];
tmp4 += " ";
- _vm->_screenSurface.drawString(tmp4, 1);
+ _vm->_screenSurface->drawString(tmp4, 1);
}
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
/* Restore the background area */
- _vm->_screenSurface.copyFrom(_vm->_backgroundSurface, 0, 0);
+ _vm->_screenSurface->copyFrom(_vm->_backgroundSurface, 0, 0);
return id;
}
@@ -221,7 +225,7 @@ void DialogManager::decodeAlertDetails(Common::String inputStr, int &choiceNumb,
}
void DialogManager::setPosition(int ji, int coldep, int esp) {
- _vm->_screenSurface.putxy(coldep + (40 + esp) * (ji - 1), 98);
+ _vm->_screenSurface->putxy(coldep + (40 + esp) * (ji - 1), 98);
}
/**
@@ -235,9 +239,9 @@ void DialogManager::drawAlertBox(int firstLine, int lineNum, int width) {
int y = (firstLine - 1) * 8;
int xx = x + width;
int yy = y + (lineNum * 8);
- _vm->_screenSurface.fillRect(15, Common::Rect(x, y, xx, yy));
- _vm->_screenSurface.fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
- _vm->_screenSurface.fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
+ _vm->_screenSurface->fillRect(15, Common::Rect(x, y, xx, yy));
+ _vm->_screenSurface->fillRect(0, Common::Rect(x, y + 2, xx, y + 4));
+ _vm->_screenSurface->fillRect(0, Common::Rect(x, yy - 4, xx, yy - 2));
}
/**
@@ -259,13 +263,13 @@ void DialogManager::setButtonText(Common::String c, int coldep, int nbcase, Comm
while (str[l].size() < 3)
str[l] += ' ';
- _vm->_screenSurface.putxy(x, 98);
+ _vm->_screenSurface->putxy(x, 98);
Common::String tmp(" ");
tmp += str[l];
tmp += " ";
- _vm->_screenSurface.drawString(tmp, 0);
+ _vm->_screenSurface->drawString(tmp, 0);
x += esp + 40;
}
}
@@ -292,13 +296,13 @@ bool DialogManager::showKnowledgeCheck() {
int correctCount = 0;
for (int indx = 0; indx < 10; ++indx) {
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
_vm->clearScreen();
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
int dialogHeight = 23;
- _vm->_screenSurface.fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
+ _vm->_screenSurface->fillRect(15, Common::Rect(0, 14, 630, dialogHeight));
Common::String tmpStr = _vm->getString(textIndexArr[indx]);
- _vm->_text.displayStr(tmpStr, 20, 15, 100, 2, 0);
+ _vm->_text->displayStr(tmpStr, 20, 15, 100, 2, 0);
int firstOption;
int lastOption;
@@ -318,7 +322,7 @@ bool DialogManager::showKnowledgeCheck() {
tmpStr = _vm->getString(j);
if ((int) tmpStr.size() > maxLength)
maxLength = tmpStr.size();
- _vm->_text.displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
+ _vm->_text->displayStr(tmpStr, 100, optionPosY, 100, 1, 0);
choiceArray[prevChoice] = tmpStr;
optionPosY += 8;
}
@@ -333,7 +337,7 @@ bool DialogManager::showKnowledgeCheck() {
}
coor[lastOption - firstOption + 2]._enabled = false;
int rep = 6;
- _vm->_screenSurface.drawBox(80, 33, 40 + (maxLength * rep), (lastOption - firstOption) * 8 + 16, 15);
+ _vm->_screenSurface->drawBox(80, 33, 40 + (maxLength * rep), (lastOption - firstOption) * 8 + 16, 15);
rep = 0;
prevChoice = 0;
@@ -342,26 +346,26 @@ bool DialogManager::showKnowledgeCheck() {
_vm->setMouseClick(false);
bool flag;
char key;
- _vm->_mouse.moveMouse(flag, key);
+ _vm->_mouse->moveMouse(flag, key);
if (_vm->shouldQuit())
return false;
currChoice = 1;
- while (coor[currChoice]._enabled && !_vm->_mouse.isMouseIn(coor[currChoice]._rect))
+ while (coor[currChoice]._enabled && !_vm->_mouse->isMouseIn(coor[currChoice]._rect))
++currChoice;
if (coor[currChoice]._enabled) {
if ((prevChoice != 0) && (prevChoice != currChoice)) {
tmpStr = choiceArray[prevChoice] + '$';
- _vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+ _vm->_text->displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
}
if (prevChoice != currChoice) {
tmpStr = choiceArray[currChoice] + '$';
- _vm->_text.displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
+ _vm->_text->displayStr(tmpStr, 100, 27 + (currChoice * 8), 100, 1, 1);
prevChoice = currChoice;
}
} else if (prevChoice != 0) {
tmpStr = choiceArray[prevChoice] + '$';
- _vm->_text.displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
+ _vm->_text->displayStr(tmpStr, 100, 27 + (prevChoice * 8), 100, 1, 0);
prevChoice = 0;
}
} while (!((prevChoice != 0) && _vm->getMouseClick()));
@@ -391,17 +395,17 @@ void DialogManager::drawF3F8() {
Common::String f8 = _vm->getEngineString(S_F8);
// Write the F3 and F8 text strings
- _vm->_screenSurface.putxy(3, 44);
- _vm->_screenSurface.drawString(f3, 5);
- _vm->_screenSurface._textPos.y = 51;
- _vm->_screenSurface.drawString(f8, 5);
+ _vm->_screenSurface->putxy(3, 44);
+ _vm->_screenSurface->drawString(f3, 5);
+ _vm->_screenSurface->_textPos.y = 51;
+ _vm->_screenSurface->drawString(f8, 5);
// Get the width of the written text strings
- int f3Width = _vm->_screenSurface.getStringWidth(f3);
- int f8Width = _vm->_screenSurface.getStringWidth(f8);
+ int f3Width = _vm->_screenSurface->getStringWidth(f3);
+ int f8Width = _vm->_screenSurface->getStringWidth(f8);
// Write out the bounding box
- _vm->_screenSurface.drawBox(0, 42, MAX(f3Width, f8Width) + 6, 18, 7);
+ _vm->_screenSurface->drawBox(0, 42, MAX(f3Width, f8Width) + 6, 18, 7);
}
/**
@@ -412,7 +416,7 @@ void DialogManager::drawF3F8() {
void DialogManager::checkForF8(int SpeechNum, bool drawFrame2Fl) {
_vm->testKeyboard();
do {
- _vm->_soundManager.startSpeech(SpeechNum, 0, 0);
+ _vm->_soundManager->startSpeech(SpeechNum, 0, 0);
_vm->_key = waitForF3F8();
if (_vm->shouldQuit())
return;
@@ -442,7 +446,7 @@ int DialogManager::waitForF3F8() {
void DialogManager::displayIntroScreen(bool drawFrame2Fl) {
_vm->_caff = 50;
_vm->_maff = 0;
- _vm->_text.taffich();
+ _vm->_text->taffich();
_vm->draw(63, 12);
if (drawFrame2Fl)
displayIntroFrame2();
@@ -466,7 +470,4 @@ void DialogManager::displayIntroFrame2() {
_vm->handleDescriptionText(2, kDialogStringIndex + 143);
}
-void DialogManager::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/dialogs.h b/engines/mortevielle/dialogs.h
index 3f30851960..03dfc78023 100644
--- a/engines/mortevielle/dialogs.h
+++ b/engines/mortevielle/dialogs.h
@@ -51,7 +51,8 @@ private:
void drawAlertBox(int firstLine, int lineNum, int width);
void setButtonText(Common::String c, int coldep, int nbcase, Common::String *str, int esp);
public:
- void setParent(MortevielleEngine *vm);
+ DialogManager(MortevielleEngine *vm);
+
int show(const Common::String &msg);
void drawF3F8();
void checkForF8(int SpeechNum, bool drawFrame2Fl);
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp
index daf7926438..18b0e7f1c1 100644
--- a/engines/mortevielle/graphics.cpp
+++ b/engines/mortevielle/graphics.cpp
@@ -881,6 +881,10 @@ GfxSurface::~GfxSurface() {
* Screen surface
*-------------------------------------------------------------------------*/
+ScreenSurface::ScreenSurface(MortevielleEngine *vm) {
+ _vm = vm;
+}
+
/**
* Called to populate the font data from the passed file
*/
@@ -1070,7 +1074,7 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
if (l == "")
return;
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
Common::Point pt = _textPos;
int charWidth = 6;
@@ -1082,11 +1086,11 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
case 0:
case 2:
color = 15;
- _vm->_screenSurface.fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+ _vm->_screenSurface->fillRect(0, Common::Rect(pt.x, pt.y, x, pt.y + 7));
break;
case 1:
case 3:
- _vm->_screenSurface.fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
+ _vm->_screenSurface->fillRect(15, Common::Rect(pt.x, pt.y, x, pt.y + 7));
break;
case 5:
color = 15;
@@ -1099,10 +1103,10 @@ void ScreenSurface::drawString(const Common::String &l, int command) {
pt.x += 1;
pt.y += 1;
for (x = 1; (x <= (int)l.size()) && (l[x - 1] != 0); ++x) {
- _vm->_screenSurface.writeCharacter(Common::Point(pt.x, pt.y), l[x - 1], color);
+ _vm->_screenSurface->writeCharacter(Common::Point(pt.x, pt.y), l[x - 1], color);
pt.x += charWidth;
}
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
}
/**
@@ -1133,7 +1137,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
else
step = 1;
do {
- _vm->_screenSurface.setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
+ _vm->_screenSurface->setPixel(Common::Point(abs((int)(a * i + b)), i), coul);
i += step;
} while (i != yy);
} else {
@@ -1145,7 +1149,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
else
step = 1;
do {
- _vm->_screenSurface.setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
+ _vm->_screenSurface->setPixel(Common::Point(i, abs((int)(a * i + b))), coul);
i = i + step;
} while (i != xx);
}
@@ -1156,12 +1160,7 @@ void ScreenSurface::drawLine(int x, int y, int xx, int yy, int coul) {
* @remarks Originally called 'paint_rect'
*/
void ScreenSurface::drawRectangle(int x, int y, int dx, int dy) {
- _vm->_screenSurface.fillRect(11, Common::Rect(x, y, x + dx, y + dy));
+ _vm->_screenSurface->fillRect(11, Common::Rect(x, y, x + dx, y + dy));
}
-void ScreenSurface::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
-
-
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h
index e31f5da29a..7f0d4823cb 100644
--- a/engines/mortevielle/graphics.h
+++ b/engines/mortevielle/graphics.h
@@ -91,6 +91,8 @@ private:
byte _fontData[FONT_NUM_CHARS * FONT_HEIGHT];
public:
+ ScreenSurface(MortevielleEngine *vm);
+
Common::Point _textPos; // Original called xwhere/ywhere
void readFontData(Common::File &f, int dataSize);
Graphics::Surface lockArea(const Common::Rect &bounds);
@@ -106,7 +108,6 @@ public:
int getStringWidth(const Common::String &s);
void drawLine(int x, int y, int xx, int yy, int coul);
void drawRectangle(int x, int y, int dx, int dy);
- void setParent(MortevielleEngine *vm);
// TODO: Refactor code to remove this method, for increased performance
void setPixel(const Common::Point &pt, int palIndex);
diff --git a/engines/mortevielle/menu.cpp b/engines/mortevielle/menu.cpp
index 641a527c98..7979e3ce7f 100644
--- a/engines/mortevielle/menu.cpp
+++ b/engines/mortevielle/menu.cpp
@@ -48,14 +48,34 @@ const byte menuConstants[8][4] = {
{62, 46, 13, 10}
};
-Menu::Menu() {
+Menu::Menu(MortevielleEngine *vm) {
+ _vm = vm;
_opcodeAttach = _opcodeWait = _opcodeForce = _opcodeSleep = OPCODE_NONE;
_opcodeListen = _opcodeEnter = _opcodeClose = _opcodeSearch = OPCODE_NONE;
_opcodeKnock = _opcodeScratch = _opcodeRead = _opcodeEat = OPCODE_NONE;
_opcodePlace = _opcodeOpen = _opcodeTake = _opcodeLook = OPCODE_NONE;
_opcodeSmell = _opcodeSound = _opcodeLeave = _opcodeLift = OPCODE_NONE;
_opcodeTurn = _opcodeSHide = _opcodeSSearch = _opcodeSRead = OPCODE_NONE;
- _opcodeSPut = _opcodeSLook = OPCODE_NONE;
+ _opcodeSPut = _opcodeSLook = _msg3 = _msg4 = OPCODE_NONE;
+
+ _menuActive = false;
+ _menuSelected = false;
+ _multiTitle = false;
+ _menuDisplayed = false;
+ for (int i = 0; i < 9; i++) {
+ _discussMenu[i]._menuId = MENU_NONE;
+ _discussMenu[i]._actionId = 0;
+ _inventoryMenu[i]._menuId = MENU_NONE;
+ _inventoryMenu[i]._actionId = 0;
+ }
+ for (int i = 0; i < 8; i++) {
+ _moveMenu[i]._menuId = MENU_NONE;
+ _moveMenu[i]._actionId = 0;
+ }
+ for (int i = 0; i < 12; i++) {
+ _actionMenu[i]._menuId = MENU_NONE;
+ _actionMenu[i]._actionId = 0;
+ }
}
void Menu::readVerbNums(Common::File &f, int dataSize) {
@@ -295,8 +315,8 @@ void Menu::enableMenuItem(MenuItem item) {
}
void Menu::displayMenu() {
- _vm->_mouse.hideMouse();
- _vm->_screenSurface.fillRect(7, Common::Rect(0, 0, 639, 10));
+ _vm->_mouse->hideMouse();
+ _vm->_screenSurface->fillRect(7, Common::Rect(0, 0, 639, 10));
int col = 28 * kResolutionScaler;
for (int charNum = 0; charNum < 6; charNum++) {
@@ -310,9 +330,9 @@ void Menu::displayMenu() {
uint msk = 0x80;
for (int pt = 0; pt <= 7; ++pt) {
if ((_charArr[charNum][idx] & msk) != 0) {
- _vm->_screenSurface.setPixel(Common::Point(x + 1, y + 1), 0);
- _vm->_screenSurface.setPixel(Common::Point(x, y + 1), 0);
- _vm->_screenSurface.setPixel(Common::Point(x, y), 9);
+ _vm->_screenSurface->setPixel(Common::Point(x + 1, y + 1), 0);
+ _vm->_screenSurface->setPixel(Common::Point(x, y + 1), 0);
+ _vm->_screenSurface->setPixel(Common::Point(x, y), 9);
}
msk >>= 1;
++x;
@@ -322,7 +342,7 @@ void Menu::displayMenu() {
}
col += 48 * kResolutionScaler;
}
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
}
/**
@@ -348,7 +368,7 @@ void Menu::invert(int indx) {
int menuIndex = _msg4 & 0xFF;
- _vm->_screenSurface.putxy(menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
+ _vm->_screenSurface->putxy(menuConstants[_msg3 - 1][0] << 3, (menuIndex + 1) << 3);
Common::String str;
switch (_msg3) {
@@ -388,7 +408,7 @@ void Menu::invert(int indx) {
break;
}
if ((str[0] != '*') && (str[0] != '<'))
- _vm->_screenSurface.drawString(str, indx);
+ _vm->_screenSurface->drawString(str, indx);
else
_msg4 = OPCODE_NONE;
}
@@ -419,71 +439,71 @@ void Menu::util(Common::Point pos) {
*/
void Menu::menuDown(int ii) {
// Make a copy of the current screen surface for later restore
- _vm->_backgroundSurface.copyFrom(_vm->_screenSurface);
+ _vm->_backgroundSurface.copyFrom(*_vm->_screenSurface);
// Draw the menu
int minX = menuConstants[ii - 1][0] << 3;
int lineNum = menuConstants[ii - 1][3];
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
int deltaX = 6;
int maxX = minX + (menuConstants[ii - 1][2] * deltaX) + 6;
if ((ii == 4) && (_vm->getLanguage() == Common::EN_ANY))
// Extra width needed for Self menu in English version
maxX = 435;
- _vm->_screenSurface.fillRect(15, Common::Rect(minX, 12, maxX, 10 + (menuConstants[ii - 1][1] << 1)));
- _vm->_screenSurface.fillRect(0, Common::Rect(maxX, 12, maxX + 4, 10 + (menuConstants[ii - 1][1] << 1)));
- _vm->_screenSurface.fillRect(0, Common::Rect(minX, 8 + (menuConstants[ii - 1][1] << 1), maxX + 4, 12 + (menuConstants[ii - 1][1] << 1)));
- _vm->_screenSurface.putxy(minX, 16);
+ _vm->_screenSurface->fillRect(15, Common::Rect(minX, 12, maxX, 10 + (menuConstants[ii - 1][1] << 1)));
+ _vm->_screenSurface->fillRect(0, Common::Rect(maxX, 12, maxX + 4, 10 + (menuConstants[ii - 1][1] << 1)));
+ _vm->_screenSurface->fillRect(0, Common::Rect(minX, 8 + (menuConstants[ii - 1][1] << 1), maxX + 4, 12 + (menuConstants[ii - 1][1] << 1)));
+ _vm->_screenSurface->putxy(minX, 16);
for (int i = 1; i <= lineNum; i++) {
switch (ii) {
case 1:
if (_inventoryStringArray[i][0] != '*')
- _vm->_screenSurface.drawString(_inventoryStringArray[i], 4);
+ _vm->_screenSurface->drawString(_inventoryStringArray[i], 4);
break;
case 2:
if (_moveStringArray[i][0] != '*')
- _vm->_screenSurface.drawString(_moveStringArray[i], 4);
+ _vm->_screenSurface->drawString(_moveStringArray[i], 4);
break;
case 3:
if (_actionStringArray[i][0] != '*')
- _vm->_screenSurface.drawString(_actionStringArray[i], 4);
+ _vm->_screenSurface->drawString(_actionStringArray[i], 4);
break;
case 4:
if (_selfStringArray[i][0] != '*')
- _vm->_screenSurface.drawString(_selfStringArray[i], 4);
+ _vm->_screenSurface->drawString(_selfStringArray[i], 4);
break;
case 5:
if (_discussStringArray[i][0] != '*')
- _vm->_screenSurface.drawString(_discussStringArray[i], 4);
+ _vm->_screenSurface->drawString(_discussStringArray[i], 4);
break;
case 6:
- _vm->_screenSurface.drawString(_vm->getEngineString(S_SAVE_LOAD + i), 4);
+ _vm->_screenSurface->drawString(_vm->getEngineString(S_SAVE_LOAD + i), 4);
break;
case 7: {
Common::String s = _vm->getEngineString(S_SAVE_LOAD + 1);
s += ' ';
s += (char)(48 + i);
- _vm->_screenSurface.drawString(s, 4);
+ _vm->_screenSurface->drawString(s, 4);
}
break;
case 8:
if (i == 1)
- _vm->_screenSurface.drawString(_vm->getEngineString(S_RESTART), 4);
+ _vm->_screenSurface->drawString(_vm->getEngineString(S_RESTART), 4);
else {
Common::String s = _vm->getEngineString(S_SAVE_LOAD + 2);
s += ' ';
s += (char)(47 + i);
- _vm->_screenSurface.drawString(s, 4);
+ _vm->_screenSurface->drawString(s, 4);
}
break;
default:
break;
}
- _vm->_screenSurface.putxy(minX, _vm->_screenSurface._textPos.y + 8);
+ _vm->_screenSurface->putxy(minX, _vm->_screenSurface->_textPos.y + 8);
}
_multiTitle = true;
- _vm->_mouse.showMouse();
+ _vm->_mouse->showMouse();
}
/**
@@ -492,11 +512,11 @@ void Menu::menuDown(int ii) {
void Menu::menuUp(int msgId) {
if (_multiTitle) {
/* Restore the background area */
- assert(_vm->_screenSurface.pitch == _vm->_backgroundSurface.pitch);
+ assert(_vm->_screenSurface->pitch == _vm->_backgroundSurface.pitch);
// Get a pointer to the source and destination of the area to restore
const byte *pSrc = (const byte *)_vm->_backgroundSurface.getBasePtr(0, 10);
- Graphics::Surface destArea = _vm->_screenSurface.lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT));
+ Graphics::Surface destArea = _vm->_screenSurface->lockArea(Common::Rect(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT));
byte *pDest = (byte *)destArea.getPixels();
// Copy the data
@@ -523,7 +543,7 @@ void Menu::updateMenu() {
if (!_menuActive)
return;
- Common::Point curPos = _vm->_mouse._pos;
+ Common::Point curPos = _vm->_mouse->_pos;
if (!_vm->getMouseClick()) {
if (curPos == _vm->_prevPos)
return;
@@ -590,10 +610,6 @@ void Menu::updateMenu() {
}
}
-void Menu::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
-
void Menu::initMenu() {
Common::File f;
diff --git a/engines/mortevielle/menu.h b/engines/mortevielle/menu.h
index debf5b09b6..d8a3b4d0d6 100644
--- a/engines/mortevielle/menu.h
+++ b/engines/mortevielle/menu.h
@@ -60,7 +60,7 @@ private:
void menuDown(int ii);
public:
- Menu();
+ Menu(MortevielleEngine *vm);
bool _menuActive;
bool _menuSelected;
@@ -103,7 +103,6 @@ public:
int _opcodeSLook;
MenuItem _actionMenu[12];
- void setParent(MortevielleEngine *vm);
void readVerbNums(Common::File &f, int dataSize);
void setText(MenuItem item, Common::String name);
void setDestinationText(int roomId);
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index d434150977..f198bcc718 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -47,17 +47,16 @@ namespace Mortevielle {
MortevielleEngine *g_vm;
MortevielleEngine::MortevielleEngine(OSystem *system, const MortevielleGameDescription *gameDesc):
- Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle"),
- _soundManager(_mixer) {
+ Engine(system), _gameDescription(gameDesc), _randomSource("mortevielle") {
g_vm = this;
- _debugger.setParent(this);
- _dialogManager.setParent(this);
- _screenSurface.setParent(this);
- _mouse.setParent(this);
- _text.setParent(this);
- _soundManager.setParent(this);
- _savegameManager.setParent(this);
- _menu.setParent(this);
+ _debugger = new Debugger(this);
+ _dialogManager = new DialogManager(this);
+ _screenSurface = new ScreenSurface(this);
+ _mouse = new MouseHandler(this);
+ _text = new TextHandler(this);
+ _soundManager = new SoundManager(this, _mixer);
+ _savegameManager = new SavegameManager(this);
+ _menu = new Menu(this);
_lastGameFrame = 0;
_mouseClick = false;
@@ -84,7 +83,7 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const MortevielleGameDescr
_keyPressedEsc = false;
_reloadCFIEC = false;
- _blo = false;
+ _outsideOnlyFl = true;
_col = false;
_syn = false;
_obpart = false;
@@ -102,9 +101,23 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const MortevielleGameDescr
_curPict = nullptr;
_curAnim = nullptr;
_rightFramePict = nullptr;
+
+ resetCoreVar();
+
+ _maff = 0;
+ _crep = 0;
}
MortevielleEngine::~MortevielleEngine() {
+ delete _menu;
+ delete _savegameManager;
+ delete _soundManager;
+ delete _text;
+ delete _mouse;
+ delete _screenSurface;
+ delete _dialogManager;
+ delete _debugger;
+
free(_curPict);
free(_curAnim);
free(_rightFramePict);
@@ -140,7 +153,7 @@ bool MortevielleEngine::canSaveGameStateCurrently() {
* Load in a savegame at the specified slot number
*/
Common::Error MortevielleEngine::loadGameState(int slot) {
- return _savegameManager.loadGame(slot);
+ return _savegameManager->loadGame(slot);
}
/**
@@ -150,7 +163,7 @@ Common::Error MortevielleEngine::saveGameState(int slot, const Common::String &d
if (slot == 0)
return Common::kWritingFailed;
- return _savegameManager.saveGame(slot, desc);
+ return _savegameManager->saveGame(slot, desc);
}
/**
@@ -196,7 +209,7 @@ Common::ErrorCode MortevielleEngine::initialize() {
DebugMan.addDebugChannel(kMortevielleGraphics, "graphics", "Graphics debugging");
// Set up an intermediate screen surface
- _screenSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
+ _screenSurface->create(SCREEN_WIDTH, SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_txxFileFl = false;
// Load texts from TXX files
@@ -205,7 +218,7 @@ Common::ErrorCode MortevielleEngine::initialize() {
// Load the mort.dat resource
Common::ErrorCode result = loadMortDat();
if (result != Common::kNoError) {
- _screenSurface.free();
+ _screenSurface->free();
return result;
}
@@ -235,8 +248,8 @@ Common::ErrorCode MortevielleEngine::initialize() {
testKeyboard();
clearScreen();
- _soundManager.loadNoise();
- _soundManager.loadAmbiantSounds();
+ _soundManager->loadNoise();
+ _soundManager->loadAmbiantSounds();
return Common::kNoError;
}
@@ -278,13 +291,13 @@ Common::ErrorCode MortevielleEngine::loadMortDat() {
if (!strncmp(dataType, "FONT", 4)) {
// Font resource
- _screenSurface.readFontData(f, dataSize);
+ _screenSurface->readFontData(f, dataSize);
} else if (!strncmp(dataType, "SSTR", 4)) {
readStaticStrings(f, dataSize, kStaticStrings);
} else if ((!strncmp(dataType, "GSTR", 4)) && (!_txxFileFl)) {
readStaticStrings(f, dataSize, kGameStrings);
} else if (!strncmp(dataType, "VERB", 4)) {
- _menu.readVerbNums(f, dataSize);
+ _menu->readVerbNums(f, dataSize);
} else {
// Unknown section
f.skip(dataSize);
@@ -369,21 +382,21 @@ Common::Error MortevielleEngine::run() {
showIntroduction();
else {
_caff = 51;
- _text.taffich();
+ _text->taffich();
}
// Either load the initial game state savegame, or the specified savegame number
adzon();
resetVariables();
if (loadSlot != 0)
- _savegameManager.loadSavegame(generateSaveFilename(loadSlot));
+ _savegameManager->loadSavegame(generateSaveFilename(loadSlot));
// Run the main game loop
mainGame();
// Cleanup (allocated in initialize())
- _screenSurface.free();
- free(_soundManager._cfiphBuffer);
+ _screenSurface->free();
+ free(_soundManager->_cfiphBuffer);
free(_cfiecBuffer);
return Common::kNoError;
@@ -393,13 +406,13 @@ Common::Error MortevielleEngine::run() {
* Show the game introduction
*/
void MortevielleEngine::showIntroduction() {
- _dialogManager.displayIntroScreen(false);
- _dialogManager.checkForF8(142, false);
+ _dialogManager->displayIntroScreen(false);
+ _dialogManager->checkForF8(142, false);
if (shouldQuit())
return;
- _dialogManager.displayIntroFrame2();
- _dialogManager.checkForF8(143, true);
+ _dialogManager->displayIntroFrame2();
+ _dialogManager->checkForF8(143, true);
if (shouldQuit())
return;
@@ -419,13 +432,13 @@ void MortevielleEngine::mainGame() {
for (_crep = 1; _crep <= _x26KeyCount; ++_crep)
decodeNumber(&_cfiecBuffer[161 * 16], (_cfiecBufferSize - (161 * 16)) / 64);
- _menu.initMenu();
+ _menu->initMenu();
charToHour();
initGame();
clearScreen();
drawRightFrame();
- _mouse.showMouse();
+ _mouse->showMouse();
// Loop to play the game
do {
diff --git a/engines/mortevielle/mortevielle.h b/engines/mortevielle/mortevielle.h
index 5ae94987a0..7a673f42f9 100644
--- a/engines/mortevielle/mortevielle.h
+++ b/engines/mortevielle/mortevielle.h
@@ -122,7 +122,6 @@ const int kMaxPatt = 20;
const int kResolutionScaler = 2;
/*
-9 "A glance at the forbidden$",
18 "It's already open$",
26 "A photograph$"
*/
@@ -135,11 +134,6 @@ enum Places {
DOOR = 25, ROOM26 = 26, COAT_ARMS = 27
};
-struct Pattern {
- byte _tay, _tax;
- byte _des[kMaxPatt + 1][kMaxPatt + 1];
-};
-
struct SaveStruct {
int _faithScore;
byte _pctHintFound[11];
@@ -391,6 +385,7 @@ private:
void prepareNextObject();
void putObject();
void resetObjectPlace();
+ void resetCoreVar();
void drawDiscussionBox();
void displayNarrativePicture(int af, int ob);
void menuUp();
@@ -407,7 +402,7 @@ public:
int _charAnswerMax[9];
byte _tabdon[4001];
bool _soundOff;
- bool _blo;
+ bool _outsideOnlyFl;
bool _destinationOk;
bool _largestClearScreen;
float _addFix;
@@ -427,17 +422,18 @@ public:
byte *_curAnim;
byte *_rightFramePict;
- Debugger _debugger;
- ScreenSurface _screenSurface;
PaletteManager _paletteManager;
GfxSurface _backgroundSurface;
Common::RandomSource _randomSource;
- SoundManager _soundManager;
- SavegameManager _savegameManager;
- Menu _menu;
- MouseHandler _mouse;
- TextHandler _text;
- DialogManager _dialogManager;
+
+ Debugger *_debugger;
+ ScreenSurface *_screenSurface;
+ SoundManager *_soundManager;
+ SavegameManager *_savegameManager;
+ Menu *_menu;
+ MouseHandler *_mouse;
+ TextHandler *_text;
+ DialogManager *_dialogManager;
MortevielleEngine(OSystem *system, const MortevielleGameDescription *gameDesc);
~MortevielleEngine();
@@ -448,7 +444,7 @@ public:
virtual Common::Error saveGameState(int slot, const Common::String &desc);
virtual Common::Error run();
virtual void pauseEngineIntern(bool pause);
- virtual GUI::Debugger *getDebugger() {return &_debugger;}
+ virtual GUI::Debugger *getDebugger() {return _debugger;}
uint32 getGameFlags() const;
Common::Language getLanguage() const;
Common::Language getOriginalLanguage() const;
diff --git a/engines/mortevielle/mouse.cpp b/engines/mortevielle/mouse.cpp
index 480b4381ef..2077a4cdc5 100644
--- a/engines/mortevielle/mouse.cpp
+++ b/engines/mortevielle/mouse.cpp
@@ -33,6 +33,10 @@
namespace Mortevielle {
+MouseHandler::MouseHandler(MortevielleEngine *vm) {
+ _vm = vm;
+}
+
/**
* Initialize the mouse
* @remarks Originally called 'init_mouse'
@@ -264,8 +268,4 @@ bool MouseHandler::isMouseIn(Common::Rect r) {
return false;
}
-void MouseHandler::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
-
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/mouse.h b/engines/mortevielle/mouse.h
index 90d1ef310e..81c02dc8bd 100644
--- a/engines/mortevielle/mouse.h
+++ b/engines/mortevielle/mouse.h
@@ -38,8 +38,8 @@ private:
MortevielleEngine *_vm;
public:
Common::Point _pos;
+ MouseHandler(MortevielleEngine *vm);
- void setParent(MortevielleEngine *vm);
void initMouse();
void hideMouse();
void showMouse();
diff --git a/engines/mortevielle/outtext.cpp b/engines/mortevielle/outtext.cpp
index d50f4005de..b359860a82 100644
--- a/engines/mortevielle/outtext.cpp
+++ b/engines/mortevielle/outtext.cpp
@@ -35,6 +35,10 @@
namespace Mortevielle {
+TextHandler::TextHandler(MortevielleEngine *vm) {
+ _vm = vm;
+}
+
/**
* Next word
* @remarks Originally called 'l_motsuiv'
@@ -59,7 +63,7 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
// Safeguard: add $ just in case
inputStr += '$';
- _vm->_screenSurface.putxy(x, y);
+ _vm->_screenSurface->putxy(x, y);
int tab = 6;
dx *= 6;
dy *= 6;
@@ -73,19 +77,19 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
while (!stringParsed) {
switch (inputStr[p]) {
case '@':
- _vm->_screenSurface.drawString(s, typ);
+ _vm->_screenSurface->drawString(s, typ);
s = "";
++p;
xc = x;
yc += 6;
- _vm->_screenSurface.putxy(xc, yc);
+ _vm->_screenSurface->putxy(xc, yc);
break;
case ' ':
s += ' ';
xc += tab;
++p;
if (nextWord(p, inputStr.c_str(), tab) + xc > xf) {
- _vm->_screenSurface.drawString(s, typ);
+ _vm->_screenSurface->drawString(s, typ);
s = "";
xc = x;
yc += 6;
@@ -96,20 +100,20 @@ void TextHandler::displayStr(Common::String inputStr, int x, int y, int dx, int
do {
j = x;
do {
- _vm->_screenSurface.putxy(j, i);
- _vm->_screenSurface.drawString(" ", 0);
+ _vm->_screenSurface->putxy(j, i);
+ _vm->_screenSurface->drawString(" ", 0);
j += 6;
} while (j <= xf);
i += 6;
} while (i <= yf);
yc = y;
}
- _vm->_screenSurface.putxy(xc, yc);
+ _vm->_screenSurface->putxy(xc, yc);
}
break;
case '$':
stringParsed = true;
- _vm->_screenSurface.drawString(s, typ);
+ _vm->_screenSurface->drawString(s, typ);
break;
default:
s += inputStr[p];
@@ -218,7 +222,7 @@ void TextHandler::taffich() {
}
_vm->_destinationOk = true;
- _vm->_mouse.hideMouse();
+ _vm->_mouse->hideMouse();
drawingStartPos = 0;
Common::String filename, altFilename;
@@ -291,18 +295,14 @@ void TextHandler::taffich() {
}
loadAniFile(filename, drawingStartPos, drawingSize);
}
- _vm->_mouse.showMouse();
- if ((a < COAT_ARMS) && ((_vm->_maff < COAT_ARMS) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_currAction != _vm->_menu._opcodeEnter)) {
+ _vm->_mouse->showMouse();
+ if ((a < COAT_ARMS) && ((_vm->_maff < COAT_ARMS) || (_vm->_coreVar._currPlace == LANDING)) && (_vm->_currAction != _vm->_menu->_opcodeEnter)) {
if ((a == ATTIC) || (a == CELLAR))
_vm->displayAloneText();
- else if (!_vm->_blo)
+ else if (!_vm->_outsideOnlyFl)
_vm->getPresence(_vm->_coreVar._currPlace);
_vm->_savedBitIndex = 0;
}
}
-void TextHandler::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
-
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/outtext.h b/engines/mortevielle/outtext.h
index 44868036d5..397ca850dd 100644
--- a/engines/mortevielle/outtext.h
+++ b/engines/mortevielle/outtext.h
@@ -38,7 +38,8 @@ private:
MortevielleEngine *_vm;
int nextWord(int p, const char *ch, int &tab);
public:
- void setParent(MortevielleEngine *vm);
+ TextHandler (MortevielleEngine *vm);
+
void displayStr(Common::String inputStr, int x, int y, int dx, int dy, int typ);
void loadPictureFile(Common::String filename, Common::String altFilename, int32 skipSize, int length);
void loadAniFile(Common::String filename, int32 skipSize, int length);
diff --git a/engines/mortevielle/saveload.cpp b/engines/mortevielle/saveload.cpp
index c14a03cd60..77a9a6371e 100644
--- a/engines/mortevielle/saveload.cpp
+++ b/engines/mortevielle/saveload.cpp
@@ -37,7 +37,7 @@ namespace Mortevielle {
static const char SAVEGAME_ID[4] = { 'M', 'O', 'R', 'T' };
-void SavegameManager::setParent(MortevielleEngine *vm) {
+SavegameManager::SavegameManager(MortevielleEngine *vm) {
_vm = vm;
}
@@ -116,14 +116,14 @@ bool SavegameManager::loadSavegame(const Common::String &filename) {
* Load a saved game
*/
Common::Error SavegameManager::loadGame(const Common::String &filename) {
- g_vm->_mouse.hideMouse();
+ g_vm->_mouse->hideMouse();
g_vm->displayEmptyHand();
if (loadSavegame(filename)) {
/* Initialization */
g_vm->charToHour();
g_vm->initGame();
g_vm->gameLoaded();
- g_vm->_mouse.showMouse();
+ g_vm->_mouse->showMouse();
return Common::kNoError;
} else
return Common::kUnknownError;
@@ -136,7 +136,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
Common::OutSaveFile *f;
int i;
- g_vm->_mouse.hideMouse();
+ g_vm->_mouse->hideMouse();
g_vm->hourToChar();
for (i = 0; i <= 389; ++i)
@@ -165,7 +165,7 @@ Common::Error SavegameManager::saveGame(int n, const Common::String &saveName) {
// Skipped: dialog asking to swap floppy
- g_vm->_mouse.showMouse();
+ g_vm->_mouse->showMouse();
return Common::kNoError;
}
@@ -191,7 +191,7 @@ void SavegameManager::writeSavegameHeader(Common::OutSaveFile *out, const Common
// Create a thumbnail and save it
Graphics::Surface *thumb = new Graphics::Surface();
- Graphics::Surface s = g_vm->_screenSurface.lockArea(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
+ Graphics::Surface s = g_vm->_screenSurface->lockArea(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
::createThumbnail(thumb, (const byte *)s.getPixels(), SCREEN_WIDTH, SCREEN_HEIGHT, thumbPalette);
Graphics::saveThumbnail(*out, *thumb);
diff --git a/engines/mortevielle/saveload.h b/engines/mortevielle/saveload.h
index 79747e6889..9c21b0c294 100644
--- a/engines/mortevielle/saveload.h
+++ b/engines/mortevielle/saveload.h
@@ -56,7 +56,8 @@ private:
void sync_save(Common::Serializer &sz);
public:
- void setParent(MortevielleEngine *vm);
+ SavegameManager(MortevielleEngine *vm);
+
bool loadSavegame(const Common::String &filename);
Common::Error loadGame(const Common::String &filename);
Common::Error saveGame(int n, const Common::String &saveName);
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index b670246726..db1f7578f1 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -55,7 +55,8 @@ namespace Mortevielle {
const byte _tabdph[16] = {0, 10, 2, 0, 2, 10, 3, 0, 3, 7, 5, 0, 6, 7, 7, 10};
const byte _tabdbc[18] = {7, 23, 7, 14, 13, 9, 14, 9, 5, 12, 6, 12, 13, 4, 0, 4, 5, 9};
-SoundManager::SoundManager(Audio::Mixer *mixer) {
+SoundManager::SoundManager(MortevielleEngine *vm, Audio::Mixer *mixer) {
+ _vm = vm;
_mixer = mixer;
_audioStream = nullptr;
_ambiantNoiseBuf = nullptr;
@@ -72,6 +73,8 @@ SoundManager::SoundManager(Audio::Mixer *mixer) {
_queue[i]._rep = 0;
}
_buildingSentence = false;
+ _ptr_oct = 0;
+ _cfiphBuffer = nullptr;
}
SoundManager::~SoundManager() {
@@ -281,10 +284,6 @@ void SoundManager::playSong(const byte* buf, uint size, uint loops) {
_mixer->stopHandle(songHandle);
}
-void SoundManager::setParent(MortevielleEngine *vm) {
- _vm = vm;
-}
-
void SoundManager::spfrac(int wor) {
_queue[2]._rep = (uint)wor >> 12;
if ((_soundType == 0) && (_queue[2]._code != 9)) {
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index cc0567fd98..5321c8946c 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -84,15 +84,13 @@ private:
void litph(tablint &t, int typ, int tempo);
public:
- SoundManager(Audio::Mixer *mixer);
+ SoundManager(MortevielleEngine *vm, Audio::Mixer *mixer);
~SoundManager();
Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle;
uint16 *_cfiphBuffer;
- void setParent(MortevielleEngine *vm);
-
int decodeMusic(const byte *PSrc, byte *PDest, int size);
void playSong(const byte *buf, uint usize, uint loops);
void loadAmbiantSounds();
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index c4f2d5714b..29c9be2e0c 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -50,9 +50,9 @@ bool MortevielleEngine::keyPressed() {
if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
_lastGameFrame = g_system->getMillis();
- _screenSurface.updateScreen();
+ _screenSurface->updateScreen();
- _debugger.onFrame();
+ _debugger->onFrame();
}
// Delay briefly to keep CPU usage down
@@ -92,8 +92,8 @@ bool MortevielleEngine::handleEvents() {
case Common::EVENT_LBUTTONUP:
case Common::EVENT_MOUSEMOVE:
_mousePos = Common::Point(event.mouse.x, event.mouse.y / 2);
- _mouse._pos.x = event.mouse.x;
- _mouse._pos.y = event.mouse.y / 2;
+ _mouse->_pos.x = event.mouse.x;
+ _mouse->_pos.y = event.mouse.y / 2;
if (event.type == Common::EVENT_LBUTTONDOWN)
_mouseClick = true;
@@ -121,8 +121,8 @@ void MortevielleEngine::addKeypress(Common::Event &evt) {
// Check for debugger
if ((evt.kbd.keycode == Common::KEYCODE_d) && (evt.kbd.flags & Common::KBD_CTRL)) {
// Attach to the debugger
- _debugger.attach();
- _debugger.onFrame();
+ _debugger->attach();
+ _debugger->onFrame();
} else if ((evt.kbd.keycode >= Common::KEYCODE_a) && (evt.kbd.keycode <= Common::KEYCODE_z)) {
// Handle alphabetic keys
if (evt.kbd.hasFlags(Common::KBD_CTRL))
@@ -208,7 +208,7 @@ void MortevielleEngine::initMouse() {
CursorMan.replaceCursor(CURSOR_ARROW_DATA, 16, 16, 0, 0, 0xff);
CursorMan.showMouse(true);
- _mouse.initMouse();
+ _mouse->initMouse();
}
/**
@@ -237,9 +237,9 @@ void MortevielleEngine::delay(int amount) {
while (g_system->getMillis() < endTime) {
if (g_system->getMillis() > (_lastGameFrame + GAME_FRAME_DELAY)) {
_lastGameFrame = g_system->getMillis();
- _screenSurface.updateScreen();
+ _screenSurface->updateScreen();
- _debugger.onFrame();
+ _debugger->onFrame();
}
g_system->delayMillis(10);
@@ -261,8 +261,8 @@ void MortevielleEngine::handleAction() {
bool handledOpcodeFl = false;
_controlMenu = 0;
if (!_keyPressedEsc) {
- _menu.drawMenu();
- _menu._menuDisplayed = true;
+ _menu->drawMenu();
+ _menu->_menuDisplayed = true;
temps = 0;
_key = 0;
funct = false;
@@ -270,28 +270,28 @@ void MortevielleEngine::handleAction() {
_inMainGameLoop = true;
do {
- _menu.updateMenu();
+ _menu->updateMenu();
prepareRoom();
- _mouse.moveMouse(funct, inkey);
+ _mouse->moveMouse(funct, inkey);
if (shouldQuit())
return;
++temps;
if (keyPressed() || _mouseClick) {
- _soundManager._mixer->stopHandle(_soundManager._soundHandle);
+ _soundManager->_mixer->stopHandle(_soundManager->_soundHandle);
}
- } while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone)));
+ } while (!((_menu->_menuSelected) || (temps > lim) || (funct) || (_anyone)));
_inMainGameLoop = false;
- _menu.eraseMenu();
- _menu._menuDisplayed = false;
- if (_menu._menuSelected && (_currMenu == MENU_SAVE)) {
+ _menu->eraseMenu();
+ _menu->_menuDisplayed = false;
+ if (_menu->_menuSelected && (_currMenu == MENU_SAVE)) {
Common::String saveName = Common::String::format("Savegame #%d", _currAction & 15);
- _savegameManager.saveGame(_currAction & 15, saveName);
+ _savegameManager->saveGame(_currAction & 15, saveName);
}
- if (_menu._menuSelected && (_currMenu == MENU_LOAD))
- _savegameManager.loadGame((_currAction & 15) - 1);
+ if (_menu->_menuSelected && (_currMenu == MENU_LOAD))
+ _savegameManager->loadGame((_currAction & 15) - 1);
if (inkey == '\103') { /* F9 */
- temps = _dialogManager.show(_hintPctMessage);
+ temps = _dialogManager->show(_hintPctMessage);
return;
} else if (inkey == '\77') {
if ((_menuOpcode != OPCODE_NONE) && ((_currMenu == MENU_ACTION) || (_currMenu == MENU_SELF))) {
@@ -321,12 +321,12 @@ void MortevielleEngine::handleAction() {
_menuOpcode = _currAction;
if (!_anyone) {
if ((_heroSearching) || (_obpart)) {
- if (_mouse._pos.y < 12)
+ if (_mouse->_pos.y < 12)
return;
- if ((_currAction == _menu._opcodeSound) || (_currAction == _menu._opcodeLift)) {
+ if ((_currAction == _menu->_opcodeSound) || (_currAction == _menu->_opcodeLift)) {
handledOpcodeFl = true;
- if ((_currAction == _menu._opcodeLift) || (_obpart)) {
+ if ((_currAction == _menu->_opcodeLift) || (_obpart)) {
endSearch();
_caff = _coreVar._currPlace;
_crep = 998;
@@ -341,7 +341,7 @@ void MortevielleEngine::handleAction() {
handleOpcode();
if ((_controlMenu == 0) && (! _loseGame) && (! _endGame)) {
- _text.taffich();
+ _text->taffich();
if (_destinationOk) {
_destinationOk = false;
drawPicture();
@@ -389,7 +389,7 @@ void MortevielleEngine::setTextColor(int col) {
*/
void MortevielleEngine::prepareScreenType1() {
// Large drawing
- _screenSurface.drawBox(0, 11, 512, 164, 15);
+ _screenSurface->drawBox(0, 11, 512, 164, 15);
}
/**
@@ -466,7 +466,7 @@ int MortevielleEngine::convertBitIndexToCharacterIndex(int bitIndex) {
*/
void MortevielleEngine::resetPresenceInRooms(int roomId) {
if (roomId == DINING_ROOM)
- _blo = false;
+ _outsideOnlyFl = false;
if (roomId != GREEN_ROOM) {
_roomPresenceLuc = false;
@@ -500,51 +500,51 @@ void MortevielleEngine::resetPresenceInRooms(int roomId) {
* @remarks Originally called 'affper'
*/
void MortevielleEngine::showPeoplePresent(int bitIndex) {
- int xp = 580 - (_screenSurface.getStringWidth("LEO") / 2);
+ int xp = 580 - (_screenSurface->getStringWidth("LEO") / 2);
for (int i = 1; i <= 8; ++i)
- _menu.disableMenuItem(_menu._discussMenu[i]);
+ _menu->disableMenuItem(_menu->_discussMenu[i]);
clearUpperRightPart();
if ((bitIndex & 128) == 128) {
- _screenSurface.putxy(xp, 24);
- _screenSurface.drawString("LEO", 4);
- _menu.enableMenuItem(_menu._discussMenu[1]);
+ _screenSurface->putxy(xp, 24);
+ _screenSurface->drawString("LEO", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[1]);
}
if ((bitIndex & 64) == 64) {
- _screenSurface.putxy(xp, 32);
- _screenSurface.drawString("PAT", 4);
- _menu.enableMenuItem(_menu._discussMenu[2]);
+ _screenSurface->putxy(xp, 32);
+ _screenSurface->drawString("PAT", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[2]);
}
if ((bitIndex & 32) == 32) {
- _screenSurface.putxy(xp, 40);
- _screenSurface.drawString("GUY", 4);
- _menu.enableMenuItem(_menu._discussMenu[3]);
+ _screenSurface->putxy(xp, 40);
+ _screenSurface->drawString("GUY", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[3]);
}
if ((bitIndex & 16) == 16) {
- _screenSurface.putxy(xp, 48);
- _screenSurface.drawString("EVA", 4);
- _menu.enableMenuItem(_menu._discussMenu[4]);
+ _screenSurface->putxy(xp, 48);
+ _screenSurface->drawString("EVA", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[4]);
}
if ((bitIndex & 8) == 8) {
- _screenSurface.putxy(xp, 56);
- _screenSurface.drawString("BOB", 4);
- _menu.enableMenuItem(_menu._discussMenu[5]);
+ _screenSurface->putxy(xp, 56);
+ _screenSurface->drawString("BOB", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[5]);
}
if ((bitIndex & 4) == 4) {
- _screenSurface.putxy(xp, 64);
- _screenSurface.drawString("LUC", 4);
- _menu.enableMenuItem(_menu._discussMenu[6]);
+ _screenSurface->putxy(xp, 64);
+ _screenSurface->drawString("LUC", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[6]);
}
if ((bitIndex & 2) == 2) {
- _screenSurface.putxy(xp, 72);
- _screenSurface.drawString("IDA", 4);
- _menu.enableMenuItem(_menu._discussMenu[7]);
+ _screenSurface->putxy(xp, 72);
+ _screenSurface->drawString("IDA", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[7]);
}
if ((bitIndex & 1) == 1) {
- _screenSurface.putxy(xp, 80);
- _screenSurface.drawString("MAX", 4);
- _menu.enableMenuItem(_menu._discussMenu[8]);
+ _screenSurface->putxy(xp, 80);
+ _screenSurface->drawString("MAX", 4);
+ _menu->enableMenuItem(_menu->_discussMenu[8]);
}
_currBitIndex = bitIndex;
}
@@ -605,7 +605,7 @@ int MortevielleEngine::getPresenceStatsGreenRoom() {
else if ((hour >= 0) && (hour < 8))
retVal = 70;
- _menu.updateMenu();
+ _menu->updateMenu();
return retVal;
}
@@ -698,19 +698,19 @@ int MortevielleEngine::getPresenceStatsRedRoom() {
*/
void MortevielleEngine::displayAloneText() {
for (int i = 1; i <= 8; ++i)
- _menu.disableMenuItem(_menu._discussMenu[i]);
+ _menu->disableMenuItem(_menu->_discussMenu[i]);
Common::String sYou = getEngineString(S_YOU);
Common::String sAre = getEngineString(S_ARE);
Common::String sAlone = getEngineString(S_ALONE);
clearUpperRightPart();
- _screenSurface.putxy(580 - (_screenSurface.getStringWidth(sYou) / 2), 30);
- _screenSurface.drawString(sYou, 4);
- _screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAre) / 2), 50);
- _screenSurface.drawString(sAre, 4);
- _screenSurface.putxy(580 - (_screenSurface.getStringWidth(sAlone) / 2), 70);
- _screenSurface.drawString(sAlone, 4);
+ _screenSurface->putxy(580 - (_screenSurface->getStringWidth(sYou) / 2), 30);
+ _screenSurface->drawString(sYou, 4);
+ _screenSurface->putxy(580 - (_screenSurface->getStringWidth(sAre) / 2), 50);
+ _screenSurface->drawString(sAre, 4);
+ _screenSurface->putxy(580 - (_screenSurface->getStringWidth(sAlone) / 2), 70);
+ _screenSurface->drawString(sAlone, 4);
_currBitIndex = 0;
}
@@ -1080,7 +1080,7 @@ void MortevielleEngine::initGame() {
_place = MANOR_FRONT;
_currentHourCount = 0;
if (!_coreVar._alreadyEnteredManor)
- _blo = true;
+ _outsideOnlyFl = true;
_inGameHourDuration = kTime1;
_currentTime = readclock();
}
@@ -1255,24 +1255,24 @@ void MortevielleEngine::startMusicOrSpeech(int so) {
;
} else if ((!_introSpeechPlayed) && (!_coreVar._alreadyEnteredManor)) {
// Type 1: Speech
- _soundManager.startSpeech(10, 1, 1);
+ _soundManager->startSpeech(10, 1, 1);
_introSpeechPlayed = true;
} else {
if (((_coreVar._currPlace == MOUNTAIN) || (_coreVar._currPlace == MANOR_FRONT) || (_coreVar._currPlace == MANOR_BACK)) && (getRandomNumber(1, 3) == 2))
// Type 1: Speech
- _soundManager.startSpeech(9, getRandomNumber(2, 4), 1);
+ _soundManager->startSpeech(9, getRandomNumber(2, 4), 1);
else if ((_coreVar._currPlace == CHAPEL) && (getRandomNumber(1, 2) == 1))
// Type 1: Speech
- _soundManager.startSpeech(8, 1, 1);
+ _soundManager->startSpeech(8, 1, 1);
else if ((_coreVar._currPlace == WELL) && (getRandomNumber(1, 2) == 2))
// Type 1: Speech
- _soundManager.startSpeech(12, 1, 1);
+ _soundManager->startSpeech(12, 1, 1);
else if (_coreVar._currPlace == INSIDE_WELL)
// Type 1: Speech
- _soundManager.startSpeech(13, 1, 1);
+ _soundManager->startSpeech(13, 1, 1);
else
// Type 2 : music
- _soundManager.startSpeech(getRandomNumber(1, 17), 1, 2);
+ _soundManager->startSpeech(getRandomNumber(1, 17), 1, 2);
}
}
@@ -1284,13 +1284,13 @@ void MortevielleEngine::loseGame() {
resetOpenObjects();
_roomDoorId = OWN_ROOM;
_curSearchObjId = 0;
- _menu.unsetSearchMenu();
- if (!_blo)
+ _menu->unsetSearchMenu();
+ if (!_outsideOnlyFl)
getPresence(MANOR_FRONT);
_loseGame = true;
clearUpperLeftPart();
- _screenSurface.drawBox(60, 35, 400, 50, 15);
+ _screenSurface->drawBox(60, 35, 400, 50, 15);
handleDescriptionText(9, _crep);
clearDescriptionBar();
clearVerbBar();
@@ -1333,20 +1333,20 @@ void MortevielleEngine::startDialog(int16 rep) {
assert(rep >= 0);
- _mouse.hideMouse();
+ _mouse->hideMouse();
Common::String dialogStr = getString(rep + kDialogStringIndex);
- _text.displayStr(dialogStr, 230, 4, 65, 26, 5);
- _dialogManager.drawF3F8();
+ _text->displayStr(dialogStr, 230, 4, 65, 26, 5);
+ _dialogManager->drawF3F8();
key = 0;
do {
- _soundManager.startSpeech(rep, haut[_caff - 69], 0);
- key = _dialogManager.waitForF3F8();
+ _soundManager->startSpeech(rep, haut[_caff - 69], 0);
+ key = _dialogManager->waitForF3F8();
if (shouldQuit())
return;
} while (key != 66);
clearScreen();
- _mouse.showMouse();
+ _mouse->showMouse();
}
/**
@@ -1357,7 +1357,7 @@ void MortevielleEngine::endSearch() {
_heroSearching = false;
_obpart = false;
_searchCount = 0;
- _menu.unsetSearchMenu();
+ _menu->unsetSearchMenu();
}
/**
@@ -1379,21 +1379,21 @@ void MortevielleEngine::gotoDiningRoom() {
showPeoplePresent(_currBitIndex);
_caff = 77;
drawPictureWithText();
- _screenSurface.drawBox(223, 47, 155, 92, 15);
+ _screenSurface->drawBox(223, 47, 155, 92, 15);
handleDescriptionText(2, 33);
testKey(false);
menuUp();
- _mouse.hideMouse();
+ _mouse->hideMouse();
clearScreen();
drawDiscussionBox();
startDialog(140);
drawRightFrame();
drawClock();
- _mouse.showMouse();
+ _mouse->showMouse();
_coreVar._currPlace = OWN_ROOM;
prepareDisplayText();
resetPresenceInRooms(DINING_ROOM);
- if (!_blo)
+ if (!_outsideOnlyFl)
getPresence(OWN_ROOM);
_currBitIndex = 0;
_savedBitIndex = 0;
@@ -1451,8 +1451,8 @@ void MortevielleEngine::floodedInWell() {
* @remarks Originally called 'antegame'
*/
void MortevielleEngine::gameLoaded() {
- _mouse.hideMouse();
- _menu._menuDisplayed = false;
+ _mouse->hideMouse();
+ _menu->_menuDisplayed = false;
_loseGame = true;
_anyone = false;
_destinationOk = true;
@@ -1490,11 +1490,11 @@ void MortevielleEngine::gameLoaded() {
handleDescriptionText(2, _crep);
clearVerbBar();
_endGame = false;
- _menu.setDestinationText(_coreVar._currPlace);
- _menu.setInventoryText();
+ _menu->setDestinationText(_coreVar._currPlace);
+ _menu->setInventoryText();
if (_coreVar._selectedObjectId != 0)
displayItemInHand(_coreVar._selectedObjectId + 400);
- _mouse.showMouse();
+ _mouse->showMouse();
}
/**
@@ -1508,7 +1508,7 @@ void MortevielleEngine::handleOpcode() {
_keyPressedEsc = false;
if (!_anyone) {
if (_uptodatePresence) {
- if ((_currMenu == MENU_MOVE) || (_currAction == _menu._opcodeLeave) || (_currAction == _menu._opcodeSleep) || (_currAction == _menu._opcodeEat)) {
+ if ((_currMenu == MENU_MOVE) || (_currAction == _menu->_opcodeLeave) || (_currAction == _menu->_opcodeSleep) || (_currAction == _menu->_opcodeEat)) {
_controlMenu = 4;
menuUp();
return;
@@ -1521,60 +1521,60 @@ void MortevielleEngine::handleOpcode() {
fctDiscuss();
else if (_currMenu == MENU_INVENTORY)
fctInventoryTake();
- else if (_currAction == _menu._opcodeAttach)
+ else if (_currAction == _menu->_opcodeAttach)
fctAttach();
- else if (_currAction == _menu._opcodeWait)
+ else if (_currAction == _menu->_opcodeWait)
fctWait();
- else if (_currAction == _menu._opcodeForce)
+ else if (_currAction == _menu->_opcodeForce)
fctForce();
- else if (_currAction == _menu._opcodeSleep)
+ else if (_currAction == _menu->_opcodeSleep)
fctSleep();
- else if (_currAction == _menu._opcodeListen)
+ else if (_currAction == _menu->_opcodeListen)
fctListen();
- else if (_currAction == _menu._opcodeEnter)
+ else if (_currAction == _menu->_opcodeEnter)
fctEnter();
- else if (_currAction == _menu._opcodeClose)
+ else if (_currAction == _menu->_opcodeClose)
fctClose();
- else if (_currAction == _menu._opcodeSearch)
+ else if (_currAction == _menu->_opcodeSearch)
fctSearch();
- else if (_currAction == _menu._opcodeKnock)
+ else if (_currAction == _menu->_opcodeKnock)
fctKnock();
- else if (_currAction == _menu._opcodeScratch)
+ else if (_currAction == _menu->_opcodeScratch)
fctScratch();
- else if (_currAction == _menu._opcodeRead)
+ else if (_currAction == _menu->_opcodeRead)
fctRead();
- else if (_currAction == _menu._opcodeEat)
+ else if (_currAction == _menu->_opcodeEat)
fctEat();
- else if (_currAction == _menu._opcodePlace)
+ else if (_currAction == _menu->_opcodePlace)
fctPlace();
- else if (_currAction == _menu._opcodeOpen)
+ else if (_currAction == _menu->_opcodeOpen)
fctOpen();
- else if (_currAction == _menu._opcodeTake)
+ else if (_currAction == _menu->_opcodeTake)
fctTake();
- else if (_currAction == _menu._opcodeLook)
+ else if (_currAction == _menu->_opcodeLook)
fctLook();
- else if (_currAction == _menu._opcodeSmell)
+ else if (_currAction == _menu->_opcodeSmell)
fctSmell();
- else if (_currAction == _menu._opcodeSound)
+ else if (_currAction == _menu->_opcodeSound)
fctSound();
- else if (_currAction == _menu._opcodeLeave)
+ else if (_currAction == _menu->_opcodeLeave)
fctLeave();
- else if (_currAction == _menu._opcodeLift)
+ else if (_currAction == _menu->_opcodeLift)
fctLift();
- else if (_currAction == _menu._opcodeTurn)
+ else if (_currAction == _menu->_opcodeTurn)
fctTurn();
- else if (_currAction == _menu._opcodeSSearch)
+ else if (_currAction == _menu->_opcodeSSearch)
fctSelfSearch();
- else if (_currAction == _menu._opcodeSRead)
+ else if (_currAction == _menu->_opcodeSRead)
fctSelfRead();
- else if (_currAction == _menu._opcodeSPut)
+ else if (_currAction == _menu->_opcodeSPut)
fctSelfPut();
- else if (_currAction == _menu._opcodeSLook)
+ else if (_currAction == _menu->_opcodeSLook)
fctSelftLook();
_hiddenHero = false;
- if (_currAction == _menu._opcodeSHide)
+ if (_currAction == _menu->_opcodeSHide)
fctSelfHide();
} else if (_anyone) {
interactNPC();
@@ -1640,9 +1640,9 @@ void MortevielleEngine::charToHour() {
* @remarks Originally called 'clsf1'
*/
void MortevielleEngine::clearUpperLeftPart() {
- _mouse.hideMouse();
- _screenSurface.fillRect(0, Common::Rect(0, 11, 514, 175));
- _mouse.showMouse();
+ _mouse->hideMouse();
+ _screenSurface->fillRect(0, Common::Rect(0, 11, 514, 175));
+ _mouse->showMouse();
}
/**
@@ -1650,16 +1650,16 @@ void MortevielleEngine::clearUpperLeftPart() {
* @remarks Originally called 'clsf2'
*/
void MortevielleEngine::clearDescriptionBar() {
- _mouse.hideMouse();
+ _mouse->hideMouse();
if (_largestClearScreen) {
- _screenSurface.fillRect(0, Common::Rect(1, 176, 633, 199));
- _screenSurface.drawBox(0, 176, 634, 23, 15);
+ _screenSurface->fillRect(0, Common::Rect(1, 176, 633, 199));
+ _screenSurface->drawBox(0, 176, 634, 23, 15);
_largestClearScreen = false;
} else {
- _screenSurface.fillRect(0, Common::Rect(1, 176, 633, 190));
- _screenSurface.drawBox(0, 176, 634, 14, 15);
+ _screenSurface->fillRect(0, Common::Rect(1, 176, 633, 190));
+ _screenSurface->drawBox(0, 176, 634, 14, 15);
}
- _mouse.showMouse();
+ _mouse->showMouse();
}
/**
@@ -1667,10 +1667,10 @@ void MortevielleEngine::clearDescriptionBar() {
* @remarks Originally called 'clsf3'
*/
void MortevielleEngine::clearVerbBar() {
- _mouse.hideMouse();
- _screenSurface.fillRect(0, Common::Rect(1, 192, 633, 199));
- _screenSurface.drawBox(0, 191, 634, 8, 15);
- _mouse.showMouse();
+ _mouse->hideMouse();
+ _screenSurface->fillRect(0, Common::Rect(1, 192, 633, 199));
+ _screenSurface->drawBox(0, 191, 634, 8, 15);
+ _mouse->showMouse();
}
/**
@@ -1680,10 +1680,10 @@ void MortevielleEngine::clearVerbBar() {
void MortevielleEngine::clearUpperRightPart() {
Common::String st;
- _mouse.hideMouse();
+ _mouse->hideMouse();
// Clear ambiance description
- _screenSurface.fillRect(15, Common::Rect(544, 93, 600, 98));
+ _screenSurface->fillRect(15, Common::Rect(544, 93, 600, 98));
if (_coreVar._faithScore < 33)
st = getEngineString(S_COOL);
else if (_coreVar._faithScore < 66)
@@ -1691,13 +1691,13 @@ void MortevielleEngine::clearUpperRightPart() {
else if (_coreVar._faithScore > 65)
st = getEngineString(S_MALSAINE);
- int x1 = 580 - (_screenSurface.getStringWidth(st) / 2);
- _screenSurface.putxy(x1, 92);
- _screenSurface.drawString(st, 4);
+ int x1 = 580 - (_screenSurface->getStringWidth(st) / 2);
+ _screenSurface->putxy(x1, 92);
+ _screenSurface->drawString(st, 4);
// Clear person list
- _screenSurface.fillRect(15, Common::Rect(560, 24, 610, 86));
- _mouse.showMouse();
+ _screenSurface->fillRect(15, Common::Rect(560, 24, 610, 86));
+ _mouse->showMouse();
}
/**
@@ -1713,7 +1713,7 @@ int MortevielleEngine::getRandomNumber(int minval, int maxval) {
* @remarks Originally called 'aldepl'
*/
void MortevielleEngine::showMoveMenuAlert() {
- _dialogManager.show(getEngineString(S_USE_DEP_MENU));
+ _dialogManager->show(getEngineString(S_USE_DEP_MENU));
}
/**
@@ -1888,24 +1888,18 @@ void MortevielleEngine::resetObjectPlace() {
_tabdon[i] = _tabdon[i + 390];
}
-/**
- * Engine function - When restarting the game, reset the main variables used by the engine
- * @remarks Originally called 'inzon'
- */
-void MortevielleEngine::resetVariables() {
- resetObjectPlace();
-
- _coreVar._alreadyEnteredManor = false;
- _coreVar._selectedObjectId = 0;
- _coreVar._cellarObjectId = 0;
- _coreVar._atticBallHoleObjectId = 0;
- _coreVar._atticRodHoleObjectId = 0;
- _coreVar._wellObjectId = 0;
- _coreVar._secretPassageObjectId = 0;
- _coreVar._purpleRoomObjectId = 136;
- _coreVar._cryptObjectId = 141;
- _coreVar._faithScore = getRandomNumber(4, 10);
- _coreVar._currPlace = MANOR_FRONT;
+void MortevielleEngine::resetCoreVar() {
+ _saveStruct._alreadyEnteredManor = _coreVar._alreadyEnteredManor = false;
+ _saveStruct._selectedObjectId = _coreVar._selectedObjectId = 0;
+ _saveStruct._cellarObjectId = _coreVar._cellarObjectId = 0;
+ _saveStruct._atticBallHoleObjectId = _coreVar._atticBallHoleObjectId = 0;
+ _saveStruct._atticRodHoleObjectId = _coreVar._atticRodHoleObjectId = 0;
+ _saveStruct._wellObjectId = _coreVar._wellObjectId = 0;
+ _saveStruct._secretPassageObjectId = _coreVar._secretPassageObjectId = 0;
+ _saveStruct._purpleRoomObjectId = _coreVar._purpleRoomObjectId = 136;
+ _saveStruct._cryptObjectId = _coreVar._cryptObjectId = 141;
+ _saveStruct._faithScore = _coreVar._faithScore = getRandomNumber(4, 10);
+ _saveStruct._currPlace = _coreVar._currPlace = MANOR_FRONT;
for (int i = 2; i <= 6; ++i)
_coreVar._inventory[i] = 0;
@@ -1913,7 +1907,7 @@ void MortevielleEngine::resetVariables() {
// Only object in inventory: a gun
_coreVar._inventory[1] = 113;
- _coreVar._fullHour = (unsigned char)20;
+ _saveStruct._fullHour = _coreVar._fullHour = (unsigned char)20;
for (int i = 1; i <= 10; ++i)
_coreVar._pctHintFound[i] = ' ';
@@ -1931,6 +1925,14 @@ void MortevielleEngine::resetVariables() {
_coreVar._availableQuestion[i] = ' ';
_coreVar._availableQuestion[33] = '*';
+}
+/**
+ * Engine function - When restarting the game, reset the main variables used by the engine
+ * @remarks Originally called 'inzon'
+ */
+void MortevielleEngine::resetVariables() {
+ resetObjectPlace();
+ resetCoreVar();
for (int i = 1; i <= 8; ++i)
_charAnswerCount[i] = 0;
@@ -2074,10 +2076,10 @@ void MortevielleEngine::loadCFIPH() {
error("Missing file - *cfiph.mor");
}
- _soundManager._cfiphBuffer = (uint16 *)malloc(sizeof(uint16) * (f.size() / 2));
+ _soundManager->_cfiphBuffer = (uint16 *)malloc(sizeof(uint16) * (f.size() / 2));
for (int i = 0; i < (f.size() / 2); ++i)
- _soundManager._cfiphBuffer[i] = f.readUint16BE();
+ _soundManager->_cfiphBuffer[i] = f.readUint16BE();
f.close();
}
@@ -2102,10 +2104,10 @@ void MortevielleEngine::music() {
f.read(compMusicBuf, size);
f.close();
- int musicSize = _soundManager.decodeMusic(compMusicBuf, musicBuf, size);
+ int musicSize = _soundManager->decodeMusic(compMusicBuf, musicBuf, size);
free(compMusicBuf);
- _soundManager.playSong(musicBuf, musicSize, 5);
+ _soundManager->playSong(musicBuf, musicSize, 5);
while (keyPressed())
getChar();
@@ -2120,14 +2122,14 @@ void MortevielleEngine::showTitleScreen() {
clearScreen();
handleDescriptionText(7, 2035);
_caff = 51;
- _text.taffich();
+ _text->taffich();
testKeyboard();
clearScreen();
draw(0, 0);
Common::String cpr = "COPYRIGHT 1989 : LANKHOR";
- _screenSurface.putxy(104 + 72 * kResolutionScaler, 185);
- _screenSurface.drawString(cpr, 0);
+ _screenSurface->putxy(104 + 72 * kResolutionScaler, 185);
+ _screenSurface->drawString(cpr, 0);
}
/**
@@ -2135,10 +2137,10 @@ void MortevielleEngine::showTitleScreen() {
* @remarks Originally called 'dessine'
*/
void MortevielleEngine::draw(int x, int y) {
- _mouse.hideMouse();
+ _mouse->hideMouse();
setPal(_numpal);
displayPicture(_curPict, x, y);
- _mouse.showMouse();
+ _mouse->showMouse();
}
/**
@@ -2147,9 +2149,9 @@ void MortevielleEngine::draw(int x, int y) {
*/
void MortevielleEngine::drawRightFrame() {
setPal(89);
- _mouse.hideMouse();
+ _mouse->hideMouse();
displayPicture(_rightFramePict, 0, 0);
- _mouse.showMouse();
+ _mouse->showMouse();
}
/**
@@ -2205,10 +2207,10 @@ void MortevielleEngine::prepareRoom() {
_minute = 30;
drawClock();
}
- if (_mouse._pos.y < 12)
+ if (_mouse->_pos.y < 12)
return;
- if (!_blo) {
+ if (!_outsideOnlyFl) {
if ((hour == 12) || ((hour > 18) && (hour < 21)) || ((hour >= 0) && (hour < 7)))
_inGameHourDuration = kTime2;
else
@@ -2221,8 +2223,8 @@ void MortevielleEngine::prepareRoom() {
int newTime = readclock();
if ((newTime - _currentTime) > _inGameHourDuration) {
- bool activeMenu = _menu._menuActive;
- _menu.eraseMenu();
+ bool activeMenu = _menu->_menuActive;
+ _menu->eraseMenu();
_currentHourCount += ((newTime - _currentTime) / _inGameHourDuration);
_currentTime = newTime;
switch (_place) {
@@ -2280,8 +2282,8 @@ void MortevielleEngine::prepareRoom() {
prepareScreenType2();
displayTextInVerbBar(getEngineString(S_HEAR_NOISE));
int rand = (getRandomNumber(0, 4)) - 2;
- _soundManager.startSpeech(1, rand, 1);
- _soundManager.waitSpeech();
+ _soundManager->startSpeech(1, rand, 1);
+ _soundManager->waitSpeech();
clearVerbBar();
}
}
@@ -2289,7 +2291,7 @@ void MortevielleEngine::prepareRoom() {
}
if (activeMenu)
- _menu.drawMenu();
+ _menu->drawMenu();
}
}
_endTime = readclock();
@@ -2315,15 +2317,15 @@ void MortevielleEngine::drawClock() {
const int y = 123;
const int rg = 9;
- _mouse.hideMouse();
+ _mouse->hideMouse();
- _screenSurface.drawRectangle(570, 118, 20, 10);
- _screenSurface.drawRectangle(578, 114, 6, 18);
+ _screenSurface->drawRectangle(570, 118, 20, 10);
+ _screenSurface->drawRectangle(578, 114, 6, 18);
if (_minute == 0)
- _screenSurface.drawLine(((uint)x >> 1) * kResolutionScaler, y, ((uint)x >> 1) * kResolutionScaler, (y - rg), 1);
+ _screenSurface->drawLine(((uint)x >> 1) * kResolutionScaler, y, ((uint)x >> 1) * kResolutionScaler, (y - rg), 1);
else
- _screenSurface.drawLine(((uint)x >> 1) * kResolutionScaler, y, ((uint)x >> 1) * kResolutionScaler, (y + rg), 1);
+ _screenSurface->drawLine(((uint)x >> 1) * kResolutionScaler, y, ((uint)x >> 1) * kResolutionScaler, (y + rg), 1);
int hour12 = _hour;
if (hour12 > 12)
@@ -2331,20 +2333,20 @@ void MortevielleEngine::drawClock() {
if (hour12 == 0)
hour12 = 12;
- _screenSurface.drawLine(((uint)x >> 1) * kResolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * kResolutionScaler, y + cv[1][hour12 - 1], 1);
- _mouse.showMouse();
- _screenSurface.putxy(568, 154);
+ _screenSurface->drawLine(((uint)x >> 1) * kResolutionScaler, y, ((uint)(x + cv[0][hour12 - 1]) >> 1) * kResolutionScaler, y + cv[1][hour12 - 1], 1);
+ _mouse->showMouse();
+ _screenSurface->putxy(568, 154);
if (_hour > 11)
- _screenSurface.drawString("PM ", 1);
+ _screenSurface->drawString("PM ", 1);
else
- _screenSurface.drawString("AM ", 1);
+ _screenSurface->drawString("AM ", 1);
- _screenSurface.putxy(550, 160);
+ _screenSurface->putxy(550, 160);
if ((_day >= 0) && (_day <= 8)) {
Common::String tmp = getEngineString(S_DAY);
tmp.insertChar((char)(_day + 49), 0);
- _screenSurface.drawString(tmp, 1);
+ _screenSurface->drawString(tmp, 1);
}
}
@@ -2376,7 +2378,7 @@ Common::String MortevielleEngine::copy(const Common::String &s, int idx, size_t
* @remarks Originally called 'hirs'
*/
void MortevielleEngine::clearScreen() {
- _screenSurface.clearScreen();
+ _screenSurface->clearScreen();
}
/**
@@ -2391,8 +2393,8 @@ void MortevielleEngine::initCaveOrCellar() {
prepareScreenType2();
displayTextInVerbBar(getEngineString(S_SOMEONE_ENTERS));
int rand = (getRandomNumber(0, 4)) - 2;
- _soundManager.startSpeech(2, rand, 1);
- _soundManager.waitSpeech();
+ _soundManager->startSpeech(2, rand, 1);
+ _soundManager->waitSpeech();
// The original was doing here a useless loop.
// It has been removed
@@ -2416,7 +2418,7 @@ void MortevielleEngine::displayControlMenu() {
void MortevielleEngine::displayPicture(const byte *pic, int x, int y) {
GfxSurface surface;
surface.decode(pic);
- _screenSurface.drawPicture(surface, x, y);
+ _screenSurface->drawPicture(surface, x, y);
}
void MortevielleEngine::adzon() {
@@ -2465,7 +2467,7 @@ void MortevielleEngine::displayTextInDescriptionBar(int x, int y, int nb, int me
Common::String tmpStr = getString(mesgId);
if ((y == 182) && ((int) tmpStr.size() > nb))
y = 176;
- _text.displayStr(tmpStr, x, y, nb, 20, _textColor);
+ _text->displayStr(tmpStr, x, y, nb, 20, _textColor);
}
/**
@@ -2482,7 +2484,7 @@ void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
_largestClearScreen = false;
clearDescriptionBar();
- _text.displayStr(tmpStr, 8, 176, 85, 3, 5);
+ _text->displayStr(tmpStr, 8, 176, 85, 3, 5);
} else {
mapMessageId(mesgId);
switch (f) {
@@ -2511,7 +2513,7 @@ void MortevielleEngine::handleDescriptionText(int f, int mesgId) {
i = 5;
Common::String tmpStr = getString(mesgId);
- _text.displayStr(tmpStr, 80, 40, 60, 25, i);
+ _text->displayStr(tmpStr, 80, 40, 60, 25, i);
if (mesgId == 180)
_coreVar._pctHintFound[6] = '*';
@@ -2584,32 +2586,32 @@ void MortevielleEngine::resetOpenObjects() {
*/
void MortevielleEngine::displayTextBlock(Common::String text) {
// Some dead code was present in the original: removed
- _screenSurface.putxy(8, 177);
+ _screenSurface->putxy(8, 177);
int tlig = 59 + (kResolutionScaler - 1) * 36;
if ((int)text.size() < tlig)
- _screenSurface.drawString(text, 5);
+ _screenSurface->drawString(text, 5);
else if ((int)text.size() < (tlig << 1)) {
- _screenSurface.putxy(8, 176);
- _screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
- _screenSurface.putxy(8, 182);
- _screenSurface.drawString(copy(text, tlig, tlig << 1), 5);
+ _screenSurface->putxy(8, 176);
+ _screenSurface->drawString(copy(text, 1, (tlig - 1)), 5);
+ _screenSurface->putxy(8, 182);
+ _screenSurface->drawString(copy(text, tlig, tlig << 1), 5);
} else {
_largestClearScreen = true;
clearDescriptionBar();
- _screenSurface.putxy(8, 176);
- _screenSurface.drawString(copy(text, 1, (tlig - 1)), 5);
- _screenSurface.putxy(8, 182);
- _screenSurface.drawString(copy(text, tlig, ((tlig << 1) - 1)), 5);
- _screenSurface.putxy(8, 190);
- _screenSurface.drawString(copy(text, tlig << 1, tlig * 3), 5);
+ _screenSurface->putxy(8, 176);
+ _screenSurface->drawString(copy(text, 1, (tlig - 1)), 5);
+ _screenSurface->putxy(8, 182);
+ _screenSurface->drawString(copy(text, tlig, ((tlig << 1) - 1)), 5);
+ _screenSurface->putxy(8, 190);
+ _screenSurface->drawString(copy(text, tlig << 1, tlig * 3), 5);
}
}
void MortevielleEngine::displayTextInVerbBar(Common::String text) {
clearVerbBar();
- _screenSurface.putxy(8, 192);
- _screenSurface.drawString(text, 5);
+ _screenSurface->putxy(8, 192);
+ _screenSurface->drawString(text, 5);
}
/**
@@ -2622,8 +2624,8 @@ void MortevielleEngine::displayItemInHand(int objId) {
if (objId != 500)
strp = getString(objId - 501 + kInventoryStringIndex);
- _menu.setText(_menu._inventoryMenu[8], strp);
- _menu.disableMenuItem(_menu._inventoryMenu[8]);
+ _menu->setText(_menu->_inventoryMenu[8], strp);
+ _menu->disableMenuItem(_menu->_inventoryMenu[8]);
}
/**
@@ -2831,7 +2833,7 @@ int MortevielleEngine::getPresence(int roomId) {
* @remarks Originally called 'writetp'
*/
void MortevielleEngine::displayQuestionText(Common::String s, int cmd) {
- _screenSurface.drawString(s, cmd);
+ _screenSurface->drawString(s, cmd);
}
/**
@@ -2855,7 +2857,7 @@ void MortevielleEngine::displayAnimFrame(int frameNum, int animId) {
GfxSurface surface;
surface.decode(&_curAnim[offset]);
- _screenSurface.drawPicture(surface, 0, 12);
+ _screenSurface->drawPicture(surface, 0, 12);
prepareScreenType1();
}
@@ -2868,10 +2870,10 @@ void MortevielleEngine::drawPicture() {
clearUpperLeftPart();
if (_caff > 99) {
draw(60, 33);
- _screenSurface.drawBox(118, 32, 291, 122, 15); // Medium box
+ _screenSurface->drawBox(118, 32, 291, 122, 15); // Medium box
} else if (_caff > 69) {
draw(112, 48); // Heads
- _screenSurface.drawBox(222, 47, 155, 92, 15);
+ _screenSurface->drawBox(222, 47, 155, 92, 15);
} else {
draw(0, 12);
prepareScreenType1();
@@ -2910,7 +2912,7 @@ void MortevielleEngine::drawPicture() {
}
void MortevielleEngine::drawPictureWithText() {
- _text.taffich();
+ _text->taffich();
drawPicture();
_destinationOk = false;
}
@@ -2924,7 +2926,7 @@ void MortevielleEngine::testKey(bool d) {
int x, y;
bool click;
- _mouse.hideMouse();
+ _mouse->hideMouse();
displayStatusInDescriptionBar('K');
// Wait for release from any key or mouse button
@@ -2932,7 +2934,7 @@ void MortevielleEngine::testKey(bool d) {
_key = gettKeyPressed();
do {
- _mouse.getMousePosition(x, y, click);
+ _mouse->getMousePosition(x, y, click);
quest = keyPressed();
if (quest && shouldQuit())
return;
@@ -2943,14 +2945,14 @@ void MortevielleEngine::testKey(bool d) {
if (d)
prepareRoom();
quest = keyPressed();
- _mouse.getMousePosition(x, y, click);
+ _mouse->getMousePosition(x, y, click);
if (shouldQuit())
return;
} while (!(quest || (click) || (d && _anyone)));
if (quest)
gettKeyPressed();
setMouseClick(false);
- _mouse.showMouse();
+ _mouse->showMouse();
}
/**
@@ -3061,7 +3063,7 @@ void MortevielleEngine::getSearchDescription(int objId) {
* @remarks Originally called 'mennor'
*/
void MortevielleEngine::menuUp() {
- _menu.menuUp(_currMenu);
+ _menu->menuUp(_currMenu);
}
/**
@@ -3070,7 +3072,7 @@ void MortevielleEngine::menuUp() {
*/
void MortevielleEngine::drawDiscussionBox() {
draw(10, 80);
- _screenSurface.drawBox(18, 79, 155, 92, 15);
+ _screenSurface->drawBox(18, 79, 155, 92, 15);
}
/**
@@ -3101,7 +3103,7 @@ void MortevielleEngine::addObjectToInventory(int objectId) {
if (_coreVar._inventory[i] == 0) {
_coreVar._inventory[i] = objectId;
- _menu.setInventoryText();
+ _menu->setInventoryText();
} else
// Inventory is full
_crep = 139;
@@ -3112,8 +3114,8 @@ void MortevielleEngine::addObjectToInventory(int objectId) {
* @remarks Originally called 'quelquun'
*/
void MortevielleEngine::interactNPC() {
- if (_menu._menuDisplayed)
- _menu.eraseMenu();
+ if (_menu->_menuDisplayed)
+ _menu->eraseMenu();
endSearch();
_crep = 997;
@@ -3123,9 +3125,9 @@ L1:
_crep = 138;
handleDescriptionText(2, _crep);
if (_crep == 138)
- _soundManager.startSpeech(5, 2, 1);
+ _soundManager->startSpeech(5, 2, 1);
else
- _soundManager.startSpeech(4, 4, 1);
+ _soundManager->startSpeech(4, 4, 1);
if (_openObjCount == 0)
_coreVar._faithScore += 2;
@@ -3134,12 +3136,12 @@ L1:
else
_coreVar._faithScore += 3 * (_coreVar._faithScore / 10);
exitRoom();
- _menu.setDestinationText(LANDING);
+ _menu->setDestinationText(LANDING);
int charIdx = convertBitIndexToCharacterIndex(_currBitIndex);
_caff = 69 + charIdx;
_crep = _caff;
_currMenu = MENU_DISCUSS;
- _currAction = (_menu._discussMenu[charIdx]._menuId << 8) | _menu._discussMenu[charIdx]._actionId;
+ _currAction = (_menu->_discussMenu[charIdx]._menuId << 8) | _menu->_discussMenu[charIdx]._actionId;
_syn = true;
_col = true;
} else {
@@ -3150,15 +3152,15 @@ L1:
} else {
handleDescriptionText(2, 136);
int rand = (getRandomNumber(0, 4)) - 2;
- _soundManager.startSpeech(3, rand, 1);
+ _soundManager->startSpeech(3, rand, 1);
clearDescriptionBar();
displayAloneText();
resetRoomVariables(MANOR_FRONT);
prepareDisplayText();
}
}
- if (_menu._menuDisplayed)
- _menu.drawMenu();
+ if (_menu->_menuDisplayed)
+ _menu->drawMenu();
}
/**
@@ -3206,25 +3208,25 @@ void MortevielleEngine::displayStatusArrow() {
touch = '\0';
do {
- _mouse.moveMouse(qust, touch);
+ _mouse->moveMouse(qust, touch);
if (shouldQuit())
return;
if (getMouseClick())
- inRect = (_mouse._pos.x < 256 * kResolutionScaler) && (_mouse._pos.y < 176) && (_mouse._pos.y > 12);
+ inRect = (_mouse->_pos.x < 256 * kResolutionScaler) && (_mouse->_pos.y < 176) && (_mouse->_pos.y > 12);
prepareRoom();
} while (!(qust || inRect || _anyone));
if (qust && (touch == '\103'))
- _dialogManager.show(_hintPctMessage);
+ _dialogManager->show(_hintPctMessage);
} while (!((touch == '\73') || ((touch == '\104') && (_x != 0) && (_y != 0)) || (_anyone) || (inRect)));
if (touch == '\73')
_keyPressedEsc = true;
if (inRect) {
- _x = _mouse._pos.x;
- _y = _mouse._pos.y;
+ _x = _mouse->_pos.x;
+ _y = _mouse->_pos.y;
}
}
@@ -3292,7 +3294,7 @@ void MortevielleEngine::displayLookScreen(int objId) {
int mdes = _caff;
_caff = objId;
- if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_currAction == _menu._opcodeSLook)) {
+ if (((_caff > 29) && (_caff < 33)) || (_caff == 144) || (_caff == 147) || (_caff == 149) || (_currAction == _menu->_opcodeSLook)) {
drawPictureWithText();
if ((_caff > 29) && (_caff < 33))
handleDescriptionText(2, _caff);
@@ -3305,7 +3307,7 @@ void MortevielleEngine::displayLookScreen(int objId) {
} else {
_obpart = true;
_crep = _caff + 400;
- _menu.setSearchMenu();
+ _menu->setSearchMenu();
}
}
@@ -3357,10 +3359,10 @@ int MortevielleEngine::checkLeaveSecretPassage() {
* @remarks Originally called 'fenat'
*/
void MortevielleEngine::displayStatusInDescriptionBar(char stat) {
- _mouse.hideMouse();
- _screenSurface.writeCharacter(Common::Point(306, 193), stat, 12);
- _screenSurface.drawBox(300, 191, 16, 8, 15);
- _mouse.showMouse();
+ _mouse->hideMouse();
+ _screenSurface->writeCharacter(Common::Point(306, 193), stat, 12);
+ _screenSurface->drawBox(300, 191, 16, 8, 15);
+ _mouse->showMouse();
}
/**
diff --git a/engines/neverhood/configure.engine b/engines/neverhood/configure.engine
new file mode 100644
index 0000000000..46910e293e
--- /dev/null
+++ b/engines/neverhood/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 neverhood "Neverhood" yes
diff --git a/engines/neverhood/detection.cpp b/engines/neverhood/detection.cpp
index efd0699d58..feba193609 100644
--- a/engines/neverhood/detection.cpp
+++ b/engines/neverhood/detection.cpp
@@ -130,6 +130,9 @@ static const NeverhoodGameDescription gameDescriptions[] = {
0,
},
+// FIXME: Disabled for now, as it has broken resources that corrupt the heap
+// (e.g. the menu header).
+#if 0
{
// Neverhood Russian version. Fargus
{
@@ -146,6 +149,7 @@ static const NeverhoodGameDescription gameDescriptions[] = {
0,
0,
},
+#endif
{ AD_TABLE_END_MARKER, 0, 0, 0, 0 }
};
@@ -166,6 +170,14 @@ static const ExtraGuiOption neverhoodExtraGuiOption2 = {
false
};
+static const ExtraGuiOption neverhoodExtraGuiOption3 = {
+ _s("Scale the making of videos to full screen"),
+ _s("Scale the making of videos, so that they use the whole screen"),
+ "scalemakingofvideos",
+ false
+};
+
+
class NeverhoodMetaEngine : public AdvancedMetaEngine {
public:
NeverhoodMetaEngine() : AdvancedMetaEngine(Neverhood::gameDescriptions, sizeof(Neverhood::NeverhoodGameDescription), neverhoodGames) {
@@ -196,7 +208,7 @@ bool NeverhoodMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave) ||
- (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportMetaInfo) ||
(f == kSavesSupportThumbnail) ||
(f == kSavesSupportCreationDate) ||
(f == kSavesSupportPlayTime);
@@ -221,6 +233,7 @@ const ExtraGuiOptions NeverhoodMetaEngine::getExtraGuiOptions(const Common::Stri
ExtraGuiOptions options;
options.push_back(neverhoodExtraGuiOption1);
options.push_back(neverhoodExtraGuiOption2);
+ options.push_back(neverhoodExtraGuiOption3);
return options;
}
diff --git a/engines/neverhood/diskplayerscene.cpp b/engines/neverhood/diskplayerscene.cpp
index ef2b856b2f..7513034bf3 100644
--- a/engines/neverhood/diskplayerscene.cpp
+++ b/engines/neverhood/diskplayerscene.cpp
@@ -169,7 +169,7 @@ AsDiskplayerSceneKey::AsDiskplayerSceneKey(NeverhoodEngine *vm)
uint32 AsDiskplayerSceneKey::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -442,7 +442,7 @@ uint32 DiskplayerScene::handleMessage(int messageNum, const MessageParam &param,
Scene::handleMessage(messageNum, param, sender);
if (!_inputDisabled) {
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
sendMessage(_parentModule, 0x1009, 0);
} else if (!_dropKey &&
@@ -460,7 +460,7 @@ uint32 DiskplayerScene::handleMessage(int messageNum, const MessageParam &param,
}
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
tuneIn();
break;
case 0x2001:
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 50c7c503d3..5e9981caa6 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -79,7 +79,7 @@ GameModule::GameModule(NeverhoodEngine *vm)
_mainMenuRequested(false) {
// Other initializations moved to actual engine class
- _vm->_soundMan->playSoundThree(0x002D0031, 0x8861079);
+ _vm->_soundMan->playSoundThree(0x002D0031, 0x08861079);
SetMessageHandler(&GameModule::handleMessage);
}
@@ -95,7 +95,7 @@ void GameModule::handleMouseMove(int16 x, int16 y) {
mousePos.x = x;
mousePos.y = y;
debug(2, "GameModule::handleMouseMove(%d, %d)", x, y);
- sendPointMessage(_childObject, 0, mousePos);
+ sendPointMessage(_childObject, NM_MOUSE_MOVE, mousePos);
}
}
@@ -105,7 +105,7 @@ void GameModule::handleMouseDown(int16 x, int16 y) {
mousePos.x = x;
mousePos.y = y;
debug(2, "GameModule::handleMouseDown(%d, %d)", x, y);
- sendPointMessage(_childObject, 0x0001, mousePos);
+ sendPointMessage(_childObject, NM_MOUSE_CLICK, mousePos);
}
}
@@ -115,14 +115,26 @@ void GameModule::handleMouseUp(int16 x, int16 y) {
mousePos.x = x;
mousePos.y = y;
debug(2, "GameModule::handleMouseUp(%d, %d)", x, y);
- sendPointMessage(_childObject, 0x0002, mousePos);
+ sendPointMessage(_childObject, NM_MOUSE_RELEASE, mousePos);
+ }
+}
+
+void GameModule::handleWheelUp() {
+ if (_childObject) {
+ sendMessage(_childObject, NM_MOUSE_WHEELUP, 0);
+ }
+}
+
+void GameModule::handleWheelDown() {
+ if (_childObject) {
+ sendMessage(_childObject, NM_MOUSE_WHEELDOWN, 0);
}
}
void GameModule::handleSpaceKey() {
if (_childObject) {
debug(2, "GameModule::handleSpaceKey()");
- sendMessage(_childObject, 0x0009, 0);
+ sendMessage(_childObject, NM_KEYPRESS_SPACE, 0);
}
}
@@ -150,7 +162,7 @@ void GameModule::handleEscapeKey() {
else if (!_prevChildObject && _canRequestMainMenu)
_mainMenuRequested = true;
else if (_childObject)
- sendMessage(_childObject, 0x000C, 0);
+ sendMessage(_childObject, NM_KEYPRESS_ESC, 0);
}
void GameModule::initKeySlotsPuzzle() {
@@ -216,7 +228,7 @@ void GameModule::initRadioPuzzle() {
setGlobalVar(V_RADIO_ROOM_LEFT_DOOR, 1);
setGlobalVar(V_RADIO_ROOM_RIGHT_DOOR, 0);
setSubVar(VA_IS_PUZZLE_INIT, 0x08C80800, 1);
- }
+ }
}
void GameModule::initTestTubes1Puzzle() {
@@ -415,6 +427,8 @@ void GameModule::checkRequests() {
_vm->_audioResourceMan->stopAllSounds();
_vm->_soundMan->stopAllMusic();
_vm->_soundMan->stopAllSounds();
+ // Reinsert turning sound because SoundMan::stopAllSounds() removes it
+ _vm->_soundMan->playSoundThree(0x002D0031, 0x08861079);
delete _childObject;
delete _prevChildObject;
_childObject = NULL;
@@ -781,7 +795,7 @@ void GameModule::updateModule() {
void GameModule::openMainMenu() {
if (_childObject) {
- sendMessage(_childObject, 0x101D, 0);
+ sendMessage(_childObject, NM_MOUSE_HIDE, 0);
_childObject->draw();
} else {
// If there's no module, create one so there's something to return to
@@ -807,7 +821,7 @@ void GameModule::updateMenuModule() {
if (!updateChild()) {
_vm->_screen->restoreParams();
_childObject = _prevChildObject;
- sendMessage(_childObject, 0x101E, 0);
+ sendMessage(_childObject, NM_MOUSE_SHOW, 0);
_prevChildObject = NULL;
_moduleNum = _prevModuleNum;
SetUpdateHandler(&GameModule::updateModule);
diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h
index 2f2fecf463..198f8f6715 100644
--- a/engines/neverhood/gamemodule.h
+++ b/engines/neverhood/gamemodule.h
@@ -40,6 +40,8 @@ public:
void handleMouseMove(int16 x, int16 y);
void handleMouseDown(int16 x, int16 y);
void handleMouseUp(int16 x, int16 y);
+ void handleWheelUp();
+ void handleWheelDown();
void handleSpaceKey();
void handleAsciiKey(char key);
void handleKeyDown(Common::KeyCode keyCode);
diff --git a/engines/neverhood/graphics.cpp b/engines/neverhood/graphics.cpp
index 490959020f..e976844c16 100644
--- a/engines/neverhood/graphics.cpp
+++ b/engines/neverhood/graphics.cpp
@@ -299,11 +299,11 @@ void unpackSpriteRle(const byte *source, int width, int height, byte *dest, int
}
source += copy;
}
- dest += destPitch;
if (replaceColors)
for (int xc = 0; xc < width; xc++)
if (dest[xc] == oldColor)
dest[xc] = newColor;
+ dest += destPitch;
}
}
rows = READ_LE_UINT16(source);
diff --git a/engines/neverhood/klaymen.cpp b/engines/neverhood/klaymen.cpp
index e1a0d72d50..a813440f62 100644
--- a/engines/neverhood/klaymen.cpp
+++ b/engines/neverhood/klaymen.cpp
@@ -77,7 +77,7 @@ uint32 Klaymen::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4818:
@@ -126,7 +126,7 @@ void Klaymen::stIdlePickEar() {
uint32 Klaymen::hmIdlePickEar(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x04DBC02C) {
playSound(0, 0x44528AA1);
}
@@ -152,7 +152,7 @@ void Klaymen::stIdleSpinHead() {
uint32 Klaymen::hmIdleSpinHead(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x808A0008) {
playSound(0, 0xD948A340);
}
@@ -179,7 +179,7 @@ void Klaymen::evIdleArmsDone() {
uint32 Klaymen::hmIdleArms(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x5A0F0104) {
playSound(0, 0x7970A100);
} else if (param.asInteger() == 0x9A9A0109) {
@@ -205,7 +205,7 @@ void Klaymen::stIdleChest() {
uint32 Klaymen::hmIdleChest(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0D2A0288) {
playSound(0, 0xD192A368);
}
@@ -227,7 +227,7 @@ void Klaymen::stIdleHeadOff() {
uint32 Klaymen::hmIdleHeadOff(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xC006000C) {
playSound(0, 0x9D406340);
} else if (param.asInteger() == 0x2E4A2940) {
@@ -333,9 +333,9 @@ void Klaymen::stPickUpTube() {
uint32 Klaymen::hmPickUpTube(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xC1380080) {
- sendMessage(_attachedSprite, 0x4806, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_USE_OBJECT, 0);
playSound(0, 0xC8004340);
} else if (param.asInteger() == 0x02B20220) {
playSound(0, 0xC5408620);
@@ -394,7 +394,7 @@ void Klaymen::stSitInTeleporter() {
uint32 Klaymen::hmSitInTeleporter(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x001A2832) {
playSound(0, 0xC0E4884C);
}
@@ -518,7 +518,7 @@ uint32 Klaymen::hmLowLevel(int messageNum, const MessageParam &param, Entity *se
case 0x1014:
_attachedSprite = (Sprite*)(param.asEntity());
break;
- case 0x1019:
+ case NM_SCENE_LEAVE:
gotoNextStateExt();
break;
case 0x101C:
@@ -556,7 +556,7 @@ void Klaymen::stIdleBlink() {
uint32 Klaymen::hmLowLevelAnimation(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextStateExt();
break;
}
@@ -575,7 +575,7 @@ void Klaymen::stStandAround() {
uint32 Klaymen::hmStartAction(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x271AA210) {
playSound(0, 0x4924AAC4);
} else if (param.asInteger() == 0x2B22AA81) {
@@ -730,7 +730,7 @@ void Klaymen::evSneakingDone() {
uint32 Klaymen::hmSneaking(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101) {
playSound(0, 0x4924AAC4);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -741,7 +741,7 @@ uint32 Klaymen::hmSneaking(int messageNum, const MessageParam &param, Entity *se
playSound(0, _soundFlag ? 0x50399F64 : 0x0460E2FA);
}
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
_x = _destX;
gotoNextStateExt();
break;
@@ -771,7 +771,7 @@ void Klaymen::evStartWalkingDone() {
uint32 Klaymen::hmStartWalking(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101) {
playSound(0, _soundFlag ? 0x48498E46 : 0x405002D8);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -802,7 +802,7 @@ void Klaymen::suWalkingFirst() {
uint32 Klaymen::hmWalking(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101) {
playSound(0, _soundFlag ? 0x48498E46 : 0x405002D8);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -861,7 +861,7 @@ void Klaymen::suWalkingTestExit() {
(_actionStatus != 2 && _actionStatus != 3 && xdiff <= 10 && (_currFrameIndex >= 12 || _currFrameIndex <= 4)) ||
(_actionStatus == 3 && xdiff < 30) ||
(_actionStatus == 3 && xdiff < 150 && _currFrameIndex >= 6)) {
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
} else {
HitRect *hitRectPrev = _parentScene->findHitRectAtPos(_x, _y);
_x += xdelta;
@@ -893,11 +893,11 @@ void Klaymen::suWalkingTestExit() {
uint32 Klaymen::hmLever(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
break;
}
@@ -919,9 +919,9 @@ void Klaymen::stPickUpGeneric() {
uint32 Klaymen::hmPickUpObject(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xC1380080) {
- sendMessage(_attachedSprite, 0x4806, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_USE_OBJECT, 0);
playSound(0, 0x40208200);
} else if (param.asInteger() == 0x02B20220) {
playSound(0, 0xC5408620);
@@ -954,7 +954,7 @@ void Klaymen::stPressButton() {
uint32 Klaymen::hmPressButton(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0D01B294) {
sendMessage(_attachedSprite, 0x480B, 0);
} else if (param.asInteger() == 0x32180101) {
@@ -1048,7 +1048,7 @@ void Klaymen::stStartWalkingSmall() {
uint32 Klaymen::hmWalkingSmall(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101)
playSound(0, 0x4924AAC4);
else if (param.asInteger() == 0x0A2A9098)
@@ -1105,11 +1105,11 @@ void Klaymen::stWalkToFrontNoStepSmall() {
uint32 Klaymen::hmWalkFrontBackSmall(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x80C110B5)
- sendMessage(_parentScene, 0x482A, 0);
+ sendMessage(_parentScene, NM_MOVE_TO_BACK, 0);
else if (param.asInteger() == 0x110010D1)
- sendMessage(_parentScene, 0x482B, 0);
+ sendMessage(_parentScene, NM_MOVE_TO_FRONT, 0);
else if (param.asInteger() == 0x32180101)
playSound(0, 0x4924AAC4);
else if (param.asInteger() == 0x0A2A9098)
@@ -1187,12 +1187,12 @@ void Klaymen::stReleaseCord() {
uint32 Klaymen::hmPullReleaseCord(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
- sendMessage(_attachedSprite, 0x480F, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_LOWER_LEVER, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
break;
}
@@ -1213,7 +1213,7 @@ void Klaymen::stUseTube() {
uint32 Klaymen::hmUseTube(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x02B20220)
playSound(0, 0xC5408620);
else if (param.asInteger() == 0x0A720138)
@@ -1369,14 +1369,14 @@ void Klaymen::suLargeStep() {
uint32 Klaymen::hmLargeStep(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101) {
playSound(0, 0x4924AAC4);
} else if (param.asInteger() == 0x0A2A9098) {
playSound(0, 0x0A2AA8E0);
}
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
_x = _destX;
gotoNextStateExt();
break;
@@ -1414,7 +1414,7 @@ void Klaymen::stTurnToUseHalf() {
uint32 Klaymen::hmTurnToUse(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101) {
playSound(0, 0x4924AAC4);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -1460,7 +1460,7 @@ uint32 Klaymen::hmPeekWall(int messageNum, const MessageParam &param, Entity *se
if (_currFrameIndex < speedUpFrameIndex)
startAnimation(0xAC20C012, speedUpFrameIndex, -1);
return 0;
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101) {
playSound(0, 0x405002D8);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -1479,7 +1479,7 @@ void Klaymen::suUpdateDestX() {
void Klaymen::stReleaseRing() {
_busyStatus = 1;
_acceptInput = false;
- sendMessage(_attachedSprite, 0x4807, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
_attachedSprite = NULL;
startAnimation(0xB869A4B9, 0, -1);
SetUpdateHandler(&Klaymen::update);
@@ -1559,7 +1559,7 @@ void Klaymen::stClimbLadderHalf() {
uint32 Klaymen::hmClimbLadderHalf(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x489B025C) {
playSound(0, 0x52C4C2D7);
} else if (param.asInteger() == 0x400A0E64) {
@@ -1577,7 +1577,7 @@ uint32 Klaymen::hmClimbLadderHalf(int messageNum, const MessageParam &param, Ent
uint32 Klaymen::hmClimbLadderUpDown(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x01084280) {
_acceptInput = true;
} else if (param.asInteger() == 0x489B025C) {
@@ -1588,11 +1588,11 @@ uint32 Klaymen::hmClimbLadderUpDown(int messageNum, const MessageParam &param, E
if (_ladderStatus == 1) {
startAnimationByHash(0x3A292504, 0x01084280, 0);
if (_destY >= _y - 30)
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
} else {
startAnimationByHash(0x122D1505, 0x01084280, 0);
if (_destY <= _y)
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
}
}
break;
@@ -1639,11 +1639,11 @@ void Klaymen::stWalkToFrontNoStep() {
uint32 Klaymen::hmWalkToFront(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x80C110B5) {
- sendMessage(_parentScene, 0x482A, 0);
+ sendMessage(_parentScene, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x110010D1) {
- sendMessage(_parentScene, 0x482B, 0);
+ sendMessage(_parentScene, NM_MOVE_TO_FRONT, 0);
} else if (param.asInteger() == 0x32180101) {
playSound(0, _soundFlag ? 0x48498E46 : 0x405002D8);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -1699,7 +1699,7 @@ void Klaymen::stLandOnFeet() {
uint32 Klaymen::hmLandOnFeet(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x320AC306) {
playSound(0, 0x5860C640);
}
@@ -1722,7 +1722,7 @@ void Klaymen::stTurnToBackToUse() {
uint32 Klaymen::hmTurnToBackToUse(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xC61A0119) {
playSound(0, 0x402338C2);
} else if (param.asInteger() == 0x32180101) {
@@ -1783,12 +1783,12 @@ void Klaymen::stMoveObjectSkipTurnFaceObject() {
}
void Klaymen::evMoveObjectTurnDone() {
- sendMessage(_attachedSprite, 0x4807, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
}
uint32 Klaymen::hmMoveObjectTurn(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x01084280) {
sendMessage(_attachedSprite, 0x480B, _doDeltaX ? 1 : 0);
} else if (param.asInteger() == 0x02421405) {
@@ -1804,7 +1804,7 @@ uint32 Klaymen::hmMoveObjectTurn(int messageNum, const MessageParam &param, Enti
playSound(0, 0x0460E2FA);
}
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
_isMoveObjectRequested = true;
return 0;
}
@@ -1839,7 +1839,7 @@ void Klaymen::stUseLever() {
if (_isLeverDown) {
stUseLeverRelease();
} else {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
startAnimation(0x0C303040, 0, -1);
SetSpriteUpdate(&Klaymen::suUpdateDestX);
SetMessageHandler(&Klaymen::hmLever);
@@ -1853,7 +1853,7 @@ void Klaymen::stUseLever() {
// Exactly the same code as sub420DA0 which was removed
void Klaymen::stPullLeverDown() {
startAnimation(0x0D318140, 0, -1);
- sendMessage(_attachedSprite, 0x480F, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_LOWER_LEVER, 0);
NextState(&Klaymen::stHoldLeverDown);
}
@@ -1871,7 +1871,7 @@ void Klaymen::stUseLeverRelease() {
SetUpdateHandler(&Klaymen::update);
SetMessageHandler(&Klaymen::hmLever);
SetSpriteUpdate(&Klaymen::suUpdateDestX);
- sendMessage(_attachedSprite, 0x4807, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
NextState(&Klaymen::stPullLeverDown);
_acceptInput = false;
}
@@ -1883,7 +1883,7 @@ void Klaymen::stReleaseLever() {
SetUpdateHandler(&Klaymen::update);
SetMessageHandler(&Klaymen::hmLever);
SetSpriteUpdate(&Klaymen::suUpdateDestX);
- sendMessage(_attachedSprite, 0x4807, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
NextState(&Klaymen::stLetGoOfLever);
_acceptInput = false;
_isLeverDown = false;
@@ -1898,7 +1898,7 @@ void Klaymen::stLetGoOfLever() {
}
void Klaymen::evLeverReleasedEvent() {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
}
void Klaymen::stInsertDisk() {
@@ -1929,7 +1929,7 @@ void Klaymen::stInsertDisk() {
uint32 Klaymen::hmInsertDisk(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (_tapesToInsert == 0 && param.asInteger() == 0x06040580) {
nextAnimationByHash(0xD8C8D100, calcHash("GoToStartLoop/Finish"), 0);
} else if (_tapesToInsert != 0 && param.asInteger() == calcHash("GoToStartLoop/Finish")) {
@@ -2033,15 +2033,15 @@ void Klaymen::suJumpToGrab() {
uint32 Klaymen::hmJumpToGrab(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x168050A0)
- sendMessage(_attachedSprite, 0x4806, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_USE_OBJECT, 0);
else if (param.asInteger() == 0x320AC306)
startAnimationByHash(0x00AB8C10, 0x01084280, 0);
else if (param.asInteger() == 0x4AB28209)
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
else if (param.asInteger() == 0x88001184)
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
break;
}
return messageResult;
@@ -2059,7 +2059,7 @@ void Klaymen::stFinishGrow() {
uint32 Klaymen::hmFinishGrow(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x040C4C01)
playSound(0, 0x01E11140);
break;
@@ -2086,7 +2086,7 @@ void Klaymen::stJumpToGrabFall() {
SetUpdateHandler(&Klaymen::update);
SetMessageHandler(&Klaymen::hmJumpToGrab);
SetSpriteUpdate(&Klaymen::suJumpToGrab);
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
}
@@ -2103,7 +2103,7 @@ void Klaymen::stJumpToGrabRelease() {
uint32 Klaymen::hmJumpToGrabRelease(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x320AC306)
playSound(0, 0x5860C640);
break;
@@ -2152,7 +2152,7 @@ void Klaymen::teleporterDisappear(uint32 fileHash) {
uint32 Klaymen::hmTeleporterAppearDisappear(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x4E0A2C24) {
playSound(0, 0x85B10BB8);
} else if (param.asInteger() == 0x4E6A0CA0) {
@@ -2185,7 +2185,7 @@ uint32 Klaymen::hmDrinkPotion(int messageNum, const MessageParam &param, Entity
} else
_potionFlag2 = true;
break;
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0002418E)
sendMessage(_parentScene, 0x2000, 0);
else if (param.asInteger() == 0x924090C2) {
@@ -2230,7 +2230,7 @@ uint32 Klaymen::hmDrinkPotion(int messageNum, const MessageParam &param, Entity
uint32 Klaymen::hmGrow(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x32180101)
playSound(0, 0x405002D8);
else if (param.asInteger() == 0x0A2A9098)
@@ -2283,7 +2283,7 @@ void Klaymen::stDrinkPotion() {
uint32 Klaymen::hmInsertKey(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (_keysToInsert == 0 && param.asInteger() == 0x06040580) {
nextAnimationByHash(0xDC409440, 0x46431401, 0);
} else if (_keysToInsert != 0 && param.asInteger() == 0x46431401) {
@@ -2344,7 +2344,7 @@ void Klaymen::stInsertKey() {
uint32 Klaymen::hmPeekWallReturn(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == calcHash("PopBalloon")) {
sendMessage(_parentScene, 0x2000, 0);
} else if (param.asInteger() == 0x02B20220) {
@@ -2444,7 +2444,7 @@ void Klaymen::suFallDown() {
if (hitRect->type == 0x5001) {
_y = hitRect->rect.y1;
updateBounds();
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
}
_parentScene->checkCollision(this, 0xFFFF, 0x4810, 0);
}
@@ -2495,7 +2495,7 @@ void Klaymen::stFalling() {
SetSpriteUpdate(NULL);
SetMessageHandler(&Klaymen::hmLowLevelAnimation);
NextState(&Klaymen::stFallTouchdown);
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
_attachedSprite = NULL;
sendMessage(_parentScene, 0x8001, 0);
}
@@ -2511,7 +2511,7 @@ void Klaymen::suFallSkipJump() {
if (hitRect->type == 0x5001) {
_y = hitRect->rect.y1;
updateBounds();
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
}
}
@@ -2533,7 +2533,7 @@ void Klaymen::upMoveObject() {
uint32 Klaymen::hmMoveObject(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x01084280) {
playSound(0, 0x405002D8);
sendMessage(_attachedSprite, 0x480B, 0);
@@ -2607,7 +2607,7 @@ void Klaymen::stInteractLever() {
void Klaymen::stPullLever() {
startAnimation(0x0D318140, 0, -1);
NextState(&Klaymen::stLookLeverDown);
- sendMessage(_attachedSprite, 0x480F, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_LOWER_LEVER, 0);
}
void Klaymen::stLookLeverDown() {
diff --git a/engines/neverhood/menumodule.cpp b/engines/neverhood/menumodule.cpp
index 6b0635598f..b332418cf5 100644
--- a/engines/neverhood/menumodule.cpp
+++ b/engines/neverhood/menumodule.cpp
@@ -112,7 +112,7 @@ void MenuModule::createScene(int sceneNum, int which) {
_childObject = new CreditsScene(_vm, this, true);
break;
case MAKING_OF:
- createSmackerScene(kMakingOfSmackerFileHashList, false, true, true);
+ createSmackerScene(kMakingOfSmackerFileHashList, ConfMan.getBool("scalemakingofvideos"), true, true);
break;
case LOAD_GAME_MENU:
createLoadGameMenu();
@@ -150,7 +150,6 @@ void MenuModule::updateScene() {
leaveModule(0);
break;
case kMainMenuQuitGame:
- leaveModule(0);
_vm->quitGame();
break;
case kMainMenuCredits:
@@ -195,6 +194,14 @@ void MenuModule::updateScene() {
}
uint32 MenuModule::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ switch(messageNum) {
+ case NM_KEYPRESS_ESC:
+ leaveModule(0);
+ break;
+ default:
+ break;
+ }
+
return Module::handleMessage(messageNum, param, sender);;
}
@@ -374,7 +381,7 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
uint32 MainMenu::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
leaveScene(param.asInteger());
break;
}
@@ -405,7 +412,6 @@ CreditsScene::CreditsScene(NeverhoodEngine *vm, Module *parentModule, bool canAb
_ticksTime = _vm->_system->getMillis() + 202100;
- _vm->toggleSoundUpdate(true);
_musicResource = new MusicResource(_vm);
_musicResource->load(0x30812225);
_musicResource->play(0);
@@ -415,7 +421,6 @@ CreditsScene::CreditsScene(NeverhoodEngine *vm, Module *parentModule, bool canAb
CreditsScene::~CreditsScene() {
_musicResource->unload();
delete _musicResource;
- _vm->toggleSoundUpdate(false);
}
void CreditsScene::update() {
@@ -448,17 +453,17 @@ void CreditsScene::update() {
uint32 CreditsScene::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0009:
+ case NM_KEYPRESS_SPACE:
leaveScene(0);
break;
case 0x000B:
if (param.asInteger() == Common::KEYCODE_ESCAPE && _canAbort)
leaveScene(0);
break;
- case 0x101D:
+ case NM_MOUSE_HIDE:
_ticksDuration = _ticksTime - _vm->_system->getMillis();
break;
- case 0x101E:
+ case NM_MOUSE_SHOW:
_ticksTime = _ticksDuration + _vm->_system->getMillis();
break;
}
@@ -997,7 +1002,7 @@ uint32 GameStateMenu::handleMessage(int messageNum, const MessageParam &param, E
setCurrWidget(_textEditWidget);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
// Handle menu button click
switch (param.asInteger()) {
case 0:
@@ -1020,6 +1025,12 @@ uint32 GameStateMenu::handleMessage(int messageNum, const MessageParam &param, E
break;
}
break;
+ case NM_MOUSE_WHEELUP:
+ _listBox->scrollUp();
+ break;
+ case NM_MOUSE_WHEELDOWN:
+ _listBox->scrollDown();
+ break;
}
return 0;
}
@@ -1072,7 +1083,7 @@ static const NRect kLoadGameMenuButtonCollisionBounds[] = {
{ 182, 358, 241, 433 }
};
-static const NRect kLoadGameMenuListBoxRect = { 0, 0, 320, 271 };
+static const NRect kLoadGameMenuListBoxRect = { 0, 0, 320, 272 };
static const NRect kLoadGameMenuTextEditRect = { 0, 0, 320, 17 };
static const NRect kLoadGameMenuMouseRect = { 263, 48, 583, 65 };
@@ -1105,7 +1116,7 @@ static const NRect kDeleteGameMenuButtonCollisionBounds[] = {
{ 395, 278, 452, 372 }
};
-static const NRect kDeleteGameMenuListBoxRect = { 0, 0, 320, 271 };
+static const NRect kDeleteGameMenuListBoxRect = { 0, 0, 320, 272 };
static const NRect kDeleteGameMenuTextEditRect = { 0, 0, 320, 17 };
DeleteGameMenu::DeleteGameMenu(NeverhoodEngine *vm, Module *parentModule, SavegameList *savegameList)
@@ -1166,7 +1177,7 @@ QueryOverwriteMenu::QueryOverwriteMenu(NeverhoodEngine *vm, Module *parentModule
uint32 QueryOverwriteMenu::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
// Handle menu button click
leaveScene(param.asInteger());
break;
diff --git a/engines/neverhood/messages.h b/engines/neverhood/messages.h
index 78c66868d5..5f1e1b87dd 100644
--- a/engines/neverhood/messages.h
+++ b/engines/neverhood/messages.h
@@ -26,10 +26,50 @@
namespace Neverhood {
enum NeverhoodMessage {
- NM_KLAYMEN_PICKUP = 0x4812,
- NM_KLAYMEN_PRESS_BUTTON = 0x4816,
- NM_KLAYMEN_INSERT_DISK = 0x481A,
- NM_KLAYMEN_RELEASE_LEVER = 0x4827
+ NM_MOUSE_MOVE = 0x0000,
+ NM_MOUSE_CLICK = 0x0001,
+ NM_MOUSE_RELEASE = 0x0002,
+ NM_MOUSE_HIDE = 0x101D,
+ NM_MOUSE_SHOW = 0x101E,
+ NM_KEYPRESS_SPACE = 0x0009,
+ NM_KEYPRESS_ESC = 0x000C,
+ NM_ANIMATION_START = 0x100D,
+ NM_SCENE_LEAVE = 0x1019,
+ NM_PRIORITY_CHANGE = 0x1022,
+ NM_ANIMATION_UPDATE = 0x2000,
+ NM_POSITION_CHANGE = 0x2002,
+ NM_KLAYMEN_CLIMB_LADDER = 0x2005,
+ NM_KLAYMEN_STOP_CLIMBING = 0x2006,
+
+ NM_CAR_MOVE_TO_PREV_POINT = 0x2007,
+ NM_CAR_MOVE_TO_NEXT_POINT = 0x2008,
+ NM_CAR_ENTER = 0x2009,
+ NM_CAR_LEAVE = 0x200A,
+ NM_CAR_TURN = 0x200E,
+ NM_CAR_AT_HOME = 0x200F,
+
+ NM_ANIMATION_STOP = 0x3002,
+
+ NM_KLAYMEN_STAND_IDLE = 0x4004,
+ NM_KLAYMEN_USE_OBJECT = 0x4806,
+ NM_KLAYMEN_RAISE_LEVER = 0x4807,
+ NM_KLAYMEN_OPEN_DOOR = 0x4808,
+ NM_KLAYMEN_CLOSE_DOOR = 0x4809,
+ NM_KLAYMEN_MOVE_OBJECT = 0x480A,
+ NM_KLAYMEN_LOWER_LEVER = 0x480F,
+ NM_KLAYMEN_PICKUP = 0x4812,
+ NM_KLAYMEN_PRESS_BUTTON = 0x4816,
+ NM_KLAYMEN_INSERT_DISK = 0x481A,
+ NM_KLAYMEN_TURN_TO_USE = 0x481D,
+ NM_KLAYMEN_RETURN_FROM_USE = 0x481E,
+ NM_KLAYMEN_RELEASE_LEVER = 0x4827,
+
+ NM_MOVE_TO_BACK = 0x482A,
+ NM_MOVE_TO_FRONT = 0x482B,
+
+ // New to ScummVM
+ NM_MOUSE_WHEELUP = 0xF000,
+ NM_MOUSE_WHEELDOWN = 0xF001
};
} // End of namespace Neverhood
diff --git a/engines/neverhood/module.cpp b/engines/neverhood/module.cpp
index d1578e680c..3ef4554334 100644
--- a/engines/neverhood/module.cpp
+++ b/engines/neverhood/module.cpp
@@ -48,7 +48,7 @@ void Module::draw() {
uint32 Module::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
case 0x0008:
- sendMessage(_parentModule, 8, 0);
+ sendMessage(_parentModule, 0x0008, 0);
return 0;
case 0x1009:
_moduleResult = param.asInteger();
diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp
index 534fb2ec2f..788e22dc1b 100644
--- a/engines/neverhood/modules/module1000.cpp
+++ b/engines/neverhood/modules/module1000.cpp
@@ -192,7 +192,7 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x00342624) {
sendEntityMessage(_klaymen, 0x1014, _asLever);
setMessageList2(0x004B4910);
@@ -214,13 +214,13 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
setRectList(0x004B49F0);
break;
case 0x480B:
sendMessage(_asWindow, 0x2001, 0);
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
sendMessage(_asHammer, 0x2000, 0);
break;
}
@@ -317,7 +317,7 @@ Scene1002::Scene1002(NeverhoodEngine *vm, Module *parentModule, int which)
_asVenusFlyTrap = insertSprite<AsScene1002VenusFlyTrap>(this, _klaymen, false);
addCollisionSprite(_asVenusFlyTrap);
- sendEntityMessage(_klaymen, 0x2007, _asVenusFlyTrap);
+ sendEntityMessage(_klaymen, NM_CAR_MOVE_TO_PREV_POINT, _asVenusFlyTrap);
_asOutsideDoorBackground = insertSprite<AsScene1002OutsideDoorBackground>();
@@ -347,7 +347,7 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xE6EE60E1) {
if (getGlobalVar(V_FLYTRAP_RING_DOOR))
setMessageList(0x004B4428);
@@ -381,7 +381,7 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
case 0x1024:
sendMessage(_parentModule, 0x1024, param.asInteger());
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (_isClimbingLadder) {
setMessageList2(0x004B43D0);
} else {
@@ -395,18 +395,18 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
_messageList = NULL;
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
_isClimbingLadder = true;
setRectList(0x004B4418);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
_isClimbingLadder = false;
setRectList(0x004B43A0);
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
if (sender == _asRing1) {
setGlobalVar(V_RADIO_ENABLED, 0);
playSound(0, 0x665198C0);
@@ -416,8 +416,8 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
} else if (sender == _asRing3) {
setGlobalVar(V_RADIO_ENABLED, 0);
playSound(1);
- sendMessage(_asDoor, 0x4808, 0);
- sendMessage(_asOutsideDoorBackground, 0x4808, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_OPEN_DOOR, 0);
+ sendMessage(_asOutsideDoorBackground, NM_KLAYMEN_OPEN_DOOR, 0);
} else if (sender == _asRing4) {
setGlobalVar(V_RADIO_ENABLED, 0);
playSound(0, 0xE0558848);
@@ -426,25 +426,25 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam &param, Entit
playSound(0, 0x44014282);
}
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
if (sender == _asRing3) {
playSound(2);
- sendMessage(_asDoor, 0x4809, 0);
- sendMessage(_asOutsideDoorBackground, 0x4809, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_CLOSE_DOOR, 0);
+ sendMessage(_asOutsideDoorBackground, NM_KLAYMEN_CLOSE_DOOR, 0);
} else if (sender == _asVenusFlyTrap) {
if (getGlobalVar(V_FLYTRAP_RING_DOOR)) {
- sendMessage(_asRing3, 0x4807, 0);
+ sendMessage(_asRing3, NM_KLAYMEN_RAISE_LEVER, 0);
}
}
break;
case 0x480B:
sendEntityMessage(_klaymen, 0x1014, _asDoorSpy);
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
setGlobalVar(V_RADIO_ENABLED, 0);
playSound(1);
- sendMessage(_asDoor, 0x4808, 0);
- sendMessage(_asOutsideDoorBackground, 0x4808, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_OPEN_DOOR, 0);
+ sendMessage(_asOutsideDoorBackground, NM_KLAYMEN_OPEN_DOOR, 0);
break;
case 0x8000:
setSpriteSurfacePriority(_ssCeiling, 995);
@@ -521,20 +521,20 @@ uint32 Scene1004::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x926500A1) {
setMessageList(0x004B7C20);
messageResult = 1;
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
loadDataResource(0x01900A04);
break;
case 0x2001:
setRectList(0x004B7C70);
break;
- case 0x2002:
- sendMessage(_asTrashCan, 0x2002, 0);
+ case NM_POSITION_CHANGE:
+ sendMessage(_asTrashCan, NM_POSITION_CHANGE, 0);
break;
}
return messageResult;
@@ -581,7 +581,7 @@ Scene1005::Scene1005(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene1005::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
diff --git a/engines/neverhood/modules/module1000_sprites.cpp b/engines/neverhood/modules/module1000_sprites.cpp
index 573474de02..a028df4b10 100644
--- a/engines/neverhood/modules/module1000_sprites.cpp
+++ b/engines/neverhood/modules/module1000_sprites.cpp
@@ -39,10 +39,10 @@ AsScene1001Door::AsScene1001Door(NeverhoodEngine *vm)
uint32 AsScene1001Door::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
hammerHitsDoor();
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -118,13 +118,13 @@ AsScene1001Hammer::AsScene1001Hammer(NeverhoodEngine *vm, Sprite *asDoor)
uint32 AsScene1001Hammer::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x00352100)
sendMessage(_asDoor, 0x2000, 0);
else if (param.asInteger() == 0x0A1A0109)
playSound(0, 0x66410886);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
startAnimation(0x022C90D4, 1, -1);
playSound(0, 0xE741020A);
_newStickFrameIndex = STICK_LAST_FRAME;
@@ -148,14 +148,14 @@ AsScene1001Window::AsScene1001Window(NeverhoodEngine *vm)
uint32 AsScene1001Window::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0E0A1410)
playSound(0, 0x60803F10);
break;
case 0x2001:
startAnimation(0xC68C2299, 0, -1);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
SetMessageHandler(NULL);
setGlobalVar(V_WINDOW_OPEN, 1);
setVisible(false);
@@ -180,9 +180,9 @@ AsScene1001Lever::AsScene1001Lever(NeverhoodEngine *vm, Scene *parentScene, int1
uint32 AsScene1001Lever::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x00C0C444)
- sendMessage(_parentScene, 0x480F, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_LOWER_LEVER, 0);
else if (param.asInteger() == 0xC41A02C0)
playSound(0, 0x40581882);
break;
@@ -190,18 +190,18 @@ uint32 AsScene1001Lever::handleMessage(int messageNum, const MessageParam &param
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(0x04A98C36, 0, -1);
_newStickFrameIndex = 0;
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
startAnimation(0x04A98C36, 0, -1);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -272,23 +272,23 @@ void AsScene1002Ring::update() {
uint32 AsScene1002Ring::hmRingIdle(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setDoDeltaX(((Sprite*)sender)->isDoDeltaX() ? 1 : 0);
- sendMessage(_parentScene, 0x4806, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_USE_OBJECT, 0);
SetMessageHandler(&AsScene1002Ring::hmRingPulled1);
startAnimation(_isSpecial ? 0x87502558 : 0x80DD4010, 0, -1);
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
setDoDeltaX(((Sprite*)sender)->isDoDeltaX() ? 1 : 0);
- sendMessage(_parentScene, 0x480F, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_LOWER_LEVER, 0);
SetMessageHandler(&AsScene1002Ring::hmRingPulled2);
startAnimation(0x861A2020, 0, -1);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -297,21 +297,21 @@ uint32 AsScene1002Ring::hmRingIdle(int messageNum, const MessageParam &param, En
uint32 AsScene1002Ring::hmRingPulled1(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(_isSpecial ? 0x78D0A812 : 0xB85D2A10, 0, -1);
SetMessageHandler(&AsScene1002Ring::hmRingHangingLow);
break;
- case 0x4807:
- sendMessage(_parentScene, 0x4807, 0);
+ case NM_KLAYMEN_RAISE_LEVER:
+ sendMessage(_parentScene, NM_KLAYMEN_RAISE_LEVER, 0);
setDoDeltaX(_vm->_rnd->getRandomNumber(1));
startAnimation(0x8258A030, 0, -1);
SetMessageHandler(&AsScene1002Ring::hmRingReleased);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -320,15 +320,15 @@ uint32 AsScene1002Ring::hmRingPulled1(int messageNum, const MessageParam &param,
uint32 AsScene1002Ring::hmRingPulled2(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(0x04103090, 0, -1);
SetMessageHandler(&AsScene1002Ring::hmRingHangingLow);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -337,17 +337,17 @@ uint32 AsScene1002Ring::hmRingPulled2(int messageNum, const MessageParam &param,
uint32 AsScene1002Ring::hmRingHangingLow(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4807:
- sendMessage(_parentScene, 0x4807, 0);
+ case NM_KLAYMEN_RAISE_LEVER:
+ sendMessage(_parentScene, NM_KLAYMEN_RAISE_LEVER, 0);
setDoDeltaX(_vm->_rnd->getRandomNumber(1));
startAnimation(0x8258A030, 0, -1);
SetMessageHandler(&AsScene1002Ring::hmRingReleased);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -356,18 +356,18 @@ uint32 AsScene1002Ring::hmRingHangingLow(int messageNum, const MessageParam &par
uint32 AsScene1002Ring::hmRingReleased(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmRingIdle(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x05410F72)
playSound(0, 0x21EE40A9);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(0xA85C4011, 0, -1);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -391,11 +391,11 @@ void AsScene1002Door::update() {
uint32 AsScene1002Door::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
setGlobalVar(V_FLYTRAP_RING_DOOR, 1);
SetSpriteUpdate(&AsScene1002Door::suOpenDoor);
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
setGlobalVar(V_FLYTRAP_RING_DOOR, 0);
SetSpriteUpdate(&AsScene1002Door::suCloseDoor);
break;
@@ -443,7 +443,7 @@ uint32 AsScene1002BoxingGloveHitEffect::handleMessage(int messageNum, const Mess
startAnimation(0x0422255A, 0, -1);
setVisible(true);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -467,7 +467,7 @@ AsScene1002DoorSpy::AsScene1002DoorSpy(NeverhoodEngine *vm, NRect &clipRect, Sce
uint32 AsScene1002DoorSpy::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xA61CA1C2)
sendMessage(_asBoxingGloveHitEffect, 0x2004, 0);
else if (param.asInteger() == 0x14CE0620)
@@ -483,7 +483,7 @@ uint32 AsScene1002DoorSpy::handleMessage(int messageNum, const MessageParam &par
uint32 AsScene1002DoorSpy::hmDoorSpyAnimation(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -607,7 +607,7 @@ void AsScene1002VenusFlyTrap::upIdle() {
uint32 AsScene1002VenusFlyTrap::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x000890C4)
playSound(0, 0xC21190D8);
else if (param.asInteger() == 0x522200A0)
@@ -660,11 +660,11 @@ uint32 AsScene1002VenusFlyTrap::handleMessage(int messageNum, const MessageParam
case 0x4810:
swallowKlaymen();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 995);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 995);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1015);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1015);
break;
}
return messageResult;
@@ -673,7 +673,7 @@ uint32 AsScene1002VenusFlyTrap::handleMessage(int messageNum, const MessageParam
uint32 AsScene1002VenusFlyTrap::hmAnimationSimple(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -683,7 +683,7 @@ uint32 AsScene1002VenusFlyTrap::hmAnimationSimple(int messageNum, const MessageP
uint32 AsScene1002VenusFlyTrap::hmAnimationExt(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x000890C4)
playSound(0, 0xC21190D8);
else if (param.asInteger() == 0x41881801) {
@@ -698,14 +698,14 @@ uint32 AsScene1002VenusFlyTrap::hmAnimationExt(int messageNum, const MessagePara
} else if (param.asInteger() == 0x522200A0)
playSound(0, 0x931080C8);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 995);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 995);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1015);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1015);
break;
}
return messageResult;
@@ -727,7 +727,7 @@ void AsScene1002VenusFlyTrap::stWalk() {
}
void AsScene1002VenusFlyTrap::stRelease() {
- sendMessage(_parentScene, 0x4807, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_RAISE_LEVER, 0);
startAnimation(0x82292851, 0, -1);
SetUpdateHandler(&AsScene1002VenusFlyTrap::update);
SetMessageHandler(&AsScene1002VenusFlyTrap::hmAnimationSimple);
@@ -833,11 +833,11 @@ void AsScene1002OutsideDoorBackground::update() {
uint32 AsScene1002OutsideDoorBackground::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageResult) {
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
_isDoorClosed = false;
_countdown = 2;
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
_isDoorClosed = true;
_countdown = 2;
break;
@@ -848,7 +848,7 @@ uint32 AsScene1002OutsideDoorBackground::handleMessage(int messageNum, const Mes
uint32 AsScene1002OutsideDoorBackground::hmAnimation(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageResult) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -930,14 +930,14 @@ void AsScene1002KlaymenPeekHand::update() {
uint32 AsScene1002KlaymenPeekHand::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x4AB28209) {
- sendMessage(_parentScene, 0x1022, 1200);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1200);
_isClipRectSaved = true;
_savedClipRect = _surface->getClipRect();
setClipRect(0, 0, 640, 480);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_parentScene, 0x1022, 1000);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1000);
if (_isClipRectSaved)
setClipRect(_savedClipRect);
}
@@ -960,15 +960,15 @@ AsScene1004TrashCan::AsScene1004TrashCan(NeverhoodEngine *vm)
uint32 AsScene1004TrashCan::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x225A8587)
playSound(0, 0x109AFC4C);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
startAnimation(0xEB312C11, 0, -1);
setVisible(true);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -991,7 +991,7 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -1001,10 +1001,10 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x480D:
GotoState(&KmScene1001::stPullHammerLever);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -1040,7 +1040,7 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
break;
case 0x4836:
if (param.asInteger() == 1) {
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
GotoState(&KmScene1001::stWakeUp);
}
break;
@@ -1075,7 +1075,7 @@ void KmScene1001::stSleeping() {
uint32 KmScene1001::hmSleeping(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x03060012) {
playSound(0, 0xC0238244);
}
@@ -1098,9 +1098,9 @@ void KmScene1001::stPullHammerLever() {
uint32 KmScene1001::hmPullHammerLever(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Klaymen::hmLever(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x4AB28209)
- sendMessage(_attachedSprite, 0x480F, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_LOWER_LEVER, 0);
break;
}
return messageResult;
@@ -1129,14 +1129,14 @@ uint32 KmScene1002::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x2001:
GotoState(&Klaymen::stStandIdleSpecial);
break;
- case 0x2007:
+ case NM_CAR_MOVE_TO_PREV_POINT:
_otherSprite = (Sprite*)param.asEntity();
break;
case 0x4001:
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4803:
@@ -1164,13 +1164,13 @@ uint32 KmScene1002::xHandleMessage(int messageNum, const MessageParam &param) {
break;
}
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
GotoState(&KmScene1002::stMoveVenusFlyTrap);
break;
case 0x480D:
GotoState(&KmScene1002::stJumpToRingVenusFlyTrap);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 0)
GotoState(&KmScene1002::stPressDoorButton);
break;
@@ -1182,21 +1182,21 @@ uint32 KmScene1002::xHandleMessage(int messageNum, const MessageParam &param) {
startWalkToAttachedSpriteXDistance(param.asInteger());
break;
case 0x4820:
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
GotoState(&Klaymen::stContinueClimbLadderUp);
break;
case 0x4821:
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
_destY = param.asInteger();
GotoState(&Klaymen::stStartClimbLadderDown);
break;
case 0x4822:
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
_destY = param.asInteger();
GotoState(&Klaymen::stStartClimbLadderUp);
break;
case 0x4823:
- sendMessage(_parentScene, 0x2006, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_STOP_CLIMBING, 0);
GotoState(&Klaymen::stClimbLadderHalf);
break;
case 0x482E:
@@ -1227,22 +1227,22 @@ void KmScene1002::setupJumpToRing() {
SetMessageHandler(&KmScene1002::hmJumpToRing);
SetSpriteUpdate(&Klaymen::suUpdateDestX);
NextState(&KmScene1002::stHangOnRing);
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
uint32 KmScene1002::hmJumpToRing(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x168050A0) {
- sendMessage(_attachedSprite, 0x4806, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_USE_OBJECT, 0);
_acceptInput = true;
} else if (param.asInteger() == 0x320AC306) {
playSound(0, 0x5860C640);
} else if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
break;
}
@@ -1283,22 +1283,22 @@ void KmScene1002::stJumpToRing3() {
SetSpriteUpdate(&Klaymen::suUpdateDestX);
SetMessageHandler(&KmScene1002::hmJumpToRing3);
NextState(&KmScene1002::stHoldRing3);
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
}
uint32 KmScene1002::hmJumpToRing3(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x168050A0) {
- sendMessage(_attachedSprite, 0x4806, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_USE_OBJECT, 0);
} else if (param.asInteger() == 0x320AC306) {
playSound(0, 0x5860C640);
} else if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
break;
}
@@ -1339,22 +1339,22 @@ void KmScene1002::stJumpToRingVenusFlyTrap() {
SetMessageHandler(&KmScene1002::hmJumpToRingVenusFlyTrap);
SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
NextState(&KmScene1002::stLandOnFeet);
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
}
uint32 KmScene1002::hmJumpToRingVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x168050A0) {
- sendMessage(_attachedSprite, 0x480F, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_LOWER_LEVER, 0);
} else if (param.asInteger() == 0x586B0300) {
sendMessage(_otherSprite, 0x480E, 1);
} else if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
}
break;
}
@@ -1377,7 +1377,7 @@ void KmScene1002::stJumpAndFall() {
void KmScene1002::stDropFromRing() {
if (_attachedSprite) {
_x = _attachedSprite->getX();
- sendMessage(_attachedSprite, 0x4807, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_RAISE_LEVER, 0);
_attachedSprite = NULL;
}
_busyStatus = 2;
@@ -1392,7 +1392,7 @@ void KmScene1002::stDropFromRing() {
uint32 KmScene1002::hmJumpAndFall(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevel(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x1307050A) {
playSound(0, 0x40428A09);
}
@@ -1426,12 +1426,12 @@ void KmScene1002::stContinueMovingVenusFlyTrap() {
}
void KmScene1002::evMoveVenusFlyTrapDone() {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
}
uint32 KmScene1002::hmMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x01084280) {
sendMessage(_attachedSprite, 0x480B, (uint32)_doDeltaX);
} else if (param.asInteger() == 0x02421405) {
@@ -1442,16 +1442,16 @@ uint32 KmScene1002::hmMoveVenusFlyTrap(int messageNum, const MessageParam &param
SetMessageHandler(&KmScene1002::hmFirstMoveVenusFlyTrap);
}
} else if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
} else if (param.asInteger() == 0x32180101) {
playSound(0, 0x405002D8);
} else if (param.asInteger() == 0x0A2A9098) {
playSound(0, 0x0460E2FA);
}
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
_isMoveObjectRequested = true;
return 0;
}
@@ -1461,11 +1461,11 @@ uint32 KmScene1002::hmMoveVenusFlyTrap(int messageNum, const MessageParam &param
uint32 KmScene1002::hmFirstMoveVenusFlyTrap(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x4AB28209) {
- sendMessage(_attachedSprite, 0x482A, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_BACK, 0);
} else if (param.asInteger() == 0x88001184) {
- sendMessage(_attachedSprite, 0x482B, 0);
+ sendMessage(_attachedSprite, NM_MOVE_TO_FRONT, 0);
} else if (param.asInteger() == 0x32180101) {
playSound(0, 0x405002D8);
} else if (param.asInteger() == 0x0A2A9098) {
@@ -1503,7 +1503,7 @@ void KmScene1002::evHitByBoxingGloveDone() {
uint32 KmScene1002::hmPressDoorButton(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x942D2081) {
_acceptInput = false;
sendMessage(_attachedSprite, 0x2003, 0);
@@ -1530,7 +1530,7 @@ uint32 KmScene1002::hmHitByBoxingGlove(int messageNum, const MessageParam &param
}
messageResult = 0;
break;
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x1A1A0785) {
playSound(0, 0x40F0A342);
} else if (param.asInteger() == 0x60428026) {
@@ -1553,7 +1553,7 @@ uint32 KmScene1004::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4817:
@@ -1563,7 +1563,7 @@ uint32 KmScene1004::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4818:
startWalkToX(_dataResource.getPoint(param.asInteger()).x, false);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&KmScene1004::stReadNote);
break;
case 0x4820:
@@ -1610,10 +1610,10 @@ uint32 KmScene1004::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 KmScene1004::hmReadNote(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x04684052) {
_acceptInput = true;
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
}
break;
}
diff --git a/engines/neverhood/modules/module1100.cpp b/engines/neverhood/modules/module1100.cpp
index af2df2e742..e40508e502 100644
--- a/engines/neverhood/modules/module1100.cpp
+++ b/engines/neverhood/modules/module1100.cpp
@@ -136,15 +136,20 @@ void Module1100::updateScene() {
switch (_sceneNum) {
case 0:
_countdown = 0;
- _vm->_soundMan->playTwoSounds(0x0002C818, 0x48498E46, 0x50399F64, 0);
_vm->_soundMan->setSoundVolume(0x48498E46, 65);
_vm->_soundMan->setSoundVolume(0x50399F64, 65);
- if (_moduleResult == 0)
+ if (_moduleResult == 0) {
+ _vm->_soundMan->playTwoSounds(0x0002C818, 0x48498E46, 0x50399F64, 0);
createScene(1, 0);
- else if (_moduleResult == 1)
+ } else if (_moduleResult == 1) {
+ /* NOTE This fixes a bug in the original where the "tunnel" footstep
+ sounds are played instead of the correct footsteps. */
+ _vm->_soundMan->playTwoSounds(0x0002C818, 0x41861371, 0x43A2507F, 0);
createScene(8, 0);
+ }
break;
case 1:
+ _countdown = 0;
_vm->_soundMan->playTwoSounds(0x0002C818, 0x41861371, 0x43A2507F, 0);
if (getGlobalVar(V_ROBOT_HIT)) {
if (_moduleResult == 0)
@@ -286,7 +291,7 @@ uint32 Scene1105::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
if (!_isActionButtonClicked && _backgroundIndex == 0) {
if (_isPanelOpen) {
@@ -309,7 +314,7 @@ uint32 Scene1105::handleMessage(int messageNum, const MessageParam &param, Entit
_leaveResult = 1;
SetUpdateHandler(&Scene1105::upClosePanel);
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
if (sender == _ssActionButton) {
if (getSubVar(VA_GOOD_DICE_NUMBERS, 0) == getSubVar(VA_CURR_DICE_NUMBERS, 0) &&
getSubVar(VA_GOOD_DICE_NUMBERS, 1) == getSubVar(VA_CURR_DICE_NUMBERS, 1) &&
@@ -318,7 +323,7 @@ uint32 Scene1105::handleMessage(int messageNum, const MessageParam &param, Entit
playSound(2);
_doMoveTeddy = true;
} else {
- sendMessage(_asTeddyBear, 0x2002, 0);
+ sendMessage(_asTeddyBear, NM_POSITION_CHANGE, 0);
}
showMouse(false);
_isActionButtonClicked = true;
@@ -460,7 +465,7 @@ void Scene1105::update() {
if (_isClosePanelDone && !isSoundPlaying(1))
leaveScene(_leaveResult);
if (_doMoveTeddy && !isSoundPlaying(2)) {
- sendMessage(_asTeddyBear, 0x2002, 0);
+ sendMessage(_asTeddyBear, NM_POSITION_CHANGE, 0);
_doMoveTeddy = false;
}
}
@@ -513,7 +518,7 @@ Scene1109::Scene1109(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene1109::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger()) {
setRectList(0x004B63A8);
_klaymen->setKlaymenIdleTable3();
diff --git a/engines/neverhood/modules/module1100_sprites.cpp b/engines/neverhood/modules/module1100_sprites.cpp
index 51e0bb3f49..49a388ffca 100644
--- a/engines/neverhood/modules/module1100_sprites.cpp
+++ b/engines/neverhood/modules/module1100_sprites.cpp
@@ -48,7 +48,7 @@ SsScene1105Button::SsScene1105Button(NeverhoodEngine *vm, Scene *parentScene, ui
void SsScene1105Button::update() {
if (_countdown != 0 && (--_countdown == 0)) {
- sendMessage(_parentScene, 0x4807, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_RAISE_LEVER, 0);
setVisible(false);
}
}
@@ -96,7 +96,7 @@ SsScene1105SymbolDie::SsScene1105SymbolDie(NeverhoodEngine *vm, uint dieIndex, i
uint32 SsScene1105SymbolDie::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
loadSymbolSprite();
break;
}
@@ -133,7 +133,7 @@ AsScene1105TeddyBear::AsScene1105TeddyBear(NeverhoodEngine *vm, Scene *parentSce
uint32 AsScene1105TeddyBear::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (getGlobalVar(V_ROBOT_TARGET)) {
startAnimation(0x6B0C0432, 0, -1);
playSound(0);
@@ -142,7 +142,7 @@ uint32 AsScene1105TeddyBear::handleMessage(int messageNum, const MessageParam &p
playSound(1);
}
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
sendMessage(_parentScene, 0x2003, 0);
stopAnimation();
break;
@@ -206,7 +206,7 @@ KmScene1109::KmScene1109(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene1109::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -214,7 +214,7 @@ uint32 KmScene1109::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
@@ -231,11 +231,11 @@ uint32 KmScene1109::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
diff --git a/engines/neverhood/modules/module1200.cpp b/engines/neverhood/modules/module1200.cpp
index 975545091d..8bf42b3b96 100644
--- a/engines/neverhood/modules/module1200.cpp
+++ b/engines/neverhood/modules/module1200.cpp
@@ -296,15 +296,15 @@ void Scene1201::update() {
uint32 Scene1201::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x07053000) {
_creatureExploded = true;
sendMessage(_asCreature, 0x2004, 0);
} else if (param.asInteger() == 0x140E5744)
- sendMessage(_asCreature, 0x2005, 0);
+ sendMessage(_asCreature, NM_KLAYMEN_CLIMB_LADDER, 0);
else if (param.asInteger() == 0x40253C40) {
_canAcceptInput = false;
- sendMessage(_asCreature, 0x2006, 0);
+ sendMessage(_asCreature, NM_KLAYMEN_STOP_CLIMBING, 0);
} else if (param.asInteger() == 0x090EB048) {
if (_klaymen->getX() < 572)
setMessageList2(0x004AEC90);
@@ -320,7 +320,7 @@ uint32 Scene1201::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList2(0x004AECC0);
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) {
// Move the TNT dummy if the fuse is burning
sendEntityMessage(_klaymen, 0x1014, _asTntMan);
@@ -347,7 +347,7 @@ uint32 Scene1201::handleMessage(int messageNum, const MessageParam &param, Entit
sendMessage(_asRightDoor, 0x4829, 0);
break;
case 0x8000:
- sendMessage(_asKlaymenHead, 0x2006, 0);
+ sendMessage(_asKlaymenHead, NM_KLAYMEN_STOP_CLIMBING, 0);
break;
}
return messageResult;
@@ -427,14 +427,14 @@ uint32 Scene1202::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !_isPuzzleSolved)
leaveScene(0);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_clickedIndex = (int)param.asInteger();
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
_counter--;
break;
}
@@ -444,7 +444,7 @@ uint32 Scene1202::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 Scene1202::hmSolved(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
diff --git a/engines/neverhood/modules/module1200_sprites.cpp b/engines/neverhood/modules/module1200_sprites.cpp
index da38924d9a..5848e16092 100644
--- a/engines/neverhood/modules/module1200_sprites.cpp
+++ b/engines/neverhood/modules/module1200_sprites.cpp
@@ -72,7 +72,7 @@ uint32 AsScene1201Tape::handleMessage(int messageNum, const MessageParam &param,
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setSubVar(VA_HAS_TAPE, _nameHash, 1);
setVisible(false);
SetMessageHandler(NULL);
@@ -101,11 +101,11 @@ AsScene1201TntManRope::AsScene1201TntManRope(NeverhoodEngine *vm, bool isDummyHa
uint32 AsScene1201TntManRope::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x02060018)
playSound(0, 0x47900E06);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
startAnimation(0x928F0C10, 1, -1);
_newStickFrameIndex = STICK_LAST_FRAME;
break;
@@ -141,7 +141,7 @@ void AsScene1201RightDoor::update() {
uint32 AsScene1201RightDoor::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
case 0x4829:
@@ -184,13 +184,13 @@ AsScene1201KlaymenHead::AsScene1201KlaymenHead(NeverhoodEngine *vm)
uint32 AsScene1201KlaymenHead::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
_x = 436;
_y = 339;
startAnimation(0xA060C599, 0, -1);
setVisible(true);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
gotoNextState();
@@ -223,14 +223,14 @@ AsScene1201TntMan::~AsScene1201TntMan() {
uint32 AsScene1201TntMan::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x092870C0)
- sendMessage(_asTntManRope, 0x2006, 0);
+ sendMessage(_asTntManRope, NM_KLAYMEN_STOP_CLIMBING, 0);
else if (param.asInteger() == 0x11CA0144)
playSound(0, 0x51800A04);
break;
case 0x1011:
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
messageResult = 1;
break;
case 0x480B:
@@ -247,7 +247,7 @@ uint32 AsScene1201TntMan::handleMessage(int messageNum, const MessageParam &para
uint32 AsScene1201TntMan::hmComingDown(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = AsScene1201TntMan::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -353,7 +353,7 @@ void AsScene1201Match::update() {
uint32 AsScene1201Match::hmOnDoorFrameAboutToMove(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x86668011)
playSound(0);
break;
@@ -364,7 +364,7 @@ uint32 AsScene1201Match::hmOnDoorFrameAboutToMove(int messageNum, const MessageP
uint32 AsScene1201Match::hmOnDoorFrameMoving(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmOnDoorFrameAboutToMove(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -378,7 +378,7 @@ uint32 AsScene1201Match::hmIdle(int messageNum, const MessageParam &param, Entit
sendMessage(_parentScene, 0x2001, 0);
messageResult = 1;
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setVisible(false);
setGlobalVar(V_MATCH_STATUS, 3);
break;
@@ -459,14 +459,14 @@ void AsScene1201Creature::update() {
uint32 AsScene1201Creature::hmWaiting(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x02060018)
playSound(0, 0xCD298116);
break;
case 0x2004:
GotoState(&AsScene1201Creature::stStartReachForTntDummy);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
GotoState(&AsScene1201Creature::stPincerSnapKlaymen);
break;
}
@@ -476,7 +476,7 @@ uint32 AsScene1201Creature::hmWaiting(int messageNum, const MessageParam &param,
uint32 AsScene1201Creature::hmPincerSnap(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmWaiting(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -486,14 +486,14 @@ uint32 AsScene1201Creature::hmPincerSnap(int messageNum, const MessageParam &par
uint32 AsScene1201Creature::hmPincerSnapKlaymen(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x02060018) {
playSound(0, 0xCD298116);
sendMessage(_parentScene, 0x4814, 0);
sendMessage(_klaymen, 0x4814, 0);
}
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -556,7 +556,7 @@ AsScene1201LeftDoor::AsScene1201LeftDoor(NeverhoodEngine *vm, Sprite *klaymen)
uint32 AsScene1201LeftDoor::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
stCloseDoor();
break;
}
@@ -619,7 +619,7 @@ uint32 AsScene1202TntItem::hmShowIdle(int messageNum, const MessageParam &param,
uint32 AsScene1202TntItem::hmChangePosition(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -648,7 +648,7 @@ void AsScene1202TntItem::stChangePositionFadeIn() {
}
void AsScene1202TntItem::stChangePositionDone() {
- sendMessage(_parentScene, 0x2002, _itemIndex);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, _itemIndex);
stShowIdle();
}
@@ -671,13 +671,13 @@ uint32 KmScene1201::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
GotoState(&Klaymen::stMoveObject);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
case 0x4813:
@@ -689,7 +689,7 @@ uint32 KmScene1201::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4815:
GotoState(&KmScene1201::stCloseEyes);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 0)
GotoState(&Klaymen::stPressButtonSide);
break;
@@ -703,10 +703,10 @@ uint32 KmScene1201::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x481F:
@@ -755,7 +755,7 @@ void KmScene1201::stCloseEyes() {
uint32 KmScene1201::hmMatch(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x51281850) {
setGlobalVar(V_TNT_DUMMY_FUSE_LIT, 1);
} else if (param.asInteger() == 0x43000538) {
@@ -798,7 +798,7 @@ void KmScene1201::stLightMatch() {
uint32 KmScene1201::hmTumbleHeadless(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x000F0082) {
playSound(0, 0x74E2810F);
}
diff --git a/engines/neverhood/modules/module1300.cpp b/engines/neverhood/modules/module1300.cpp
index 312fb85ae7..fe119c1732 100644
--- a/engines/neverhood/modules/module1300.cpp
+++ b/engines/neverhood/modules/module1300.cpp
@@ -350,7 +350,7 @@ Scene1302::Scene1302(NeverhoodEngine *vm, Module *parentModule, int which)
_asVenusFlyTrap = insertSprite<AsScene1002VenusFlyTrap>(this, _klaymen, true);
addCollisionSprite(_asVenusFlyTrap);
- sendEntityMessage(_klaymen, 0x2007, _asVenusFlyTrap);
+ sendEntityMessage(_klaymen, NM_CAR_MOVE_TO_PREV_POINT, _asVenusFlyTrap);
}
@@ -358,10 +358,10 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
- if (param.asInteger() == 0x4A845A00)
+ case NM_ANIMATION_START:
+ if (param.asInteger() == 0x4A845A00) {
sendEntityMessage(_klaymen, 0x1014, _asRing1);
- else if (param.asInteger() == 0x43807801) {
+ } else if (param.asInteger() == 0x43807801) {
if (!getGlobalVar(V_FLYTRAP_RING_BRIDGE)) {
sendEntityMessage(_klaymen, 0x1014, _asRing2);
if (_asVenusFlyTrap->getX() - 10 < 218 + 32 && _asVenusFlyTrap->getX() + 10 > 218 + 32)
@@ -371,9 +371,9 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam &param, Entit
} else
setMessageList(0x004B0950);
messageResult = 1;
- } else if (param.asInteger() == 0x46C26A01)
+ } else if (param.asInteger() == 0x46C26A01) {
sendEntityMessage(_klaymen, 0x1014, _asRing3);
- else if (param.asInteger() == 0x468C7B11) {
+ } else if (param.asInteger() == 0x468C7B11) {
if (!getGlobalVar(V_FLYTRAP_RING_FENCE)) {
sendEntityMessage(_klaymen, 0x1014, _asRing4);
if (_asVenusFlyTrap->getX() - 10 < 218 + 32 + 32 + 32 && _asVenusFlyTrap->getX() + 10 > 218 + 32 + 32 + 32)
@@ -383,9 +383,9 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam &param, Entit
} else
setMessageList(0x004B0950);
messageResult = 1;
- } else if (param.asInteger() == 0x42845B19)
+ } else if (param.asInteger() == 0x42845B19) {
sendEntityMessage(_klaymen, 0x1014, _asRing5);
- else if (param.asInteger() == 0x430A6060) {
+ } else if (param.asInteger() == 0x430A6060) {
if (getGlobalVar(V_FLYTRAP_RING_BRIDGE))
setMessageList2(0x004B0910);
else
@@ -402,66 +402,66 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004B0978);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (_klaymen->getY() > 360) {
sendEntityMessage(_klaymen, 0x1014, _asVenusFlyTrap);
setMessageList2(0x004B08F0);
} else
setMessageList2(0x004B0920);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (_klaymen->getX() > 545)
leaveScene(1);
break;
case 0x2032:
_sprite2->setVisible(true);
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
sendMessage(_parentModule, 0x1024, 2);
if (sender == _asRing1)
playSound(0, 0x665198C0);
else if (sender == _asRing2) {
- sendMessage(_asBridge, 0x4808, 0);
+ sendMessage(_asBridge, NM_KLAYMEN_OPEN_DOOR, 0);
setGlobalVar(V_FLYTRAP_RING_BRIDGE, 1);
- } else if (sender == _asRing3)
+ } else if (sender == _asRing3) {
playSound(0, 0xE2D389C0);
- else if (sender == _asRing4) {
- sendMessage(_ssFence, 0x4808, 0);
+ } else if (sender == _asRing4) {
+ sendMessage(_ssFence, NM_KLAYMEN_OPEN_DOOR, 0);
setGlobalVar(V_FLYTRAP_RING_FENCE, 1);
} else if (sender == _asRing5)
playSound(0, 0x40428A09);
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
if (sender == _asRing2) {
- sendMessage(_asBridge, 0x4809, 0);
+ sendMessage(_asBridge, NM_KLAYMEN_CLOSE_DOOR, 0);
setGlobalVar(V_FLYTRAP_RING_BRIDGE, 0);
_sprite2->setVisible(false);
} else if (sender == _asRing4) {
- sendMessage(_ssFence, 0x4809, 0);
+ sendMessage(_ssFence, NM_KLAYMEN_CLOSE_DOOR, 0);
setGlobalVar(V_FLYTRAP_RING_FENCE, 0);
} else if (sender == _asVenusFlyTrap) {
if (getGlobalVar(V_FLYTRAP_RING_BRIDGE))
- sendMessage(_asRing2, 0x4807, 0);
+ sendMessage(_asRing2, NM_KLAYMEN_RAISE_LEVER, 0);
else
- sendMessage(_asRing4, 0x4807, 0);
+ sendMessage(_asRing4, NM_KLAYMEN_RAISE_LEVER, 0);
}
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
if (sender == _asRing2) {
playSound(0, 0x60755842);
- sendMessage(_asBridge, 0x4808, 0);
+ sendMessage(_asBridge, NM_KLAYMEN_OPEN_DOOR, 0);
setGlobalVar(V_FLYTRAP_RING_BRIDGE, 1);
} else if (sender == _asRing4) {
playSound(0, 0x60755842);
- sendMessage(_ssFence, 0x4808, 0);
+ sendMessage(_ssFence, NM_KLAYMEN_OPEN_DOOR, 0);
setGlobalVar(V_FLYTRAP_RING_FENCE, 1);
}
break;
- case 0x482A:
- sendMessage(_asVenusFlyTrap, 0x482B, 0);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_asVenusFlyTrap, NM_MOVE_TO_FRONT, 0);
break;
- case 0x482B:
- sendMessage(_asVenusFlyTrap, 0x482A, 0);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_asVenusFlyTrap, NM_MOVE_TO_BACK, 0);
break;
case 0x8000:
setSpriteSurfacePriority(_class595, 995);
@@ -500,7 +500,7 @@ Scene1303::Scene1303(NeverhoodEngine *vm, Module *parentModule)
uint32 Scene1303::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
setGlobalVar(V_BALLOON_POPPED, 1);
sendMessage(_asBalloon, 0x2000, 0);
break;
@@ -555,7 +555,7 @@ Scene1304::Scene1304(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene1304::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x415634A4) {
if (getGlobalVar(V_BALLOON_POPPED))
cancelMessageList();
@@ -629,7 +629,7 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which)
insertStaticSprite(0x00042313, 1100);
if (which < 0) {
- // Resoring game
+ // Restoring game
insertKlaymen<KmScene1306>(380, 440);
setMessageList(0x004AFAD0);
sendMessage(this, 0x2000, 0);
@@ -681,7 +681,7 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which)
sendMessage(this, 0x2000, 0);
SetMessageHandler(&Scene1306::handleMessage416EB0);
clearRectList();
- sendMessage(_asElevator, 0x4808, 0);
+ sendMessage(_asElevator, NM_KLAYMEN_OPEN_DOOR, 0);
}
}
@@ -693,7 +693,7 @@ Scene1306::~Scene1306() {
uint32 Scene1306::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x402064D8)
sendEntityMessage(_klaymen, 0x1014, _ssButton);
else if (param.asInteger() == 0x01C66840) {
@@ -707,7 +707,7 @@ uint32 Scene1306::handleMessage(int messageNum, const MessageParam &param, Entit
SetMessageHandler(&Scene1306::handleMessage416EB0);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger() != 0) {
setRectList(0x004AFD28);
_klaymen->setKlaymenIdleTable3();
@@ -718,7 +718,7 @@ uint32 Scene1306::handleMessage(int messageNum, const MessageParam &param, Entit
break;
case 0x480B:
if (sender == _ssButton)
- sendMessage(_asElevator, 0x4808, 0);
+ sendMessage(_asElevator, NM_KLAYMEN_OPEN_DOOR, 0);
break;
case 0x4826:
if (sender == _asKey) {
@@ -733,12 +733,12 @@ uint32 Scene1306::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
setSurfacePriority(_asElevator->getSurface(), 1100);
setSurfacePriority(_asElevatorDoor->getSurface(), 1090);
setSurfacePriority(_sprite1->getSurface(), 1080);
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
setSurfacePriority(_asElevator->getSurface(), 100);
setSurfacePriority(_asElevatorDoor->getSurface(), 90);
setSurfacePriority(_sprite1->getSurface(), 80);
@@ -752,19 +752,19 @@ uint32 Scene1306::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 Scene1306::handleMessage416EB0(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
setMessageList(0x004AFBD0);
SetMessageHandler(&Scene1306::handleMessage);
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
leaveScene(1);
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
setSurfacePriority(_asElevator->getSurface(), 1100);
setSurfacePriority(_asElevatorDoor->getSurface(), 1090);
setSurfacePriority(_sprite1->getSurface(), 1080);
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
setSurfacePriority(_asElevator->getSurface(), 100);
setSurfacePriority(_asElevatorDoor->getSurface(), 90);
setSurfacePriority(_sprite1->getSurface(), 80);
@@ -840,7 +840,7 @@ uint32 Scene1307::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (!_isPuzzleSolved) {
if (param.asPoint().x > 20 && param.asPoint().x < 620) {
if (_asCurrKey && !_isInsertingKey) {
@@ -873,7 +873,7 @@ uint32 Scene1307::handleMessage(int messageNum, const MessageParam &param, Entit
leaveScene(0);
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
// Check if all keys are in the correct keyholes
if (getSubVar(VA_IS_KEY_INSERTED, 0) && getSubVar(VA_CURR_KEY_SLOT_NUMBERS, 0) == getSubVar(VA_GOOD_KEY_SLOT_NUMBERS, 0) &&
getSubVar(VA_IS_KEY_INSERTED, 1) && getSubVar(VA_CURR_KEY_SLOT_NUMBERS, 1) == getSubVar(VA_GOOD_KEY_SLOT_NUMBERS, 1) &&
@@ -981,7 +981,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
// Klaymen entering from the left
insertKlaymen<KmScene1308>(41, 440);
setMessageList(0x004B57D0);
- sendMessage(_asJaggyDoor, 0x4808, 0);
+ sendMessage(_asJaggyDoor, NM_KLAYMEN_OPEN_DOOR, 0);
_sprite1->setVisible(false);
if (getGlobalVar(V_KEYDOOR_UNLOCKED)) {
_sprite4 = insertStaticSprite(0x0101A624, 1100);
@@ -1009,7 +1009,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene1308::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x88C11390) {
setRectList(0x004B59A0);
_isProjecting = true;
@@ -1022,12 +1022,12 @@ uint32 Scene1308::handleMessage(int messageNum, const MessageParam &param, Entit
_isProjecting = false;
} else if (param.asInteger() == 0x4AC68808) {
clearRectList();
- sendMessage(_asJaggyDoor, 0x4809, 0);
+ sendMessage(_asJaggyDoor, NM_KLAYMEN_CLOSE_DOOR, 0);
_sprite1->setVisible(false);
_klaymen->setVisible(false);
}
break;
- case 0x1022:
+ case NM_PRIORITY_CHANGE:
if (sender == _asProjector) {
if (param.asInteger() >= 1000)
setSurfacePriority(_sprite3->getSurface(), 1100);
@@ -1035,7 +1035,7 @@ uint32 Scene1308::handleMessage(int messageNum, const MessageParam &param, Entit
setSurfacePriority(_sprite3->getSurface(), 995);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (getGlobalVar(V_KEYDOOR_UNLOCKED))
setRectList(0x004B5990);
else
@@ -1056,11 +1056,11 @@ uint32 Scene1308::handleMessage(int messageNum, const MessageParam &param, Entit
_sprite4->setVisible(true);
setRectList(0x004B5990);
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
sendMessage(_asLightWallSymbols, 0x2003, 0);
break;
- case 0x480F:
- sendMessage(_asLightWallSymbols, 0x2002, 0);
+ case NM_KLAYMEN_LOWER_LEVER:
+ sendMessage(_asLightWallSymbols, NM_POSITION_CHANGE, 0);
_ssNumber1->setVisible(true);
_ssNumber2->setVisible(true);
_ssNumber3->setVisible(true);
@@ -1141,7 +1141,7 @@ void Scene1317::upChooseKing() {
uint32 Scene1317::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
stChooseKing();
break;
}
@@ -1151,7 +1151,7 @@ uint32 Scene1317::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 Scene1317::hmChooseKing(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x >= 21 && param.asPoint().y >= 24 &&
param.asPoint().x <= 261 && param.asPoint().y <= 280) {
stHoborgAsKing();
@@ -1170,7 +1170,7 @@ uint32 Scene1317::hmChooseKing(int messageNum, const MessageParam &param, Entity
uint32 Scene1317::hmHoborgAsKing(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
stEndMovie();
break;
}
@@ -1180,7 +1180,7 @@ uint32 Scene1317::hmHoborgAsKing(int messageNum, const MessageParam &param, Enti
uint32 Scene1317::hmEndMovie(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
leaveScene(0);
break;
}
diff --git a/engines/neverhood/modules/module1300_sprites.cpp b/engines/neverhood/modules/module1300_sprites.cpp
index a65f2363a3..0c1632501e 100644
--- a/engines/neverhood/modules/module1300_sprites.cpp
+++ b/engines/neverhood/modules/module1300_sprites.cpp
@@ -46,13 +46,13 @@ AsScene1302Bridge::AsScene1302Bridge(NeverhoodEngine *vm, Scene *parentScene)
uint32 AsScene1302Bridge::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
stLowerBridge();
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
stRaiseBridge();
break;
}
@@ -99,12 +99,12 @@ void SsScene1302Fence::update() {
uint32 SsScene1302Fence::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
playSound(0);
SetMessageHandler(NULL);
SetSpriteUpdate(&SsScene1302Fence::suMoveDown);
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
playSound(1);
SetMessageHandler(NULL);
SetSpriteUpdate(&SsScene1302Fence::suMoveUp);
@@ -150,7 +150,7 @@ uint32 AsScene1303Balloon::handleMessage(int messageNum, const MessageParam &par
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
stPopBalloon();
break;
}
@@ -160,11 +160,11 @@ uint32 AsScene1303Balloon::handleMessage(int messageNum, const MessageParam &par
uint32 AsScene1303Balloon::hmBalloonPopped(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x020B0003)
playSound(0, 0x742B0055);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
playSound(0, 0x470007EE);
stopAnimation();
setVisible(false);
@@ -193,7 +193,7 @@ uint32 AsScene1304Needle::handleMessage(int messageNum, const MessageParam &para
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setGlobalVar(V_HAS_NEEDLE, 1);
setVisible(false);
SetMessageHandler(NULL);
@@ -241,10 +241,10 @@ uint32 AsScene1306Elevator::handleMessage(int messageNum, const MessageParam &pa
_countdown = 144;
messageResult = _isUp ? 1 : 0;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
if (_isDown)
stGoingUp();
break;
@@ -262,7 +262,7 @@ void AsScene1306Elevator::stGoingUp() {
}
void AsScene1306Elevator::cbGoingUpEvent() {
- sendMessage(_parentScene, 0x4808, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_OPEN_DOOR, 0);
_isUp = true;
_countdown = 144;
stopAnimation();
@@ -282,7 +282,7 @@ void AsScene1306Elevator::stGoingDown() {
void AsScene1306Elevator::cbGoingDownEvent() {
_isDown = true;
- sendMessage(_parentScene, 0x4809, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLOSE_DOOR, 0);
stopAnimation();
SetUpdateHandler(&AsScene1306Elevator::update);
}
@@ -361,7 +361,7 @@ uint32 AsScene1307Key::handleMessage(int messageNum, const MessageParam &param,
messageResult = 1;
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isClickable = param.asInteger() != 0;
break;
case 0x2001:
@@ -401,7 +401,7 @@ void AsScene1307Key::suInsertKey() {
playSound(0);
} else {
SetSpriteUpdate(NULL);
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
}
}
@@ -430,7 +430,7 @@ void AsScene1307Key::stRemoveKey() {
void AsScene1307Key::stInsertKey() {
_pointIndex = 0;
- sendMessage(_parentScene, 0x1022, kAsScene1307KeySurfacePriorities[getSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex) % 4]);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, kAsScene1307KeySurfacePriorities[getSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex) % 4]);
setClipRect(_clipRects[getSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex) % 4]);
_newStickFrameIndex = STICK_LAST_FRAME;
SetSpriteUpdate(&AsScene1307Key::suInsertKey);
@@ -440,7 +440,7 @@ void AsScene1307Key::stMoveKey() {
NPoint pt = (*_pointList)[getSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex)];
int16 newX = pt.x + kAsScene1307KeyXDelta;
int16 newY = pt.y + kAsScene1307KeyYDelta;
- sendMessage(_parentScene, 0x1022, 1000);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1000);
setClipRect(0, 0, 640, 480);
_prevX = _x;
_prevY = _y;
@@ -480,13 +480,13 @@ AsScene1308JaggyDoor::AsScene1308JaggyDoor(NeverhoodEngine *vm, Scene *parentSce
uint32 AsScene1308JaggyDoor::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
stOpenDoor();
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
stCloseDoor();
break;
}
@@ -530,7 +530,7 @@ AsScene1308KeyboardDoor::AsScene1308KeyboardDoor(NeverhoodEngine *vm, Scene *par
uint32 AsScene1308KeyboardDoor::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -562,13 +562,13 @@ AsScene1308LightWallSymbols::AsScene1308LightWallSymbols(NeverhoodEngine *vm, Sc
uint32 AsScene1308LightWallSymbols::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2002:
+ case NM_POSITION_CHANGE:
stFadeIn();
break;
case 0x2003:
stFadeOut();
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -615,7 +615,7 @@ AsScene1308Mouse::AsScene1308Mouse(NeverhoodEngine *vm)
uint32 AsScene1308Mouse::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x66382026)
playSound(0, 0x0CD84468);
else if (param.asInteger() == 0x6E28061C)
@@ -660,10 +660,10 @@ uint32 KmScene1304::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -711,7 +711,7 @@ uint32 KmScene1305::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -750,7 +750,7 @@ KmScene1306::KmScene1306(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -758,13 +758,13 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -772,7 +772,7 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam &param) {
else
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -784,7 +784,7 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481A:
+ case NM_KLAYMEN_INSERT_DISK:
GotoState(&Klaymen::stInsertDisk);
break;
case 0x481B:
@@ -793,13 +793,13 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
else
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
else
@@ -874,10 +874,10 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
if (param.asInteger() == 1)
GotoState(&Klaymen::stMoveObjectSkipTurnFaceObject);
else
@@ -886,7 +886,7 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x480D:
GotoState(&Klaymen::stUseLever);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -898,7 +898,7 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481A:
+ case NM_KLAYMEN_INSERT_DISK:
if (param.asInteger() == 1)
GotoState(&Klaymen::stInsertKey);
else
@@ -910,13 +910,13 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
- case 0x4827:
+ case NM_KLAYMEN_RELEASE_LEVER:
GotoState(&Klaymen::stReleaseLever);
break;
case 0x4834:
diff --git a/engines/neverhood/modules/module1400.cpp b/engines/neverhood/modules/module1400.cpp
index 2fc1052ab1..018f27e2b7 100644
--- a/engines/neverhood/modules/module1400.cpp
+++ b/engines/neverhood/modules/module1400.cpp
@@ -207,7 +207,7 @@ Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which)
_klaymen->setClipRect(_sprite3->getDrawRect().x, 0, 640, 480);
if (which == 0 && _asProjector)
- sendMessage(_asProjector, 0x482B, 0);
+ sendMessage(_asProjector, NM_MOVE_TO_FRONT, 0);
_asBackDoor = insertSprite<AsScene1401BackDoor>(_klaymen, which == 0);
@@ -225,7 +225,7 @@ void Scene1401::update() {
uint32 Scene1401::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x02144CB1)
sendEntityMessage(_klaymen, 0x1014, _ssFloorButton);
else if (param.asInteger() == 0x402064D8)
@@ -237,7 +237,7 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004B66B0);
}
break;
- case 0x1019:
+ case NM_SCENE_LEAVE:
if (param.asInteger() != 0)
leaveScene(2);
else
@@ -254,7 +254,7 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam &param, Entit
if (_asProjector && _asProjector->getX() > 404 && _asProjector->getX() < 504)
sendMessage(_asProjector , 0x4839, 0);
} else if (sender == _ssButton)
- sendMessage(_asBackDoor, 0x4808, 0);
+ sendMessage(_asBackDoor, NM_KLAYMEN_OPEN_DOOR, 0);
break;
case 0x4826:
if (sender == _asProjector) {
@@ -265,15 +265,15 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList2(0x004B65F0);
}
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
_sprite1->setVisible(true);
if (_asProjector)
- sendMessage(_asProjector, 0x482B, 0);
+ sendMessage(_asProjector, NM_MOVE_TO_FRONT, 0);
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
_sprite1->setVisible(false);
if (_asProjector)
- sendMessage(_asProjector, 0x482A, 0);
+ sendMessage(_asProjector, NM_MOVE_TO_BACK, 0);
break;
}
return 0;
@@ -375,7 +375,7 @@ void Scene1402::upShaking() {
uint32 Scene1402::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x00F43389) {
if (getGlobalVar(V_MOUSE_PUZZLE_SOLVED))
leaveScene(0);
@@ -383,18 +383,18 @@ uint32 Scene1402::handleMessage(int messageNum, const MessageParam &param, Entit
clearRectList();
_klaymen->setVisible(false);
showMouse(false);
- sendMessage(_asPuzzleBox, 0x2002, 0);
+ sendMessage(_asPuzzleBox, NM_POSITION_CHANGE, 0);
startShaking();
}
}
break;
- case 0x1019:
+ case NM_SCENE_LEAVE:
if (param.asInteger())
leaveScene(0);
else
leaveScene(1);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
stopShaking();
showMouse(true);
setRectList(0x004B0C48);
@@ -455,7 +455,7 @@ void Scene1407::update() {
uint32 Scene1407::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (_puzzleSolvedCountdown == 0) {
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
// Exit scene
@@ -473,7 +473,7 @@ uint32 Scene1407::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
// The mouse got the cheese (nomnom)
setGlobalVar(V_MOUSE_PUZZLE_SOLVED, 1);
playSound(0, 0x68E25540);
@@ -534,7 +534,7 @@ Scene1403::Scene1403(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene1403::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x88C11390) {
setRectList(0x004B2008);
_isProjecting = true;
@@ -544,10 +544,10 @@ uint32 Scene1403::handleMessage(int messageNum, const MessageParam &param, Entit
_isProjecting = false;
}
break;
- case 0x1019:
+ case NM_SCENE_LEAVE:
leaveScene(0);
break;
- case 0x1022:
+ case NM_PRIORITY_CHANGE:
if (sender == _asProjector) {
if (param.asInteger() >= 1000)
setSurfacePriority(_sprite3->getSurface(), 1100);
@@ -555,10 +555,10 @@ uint32 Scene1403::handleMessage(int messageNum, const MessageParam &param, Entit
setSurfacePriority(_sprite3->getSurface(), 995);
}
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
_sprite1->setVisible(false);
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
_sprite1->setVisible(true);
break;
case 0x4826:
@@ -655,7 +655,7 @@ Scene1404::~Scene1404() {
uint32 Scene1404::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x410650C2) {
if (_asProjector && _asProjector->getX() == 220)
setMessageList(0x004B8C40);
@@ -663,7 +663,7 @@ uint32 Scene1404::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004B8CE8);
}
break;
- case 0x1019:
+ case NM_SCENE_LEAVE:
leaveScene(0);
break;
case 0x4826:
@@ -725,11 +725,11 @@ void Scene1405::update() {
uint32 Scene1405::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (_selectFirstTile) {
_firstTileIndex = param.asInteger();
_selectFirstTile = false;
diff --git a/engines/neverhood/modules/module1400_sprites.cpp b/engines/neverhood/modules/module1400_sprites.cpp
index c0ab73c93d..478b328034 100644
--- a/engines/neverhood/modules/module1400_sprites.cpp
+++ b/engines/neverhood/modules/module1400_sprites.cpp
@@ -59,11 +59,11 @@ void AsScene1401Pipe::upSuckInProjector() {
uint32 AsScene1401Pipe::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0A8A1490)
playSound(1, 0x6AB6666F);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_countdown1 = 70;
_countdown2 = 8;
stStartSucking();
@@ -78,7 +78,7 @@ uint32 AsScene1401Pipe::handleMessage(int messageNum, const MessageParam &param,
uint32 AsScene1401Pipe::hmSuckInProjector(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
if (_countdown1 != 0)
stStartSucking();
else
@@ -121,7 +121,7 @@ AsScene1401Mouse::AsScene1401Mouse(NeverhoodEngine *vm)
uint32 AsScene1401Mouse::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x66382026)
playSound(0, 0x0CD84468);
else if (param.asInteger() == 0x6E28061C)
@@ -222,10 +222,10 @@ uint32 AsScene1401BackDoor::handleMessage(int messageNum, const MessageParam &pa
_countdown = 168;
messageResult = _isOpen ? 1 : 0;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
_countdown = 168;
if (!_isOpen)
stOpenDoor();
@@ -292,7 +292,7 @@ uint32 AsCommonProjector::handleMessage(int messageNum, const MessageParam &para
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
setGlobalVar(V_PROJECTOR_SLOT, (_x - _asProjectorItem->point.x) / 108);
if ((int8)getGlobalVar(V_PROJECTOR_SLOT) == _asProjectorItem->lockSlotIndex)
stStartLockedInSlot();
@@ -314,11 +314,11 @@ uint32 AsCommonProjector::handleMessage(int messageNum, const MessageParam &para
else
messageResult = getGlobalVar(V_PROJECTOR_SLOT) > 0 ? 1 : 0;
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
case 0x4839:
stStartSuckedIn();
@@ -338,8 +338,8 @@ uint32 AsCommonProjector::hmLockedInSlot(int messageNum, const MessageParam &par
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4807:
- sendMessage(_parentScene, 0x4807, 0);
+ case NM_KLAYMEN_RAISE_LEVER:
+ sendMessage(_parentScene, NM_KLAYMEN_RAISE_LEVER, 0);
stStopProjecting();
break;
case 0x480B:
@@ -357,14 +357,14 @@ uint32 AsCommonProjector::hmLockedInSlot(int messageNum, const MessageParam &par
else
messageResult = getGlobalVar(V_PROJECTOR_SLOT) > 0 ? 1 : 0;
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
stStartProjecting();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -373,7 +373,7 @@ uint32 AsCommonProjector::hmLockedInSlot(int messageNum, const MessageParam &par
uint32 AsCommonProjector::hmAnimation(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -388,11 +388,11 @@ void AsCommonProjector::suMoving() {
moveProjector();
if (_beforeMoveX == _x) {
if (getGlobalVar(V_PROJECTOR_SLOT) == 0 && _asProjectorItem->leftBorderLeaves != 0) {
- sendMessage(_parentScene, 0x1019, 0);
+ sendMessage(_parentScene, NM_SCENE_LEAVE, 0);
incGlobalVar(V_PROJECTOR_LOCATION, -1);
setGlobalVar(V_PROJECTOR_SLOT, kAsCommonProjectorItems[getGlobalVar(V_PROJECTOR_LOCATION)].maxSlotCount);
} else if ((int8)getGlobalVar(V_PROJECTOR_SLOT) == _asProjectorItem->maxSlotCount && _asProjectorItem->rightBorderLeaves != 0) {
- sendMessage(_parentScene, 0x1019, 1);
+ sendMessage(_parentScene, NM_SCENE_LEAVE, 1);
incGlobalVar(V_PROJECTOR_LOCATION, +1);
setGlobalVar(V_PROJECTOR_SLOT, 0);
}
@@ -481,7 +481,7 @@ void AsCommonProjector::stStartProjecting() {
}
void AsCommonProjector::stLockedInSlot() {
- sendMessage(_parentScene, 0x480F, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_LOWER_LEVER, 0);
startAnimation(0xD833207F, 0, -1);
SetMessageHandler(&AsCommonProjector::hmLockedInSlot);
SetSpriteUpdate(NULL);
@@ -553,13 +553,13 @@ AsScene1402PuzzleBox::AsScene1402PuzzleBox(NeverhoodEngine *vm, Scene *parentSce
uint32 AsScene1402PuzzleBox::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2002:
+ case NM_POSITION_CHANGE:
playSound(1);
startAnimation(0x20060259, -1, -1);
_playBackwards = true;
NextState(&AsScene1402PuzzleBox::stMoveDownDone);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -691,7 +691,7 @@ void AsScene1407Mouse::suWalkTo() {
xdelta = -_deltaX;
_deltaX = 0;
if (_walkDestX == _x)
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
else {
_x += xdelta;
updateBounds();
@@ -709,7 +709,7 @@ void AsScene1407Mouse::upGoThroughHole() {
uint32 AsScene1407Mouse::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
{
int16 mouseX = param.asPoint().x;
int16 mouseY = param.asPoint().y;
@@ -735,7 +735,7 @@ uint32 AsScene1407Mouse::handleMessage(int messageNum, const MessageParam &param
}
}
break;
- case 0x1019:
+ case NM_SCENE_LEAVE:
gotoNextState();
break;
case 0x2001:
@@ -893,16 +893,16 @@ uint32 KmScene1401::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
if (param.asInteger() == 1)
GotoState(&Klaymen::stMoveObjectSkipTurnFaceObject);
else
GotoState(&Klaymen::stMoveObjectFaceObject);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -960,10 +960,10 @@ uint32 KmScene1402::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
if (param.asInteger() == 1)
GotoState(&Klaymen::stMoveObjectSkipTurnFaceObject);
else
@@ -979,10 +979,10 @@ uint32 KmScene1402::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
}
@@ -1007,10 +1007,10 @@ uint32 KmScene1403::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
if (param.asInteger() == 1)
GotoState(&Klaymen::stMoveObjectSkipTurnFaceObject);
else
@@ -1019,7 +1019,7 @@ uint32 KmScene1403::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x480D:
GotoState(&Klaymen::stUseLever);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -1037,7 +1037,7 @@ uint32 KmScene1403::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x4827:
+ case NM_KLAYMEN_RELEASE_LEVER:
GotoState(&Klaymen::stReleaseLever);
break;
case 0x483F:
@@ -1064,16 +1064,16 @@ uint32 KmScene1404::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x480A:
+ case NM_KLAYMEN_MOVE_OBJECT:
if (param.asInteger() == 1)
GotoState(&Klaymen::stMoveObjectSkipTurnFaceObject);
else
GotoState(&Klaymen::stMoveObjectFaceObject);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -1085,7 +1085,7 @@ uint32 KmScene1404::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481A:
+ case NM_KLAYMEN_INSERT_DISK:
GotoState(&Klaymen::stInsertDisk);
break;
case 0x481B:
@@ -1094,10 +1094,10 @@ uint32 KmScene1404::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x481F:
diff --git a/engines/neverhood/modules/module1500.cpp b/engines/neverhood/modules/module1500.cpp
index 3ce9783b69..eaa23e586b 100644
--- a/engines/neverhood/modules/module1500.cpp
+++ b/engines/neverhood/modules/module1500.cpp
@@ -102,11 +102,11 @@ void Scene1501::update() {
Scene::update();
if (_countdown1 != 0) {
_countdown1--;
- if (_countdown1 == 0) {
+ if (_countdown1 == 0 || _skip) {
_vm->_screen->clear();
leaveScene(0);
}
- } else if ((_countdown2 != 0 && (--_countdown2 == 0)) || (_countdown2 == 0 && !isSoundPlaying(0))) {
+ } else if ((_countdown2 != 0 && (--_countdown2 == 0)) || (_countdown2 == 0 && !isSoundPlaying(0)) || _skip) {
_countdown1 = 12;
_palette->startFadeToBlack(11);
}
@@ -124,7 +124,7 @@ void Scene1501::update() {
uint32 Scene1501::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0009:
+ case NM_KEYPRESS_SPACE:
_skip = true;
break;
}
diff --git a/engines/neverhood/modules/module1600.cpp b/engines/neverhood/modules/module1600.cpp
index 0df7dd8925..76c5ca93d2 100644
--- a/engines/neverhood/modules/module1600.cpp
+++ b/engines/neverhood/modules/module1600.cpp
@@ -258,7 +258,7 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which)
SetMessageHandler(&Scene1608::hmUpperFloor);
SetUpdateHandler(&Scene1608::upUpperFloor);
_asCar->setPathPoints(_roomPathPoints);
- sendMessage(_asCar, 0x2002, _roomPathPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _roomPathPoints->size() - 1);
_sprite3 = insertStaticSprite(0xB47026B0, 1100);
_clipRect1.set(_sprite3->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2());
_clipRect3.set(_sprite2->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2());
@@ -299,15 +299,15 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which)
_asIdleCarLower->setVisible(false);
_asIdleCarFull->setVisible(false);
_asCar->setPathPoints(_roomPathPoints);
- sendMessage(_asCar, 0x2002, 0);
- sendMessage(_asCar, 0x2008, 90);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 90);
_sprite3 = insertStaticSprite(0xB47026B0, 1100);
_clipRect1.set(_sprite3->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2());
_clipRect3.set(_sprite2->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2());
_clipRect2 = _clipRect1;
_clipRect2.y2 = 215;
_kmScene1608->setClipRect(_clipRect1);
- _asCar->setClipRect(_clipRect1);
+ _asCar->setClipRect(_clipRect3);
_asIdleCarLower->setClipRect(_clipRect1);
_asIdleCarFull->setClipRect(_clipRect1);
_asTape = insertSprite<AsScene1201Tape>(this, 13, 1100, 412, 443, 0x9148A011);
@@ -349,7 +349,7 @@ void Scene1608::upUpperFloor() {
_asIdleCarLower->setVisible(false);
_asIdleCarFull->setVisible(false);
_asCar->setVisible(true);
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
_asCar->handleUpdate();
_klaymen = NULL;
_carStatus = 0;
@@ -361,7 +361,7 @@ void Scene1608::upCarAtHome() {
Scene::update();
if (_mouseClicked) {
if (_mouseClickPos.x <= 329 && _asCar->getX() == 375 && _asCar->getY() == 227) {
- sendMessage(_asCar, 0x200A, 0);
+ sendMessage(_asCar, NM_CAR_LEAVE, 0);
SetUpdateHandler(&Scene1608::upGettingOutOfCar);
} else {
sendPointMessage(_asCar, 0x2004, _mouseClickPos);
@@ -401,12 +401,12 @@ void Scene1608::upRidingCar() {
sendPointMessage(_asCar, 0x2004, _mouseClickPos);
_mouseClicked = false;
}
- if (_asCar->getX() < 300) {
+ if (_asCar->getY() < 330) {
if (_carClipFlag) {
_carClipFlag = false;
_asCar->setClipRect(_clipRect1);
if (!_asCar->isDoDeltaX())
- sendMessage(_asCar, 0x200E, 0);
+ sendMessage(_asCar, NM_CAR_TURN, 0);
}
} else if (!_carClipFlag) {
_carClipFlag = true;
@@ -417,13 +417,13 @@ void Scene1608::upRidingCar() {
uint32 Scene1608::hmLowerFloor(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x20250B1A) {
clearRectList();
_klaymen->setVisible(false);
showMouse(false);
_sprite1->setVisible(false);
- //sendMessage(_asDoor, 0x4809, 0); // Play sound?
+ //sendMessage(_asDoor, NM_KLAYMEN_CLOSE_DOOR, 0); // Play sound?
_countdown1 = 28;
}
break;
@@ -444,7 +444,7 @@ uint32 Scene1608::hmLowerFloor(int messageNum, const MessageParam &param, Entity
uint32 Scene1608::hmUpperFloor(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x60842040)
_carStatus = 1;
break;
@@ -464,13 +464,13 @@ uint32 Scene1608::hmUpperFloor(int messageNum, const MessageParam &param, Entity
uint32 Scene1608::hmRidingCar(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
leaveScene(1);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
SetMessageHandler(&Scene1608::hmCarAtHome);
SetUpdateHandler(&Scene1608::upCarAtHome);
- sendMessage(_asCar, 0x200F, 1);
+ sendMessage(_asCar, NM_CAR_AT_HOME, 1);
break;
case 0x200D:
sendMessage(_parentModule, 0x200D, 0);
@@ -482,7 +482,7 @@ uint32 Scene1608::hmRidingCar(int messageNum, const MessageParam &param, Entity
uint32 Scene1608::hmCarAtHome(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x200A:
+ case NM_CAR_LEAVE:
_carStatus = 2;
break;
case 0x200D:
@@ -544,11 +544,11 @@ void Scene1609::update() {
uint32 Scene1609::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (!_isSolved) {
if (_changeCurrentSymbol)
_asSymbols[_symbolPosition]->change(_currentSymbolIndex + 12, false);
diff --git a/engines/neverhood/modules/module1600_sprites.cpp b/engines/neverhood/modules/module1600_sprites.cpp
index 06a00c82c0..b7b3658c5e 100644
--- a/engines/neverhood/modules/module1600_sprites.cpp
+++ b/engines/neverhood/modules/module1600_sprites.cpp
@@ -94,10 +94,10 @@ void AsCommonCar::upIdle() {
uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x1019:
+ case NM_SCENE_LEAVE:
SetSpriteUpdate(NULL);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
// Set the current position without moving
_currPointIndex = param.asInteger();
_stepError = 0;
@@ -116,10 +116,10 @@ uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam &param, Ent
} else if (_currPointIndex == newPointIndex && _stepError == 0) {
if (_currPointIndex == 0) {
_yMoveTotalSteps = 0;
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
} else if (_currPointIndex == (int)_pathPoints->size()) {
_yMoveTotalSteps = 0;
- sendMessage(_parentScene, 0x2006, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_STOP_CLIMBING, 0);
}
} else {
moveToPrevPoint();
@@ -177,30 +177,30 @@ uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam &param, Ent
}
}
break;
- case 0x2007:
+ case NM_CAR_MOVE_TO_PREV_POINT:
_yMoveTotalSteps = param.asInteger();
_steps = 0;
_isBraking = false;
_lastDistance = 640;
SetSpriteUpdate(&AsCommonCar::suMoveToPrevPoint);
break;
- case 0x2008:
+ case NM_CAR_MOVE_TO_NEXT_POINT:
_yMoveTotalSteps = param.asInteger();
_steps = 0;
_isBraking = false;
_lastDistance = 640;
SetSpriteUpdate(&AsCommonCar::suMoveToNextPoint);
break;
- case 0x2009:
+ case NM_CAR_ENTER:
stEnterCar();
break;
- case 0x200A:
+ case NM_CAR_LEAVE:
stLeaveCar();
break;
- case 0x200E:
+ case NM_CAR_TURN:
stTurnCar();
break;
- case 0x200F:
+ case NM_CAR_AT_HOME:
stCarAtHome();
_newDeltaXType = param.asInteger();
break;
@@ -211,11 +211,11 @@ uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam &param, Ent
uint32 AsCommonCar::hmAnimation(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = AsCommonCar::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (_isBusy && param.asInteger() == 0x025424A2)
gotoNextState();
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -224,11 +224,11 @@ uint32 AsCommonCar::hmAnimation(int messageNum, const MessageParam &param, Entit
uint32 AsCommonCar::hmLeaveCar(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
- case 0x2009:
+ case NM_CAR_ENTER:
stEnterCar();
break;
- case 0x3002:
- sendMessage(_parentScene, 0x200A, 0);
+ case NM_ANIMATION_STOP:
+ sendMessage(_parentScene, NM_CAR_LEAVE, 0);
SetMessageHandler(&AsCommonCar::handleMessage);
break;
}
@@ -350,8 +350,8 @@ void AsCommonCar::stUpdateMoveDirection() {
void AsCommonCar::moveToNextPoint() {
if (_currPointIndex >= (int)_pathPoints->size() - 1) {
_yMoveTotalSteps = 0;
- sendMessage(this, 0x1019, 0);
- sendMessage(_parentScene, 0x2006, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_STOP_CLIMBING, 0);
} else {
NPoint nextPt = pathPoint(_currPointIndex + 1);
NPoint currPt = pathPoint(_currPointIndex);
@@ -431,8 +431,8 @@ void AsCommonCar::stTurnCarMoveToPrevPoint() {
void AsCommonCar::moveToPrevPoint() {
if (_currPointIndex == 0 && _stepError == 0) {
_yMoveTotalSteps = 0;
- sendMessage(this, 0x1019, 0);
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
} else {
NPoint prevPt;
NPoint currPt;
@@ -492,14 +492,14 @@ void AsCommonCar::suMoveToNextPoint() {
if (_currPointIndex >= (int)_pathPoints->size()) {
_yMoveTotalSteps = 0;
- sendMessage(this, 0x1019, 0);
- sendMessage(_parentScene, 0x2006, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_STOP_CLIMBING, 0);
return;
}
if (_isBraking) {
if (_steps <= 0) {
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
return;
} else
_steps--;
@@ -623,8 +623,8 @@ void AsCommonCar::suMoveToNextPoint() {
if (_currPointIndex == (int)_pathPoints->size() - 1) {
_isBraking = true;
_yMoveTotalSteps = 0;
- sendMessage(this, 0x1019, 0);
- sendMessage(_parentScene, 0x2006, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_STOP_CLIMBING, 0);
}
}
@@ -635,14 +635,14 @@ void AsCommonCar::suMoveToPrevPoint() {
if (_currPointIndex == 0 && _stepError == 0) {
_yMoveTotalSteps = 0;
- sendMessage(this, 0x1019, 0);
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
return;
}
if (_isBraking) {
if (_steps <= 0) {
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
return;
} else
_steps--;
@@ -768,8 +768,8 @@ void AsCommonCar::suMoveToPrevPoint() {
if (_currPointIndex == 0 && _stepError == 0) {
_isBraking = true;
_yMoveTotalSteps = 0;
- sendMessage(this, 0x1019, 0);
- sendMessage(_parentScene, 0x2005, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_CLIMB_LADDER, 0);
}
}
@@ -860,13 +860,13 @@ uint32 KmScene1608::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -884,11 +884,11 @@ uint32 KmScene1608::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
diff --git a/engines/neverhood/modules/module1700.cpp b/engines/neverhood/modules/module1700.cpp
index e3a5fc3663..1062691cd2 100644
--- a/engines/neverhood/modules/module1700.cpp
+++ b/engines/neverhood/modules/module1700.cpp
@@ -215,7 +215,7 @@ void Scene1705::update() {
uint32 Scene1705::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger()) {
setRectList(0x004B6B40);
_klaymen->setKlaymenIdleTable3();
diff --git a/engines/neverhood/modules/module1700_sprites.cpp b/engines/neverhood/modules/module1700_sprites.cpp
index 6274e5a8cc..d6e00c95f3 100644
--- a/engines/neverhood/modules/module1700_sprites.cpp
+++ b/engines/neverhood/modules/module1700_sprites.cpp
@@ -56,7 +56,7 @@ uint32 SsScene1705Tape::handleMessage(int messageNum, const MessageParam &param,
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setSubVar(VA_HAS_TAPE, _tapeIndex, 1);
setVisible(false);
SetMessageHandler(NULL);
@@ -74,7 +74,7 @@ KmScene1705::KmScene1705(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene1705::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -82,7 +82,7 @@ uint32 KmScene1705::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
@@ -91,7 +91,7 @@ uint32 KmScene1705::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4803:
GotoState(&Klaymen::stFallSkipJump);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -109,12 +109,12 @@ uint32 KmScene1705::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter) {
GotoState(&Klaymen::stTurnToUseInTeleporter);
}
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
diff --git a/engines/neverhood/modules/module1900.cpp b/engines/neverhood/modules/module1900.cpp
index a920893755..5fdc6091dc 100644
--- a/engines/neverhood/modules/module1900.cpp
+++ b/engines/neverhood/modules/module1900.cpp
@@ -198,13 +198,13 @@ void Scene1907::update() {
uint32 Scene1907::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) &&
!_hasPlugInFailed && _moveDownCountdown == 0 && _moveUpCountdown == 0 && _countdown3 == 0) {
leaveScene(0);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (getGlobalVar(V_STAIRS_DOWN)) {
playSound(0);
for (int i = 0; i < 9; i++)
diff --git a/engines/neverhood/modules/module1900_sprites.cpp b/engines/neverhood/modules/module1900_sprites.cpp
index 09c0b132d5..9e43203def 100644
--- a/engines/neverhood/modules/module1900_sprites.cpp
+++ b/engines/neverhood/modules/module1900_sprites.cpp
@@ -122,7 +122,7 @@ uint32 AsScene1907Symbol::handleMessage(int messageNum, const MessageParam &para
uint32 AsScene1907Symbol::hmTryToPlugIn(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -216,7 +216,7 @@ void AsScene1907Symbol::tryToPlugIn() {
_plugInTryCount++;
_newPositionIndex = _parentScene->getNextPosition();
_parentScene->setPositionFree(_currPositionIndex, true);
- sendMessage(_parentScene, 0x1022, 1100 + _newPositionIndex);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1100 + _newPositionIndex);
startAnimation(kAsScene1907SymbolFileHashes[_elementIndex], 0, -1);
SetUpdateHandler(&AsScene1907Symbol::update);
SetMessageHandler(&AsScene1907Symbol::hmTryToPlugIn);
@@ -255,7 +255,7 @@ void AsScene1907Symbol::fallOff(int newPositionIndex, int fallOffDelay) {
void AsScene1907Symbol::stFallOffHitGround() {
playSound(1);
- sendMessage(_parentScene, 0x1022, 1000 + _newPositionIndex);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1000 + _newPositionIndex);
Entity::_priority = 1000 - _newPositionIndex;
_parentScene->removeCollisionSprite(this);
_parentScene->addCollisionSprite(this);
@@ -394,7 +394,7 @@ void AsScene1907WaterHint::update() {
uint32 AsScene1907WaterHint::hmShowing(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -426,17 +426,17 @@ uint32 KmScene1901::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4817:
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x482D:
diff --git a/engines/neverhood/modules/module2000.cpp b/engines/neverhood/modules/module2000.cpp
index 3364f60f8b..ad18e65cdd 100644
--- a/engines/neverhood/modules/module2000.cpp
+++ b/engines/neverhood/modules/module2000.cpp
@@ -144,7 +144,7 @@ Scene2001::Scene2001(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2001::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger()) {
setRectList(0x004B3680);
_klaymen->setKlaymenIdleTable3();
diff --git a/engines/neverhood/modules/module2000_sprites.cpp b/engines/neverhood/modules/module2000_sprites.cpp
index c9c1481aa7..35edd8e73f 100644
--- a/engines/neverhood/modules/module2000_sprites.cpp
+++ b/engines/neverhood/modules/module2000_sprites.cpp
@@ -33,7 +33,7 @@ KmScene2001::KmScene2001(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene2001::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -41,7 +41,7 @@ uint32 KmScene2001::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
@@ -58,11 +58,11 @@ uint32 KmScene2001::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
diff --git a/engines/neverhood/modules/module2100.cpp b/engines/neverhood/modules/module2100.cpp
index db7258b066..e95eb58420 100644
--- a/engines/neverhood/modules/module2100.cpp
+++ b/engines/neverhood/modules/module2100.cpp
@@ -147,7 +147,7 @@ void Scene2101::update() {
if (_countdown1 != 0) {
if (_doorStatus == 2) {
if (--_countdown1 == 0) {
- sendMessage(_asDoor, 0x4809, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_CLOSE_DOOR, 0);
_doorStatus = 1;
}
} else {
@@ -155,12 +155,12 @@ void Scene2101::update() {
_canAcceptInput = false;
if (--_countdown1 == 0) {
if (_klaymen->getX() < 480) {
- sendMessage(_asDoor, 0x4809, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_CLOSE_DOOR, 0);
_doorStatus = 1;
} else if (_klaymen->getX() >= 480 && _klaymen->getX() <= 575) {
_klaymen->setDoDeltaX(0);
setMessageList2(0x004B8F48);
- sendMessage(_asDoor, 0x4809, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_CLOSE_DOOR, 0);
sendMessage(_asHitByDoorEffect, 0x2001, 0);
_doorStatus = 1;
}
@@ -174,7 +174,7 @@ void Scene2101::update() {
uint32 Scene2101::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x02144CB1)
sendEntityMessage(_klaymen, 0x1014, _ssFloorButton);
else if (param.asInteger() == 0x21E64A00) {
@@ -185,7 +185,7 @@ uint32 Scene2101::handleMessage(int messageNum, const MessageParam &param, Entit
} else if (param.asInteger() == 0x41442820)
cancelMessageList();
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger() != 0) {
setRectList(0x004B9008);
_klaymen->setKlaymenIdleTable3();
@@ -196,7 +196,7 @@ uint32 Scene2101::handleMessage(int messageNum, const MessageParam &param, Entit
break;
case 0x480B:
if (sender == _ssFloorButton && _doorStatus == 1) {
- sendMessage(_asDoor, 0x4808, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_OPEN_DOOR, 0);
_doorStatus = 0;
_countdown1 = 90;
}
diff --git a/engines/neverhood/modules/module2100_sprites.cpp b/engines/neverhood/modules/module2100_sprites.cpp
index 707ebe342f..f43c0afed5 100644
--- a/engines/neverhood/modules/module2100_sprites.cpp
+++ b/engines/neverhood/modules/module2100_sprites.cpp
@@ -42,13 +42,13 @@ AsScene2101Door::AsScene2101Door(NeverhoodEngine *vm, bool isOpen)
uint32 AsScene2101Door::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
stOpenDoor();
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
stCloseDoor();
break;
}
@@ -93,7 +93,7 @@ uint32 AsScene2101HitByDoorEffect::handleMessage(int messageNum, const MessagePa
startAnimation(0x0422255A, 0, -1);
setVisible(true);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -118,7 +118,7 @@ SsCommonFloorButton::SsCommonFloorButton(NeverhoodEngine *vm, Scene *parentScene
void SsCommonFloorButton::update() {
if (_countdown != 0 && (--_countdown == 0)) {
- sendMessage(_parentScene, 0x1022, 1010);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
if (_fileHash1)
loadSprite(_fileHash1, kSLFDefDrawOffset | kSLFDefPosition);
else
@@ -132,7 +132,7 @@ uint32 SsCommonFloorButton::handleMessage(int messageNum, const MessageParam &pa
case 0x480B:
sendMessage(_parentScene, 0x480B, 0);
setVisible(true);
- sendMessage(_parentScene, 0x1022, 990);
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
loadSprite(_fileHash2, kSLFDefDrawOffset | kSLFDefPosition);
_countdown = 16;
playSound(0, _soundFileHash);
@@ -150,7 +150,7 @@ KmScene2101::KmScene2101(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -158,7 +158,7 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
@@ -167,7 +167,7 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4811:
GotoState(&KmScene2101::stHitByDoor);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -175,7 +175,7 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
else
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -193,11 +193,11 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
@@ -236,7 +236,7 @@ uint32 KmScene2101::hmHitByDoor(int messageNum, const MessageParam &param, Entit
}
messageResult = 0;
break;
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x1A1A0785) {
playSound(0, 0x40F0A342);
} else if (param.asInteger() == 0x60428026) {
diff --git a/engines/neverhood/modules/module2200.cpp b/engines/neverhood/modules/module2200.cpp
index eecddf904c..f1d5d2854d 100644
--- a/engines/neverhood/modules/module2200.cpp
+++ b/engines/neverhood/modules/module2200.cpp
@@ -551,7 +551,7 @@ void Scene2201::update() {
uint32 Scene2201::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x402064D8)
sendEntityMessage(_klaymen, 0x1014, _ssDoorButton);
else if (param.asInteger() == 0x35803198) {
@@ -575,7 +575,7 @@ uint32 Scene2201::handleMessage(int messageNum, const MessageParam &param, Entit
break;
case 0x480B:
if (sender == _ssDoorButton)
- sendMessage(_asDoor, 0x4808, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_OPEN_DOOR, 0);
break;
case 0x4826:
if (sender == _asTape) {
@@ -662,15 +662,15 @@ void Scene2202::update() {
uint32 Scene2202::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_movingCubePosition = (int16)param.asInteger();
_ssMovingCube = (Sprite*)sender;
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
_isCubeMoving = false;
_ssDoneMovingCube = (Sprite*)sender;
if (param.asInteger() <= 2)
@@ -786,7 +786,7 @@ uint32 Scene2203::handleMessage(int messageNum, const MessageParam &param, Entit
else
setMessageList2(0x004B83C8);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (sender == _asLeftDoor)
setMessageList2(0x004B8370);
else
@@ -798,7 +798,7 @@ uint32 Scene2203::handleMessage(int messageNum, const MessageParam &param, Entit
else
_ssSmallRightDoor->setVisible(false);
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
if (sender == _asLeftDoor) {
_ssSmallLeftDoor->setVisible(true);
_klaymen->setClipRect(_leftDoorClipRect);
@@ -911,7 +911,7 @@ void Scene2205::update() {
uint32 Scene2205::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x6449569A)
setMessageList(0x004B0690);
else if (param.asInteger() == 0x2841369C)
@@ -1012,7 +1012,7 @@ Scene2206::~Scene2206() {
uint32 Scene2206::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x800C6694)
readClickedColumn();
else if (param.asInteger() == 0x402064D8)
@@ -1031,19 +1031,19 @@ uint32 Scene2206::handleMessage(int messageNum, const MessageParam &param, Entit
if (sender == _ssButton) {
setGlobalVar(V_SPIKES_RETRACTED, getGlobalVar(V_SPIKES_RETRACTED) ? 0 : 1);
if (getGlobalVar(V_SPIKES_RETRACTED))
- sendMessage(_asDoorSpikes, 0x4808, 0);
+ sendMessage(_asDoorSpikes, NM_KLAYMEN_OPEN_DOOR, 0);
else
- sendMessage(_asDoorSpikes, 0x4809, 0);
+ sendMessage(_asDoorSpikes, NM_KLAYMEN_CLOSE_DOOR, 0);
}
break;
case 0x4826:
sendEntityMessage(_klaymen, 0x1014, _ssTestTube);
setMessageList(0x004B8988);
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
klaymenBehindSpikes();
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
klaymenInFrontSpikes();
break;
}
@@ -1179,7 +1179,7 @@ void Scene2207::update() {
uint32 Scene2207::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0014F275) {
if (_klaymenAtElevator) {
sendMessage(_asElevator, 0x2000, _mouseClickPos.y);
@@ -1215,15 +1215,15 @@ uint32 Scene2207::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004B37D8);
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
_elevatorSurfacePriority = param.asInteger();
break;
case 0x2003:
_isKlaymenBusy = false;
break;
- case 0x4807:
- sendMessage(_asWallRobotAnimation, 0x2007, 0);
- sendMessage(_asWallCannonAnimation, 0x2007, 0);
+ case NM_KLAYMEN_RAISE_LEVER:
+ sendMessage(_asWallRobotAnimation, NM_CAR_MOVE_TO_PREV_POINT, 0);
+ sendMessage(_asWallCannonAnimation, NM_CAR_MOVE_TO_PREV_POINT, 0);
break;
case 0x480B:
if (sender == _ssButton) {
@@ -1236,9 +1236,9 @@ uint32 Scene2207::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x480F:
- sendMessage(_asWallRobotAnimation, 0x2006, 0);
- sendMessage(_asWallCannonAnimation, 0x2006, 0);
+ case NM_KLAYMEN_LOWER_LEVER:
+ sendMessage(_asWallRobotAnimation, NM_KLAYMEN_STOP_CLIMBING, 0);
+ sendMessage(_asWallCannonAnimation, NM_KLAYMEN_STOP_CLIMBING, 0);
_asWallRobotAnimation->setVisible(true);
_asWallCannonAnimation->setVisible(true);
break;
@@ -1262,12 +1262,12 @@ uint32 Scene2207::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 Scene2207::handleMessage2(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2002:
+ case NM_POSITION_CHANGE:
_elevatorSurfacePriority = param.asInteger();
break;
case 0x2004:
SetMessageHandler(&Scene2207::handleMessage);
- sendMessage(_klaymen, 0x2005, 0);
+ sendMessage(_klaymen, NM_KLAYMEN_CLIMB_LADDER, 0);
sendEntityMessage(_klaymen, 0x1014, _asLever);
setMessageList(0x004B3920);
setRectList(0x004B3948);
@@ -1400,7 +1400,7 @@ void Scene2208::update() {
uint32 Scene2208::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 40 || param.asPoint().x >= 600)
leaveScene(0);
break;
@@ -1519,7 +1519,7 @@ void Scene2242::update() {
uint32 Scene2242::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x800C6694)
readClickedColumn();
break;
@@ -1620,7 +1620,7 @@ HallOfRecordsScene::~HallOfRecordsScene() {
uint32 HallOfRecordsScene::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x800C6694)
readClickedColumn();
break;
@@ -1708,7 +1708,7 @@ Scene2247::~Scene2247() {
uint32 Scene2247::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x800C6694)
readClickedColumn();
break;
diff --git a/engines/neverhood/modules/module2200_sprites.cpp b/engines/neverhood/modules/module2200_sprites.cpp
index 30f0404cf1..ddf31f7920 100644
--- a/engines/neverhood/modules/module2200_sprites.cpp
+++ b/engines/neverhood/modules/module2200_sprites.cpp
@@ -62,7 +62,7 @@ void AsScene2201Door::update() {
uint32 AsScene2201Door::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x11001090) {
if (_isOpen)
_ssDoorLight->setVisible(true);
@@ -71,15 +71,15 @@ uint32 AsScene2201Door::handleMessage(int messageNum, const MessageParam &param,
_ssDoorLight->setVisible(false);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (_isOpen)
_countdown = 144;
messageResult = _isOpen ? 1 : 0;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
_countdown = 144;
if (!_isOpen)
stOpenDoor();
@@ -317,7 +317,7 @@ void SsScene2202PuzzleCube::stopMoving() {
loadSprite(kSsScene2202PuzzleCubeFileHashes2[_cubeSymbol], kSLFCenteredDrawOffset);
SetSpriteUpdate(NULL);
_isMoving = false;
- sendMessage(_parentScene, 0x2002, _cubePosition);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, _cubePosition);
}
static const uint32 kAsCommonKeyFileHashes[] = {
@@ -343,7 +343,7 @@ uint32 AsCommonKey::handleMessage(int messageNum, const MessageParam &param, Ent
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setSubVar(VA_HAS_KEY, _keyIndex, 1);
setVisible(false);
SetMessageHandler(NULL);
@@ -377,25 +377,25 @@ uint32 AsScene2203Door::handleMessage(int messageNum, const MessageParam &param,
switch (messageNum) {
case 0x1011:
if (_doorIndex == getGlobalVar(V_LARGE_DOOR_NUMBER))
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
else
sendMessage(_parentScene, 0x2001, 0);
messageResult = 1;
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_otherDoor = (Sprite*)param.asEntity();
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
if (_doorIndex == getGlobalVar(V_LARGE_DOOR_NUMBER))
- sendMessage(_parentScene, 0x4808, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_OPEN_DOOR, 0);
stopAnimation();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
setGlobalVar(V_LARGE_DOOR_NUMBER, _doorIndex);
- sendMessage(_otherDoor, 0x4809, 0);
+ sendMessage(_otherDoor, NM_KLAYMEN_CLOSE_DOOR, 0);
openDoor();
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
closeDoor();
sendMessage(_parentScene, 0x2003, 0);
break;
@@ -425,7 +425,7 @@ SsScene2205DoorFrame::SsScene2205DoorFrame(NeverhoodEngine *vm)
uint32 SsScene2205DoorFrame::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
loadSprite(getGlobalVar(V_LIGHTS_ON) ? 0x24306227 : 0xD90032A0, kSLFDefDrawOffset | kSLFDefPosition);
break;
}
@@ -458,13 +458,13 @@ void AsScene2206DoorSpikes::update() {
uint32 AsScene2206DoorSpikes::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
_deltaIndex = 0;
playSound(0, 0x032746E0);
SetMessageHandler(NULL);
SetSpriteUpdate(&AsScene2206DoorSpikes::suOpen);
break;
- case 0x4809:
+ case NM_KLAYMEN_CLOSE_DOOR:
_deltaIndex = 0;
playSound(0, 0x002642C0);
SetMessageHandler(NULL);
@@ -543,7 +543,7 @@ uint32 SsScene2206TestTube::handleMessage(int messageNum, const MessageParam &pa
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setGlobalVar(V_HAS_TEST_TUBE, 1);
setVisible(false);
SetMessageHandler(NULL);
@@ -607,9 +607,9 @@ void AsScene2207Elevator::update() {
}
if (_pointIndex > 20 && _surface->getPriority() != 900)
- sendMessage(_parentScene, 0x2002, 900);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 900);
else if (_pointIndex < 20 && _surface->getPriority() != 1100)
- sendMessage(_parentScene, 0x2002, 1100);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 1100);
AnimatedSprite::update();
@@ -629,7 +629,7 @@ void AsScene2207Elevator::suSetPosition() {
uint32 AsScene2207Elevator::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
moveToY(param.asInteger());
break;
}
@@ -685,21 +685,21 @@ uint32 AsScene2207Lever::handleMessage(int messageNum, const MessageParam &param
sendMessage(_parentScene, 0x4826, 0);
messageResult = 1;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
stopAnimation();
break;
- case 0x4807:
+ case NM_KLAYMEN_RAISE_LEVER:
stLeverUp();
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
stLeverDown();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -712,7 +712,7 @@ void AsScene2207Lever::stLeverDown() {
}
void AsScene2207Lever::stLeverDownEvent() {
- sendMessage(_parentScene, 0x480F, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_LOWER_LEVER, 0);
}
void AsScene2207Lever::stLeverUp() {
@@ -723,7 +723,7 @@ void AsScene2207Lever::stLeverUp() {
}
void AsScene2207Lever::stLeverUpEvent() {
- sendMessage(_parentScene, 0x4807, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_RAISE_LEVER, 0);
}
AsScene2207WallRobotAnimation::AsScene2207WallRobotAnimation(NeverhoodEngine *vm, Scene *parentScene)
@@ -748,7 +748,7 @@ AsScene2207WallRobotAnimation::~AsScene2207WallRobotAnimation() {
uint32 AsScene2207WallRobotAnimation::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (!_idle) {
if (param.asInteger() == 0x3423093) {
_vm->_soundMan->addSound(0x80D00820, 0x12121943);
@@ -769,13 +769,13 @@ uint32 AsScene2207WallRobotAnimation::handleMessage(int messageNum, const Messag
playSound(0, 0xE0702146);
}
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
stStartAnimation();
break;
- case 0x2007:
+ case NM_CAR_MOVE_TO_PREV_POINT:
stStopAnimation();
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -822,13 +822,13 @@ AsScene2207WallCannonAnimation::AsScene2207WallCannonAnimation(NeverhoodEngine *
uint32 AsScene2207WallCannonAnimation::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
stStartAnimation();
break;
- case 0x2007:
+ case NM_CAR_MOVE_TO_PREV_POINT:
stStopAnimation();
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -876,13 +876,13 @@ uint32 KmScene2201::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 0)
GotoState(&Klaymen::stPressButtonSide);
break;
@@ -899,10 +899,10 @@ uint32 KmScene2201::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x482D:
@@ -943,10 +943,10 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -954,7 +954,7 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam &param) {
else
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -972,7 +972,7 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4819:
GotoState(&KmScene2203::stClayDoorOpen);
break;
- case 0x481A:
+ case NM_KLAYMEN_INSERT_DISK:
GotoState(&Klaymen::stInsertDisk);
break;
case 0x481B:
@@ -981,10 +981,10 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x482D:
@@ -1015,9 +1015,9 @@ void KmScene2203::stClayDoorOpen() {
uint32 KmScene2203::hmClayDoorOpen(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x040D4186) {
- sendMessage(_attachedSprite, 0x4808, 0);
+ sendMessage(_attachedSprite, NM_KLAYMEN_OPEN_DOOR, 0);
}
break;
}
@@ -1040,7 +1040,7 @@ uint32 KmScene2205::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -1050,7 +1050,7 @@ uint32 KmScene2205::xHandleMessage(int messageNum, const MessageParam &param) {
} else
GotoState(&Klaymen::stPeekWall);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 0)
GotoState(&Klaymen::stPressButtonSide);
break;
@@ -1092,7 +1092,7 @@ uint32 KmScene2206::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4803:
@@ -1105,13 +1105,13 @@ uint32 KmScene2206::xHandleMessage(int messageNum, const MessageParam &param) {
} else
GotoState(&Klaymen::stPeekWall);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPickUpTube);
else
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -1174,7 +1174,7 @@ void KmScene2206::suRidePlatformDown() {
_platformDeltaY++;
_y += _platformDeltaY;
if (_y > 600)
- sendMessage(this, 0x1019, 0);
+ sendMessage(this, NM_SCENE_LEAVE, 0);
}
void KmScene2206::stRidePlatformDown() {
@@ -1202,7 +1202,7 @@ uint32 KmScene2207::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x2001:
GotoState(&Klaymen::stRidePlatform);
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
suRidePlatform();
GotoState(&Klaymen::stTryStandIdle);
break;
@@ -1210,16 +1210,16 @@ uint32 KmScene2207::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x480D:
GotoState(&Klaymen::stInteractLever);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -1237,7 +1237,7 @@ uint32 KmScene2207::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x4827:
+ case NM_KLAYMEN_RELEASE_LEVER:
GotoState(&Klaymen::stReleaseLever);
break;
case 0x482D:
@@ -1270,7 +1270,7 @@ uint32 KmScene2242::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -1280,7 +1280,7 @@ uint32 KmScene2242::xHandleMessage(int messageNum, const MessageParam &param) {
} else
GotoState(&Klaymen::stPeekWall);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -1336,7 +1336,7 @@ uint32 KmHallOfRecords::xHandleMessage(int messageNum, const MessageParam &param
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -1389,7 +1389,7 @@ uint32 KmScene2247::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
diff --git a/engines/neverhood/modules/module2400.cpp b/engines/neverhood/modules/module2400.cpp
index dab39b24f6..867fb692f2 100644
--- a/engines/neverhood/modules/module2400.cpp
+++ b/engines/neverhood/modules/module2400.cpp
@@ -253,11 +253,11 @@ void Scene2401::update() {
if (puzzleSolved) {
setGlobalVar(V_NOTES_DOOR_UNLOCKED, 1);
setGlobalVar(V_NOTES_PUZZLE_SOLVED, 1);
- sendMessage(_asDoor, 0x4808, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_OPEN_DOOR, 0);
} else if (waterInside) {
playPipeSound(0xD0431020);
for (uint i = 0; i < 5; i++) {
- sendMessage(_asWaterFlushing[i], 0x2002, getSubVar(VA_CURR_WATER_PIPES_LEVEL, i));
+ sendMessage(_asWaterFlushing[i], NM_POSITION_CHANGE, getSubVar(VA_CURR_WATER_PIPES_LEVEL, i));
setSubVar(VA_CURR_WATER_PIPES_LEVEL, i, 0);
}
}
@@ -283,7 +283,7 @@ void Scene2401::update() {
uint32 Scene2401::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x402064D8)
sendEntityMessage(_klaymen, 0x1014, _ssButton);
else if (param.asInteger() == 0x02144CB1)
@@ -313,7 +313,7 @@ uint32 Scene2401::handleMessage(int messageNum, const MessageParam &param, Entit
} else if (param.asInteger() == 0x09C4B40A && _countdown2 > 12)
_countdown2 = 12;
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
messageResult = 0;
for (uint32 i = 0; i < 5; i++)
if (kScene2401Rects[i].contains(_mouseClickPos.x, _mouseClickPos.y)) {
@@ -334,15 +334,15 @@ uint32 Scene2401::handleMessage(int messageNum, const MessageParam &param, Entit
_countdown1 = 8;
} else if (sender == _ssFloorButton && getGlobalVar(V_WATER_RUNNING)) {
_countdown2 = 144;
- sendMessage(_asFlowingWater, 0x2002, 0);
+ sendMessage(_asFlowingWater, NM_POSITION_CHANGE, 0);
playSound(0, 0xE1130324);
}
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
_palette->addBasePalette(0xB103B604, 0, 65, 0);
_palette->startFadeToPalette(12);
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
_palette->addBasePalette(0x91D3A391, 0, 65, 0);
_palette->startFadeToPalette(12);
break;
@@ -411,7 +411,7 @@ Scene2402::~Scene2402() {
void Scene2402::update() {
if (_countdown != 0 && (--_countdown) == 0) {
if (_pipeStatus >= 10) {
- sendMessage(_asDoor, 0x4808, 0);
+ sendMessage(_asDoor, NM_KLAYMEN_OPEN_DOOR, 0);
_ssDoorFrame->loadSprite(0x00B415E0, kSLFDefDrawOffset | kSLFDefPosition);
} else if (_pipeStatus >= 5) {
_countdown = 8;
@@ -428,7 +428,7 @@ void Scene2402::update() {
uint32 Scene2402::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x402064D8)
sendEntityMessage(_klaymen, 0x1014, _ssButton);
else if (param.asInteger() == 0x01C66840) {
@@ -516,13 +516,13 @@ Scene2403::Scene2403(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2403::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x040424D0)
sendEntityMessage(_klaymen, 0x1014, _ssButton);
else if (param.asInteger() == 0x180CE614)
sendEntityMessage(_klaymen, 0x1014, _asLightCord);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isClimbingLadder = true;
setRectList(0x004B5E28);
break;
@@ -541,7 +541,7 @@ uint32 Scene2403::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
if (sender == _asLightCord)
leaveScene(2);
break;
@@ -637,7 +637,7 @@ Scene2406::Scene2406(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2406::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x41062804) {
if (getGlobalVar(V_SPIKES_RETRACTED))
setMessageList(0x004B7758);
@@ -645,7 +645,7 @@ uint32 Scene2406::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004B7738);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isClimbingLadder = true;
setRectList(0x004B78D8);
break;
diff --git a/engines/neverhood/modules/module2400_sprites.cpp b/engines/neverhood/modules/module2400_sprites.cpp
index bf85b0dc37..32c00cde27 100644
--- a/engines/neverhood/modules/module2400_sprites.cpp
+++ b/engines/neverhood/modules/module2400_sprites.cpp
@@ -49,11 +49,11 @@ AsScene2401WaterSpit::AsScene2401WaterSpit(NeverhoodEngine *vm)
uint32 AsScene2401WaterSpit::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x120A0013)
playSound(0, kAsScene2401WaterSpitFileHashes1[_soundIndex]);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_x = 240;
_y = 447;
_soundIndex = getSubVar(VA_CURR_WATER_PIPES_LEVEL, param.asInteger());
@@ -61,7 +61,7 @@ uint32 AsScene2401WaterSpit::handleMessage(int messageNum, const MessageParam &p
setVisible(true);
playSound(0, 0x48640244);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -87,11 +87,11 @@ AsScene2401FlowingWater::~AsScene2401FlowingWater() {
uint32 AsScene2401FlowingWater::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (_isWaterFlowing && param.asInteger() == 0x02421405)
startAnimationByHash(0x10203116, 0x01084280, 0);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (!_isWaterFlowing) {
_vm->_soundMan->addSound(0x40F11C09, 0x980C1420);
_vm->_soundMan->playSoundLooping(0x980C1420);
@@ -104,7 +104,7 @@ uint32 AsScene2401FlowingWater::handleMessage(int messageNum, const MessageParam
_vm->_soundMan->deleteSound(0x980C1420);
_isWaterFlowing = false;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -135,19 +135,19 @@ void AsScene2401WaterFlushing::update() {
uint32 AsScene2401WaterFlushing::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (_flushLoopCount > 0 && param.asInteger() == 0x02421405) {
startAnimationByHash(0xB8596884, 0x01084280, 0);
_flushLoopCount--;
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (param.asInteger() > 0) {
_flushLoopCount = param.asInteger() - 1;
_countdown = _vm->_rnd->getRandomNumber(3) + 1;
}
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -194,10 +194,10 @@ uint32 AsScene2401Door::handleMessage(int messageNum, const MessageParam &param,
_countdown = 168;
messageResult = _isOpen ? 1 : 0;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
if (!_isOpen) {
_countdown = 168;
_isOpen = true;
@@ -249,15 +249,15 @@ void AsScene2402Door::update() {
uint32 AsScene2402Door::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (_isOpen)
_countdown = 144;
messageResult = _isOpen ? 1 : 0;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x4808:
+ case NM_KLAYMEN_OPEN_DOOR:
_countdown = 144;
_isOpen = true;
setVisible(true);
@@ -342,11 +342,11 @@ void AsScene2402TV::stJokeFinished() {
uint32 AsScene2402TV::hmJoke(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x431EA0B0)
playSound(0);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -368,10 +368,10 @@ uint32 KmScene2401::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -437,7 +437,7 @@ uint32 KmScene2401::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 KmScene2401::hmSpit(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x16401CA6) {
_canSpitPipe = true;
if (_contSpitPipe)
@@ -508,7 +508,7 @@ uint32 KmScene2402::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (!getGlobalVar(V_TV_JOKE_TOLD))
GotoState(&Klaymen::stStandWonderAbout);
else
@@ -521,10 +521,10 @@ uint32 KmScene2402::xHandleMessage(int messageNum, const MessageParam &param) {
} else
GotoState(&Klaymen::stPeekWall);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -577,16 +577,16 @@ uint32 KmScene2403::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x480D:
GotoState(&Klaymen::stPullCord);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
@@ -661,7 +661,7 @@ uint32 KmScene2406::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -671,7 +671,7 @@ uint32 KmScene2406::xHandleMessage(int messageNum, const MessageParam &param) {
} else
GotoState(&Klaymen::stPeekWall);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -683,7 +683,7 @@ uint32 KmScene2406::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481A:
+ case NM_KLAYMEN_INSERT_DISK:
GotoState(&Klaymen::stInsertDisk);
break;
case 0x481B:
@@ -692,10 +692,10 @@ uint32 KmScene2406::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x481F:
diff --git a/engines/neverhood/modules/module2500.cpp b/engines/neverhood/modules/module2500.cpp
index d0e60adf65..eb1b65cd83 100644
--- a/engines/neverhood/modules/module2500.cpp
+++ b/engines/neverhood/modules/module2500.cpp
@@ -252,7 +252,7 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which)
setRectList(0x004B2608);
SetMessageHandler(&Scene2501::handleMessage);
SetUpdateHandler(&Scene2501::update);
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
_asCar->setVisible(false);
_currTrackIndex = 0;
} else if (which == 1 || which == 2) {
@@ -277,7 +277,7 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which)
setRectList(0x004B2608);
SetMessageHandler(&Scene2501::handleMessage);
SetUpdateHandler(&Scene2501::update);
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
_asCar->setVisible(false);
_currTrackIndex = 0;
}
@@ -295,14 +295,14 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which)
if (which >= 0 && _tracks[_currTrackIndex]->which2 == which) {
NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1];
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480)
- sendMessage(_asCar, 0x2007, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 150);
} else {
NPoint testPoint = (*_trackPoints)[0];
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480)
- sendMessage(_asCar, 0x2008, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 150);
}
_carStatus = 0;
@@ -329,7 +329,7 @@ void Scene2501::update() {
_asIdleCarLower->setVisible(false);
_asIdleCarFull->setVisible(false);
_asCar->setVisible(true);
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
_asCar->handleUpdate();
_klaymen = NULL;
_carStatus = 0;
@@ -341,7 +341,7 @@ void Scene2501::upCarAtHome() {
Scene::update();
if (_mouseClicked) {
if (_mouseClickPos.x <= 210 && _asCar->getX() == 211 && _asCar->getY() == 400) {
- sendMessage(_asCar, 0x200A, 0);
+ sendMessage(_asCar, NM_CAR_LEAVE, 0);
SetUpdateHandler(&Scene2501::upGettingOutOfCar);
} else {
moveCarToPoint(_mouseClickPos);
@@ -385,7 +385,7 @@ void Scene2501::upRidingCar() {
uint32 Scene2501::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x60842040)
_carStatus = 1;
break;
@@ -399,23 +399,23 @@ uint32 Scene2501::handleMessage(int messageNum, const MessageParam &param, Entit
uint32 Scene2501::hmRidingCar(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (_tracks[_currTrackIndex]->which1 < 0 && _newTrackIndex >= 0)
changeTrack();
else if (_tracks[_currTrackIndex]->which1 == 0) {
SetMessageHandler(&Scene2501::hmCarAtHome);
SetUpdateHandler(&Scene2501::upCarAtHome);
- sendMessage(_asCar, 0x200F, 1);
+ sendMessage(_asCar, NM_CAR_AT_HOME, 1);
} else if (_tracks[_currTrackIndex]->which1 > 0)
leaveScene(_tracks[_currTrackIndex]->which1);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
if (_tracks[_currTrackIndex]->which2 < 0 && _newTrackIndex >= 0)
changeTrack();
else if (_tracks[_currTrackIndex]->which2 == 0) {
SetMessageHandler(&Scene2501::hmCarAtHome);
SetUpdateHandler(&Scene2501::upCarAtHome);
- sendMessage(_asCar, 0x200F, 1);
+ sendMessage(_asCar, NM_CAR_AT_HOME, 1);
} else if (_tracks[_currTrackIndex]->which2 > 0)
leaveScene(_tracks[_currTrackIndex]->which2);
break;
@@ -429,7 +429,7 @@ uint32 Scene2501::hmRidingCar(int messageNum, const MessageParam &param, Entity
uint32 Scene2501::hmCarAtHome(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x200A:
+ case NM_CAR_LEAVE:
_carStatus = 2;
break;
case 0x200D:
@@ -460,9 +460,9 @@ void Scene2501::changeTrack() {
_trackPoints = _dataResource.getPointArray(_tracks[_currTrackIndex]->trackPointsName);
_asCar->setPathPoints(_trackPoints);
if (_currTrackIndex == 0)
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
else
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
sendPointMessage(_asCar, 0x2004, _clickPoint);
_newTrackIndex = -1;
}
@@ -491,7 +491,7 @@ Scene2504::Scene2504(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2504::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
diff --git a/engines/neverhood/modules/module2500_sprites.cpp b/engines/neverhood/modules/module2500_sprites.cpp
index ab6b3dcfbe..1394a87db6 100644
--- a/engines/neverhood/modules/module2500_sprites.cpp
+++ b/engines/neverhood/modules/module2500_sprites.cpp
@@ -81,7 +81,7 @@ KmScene2501::KmScene2501(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene2501::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -89,7 +89,7 @@ uint32 KmScene2501::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
@@ -99,11 +99,11 @@ uint32 KmScene2501::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
diff --git a/engines/neverhood/modules/module2600.cpp b/engines/neverhood/modules/module2600.cpp
index a6484a4926..3c3e733b3f 100644
--- a/engines/neverhood/modules/module2600.cpp
+++ b/engines/neverhood/modules/module2600.cpp
@@ -239,20 +239,20 @@ Scene2609::Scene2609(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2609::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !_isBusy)
leaveScene(0);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isBusy = true;
break;
case 0x2001:
_isBusy = false;
sendMessage(_asWater, 0x2001, 0);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
_isBusy = false;
- sendMessage(_asWater, 0x2002, 0);
+ sendMessage(_asWater, NM_POSITION_CHANGE, 0);
break;
}
return 0;
diff --git a/engines/neverhood/modules/module2600_sprites.cpp b/engines/neverhood/modules/module2600_sprites.cpp
index 2c24b533f3..2506a6eb48 100644
--- a/engines/neverhood/modules/module2600_sprites.cpp
+++ b/engines/neverhood/modules/module2600_sprites.cpp
@@ -47,7 +47,7 @@ void SsScene2609Button::update() {
sendMessage(_parentScene, 0x2001, 0);
} else {
setGlobalVar(V_WATER_RUNNING, 1);
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
}
}
}
@@ -88,7 +88,7 @@ AsScene2609Water::AsScene2609Water(NeverhoodEngine *vm)
SetUpdateHandler(&AnimatedSprite::update);
SetMessageHandler(&AsScene2609Water::handleMessage);
if (getGlobalVar(V_WATER_RUNNING))
- sendMessage(this, 0x2002, 0);
+ sendMessage(this, NM_POSITION_CHANGE, 0);
}
AsScene2609Water::~AsScene2609Water() {
@@ -103,7 +103,7 @@ uint32 AsScene2609Water::handleMessage(int messageNum, const MessageParam &param
setVisible(false);
_vm->_soundMan->stopSound(0xDC2769B0);
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
startAnimation(0x9C210C90, 0, -1);
setVisible(true);
_vm->_soundMan->playSoundLooping(0xDC2769B0);
diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp
index 1b78615fdb..13c30048a4 100644
--- a/engines/neverhood/modules/module2700.cpp
+++ b/engines/neverhood/modules/module2700.cpp
@@ -576,14 +576,14 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which)
if (which == _which2) {
NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1];
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480)
- sendMessage(_asCar, 0x2007, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 150);
} else {
NPoint testPoint = (*_trackPoints)[0];
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480)
- sendMessage(_asCar, 0x2008, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 150);
}
_asCar->setClipRect(clipRect);
@@ -592,7 +592,7 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which)
if (which == 1) {
SetMessageHandler(&Scene2701::hmRidingCar);
} else {
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
SetMessageHandler(&Scene2701::hmCarAtHome);
}
@@ -601,14 +601,14 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2701::hmRidingCar(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
sendPointMessage(_asCar, 0x2004, param.asPoint());
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (_which1 >= 0)
SetMessageHandler(&Scene2701::hmCarAtHome);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
if (_which2 >= 0)
leaveScene(_which2);
break;
@@ -622,7 +622,7 @@ uint32 Scene2701::hmRidingCar(int messageNum, const MessageParam &param, Entity
uint32 Scene2701::hmCarAtHome(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x >= 385)
leaveScene(0);
else {
@@ -702,11 +702,11 @@ Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which)
_asCar->setPathPoints(_trackPoints);
if (which == _tracks[_currTrackIndex]->which2) {
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
- sendMessage(_asCar, 0x2007, 150);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 150);
} else {
- sendMessage(_asCar, 0x2002, 0);
- sendMessage(_asCar, 0x2008, 150);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 150);
}
_palette->copyBasePalette(0, 256, 0);
@@ -731,17 +731,17 @@ void Scene2702::update() {
uint32 Scene2702::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
moveCarToPoint(param.asPoint());
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (_newTrackIndex >= 0) {
if (_tracks[_currTrackIndex]->which1 < 0)
changeTrack();
} else if (_tracks[_currTrackIndex]->which1 >= 0)
leaveScene(_tracks[_currTrackIndex]->which1);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
if (_newTrackIndex >= 0) {
if (_tracks[_currTrackIndex]->which2 < 0)
changeTrack();
@@ -782,13 +782,13 @@ void Scene2702::changeTrack() {
_asCar->setPathPoints(_trackPoints);
if (_isUpperTrack) {
if (_currTrackIndex == 0)
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
else
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
} else if (_currTrackIndex == 2)
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
else
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
sendMessage(_asCar, 0x2004, _newTrackDestX);
_newTrackIndex = -1;
}
@@ -832,18 +832,18 @@ Scene2703::Scene2703(NeverhoodEngine *vm, Module *parentModule, int which, uint3
if (which == _which2) {
NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1];
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
if (testPoint.x > 0 && testPoint.x < 640 && testPoint.y > 0 && testPoint.y < 480)
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
else
- sendMessage(_asCar, 0x2007, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 150);
} else {
NPoint testPoint = (*_trackPoints)[0];
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
if (testPoint.x > 0 && testPoint.x < 640 && testPoint.y > 0 && testPoint.y < 480)
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
else
- sendMessage(_asCar, 0x2008, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 150);
}
if (which == 0) {
@@ -891,11 +891,11 @@ void Scene2703::update() {
uint32 Scene2703::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (_which1 >= 0)
leaveScene(_which1);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
if (_which2 >= 0)
leaveScene(_which2);
break;
@@ -951,18 +951,18 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3
if (which == _which2) {
NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1];
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
if (testPoint.x > 0 && testPoint.x < 640 && testPoint.y > 0 && testPoint.y < 480)
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
else
- sendMessage(_asCar, 0x2007, 0);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 150);
} else {
NPoint testPoint = (*_trackPoints)[0];
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
if (testPoint.x > 0 && testPoint.x < 640 && testPoint.y > 0 && testPoint.y < 480)
- sendMessage(_asCar, 0x2009, 0);
+ sendMessage(_asCar, NM_CAR_ENTER, 0);
else
- sendMessage(_asCar, 0x2008, 0);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 150);
}
if (clipRect) {
@@ -990,11 +990,11 @@ void Scene2704::update() {
uint32 Scene2704::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (_which1 >= 0)
leaveScene(_which1);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
if (_which2 >= 0)
leaveScene(_which2);
break;
@@ -1044,17 +1044,17 @@ Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which)
_asCar->setPathPoints(_trackPoints);
if (which == _tracks[_currTrackIndex]->which2) {
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
if (which == 5)
- sendMessage(_asCar, 0x2007, 50);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 50);
else
- sendMessage(_asCar, 0x2007, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_PREV_POINT, 150);
} else {
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
if (which == 5)
- sendMessage(_asCar, 0x2008, 50);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 50);
else
- sendMessage(_asCar, 0x2008, 150);
+ sendMessage(_asCar, NM_CAR_MOVE_TO_NEXT_POINT, 150);
}
}
@@ -1062,17 +1062,17 @@ Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2706::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
moveCarToPoint(param.asPoint());
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (_newTrackIndex >= 0) {
if (_tracks[_currTrackIndex]->which1 < 0)
changeTrack();
} else if (_tracks[_currTrackIndex]->which1 >= 0)
leaveScene(_tracks[_currTrackIndex]->which1);
break;
- case 0x2006:
+ case NM_KLAYMEN_STOP_CLIMBING:
if (_newTrackIndex >= 0) {
if (_tracks[_currTrackIndex]->which2 < 0)
changeTrack();
@@ -1107,9 +1107,9 @@ void Scene2706::changeTrack() {
_trackPoints = _dataResource.getPointArray(_tracks[_currTrackIndex]->trackPointsName);
_asCar->setPathPoints(_trackPoints);
if (_currTrackIndex == 0)
- sendMessage(_asCar, 0x2002, _trackPoints->size() - 1);
+ sendMessage(_asCar, NM_POSITION_CHANGE, _trackPoints->size() - 1);
else
- sendMessage(_asCar, 0x2002, 0);
+ sendMessage(_asCar, NM_POSITION_CHANGE, 0);
sendMessage(_asCar, 0x2004, _newTrackDestX);
_newTrackIndex = -1;
}
diff --git a/engines/neverhood/modules/module2800.cpp b/engines/neverhood/modules/module2800.cpp
index d51515ce81..5d892de224 100644
--- a/engines/neverhood/modules/module2800.cpp
+++ b/engines/neverhood/modules/module2800.cpp
@@ -59,154 +59,123 @@ Module2800::~Module2800() {
_vm->_soundMan->deleteGroup(0x64210814);
}
+#define statueCloseup(backgroundFileHash, cursorFileHash) \
+ _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2); \
+ createStaticScene(backgroundFileHash, cursorFileHash)
+
void Module2800::createScene(int sceneNum, int which) {
debug(1, "Module2800::createScene(%d, %d)", sceneNum, which);
_sceneNum = sceneNum;
+
+ if (_sceneNum != 1001)
+ _vm->gameState().sceneNum = _sceneNum;
+
switch (_sceneNum) {
- case 0:
- _vm->gameState().sceneNum = 0;
+ case 0: // in front of radio
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 0);
_childObject = new Scene2801(_vm, this, which);
break;
- case 1:
- _vm->gameState().sceneNum = 1;
+ case 1: // radio
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 0);
if (getGlobalVar(V_RADIO_ENABLED))
_childObject = new Scene2802(_vm, this, which);
else
createStaticScene(0x000C6444, 0xC6440008);
break;
- case 2:
- _vm->gameState().sceneNum = 2;
+ case 2: // outside shrink machine
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
if (getGlobalVar(V_KLAYMEN_SMALL))
_childObject = new Scene2803Small(_vm, this, which);
else
_childObject = new Scene2803(_vm, this, which);
break;
- case 3:
- _vm->gameState().sceneNum = 3;
+ case 3: // glass cylinder with diamonds
_childObject = new Scene2804(_vm, this, which);
break;
- case 4:
- _vm->gameState().sceneNum = 4;
+ case 4: // outside the transporter
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2805(_vm, this, which);
break;
- case 5:
- _vm->gameState().sceneNum = 5;
+ case 5: // left test tube room
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2806(_vm, this, which);
break;
- case 6:
- _vm->gameState().sceneNum = 6;
+ case 6: // the three test tubes next to the window
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2807(_vm, this, which);
break;
- case 7:
- _vm->gameState().sceneNum = 7;
+ case 7: // left test tube room closeup
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2808(_vm, this, 0);
break;
- case 8:
- _vm->gameState().sceneNum = 8;
+ case 8: // right test tube room
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2809(_vm, this, which);
break;
- case 9:
- _vm->gameState().sceneNum = 9;
+ case 9: // statue room
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2810(_vm, this, which);
break;
- case 10:
- _vm->gameState().sceneNum = 10;
+ case 10: // right test tube room closeup
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2808(_vm, this, 1);
break;
- case 11:
- _vm->gameState().sceneNum = 11;
+ case 11: // disk player room (above the statue room)
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2812(_vm, this, which);
break;
case 12:
- _vm->gameState().sceneNum = 12;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x0000A245, 0x0A241008);
+ statueCloseup(0x0000A245, 0x0A241008);
break;
case 13:
- _vm->gameState().sceneNum = 13;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x81C60635, 0x60631814);
+ statueCloseup(0x81C60635, 0x60631814);
break;
case 14:
- _vm->gameState().sceneNum = 14;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0xCA811204, 0x11200CA0);
+ statueCloseup(0xCA811204, 0x11200CA0);
break;
case 15:
- _vm->gameState().sceneNum = 15;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x2D438A00, 0x38A042DC);
+ statueCloseup(0x2D438A00, 0x38A042DC);
break;
case 16:
- _vm->gameState().sceneNum = 16;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x0A806204, 0x062000A0);
+ statueCloseup(0x0A806204, 0x062000A0);
break;
case 17:
- _vm->gameState().sceneNum = 17;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x010F9284, 0xF9280018);
+ statueCloseup(0x010F9284, 0xF9280018);
break;
case 18:
- _vm->gameState().sceneNum = 18;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x0100022B, 0x0022F018);
+ statueCloseup(0x0100022B, 0x0022F018);
break;
case 19:
- _vm->gameState().sceneNum = 19;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x10866205, 0x66201100);
+ statueCloseup(0x10866205, 0x66201100);
break;
case 20:
- _vm->gameState().sceneNum = 20;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x01C58000, 0x58004014);
+ statueCloseup(0x01C58000, 0x58004014);
break;
- case 21:
- _vm->gameState().sceneNum = 21;
+ case 21: // statue with ladder down button
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
_childObject = new Scene2822(_vm, this, which);
break;
case 22:
- _vm->gameState().sceneNum = 22;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x9408121E, 0x8121A948);
+ statueCloseup(0x9408121E, 0x8121A948);
break;
case 23:
- _vm->gameState().sceneNum = 23;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x048C0600, 0xC0604040);
+ statueCloseup(0x048C0600, 0xC0604040);
break;
case 24:
- _vm->gameState().sceneNum = 24;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
- createStaticScene(0x04270A94, 0x70A9004A);
+ statueCloseup(0x04270A94, 0x70A9004A);
break;
- case 25:
- _vm->gameState().sceneNum = 25;
+ case 25: // window
_vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
if (getGlobalVar(V_SHRINK_LIGHTS_ON))
createStaticScene(0x01600204, 0x0020001E);
else
createStaticScene(0x08611204, 0x1120008E);
break;
- case 26:
- _vm->gameState().sceneNum = 26;
- _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2);
+ case 26: // disk player
+ _vm->_soundMan->stopMusic(0xD2FA4D14, 0, 2);
_childObject = new DiskplayerScene(_vm, this, 4);
break;
- case 1001:
+ case 1001: // tower rotation video
_vm->_soundMan->stopMusic(0xD2FA4D14, 0, 0);
_musicResource->stop(0);
_currentMusicFileHash = 0;
@@ -217,6 +186,8 @@ void Module2800::createScene(int sceneNum, int which) {
_childObject->handleUpdate();
}
+#undef statueCloseup
+
void Module2800::updateScene() {
if (!updateChild()) {
switch (_sceneNum) {
@@ -478,11 +449,11 @@ uint32 Scene2801::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004B6C40);
}
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
_palette->addBasePalette(0xB103B604, 0, 65, 0);
_palette->startFadeToPalette(12);
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
_palette->addBasePalette(_paletteHash, 0, 65, 0);
_palette->startFadeToPalette(12);
break;
@@ -586,7 +557,7 @@ uint32 Scene2802::handleMessage(int messageNum, const MessageParam &param, Entit
int prevTuneStatus = _currTuneStatus;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
leaveScene(0);
} else if (_currTuneStatus == 0) {
@@ -603,7 +574,7 @@ uint32 Scene2802::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x0002:
+ case NM_MOUSE_RELEASE:
if (_countdown1 == 0)
_currTuneStatus = 0;
else {
@@ -779,10 +750,10 @@ void Scene2803::upKlaymenStairs() {
uint32 Scene2803::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
toggleBackground();
// NOTE Intentional fall-through
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x84251F82)
setMessageList(0x004B7A50);
else if (param.asInteger() == 0x4254A2D2)
@@ -797,11 +768,11 @@ uint32 Scene2803::handleMessage(int messageNum, const MessageParam &param, Entit
} else if (param.asInteger() == 0x9626F390)
setMessageList(0x004B7A88);
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
klaymenStairs();
setPaletteArea1();
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
klaymenFloor();
setPaletteArea0();
break;
@@ -1015,7 +986,7 @@ Scene2803Small::Scene2803Small(NeverhoodEngine *vm, Module *parentModule, int wh
uint32 Scene2803Small::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xB4E4884C) {
setMessageList(0x004B6180);
} else if (param.asInteger() == 0xB1FDAB2E) {
@@ -1043,7 +1014,7 @@ uint32 Scene2803Small::handleMessage(int messageNum, const MessageParam &param,
setMessageList(0x004B61A8);
}
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
if (_klaymen->getX() < 200) {
setPaletteArea3();
} else if (_klaymen->getX() < 500) {
@@ -1055,7 +1026,7 @@ uint32 Scene2803Small::handleMessage(int messageNum, const MessageParam &param,
setPaletteArea2();
}
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
_sprite6->setVisible(false);
_sprite7->setVisible(false);
_klaymen->setClipRect(0, 0, 640, 480);
@@ -1206,14 +1177,14 @@ Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2804::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
leaveScene(0);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isWorking = true;
- sendMessage(_asCoil, 0x2002, 0);
+ sendMessage(_asCoil, NM_POSITION_CHANGE, 0);
if (getGlobalVar(V_SHRINK_LIGHTS_ON)) {
sendMessage(_asTarget, 0x2004, 0);
_countdown2 = 48;
@@ -1243,7 +1214,7 @@ void Scene2804::update() {
if (_countdown2 != 0 && (--_countdown2) == 0) {
_isWorking = false;
sendMessage(_asCoil, 0x2003, 0);
- sendMessage(_asTarget, 0x2005, 0);
+ sendMessage(_asTarget, NM_KLAYMEN_CLIMB_LADDER, 0);
for (uint index = 0; index < 5; index++)
_asCrystals[index]->hide();
}
@@ -1317,7 +1288,7 @@ Scene2805::Scene2805(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2805::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger()) {
setRectList(0x004AE318);
_klaymen->setKlaymenIdleTable3();
@@ -1407,12 +1378,12 @@ Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2806::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x44262B12) {
setMessageList(0x004AF0E0);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
sendMessage(_asSpew, 0x2000, 0);
break;
}
@@ -1487,7 +1458,7 @@ Scene2807::Scene2807(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2807::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
leaveScene(0);
}
@@ -1557,19 +1528,19 @@ Scene2808::Scene2808(NeverhoodEngine *vm, Module *parentModule, int which)
uint32 Scene2808::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !isAnyTestTubeFilled()) {
leaveScene(1);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (!_isFlowing)
_asTestTubes[param.asInteger()]->fill();
break;
case 0x2001:
_isFlowing = true;
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (isAnyTestTubeFilled()) {
_leaveResult = 3;
if (!isMixtureGood())
@@ -1697,12 +1668,12 @@ void Scene2809::update() {
uint32 Scene2809::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x160DA937) {
setMessageList(0x004B5B98);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
sendMessage(_asSpew, 0x2000, 0);
break;
}
@@ -1904,7 +1875,7 @@ void Scene2810::insertKlaymenLadder() {
uint32 Scene2810::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0xE574F14C)
setMessageList(0x004AE458);
else if (param.asInteger() == 0x7214A05C || param.asInteger() == 0x2905E574)
@@ -1934,7 +1905,7 @@ uint32 Scene2810::handleMessage(int messageNum, const MessageParam &param, Entit
else if (param.asInteger() == 0x2064294C || param.asInteger() == 0x2194E053)
setMessageList(0x004AE688);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
setRectList(0x004AE800);
_isRopingDown = true;
break;
@@ -2037,7 +2008,7 @@ void Scene2812::update() {
uint32 Scene2812::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x0004269B)
sendEntityMessage(_klaymen, 0x1014, _asRope);
break;
@@ -2046,12 +2017,12 @@ uint32 Scene2812::handleMessage(int messageNum, const MessageParam &param, Entit
setRectList(0x004AF710);
_klaymen->setClipRect(_sprite4->getDrawRect().x, 0, 640, _sprite4->getDrawRect().y2());
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
_isRopingDown = false;
setRectList(0x004AF700);
_klaymen->setClipRect(_sprite4->getDrawRect().x, 0, 640, _sprite3->getDrawRect().y2());
break;
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
sendMessage(_asWinch, 0x2000, 0);
sendMessage(_asTrapDoor, 0x2000, 0);
break;
@@ -2064,12 +2035,12 @@ uint32 Scene2812::handleMessage(int messageNum, const MessageParam &param, Entit
setMessageList(0x004AF668);
}
break;
- case 0x482A:
+ case NM_MOVE_TO_BACK:
setPaletteArea1(false);
_sprite1->setVisible(true);
_klaymen->setClipRect(_sprite1->getDrawRect().x, 0, _sprite1->getDrawRect().x2(), _sprite3->getDrawRect().y2());
break;
- case 0x482B:
+ case NM_MOVE_TO_FRONT:
setPaletteArea0(false);
_sprite1->setVisible(false);
_klaymen->setClipRect(_sprite4->getDrawRect().x, 0, 640, _sprite3->getDrawRect().y2());
@@ -2160,7 +2131,7 @@ void Scene2822::update() {
uint32 Scene2822::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
leaveScene(0);
} else if (param.asPoint().x >= 257 && param.asPoint().y >= 235 &&
diff --git a/engines/neverhood/modules/module2800_sprites.cpp b/engines/neverhood/modules/module2800_sprites.cpp
index a600c55dd3..35596da6b5 100644
--- a/engines/neverhood/modules/module2800_sprites.cpp
+++ b/engines/neverhood/modules/module2800_sprites.cpp
@@ -40,20 +40,20 @@ AsScene2803LightCord::AsScene2803LightCord(NeverhoodEngine *vm, Scene *parentSce
uint32 AsScene2803LightCord::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (!_isBusy && param.asInteger() == calcHash("ClickSwitch")) {
- sendMessage(_parentScene, 0x480F, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_LOWER_LEVER, 0);
playSound(0, 0x4E1CA4A0);
}
break;
- case 0x480F:
+ case NM_KLAYMEN_LOWER_LEVER:
stPulled();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -62,7 +62,7 @@ uint32 AsScene2803LightCord::handleMessage(int messageNum, const MessageParam &p
uint32 AsScene2803LightCord::hmPulled(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -107,7 +107,7 @@ AsScene2803TestTubeOne::AsScene2803TestTubeOne(NeverhoodEngine *vm, uint32 fileH
uint32 AsScene2803TestTubeOne::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (param.asInteger())
startAnimation(_fileHash2, 0, -1);
else
@@ -133,15 +133,15 @@ AsScene2803Rope::AsScene2803Rope(NeverhoodEngine *vm, Scene *parentScene, int16
uint32 AsScene2803Rope::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(0x9D098C23, 50, -1);
SetMessageHandler(&AsScene2803Rope::hmReleased);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -150,14 +150,14 @@ uint32 AsScene2803Rope::handleMessage(int messageNum, const MessageParam &param,
uint32 AsScene2803Rope::hmReleased(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -217,7 +217,7 @@ SsScene2804LightCoil::SsScene2804LightCoil(NeverhoodEngine *vm)
uint32 SsScene2804LightCoil::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2002:
+ case NM_POSITION_CHANGE:
setVisible(true);
updatePosition();
messageResult = 1;
@@ -247,7 +247,7 @@ uint32 SsScene2804LightTarget::handleMessage(int messageNum, const MessageParam
updatePosition();
messageResult = 1;
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
setVisible(false);
updatePosition();
messageResult = 1;
@@ -470,7 +470,7 @@ void AsScene2804BeamCoil::update() {
uint32 AsScene2804BeamCoil::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2002:
+ case NM_POSITION_CHANGE:
show();
_countdown = 92;
messageResult = 1;
@@ -509,7 +509,7 @@ void AsScene2804BeamCoil::stBeaming() {
uint32 AsScene2804BeamCoil::hmBeaming(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -537,7 +537,7 @@ uint32 AsScene2804BeamTarget::handleMessage(int messageNum, const MessageParam &
startAnimation(0x03842000, 0, -1);
messageResult = 1;
break;
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
setVisible(false);
stopAnimation();
messageResult = 1;
@@ -561,12 +561,12 @@ AsScene2806Spew::AsScene2806Spew(NeverhoodEngine *vm)
uint32 AsScene2806Spew::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
playSound(0, 0x48640244);
startAnimation(0x04211490, 0, -1);
setVisible(true);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -774,7 +774,7 @@ uint32 AsScene2808Handle::handleMessage(int messageNum, const MessageParam &para
uint32 AsScene2808Handle::hmActivating(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -791,7 +791,7 @@ void AsScene2808Handle::activate() {
void AsScene2808Handle::stActivated() {
stopAnimation();
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
}
AsScene2808Flow::AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int testTubeSetNum)
@@ -817,7 +817,7 @@ AsScene2808Flow::AsScene2808Flow(NeverhoodEngine *vm, Scene *parentScene, int te
uint32 AsScene2808Flow::hmFlowing(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -875,12 +875,12 @@ AsScene2809Spew::AsScene2809Spew(NeverhoodEngine *vm)
uint32 AsScene2809Spew::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
playSound(0, 0x48640244);
startAnimation(0x04211490, 0, -1);
setVisible(true);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
stopAnimation();
setVisible(false);
break;
@@ -903,14 +903,14 @@ AsScene2810Rope::AsScene2810Rope(NeverhoodEngine *vm, Scene *parentScene, int16
uint32 AsScene2810Rope::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(0x9D098C23, 35, 53);
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -934,13 +934,13 @@ AsScene2812Winch::~AsScene2812Winch() {
uint32 AsScene2812Winch::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
startAnimation(0x20DA08A0, 0, -1);
setVisible(true);
_vm->_soundMan->addSound(0x00B000E2, 0xC874EE6C);
_vm->_soundMan->playSoundLooping(0xC874EE6C);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
startAnimation(0x20DA08A0, 7, -1);
break;
}
@@ -962,15 +962,15 @@ AsScene2812Rope::AsScene2812Rope(NeverhoodEngine *vm, Scene *parentScene)
uint32 AsScene2812Rope::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x4806:
+ case NM_KLAYMEN_USE_OBJECT:
setDoDeltaX(((Sprite*)sender)->isDoDeltaX() ? 1 : 0);
stRopingDown();
break;
- case 0x482A:
- sendMessage(_parentScene, 0x1022, 990);
+ case NM_MOVE_TO_BACK:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 990);
break;
- case 0x482B:
- sendMessage(_parentScene, 0x1022, 1010);
+ case NM_MOVE_TO_FRONT:
+ sendMessage(_parentScene, NM_PRIORITY_CHANGE, 1010);
break;
}
return messageResult;
@@ -979,7 +979,7 @@ uint32 AsScene2812Rope::handleMessage(int messageNum, const MessageParam &param,
uint32 AsScene2812Rope::hmRopingDown(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
@@ -987,7 +987,7 @@ uint32 AsScene2812Rope::hmRopingDown(int messageNum, const MessageParam &param,
}
void AsScene2812Rope::stRopingDown() {
- sendMessage(_parentScene, 0x4806, 0);
+ sendMessage(_parentScene, NM_KLAYMEN_USE_OBJECT, 0);
startAnimation(0x9D098C23, 0, -1);
SetMessageHandler(&AsScene2812Rope::hmRopingDown);
}
@@ -1002,7 +1002,7 @@ AsScene2812TrapDoor::AsScene2812TrapDoor(NeverhoodEngine *vm)
uint32 AsScene2812TrapDoor::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
startAnimation(0x805D0029, 0, -1);
playSound(0, 0xEA005F40);
_newStickFrameIndex = STICK_LAST_FRAME;
@@ -1023,10 +1023,10 @@ uint32 KmScene2801::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
case 0x4817:
@@ -1039,10 +1039,10 @@ uint32 KmScene2801::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x481F:
@@ -1093,7 +1093,7 @@ uint32 KmScene2803::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4803:
@@ -1114,10 +1114,10 @@ uint32 KmScene2803::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4818:
startWalkToX(_dataResource.getPoint(param.asInteger()).x, false);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x481F:
@@ -1154,7 +1154,7 @@ uint32 KmScene2803Small::xHandleMessage(int messageNum, const MessageParam &para
case 0x4800:
startWalkToXSmall(param.asPoint().x);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stStandIdleSmall);
break;
case 0x4817:
@@ -1198,9 +1198,9 @@ uint32 KmScene2803Small::xHandleMessage(int messageNum, const MessageParam &para
uint32 KmScene2803Small::hmShrink(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
- case 0x100D:
+ case NM_ANIMATION_START:
if (param.asInteger() == 0x80C110B5)
- sendMessage(_parentScene, 0x482A, 0);
+ sendMessage(_parentScene, NM_MOVE_TO_BACK, 0);
else if (param.asInteger() == 0x33288344)
playSound(2, 0x10688664);
break;
@@ -1227,7 +1227,7 @@ KmScene2805::KmScene2805(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16
uint32 KmScene2805::xHandleMessage(int messageNum, const MessageParam &param) {
uint32 messageResult = 0;
switch (messageNum) {
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
@@ -1235,7 +1235,7 @@ uint32 KmScene2805::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
@@ -1245,11 +1245,11 @@ uint32 KmScene2805::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
@@ -1301,7 +1301,7 @@ uint32 KmScene2806::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -1310,7 +1310,7 @@ uint32 KmScene2806::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x480D:
GotoState(&Klaymen::stPullCord);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 0)
GotoState(&Klaymen::stPressButtonSide);
break;
@@ -1359,7 +1359,7 @@ uint32 KmScene2809::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
@@ -1368,7 +1368,7 @@ uint32 KmScene2809::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x480D:
GotoState(&Klaymen::stPullCord);
break;
- case 0x4816:
+ case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 0)
GotoState(&Klaymen::stPressButtonSide);
break;
@@ -1404,7 +1404,7 @@ uint32 KmScene2810Small::xHandleMessage(int messageNum, const MessageParam &para
case 0x4800:
startWalkToXSmall(param.asPoint().x);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stStandIdleSmall);
break;
case 0x4817:
@@ -1453,7 +1453,7 @@ uint32 KmScene2810::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4803:
@@ -1464,7 +1464,7 @@ uint32 KmScene2810::xHandleMessage(int messageNum, const MessageParam &param) {
if (param.asInteger() == 3)
GotoState(&Klaymen::stFinishGrow);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
GotoState(&Klaymen::stPickUpGeneric);
break;
case 0x4817:
@@ -1545,14 +1545,14 @@ uint32 KmScene2812::xHandleMessage(int messageNum, const MessageParam &param) {
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
- case 0x4004:
+ case NM_KLAYMEN_STAND_IDLE:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4805:
_destY = param.asInteger();
GotoState(&Klaymen::stJumpToGrabFall);
break;
- case 0x4812:
+ case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
@@ -1564,7 +1564,7 @@ uint32 KmScene2812::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
- case 0x481A:
+ case NM_KLAYMEN_INSERT_DISK:
GotoState(&Klaymen::stInsertDisk);
break;
case 0x481B:
@@ -1573,10 +1573,10 @@ uint32 KmScene2812::xHandleMessage(int messageNum, const MessageParam &param) {
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
- case 0x481D:
+ case NM_KLAYMEN_TURN_TO_USE:
GotoState(&Klaymen::stTurnToUse);
break;
- case 0x481E:
+ case NM_KLAYMEN_RETURN_FROM_USE:
GotoState(&Klaymen::stReturnFromUse);
break;
case 0x4820:
@@ -1594,7 +1594,7 @@ uint32 KmScene2812::xHandleMessage(int messageNum, const MessageParam &param) {
GotoState(&Klaymen::stStartClimbLadderUp);
break;
case 0x4823:
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
GotoState(&Klaymen::stClimbLadderHalf);
break;
case 0x482D:
diff --git a/engines/neverhood/modules/module2900.cpp b/engines/neverhood/modules/module2900.cpp
index bb0b69f35d..ca734972ca 100644
--- a/engines/neverhood/modules/module2900.cpp
+++ b/engines/neverhood/modules/module2900.cpp
@@ -211,11 +211,11 @@ void Scene2901::update() {
uint32 Scene2901::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene((uint32)-1);
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (_currLocationButtonNum != _selectedButtonNum)
leaveScene(_selectedButtonNum);
break;
diff --git a/engines/neverhood/modules/module3000.cpp b/engines/neverhood/modules/module3000.cpp
index a12776611e..dc6fb984ef 100644
--- a/engines/neverhood/modules/module3000.cpp
+++ b/engines/neverhood/modules/module3000.cpp
@@ -552,13 +552,13 @@ void Scene3009::update() {
uint32 Scene3009::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !getGlobalVar(V_CANNON_RAISED)) {
setGlobalVar(V_CANNON_TARGET_STATUS, 0);
leaveScene(0);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (!getGlobalVar(V_CANNON_RAISED)) {
if (!getGlobalVar(V_WALL_BROKEN)) {
_cannonTargetStatus = kCTSBreakWall;
@@ -581,7 +581,7 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam &param, Entit
case 0x2001:
_lockSymbolsPart1Countdown = 24;
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
// Raise/lower the cannon
if (!getGlobalVar(V_CANNON_TURNED) && !_isTurning) {
if (getGlobalVar(V_CANNON_RAISED)) {
@@ -731,7 +731,7 @@ void Scene3010::update() {
uint32 Scene3010::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && _countdown == 0 && !_checkUnlocked) {
if (!_boltUnlocking[0] && !_boltUnlocking[1] && !_boltUnlocking[2]) {
showMouse(false);
@@ -749,7 +749,7 @@ uint32 Scene3010::handleMessage(int messageNum, const MessageParam &param, Entit
}
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
if (!_boltUnlocked[param.asInteger()] && !_checkUnlocked && _countdown == 0) {
_asDeadBolts[param.asInteger()]->unlock(false);
_boltUnlocking[param.asInteger()] = true;
@@ -769,7 +769,7 @@ uint32 Scene3010::handleMessage(int messageNum, const MessageParam &param, Entit
_doorUnlocked = true;
}
break;
- case 0x2002:
+ case NM_POSITION_CHANGE:
if (!_checkUnlocked && _countdown == 0) {
_asDeadBolts[param.asInteger()]->lock();
}
@@ -853,12 +853,12 @@ void Scene3011::update() {
uint32 Scene3011::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
leaveScene(0);
}
break;
- case 0x2000:
+ case NM_ANIMATION_UPDATE:
_buttonClicked = true;
if (_countdown == 0)
_countdown = 1;
diff --git a/engines/neverhood/modules/module3000_sprites.cpp b/engines/neverhood/modules/module3000_sprites.cpp
index 7d0162d7d0..3c0c5fe209 100644
--- a/engines/neverhood/modules/module3000_sprites.cpp
+++ b/engines/neverhood/modules/module3000_sprites.cpp
@@ -261,7 +261,7 @@ uint32 SsScene3009SymbolArrow::handleMessage(int messageNum, const MessageParam
_countdown = 2;
loadSprite(kSsScene3009SymbolArrowFileHashes1[_index], kSLFDefDrawOffset);
playSound(0);
- sendMessage(_asSymbol, 0x2005, _incrDecr);
+ sendMessage(_asSymbol, NM_KLAYMEN_CLIMB_LADDER, _incrDecr);
}
messageResult = 1;
break;
@@ -294,7 +294,7 @@ uint32 AsScene3009VerticalIndicator::handleMessage(int messageNum, const Message
switch (messageNum) {
case 0x1011:
if (_enabled) {
- sendMessage(_parentScene, 0x2002, 0);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, 0);
}
messageResult = 1;
break;
@@ -388,7 +388,7 @@ AsScene3009Symbol::AsScene3009Symbol(NeverhoodEngine *vm, Scene3009 *parentScene
uint32 AsScene3009Symbol::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x2005:
+ case NM_KLAYMEN_CLIMB_LADDER:
if (param.asInteger()) {
if (_symbolIndex == 11)
_symbolIndex = 0;
@@ -501,7 +501,7 @@ uint32 SsScene3010DeadBoltButton::handleMessage(int messageNum, const MessagePar
_buttonLocked = true;
sendMessage(_parentScene, 0x2000, _buttonIndex);
} else {
- sendMessage(_parentScene, 0x2002, _buttonIndex);
+ sendMessage(_parentScene, NM_POSITION_CHANGE, _buttonIndex);
}
_needRefresh = true;
updatePosition();
@@ -565,7 +565,7 @@ void AsScene3010DeadBolt::update() {
uint32 AsScene3010DeadBolt::hmAnimation(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x3002:
+ case NM_ANIMATION_STOP:
gotoNextState();
break;
}
diff --git a/engines/neverhood/navigationscene.cpp b/engines/neverhood/navigationscene.cpp
index a15c00de07..adbb6aef7a 100644
--- a/engines/neverhood/navigationscene.cpp
+++ b/engines/neverhood/navigationscene.cpp
@@ -106,19 +106,19 @@ void NavigationScene::update() {
uint32 NavigationScene::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
- case 0x0000:
+ case NM_MOUSE_MOVE:
if (_interactive)
sendMessage(_mouseCursor, 0x4002, param);
break;
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (_interactive)
handleNavigation(param.asPoint());
break;
- case 0x0009:
+ case NM_KEYPRESS_SPACE:
if (!_interactive)
_smackerDone = true;
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
_smackerDone = true;
break;
}
diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp
index b961bccea7..1119bfbb08 100644
--- a/engines/neverhood/neverhood.cpp
+++ b/engines/neverhood/neverhood.cpp
@@ -45,7 +45,7 @@
namespace Neverhood {
-NeverhoodEngine::NeverhoodEngine(OSystem *syst, const NeverhoodGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
+NeverhoodEngine::NeverhoodEngine(OSystem *syst, const NeverhoodGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _console(nullptr) {
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
@@ -178,6 +178,12 @@ void NeverhoodEngine::mainLoop() {
case Common::EVENT_RBUTTONUP:
_gameModule->handleMouseUp(event.mouse.x, event.mouse.y);
break;
+ case Common::EVENT_WHEELUP:
+ _gameModule->handleWheelUp();
+ break;
+ case Common::EVENT_WHEELDOWN:
+ _gameModule->handleWheelDown();
+ break;
case Common::EVENT_QUIT:
_system->quit();
break;
@@ -191,13 +197,12 @@ void NeverhoodEngine::mainLoop() {
_gameModule->draw();
_console->onFrame();
_screen->update();
+ if (_updateSound)
+ _soundMan->update();
nextFrameTime = _screen->getNextFrameTime();
};
- if (_updateSound) {
- _soundMan->update();
- _audioResourceMan->updateMusic();
- }
+ _audioResourceMan->updateMusic();
_system->updateScreen();
_system->delayMillis(10);
diff --git a/engines/neverhood/neverhood.h b/engines/neverhood/neverhood.h
index 0561aa251e..4d923d1f0e 100644
--- a/engines/neverhood/neverhood.h
+++ b/engines/neverhood/neverhood.h
@@ -32,6 +32,8 @@
#include "common/system.h"
#include "audio/mixer.h"
#include "engines/engine.h"
+#include "gui/debugger.h"
+#include "neverhood/console.h"
#include "neverhood/messages.h"
namespace Neverhood {
@@ -48,7 +50,6 @@ class Screen;
class SoundMan;
class AudioResourceMan;
class StaticData;
-class Console;
struct NPoint;
struct GameState {
@@ -90,6 +91,7 @@ public:
GameModule *_gameModule;
StaticData *_staticData;
Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
SoundMan *_soundMan;
AudioResourceMan *_audioResourceMan;
diff --git a/engines/neverhood/palette.cpp b/engines/neverhood/palette.cpp
index 941bcc3cd3..134fec7163 100644
--- a/engines/neverhood/palette.cpp
+++ b/engines/neverhood/palette.cpp
@@ -119,7 +119,7 @@ void Palette::startFadeToBlack(int counter) {
_fadeToG = 0;
_fadeToB = 0;
_palCounter = counter;
- _fadeStep = 255 / counter;
+ _fadeStep = calculateFadeStep(counter);
_status = 1;
}
@@ -131,7 +131,7 @@ void Palette::startFadeToWhite(int counter) {
_fadeToG = 255;
_fadeToB = 255;
_palCounter = counter;
- _fadeStep = 255 / counter;
+ _fadeStep = calculateFadeStep(counter);
_status = 1;
}
@@ -140,7 +140,7 @@ void Palette::startFadeToPalette(int counter) {
if (counter == 0)
counter = 1;
_palCounter = counter;
- _fadeStep = 255 / counter;
+ _fadeStep = calculateFadeStep(counter);
_status = 2;
}
@@ -203,4 +203,11 @@ void Palette::fadeColor(byte *rgb, byte toR, byte toG, byte toB) {
#undef FADE
}
+int Palette::calculateFadeStep(int counter) {
+ int fadeStep = 255 / counter;
+ if (255 % counter)
+ fadeStep++;
+ return fadeStep;
+}
+
} // End of namespace Neverhood
diff --git a/engines/neverhood/palette.h b/engines/neverhood/palette.h
index c83207caae..016f856104 100644
--- a/engines/neverhood/palette.h
+++ b/engines/neverhood/palette.h
@@ -61,6 +61,7 @@ protected:
int _fadeStep;
void update();
void fadeColor(byte *rgb, byte toR, byte toG, byte toB);
+ int calculateFadeStep(int counter);
};
} // End of namespace Neverhood
diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp
index 9a7e87ac8d..b8cde73e81 100644
--- a/engines/neverhood/scene.cpp
+++ b/engines/neverhood/scene.cpp
@@ -283,11 +283,11 @@ void Scene::leaveScene(uint32 result) {
uint32 Scene::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
switch (messageNum) {
- case 0x0000: // mouse moved
+ case NM_MOUSE_MOVE:
if (_mouseCursor && _mouseCursor->hasMessageHandler())
sendMessage(_mouseCursor, 0x4002, param);
break;
- case 0x0001: // mouse clicked
+ case NM_MOUSE_CLICK:
_mouseClicked = true;
_mouseClickPos = param.asPoint();
break;
@@ -301,7 +301,7 @@ uint32 Scene::handleMessage(int messageNum, const MessageParam &param, Entity *s
if (_messageListIndex == _messageListCount) {
// If the current message list was processed completely,
// sent Klaymen into the idle state.
- sendMessage(_klaymen, 0x4004, 0);
+ sendMessage(_klaymen, NM_KLAYMEN_STAND_IDLE, 0);
} else {
// Else continue with the next message in the current message list
processMessageList();
@@ -314,23 +314,21 @@ uint32 Scene::handleMessage(int messageNum, const MessageParam &param, Entity *s
if (_isKlaymenBusy) {
_isKlaymenBusy = false;
_messageList = NULL;
- sendMessage(_klaymen, 0x4004, 0);
+ sendMessage(_klaymen, NM_KLAYMEN_STAND_IDLE, 0);
}
break;
- case 0x101D:
- // Hide the mouse cursor
+ case NM_MOUSE_HIDE:
if (_mouseCursor) {
_mouseCursorWasVisible = _mouseCursor->getSurface()->getVisible();
_mouseCursor->getSurface()->setVisible(false);
}
break;
- case 0x101E:
- // Show the mouse cursor
+ case NM_MOUSE_SHOW:
if (_mouseCursorWasVisible && _mouseCursor) {
_mouseCursor->getSurface()->setVisible(true);
}
break;
- case 0x1022:
+ case NM_PRIORITY_CHANGE:
// Set the sender's surface priority
setSurfacePriority(((Sprite*)sender)->getSurface(), param.asInteger());
break;
@@ -451,7 +449,7 @@ void Scene::processMessageList() {
_isKlaymenBusy = true;
sendPointMessage(_klaymen, 0x4001, _mouseClickPos);
} else if (messageNum == 0x100D) {
- if (this->hasMessageHandler() && sendMessage(this, 0x100D, messageParam) != 0)
+ if (this->hasMessageHandler() && sendMessage(this, NM_ANIMATION_START, messageParam) != 0)
continue;
} else if (messageNum == 0x101A) {
_messageListStatus = 0;
@@ -485,7 +483,7 @@ void Scene::cancelMessageList() {
_isKlaymenBusy = false;
_messageList = NULL;
_canAcceptInput = true;
- sendMessage(_klaymen, 0x4004, 0);
+ sendMessage(_klaymen, NM_KLAYMEN_STAND_IDLE, 0);
}
void Scene::setRectList(uint32 id) {
@@ -617,7 +615,7 @@ StaticScene::StaticScene(NeverhoodEngine *vm, Module *parentModule, uint32 backg
uint32 StaticScene::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0001:
+ case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
diff --git a/engines/neverhood/smackerplayer.cpp b/engines/neverhood/smackerplayer.cpp
index 187939faee..014e094b94 100644
--- a/engines/neverhood/smackerplayer.cpp
+++ b/engines/neverhood/smackerplayer.cpp
@@ -21,6 +21,7 @@
*/
#include "graphics/palette.h"
+#include "neverhood/gamemodule.h"
#include "neverhood/smackerplayer.h"
#include "neverhood/palette.h"
#include "neverhood/resourceman.h"
@@ -160,7 +161,7 @@ void SmackerPlayer::close() {
void SmackerPlayer::gotoFrame(int frameNumber) {
if (_smackerDecoder) {
_smackerDecoder->forceSeekToFrame(frameNumber);
- _smackerDecoder->decodeNextFrame();
+ updateFrame();
}
}
@@ -204,7 +205,7 @@ void SmackerPlayer::update() {
} else if (!_keepLastFrame) {
// Inform the scene about the end of the video playback
if (_scene)
- sendMessage(_scene, 0x3002, 0);
+ sendMessage(_scene, NM_ANIMATION_STOP, 0);
_videoDone = true;
} else {
rewind();
@@ -251,6 +252,15 @@ void SmackerPlayer::updatePalette() {
tempPalette[i * 4 + 1] = smackerPalette[i * 3 + 1];
tempPalette[i * 4 + 2] = smackerPalette[i * 3 + 2];
}
+
+ // WORKAROUND: Scene 3, module 3000 defines a black color 255 instead of
+ // white, which results in the mouse cursor showing black. I'm not sure if
+ // color 255 is always supposed to be white. It's not feasible to check
+ // all scenes for a glitch that only seems to manifest in one, therefore
+ // we define color 255 to be white only for that scene.
+ if (_vm->_gameModule->getCurrentModuleNum() == 3000 && _vm->_gameState.sceneNum == 3)
+ tempPalette[255 * 4 + 0] = tempPalette[255 * 4 + 1] = tempPalette[255 * 4 + 2] = 0xFF;
+
_palette->copyPalette(tempPalette, 0, 256, 0);
}
diff --git a/engines/neverhood/smackerscene.cpp b/engines/neverhood/smackerscene.cpp
index d9d032a3b5..c3915200b5 100644
--- a/engines/neverhood/smackerscene.cpp
+++ b/engines/neverhood/smackerscene.cpp
@@ -104,15 +104,15 @@ void SmackerScene::update() {
uint32 SmackerScene::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
- case 0x0009:
+ case NM_KEYPRESS_SPACE:
if ((_videoPlayedBefore && _canSkip) || (_canAbort && _canSkip))
_playNextVideoFlag = true;
break;
- case 0x000C:
+ case NM_KEYPRESS_ESC:
if (_canAbort)
sendMessage(_parentModule, 0x1009, 0);
break;
- case 0x3002:
+ case NM_ANIMATION_STOP:
_playNextVideoFlag = true;
break;
}
diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp
index 3ea45491a7..023eda4c02 100644
--- a/engines/neverhood/sound.cpp
+++ b/engines/neverhood/sound.cpp
@@ -66,6 +66,12 @@ void SoundResource::play() {
soundItem->playSound(false);
}
+void SoundResource::playLooping() {
+ AudioResourceManSoundItem *soundItem = getSoundItem();
+ if (soundItem)
+ soundItem->playSound(true);
+}
+
void SoundResource::stop() {
AudioResourceManSoundItem *soundItem = getSoundItem();
if (soundItem)
@@ -208,7 +214,7 @@ void SoundItem::setSoundParams(bool playOnceAfterRandomCountdown, int16 minCount
_minCountdown = minCountdown;
if (maxCountdown > 0)
_maxCountdown = maxCountdown;
- if (firstMinCountdown >= firstMaxCountdown)
+ if (firstMinCountdown > firstMaxCountdown)
_currCountdown = firstMinCountdown;
else if (firstMinCountdown > 0 && firstMaxCountdown > 0 && firstMinCountdown < firstMaxCountdown)
_currCountdown = _vm->_rnd->getRandomNumberRng(firstMinCountdown, firstMaxCountdown);
@@ -235,24 +241,24 @@ void SoundItem::update() {
if (_playOnceAfterCountdown) {
if (_currCountdown == 0)
_currCountdown = _initialCountdown;
- else if (--_currCountdown == 0)
+ else if (--_currCountdown <= 0)
_soundResource->play();
} else if (_playOnceAfterRandomCountdown) {
if (_currCountdown == 0) {
if (_minCountdown > 0 && _maxCountdown > 0 && _minCountdown < _maxCountdown)
_currCountdown = _vm->_rnd->getRandomNumberRng(_minCountdown, _maxCountdown);
- } else if (--_currCountdown == 0)
+ } else if (--_currCountdown <= 0)
_soundResource->play();
} else if (_playLooping && !_soundResource->isPlaying())
- _soundResource->play();
+ _soundResource->playLooping();
}
// SoundMan
SoundMan::SoundMan(NeverhoodEngine *vm)
: _vm(vm), _soundIndex1(-1), _soundIndex2(-1), _soundIndex3(-1),
- _initialCountdown(0), _playOnceAfterCountdown(false),
- _initialCountdown3(0), _playOnceAfterCountdown3(false) {
+ _initialCountdown(15), _playOnceAfterCountdown(false),
+ _initialCountdown3(9), _playOnceAfterCountdown3(false) {
}
SoundMan::~SoundMan() {
@@ -373,7 +379,6 @@ void SoundMan::update() {
if (soundItem)
soundItem->update();
}
-
for (uint i = 0; i < _musicItems.size(); ++i) {
MusicItem *musicItem = _musicItems[i];
if (musicItem)
@@ -553,15 +558,19 @@ int NeverhoodAudioStream::readBuffer(int16 *buffer, const int numSamples) {
*buffer++ = _prevValue << _shiftValue;
}
} else {
- memcpy(buffer, _buffer, bytesRead);
- buffer += bytesRead;
+ while (samplesRead--) {
+ *buffer++ = READ_LE_UINT16(src);
+ src += 2;
+ }
}
if (bytesRead < bytesToRead || _stream->pos() >= _stream->size() || _stream->err() || _stream->eos()) {
- if (_isLooping)
+ if (_isLooping) {
_stream->seek(0);
- else
+ _prevValue = 0;
+ } else {
_endOfData = true;
+ }
}
}
@@ -609,7 +618,7 @@ void AudioResourceManSoundItem::playSound(bool looping) {
if (_data) {
const byte *shiftValue = _resourceHandle.extData();
Common::MemoryReadStream *stream = new Common::MemoryReadStream(_data, _resourceHandle.size(), DisposeAfterUse::NO);
- NeverhoodAudioStream *audioStream = new NeverhoodAudioStream(22050, *shiftValue, false, DisposeAfterUse::YES, stream);
+ NeverhoodAudioStream *audioStream = new NeverhoodAudioStream(22050, *shiftValue, looping, DisposeAfterUse::YES, stream);
_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle,
audioStream, -1, VOLUME(_volume), PANNING(_panning));
debug(1, "playing sound %08X", _fileHash);
diff --git a/engines/neverhood/sound.h b/engines/neverhood/sound.h
index 548fe88501..1f80f8d6b0 100644
--- a/engines/neverhood/sound.h
+++ b/engines/neverhood/sound.h
@@ -50,6 +50,7 @@ public:
void unload();
void play(uint32 fileHash);
void play();
+ void playLooping();
void stop();
void setVolume(int16 volume);
void setPan(int16 pan);
diff --git a/engines/neverhood/sprite.cpp b/engines/neverhood/sprite.cpp
index 1a432461fb..05fc9b256f 100644
--- a/engines/neverhood/sprite.cpp
+++ b/engines/neverhood/sprite.cpp
@@ -372,7 +372,7 @@ void AnimatedSprite::updateFrameIndex() {
} else {
// Inform self about end of current animation
// The caller can then e.g. set a new animation fileHash
- sendMessage(this, 0x3002, 0);
+ sendMessage(this, NM_ANIMATION_STOP, 0);
if (_newAnimFileHash == 0)
_currFrameIndex = 0;
}
@@ -380,7 +380,7 @@ void AnimatedSprite::updateFrameIndex() {
if (_currFrameIndex > 0) {
_currFrameIndex--;
} else {
- sendMessage(this, 0x3002, 0);
+ sendMessage(this, NM_ANIMATION_STOP, 0);
if (_newAnimFileHash == 0)
_currFrameIndex = _lastFrameIndex;
}
@@ -399,7 +399,7 @@ void AnimatedSprite::updateFrameInfo() {
updateBounds();
_needRefresh = true;
if (frameInfo.frameHash != 0)
- sendMessage(this, 0x100D, frameInfo.frameHash);
+ sendMessage(this, NM_ANIMATION_START, frameInfo.frameHash);
}
void AnimatedSprite::createSurface1(uint32 fileHash, int surfacePriority) {
diff --git a/engines/parallaction/configure.engine b/engines/parallaction/configure.engine
new file mode 100644
index 0000000000..babca4579f
--- /dev/null
+++ b/engines/parallaction/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 parallaction "Parallaction" yes
diff --git a/engines/parallaction/exec.h b/engines/parallaction/exec.h
index b966d677cd..5968954ba0 100644
--- a/engines/parallaction/exec.h
+++ b/engines/parallaction/exec.h
@@ -62,7 +62,7 @@ struct ProgramContext {
AnimationPtr _anim;
ProgramPtr _program;
InstructionPtr _inst;
- uint32 _ip;
+ uint32 _ip;
uint16 _modCounter;
bool _suspend;
};
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index ea3c394684..ae32a416e3 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -415,7 +415,7 @@ class SelectCharacterInputState_NS : public MenuInputState {
#define CHAR_DONNA 1
#define CHAR_DOUGH 2
- Common::Rect _codeSelectBlocks[9];
+ Common::Rect _codeSelectBlocks[9];
Common::Rect _codeTrueBlocks[9];
Parallaction_ns *_vm;
diff --git a/engines/parallaction/input.h b/engines/parallaction/input.h
index a815469ec3..a303eb96c8 100644
--- a/engines/parallaction/input.h
+++ b/engines/parallaction/input.h
@@ -114,7 +114,7 @@ public:
void trackMouse(ZonePtr z);
void waitForButtonEvent(uint32 buttonEventMask, int32 timeout = -1);
uint32 getLastButtonEvent() { return _mouseButtons; }
- bool getLastKeyDown(uint16 &ascii);
+ bool getLastKeyDown(uint16 &ascii);
void stopHovering();
diff --git a/engines/parallaction/objects.h b/engines/parallaction/objects.h
index 81761b2c6b..89e8134431 100644
--- a/engines/parallaction/objects.h
+++ b/engines/parallaction/objects.h
@@ -147,7 +147,7 @@ typedef Common::List<CommandPtr> CommandList;
struct Answer {
Common::String _text;
uint16 _mood;
- Common::String _followingName;
+ Common::String _followingName;
CommandList _commands;
uint32 _noFlags;
@@ -188,7 +188,7 @@ struct Dialogue {
~Dialogue();
};
-#define MAX_WALKPOINT_LISTS 20
+#define MAX_WALKPOINT_LISTS 20
#define FREE_HEAR_CHANNEL -1
#define MUSIC_HEAR_CHANNEL -2
@@ -452,7 +452,7 @@ struct Program {
uint16 _numLocals;
uint32 _ip;
- uint32 _loopStart;
+ uint32 _loopStart;
InstructionList _instructions;
uint32 _status;
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 2dbb0227d6..203a0168ea 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -360,7 +360,7 @@ public:
uint32 getLocationFlags();
bool checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y);
bool checkZoneBox(ZonePtr z, uint32 type, uint x, uint y);
- bool checkZoneType(ZonePtr z, uint32 type);
+ bool checkZoneType(ZonePtr z, uint32 type);
bool checkLinkedAnimBox(ZonePtr z, uint32 type, uint x, uint y);
ZonePtr hitZone(uint32 type, uint16 x, uint16 y);
void runZone(ZonePtr z);
@@ -579,7 +579,7 @@ private:
void freeLocation(bool removeAll);
void loadProgram(AnimationPtr a, const char *filename);
void startGui(bool showSplash);
- void startIngameMenu();
+ void startIngameMenu();
void freeCharacter();
typedef void (Parallaction_br::*Callable)(void *);
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index e55df686e0..622e507aad 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -297,7 +297,7 @@ public:
virtual void parseGetData(ZonePtr z);
virtual void parseDoorData(ZonePtr z);
virtual void parseHearData(ZonePtr z);
- virtual void parseNoneData(ZonePtr z);
+ virtual void parseNoneData(ZonePtr z);
protected:
void parseAnswerCounter(Answer *answer);
virtual Answer *parseAnswer();
diff --git a/engines/parallaction/sound.h b/engines/parallaction/sound.h
index e12e50e278..e8dde78ddc 100644
--- a/engines/parallaction/sound.h
+++ b/engines/parallaction/sound.h
@@ -103,7 +103,7 @@ protected:
Audio::Mixer *_mixer;
char _musicFile[PATH_LEN];
- bool _sfxLooping;
+ bool _sfxLooping;
int _sfxVolume;
int _sfxRate;
uint _sfxChannel;
@@ -156,7 +156,7 @@ class AmigaSoundMan_ns : public SoundMan_ns {
Audio::AudioStream *_musicStream;
Audio::SoundHandle _musicHandle;
- uint32 beepSoundBufferSize;
+ uint32 beepSoundBufferSize;
int8 *beepSoundBuffer;
Channel _channels[NUM_SFX_CHANNELS];
@@ -188,7 +188,7 @@ protected:
Common::String _musicFile;
- bool _sfxLooping;
+ bool _sfxLooping;
int _sfxVolume;
int _sfxRate;
uint _sfxChannel;
diff --git a/engines/pegasus/configure.engine b/engines/pegasus/configure.engine
new file mode 100644
index 0000000000..ed7e295287
--- /dev/null
+++ b/engines/pegasus/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 pegasus "The Journeyman Project: Pegasus Prime" yes "" "" "16bit"
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
index 0b3e1ee040..0707a83e87 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
@@ -386,54 +386,72 @@ void Caldoria::startSpotOnceOnly(TimeValue startTime, TimeValue stopTime) {
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen13CarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen13CarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria14, kEast):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen14CarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen14CarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria18, kWest):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen18CarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen18CarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria23, kSouth):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen23CarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen23CarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria33, kSouth):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen33CarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen33CarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria36, kNorth):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen36CarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen36CarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria41, kNorth):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen41NorthCarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen41NorthCarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria41, kEast):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen41EastCarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen41EastCarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
case MakeRoomView(kCaldoria41, kWest):
if (!_privateFlags.getFlag(kCaldoriaPrivateSeen41WestCarFlag) && _vm->getRandomBit() == 0) {
_privateFlags.setFlag(kCaldoriaPrivateSeen41WestCarFlag, true);
Neighborhood::startSpotOnceOnly(startTime, stopTime);
+ } else {
+ showViewFrame(getViewTime(GameState.getCurrentRoom(), GameState.getCurrentDirection()));
}
break;
default:
diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp
index 775221589a..435bcd4c9e 100644
--- a/engines/pegasus/neighborhood/mars/mars.cpp
+++ b/engines/pegasus/neighborhood/mars/mars.cpp
@@ -2011,7 +2011,7 @@ void Mars::dropItemIntoRoom(Item *item, Hotspot *dropSpot) {
void Mars::robotTiredOfWaiting() {
if (GameState.getCurrentRoomAndView() == MakeRoomView(kMars48, kEast)) {
- if (_attackingItem) {
+ if (!_attackingItem) {
startExtraSequence(kMars48RobotKillsPlayer, kExtraCompletedFlag, kFilterNoInput);
loadLoopSound2("");
} else {
diff --git a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
index d62b069e46..190984f8bc 100644
--- a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
+++ b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
@@ -124,11 +124,6 @@ void Prehistoric::setUpAIRules() {
AIHasItemCondition *hasLogCondition = new AIHasItemCondition(kHistoricalLog);
AIRule *rule = new AIRule(hasLogCondition, doneAction);
g_AIArea->addAIRule(rule);
- } else {
- AIPlayMessageAction *messageAction = new AIPlayMessageAction("Images/AI/Prehistoric/XP25W", false);
- AIHasItemCondition *hasLogCondition = new AIHasItemCondition(kHistoricalLog);
- AIRule *rule = new AIRule(hasLogCondition, messageAction);
- g_AIArea->addAIRule(rule);
}
if (!_vm->isOldDemo()) {
@@ -167,6 +162,13 @@ void Prehistoric::setUpAIRules() {
rule = new AIRule(timerCondition, messageAction);
g_AIArea->addAIRule(rule);
}
+
+ if (!_vm->isDemo()) {
+ AIPlayMessageAction *messageAction = new AIPlayMessageAction("Images/AI/Prehistoric/XP25W", false);
+ AIHasItemCondition *hasLogCondition = new AIHasItemCondition(kHistoricalLog);
+ AIRule *rule = new AIRule(hasLogCondition, messageAction);
+ g_AIArea->addAIRule(rule);
+ }
}
}
@@ -202,11 +204,11 @@ TimeValue Prehistoric::getViewTime(const RoomID room, const DirectionConstant di
void Prehistoric::findSpotEntry(const RoomID room, const DirectionConstant direction, SpotFlags flags, SpotTable::Entry &entry) {
Neighborhood::findSpotEntry(room, direction, flags, entry);
+ // The original strangely disabled the loop for the two volcano spots:
+ // (kPrehistoric01, kSouth) and (kPrehistoric25, kSouth)
+ // We don't do that here.
+
switch (MakeRoomView(room, direction)) {
- case MakeRoomView(kPrehistoric01, kSouth):
- case MakeRoomView(kPrehistoric25, kSouth):
- entry.clear();
- break;
case MakeRoomView(kPrehistoric01, kEast):
if (GameState.getPrehistoricSeenFlyer1())
entry.clear();
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 3bd29ce8dd..0148470cd5 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -429,7 +429,7 @@ void PegasusEngine::removeTimeBase(TimeBase *timeBase) {
_timeBases.remove(timeBase);
}
-bool PegasusEngine::loadFromStream(Common::ReadStream *stream) {
+bool PegasusEngine::loadFromStream(Common::SeekableReadStream *stream) {
// Dispose currently running stuff
useMenu(0);
useNeighborhood(0);
@@ -520,8 +520,36 @@ bool PegasusEngine::loadFromStream(Common::ReadStream *stream) {
performJump(GameState.getCurrentNeighborhood());
// AI rules
- if (g_AIArea)
- g_AIArea->readAIRules(stream);
+ if (g_AIArea) {
+ // HACK: clone2727 accidentally changed some Prehistoric code to output some bad saves
+ // at one point. That's fixed now, but I don't want to leave the other users high
+ // and dry.
+ if (GameState.getCurrentNeighborhood() == kPrehistoricID && !isDemo()) {
+ uint32 pos = stream->pos();
+ stream->seek(0x208);
+ uint32 roomView = stream->readUint32BE();
+ stream->seek(pos);
+
+ if (roomView == 0x30019) {
+ // This is a bad save -> Let's fix the data
+ // One byte should be put at the end instead
+ uint32 size = stream->size() - pos;
+ byte *data = (byte *)malloc(size);
+ data[0] = stream->readByte();
+ data[1] = stream->readByte();
+ data[2] = stream->readByte();
+ byte wrongData = stream->readByte();
+ stream->read(data + 3, size - 4);
+ data[size - 1] = wrongData;
+ Common::MemoryReadStream tempStream(data, size, DisposeAfterUse::YES);
+ g_AIArea->readAIRules(&tempStream);
+ } else {
+ g_AIArea->readAIRules(stream);
+ }
+ } else {
+ g_AIArea->readAIRules(stream);
+ }
+ }
startNeighborhood();
diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h
index 07e6d8f761..59637e38df 100644
--- a/engines/pegasus/pegasus.h
+++ b/engines/pegasus/pegasus.h
@@ -249,7 +249,7 @@ private:
Common::List<TimeBase *> _timeBases;
// Save/Load
- bool loadFromStream(Common::ReadStream *stream);
+ bool loadFromStream(Common::SeekableReadStream *stream);
bool writeToStream(Common::WriteStream *stream, int saveType);
void loadFromContinuePoint();
void writeContinueStream(Common::WriteStream *stream);
diff --git a/engines/pegasus/timers.cpp b/engines/pegasus/timers.cpp
index 8463d866e8..5fb2551e7a 100644
--- a/engines/pegasus/timers.cpp
+++ b/engines/pegasus/timers.cpp
@@ -333,6 +333,7 @@ void TimeBaseCallBack::releaseCallBack() {
void TimeBaseCallBack::disposeCallBack() {
_timeBase = 0;
+ _trigger = kTriggerNone;
_hasBeenTriggered = false;
}
diff --git a/engines/plugins_table.h b/engines/plugins_table.h
deleted file mode 100644
index 38cd43ac74..0000000000
--- a/engines/plugins_table.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// This file is being included by "base/plugins.cpp"
-#if PLUGIN_ENABLED_STATIC(SCUMM)
-LINK_PLUGIN(SCUMM)
-#endif
-#if PLUGIN_ENABLED_STATIC(AGI)
-LINK_PLUGIN(AGI)
-#endif
-#if PLUGIN_ENABLED_STATIC(AGOS)
-LINK_PLUGIN(AGOS)
-#endif
-#if PLUGIN_ENABLED_STATIC(AVALANCHE)
-LINK_PLUGIN(AVALANCHE)
-#endif
-#if PLUGIN_ENABLED_STATIC(CGE)
-LINK_PLUGIN(CGE)
-#endif
-#if PLUGIN_ENABLED_STATIC(CINE)
-LINK_PLUGIN(CINE)
-#endif
-#if PLUGIN_ENABLED_STATIC(COMPOSER)
-LINK_PLUGIN(COMPOSER)
-#endif
-#if PLUGIN_ENABLED_STATIC(CRUISE)
-LINK_PLUGIN(CRUISE)
-#endif
-#if PLUGIN_ENABLED_STATIC(DRACI)
-LINK_PLUGIN(DRACI)
-#endif
-#if PLUGIN_ENABLED_STATIC(DRASCULA)
-LINK_PLUGIN(DRASCULA)
-#endif
-#if PLUGIN_ENABLED_STATIC(DREAMWEB)
-LINK_PLUGIN(DREAMWEB)
-#endif
-#if PLUGIN_ENABLED_STATIC(FULLPIPE)
-LINK_PLUGIN(FULLPIPE)
-#endif
-#if PLUGIN_ENABLED_STATIC(GOB)
-LINK_PLUGIN(GOB)
-#endif
-#if PLUGIN_ENABLED_STATIC(GROOVIE)
-LINK_PLUGIN(GROOVIE)
-#endif
-#if PLUGIN_ENABLED_STATIC(HOPKINS)
-LINK_PLUGIN(HOPKINS)
-#endif
-#if PLUGIN_ENABLED_STATIC(HUGO)
-LINK_PLUGIN(HUGO)
-#endif
-#if PLUGIN_ENABLED_STATIC(KYRA)
-LINK_PLUGIN(KYRA)
-#endif
-#if PLUGIN_ENABLED_STATIC(MORTEVIELLE)
-LINK_PLUGIN(MORTEVIELLE)
-#endif
-#if PLUGIN_ENABLED_STATIC(LASTEXPRESS)
-LINK_PLUGIN(LASTEXPRESS)
-#endif
-#if PLUGIN_ENABLED_STATIC(LURE)
-LINK_PLUGIN(LURE)
-#endif
-#if PLUGIN_ENABLED_STATIC(MADE)
-LINK_PLUGIN(MADE)
-#endif
-#if PLUGIN_ENABLED_STATIC(MOHAWK)
-LINK_PLUGIN(MOHAWK)
-#endif
-#if PLUGIN_ENABLED_STATIC(NEVERHOOD)
-LINK_PLUGIN(NEVERHOOD)
-#endif
-#if PLUGIN_ENABLED_STATIC(PARALLACTION)
-LINK_PLUGIN(PARALLACTION)
-#endif
-#if PLUGIN_ENABLED_STATIC(PEGASUS)
-LINK_PLUGIN(PEGASUS)
-#endif
-#if PLUGIN_ENABLED_STATIC(QUEEN)
-LINK_PLUGIN(QUEEN)
-#endif
-#if PLUGIN_ENABLED_STATIC(SAGA)
-LINK_PLUGIN(SAGA)
-#endif
-#if PLUGIN_ENABLED_STATIC(SCI)
-LINK_PLUGIN(SCI)
-#endif
-#if PLUGIN_ENABLED_STATIC(SKY)
-LINK_PLUGIN(SKY)
-#endif
-#if PLUGIN_ENABLED_STATIC(SWORD1)
-LINK_PLUGIN(SWORD1)
-#endif
-#if PLUGIN_ENABLED_STATIC(SWORD2)
-LINK_PLUGIN(SWORD2)
-#endif
-#if PLUGIN_ENABLED_STATIC(SWORD25)
-LINK_PLUGIN(SWORD25)
-#endif
-#if PLUGIN_ENABLED_STATIC(TEENAGENT)
-LINK_PLUGIN(TEENAGENT)
-#endif
-#if PLUGIN_ENABLED_STATIC(TESTBED)
-LINK_PLUGIN(TESTBED)
-#endif
-#if PLUGIN_ENABLED_STATIC(TINSEL)
-LINK_PLUGIN(TINSEL)
-#endif
-#if PLUGIN_ENABLED_STATIC(TOLTECS)
-LINK_PLUGIN(TOLTECS)
-#endif
-#if PLUGIN_ENABLED_STATIC(TONY)
-LINK_PLUGIN(TONY)
-#endif
-#if PLUGIN_ENABLED_STATIC(TOON)
-LINK_PLUGIN(TOON)
-#endif
-#if PLUGIN_ENABLED_STATIC(TSAGE)
-LINK_PLUGIN(TSAGE)
-#endif
-#if PLUGIN_ENABLED_STATIC(TOUCHE)
-LINK_PLUGIN(TOUCHE)
-#endif
-#if PLUGIN_ENABLED_STATIC(TUCKER)
-LINK_PLUGIN(TUCKER)
-#endif
-#if PLUGIN_ENABLED_STATIC(WINTERMUTE)
-LINK_PLUGIN(WINTERMUTE)
-#endif
-#if PLUGIN_ENABLED_STATIC(ZVISION)
-LINK_PLUGIN(ZVISION)
-#endif
diff --git a/engines/queen/configure.engine b/engines/queen/configure.engine
new file mode 100644
index 0000000000..c8766743f9
--- /dev/null
+++ b/engines/queen/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 queen "Flight of the Amazon Queen" yes
diff --git a/engines/saga/configure.engine b/engines/saga/configure.engine
new file mode 100644
index 0000000000..99e2ab367b
--- /dev/null
+++ b/engines/saga/configure.engine
@@ -0,0 +1,5 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine saga "SAGA" yes "ihnm saga2" "ITE"
+add_engine ihnm "IHNM" yes
+add_engine saga2 "SAGA 2 games" no
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 01cab21f5d..645e1c30d0 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -138,7 +138,7 @@ enum GameFileTypes {
enum GameFeatures {
GF_ITE_FLOPPY = 1 << 0,
#if 0
- GF_OLD_ITE_DOS = 1 << 1, // Currently unused
+ GF_OLD_ITE_DOS = 1 << 1, // Currently unused
#endif
GF_EXTRA_ITE_CREDITS = 1 << 2,
GF_8BIT_UNSIGNED_PCM = 1 << 3
diff --git a/engines/sci/configure.engine b/engines/sci/configure.engine
new file mode 100644
index 0000000000..d1c45a4654
--- /dev/null
+++ b/engines/sci/configure.engine
@@ -0,0 +1,4 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine sci "SCI" yes "sci32" "SCI 0-1.1 games"
+add_engine sci32 "SCI32 games" no
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 80d8ab8257..e7cbde6cbb 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2980,7 +2980,7 @@ void Console::printKernelCallsFound(int kernelFuncNum, bool showFoundScripts) {
Script *script;
// Create a custom segment manager here, so that the game's segment
// manager won't be affected by loading and unloading scripts here.
- SegManager *customSegMan = new SegManager(_engine->getResMan());
+ SegManager *customSegMan = new SegManager(_engine->getResMan(), _engine->getScriptPatcher());
Common::List<ResourceId>::iterator itr;
for (itr = resources.begin(); itr != resources.end(); ++itr) {
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index 5ad49acf5c..85d01ca380 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -50,7 +50,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "f3d1be7752d30ba60614533d531e2e98", 474},
{"resource.001", 0, "6fd05926c2199af0af6f72f90d0d7260", 126895},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.005.000"
@@ -62,7 +62,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "d226d7d3b4f77c4a566913fc310487fc", 792380},
{"resource.003", 0, "d226d7d3b4f77c4a566913fc310487fc", 464348},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - German Amiga (from www.back2roots.org, also includes English language)
// Executable scanning reports "1.005.001"
@@ -74,7 +74,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "85e51acb5f9c539d66e3c8fe40e17da5", 826309},
{"resource.003", 0, "85e51acb5f9c539d66e3c8fe40e17da5", 493638},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain Macintosh (from omer_mor, bug report #3328251)
{"castlebrain", "", {
@@ -84,7 +84,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "e1a6b6f1060f60be9dcb6d28ad7a2a20", 1168310},
{"resource.003", 0, "6c3d1bb26ad532c94046bc9ac49b5ff4", 891295},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS Non-Interactive Demo
// SCI interpreter version 1.000.005
@@ -93,7 +93,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "9780f040d58182994e22d2e34fab85b0", 67367},
{"resource.001", 0, "2af49dbd8f2e1db4ab09f9310dc91259", 570553},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS 5.25" Floppy EGA (from omer_mor, bug report #3035349)
{"castlebrain", "EGA", {
@@ -106,7 +106,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "8a5ed3ba96e2eaf18e36fedfaab89419", 297838},
{"resource.006", 0, "dceed92e709cad1bd9582809a235b0a0", 266682},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS 3.5" Floppy EGA (from nozomi77, bug report #3405307)
{"castlebrain", "EGA", {
@@ -116,7 +116,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "de2f182529efaad2c4b510b452ab77ac", 633662},
{"resource.003", 0, "38b4b37febc6b4f5061c461a283df148", 430388},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS Floppy (from jvprat)
// Executable scanning reports "1.000.044", Floppy label reports "1.0, 10.30.91", VERSION file reports "1.000"
@@ -127,7 +127,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "d2f5a1be74ed963fa849a76892be5290", 794832},
{"resource.002", 0, "c0c29c51af66d65cb53f49e785a2d978", 1280907},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS 5.25" Floppy VGA 1.1 (from rnjacobs, bug report #3578286)
{"castlebrain", "", {
@@ -137,7 +137,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "583d348c908f89f94f8551d7fe0a2eca", 991752},
{"resource.003", 0, "6c3d1bb26ad532c94046bc9ac49b5ff4", 728315},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS Floppy 1.1
{"castlebrain", "", {
@@ -146,7 +146,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "13e81e1839cd7b216d2bb5615c1ca160", 796776},
{"resource.002", 0, "930e416bec196b9703a331d81b3d66f2", 1283812},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - English DOS Floppy 1.000
// Reported by graxer in bug report #3037942
@@ -161,7 +161,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "1d778a0c65cac9ddbab65495e50a94ee", 335281},
{"resource.007", 0, "063bb8ce4157c778cf30d1c912c006f1", 335631},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Castle of Dr. Brain - Spanish DOS (also includes english language)
// SCI interpreter version 1.000.510
@@ -170,7 +170,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 1197694},
{"resource.001", 0, "735be4e58957180cfc807d5e18fdffcd", 1433302},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Inside the Chest / Behind the Developer's Shield
@@ -179,7 +179,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "9dd015e79cac4f91e7de805448f39775", 1912},
{"resource.000", 0, "e4efcd042f86679dd4e1834bb3a38edb", 3770943},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) },
#endif
// Christmas Card 1988 - English DOS
@@ -188,7 +188,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "39485580d34a72997f3d5b3aba4d24f1", 426},
{"resource.001", 0, "11391434f41c834090d7a1e9488ce936", 129739},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Christmas Card 1990: The Seasoned Professional - English DOS (16 Colors)
// SCI interpreter version 1.000.172
@@ -196,7 +196,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8f656714a05b94423ac6eb10ee8797d0", 600},
{"resource.001", 0, "acde93e58fca4f7a2a5a220558a94aa8", 272629},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Christmas Card 1990: The Seasoned Professional - English DOS (256 Colors)
// SCI interpreter version 1.000.174
@@ -204,7 +204,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "44b8f45b841b9b5e17e939a35e443988", 600},
{"resource.001", 0, "acde93e58fca4f7a2a5a220558a94aa8", 335362},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Christmas Card 1992 - English DOS
// SCI interpreter version 1.001.055
@@ -212,7 +212,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "f1f8c8a8443f523422af70b4ec85b71c", 318},
{"resource.000", 0, "62fb9256f8e7e6e65a6875efdb7939ac", 203396},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Codename: Iceman - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.002.031"
@@ -226,7 +226,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "8613c45fc771d658e5a505b9a4a54f31", 713382},
{"resource.005", 0, "605b67a9ef199a9bb015745e7c004cf4", 478384},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Codename: Iceman - English DOS Non-Interactive Demo
// Executable scanning reports "0.000.685"
@@ -234,7 +234,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "782974f29d8a824782d2d4aea39964e3", 1056},
{"resource.001", 0, "d4b75e280d1c3a97cfef1b0bebff387c", 573647},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Codename: Iceman - English DOS (from jvprat)
// Executable scanning reports "0.000.685", Floppy label reports "1.033, 6.8.90", VERSION file reports "1.033"
@@ -247,7 +247,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "d97a96f1ab91b41cf46a02cc89b0a04e", 624303},
{"resource.004", 0, "8613c45fc771d658e5a505b9a4a54f31", 670883},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Codename: Iceman - English DOS (from FRG)
// SCI interpreter version 0.000.668
@@ -259,7 +259,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "dc7c5280e7acfaffe6ef2a6c963c5f94", 622118},
{"resource.004", 0, "64f342463f6f35ba71b3509ef696ae3f", 669188},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Codename: Iceman - English DOS (supplied by ssburnout in bug report #3049193)
// 1.022 9x5.25" (label: Int#0.000.668)
@@ -274,7 +274,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "08050329aa113a9f14ed99cbfe3536ec", 232942},
{"resource.007", 0, "64f342463f6f35ba71b3509ef696ae3f", 267811},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Codename: Iceman - English DOS 1.023 (from abevi, bug report #2612718)
{"iceman", "", {
@@ -288,7 +288,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "08050329aa113a9f14ed99cbfe3536ec", 232942},
{"resource.007", 0, "64f342463f6f35ba71b3509ef696ae3f", 267702},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of Camelot - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.002.030"
@@ -303,7 +303,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "c6e551bdc24f0acc193159038d4ca767", 605882},
{"resource.006", 0, "8f880a536908ab496bbc552f7f5c3738", 585255},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of Camelot - English DOS Non-Interactive Demo
// SCI interpreter version 0.000.668
@@ -311,7 +311,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "f4cd75c15be75e04cdca3acda2c0b0ea", 468},
{"resource.001", 0, "4930708722f34bfbaa4945fb08f55f61", 232523},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of Camelot - English DOS (from jvprat)
// Executable scanning reports "0.000.685", Floppy label reports "1.001, 0.000.685", VERSION file reports "1.001.000"
@@ -323,7 +323,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "8e1a3a8c588007404b532b8dfacc1460", 723712},
{"resource.004", 0, "8e1a3a8c588007404b532b8dfacc1460", 729143},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of Camelot - English DOS
// SCI interpreter version 0.000.685
@@ -337,7 +337,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "8e1a3a8c588007404b532b8dfacc1460", 332446},
{"resource.007", 0, "8e1a3a8c588007404b532b8dfacc1460", 358182},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.005.001"
@@ -352,7 +352,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "1c3804e56b114028c5873a35c2f06d13", 653002},
{"resource.006", 0, "f9487732289a4f4966b4e34eea413325", 842817},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow - English DOS
// SCI interpreter version 1.000.510
@@ -366,7 +366,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "d036df0872f2db19bca34601276be2d7", 1154950},
{"resource.006", 0, "b367a6a59f29ee30dde1d88a5a41152d", 1042966},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow - English DOS Floppy (from jvprat)
// Executable scanning reports "1.000.168", Floppy label reports "1.1, 1.13.92", VERSION file reports "1.1"
@@ -380,7 +380,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1261462},
{"resource.005", 0, "21ebe6b39b57a73fc449f67f013765aa", 1284720},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow - English DOS
// SCI interpreter version 1.000.510
@@ -393,30 +393,32 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "9cfce07e204a329e94fda8b5657621da", 1260237},
{"resource.005", 0, "21ebe6b39b57a73fc449f67f013765aa", 1284609},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow EGA - English DOS
// SCI interpreter version 1.000.510
{"longbow", "EGA", {
- {"resource.map", 0, "7676ec9f08967d7a9a7724f5170456e0", 6261},
- {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 718161},
- {"resource.001", 0, "3c3735caa34fa3f261a9552831bb43ed", 705680},
- {"resource.002", 0, "7025b87e735b1df3f0e9488a621f4333", 700633},
- {"resource.003", 0, "eaca7933e8e56bea22b42f7fd5d7a8a7", 686510},
- {"resource.004", 0, "b7bb35c027bb424ecefcd122768e5e60", 705631},
- {"resource.005", 0, "58942b1aa6d6ffeb66e9f8897fd4435f", 469243},
- {"resource.006", 0, "8c767b3939add63d11274065e46aad04", 713158},
- AD_LISTEND}, Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ {"resource.map", 0, "7676ec9f08967d7a9a7724f5170456e0", 6261},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 718161},
+ {"resource.001", 0, "3c3735caa34fa3f261a9552831bb43ed", 705680},
+ {"resource.002", 0, "7025b87e735b1df3f0e9488a621f4333", 700633},
+ {"resource.003", 0, "eaca7933e8e56bea22b42f7fd5d7a8a7", 686510},
+ {"resource.004", 0, "b7bb35c027bb424ecefcd122768e5e60", 705631},
+ {"resource.005", 0, "58942b1aa6d6ffeb66e9f8897fd4435f", 469243},
+ {"resource.006", 0, "8c767b3939add63d11274065e46aad04", 713158},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow DOS 1.0 EGA (4 x 5.25" disks)
// Provided by ssburnout in bug report #3046802
{"longbow", "EGA", {
- {"resource.map", 0, "0517ca368ec844df0cb21a05020fae01", 6021},
- {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 934643},
- {"resource.001", 0, "76c729e563809170e6cc8b2f3f6cf0a4", 1196133},
- {"resource.002", 0, "8c767b3939add63d11274065e46aad04", 1152478},
- {"resource.003", 0, "7025b87e735b1df3f0e9488a621f4333", 1171439},
- AD_LISTEND}, Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ {"resource.map", 0, "0517ca368ec844df0cb21a05020fae01", 6021},
+ {"resource.000", 0, "36e8fda5d0b8c49e587c8a9617959f72", 934643},
+ {"resource.001", 0, "76c729e563809170e6cc8b2f3f6cf0a4", 1196133},
+ {"resource.002", 0, "8c767b3939add63d11274065e46aad04", 1152478},
+ {"resource.003", 0, "7025b87e735b1df3f0e9488a621f4333", 1171439},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow - English DOS Non-Interactive Demo
// SCI interpreter version 1.000.510
@@ -424,7 +426,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "cbc5cb73341de1bff1b1e20a640af220", 588},
{"resource.001", 0, "f05a20cc07eee85da8e999d0ac0f596b", 869916},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Conquests of the Longbow - German DOS (suplied by markcoolio in bug report #2727681, also includes english language)
// SCI interpreter version 1.000.510
@@ -438,7 +440,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "d036df0872f2db19bca34601276be2d7", 1176914},
{"resource.006", 0, "b367a6a59f29ee30dde1d88a5a41152d", 1123585},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - English DOS Non-Interactive Demo (from FRG)
// Executable scanning reports "x.yyy.zzz"
@@ -447,7 +449,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "c819e171359b7c95f4c13b846d5c034e", 873},
{"resource.001", 0, "baf9393a9bfa73098adb501e5bc5487b", 657518},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - English DOS CD 1.1
// SCI interpreter version 1.001.064
@@ -455,7 +457,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a4b73d5d2b55bdb6e44345e99c8fbdd0", 4804},
{"resource.000", 0, "d908dbef56816ac6c60dd145fdeafb2b", 3536046},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - English DOS CD 1.1
// SCI interpreter version 1.001.064
@@ -465,7 +467,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a4b73d5d2b55bdb6e44345e99c8fbdd0", 4804},
{"resource.000", 0, "d908dbef56816ac6c60dd145fdeafb2b", 3536046},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - English DOS Floppy
// SCI interpreter version 1.000.510
@@ -476,7 +478,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "28fe9b4f0567e71feb198bc9f3a2c605", 1241816},
{"resource.003", 0, "f3146df0ad4297f5ce35aa8c4753bf6c", 586832},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - English DOS Floppy
// SCI interpreter version 1.000.510
@@ -487,7 +489,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "323b3b12f43d53f27d259beb225f0aa7", 1129316},
{"resource.003", 0, "83ac03e4bddb2c1ac2d36d2a587d0536", 1145616},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - German DOS Floppy (supplied by markcoolio in bug report #2723744, also includes english language)
// SCI interpreter version 1.000.510
@@ -498,7 +500,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "02d7d0411f7903aacb3bc8b0f8ca8a9a", 1202581},
{"resource.003", 0, "84dd11b6825255671c703aee5ceff620", 1175835},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - Spanish DOS Floppy (from jvprat, also includes english language)
// Executable scanning reports "1.ECO.013", VERSION file reports "1.000, 11.12.92"
@@ -510,7 +512,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "2d21a1d2dcbffa551552e3e0725d2284", 1186033},
{"resource.003", 0, "84dd11b6825255671c703aee5ceff620", 1174993},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest - French DOS Floppy (from Strangerke, also includes english language)
// SCI interpreter version 1.ECO.013
@@ -521,7 +523,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "b836c6ee9de67d814ac5d1b05f5b9858", 1173872},
{"resource.003", 0, "f8f767f9d6351432621c6e54c1b2ba8c", 1141520},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest 2 - English DOS Non-Interactive Demo
// SCI interpreter version 1.001.055
@@ -529,7 +531,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "607cfa0d8a03b7d348c06ee727e3d939", 1321},
{"resource.000", 0, "dd6f614c43c029f063e93cd243af90a4", 525992},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest 2 - English DOS Floppy (supplied by markcoolio in bug report #2723761)
// SCI interpreter version 1.001.065
@@ -537,7 +539,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "28fb7b6abb9fc1cb8882d7c2e701b63f", 5658},
{"resource.000", 0, "cc1d17e5637528dbe4a812699e1cbfc6", 4208192},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest 2 - French DOS Floppy (from Strangerke)
// SCI interpreter version 1.001.081
@@ -545,7 +547,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "c22ab8b33c339c138b6b1697b77b9e79", 5588},
{"resource.000", 0, "1c4093f7248240329121fdf8c0d59152", 4231946},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest 2 - Spanish DOS Floppy (supplied by umbrio in bug report #3313962)
{"ecoquest2", "Floppy", {
@@ -553,7 +555,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "1c4093f7248240329121fdf8c0d59152", 4209150},
{"resource.msg", 0, "eff8be1925d42288de55e405983e9314", 117810},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Eco Quest 2 - German DOS Floppy (supplied by frankenbuam in bug report #3615072)
{"ecoquest2", "Floppy", {
@@ -569,7 +571,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "97aa9fcfe84c9993a64debd28c32393a", 1909},
{"resource.000", 0, "5ea8e7a3ea10cce6efd5c106dc62fd8c", 867724},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - English CD DOS (from FRG)
// SCI interpreter version 1.001.132
@@ -577,7 +579,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "d46b282f228a67ba13bd4b4009e95f8f", 6058},
{"resource.000", 0, "ee3c64ffff0ba9fb08bea2624631c598", 5490246},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - English DOS Floppy (updated information from markcoolio in bug reports #2723773 and #2724720)
// Executable scanning reports "1.cfs.081"
@@ -587,7 +589,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
{"resource.msg", 0, "554f65315d851184f6e38211489fdd8f", -1},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - French DOS Floppy (supplied by misterhands in bug report #3589449)
// Executable scanning reports "1.cfs.081"
@@ -596,7 +598,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 5233230},
{"resource.msg", 0, "4dc478f5c73b57e5d690bdfffdcf1c44", 816518},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - Windows (supplied by abevi in bug report #2612718)
// Executable scanning reports "1.cfs.081"
@@ -605,7 +607,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a32674e7fbf7b213b4a066c8037f16b6", 5816},
{"resource.000", 0, "fed4808fdb72486908ac7ad0044b14d8", 5233230},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - German DOS Floppy (from Tobis87, updated information from markcoolio in bug reports #2723772 and #2724720)
// Executable scanning reports "1.cfs.081"
@@ -615,7 +617,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
{"resource.msg", 0, "304b5a5781800affd2235152a5794fa8", -1},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - Spanish DOS (from jvprat)
// Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
@@ -628,7 +630,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "05acdc256c742e79c50b9fe7ec2cc898", 863310},
{"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - Spanish DOS (from jvprat)
// Executable scanning reports "1.cfs.081", VERSION file reports "1.000, March 30, 1995"
@@ -638,7 +640,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "96b07e9b914dba1c8dc6c78a176326df", 5233230},
{"resource.msg", 0, "45b5bf74933ac3727e4cc844446dc052", 796156},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - English DOS CD Demo
// SCI interpreter version 1.001.095
@@ -646,14 +648,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a62a7eae85dd1e6b07f39662b278437e", 1918},
{"resource.000", 0, "4962a3c4dd44e36e78ea4a7a374c2220", 957382},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Freddy Pharkas - English Macintosh
{"freddypharkas", "", {
{"Data1", 0, "ef7cbd62727989818f1cfae69c9fd61d", 3038492},
{"Data2", 0, "2424b418f7d52c385cea4701f529c69a", 4721732},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Fun Seeker's Guide - English DOS
// SCI interpreter version 0.000.506
@@ -661,7 +663,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7ee6859ef74314f6d91938c3595348a9", 282},
{"resource.001", 0, "f1e680095424e31f7fae1255d36bacba", 40692},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English DOS CD Demo
// SCI interpreter version 1.001.092
@@ -669,7 +671,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "39645952ae0ed8072c7e838f31b75464", 2490},
{"resource.000", 0, "eb3ed7477ca4110813fe1fcf35928561", 1718450},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English DOS CD Demo (from DrMcCoy)
// SCI interpreter version 1.001.092
@@ -677,7 +679,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8cad2a256f41463030cbb7ea1bfb2857", 2490},
{"resource.000", 0, "eb3ed7477ca4110813fe1fcf35928561", 1718450},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Gabriel Knight - English DOS Floppy
@@ -686,7 +688,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10783},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English DOS Floppy (supplied my markcoolio in bug report #2723777)
// SCI interpreter version 2.000.000
@@ -694,7 +696,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "65e8c14092e4c9b3b3538b7602c8c5ec", 10783},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English DOS Floppy
// SCI interpreter version 2.000.000, VERSION file reports "1.0\nGabriel Knight\n11/22/10:33 pm\n\x1A"
@@ -702,7 +704,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ef41df08cf2c1f680216cdbeed0f8311", 10783},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 13022630},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - German DOS Floppy (supplied my markcoolio in bug report #2723775)
// SCI interpreter version 2.000.000
@@ -710,7 +712,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ad6508b0296b25c07b1f58828dc33696", 10789},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13077029},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - French DOS Floppy (supplied my kervala in bug report #3611487)
// SCI interpreter version 2.000.000
@@ -718,7 +720,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "236e36cc847cdeafdd5e5fa8cba916ed", 10801},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13033072},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English DOS CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "01.100.000"
@@ -726,7 +728,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English Windows CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "01.100.000"
@@ -734,7 +736,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "372d059f75856afa6d73dd84cbb8913d", 10996},
{"resource.000", 0, "69b7516962510f780d38519cc15fcc7c", 12581736},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - German DOS CD (from Tobis87)
// SCI interpreter version 2.000.000
@@ -742,7 +744,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - Spanish DOS CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995"
@@ -750,7 +752,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - French DOS CD (from Hkz)
// VERSION file reports "1.000.000, May 3, 1994"
@@ -758,7 +760,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "55f909ba93a2515042a08d8a2da8414e", 11392},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13325145},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - German Windows CD (from Tobis87)
// SCI interpreter version 2.000.000
@@ -766,7 +768,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a7d3e55114c65647310373cb390815ba", 11392},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13400497},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - Spanish Windows CD (from jvprat)
// Executable scanning reports "2.000.000", VERSION file reports "1.000.000, April 13, 1995"
@@ -774,7 +776,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7cb6e9bba15b544ec7a635c45bde9953", 11404},
{"resource.000", 0, "091cf08910780feabc56f8551b09cb36", 13381599},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformWindows, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight - English Macintosh
{"gk1", "", {
@@ -783,7 +785,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data3", 0, "f25068b408b09275d8b698866462f578", 3677599},
{"Data4", 0, "1cceebbe411b26c860a74f91c337fdf3", 3230086},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight 2 - English Windows Non-Interactive Demo
// Executable scanning reports "2.100.002"
@@ -791,7 +793,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "e0effce11c4908f4b91838741716c83d", 1351},
{"resource.000", 0, "d04cfc7f04b6f74d13025378be49ec2b", 4640330},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight 2 - English DOS (GOG version) - ressci.* merged in ressci.000
// using Enrico Rolfi's HD/DVD installer: http://gkpatches.vogons.zetafleet.com/
@@ -799,7 +801,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "b996fa1e57389a1e179a00a0049de1f4", 8110},
{"ressci.000", 0, "a19fc3604c6e5407abcf03d59ee87217", 168522221},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight 2 - English DOS (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.1"
@@ -817,7 +819,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.006", 0, "ce9359037277b7d7976da185c2fa0aad", 2977},
{"ressci.006", 0, "8e44e03890205a7be12f45aaba9644b4", 60659424},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight 2 - French DOS (6-CDs Sierra Originals reedition)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -835,7 +837,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.006", 0, "11b2e722170b8c93fdaa5428e2c7676f", 3001},
{"ressci.006", 0, "4037d941aec39d2e654e20960429aefc", 60568486},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Gabriel Knight 2 - English Macintosh
// NOTE: This only contains disc 1 files (as well as the persistent file:
@@ -847,7 +849,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data4", 0, "8b843c62eb53136a855d6e0087e3cb0d", 5889553},
{"Data5", 0, "f9fcf9ab2eb13b2125c33a1cda03a093", 14349984},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI32
@@ -859,7 +861,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 342149},
{"resource.003", 0, "e0dd44069a62a463fd124974b915f10d", 328925},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 1 - English DOS (supplied by wibble92 in bug report #2644547)
// SCI interpreter version 0.000.530
@@ -869,7 +871,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 342309},
{"resource.003", 0, "e0dd44069a62a463fd124974b915f10d", 328912},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 1 - English DOS (supplied by merkur in bug report #2719227)
// SCI interpreter version 0.000.530
@@ -877,14 +879,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "1034a218943d12f1f36e753fa10c95b8", 4386},
{"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 518308},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 1 3.5' - English DOS (supplied by eddydrama in bug report #3052366 and dinnerx in bug report #3090841)
{"hoyle1", "", {
{"resource.map", 0, "0af9a3dcd72a091960de070432e1f524", 4386},
{"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 518127},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#if 0 // TODO: unknown if these files are corrupt
// Hoyle 1 - English Amiga (from www.back2roots.org)
@@ -894,7 +896,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "e0dd44069a62a463fd124974b915f10d", 218755},
{"resource.002", 0, "e0dd44069a62a463fd124974b915f10d", 439502},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif
// Hoyle 2 - English DOS
@@ -904,7 +906,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 98138},
{"resource.002", 0, "8f2dd70abe01112eca464cda818b5eb6", 196631},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 2 - English DOS (supplied by ssburnout in bug report #3049193)
// 1.000.011 1x3.5" (label:Int#6.21.90)
@@ -912,7 +914,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "db0ba08b953e9904a4960ad99cd29c20", 1356},
{"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 216315},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 2 - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.002.032"
@@ -921,7 +923,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "62ed48d20c580e5a98f102f7cd93706a", 1356},
{"resource.001", 0, "8f2dd70abe01112eca464cda818b5eb6", 222704},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 2 - English Macintosh
// Executable scanning reports "x.yyy.zzz"
@@ -929,7 +931,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "1af1d3aa3cf564f93477c9f87e53f495", 1728},
{"resource.001", 0, "b73b8131669d69d41a326415e4519138", 482882},
{NULL, 0, NULL, 0}},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#if 0 // TODO: unknown if these files are corrupt
// Hoyle 3 - English Amiga (from www.back2roots.org)
@@ -940,7 +942,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "595b6039ea1356e7f96a52c58eedcf22", 355791},
{"resource.001", 0, "143df8aef214a2db34c2d48190742012", 632273},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif
// Hoyle 3 - English DOS Non-Interactive Demo
@@ -950,7 +952,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "0d06cacc87dc21a08cd017e73036f905", 735},
{"resource.001", 0, "24db2bccda0a3c43ac4a7b5edb116c7e", 797678},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 3 - English DOS Floppy (from jvprat)
// Executable scanning reports "x.yyy.zzz", Floppy label reports "1.0, 11.2.91", VERSION file reports "1.000"
@@ -960,7 +962,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "6ef28cac094dcd97fdb461662ead6f92", 541845},
{"resource.001", 0, "0a98a268ee99b92c233a0d7187c1f0fa", 845795},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 3 - English DOS Floppy (supplied by eddydrama in bug report #3038837)
{"hoyle3", "", {
@@ -971,7 +973,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "97cfd72633f8f9b2a0b1d4116cf3ee81", 346116},
{"resource.004", 0, "2884fb91b225fabd9ca87ea231293b48", 351218},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 3 EGA - English DOS Floppy 1.0 (supplied by abevi in bug report #2612718)
{"hoyle3", "EGA", {
@@ -979,14 +981,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "6ef28cac094dcd97fdb461662ead6f92", 319905},
{"resource.001", 0, "0a98a268ee99b92c233a0d7187c1f0fa", 526438},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 4 (Hoyle Classic Card Games) - English DOS Demo
{"hoyle4", "Demo", {
{"resource.map", 0, "60f764020a6b788bbbe415dbc2ccb9f3", 931},
{"resource.000", 0, "5fe3670e3ddcd4f85c10013b5453141a", 615522},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 4 (Hoyle Classic Card Games) - English DOS Demo
// SCI interpreter version 1.001.200 (just a guess)
@@ -995,7 +997,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "662087cb383e52e3cc4ae7ecb10e20aa", 938},
{"resource.000", 0, "24c10844792c54d476d272213cbac300", 675252},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 4 (Hoyle Classic Card Games) - English DOS/Win
// Supplied by abevi in bug report #3039291
@@ -1003,7 +1005,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "2b577c975cc8d8d43f61b6a756129fe3", 4352},
{"resource.000", 0, "43e2c15ce436aab611a462ad0603e12d", 2000132},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Hoyle 4 (Hoyle Classic Card Games) - English Macintosh Floppy
// VERSION file reports "2.0"
@@ -1011,7 +1013,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data1", 0, "99575fae4579540a314bbedd72d51e8c", 7682887},
{"Data2", 0, "7d4bf5bdf3c02edbf35cb8471c84ec13", 1539134},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Jones in the Fast Lane EGA - English DOS
// SCI interpreter version 1.000.172 (not 100% sure FIXME)
@@ -1020,14 +1022,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "bac3ec6cb3e3920984ab0f32becf5163", 202105},
{"resource.002", 0, "b86daa3ba2784d1502da881eedb80d9b", 341771},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Jones in the Fast Lane EGA - English DOS (supplied by EddyDrama in bug report #3038761)
{"jones", "EGA", {
{"resource.map", 0, "8e92cf319180cc8b5b87b2ce93a4fe22", 1602},
{"resource.001", 0, "bac3ec6cb3e3920984ab0f32becf5163", 511528},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Jones in the Fast Lane VGA - English DOS
// SCI interpreter version 1.000.172
@@ -1036,7 +1038,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "bac3ec6cb3e3920984ab0f32becf5163", 313476},
{"resource.002", 0, "b86daa3ba2784d1502da881eedb80d9b", 719747},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Jones in the Fast Lane VGA - English DOS (supplied by omer_mor in bug report #3037054)
// VERSION file reports "1.000.060"
@@ -1044,14 +1046,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "db175ab494ab0666f19ab8f2597a8e49", 1602},
{"resource.001", 0, "bac3ec6cb3e3920984ab0f32becf5163", 994487},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Jones in the Fast Lane - English DOS CD
{"jones", "CD", {
{"resource.map", 0, "459f5b04467bc2107aec02f5c4b71b37", 4878},
{"resource.001", 0, "3876da2ce16fb7dea2f5d943d946fa84", 1652150},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO1(GAMEOPTION_JONES_CDAUDIO) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO1(GAMEOPTION_JONES_CDAUDIO) },
// Jones in the Fast Lane - English DOS CD
// Same entry as the DOS version above. This one is used for the alternate
@@ -1060,7 +1062,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "459f5b04467bc2107aec02f5c4b71b37", 4878},
{"resource.001", 0, "3876da2ce16fb7dea2f5d943d946fa84", 1652150},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI, GAMEOPTION_JONES_CDAUDIO) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI, GAMEOPTION_JONES_CDAUDIO) },
// Jones in the Fast Lane - English DOS US CD (alternate version)
// Supplied by collector9 in bug #3614668
@@ -1068,7 +1070,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "4344ff3f796707843b992adec2c87663", 4878},
{"resource.001", 0, "3876da2ce16fb7dea2f5d943d946fa84", 1652062},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO1(GAMEOPTION_JONES_CDAUDIO) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO1(GAMEOPTION_JONES_CDAUDIO) },
// Jones in the Fast Lane - English DOS US CD (alternate version)
// Same entry as the DOS version above. This one is used for the alternate
@@ -1077,7 +1079,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "4344ff3f796707843b992adec2c87663", 4878},
{"resource.001", 0, "3876da2ce16fb7dea2f5d943d946fa84", 1652062},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI, GAMEOPTION_JONES_CDAUDIO) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI, GAMEOPTION_JONES_CDAUDIO) },
// King's Quest 1 SCI Remake - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.003.007"
@@ -1089,7 +1091,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "9ae2a13708d691cd42f9129173c4b39d", 763224},
{"resource.004", 0, "9ae2a13708d691cd42f9129173c4b39d", 820443},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 1 SCI Remake - English DOS Non-Interactive Demo
// Executable scanning reports "S.old.010"
@@ -1097,7 +1099,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "59b13619078bd47011421468959ee5d4", 954},
{"resource.001", 0, "4cfb9040db152868f7cb6a1e8151c910", 296555},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 1 SCI Remake - English DOS (from the King's Quest Collection)
// Executable scanning reports "S.old.010", VERSION file reports "1.000.051"
@@ -1108,7 +1110,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "fed9e0072ffd511d248674e60dee2099", 714062},
{"resource.003", 0, "fed9e0072ffd511d248674e60dee2099", 717478},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 1 SCI Remake - English DOS (supplied by ssburnout in bug report #3049193)
// 1.000.051 9x5.25" (label: INT#9.19.90)
@@ -1122,7 +1124,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "fed9e0072ffd511d248674e60dee2099", 351062},
{"resource.007", 0, "fed9e0072ffd511d248674e60dee2099", 330472},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.002.032"
@@ -1135,7 +1137,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "fd16c9c223f7dc5b65f06447615224ff", 683016},
{"resource.004", 0, "3fac034c7d130e055d05bc43a1f8d5f8", 549993},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English DOS Non-Interactive Demo
// Executable scanning reports "0.000.494"
@@ -1143,7 +1145,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "992ac7cc31d3717fe53818a9bb6d1dae", 594},
{"resource.001", 0, "143e1c14f15ad0fbfc714f648a65f661", 205330},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English DOS (original boxed release, 3 1/2" disks)
// SCI interpreter version 0.000.247
@@ -1154,7 +1156,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "851a62d00972dc4002f472cc0d84e71d", 683145},
{"resource.004", 0, "851a62d00972dc4002f472cc0d84e71d", 649441},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English DOS (from the King's Quest Collection)
// Executable scanning reports "0.000.502"
@@ -1166,7 +1168,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "77615c595388acf3d1df8e107bfb6b52", 707591},
{"resource.004", 0, "77615c595388acf3d1df8e107bfb6b52", 479562},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English DOS (supplied by ssburnout in bug report #3049193)
// 1.006.003 8x5.25" (label: Int.#0.000.502)
@@ -1180,7 +1182,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "6db7de6f93c6ea62dca78abee677f8c0", 324789},
{"resource.007", 0, "6db7de6f93c6ea62dca78abee677f8c0", 334441},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English DOS
// SCI interpreter version 0.000.274
@@ -1194,7 +1196,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "851a62d00972dc4002f472cc0d84e71d", 333777},
{"resource.007", 0, "851a62d00972dc4002f472cc0d84e71d", 341038},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English DOS
// SCI interpreter version 0.000.253
@@ -1208,7 +1210,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "0c8566848a76eea19a6d6220914030a7", 337288},
{"resource.007", 0, "0c8566848a76eea19a6d6220914030a7", 343882},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 4 - English Atari ST (double-sided diskettes)
// Game version 1.003.006 (January 12, 1989)
@@ -1221,7 +1223,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "a3cdb4848fb859fdd302976fff56490f", 705074},
{"resource.004", 0, "a3cdb4848fb859fdd302976fff56490f", 478366},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.004.018"
@@ -1237,7 +1239,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "26c0c25399b6715fec03fc3e12544fe3", 823048},
{"resource.007", 0, "b914b5901e786327213e779725d30dd1", 778772},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - German Amiga (also includes english language)
// Executable scanning reports "1.004.024"
@@ -1253,7 +1255,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "56546b20db11a4836f900efa6d3a3e74", 672099},
{"resource.007", 0, "56546b20db11a4836f900efa6d3a3e74", 794194},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - Italian Amiga (also includes english language)
// Executable scanning reports "1.004.024"
@@ -1269,7 +1271,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 672527},
{"resource.007", 0, "11cb750f5f816445ad0f4b9f50a4f59a", 794259},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English DOS CD (from the King's Quest Collection)
// Executable scanning reports "x.yyy.zzz", VERSION file reports "1.000.052"
@@ -1279,7 +1281,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "449471bfd77be52f18a3773c7f7d843d", 571368},
{"resource.001", 0, "b45a581ff8751e052c7e364f58d3617f", 16800210},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English DOS CD (from the King's Quest Collection)
// Executable scanning reports "x.yyy.zzz", VERSION file reports "1.000.052"
@@ -1291,7 +1293,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "449471bfd77be52f18a3773c7f7d843d", 571368},
{"resource.001", 0, "b45a581ff8751e052c7e364f58d3617f", 16800210},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO4(GUIO_MIDIGM, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English DOS Floppy
// SCI interpreter version 1.000.060
@@ -1306,7 +1308,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "672ede1136e9e401658538e51bd5dc22", 1172619},
{"resource.007", 0, "2f48faf27666b58c276dda20f91f4a93", 1240456},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English DOS Floppy
// VERSION file reports "0.000.051"
@@ -1324,7 +1326,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "da82e4beb744731d0a151f1d4922fafa", 1170456},
{"resource.007", 0, "431def14ca29cdb5e6a5e84d3f38f679", 1240176},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English DOS Floppy (supplied by omer_mor in bug report #3036996)
// VERSION file reports "0.000.051"
@@ -1339,7 +1341,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "06cb3f689836086ebe08b1efc0126592", 921113},
{"resource.007", 0, "252249753c6e850eacceb8af634986d3", 1133608},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 EGA (supplied by markcoolio in bug report #2829470)
// SCI interpreter version 1.000.060
@@ -1355,7 +1357,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "698c698570cde9015e4d51eb8d2e9db1", 666527},
{"resource.007", 0, "703d8df30e89541af337d7706540d5c4", 541743},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 EGA 1.2M disk version (from LordHoto)
// VERSION file reports "0.000.055"
@@ -1367,7 +1369,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "53206afb4fd73871a484e83acab80f31", 7608},
{"resource.004", 0, "83568edf7fde18b3eed988bc5d22ceb1", 1188053},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 EGA (supplied by omer_mor in bug report #3035421)
// VERSION file reports "0.000.062"
@@ -1382,7 +1384,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "698c698570cde9015e4d51eb8d2e9db1", 666541},
{"resource.007", 0, "703d8df30e89541af337d7706540d5c4", 541762},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest V DOS 0.000.062 EGA (5 x 5.25" disks)
// Supplied by ssburnout in bug report #3046780
@@ -1394,7 +1396,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "3cca5b2dae8afe94532edfdc98d7edbe", 1092325},
{"resource.004", 0, "8e5c1bc4d738cf7316ff506f59d265e2", 1187803},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 DOS Spanish Floppy 0.000.062 VGA (5 x 3.5" disks)
// Supplied by dianiu in bug report #3555646
@@ -1409,7 +1411,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "65b520e60c4217e6a6572d9edf77193b", 1141985},
{"resource.007", 0, "f42b0100f0a1c30806814f8648b6bc28", 1145583},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - German DOS Floppy (supplied by markcoolio in bug report #2727101, also includes english language)
// SCI interpreter version 1.000.060
@@ -1424,7 +1426,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "d1a75fdc01840664d00366cff6919366", 1208972},
{"resource.007", 0, "c07494f0cce7c05210893938786a955b", 1337361},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - French DOS Floppy (from the King's Quest Collector's Edition 1994, also includes english language)
// Supplied by aroenai in bug report #2812611
@@ -1440,7 +1442,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "f7dc85307632ef657ceb1651204f6f51", 1210081},
{"resource.007", 0, "7db4d0a1d8d547c0019cb7d2a6acbdd4", 1338473},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - Italian DOS Floppy (from glorifindel, includes english language)
// SCI interpreter version 1.000.060
@@ -1455,7 +1457,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "8eeabd92af71e766e323db2100879102", 1209325},
{"resource.007", 0, "dc10c107e0923b902326a040b9c166b9", 1337859},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - Polish DOS Floppy (supplied by jacek909 in bug report #2725722)
// SCI interpreter version 1.000.060
@@ -1473,7 +1475,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.007", 0, "431def14ca29cdb5e6a5e84d3f38f679", 1240176},
{"text.000", 0, "601aa35a3ddeb558e1280e0963e955a2", 1517},
AD_LISTEND},
- Common::PL_POL, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::PL_POL, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - English Macintosh
// VERSION file reports "1.000.055"
@@ -1488,7 +1490,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "3d22904a374c192f51e5665b74364133", 1264079},
{"resource.007", 0, "ffe17e23d5833a79f3695addfc149a56", 1361965},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 5 - FM-Towns (supplied by abevi in bug report #3038720)
{"kq5", "", {
@@ -1496,7 +1498,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "71afd220d46bde1109c58e6acc0f3a01", 469094},
{"resource.001", 0, "72a569f46f1abf2d9d2b1526ad3799c3", 12808839},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO2(GUIO_NOASPECT, GUIO_MIDITOWNS) },
+ Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO2(GUIO_NOASPECT, GUIO_MIDITOWNS) },
{"kq5", "", {
{"resource.map", 0, "20c7cd248ff1a349ed354568eebd972b", 12733},
{"resource.000", 0, "71afd220d46bde1109c58e6acc0f3a01", 469094},
@@ -1514,7 +1516,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "e114ce8f884601c43308fb5cbbea4874", 1174129},
{"resource.005", 0, "349ad9438172265d00680075c5a988d0", 1019669},
AD_LISTEND},
- Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - English DOS Non-Interactive Demo
// Executable scanning reports "1.001.055", VERSION file reports "1.000.000"
@@ -1524,7 +1526,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "535b1b920441ec73f42eaa4ccfd47b89", 264116},
{"resource.msg", 0, "54d1fdc936f98c81f9e4c19e04fb1510", 8260},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - English DOS Floppy
// SCI interpreter version 1.001.054
@@ -1533,7 +1535,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
{"resource.msg", 0, "3cf5de44de36191f109d425b8450efc8", 258590},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - French DOS Floppy (supplied by misterhands in bug #3503425)
// SCI interpreter version ???
@@ -1542,7 +1544,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
{"resource.msg", 0, "adc2aa8adbdcc97507d44a6f492fbd77", 265194},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - German DOS Floppy (supplied by markcoolio in bug report #2727156)
// SCI interpreter version 1.001.054
@@ -1551,7 +1553,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "f2b7f753992c56a0c7a08d6a5077c895", 7863324},
{"resource.msg", 0, "756297b2155db9e43f621c6f6fb763c3", 282822},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - Spanish DOS Floppy (from jvprat)
// Executable scanning reports "1.cfs.158", VERSION file reports "1.000.000, July 5, 1994"
@@ -1561,7 +1563,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "4da3ad5868a775549a7cc4f72770a58e", 8537260},
{"resource.msg", 0, "41eed2d3893e1ca6c3695deba4e9d2e8", 267102},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - Italian DOS Floppy (supplied by guybrush79 in bug report #3606719)
{"kq6", "", {
@@ -1569,7 +1571,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "d3358ba7306378aed83d02b5c3f11311", 8531908},
{"resource.msg", 0, "b7e8220be596fd6a9287eae5a8fd354a", 279886},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - English DOS CD (from the King's Quest Collection)
// Executable scanning reports "1.cfs.158", VERSION file reports "1.034 9/11/94 - KQ6 version 1.000.00G"
@@ -1578,7 +1580,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7a550ebfeae2575ca00d47703a6a774c", 9215},
{"resource.000", 0, "233394a5f33b475ae5975e7e9a420865", 8376352},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - English Windows CD (from the King's Quest Collection)
// Executable scanning reports "1.cfs.158", VERSION file reports "1.034 9/11/94 - KQ6 version 1.000.00G"
@@ -1587,7 +1589,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "7a550ebfeae2575ca00d47703a6a774c", 9215},
{"resource.000", 0, "233394a5f33b475ae5975e7e9a420865", 8376352},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO5(GUIO_NOASPECT, GAMEOPTION_KQ6_WINDOWS_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO5(GUIO_NOASPECT, GAMEOPTION_KQ6_WINDOWS_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 6 - English Macintosh Floppy
// VERSION file reports "1.0"
@@ -1595,7 +1597,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data1", 0, "a183fc0c22fcbd9be4c8800d974b5599", 3892124},
{"Data2", 0, "b3722460dfd3097a1fbaf99a21ad8ea5", 15031272},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
@@ -1606,7 +1608,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, GUIO5(GUIO_NOSPEECH, 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"
@@ -1614,7 +1616,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, GUIO5(GUIO_NOSPEECH, 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"
@@ -1622,7 +1624,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, GUIO5(GUIO_NOSPEECH, 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"
@@ -1630,7 +1632,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, GUIO5(GUIO_NOSPEECH, 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
@@ -1638,7 +1640,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, GUIO5(GUIO_NOSPEECH, 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"
@@ -1646,7 +1648,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, GUIO5(GUIO_NOSPEECH, 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
@@ -1654,7 +1656,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "b44f774108d63faa1d021101221c5a54", 1690},
{"resource.000", 0, "d9659d2cf0c269c6a9dc776707f5bea0", 2433827},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - English Windows Demo (from DrMcCoy)
// SCI interpreter version 2.100.002
@@ -1662,7 +1664,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, GUIO5(GUIO_NOSPEECH, 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
@@ -1670,7 +1672,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "9b1cddecd4f0720d83661ba7aed28891", 162697},
{"resource.map", 0, "93a2251fa64e729d7a7d2fe56b217c8e", 502},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO3(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI32
@@ -1686,7 +1688,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "aa553977f7e5804081de293800d3bcce", 695067},
{"resource.005", 0, "bfd870d51dc97729f0914095f58e6957", 676881},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow - English Atari ST (from jvprat)
// Executable scanning reports "1.002.030", Floppy label reports "1.000.062, 9.23.90"
@@ -1698,7 +1700,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 667365},
{"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 683737},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAtariST, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow - English DOS Non-Interactive Demo
// Executable scanning reports "x.yyy.zzz"
@@ -1706,7 +1708,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "e625726268ff4e123ada11f31f0249f3", 768},
{"resource.001", 0, "0c8912290af0890f8d95faeb4ddb2d68", 333031},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow - English DOS 3.5" Floppy (from "The Roberta Williams Anthology"/1996)
// SCI interpreter version 0.000.631
@@ -1717,7 +1719,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 667468},
{"resource.004", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 683807},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow - English DOS (from FRG)
// SCI interpreter version 0.000.631
@@ -1731,7 +1733,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 328390},
{"resource.007", 0, "e45c888d9c7c04aec0a20e9f820b79ff", 317687},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow 2 - English DOS Non-Interactive Demo (from FRG)
// Executable scanning reports "x.yyy.zzz"
@@ -1740,7 +1742,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "24dffc5db1d88c7999f13e8767ed7346", 855},
{"resource.000", 0, "2b2b1b4f7584f9b38fd13f6ab95634d1", 781912},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow 2 - English DOS Floppy
// Executable scanning reports "2.000.274"
@@ -1749,7 +1751,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "610bfd9a852004222f0faaf5fc9e630a", 6489},
{"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5035964},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow 2 - English DOS CD (from "The Roberta Williams Antology"/1996)
// Executable scanning reports "1.001.072", VERSION file reports "1.1" (from jvprat)
@@ -1758,7 +1760,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a70945e61ba7ac7bfea6b7bd72c6aec5", 7274},
{"resource.000", 0, "82578b8d5a7e09c4c58891ca49fae35b", 5598672},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow 2 v1.1 - French DOS Floppy (from Hkz)
{"laurabow2", "", {
@@ -1766,7 +1768,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
{"resource.msg", 0, "0fceedfbdd85a4bc7851fdd9dd2d2f19", 278253},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow 2 v1.1 - German DOS Floppy (from Tobis87, updated info from markcoolio in bug report #2723787, updated info from #2797962))
// Executable scanning reports "2.000.274"
@@ -1775,7 +1777,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
{"resource.msg", 0, "795c928cd00dfec9fbc62ebcd12e1f65", 303185},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Laura Bow 2 - Spanish DOS CD (from jvprat)
// Executable scanning reports "2.000.274", VERSION file reports "1.000.000, May 10, 1994"
@@ -1784,7 +1786,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "57084910bc923bff5d6d9bc1b56e9604", 5028766},
{"resource.msg", 0, "71f1f0cd9f082da2e750c793a8ed9d84", 286141},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 EGA Remake - English DOS (from spookypeanut)
// SCI interpreter version 0.000.510 (or 0.000.577?)
@@ -1795,7 +1797,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "24c958bc922b07f91e25e8c93aa01fcf", 491230},
{"resource.003", 0, "685cd6c1e05a695ab1e0db826337ee2a", 553279},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#if 0
// The resource.002 file, contained in disk 3, is broken in this version
@@ -1813,7 +1815,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "5790ac0505f7ca98d4567132b875eb1e", 681041},
{"resource.003", 0, "4a34c3367c2fe7eb380d741374da1989", 572251},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif
// Larry 1 VGA Remake - English DOS (from spookypeanut)
@@ -1824,7 +1826,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "ec20246209d7b19f38989261e5c8f5b8", 1111226},
{"resource.002", 0, "85d6935ef77e6b0e16bc307640a0d913", 1088312},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 VGA Remake - English DOS (from FRG)
// SCI interpreter version 1.000.510
@@ -1834,7 +1836,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "d34cadb11e1aefbb497cf91bc1d3baa7", 1114688},
{"resource.002", 0, "85b030bb66d5342b0a068f1208c431a8", 1078443},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 VGA Remake - English Macintosh (from omer_mor, bug report #3328262)
{"lsl1sci", "SCI", {
@@ -1843,7 +1845,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "aa6f153f70f1e32d1bde465fff08eecf", 1137418},
{"resource.002", 0, "b22c616aa789ebef990290c7ffd86548", 1097477},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 VGA Remake - English DOS Non-Interactive Demo
// SCI interpreter version 1.000.084
@@ -1851,7 +1853,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "434e1f6c39d71647b34f0ee57b2bbd68", 444},
{"resource.001", 0, "0c0768215c562d9dace4a5ca53696cf3", 359913},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 VGA Remake - Spanish DOS (from the Leisure Suit Larry Collection, also includes english language)
// Executable scanning reports "1.SQ4.057", VERSION file reports "1.000"
@@ -1864,7 +1866,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "3fe2a3aec0ed53c7d6db1845a67e3aa2", 1095908},
{"resource.003", 0, "ac175df0ea9a2cba57f0248651856d27", 376556},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 VGA Remake - Russian DOS (also includes english language?!)
// Executable scanning reports "1.000.510", VERSION file reports "2.0"
@@ -1875,7 +1877,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "bc8ca10c807515d959cbd91f9ba47735", 1123759},
{"resource.002", 0, "b7409ab32bc3bee2d6cce887cd33f2b6", 1092160},
AD_LISTEND},
- Common::RU_RUS, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::RU_RUS, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 1 VGA Remake - Polish DOS (from Polish Leisure Suit Larry Collection, official release)
// SCI interpreter version 1.000.577, VERSION file reports "2.1" (this release does NOT include english text)
@@ -1883,7 +1885,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "58330a85767e42a2487129913283ab5b", 3228},
{"resource.000", 0, "b6097ff35cdc8469f02150fe2f824198", 4781210},
AD_LISTEND},
- Common::PL_POL, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::PL_POL, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 2 - English Amiga (from www.back2roots.org)
// Executable scanning reports "x.yyy.zzz"
@@ -1895,7 +1897,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "a0d4a625311d307257da7fc43d00459d", 570356},
{"resource.004", 0, "a0d4a625311d307257da7fc43d00459d", 717844},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 2 - English DOS Non-Interactive Demo
// Executable scanning reports "x.yyy.zzz"
@@ -1904,7 +1906,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "03dba704bb77da55a91ad27b5a3cac09", 528},
{"resource.001", 0, "9f5520f0297206928df0b0b36493cd33", 127532},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 2 - English DOS
// SCI interpreter version 0.000.409
@@ -1917,7 +1919,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "4a24443a25e2b1492462a52809605dc2", 277732},
{"resource.006", 0, "4a24443a25e2b1492462a52809605dc2", 345683},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 2 - English DOS
// SCI interpreter version 0.000.343
@@ -1932,7 +1934,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
//{"resource.006", 0, "96033f57accfca903750413fd09193c8", 345818},
{"resource.006", 0, "96033f57accfca903750413fd09193c8", -1}, // 345818 or 208739
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 2 - English DOS (supplied by ssburnout in bug report #3049193)
// 1.000.011 3x3.5" (label: Int. #0.000.343)
@@ -1942,7 +1944,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "96033f57accfca903750413fd09193c8", 407014},
{"resource.003", 0, "96033f57accfca903750413fd09193c8", 592834},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 2 - English DOS (supplied by ssburnout in bug report #3049193)
// 1.002.000 3x3.5" (label: INT#0.000.409)
@@ -1952,7 +1954,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "4a24443a25e2b1492462a52809605dc2", 406935},
{"resource.003", 0, "4a24443a25e2b1492462a52809605dc2", 592533},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.002.032"
@@ -1966,7 +1968,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "f408e59cbee1457f042e5773b8c53951", 651634},
{"resource.005", 0, "433911eb764089d493aed1f958a5615a", 524259},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - English DOS (supplied by ssburnout in bug report #3049193)
// 1.021 8x5.25" (label: Int#5.15.90)
@@ -1980,7 +1982,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "f18441027154292836b973c655fa3175", 282649},
{"resource.007", 0, "f18441027154292836b973c655fa3175", 257178},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - English DOS
// SCI interpreter version 0.000.572
@@ -1994,7 +1996,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "f18441027154292836b973c655fa3175", 282465},
{"resource.007", 0, "f18441027154292836b973c655fa3175", 257174},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - English DOS
// SCI interpreter version 0.000.572
@@ -2005,7 +2007,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "f18441027154292836b973c655fa3175", 506807},
{"resource.004", 0, "f18441027154292836b973c655fa3175", 513651},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - English DOS (supplied by kervala in bug report #3611488)
{"lsl3", "", {
@@ -2015,7 +2017,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "f18441027154292836b973c655fa3175", 506817},
{"resource.004", 0, "f18441027154292836b973c655fa3175", 513337},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - English DOS Non-Interactive Demo
// SCI interpreter version 0.000.530
@@ -2024,7 +2026,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "f773d79b93dfd4052ec8c1cc64c1e6ab", 76525},
{"resource.002", 0, "f773d79b93dfd4052ec8c1cc64c1e6ab", 268299},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723832, also includes english language)
// Executable scanning reports "S.old.123"
@@ -2036,7 +2038,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "3827a9b17b926e12dcc336860f50612a", 587036},
{"resource.004", 0, "3827a9b17b926e12dcc336860f50612a", 691932},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 - French DOS (provided by richiefs in bug report #2670691, also includes english language)
// Executable scanning reports "S.old.123"
@@ -2048,7 +2050,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "65f1bdaa20f6d0470e9d969f22473873", 586921},
{"resource.004", 0, "65f1bdaa20f6d0470e9d969f22473873", 690826},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 3 1.050 Fr/En (9 x 5.25" disks)
// Provided by ssburnout in bug report #3046779
@@ -2062,7 +2064,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "65f1bdaa20f6d0470e9d969f22473873", 325292},
{"resource.007", 0, "65f1bdaa20f6d0470e9d969f22473873", 308982},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - English Amiga
// Executable scanning reports "1.004.023"
@@ -2077,7 +2079,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "f8b2d1137bb767e5d232056b99dd69eb", 623621},
{"resource.006", 0, "bafc64e3144f115dc58c6aee02de98fb", 715598},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - German Amiga (also includes english language)
// Executable scanning reports "1.004.024"
@@ -2093,7 +2095,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "bafc64e3144f115dc58c6aee02de98fb", 754966},
{"resource.007", 0, "59eba83ad465b08d763b44f86afa86f6", 683135},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - English DOS Non-Interactive Demo (from FRG)
// SCI interpreter version 1.000.181
@@ -2101,7 +2103,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "efe8d3f45ce4f6bd9a6643e0ac8d2a97", 504},
{"resource.001", 0, "8bd8d9c0b5f455ee1269d63ce86c50dd", 531380},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - English DOS (from spookypeanut)
// SCI interpreter version 1.000.510
@@ -2116,7 +2118,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1024810},
{"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 1030656},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - English Macintosh (from omer_mor, bug report #3328257)
{"lsl5", "", {
@@ -2130,7 +2132,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1110043},
{"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 989801},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - German DOS (from Tobis87)
// SCI interpreter version T.A00.196
@@ -2145,7 +2147,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1021774},
{"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 993408},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - French DOS (provided by richiefs in bug report #2670691)
// Executable scanning reports "1.lsl5.019"
@@ -2161,7 +2163,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 946540},
{"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 958842},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - Spanish DOS (from the Leisure Suit Larry Collection)
// Executable scanning reports "1.ls5.006", VERSION file reports "1.000, 4/21/92"
@@ -2177,7 +2179,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "dda27ce00682aa76198dac124bbbe334", 1015136},
{"resource.007", 0, "ac443fae1285fb359bf2b2bc6a7301ae", 987222},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 - Italian DOS Floppy (from glorifindel)
// SCI interpreter version 1.000.510 (just a guess)
@@ -2185,7 +2187,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a99776df795127f387cb35dae872d4e4", 5919},
{"resource.000", 0, "a8989a5a89e7d4f702b26b378c7a357a", 7001981},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 1.0 EGA DOS (8 x 3.5" disks)
// Provided by ssburnout in bug report #3046806
@@ -2200,7 +2202,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "f6046a8445422f17d40b1b10ab21ebf3", 568551},
{"resource.007", 0, "640ee65595d40372ef95462f2c1ae28a", 593429},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 5 EGA
// Supplied by omer_mor in bug report #3049771
@@ -2211,7 +2213,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "5a55af4e40728b1a8103dc47ad2afa8d", 1100539},
{"resource.003", 0, "16f4d8fb1b526125edaca4fc6cbb7530", 1064563},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - English DOS (from spookypeanut)
// SCI interpreter version 1.001.113
@@ -2219,7 +2221,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "bb8a39d9e2a77ba449a1e591109ad9a8", 6973},
{"resource.000", 0, "4462fe48c7452d98fddcec327a3e738d", 5789138},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - English/German/French DOS CD - LOWRES
// SCI interpreter version 1.001.115
@@ -2227,7 +2229,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "0b91234b7112782962cb480b7791b6e2", 7263},
{"resource.000", 0, "57d5fe8bb9e044158514476ea7678eb0", 5754790},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - German DOS CD - LOWRES (provided by richiefs in bug report #2670691)
// SCI interpreter version 1.001.115
@@ -2235,7 +2237,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "bafe85f32738854135991d4324ad147e", 7268},
{"resource.000", 0, "f6cbc6da7b90ea135883e0759848ca2c", 5773160},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - French DOS CD - LOWRES (provided by richiefs in bug report #2670691)
// SCI interpreter version 1.001.115
@@ -2243,7 +2245,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "97797ea775baaf18a1907d357d3c0ea6", 7268},
{"resource.000", 0, "f6cbc6da7b90ea135883e0759848ca2c", 5776092},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - Spanish DOS - LOWRES (from the Leisure Suit Larry Collection)
// Executable scanning reports "1.001.113", VERSION file reports "1.000, 11.06.93, FIVE PATCHES ADDED TO DISK 6 ON 11-18-93"
@@ -2251,7 +2253,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "633bf8f42170b6271019917c8009989b", 6943},
{"resource.000", 0, "7884a8db9253e29e6b37a2651fd90ba3", 5733116},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Crazy Nick's Software Picks: Leisure Suit Larry's Casino - English DOS (from the Leisure Suit Larry Collection)
// Executable scanning reports "1.001.029", VERSION file reports "1.000"
@@ -2259,35 +2261,35 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "194f1578f2624db813c9072359ad1639", 783},
{"resource.001", 0, "3733433b517ec3d14a3331d9ab3842ae", 344830},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Crazy Nick's Software Picks: King Graham's Board Game Challenge
{"cnick-kq", "", {
{"resource.map", 0, "44bc538a5cd24b39ffccc967c0ebf84d", 1137},
{"resource.001", 0, "470e7a4a3504635e70b623c44461e1ac", 451272},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Crazy Nick's Software Picks: Parlor Games with Laura Bow
{"cnick-laurabow", "", {
{"resource.map", 0, "3b826bfe64f8ff1ccf30eef93cd2f727", 999},
{"resource.001", 0, "985ac8db6f636f2b4334c04b0fbb44fb", 336698},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Crazy Nick's Software Picks: Robin Hood's Game of Skill and Chance
{"cnick-longbow", "", {
{"resource.map", 0, "4a5c81f485a2416bde12978506f2fb5f", 897},
{"resource.001", 0, "ef16dc9e867eb8eeb5b13e110b90bd4b", 571466},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Crazy Nick's Software Picks: Roger Wilco's Spaced Out Game Pack
{"cnick-sq", "", {
{"resource.map", 0, "b4d95b02d84e297441bd999d34eaa6b1", 879},
{"resource.001", 0, "82ff2b64a60117886fbcd6a3a8c977c6", 364921},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Larry 6 - English/German DOS CD - HIRES
@@ -2296,7 +2298,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872},
{"resource.000", 0, "9a9f4870504444cda863dd14d077a680", 18520872},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - German DOS CD - HIRES (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2304,7 +2306,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "badfdf446ffed569a310d2c63a249421", 8896},
{"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18534274},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 6 - French DOS CD - HIRES (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2312,7 +2314,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "d184e9aa4f2d4b5670ddb3669db82cda", 8896},
{"resource.000", 0, "bd944d2b06614a5b39f1586906f0ee88", 18538987},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 7 - English DOS Demo (provided by richiefs in bug report #2670691)
// SCI interpreter version 2.100.002
@@ -2320,7 +2322,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "5cc6159688b2dc03790a67c90ccc67f9", 10195878},
{"resmap.000", 0, "6a2b2811eef82e87cde91cf1de845af8", 2695},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI3_GAMES
// Larry 7 - English DOS CD (from spookypeanut)
@@ -2329,7 +2331,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "eae93e1b1d1ccc58b4691c371281c95d", 8188},
{"ressci.000", 0, "89353723488219e25589165d73ed663e", 66965678},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 7 - German DOS (from Tobis87)
// SCI interpreter version 3.000.000
@@ -2337,7 +2339,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "c11e6bfcfc2f2d05da47e5a7df3e9b1a", 8188},
{"ressci.000", 0, "a8c6817bb94f332ff498a71c8b47f893", 66971724},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 7 - French DOS (provided by richiefs in bug report #2670691)
// SCI interpreter version 3.000.000
@@ -2345,7 +2347,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "4407849fd52fe3efb0c30fba60cd5cd4", 8206},
{"ressci.000", 0, "dc37c3055fffbefb494ff22b145d377b", 66964472},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 7 - Italian DOS CD (from glorifindel)
// SCI interpreter version 3.000.000
@@ -2353,7 +2355,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "9852a97141f789413f29bf956052acdb", 8212},
{"ressci.000", 0, "440b9fed89590abb4e4386ed6f948ee2", 67140181},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Larry 7 - Spanish DOS (from the Leisure Suit Larry Collection)
// Executable scanning reports "3.000.000", VERSION file reports "1.0s"
@@ -2361,7 +2363,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "8f3d603e1acc834a5d598b30cdfc93f3", 8188},
{"ressci.000", 0, "32792f9bc1bf3633a88b382bb3f6e40d", 67071418},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif
// Lighthouse - English Windows Demo (from jvprat)
@@ -2370,7 +2372,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "543124606352bfa5e07696ddf2a669be", 64},
{"resource.000", 0, "5d7714416b612463d750fb9c5690c859", 28952},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI3_GAMES
// Lighthouse - English Windows Demo
@@ -2379,7 +2381,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "3bdee7a16926975a4729f75cf6b80a92", 1525},
{"ressci.000", 0, "3c585827fa4a82f4c04a56a0bc52ccee", 11494351},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Lighthouse - English DOS (from jvprat)
// Executable scanning reports "3.000.000", VERSION file reports "1.1"
@@ -2389,7 +2391,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.002", 0, "c68db5333f152fea6ca2dfc75cad8b34", 7573},
{"ressci.002", 0, "175468431a979b9f317c294ce3bc1430", 94628315},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Lighthouse - Spanish DOS (from jvprat)
// Executable scanning reports "3.000.000", VERSION file reports "1.1"
@@ -2399,7 +2401,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.002", 0, "e7dc85884a2417e2eff9de0c63dd65fa", 7630},
{"ressci.002", 0, "3c8d627c555b0e3e4f1d9955bc0f0df4", 94631127},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI3_GAMES
#endif // ENABLE_SCI32
@@ -2410,7 +2412,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "8be56a3a88c065ee00c02c0e29199f3a", 14643},
{"resource.001", 0, "9e33566515b18bee7915db448063bba2", 871853},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Fairy Tales - English DOS Floppy EGA (from omer_mor, bug report #3035350)
{"fairytales", "EGA", {
@@ -2421,7 +2423,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "509b2467ba779100d5933ed51a9ae32f", 560255},
{"resource.004", 0, "93afc85d5ffa60ea555d6cc336d22c03", 651109},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Fairy Tales v1.000 - English DOS (supplied by markcoolio in bug report #2723791)
// Executable scanning reports "1.000.145"
@@ -2433,7 +2435,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "b1288e0821ee358d1ffe877e5900c8ec", 1047565},
{"resource.004", 0, "f79daa70390d73746742ffcfc3dc4471", 937580},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Fairy Tales - English DOS Floppy (from jvprat)
// Executable scanning reports "1.000.145", Floppy label reports "1.0, 11.13.91", VERSION file reports "1.000"
@@ -2444,7 +2446,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "564f516d991032e781492592a4eaa275", 1414142},
{"resource.003", 0, "dd6cef0c592eadb7e6be9a25307c57a2", 1344719},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose - English Amiga (from www.back2roots.org)
// Executable scanning reports "1.003.009"
@@ -2454,7 +2456,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "fb552ae550ca1dac19ed8f6a3767612d", 262885},
{"resource.002", 0, "fb552ae550ca1dac19ed8f6a3767612d", 817191},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose - English DOS Floppy EGA (from omer_mor, bug report #3035354)
{"mothergoose", "EGA", {
@@ -2462,7 +2464,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "d893892d62b3f061357291d66775e360", 239906},
{"resource.002", 0, "d893892d62b3f061357291d66775e360", 719398},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose - English DOS Floppy EGA (supplied by ssburnout in bug report #3049193)
// 1.011 5x5.25" (label: Int#8.2.90)
@@ -2475,7 +2477,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "dbbc22f124533ce308bc386b08956326", 146251},
{"resource.005", 0, "2ba5348e7fad641b9c4c7ff7c7cf4e68", 110979},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose v2.000 - English DOS Floppy (supplied by markcoolio in bug report #2723795)
// Executable scanning reports "1.001.031"
@@ -2483,7 +2485,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "52aae15e493cafd1da7e1c9b657a5bb9", 7026},
{"resource.000", 0, "b7ecd8ae9e254e80310b5a668b276e6e", 2948975},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose - English DOS CD (from jvprat)
// Executable scanning reports "x.yyy.zzz"
@@ -2492,7 +2494,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "1c7f311b0a2c927b2fbe81ae341fb2f6", 5790},
{"resource.001", 0, "5a0ed1d745855148364de1b3be099bac", 4369438},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose - English Windows Interactive Demo
// Executable scanning reports "x.yyy.zzz"
@@ -2500,19 +2502,19 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "87f9dc1cafc4d4fa835fb2f00cf3a6ef", 4560},
{"resource.001", 0, "5a0ed1d745855148364de1b3be099bac", 2070072},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose - FM-Towns (supplied by abevi in bug report #3038720)
{"mothergoose256", "", {
{"resource.map", 0, "b11e971ccd2040bebba59dfb409a08ef", 5772},
{"resource.001", 0, "d49625d9b8005ec01c852f8322a82867", 4330713},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformFMTowns, 0, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
{"mothergoose256", "", {
{"resource.map", 0, "b11e971ccd2040bebba59dfb409a08ef", 5772},
{"resource.001", 0, "d49625d9b8005ec01c852f8322a82867", 4330713},
AD_LISTEND},
- Common::JA_JPN, Common::kPlatformFMTowns, 0, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::JA_JPN, Common::kPlatformFMTowns, 0, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Mixed-Up Mother Goose Deluxe - English Windows/DOS CD (supplied by markcoolio in bug report #2723810)
@@ -2521,7 +2523,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "5159a1578c4306bfe070a3e4d8c2e1d3", 4741},
{"resource.000", 0, "1926925c95d82f0999590e93b02887c5", 15150768},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Mixed-Up Mother Goose Deluxe - Multilingual Windows CD (English/French/German/Spanish)
// Executable scanning reports "2.100.002"
@@ -2529,7 +2531,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "ef611af561898dcfea87846919ebf3eb", 4969},
{"ressci.000", 0, "227685bc59d90821978d330713e44a7a", 17205800},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI32
// Ms. Astro Chicken - English DOS
@@ -2538,7 +2540,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "5b457cbe5042f557e5b610148171f6c0", 1158},
{"resource.001", 0, "453ea81ef66a50cbe33ce06302afe47f", 229737},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Phantasmagoria - English DOS (from jvprat)
@@ -2559,7 +2561,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.007", 0, "afbd16ea77869a720afa1c5371de107d", 7972},
//{"ressci.007", 0, "3aae6559aa1df273bc542d5ac6330d75", 25859038},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Phantasmagoria - English DOS Demo
// Executable scanning reports "2.100.002"
@@ -2567,7 +2569,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.001", 0, "416138651ea828219ca454cae18341a3", 11518},
{"ressci.001", 0, "3aae6559aa1df273bc542d5ac6330d75", 65844612},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Phantasmagoria - English DOS/Windows (GOG version) - ressci.* merged in ressci.000
// Windows executable scanning reports "2.100.002" - "Sep 19 1995 15:09:43"
@@ -2578,7 +2580,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "cd5967f9b9586e3380645961c0765be3", 116822037},
{"resmap.000", 0, "3cafc1c6a53945c1f3babbfd6380c64c", 16468},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Phantasmagoria - English Macintosh
// NOTE: This only contains disc 1 files (as well as the two persistent files:
@@ -2611,7 +2613,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.005", 0, "8bd5ceeedcbe16dfe55d1b90dcd4be84", 1942},
{"ressci.005", 0, "05f9fe2bee749659acb3cd2c90252fc5", 67905112},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Phantasmagoria 2 - English DOS (GOG version) - ressci.* merged in ressci.000
// Executable scanning reports "3.000.000" - "Dec 07 1996 09:29:03"
@@ -2621,7 +2623,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "c54f26d9f43f908151263254b6d97053", 108134481},
{"resmap.000", 0, "de154a223a9ef4ea7358b76adc38ef5b", 2956},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI3_GAMES
#endif // ENABLE_SCI32
@@ -2632,7 +2634,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "72726dc81c1b4c1110c486be77369bc8", 5179},
{"resource.000", 0, "670d0c53622429f4b11275caf7f8d292", 5459574},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Pepper - English DOS Non-Interactive Demo
// Executable scanning reports "1.001.060", VERSION file reports "1.000"
@@ -2640,7 +2642,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "379bb4fb896630b14f2d91ed21e36ba1", 984},
{"resource.000", 0, "118f6c31a93ec7fd9a231c61125229e3", 645494},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Pepper - English DOS/Windows Interactive Demo
// Executable scanning reports "1.001.069", VERSION file reports ".001"
@@ -2648,7 +2650,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "975e8df76106a5c13d12ab674f906a02", 2514},
{"resource.000", 0, "e6a918a2dd7a4bcecd8fb389f43287c2", 1698164},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Pepper - English DOS Interactive Demo
// Executable scanning reports "1.001.072", VERSION file reports "1.000"
@@ -2656,7 +2658,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "9c9b7b900651a370dd3fb38d478b1798", 2524},
{"resource.000", 0, "e6a918a2dd7a4bcecd8fb389f43287c2", 1713544},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 1 VGA Remake - English DOS (from the Police Quest Collection)
// Executable scanning reports "1.001.029", VERSION file reports "2.000"
@@ -2664,7 +2666,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "35efa814fb994b1cbdac9611e401da67", 5013},
{"resource.000", 0, "e0d5ddf34eda903a38f0837e2aa7145b", 6401433},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 - English Amiga (from www.back2roots.org)
// SCI interpreter version 0.000.685 (just a guess)
@@ -2675,7 +2677,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "499737c21a28ac026e11ab817100d610", 511099},
{"resource.003", 0, "e008f5d6e2a7c4d4a0da0173e4fa8f8b", 553970},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 - English DOS Non-Interactive Demo
// Executable scanning reports "0.000.413"
@@ -2683,7 +2685,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8b77d0d4650c2052b356cece28294b58", 576},
{"resource.001", 0, "376ef6d6eaaeed66e1424bd219c4b9ab", 215398},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 - English DOS (provided by richiefs in bug report #2670691)
// SCI interpreter version 0.000.395
@@ -2696,7 +2698,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "77f02def3094af804fd2371db25b7100", 349899},
{"resource.006", 0, "77f02def3094af804fd2371db25b7100", 354991},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 - English DOS (from the Police Quest Collection)
// Executable scanning reports "0.000.490"
@@ -2706,7 +2708,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 546000},
{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 591851},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 - English DOS (from FRG)
// SCI interpreter version 0.000.395
@@ -2716,7 +2718,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 542897},
{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 586857},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 English DOS 1.001.006 (supplied by merkur-kun in bug report #3028479)
{"pq2", "", {
@@ -2725,7 +2727,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "77f02def3094af804fd2371db25b7100", 541261},
{"resource.003", 0, "77f02def3094af804fd2371db25b7100", 587511},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 2 - Japanese PC-98 (also includes english language)
// SCI interpreter version unknown
@@ -2735,7 +2737,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "05fdee43a228dd6ea4d1a92ccae3f788", 637662},
{"resource.003", 0, "05fdee43a228dd6ea4d1a92ccae3f788", 684395},
AD_LISTEND},
- Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 - English Amiga
// Executable scanning reports "1.004.024"
@@ -2748,7 +2750,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "630bfa65beb05f743552704ac2899dae", 759891},
{"resource.004", 0, "7b229fbdf30d670d0728cede3e984a7e", 838663},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 - German Amiga (also includes english language)
// Executable scanning reports "1.004.024"
@@ -2762,7 +2764,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "6258d5dd85898d8e218eb8113ebc9059", 722738},
{"resource.005", 0, "6258d5dd85898d8e218eb8113ebc9059", 704485},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 - English DOS (from the Police Quest Collection)
// Executable scanning reports "T.A00.178", VERSION file reports "1.00"
@@ -2775,7 +2777,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "8791b9eef53edf77c2dac950142221d3", 1159791},
{"resource.004", 0, "1b91e891a3c60a941dac0eecdf83375b", 1143606},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 - English DOS Non-Interactive Demo
// Executable scanning reports "T.A00.052"
@@ -2785,7 +2787,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "277f97771f7a6d89677141f02da313d6", 65150},
{"resource.001", 0, "5c5a551b6c86cce2ee75becb90e0b586", 624411},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 - German DOS (supplied by markcoolio in bug report #2723837, also includes english language)
// Executable scanning reports "T.A00.178"
@@ -2798,14 +2800,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "4836f460f4cfc8de61e2df4c45775504", 1180956},
{"resource.004", 0, "0c3eb84b9755852d9e795e0d5c9373c7", 1171760},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 - Spanish DOS v1.000 - Supplied by dianiu in bug report #3555647
{"pq3", "", {
{"resource.map", 0, "ffa0b4631c4e36d69631256d19ba29e7", 5421},
{"resource.000", 0, "5ee460af3d70c06a745cc482b6c783ba", 5410263},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 3 EGA
// Reported by musiclyinspired in bug report #3046573
@@ -2818,7 +2820,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "b96a86ab681769e4cbb439670d967ca6", 449682},
{"resource.005", 0, "9e6c53a0e7eef53694d260fade8b1fc7", 724000},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 4 - English DOS Non-Interactive Demo (from FRG)
// SCI interpreter version 1.001.096
@@ -2826,7 +2828,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "be56f87a1c4a13062a30a362df860c2f", 1472},
{"resource.000", 0, "527d5684016e6816157cd15d9071b11b", 1121310},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Police Quest 4 - English DOS CD (from the Police Quest Collection)
@@ -2835,7 +2837,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "379dfe80ed6bd16c47e4b950c4722eac", 11374},
{"resource.000", 0, "fd316a09b628b7032248139003369022", 18841068},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 4 - German DOS CD (German text, English speech)
// Supplied by markcoolio in bug report #3392955
@@ -2843,7 +2845,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a398076371ed0e1e706c8f9fb9fc7ac5", 11386},
{"resource.000", 0, "6ff21954e0a2c5992279e7eb787c8d56", 18918747},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 4 - English DOS
// SCI interpreter version 2.000.000 (a guess?)
@@ -2851,7 +2853,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "aed9643158ccf01b71f359db33137f82", 9895},
{"resource.000", 0, "da383857b3be1e4514daeba2524359e0", 15141432},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 4 - French DOS (supplied by abevi in bug report #2612718)
// SCI interpreter version 2.000.000
@@ -2859,7 +2861,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "008030846edcc7c5c7a812c7f4ae4ceb", 9256},
{"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730153},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest 4 - German DOS (supplied by markcoolio in bug report #2723840)
// SCI interpreter version 2.000.000 (a guess?)
@@ -2867,7 +2869,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "2393ee728ab930b2762cb5889f9b5aff", 9256},
{"resource.000", 0, "6ba98bd2e436739d87ecd2a9b99cabb4", 14730155},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest: SWAT - English DOS/Windows Demo (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "0.001.200"
@@ -2875,7 +2877,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8c96733ef94c21526792f7ca4e3f2120", 1648},
{"resource.000", 0, "d8892f1b8c56c8f7704325460f49b300", 3676175},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest: SWAT - English DOS (from GOG.com)
// Executable scanning reports "2.100.002", VERSION file reports "1.0c"
@@ -2883,7 +2885,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "1c2563fee189885e29d9348f37306d94", 12175},
{"ressci.000", 0, "b2e1826ca81ce2e7e764587f5a14eee9", 127149181},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Police Quest: SWAT - English Windows (from the Police Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.0c"
@@ -2898,7 +2900,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.004", 0, "4228038906f041623e65789500b22285", 6835},
{"ressci.004", 0, "b7e619e6ecf62fe65d5116a3a422e5f0", 46223872},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI32
// Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by merkur in bug report #2718784)
@@ -2911,7 +2913,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 642203},
{"resource.004", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 641688},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy (supplied by alonzotg in bug report #3206006)
{"qfg1", "", {
@@ -2922,7 +2924,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 642203},
{"resource.004", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 641688},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS 3.5" Floppy v1.102 Int#0.000.629 (suppled by digitoxin1 in bug report #3554611)
{"qfg1", "", {
@@ -2933,7 +2935,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "f0af87c60ec869946da442833aa5afa8", 640502},
{"resource.004", 0, "f0af87c60ec869946da442833aa5afa8", 644575},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS 5.25" Floppy v1.102 Int#0.000.629 (suppled by digitoxin1 in bug report #3554611)
{"qfg1", "", {
@@ -2947,7 +2949,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "48b2b3c964dcbeccb68e984e6d4e97db", 278473},
{"resource.007", 0, "f0af87c60ec869946da442833aa5afa8", 269237},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS 5.25" Floppy (supplied by markcoolio in bug report #2723843)
// Executable scanning reports "0.000.566"
@@ -2962,7 +2964,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "69366c2a2f99917199fe1b60a4fee19d", 267852},
{"resource.007", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 272747},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS 5.25" Floppy (supplied by ssburnout in bug report #3049193)
// 1.001 10x5.25" (label: INT.#0.000.566)
@@ -2977,7 +2979,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "69366c2a2f99917199fe1b60a4fee19d", 267852},
{"resource.007", 0, "7ab2bf8e224b57f75e0cd6e4ba790761", 272747},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS 5.25" Floppy (supplied by ssburnout in bug report #3049193)
// 1.200 10x5.25" (label: INT#9.10.90)
@@ -2992,7 +2994,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "f46690dca714abc8c89357d30e363dd3", 278387},
{"resource.007", 0, "951299a82a8134ed12c5c18118d45c2f", 269173},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 / Hero's Quest - English DOS Demo
// Executable scanning reports "0.000.685"
@@ -3000,7 +3002,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "df34c758cbb9026da175793ff686b0e6", 882},
{"resource.001", 0, "73fbaafdd313b39aeedb80fbf85ecef1", 389884},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 - Japanese PC-98 5.25" Floppy (also includes English language)
// Executable scanning reports "S.old.201"
@@ -3010,7 +3012,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "a21451ef6fa8179bd4b22c4950004c44", 1136968},
{"resource.003", 0, "a21451ef6fa8179bd4b22c4950004c44", 769897},
AD_LISTEND},
- Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO3(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_EGA_UNDITHER) },
+ Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO3(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_EGA_UNDITHER) },
// Quest for Glory 1 - Japanese PC-98 5.25" Floppy (also includes English language)
// Executable scanning reports "S.old.201"
@@ -3020,7 +3022,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "a21451ef6fa8179bd4b22c4950004c44", 1147121},
{"resource.003", 0, "a21451ef6fa8179bd4b22c4950004c44", 777575},
AD_LISTEND},
- Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO3(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_EGA_UNDITHER) },
+ Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO3(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_EGA_UNDITHER) },
// Quest for Glory 1 - English Amiga
// Executable scanning reports "1.002.020"
@@ -3034,7 +3036,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "16cd4414c37ae3bb6d6da33dce8e25e8", 689124},
{"resource.005", 0, "5f3386ef2f2b1254e4a066f5d9027324", 609529},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 - English DOS
// SCI interpreter version 0.000.629
@@ -3046,7 +3048,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "951299a82a8134ed12c5c18118d45c2f", 640483},
{"resource.004", 0, "951299a82a8134ed12c5c18118d45c2f", 644443},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 VGA Remake - English DOS
// Executable scanning reports "2.000.411"
@@ -3054,7 +3056,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a731fb6c9c0b282443f7027bc8694d4c", 8469},
{"resource.000", 0, "ecace1a2771846b1a8aa1afdd44111a0", 6570147},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 VGA Remake - English DOS Non-Interactive Demo (from FRG)
// SCI interpreter version 1.001.029
@@ -3062,7 +3064,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ac0257051c95a59c0cdc0be24d9b11fa", 729},
{"resource.000", 0, "ec6f5cf369054dd3e5392995e9975b9e", 768218},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 1 VGA Remake - English Macintosh Floppy
// VERSION file reports "2.0"
@@ -3070,7 +3072,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data1", 0, "106527ff8756e4e1a795d63d23e8b833", 1752358},
{"Data2", 0, "5cdd92033231159c6e9c71d43e9f194d", 6574746},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English Amiga
// Executable scanning reports "1.003.004"
@@ -3086,7 +3088,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "ccf5dba33e5cab6d5872838c0f8db44c", 500039},
{"resource.007", 0, "4c9fc1587545879295cb9627f56a2cb8", 575056},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English (supplied by ssburnout in bug report #3049193)
// 1.000 5x5.25" (label: INT#10.31.90)
@@ -3098,7 +3100,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "0790f67d87642132be515cab05026baa", 972144},
{"resource.004", 0, "2ac1e6fea9aa1f5b91a06693a67b9766", 982830},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English (supplied by ssburnout in bug report #3049193)
// 1.000 9x3.5" (label: INT#10.31.90)
@@ -3113,7 +3115,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "5e9deacbdb17198ad844988e04833520", 498593},
{"resource.007", 0, "2ac1e6fea9aa1f5b91a06693a67b9766", 490151},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English (from FRG)
// Executable scanning reports "1.000.072"
@@ -3125,7 +3127,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "b192607c42f6960ecdf2ad2e4f90e9bc", 972804},
{"resource.004", 0, "cd2de58e27665d5853530de93fae7cd6", 983617},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English DOS
// Executable scanning reports "1.000.072"
@@ -3140,7 +3142,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
{"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English DOS (supplied by digitoxin1 in bug report #3554614)
// v1.102 9x3.5" (label: Int#11.20.90)
@@ -3155,7 +3157,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "b1944bd664ddbd2859cdaa0c4a0d6281", 507489},
{"resource.007", 0, "cd2de58e27665d5853530de93fae7cd6", 490794},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 2 - English DOS Non-Interactive Demo
// Executable scanning reports "1.000.046"
@@ -3163,7 +3165,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "e75eb86bdd517b3ef709058249986a87", 906},
{"resource.001", 0, "9b098f9e1008abe30e56c93b896494e6", 362123},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - English DOS Non-Interactive Demo (from FRG)
// Executable scanning reports "1.001.021", VERSION file reports "1.000, 0.001.059, 6.12.92"
@@ -3171,7 +3173,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "fd71de9b588a45f085317caacf050e91", 687},
{"resource.000", 0, "b6c69bf6c18bf177492249fe81fc6a6d", 648702},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - English DOS
// SCI interpreter version 1.001.050
@@ -3179,7 +3181,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868000},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - English DOS (supplied by abevi in bug report #2612718)
// SCI interpreter version 1.001.050
@@ -3187,7 +3189,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "62c185d190363d7df06330fa0cc45b36", 5958},
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5867442},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - English DOS (supplied by dknute in bug report #3125559)
{"qfg3", "", {
@@ -3195,7 +3197,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868042},
{"resource.msg", 0, "27e5419c98ce444253f88c95dced14a9", 246888},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - German DOS (supplied by markcoolio in bug report #2723846)
// Executable scanning reports "L.rry.083"
@@ -3203,7 +3205,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "19e2bf9b693932b5e2bb59b9f9ab86c9", 5958},
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868042},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - French DOS v1.1 (supplied by misterhands in bug report #3586214)
// Executable scanning reports "L.rry.083"
@@ -3212,7 +3214,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868000},
{"resource.msg", 0, "0fa1047002df904b8d1807bb7bab4fab", 267210},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - Spanish DOS CD (from jvprat)
// Executable scanning reports "L.rry.083", VERSION file reports "1.000.000, June 30, 1994"
@@ -3221,7 +3223,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "ba7ac86155e4c531e46cd73c86daa80a", 5884098},
{"resource.msg", 0, "a63974730d294dec0bea10057c36e506", 256014},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 3 - Italian DOS
// Supplied by ghoost in bug report #3053457
@@ -3230,7 +3232,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "6178ad2e83e58e4671ca03315f7a6498", 5868000},
{"resource.msg", 0, "5a0a896ff3e4a628db38a75eb6c84114", 259018},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 4 - English DOS Non-Interactive Demo (from FRG)
// SCI interpreter version 1.001.069 (just a guess)
@@ -3238,7 +3240,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "1ba7c7ae1efb315326d45cb931569b1b", 922},
{"resource.000", 0, "41ba03f0b188b029132daa3ece0d3e14", 623154},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Quest for Glory 4 1.1 Floppy - English DOS (supplied by markcool in bug report #2723852)
@@ -3247,7 +3249,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "685bdb1ed47bbbb0e5e25db392da83ce", 9301},
{"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11004993},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 4 1.1 Floppy - English DOS (supplied by abevi in bug report #2612718)
// SCI interpreter version 2.000.000
@@ -3255,7 +3257,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "d10a4cc177d2091d744e2ad8c049b0ae", 9295},
{"resource.000", 0, "f64fd6aa3977939a86ff30783dd677e1", 11003589},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 4 1.1 Floppy - German DOS (supplied by markcool in bug report #2723850)
// Executable scanning reports "2.000.000", VERSION file reports "1.1"
@@ -3263,7 +3265,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "9e0abba8746f40565bc7eb5720522ecd", 9301},
{"resource.000", 0, "57f22cdc54eeb35fce1f26b31b5c3ee1", 11076197},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Quest for Glory 4 CD - English DOS/Windows (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -3271,7 +3273,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "aba367f2102e81782d961b14fbe3d630", 10246},
{"resource.000", 0, "263dce4aa34c49d3ad29bec889007b1c", 11571394},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// RAMA - English DOS/Windows Demo
// Executable scanning reports "2.100.002", VERSION file reports "000.000.008"
@@ -3279,7 +3281,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.001", 0, "775304e9b2a545156be4d94209550094", 1393},
{"ressci.001", 0, "259437fd75fdf51e8207fda8c01fa4fd", 2334384},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI3_GAMES
// RAMA - English Windows (from jvprat)
@@ -3292,7 +3294,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.003", 0, "31ef4c0621711585d031f0ae81707251", 1636},
{"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6860492},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// RAMA - English Windows (from Quietust, in bug report #2850645)
{"rama", "", {
@@ -3303,18 +3305,18 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.003", 0, "48841e4b84ef1b98b48d43566fda9e13", 1636},
{"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6870356},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// RAMA - German Windows CD (from farmboy0, in pull request 397)
{"rama", "", {
{"resmap.001", 0, "f68cd73308c46977a9632dfc618e1e38", 8338},
- {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70595521},
- {"resmap.002", 0, "891fc2f5d9e23e7d9a9454acc7aaae52", 12082},
- {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128508558},
- {"resmap.003", 0, "222096000bd83a1d56577114a452cccf", 1636},
- {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6954219},
+ {"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70595521},
+ {"resmap.002", 0, "891fc2f5d9e23e7d9a9454acc7aaae52", 12082},
+ {"ressci.002", 0, "2a68edd064e5e4937b5e9c74b38f2082", 128508558},
+ {"resmap.003", 0, "222096000bd83a1d56577114a452cccf", 1636},
+ {"ressci.003", 0, "2a68edd064e5e4937b5e9c74b38f2082", 6954219},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// RAMA - Italian Windows CD (from glorifindel)
// SCI interpreter version 3.000.000 (a guess?)
@@ -3322,7 +3324,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.001", 0, "2a68edd064e5e4937b5e9c74b38f2082", 70611091},
{"resmap.001", 0, "70ba2ff04a2b7fb2c52420ba7fbd47c2", 8338},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI3_GAMES
// Shivers - English Windows (from jvprat)
@@ -3331,14 +3333,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "f2ead37749ed8f6535a2445a7d05a0cc", 46525},
{"ressci.000", 0, "4294c6d7510935f2e0a52e302073c951", 262654836},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Shivers - German Windows (from Tobis87)
{"shivers", "", {
{"resmap.000", 0, "f483d0a1f78334c18052e92785c3086e", 46537},
{"ressci.000", 0, "6751b144671e2deed919eb9d284b07eb", 262390692},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Shivers - English Windows Demo
// Executable scanning reports "2.100.002"
@@ -3346,7 +3348,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "d9e0bc5eddefcbe47f528760085d8927", 1186},
{"ressci.000", 0, "3a93c6340b54e07e65d0e5583354d186", 10505469},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Shivers 2 doesn't contain SCI scripts. The whole game logic has
// been reimplemented from SCI in native code placed in DLL files.
@@ -3364,7 +3366,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "d8659188b84beaef076bd869837cd530", 634},
{"ressci.000", 0, "7fbac0807a044c9543e8ac376d200e59", 4925003},
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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Shivers 2 - English Windows (from abevi)
// VERSION.TXT Version 1.0 (3/25/97)
@@ -3372,7 +3374,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.001", 0, "a79d03d6eb75be0a79324f14e3d2ace4", 95346793},
{"resmap.001", 0, "a4804d436d90c4ec2e46b537f5e954db", 6268},
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, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif
@@ -3385,7 +3387,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.msg", 0, "1aeafe2b495de288d002109650b66614", 1364},
{"resource.000", 0, "8e10d4f05c1fd9f883384fa38a898489", 377394},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Slater & Charlie Go Camping - English DOS/Windows
{"slater", "", {
@@ -3393,7 +3395,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "21f85414124dc23e54544a5536dc35cd", 4044},
{"resource.msg", 0, "c44f51fb955eae266fecf360ebcd5ad2", 1132},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Slater & Charlie Go Camping - English DOS/Windows (Sierra Originals)
@@ -3402,14 +3404,14 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "21f85414124dc23e54544a5536dc35cd", 4044},
{"resource.msg", 0, "c44f51fb955eae266fecf360ebcd5ad2", 1132},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Slater & Charlie Go Camping - English Macintosh
{"slater", "", {
{"Data1", 0, "7243b4390e5f0182d8133fbcae4b50c5", 2298853},
{"Data2", 0, "6b6f18f9b502dc0923eeae0ef47f02d5", 2276956},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO1(GUIO_NONE) },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK, GUIO1(GUIO_NONE) },
// Space Quest 1 VGA Remake - English Amiga (from www.back2roots.org)
// SCI interpreter version 1.000.510 (just a guess)
@@ -3422,7 +3424,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "b25a1539c71701f7715f738c5037e9a6", 775515},
{"resource.005", 0, "640ffe1a9acde392cc33cc1b1a528328", 806324},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 1 VGA Remake - English DOS (from the Space Quest Collection)
// Executable scanning reports "T.A00.081", VERSION file reports "2.000"
@@ -3435,7 +3437,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "c47600e50c6fc591957ae0c5020ee7b8", 1213262},
{"resource.004", 0, "e19ea4ad131472f9238590f2e1d40289", 1203051},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 1 VGA Remake - English Mac (from Fingolfin)
{"sq1sci", "SCI", {
@@ -3446,7 +3448,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "ae46e195e66df5a131917f0aa80b5669", 1242794},
{"resource.004", 0, "91d58a9eb2187c38424990afe4c12bc6", 1250949},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 1 VGA Remake - English Non-Interactive Demo (from FRG)
// SCI interpreter version 1.000.181
@@ -3454,7 +3456,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "5af709ac5e0e923e0b8174f49978c30e", 636},
{"resource.001", 0, "fd99ea43f57576ded7c86036996346cf", 507642},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 1 VGA Remake - Spanish DOS Floppy (from jvprat)
// Executable scanning reports "T.A00.081", VERSION file reports "2.000"
@@ -3468,7 +3470,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "9b78228ad4f9f335fedf74f1812dcfca", 513325},
{"resource.005", 0, "7d4ebcb745c0bf8fc42e4013f52ecd49", 1101812},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest I 2.0 EGA DOS (6 x 3.5" disks)
// Provided by ssburnout in bug report #3046805
@@ -3481,7 +3483,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "975c6e81194ae6b65e960a248129ecaa", 684119},
{"resource.005", 0, "13d96f7905637552c0647175ff816145", 695589},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - English Amiga (from www.back2roots.org)
// SCI interpreter version 0.000.453 (just a guess)
@@ -3492,7 +3494,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 746496},
{"resource.004", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 761984},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - German Amiga (also includes english language)
// Executable scanning reports "1.004.006"
@@ -3513,7 +3515,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ec66ac2b1ce58b2575ba00b65058de1a", 612},
{"resource.001", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 180245},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - English DOS (provided by richiefs in bug report #2670691)
// SCI interpreter version 0.000.453
@@ -3523,7 +3525,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 720244},
{"resource.003", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 688367},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - English DOS (from the Space Quest Collection)
// Executable scanning reports "0.000.685", VERSION file reports "1.018"
@@ -3533,7 +3535,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 715777},
{"resource.003", 0, "8b55c4875298f45ea5696a5ee8f6a7fe", 703370},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - English DOS (from abevi, bug report #2612718)
{"sq3", "", {
@@ -3545,7 +3547,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 328278},
{"resource.006", 0, "ceeda7202b96e5c85ecaa88a40a540fc", 356702},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - English Mac (from Fingolfin)
{"sq3", "", {
@@ -3554,7 +3556,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "0d8dfe42683b46f3131823233a91ce6a", 794072},
{"resource.003", 0, "0d8dfe42683b46f3131823233a91ce6a", 776536},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 - German DOS (from Tobis87, also includes english language)
// SCI interpreter version 0.000.453 (?)
@@ -3568,7 +3570,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.006", 0, "9107c2aa5398e28b5c5406df13491f85", 320643},
{"resource.007", 0, "9107c2aa5398e28b5c5406df13491f85", 344287},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 3 v1.052 - German DOS (supplied by markcoolio in bug report #2723860, also includes english language)
// Executable scanning reports "S.old.114"
@@ -3578,7 +3580,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "9107c2aa5398e28b5c5406df13491f85", 596768},
{"resource.003", 0, "9107c2aa5398e28b5c5406df13491f85", 693573},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English Amiga
// Executable scanning reports "1.004.024"
@@ -3593,7 +3595,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "3540d1cc84d674cf4b2c898b88a3b563", 790296},
{"resource.006", 0, "ade814bc4d56244c156d9e9bcfebbc11", 664085},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - German Amiga (from www.back2roots.org, also includes english language)
// SCI interpreter version 1.000.200 (just a guess)
@@ -3607,7 +3609,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "10ee1709e6559c724676d058199b75b5", 818745},
{"resource.006", 0, "67fb188b191d88efe8414af6ea297b93", 672675},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformAmiga, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English DOS - THIS VERSION IS PIRATED/CRACKED AND REPACKAGED =DO NOT RE-ADD=
// Executable scanning reports "1.000.753"
@@ -3616,7 +3618,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a18088c8aceb06025dbc945f29e02935", 5124},
{"resource.000", 0, "e1f46832cd2458796028e054a0466031", 5502009},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_PIRATED, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_PIRATED, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English DOS
// Executable scanning reports "1.000.753"
@@ -3625,7 +3627,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "71ccf4f82ac4efb588731acfb7bf2603", 5646},
{"resource.000", 0, "e1f46832cd2458796028e054a0466031", 933928},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 1.052 - English DOS Floppy (supplied by markcoolio in bug report #2723865)
// Executable scanning reports "1.000.753"
@@ -3639,7 +3641,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "ff9c87da3bc53473fdee8b9d3edbc93c", 1200631},
{"resource.005", 0, "e33019ac19f755ae33fbf49b4fc9066c", 1053294},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 1.000 - French DOS Floppy (supplied by misterhands in bug report #3515247)
{"sq4", "", {
@@ -3652,7 +3654,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "b2cca3afcf2e013b8ce86b64155af766", 1254353},
{"resource.005", 0, "9e520577e035547c4b5149a6d12ef85b", 1098814},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 1.000 - English DOS Floppy (from abevi, bug report #2612718)
{"sq4", "", {
@@ -3664,7 +3666,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "c06350184a490c10eb4585fff0aa3192", 1254368},
{"resource.005", 0, "b8d6efbd3235329bfe844c794097b2c9", 1098717},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest IV DOS 1.060 EGA (6 x 3.5" disks)
// Supplied by ssburnout in bug report #3046781
@@ -3677,7 +3679,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "9a673e33c3f6dd560b993ffed77eeb49", 534994},
{"resource.005", 0, "3c4841d0a3ebba4404af588c93620c22", 595465},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO5(GUIO_NOSPEECH, GAMEOPTION_EGA_UNDITHER, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - German DOS (from Tobis87, also includes english language)
// SCI interpreter version 1.000.200 (just a guess)
@@ -3691,7 +3693,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "47ee647b5b12232d27e63cc627c25899", 1156765},
{"resource.006", 0, "dfb023e4e2a1e7a00fa18f9ede72a91b", 924059},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - Italian DOS Floppy (from glorifindel, also includes english language)
// SCI interpreter version 1.000.200 (just a guess)
@@ -3704,7 +3706,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "4277c61bed40a50dadc4b5a344520af2", 1251000},
{"resource.005", 0, "5f885abd335978e2fd4e5f886d7676c8", 1102880},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - Japanese PC-98 5.25" Floppy (also includes english language)
// SCI interpreter version 1.000.1068
@@ -3714,7 +3716,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "454684e3a7a68cbca073945e50778447", 1187088},
{"resource.002", 0, "6dc668326cc22cb9e8bd8ca9e68d2a66", 1181249},
AD_LISTEND},
- Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - Japanese PC-98 5.25" Floppy (also includes english language)
// SCI interpreter version 1.000.1068
@@ -3724,7 +3726,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.001", 0, "454684e3a7a68cbca073945e50778447", 1187088},
{"resource.002", 0, "6dc668326cc22cb9e8bd8ca9e68d2a66", 1181249},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English DOS CD (from the Space Quest Collection)
// Executable scanning reports "1.001.064", VERSION file reports "1.0"
@@ -3732,7 +3734,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ed90a8e3ccc53af6633ff6ab58392bae", 7054},
{"resource.000", 0, "63247e3901ab8963d4eece73747832e0", 5157378},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO4(GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD, GUIO4(GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English Windows CD (from the Space Quest Collection)
// Executable scanning reports "1.001.064", VERSION file reports "1.0"
@@ -3742,7 +3744,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "ed90a8e3ccc53af6633ff6ab58392bae", 7054},
{"resource.000", 0, "63247e3901ab8963d4eece73747832e0", 5157378},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO5(GUIO_MIDIGM, GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_CD, GUIO5(GUIO_MIDIGM, GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English DOS CD patch 1.2 (unofficial - NRS) - THIS VERSION IS PIRATED/CRACKED AND REPACKAGED =DO NOT RE-ADD=
// In essence, this "patch" includes a mixture the CD and floppy versions (the whole game), without the speech file
@@ -3750,7 +3752,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "38287a646458a1dabded55d094407793", 7139},
{"resource.000", 0, "231fd8421e1f211e1bcf9d7b8b6408e7", 9525849},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_PIRATED, GUIO4(GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_PIRATED, GUIO4(GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - Spanish DOS CD (from jvprat, is still text only, not talkie, also includes english language)
// Executable scanning reports "1.SQ4.057", VERSION file reports "1.000"
@@ -3764,7 +3766,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "776fba81c110d1908776232cbe190e20", 1253752},
{"resource.005", 0, "55fae26c2a92f16ef72c1e216e827c0f", 1098328},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GAMEOPTION_SQ4_SILVER_CURSORS, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - Spanish DOS Floppy (from jvprat, also includes english language)
// Executable scanning reports "1.SQ4.056", VERSION file reports "1.000"
@@ -3776,7 +3778,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.002", 0, "74c62fa2146ff3b3b2ea2b3fb95b9af9", 1140801},
{"resource.003", 0, "42a307941edeb1a3be31daeb2e4be90b", 1088408},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 1.000 - German DOS Floppy (supplied by markcoolio in bug report #2723862, also includes english language)
// Executable scanning reports "1.SQ4.030"
@@ -3790,7 +3792,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "c06350184a490c10eb4585fff0aa3192", 1254368},
{"resource.005", 0, "b8d6efbd3235329bfe844c794097b2c9", 1098717},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - English Macintosh
// Executable scanning reports "x.yyy.zzz"
@@ -3805,7 +3807,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.005", 0, "869d16cab6641c80b06f4dcee18f86bc", 1426228},
{"resource.006", 0, "91d23407bc0447a3722fbeb952d7edee", 1402451},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 4 - Russian DOS
// Executable scanning reports "1.000.753", VERSION file reports "1.994"
@@ -3818,7 +3820,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.004", 0, "2763fe4f0cb74df716ec8b0c464b0988", 1217428},
{"resource.005", 0, "d608713197c5ba1cd8c6ed46299c3069", 1057924},
AD_LISTEND},
- Common::RU_RUS, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::RU_RUS, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 - English DOS (from the Space Quest Collection)
// Executable scanning reports "1.001.068", VERSION file reports "1.04"
@@ -3827,7 +3829,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
{"resource.msg", 0, "bb8ad78793c26bdb3f77498b1d6515a9", 125988},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 - English DOS - THIS IS THE UNOFFICIAL BETA VERSION, WHICH IS OBVIOUSLY PIRATED AND CONTAINS MANY BUGS
// refer to http://www.akril15.com/sr/sq5alt/sq5alt.html =DO NOT RE-ADD=
@@ -3836,7 +3838,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8bde0a9adb9a3e9aaa861826874c9834", 6473},
{"resource.000", 0, "f4a48705764544d7cc64a7bb22a610df", 6025184},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_PIRATED, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_PIRATED, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 v1.04 - German DOS (from Tobis87, updated information by markcool from bug reports #2723935 and #2724762)
// SCI interpreter version 1.001.068
@@ -3845,7 +3847,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
{"resource.msg", 0, "7c71cfc36153cfe07b450423a51f7e68", 146282},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 v1.04 - French DOS (from Hkz, Included in Space Quest Collector's Edition, with chapters I-V)
{"sq5", "", {
@@ -3853,7 +3855,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "4147edc5045e6d62998018b5614c58ec", 5496486},
{"resource.msg", 0, "877c42380320eb1db7dad83ccd261214", 140374},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 - Italian DOS Floppy (from glorifindel)
// SCI interpreter version 1.001.068 (just a guess)
@@ -3861,7 +3863,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "5040026519f37199f3616fb1d4704dff", 6047170},
{"resource.map", 0, "5b09168baa2f6e2e22787429b2d72f54", 6492},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 - Spanish DOS Floppy (from mirir, bug report #3090664)
{"sq5", "", {
@@ -3869,7 +3871,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "5714a899033bdebf2d61ad333c8c6637", 6492},
{"resource.msg", 0, "46deca7ef9cf057f7d442df98c1a2ae2", 134612},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 5 - Russian DOS
// Executable scanning reports "1.001.068", VERSION file reports "1.994"
@@ -3878,7 +3880,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "6f9ed21e1001526b4137f6703ed476af", 6103778},
{"resource.msg", 0, "0a8931990cd2eac1691602391c68ab85", 147580},
AD_LISTEND},
- Common::RU_RUS, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::RU_RUS, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Space Quest 6 - English DOS/Win3.11 CD (from the Space Quest Collection)
@@ -3887,7 +3889,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "6dddfa3a8f3a3a513ec9dfdfae955005", 10528},
{"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 6 - English DOS/Win3.11 CD ver 1.11 (from FRG)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3895,7 +3897,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "e0615d6e4e10e37ae42e6a2a95aaf145", 10528},
{"resource.000", 0, "c4259ab7355aead07773397b1052827d", 41150806},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 6 - French DOS/Win3.11 CD (from French magazine Joystick - September 1997)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -3903,7 +3905,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "3c831625931d5079b73ae8c275f52c95", 10534},
{"resource.000", 0, "4195ca940f759424f62b90e262cc1737", 40932397},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 6 - German DOS (from Tobis87, updated info from markcoolio in bug report #2723884)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3911,7 +3913,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "664d797415484f85c90b1b45aedc7686", 10534},
{"resource.000", 0, "ba87ba91e5bdabb4169dd0df75777722", 40933685},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_CD | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Space Quest 6 - English DOS/Win3.11 Interactive Demo (from FRG)
// SCI interpreter version 2.100.002 (just a guess)
@@ -3919,7 +3921,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "368f07b07433db3f819fa3fa0e5efee5", 2572},
{"resource.000", 0, "ab12724e078dea34b624e0d2a38dcd7c", 2272050},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI32
// The Island of Dr. Brain - English DOS CD (from jvprat)
@@ -3928,7 +3930,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "2388efef8430b041b0f3b00b9050e4a2", 3281},
{"resource.000", 0, "b3acd9b9dd7fe53c4ee133ac9a1acfab", 2103560},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO3(GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// The Island of Dr. Brain - English DOS (from Quietust)
// Executable scanning reports "1.001.053", VERSION file reports "1.1 2.3.93"
@@ -3936,7 +3938,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "3c07da06bdd1689f9d07af78fb94d0ec", 3101},
{"resource.000", 0, "ecc686e0034fb4d41de077ac7167b3cf", 1947866},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// The Island of Dr. Brain - English DOS Non-Interactive Demo
// SCI interpreter version 1.001.053 (just a guess)
@@ -3944,7 +3946,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "a8e5ca8ed1996974afa59f4c45e06195", 986},
{"resource.000", 0, "b3acd9b9dd7fe53c4ee133ac9a1acfab", 586560},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_DEMO, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#ifdef ENABLE_SCI32
// Torin's Passage - English Windows Interactive Demo
@@ -3953,7 +3955,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, 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
@@ -3961,7 +3963,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, 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"
@@ -3970,7 +3972,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, 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
@@ -3978,7 +3980,7 @@ 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, 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
@@ -3986,7 +3988,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, 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
@@ -3994,7 +3996,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, 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
@@ -4002,7 +4004,19 @@ 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, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // Torin's Passage - English Macintosh
+ {"torin", "", {
+ {"Data1", 0, "63887e33cc282c92dc1f916f54aea8eb", 700786},
+ {"Data2", 0, "da2f13be2819a7333fee372d38b8d1a2", 122485},
+ {"Data3", 0, "e9fda4f1714ddb443545ba8a2d58ef18", 7299126},
+ {"Data4", 0, "59b432ec35b24a216432a556e25087ef", 7209309},
+ {"Data5", 0, "189e809f24aee83c707dea03a543c7c4", 6615563},
+ {"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) },
#endif // ENABLE_SCI32
// SCI Fanmade Games
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index c6635f2f27..b940eca6f5 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -718,7 +718,7 @@ reg_t kSave(EngineState *s, int argc, reg_t *argv) {
reg_t kSaveGame(EngineState *s, int argc, reg_t *argv) {
Common::String game_id;
- int16 virtualId = argv[1].toSint16();
+ int16 virtualId = argv[1].toSint16();
int16 savegameId = -1;
Common::String game_description;
Common::String version;
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index e4b3028bcd..79ab2d138b 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -185,7 +185,8 @@ static reg_t kSetCursorSci11(EngineState *s, int argc, reg_t *argv) {
hotspot = new Common::Point(argv[3].toSint16(), argv[4].toSint16());
// Fallthrough
case 3:
- if (g_sci->getPlatform() == Common::kPlatformMacintosh) {
+ if (g_sci->getPlatform() == Common::kPlatformMacintosh && g_sci->getGameId() != GID_TORIN) {
+ // Torin Mac seems to be the only game that uses view cursors
delete hotspot; // Mac cursors have their own hotspot, so ignore any we get here
g_sci->_gfxCursor->kernelSetMacCursor(argv[0].toUint16(), argv[1].toUint16(), argv[2].toUint16());
} else {
diff --git a/engines/sci/engine/object.cpp b/engines/sci/engine/object.cpp
index b28026b71f..6f219b388e 100644
--- a/engines/sci/engine/object.cpp
+++ b/engines/sci/engine/object.cpp
@@ -175,6 +175,7 @@ bool Object::initBaseObject(SegManager *segMan, reg_t addr, bool doInitSuperClas
_variables.resize(baseObj->getVarCount());
// Copy base from species class, as we need its selector IDs
_baseObj = baseObj->_baseObj;
+ assert(_baseObj);
if (doInitSuperClass)
initSuperClass(segMan, addr);
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index c60b50a964..ce9a672572 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -219,25 +219,30 @@ void SegManager::saveLoadWithSerializer(Common::Serializer &s) {
syncArray<Class>(s, _classTable);
- // Now that all scripts are loaded, init their objects
- for (uint i = 0; i < _heap.size(); i++) {
- if (!_heap[i] || _heap[i]->getType() != SEG_TYPE_SCRIPT)
- continue;
+ // Now that all scripts are loaded, init their objects.
+ // Just like in Script::initializeObjectsSci0, we do two passes
+ // in case an object is loaded before its base.
+ int passes = getSciVersion() < SCI_VERSION_1_1 ? 2 : 1;
+ for (int pass = 1; pass <= passes; ++pass) {
+ for (uint i = 0; i < _heap.size(); i++) {
+ if (!_heap[i] || _heap[i]->getType() != SEG_TYPE_SCRIPT)
+ continue;
- Script *scr = (Script *)_heap[i];
- scr->syncLocalsBlock(this);
+ Script *scr = (Script *)_heap[i];
+ scr->syncLocalsBlock(this);
- ObjMap objects = scr->getObjectMap();
- for (ObjMap::iterator it = objects.begin(); it != objects.end(); ++it) {
- reg_t addr = it->_value.getPos();
- Object *obj = scr->scriptObjInit(addr, false);
+ ObjMap objects = scr->getObjectMap();
+ for (ObjMap::iterator it = objects.begin(); it != objects.end(); ++it) {
+ reg_t addr = it->_value.getPos();
+ Object *obj = scr->scriptObjInit(addr, false);
- if (getSciVersion() < SCI_VERSION_1_1) {
- if (!obj->initBaseObject(this, addr, false)) {
- // TODO/FIXME: This should not be happening at all. It might indicate a possible issue
- // with the garbage collector. It happens for example in LSL5 (German, perhaps English too).
- warning("Failed to locate base object for object at %04X:%04X; skipping", PRINT_REG(addr));
- objects.erase(addr.toUint16());
+ if (pass == 2) {
+ if (!obj->initBaseObject(this, addr, false)) {
+ // TODO/FIXME: This should not be happening at all. It might indicate a possible issue
+ // with the garbage collector. It happens for example in LSL5 (German, perhaps English too).
+ warning("Failed to locate base object for object at %04X:%04X; skipping", PRINT_REG(addr));
+ objects.erase(addr.toUint16());
+ }
}
}
}
@@ -465,7 +470,7 @@ void Script::syncStringHeap(Common::Serializer &s) {
break;
} while (1);
- } else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1){
+ } else if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1){
// Strings in SCI1.1 come after the object instances
byte *buf = _heapStart + 4 + READ_SCI11ENDIAN_UINT16(_heapStart + 2) * 2;
@@ -484,7 +489,7 @@ void Script::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint32LE(_nr);
if (s.isLoading())
- load(_nr, g_sci->getResMan());
+ load(_nr, g_sci->getResMan(), g_sci->getScriptPatcher());
s.skip(4, VER(14), VER(22)); // OBSOLETE: Used to be _bufSize
s.skip(4, VER(14), VER(22)); // OBSOLETE: Used to be _scriptSize
s.skip(4, VER(14), VER(22)); // OBSOLETE: Used to be _heapSize
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp
index 6616a0ee13..c661a00185 100644
--- a/engines/sci/engine/script.cpp
+++ b/engines/sci/engine/script.cpp
@@ -32,7 +32,8 @@
namespace Sci {
-Script::Script() : SegmentObj(SEG_TYPE_SCRIPT), _buf(NULL) {
+Script::Script()
+ : SegmentObj(SEG_TYPE_SCRIPT), _buf(NULL) {
freeScript();
}
@@ -65,7 +66,7 @@ void Script::freeScript() {
_objects.clear();
}
-void Script::load(int script_nr, ResourceManager *resMan) {
+void Script::load(int script_nr, ResourceManager *resMan, ScriptPatcher *scriptPatcher) {
freeScript();
Resource *script = resMan->findResource(ResourceId(kResourceTypeScript, script_nr), 0);
@@ -136,7 +137,7 @@ void Script::load(int script_nr, ResourceManager *resMan) {
memcpy(_buf, script->data, script->size);
// Check scripts for matching signatures and patch those, if found
- patcherProcessScript(_nr, _buf, script->size);
+ scriptPatcher->processScript(_nr, _buf, script->size);
if (getSciVersion() >= SCI_VERSION_1_1 && getSciVersion() <= SCI_VERSION_2_1) {
Resource *heap = resMan->findResource(ResourceId(kResourceTypeHeap, _nr), 0);
diff --git a/engines/sci/engine/script.h b/engines/sci/engine/script.h
index 6a27dc7f64..9e016156b8 100644
--- a/engines/sci/engine/script.h
+++ b/engines/sci/engine/script.h
@@ -25,6 +25,7 @@
#include "common/str.h"
#include "sci/engine/segment.h"
+#include "sci/engine/script_patches.h"
namespace Sci {
@@ -96,13 +97,7 @@ public:
~Script();
void freeScript();
- void load(int script_nr, ResourceManager *resMan);
-
- void patcherProcessScript(uint16 scriptNr, byte *scriptData, const uint32 scriptSize);
- void patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacSci11);
- void patcherEnablePatch(SciScriptPatcherEntry *patchTable, const char *searchDescription);
- int32 patcherFindSignature(const SciScriptPatcherEntry *patchEntry, const byte *scriptData, const uint32 scriptSize, bool isMacSci11);
- void patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, bool isMacSci11);
+ void load(int script_nr, ResourceManager *resMan, ScriptPatcher *scriptPatcher);
virtual bool isValidOffset(uint16 offset) const;
virtual SegmentRef dereference(reg_t pointer);
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index 6293fb42ae..8f05cc1453 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -25,6 +25,7 @@
#include "sci/engine/script.h"
#include "sci/engine/state.h"
#include "sci/engine/features.h"
+#include "sci/engine/script_patches.h"
#include "common/util.h"
@@ -76,72 +77,29 @@ namespace Sci {
// You have to use the exact same order in both the table and the enum, otherwise
// it won't work.
-#define SIG_END 0xFFFF
-#define SIG_MISMATCH 0xFFFE
-#define SIG_COMMANDMASK 0xF000
-#define SIG_VALUEMASK 0x0FFF
-#define SIG_BYTEMASK 0x00FF
-#define SIG_MAGICDWORD 0xF000
-#define SIG_ADDTOOFFSET 0xE000
-#define SIG_SELECTOR16 0x9000
-#define SIG_SELECTOR8 0x8000
-#define SIG_UINT16 0x1000
-#define SIG_BYTE 0x0000
-
-#define PATCH_END SIG_END
-#define PATCH_COMMANDMASK SIG_COMMANDMASK
-#define PATCH_VALUEMASK SIG_VALUEMASK
-#define PATCH_BYTEMASK SIG_BYTEMASK
-#define PATCH_ADDTOOFFSET SIG_ADDTOOFFSET
-#define PATCH_GETORIGINALBYTE 0xD000
-#define PATCH_GETORIGINALBYTEADJUST 0xC000
-#define PATCH_SELECTOR16 SIG_SELECTOR16
-#define PATCH_SELECTOR8 SIG_SELECTOR8
-#define PATCH_UINT16 SIG_UINT16
-#define PATCH_BYTE SIG_BYTE
-
-// defines maximum scratch area for getting original bytes from unpatched script data
-#define PATCH_VALUELIMIT 4096
-
-struct SciScriptPatcherEntry {
- bool active;
- uint16 scriptNr;
- const char *description;
- int16 applyCount;
- uint32 magicDWord;
- int magicOffset;
- const uint16 *signatureData;
- const uint16 *patchData;
-};
-
-#define SCI_SIGNATUREENTRY_TERMINATOR { false, 0, NULL, 0, 0, 0, NULL, NULL }
-
-struct SciScriptPatcherSelector {
- const char *name;
- int16 id;
-};
-
-SciScriptPatcherSelector selectorTable[] = {
- { "cycles", -1, }, // system selector
- { "seconds", -1, }, // system selector
- { "init", -1, }, // system selector
- { "dispose", -1, }, // system selector
- { "new", -1, }, // system selector
- { "curEvent", -1, }, // system selector
- { "disable", -1, }, // system selector
- { "show", -1, }, // system selector
- { "x", -1, }, // system selector
- { "cel", -1, }, // system selector
- { "setMotion", -1, }, // system selector
- { "deskSarg", -1, }, // Gabriel Knight
- { "localize", -1, }, // Freddy Pharkas
- { "put", -1, }, // Police Quest 1 VGA
- { "solvePuzzle", -1, }, // Quest For Glory 3
- { "timesShownID", -1, }, // Space Quest 1 VGA
- { "startText", -1, }, // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
- { "startAudio", -1, }, // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
- { "modNum", -1, }, // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
- { NULL, -1 }
+static const char *const selectorNameTable[] = {
+ "cycles", // system selector
+ "seconds", // system selector
+ "init", // system selector
+ "dispose", // system selector
+ "new", // system selector
+ "curEvent", // system selector
+ "disable", // system selector
+ "doit", // system selector
+ "show", // system selector
+ "x", // system selector
+ "cel", // system selector
+ "setMotion", // system selector
+ "overlay", // system selector
+ "deskSarg", // Gabriel Knight
+ "localize", // Freddy Pharkas
+ "put", // Police Quest 1 VGA
+ "solvePuzzle", // Quest For Glory 3
+ "timesShownID", // Space Quest 1 VGA
+ "startText", // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
+ "startAudio", // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
+ "modNum", // King's Quest 6 CD / Laura Bow 2 CD for audio+text support
+ NULL
};
enum ScriptPatcherSelectors {
@@ -152,10 +110,12 @@ enum ScriptPatcherSelectors {
SELECTOR_new,
SELECTOR_curEvent,
SELECTOR_disable,
+ SELECTOR_doit,
SELECTOR_show,
SELECTOR_x,
SELECTOR_cel,
SELECTOR_setMotion,
+ SELECTOR_overlay,
SELECTOR_deskSarg,
SELECTOR_localize,
SELECTOR_put,
@@ -186,32 +146,32 @@ enum ScriptPatcherSelectors {
// We fix the script by patching in a jump to the proper code inside fawaz::doit.
// Responsible method: fawaz::handleEvent
// Fixes bug: #6402
-const uint16 camelotSignaturePeepingTom[] = {
- 0x72, SIG_MAGICDWORD, SIG_UINT16 + 0x7e, 0x07, // lofsa fawaz <-- start of proper initializion code
+static const uint16 camelotSignaturePeepingTom[] = {
+ 0x72, SIG_MAGICDWORD, SIG_UINT16(0x077e), // lofsa fawaz <-- start of proper initializion code
0xa1, 0xb9, // sag b9h
- SIG_ADDTOOFFSET +571, // skip 571 bytes
+ SIG_ADDTOOFFSET(+571), // skip 571 bytes
0x39, 0x7a, // pushi 7a <-- initialization code when walking automatically
0x78, // push1
0x7a, // push2
- 0x38, SIG_UINT16 + 0xa9, 0x00, // pushi 00a9 - script 169
+ 0x38, SIG_UINT16(0x00a9), // + 0xa9, 0x00, // pushi 00a9 - script 169
0x78, // push1
0x43, 0x02, 0x04, // call kScriptID
0x36, // push
0x81, 0x00, // lag 00
0x4a, 0x06, // send 06
- 0x32, SIG_UINT16 + 0x20, 0x05, // jmp [end of fawaz::handleEvent]
+ 0x32, SIG_UINT16(0x0520), // jmp [end of fawaz::handleEvent]
SIG_END
};
-const uint16 camelotPatchPeepingTom[] = {
- PATCH_ADDTOOFFSET +576,
- 0x32, PATCH_UINT16 + 0xbd, 0xfd, // jmp to fawaz::doit / properly init peepingTom code
+static const uint16 camelotPatchPeepingTom[] = {
+ PATCH_ADDTOOFFSET(+576),
+ 0x32, PATCH_UINT16(0xfdbd), // jmp to fawaz::doit / properly init peepingTom code
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry camelotSignatures[] = {
- { true, 62, "fix peepingTom Sierra bug", 1, 0, 0, camelotSignaturePeepingTom, camelotPatchPeepingTom },
+// script, description, signature patch
+static const SciScriptPatcherEntry camelotSignatures[] = {
+ { true, 62, "fix peepingTom Sierra bug", 1, camelotSignaturePeepingTom, camelotPatchPeepingTom },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -224,7 +184,7 @@ SciScriptPatcherEntry camelotSignatures[] = {
// Applies to at least: PC-CD
// Responsible method: stayAndHelp::changeState
// Fixes bug: #5107
-const uint16 ecoquest1SignatureStayAndHelp[] = {
+static const uint16 ecoquest1SignatureStayAndHelp[] = {
0x3f, 0x01, // link 01
0x87, 0x01, // lap param[1]
0x65, 0x14, // aTop state
@@ -236,12 +196,12 @@ const uint16 ecoquest1SignatureStayAndHelp[] = {
0x76, // push0
0x45, 0x01, 0x00, // callb export1 from script 0 (switching control off)
SIG_MAGICDWORD,
- 0x38, SIG_UINT16 + 0x22, 0x01, // pushi 0122
+ 0x38, SIG_UINT16(0x0122), // pushi 0122
0x78, // push1
0x76, // push0
0x81, 0x00, // lag global[0]
0x4a, 0x06, // send 06 - call ego::setMotion(0)
- 0x39, SIG_SELECTOR8 + SELECTOR_init, // pushi "init"
+ 0x39, SIG_SELECTOR8(init), // pushi "init"
0x39, 0x04, // pushi 04
0x76, // push0
0x76, // push0
@@ -253,34 +213,34 @@ const uint16 ecoquest1SignatureStayAndHelp[] = {
SIG_END
};
-const uint16 ecoquest1PatchStayAndHelp[] = {
+static const uint16 ecoquest1PatchStayAndHelp[] = {
0x87, 0x01, // lap param[1]
0x65, 0x14, // aTop state
0x36, // push
0x2f, 0x22, // bt [next state] (this optimization saves 6 bytes)
0x39, 0x00, // pushi 0 (wasting 1 byte here)
0x45, 0x01, 0x00, // callb export1 from script 0 (switching control off)
- 0x38, PATCH_UINT16 + 0x22, 0x01, // pushi 0122
+ 0x38, PATCH_UINT16(0x0122), // pushi 0122
0x78, // push1
0x76, // push0
0x81, 0x00, // lag global[0]
0x4a, 0x06, // send 06 - call ego::setMotion(0)
- 0x39, PATCH_SELECTOR8 + SELECTOR_init, // pushi "init"
+ 0x39, PATCH_SELECTOR8(init), // pushi "init"
0x39, 0x06, // pushi 06
0x39, 0x02, // pushi 02 (additional 2 bytes)
0x76, // push0
0x76, // push0
0x39, 0x17, // pushi 17
0x7c, // pushSelf
- 0x38, PATCH_UINT16 + 0x80, 0x02, // pushi 280 (additional 3 bytes)
+ 0x38, PATCH_UINT16(0x0280), // pushi 280 (additional 3 bytes)
0x51, 0x82, // class EcoNarrator
0x4a, 0x10, // send 10 - call EcoNarrator::init(2, 0, 0, 23, self, 640)
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry ecoquest1Signatures[] = {
- { true, 660, "CD: bad messagebox and freeze", 1, 0, 0, ecoquest1SignatureStayAndHelp, ecoquest1PatchStayAndHelp },
+// script, description, signature patch
+static const SciScriptPatcherEntry ecoquest1Signatures[] = {
+ { true, 660, "CD: bad messagebox and freeze", 1, ecoquest1SignatureStayAndHelp, ecoquest1PatchStayAndHelp },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -291,7 +251,7 @@ SciScriptPatcherEntry ecoquest1Signatures[] = {
// is resetted every time, which means the previous text isn't available
// anymore. We have to patch the code because of that.
// Fixes bug: #4993
-const uint16 ecoquest2SignatureEcorder[] = {
+static const uint16 ecoquest2SignatureEcorder[] = {
0x31, 0x22, // bnt [next state]
0x39, 0x0a, // pushi 0a
0x5b, 0x04, 0x1e, // lea temp[1e]
@@ -303,14 +263,14 @@ const uint16 ecoquest2SignatureEcorder[] = {
0x39, 0x66, // pushi 66
0x39, 0x17, // pushi 17
0x39, 0x69, // pushi 69
- 0x38, PATCH_UINT16 + 0x31, 0x26, // pushi 2631
+ 0x38, PATCH_UINT16(0x2631), // pushi 2631
0x39, 0x6a, // pushi 6a
0x39, 0x64, // pushi 64
0x43, 0x1b, 0x14, // call kDisplay
0x35, 0x0a, // ldi 0a
0x65, 0x20, // aTop ticks
0x33, // jmp [end]
- SIG_ADDTOOFFSET +1, // [skip 1 byte]
+ SIG_ADDTOOFFSET(+1), // [skip 1 byte]
0x3c, // dup
0x35, 0x03, // ldi 03
0x1a, // eq?
@@ -318,25 +278,25 @@ const uint16 ecoquest2SignatureEcorder[] = {
SIG_END
};
-const uint16 ecoquest2PatchEcorder[] = {
+static const uint16 ecoquest2PatchEcorder[] = {
0x2f, 0x02, // bt [to pushi 07]
0x3a, // toss
0x48, // ret
- 0x38, PATCH_UINT16 + 0x07, 0x00, // pushi 07 (parameter count) (waste 1 byte)
+ 0x38, PATCH_UINT16(0x0007), // pushi 07 (parameter count) (waste 1 byte)
0x39, 0x0b, // push (FillBoxAny)
0x39, 0x1d, // pushi 29d
0x39, 0x73, // pushi 115d
0x39, 0x5e, // pushi 94d
- 0x38, PATCH_UINT16 + 0xd7, 0x00, // pushi 215d
+ 0x38, PATCH_UINT16(0x00d7), // pushi 215d
0x78, // push1 (visual screen)
- 0x38, PATCH_UINT16 + 0x17, 0x00, // pushi 17 (color) (waste 1 byte)
+ 0x38, PATCH_UINT16(0x0017), // pushi 17 (color) (waste 1 byte)
0x43, 0x6c, 0x0e, // call kGraph
- 0x38, PATCH_UINT16 + 0x05, 0x00, // pushi 05 (parameter count) (waste 1 byte)
+ 0x38, PATCH_UINT16(0x0005), // pushi 05 (parameter count) (waste 1 byte)
0x39, 0x0c, // pushi 12d (UpdateBox)
0x39, 0x1d, // pushi 29d
0x39, 0x73, // pushi 115d
0x39, 0x5e, // pushi 94d
- 0x38, PATCH_UINT16 + 0xd7, 0x00, // pushi 215d
+ 0x38, PATCH_UINT16(0x00d7), // pushi 215d
0x43, 0x6c, 0x0a, // call kGraph
PATCH_END
};
@@ -347,8 +307,8 @@ const uint16 ecoquest2PatchEcorder[] = {
// kGraphFillBoxAny and kGraphUpdateBox), as there isn't enough space to patch
// the function otherwise.
// Fixes bug: #6467
-const uint16 ecoquest2SignatureEcorderTutorial[] = {
- 0x30, SIG_UINT16 + 0x23, 0x00, // bnt [next state]
+static const uint16 ecoquest2SignatureEcorderTutorial[] = {
+ 0x30, SIG_UINT16(0x0023), // bnt [next state]
0x39, 0x0a, // pushi 0a
0x5b, 0x04, 0x1f, // lea temp[1f]
0x36, // push
@@ -359,7 +319,7 @@ const uint16 ecoquest2SignatureEcorderTutorial[] = {
0x39, 0x66, // pushi 66
0x39, 0x17, // pushi 17
0x39, 0x69, // pushi 69
- 0x38, SIG_UINT16 + 0x31, 0x26, // pushi 2631
+ 0x38, SIG_UINT16(0x2631), // pushi 2631
0x39, 0x6a, // pushi 6a
0x39, 0x64, // pushi 64
0x43, 0x1b, 0x14, // call kDisplay
@@ -370,7 +330,7 @@ const uint16 ecoquest2SignatureEcorderTutorial[] = {
SIG_END
};
-const uint16 ecoquest2PatchEcorderTutorial[] = {
+static const uint16 ecoquest2PatchEcorderTutorial[] = {
0x31, 0x23, // bnt [next state] (save 1 byte)
// The parameter count below should be 7, but we're out of bytes
// to patch! A workaround has been added because of this
@@ -380,7 +340,7 @@ const uint16 ecoquest2PatchEcorderTutorial[] = {
0x39, 0x1d, // pushi 29d
0x39, 0x73, // pushi 115d
0x39, 0x5e, // pushi 94d
- 0x38, PATCH_UINT16 + 0xd7, 0x00, // pushi 215d
+ 0x38, PATCH_UINT16(0x00d7), // pushi 215d
0x78, // push1 (visual screen)
0x39, 0x17, // pushi 17 (color)
0x43, 0x6c, 0x0e, // call kGraph
@@ -392,21 +352,21 @@ const uint16 ecoquest2PatchEcorderTutorial[] = {
0x39, 0x1d, // pushi 29d
0x39, 0x73, // pushi 115d
0x39, 0x5e, // pushi 94d
- 0x38, PATCH_UINT16 + 0xd7, 0x00, // pushi 215d
+ 0x38, PATCH_UINT16(0x00d7), // pushi 215d
0x43, 0x6c, 0x0a, // call kGraph
// We are out of bytes to patch at this point,
// so we skip 494 (0x1EE) bytes to reuse this code:
// ldi 1e
// aTop 20
// jmp 030e (jump to end)
- 0x32, PATCH_UINT16 + 0xee, 0x01, // skip 494 (0x1EE) bytes
+ 0x32, PATCH_UINT16(0x01ee), // skip 494 (0x1EE) bytes
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry ecoquest2Signatures[] = {
- { true, 50, "initial text not removed on ecorder", 1, 0, 0, ecoquest2SignatureEcorder, ecoquest2PatchEcorder },
- { true, 333, "initial text not removed on ecorder tutorial",1, 0, 0, ecoquest2SignatureEcorderTutorial, ecoquest2PatchEcorderTutorial },
+// script, description, signature patch
+static const SciScriptPatcherEntry ecoquest2Signatures[] = {
+ { true, 50, "initial text not removed on ecorder", 1, ecoquest2SignatureEcorder, ecoquest2PatchEcorder },
+ { true, 333, "initial text not removed on ecorder tutorial", 1, ecoquest2SignatureEcorderTutorial, ecoquest2PatchEcorderTutorial },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -416,26 +376,26 @@ SciScriptPatcherEntry ecoquest2Signatures[] = {
// infinite loop. This script bug was not apparent in SSCI, probably because
// event handling was slightly different there, so it was never discovered.
// Fixes bug: #5120
-const uint16 fanmadeSignatureInfiniteLoop[] = {
- 0x38, SIG_UINT16 + 0x4c, 0x00, // pushi 004c
+static const uint16 fanmadeSignatureInfiniteLoop[] = {
+ 0x38, SIG_UINT16(0x004c), // pushi 004c
0x39, 0x00, // pushi 00
0x87, 0x01, // lap 01
0x4b, 0x04, // send 04
SIG_MAGICDWORD,
0x18, // not
- 0x30, SIG_UINT16 + 0x2f, 0x00, // bnt 002f [06a5] --> jmp ffbc [0664] --> BUG! infinite loop
+ 0x30, SIG_UINT16(0x002f), // bnt 002f [06a5] --> jmp ffbc [0664] --> BUG! infinite loop
SIG_END
};
-const uint16 fanmadePatchInfiniteLoop[] = {
- PATCH_ADDTOOFFSET | +10,
- 0x30, SIG_UINT16 + 0x32, 0x00, // bnt 0032 [06a8] --> pushi 004c
+static const uint16 fanmadePatchInfiniteLoop[] = {
+ PATCH_ADDTOOFFSET(+10),
+ 0x30, SIG_UINT16(0x0032), // bnt 0032 [06a8] --> pushi 004c
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry fanmadeSignatures[] = {
- { true, 999, "infinite loop on typo", 1, 0, 0, fanmadeSignatureInfiniteLoop, fanmadePatchInfiniteLoop },
+// script, description, signature patch
+static const SciScriptPatcherEntry fanmadeSignatures[] = {
+ { true, 999, "infinite loop on typo", 1, fanmadeSignatureInfiniteLoop, fanmadePatchInfiniteLoop },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -449,7 +409,7 @@ SciScriptPatcherEntry fanmadeSignatures[] = {
// The "score" code is already buggy and sets volume to 0 when playing
// Applies to at least: English PC-CD
// Responsible method: unknown
-const uint16 freddypharkasSignatureScoreDisposal[] = {
+static const uint16 freddypharkasSignatureScoreDisposal[] = {
0x67, 0x32, // pTos 32 (selector theAudCount)
0x78, // push1
SIG_MAGICDWORD,
@@ -460,10 +420,10 @@ const uint16 freddypharkasSignatureScoreDisposal[] = {
SIG_END
};
-const uint16 freddypharkasPatchScoreDisposal[] = {
- 0x34, PATCH_UINT16 + 0x00, 0x00, // ldi 0000
- 0x34, PATCH_UINT16 + 0x00, 0x00, // ldi 0000
- 0x34, PATCH_UINT16 + 0x00, 0x00, // ldi 0000
+static const uint16 freddypharkasPatchScoreDisposal[] = {
+ 0x34, PATCH_UINT16(0x0000), // ldi 0000
+ 0x34, PATCH_UINT16(0x0000), // ldi 0000
+ 0x34, PATCH_UINT16(0x0000), // ldi 0000
PATCH_END
};
@@ -475,8 +435,8 @@ const uint16 freddypharkasPatchScoreDisposal[] = {
// this fixes the issue.
// Applies to at least: English PC-CD
// Responsible method: rm235::init and sEnterFrom500::changeState
-const uint16 freddypharkasSignatureCanisterHang[] = {
- 0x38, SIG_SELECTOR16 + SELECTOR_disable, // pushi disable
+static const uint16 freddypharkasSignatureCanisterHang[] = {
+ 0x38, SIG_SELECTOR16(disable), // pushi disable
0x7a, // push2
SIG_MAGICDWORD,
0x39, 0x07, // pushi 07
@@ -486,12 +446,12 @@ const uint16 freddypharkasSignatureCanisterHang[] = {
SIG_END
};
-const uint16 freddypharkasPatchCanisterHang[] = {
- PATCH_ADDTOOFFSET | +3,
+static const uint16 freddypharkasPatchCanisterHang[] = {
+ PATCH_ADDTOOFFSET(+3),
0x78, // push1
- PATCH_ADDTOOFFSET | +2,
+ PATCH_ADDTOOFFSET(+2),
0x33, 0x00, // ldi 00 (waste 2 bytes)
- PATCH_ADDTOOFFSET | +3,
+ PATCH_ADDTOOFFSET(+3),
0x06, // send 06 - call IconBar::disable(7)
PATCH_END
};
@@ -506,27 +466,27 @@ const uint16 freddypharkasPatchCanisterHang[] = {
// We just reuse the active event, thus removing the duplicate kGetEvent call.
// Applies to at least: English PC-CD, German Floppy, English Mac
// Responsible method: lowerLadder::doit and highLadder::doit
-const uint16 freddypharkasSignatureLadderEvent[] = {
+static const uint16 freddypharkasSignatureLadderEvent[] = {
0x39, SIG_MAGICDWORD,
- SIG_SELECTOR8 + SELECTOR_new, // pushi new
+ SIG_SELECTOR8(new), // pushi new
0x76, // push0
- 0x38, SIG_SELECTOR16 + SELECTOR_curEvent, // pushi curEvent
+ 0x38, SIG_SELECTOR16(curEvent), // pushi curEvent
0x76, // push0
0x81, 0x50, // lag global[50]
0x4a, 0x04, // send 04 - read User::curEvent
0x4a, 0x04, // send 04 - call curEvent::new
0xa5, 0x00, // sat temp[0]
- 0x38, SIG_SELECTOR16 + SELECTOR_localize,
+ 0x38, SIG_SELECTOR16(localize),
0x76, // push0
0x4a, 0x04, // send 04 - call curEvent::localize
SIG_END
};
-const uint16 freddypharkasPatchLadderEvent[] = {
+static const uint16 freddypharkasPatchLadderEvent[] = {
0x34, 0x00, 0x00, // ldi 0000 (waste 3 bytes, overwrites first 2 pushes)
- PATCH_ADDTOOFFSET | +8,
+ PATCH_ADDTOOFFSET(+8),
0xa5, 0x00, // sat temp[0] (waste 2 bytes, overwrites 2nd send)
- PATCH_ADDTOOFFSET | +2,
+ PATCH_ADDTOOFFSET(+2),
0x34, 0x00, 0x00, // ldi 0000
0x34, 0x00, 0x00, // ldi 0000 (waste 6 bytes, overwrites last 3 opcodes)
PATCH_END
@@ -537,29 +497,29 @@ const uint16 freddypharkasPatchLadderEvent[] = {
// so we revert the script back to using the values of the DOS script.
// Applies to at least: English Mac
// Responsible method: unknown
-const uint16 freddypharkasSignatureMacInventory[] = {
+static const uint16 freddypharkasSignatureMacInventory[] = {
SIG_MAGICDWORD,
0x39, 0x23, // pushi 23
0x39, 0x74, // pushi 74
0x78, // push1
- 0x38, SIG_UINT16 + 0x74, 0x01, // pushi 0174 (on mac it's actually 0x01, 0x74)
+ 0x38, SIG_UINT16(0x0174), // pushi 0174 (on mac it's actually 0x01, 0x74)
0x85, 0x15, // lat 15
SIG_END
};
-const uint16 freddypharkasPatchMacInventory[] = {
+static const uint16 freddypharkasPatchMacInventory[] = {
0x39, 0x02, // pushi 02 (now matches the DOS version)
- PATCH_ADDTOOFFSET +23,
+ PATCH_ADDTOOFFSET(+23),
0x39, 0x04, // pushi 04 (now matches the DOS version)
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry freddypharkasSignatures[] = {
- { true, 0, "CD: score early disposal", 1, 0, 0, freddypharkasSignatureScoreDisposal, freddypharkasPatchScoreDisposal },
- { true, 15, "Mac: broken inventory", 1, 0, 0, freddypharkasSignatureMacInventory, freddypharkasPatchMacInventory },
- { true, 235, "CD: canister pickup hang", 3, 0, 0, freddypharkasSignatureCanisterHang, freddypharkasPatchCanisterHang },
- { true, 320, "ladder event issue", 2, 0, 0, freddypharkasSignatureLadderEvent, freddypharkasPatchLadderEvent },
+// script, description, signature patch
+static const SciScriptPatcherEntry freddypharkasSignatures[] = {
+ { true, 0, "CD: score early disposal", 1, freddypharkasSignatureScoreDisposal, freddypharkasPatchScoreDisposal },
+ { true, 15, "Mac: broken inventory", 1, freddypharkasSignatureMacInventory, freddypharkasPatchMacInventory },
+ { true, 235, "CD: canister pickup hang", 3, freddypharkasSignatureCanisterHang, freddypharkasPatchCanisterHang },
+ { true, 320, "ladder event issue", 2, freddypharkasSignatureLadderEvent, freddypharkasPatchLadderEvent },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -568,25 +528,25 @@ SciScriptPatcherEntry freddypharkasSignatures[] = {
// this is not enough time to get to the door, so we patch that to 23 seconds
// Applies to at least: English PC-CD, German PC-CD, English Mac
// Responsible method: daySixBeignet::changeState
-const uint16 gk1SignatureDay6PoliceBeignet[] = {
+static const uint16 gk1SignatureDay6PoliceBeignet[] = {
0x35, 0x04, // ldi 04
0x1a, // eq?
- 0x30, SIG_ADDTOOFFSET +2, // bnt [next state check]
- 0x38, SIG_SELECTOR16 + SELECTOR_dispose, // pushi dispose
+ 0x30, SIG_ADDTOOFFSET(+2), // bnt [next state check]
+ 0x38, SIG_SELECTOR16(dispose), // pushi dispose
0x76, // push0
- 0x72, SIG_ADDTOOFFSET +2, // lofsa deskSarg
- 0x4a, SIG_UINT16 + 0x04, 0x00, // send 04
+ 0x72, SIG_ADDTOOFFSET(+2), // lofsa deskSarg
+ 0x4a, SIG_UINT16(0x0004), // send 04
SIG_MAGICDWORD,
- 0x34, SIG_UINT16 + 0xdc, 0x00, // ldi 220
- 0x65, SIG_ADDTOOFFSET +1, // aTop cycles (1a for PC, 1c for Mac)
+ 0x34, SIG_UINT16(0x00dc), // ldi 220
+ 0x65, SIG_ADDTOOFFSET(+1), // aTop cycles (1a for PC, 1c for Mac)
0x32, // jmp [end]
SIG_END
};
-const uint16 gk1PatchDay6PoliceBeignet[] = {
- PATCH_ADDTOOFFSET +16,
- 0x34, PATCH_UINT16 + 0x17, 0x00, // ldi 23
- 0x65, PATCH_GETORIGINALBYTEADJUST +20, +2, // aTop seconds (1c for PC, 1e for Mac)
+static const uint16 gk1PatchDay6PoliceBeignet[] = {
+ PATCH_ADDTOOFFSET(+16),
+ 0x34, PATCH_UINT16(0x0017), // ldi 23
+ 0x65, PATCH_GETORIGINALBYTEADJUST(+20, +2), // aTop seconds (1c for PC, 1e for Mac)
PATCH_END
};
@@ -594,42 +554,42 @@ const uint16 gk1PatchDay6PoliceBeignet[] = {
// this is not enough time to get to the door, so we patch it to 42 seconds
// Applies to at least: English PC-CD, German PC-CD, English Mac
// Responsible method: sargSleeping::changeState
-const uint16 gk1SignatureDay6PoliceSleep[] = {
+static const uint16 gk1SignatureDay6PoliceSleep[] = {
0x35, 0x08, // ldi 08
0x1a, // eq?
- 0x31, SIG_ADDTOOFFSET +1, // bnt [next state check]
+ 0x31, SIG_ADDTOOFFSET(+1), // bnt [next state check]
SIG_MAGICDWORD,
- 0x34, SIG_UINT16 + 0xdc, 0x00, // ldi 220
- 0x65, SIG_ADDTOOFFSET +1, // aTop cycles (1a for PC, 1c for Mac)
+ 0x34, SIG_UINT16(0x00dc), // ldi 220
+ 0x65, SIG_ADDTOOFFSET(+1), // aTop cycles (1a for PC, 1c for Mac)
0x32, // jmp [end]
0
};
-const uint16 gk1PatchDay6PoliceSleep[] = {
- PATCH_ADDTOOFFSET +5,
- 0x34, SIG_UINT16 + 0x2a, 0x00, // ldi 42
- 0x65, PATCH_GETORIGINALBYTEADJUST +9, +2, // aTop seconds (1c for PC, 1e for Mac)
+static const uint16 gk1PatchDay6PoliceSleep[] = {
+ PATCH_ADDTOOFFSET(+5),
+ 0x34, SIG_UINT16(0x002a), // ldi 42
+ 0x65, PATCH_GETORIGINALBYTEADJUST(+9, +2), // aTop seconds (1c for PC, 1e for Mac)
PATCH_END
};
// startOfDay5::changeState (20h) - when gabriel goes to the phone the script will hang
// Applies to at least: English PC-CD, German PC-CD, English Mac
// Responsible method: startOfDay5::changeState
-const uint16 gk1SignatureDay5PhoneFreeze[] = {
+static const uint16 gk1SignatureDay5PhoneFreeze[] = {
0x4a,
- SIG_MAGICDWORD, SIG_UINT16 + 0x0c, 0x00, // send 0c
+ SIG_MAGICDWORD, SIG_UINT16(0x000c), // send 0c
0x35, 0x03, // ldi 03
- 0x65, SIG_ADDTOOFFSET +1, // aTop cycles
- 0x32, SIG_ADDTOOFFSET +2, // jmp [end]
+ 0x65, SIG_ADDTOOFFSET(+1), // aTop cycles
+ 0x32, SIG_ADDTOOFFSET(+2), // jmp [end]
0x3c, // dup
0x35, 0x21, // ldi 21
SIG_END
};
-const uint16 gk1PatchDay5PhoneFreeze[] = {
- PATCH_ADDTOOFFSET +3,
+static const uint16 gk1PatchDay5PhoneFreeze[] = {
+ PATCH_ADDTOOFFSET(+3),
0x35, 0x06, // ldi 01
- 0x65, PATCH_GETORIGINALBYTEADJUST +6, +6, // aTop ticks
+ 0x65, PATCH_GETORIGINALBYTEADJUST(+6, +6), // aTop ticks
PATCH_END
};
@@ -644,33 +604,33 @@ const uint16 gk1PatchDay5PhoneFreeze[] = {
// Applies to at least: English Floppy
// Responsible method: Interrogation::dispose
// TODO: Check, if English Mac is affected too and if this patch applies
-const uint16 gk1SignatureInterrogationBug[] = {
+static const uint16 gk1SignatureInterrogationBug[] = {
SIG_MAGICDWORD,
0x65, 0x4c, // aTop 4c
0x67, 0x50, // pTos 50
- 0x34, SIG_UINT16 + 0x10, 0x27, // ldi 2710
+ 0x34, SIG_UINT16(0x2710), // ldi 2710
0x1e, // gt?
0x31, 0x08, // bnt 08 [05a0]
0x67, 0x50, // pTos 50
- 0x34, SIG_UINT16 + 0x10, 0x27, // ldi 2710
+ 0x34, SIG_UINT16(0x2710), // ldi 2710
0x04, // sub
0x65, 0x50, // aTop 50
0x63, 0x50, // pToa 50
0x31, 0x15, // bnt 15 [05b9]
0x39, 0x0e, // pushi 0e
0x76, // push0
- 0x4a, SIG_UINT16 + 0x04, 0x00, // send 0004
+ 0x4a, SIG_UINT16(0x0004), // send 0004
0xa5, 0x00, // sat 00
- 0x38, SIG_SELECTOR16 + SELECTOR_dispose, // pushi dispose
+ 0x38, SIG_SELECTOR16(dispose), // pushi dispose
0x76, // push0
0x63, 0x50, // pToa 50
- 0x4a, SIG_UINT16 + 0x04, 0x00, // send 0004
+ 0x4a, SIG_UINT16(0x0004), // send 0004
0x85, 0x00, // lat 00
0x65, 0x50, // aTop 50
SIG_END
};
-const uint16 gk1PatchInterrogationBug[] = {
+static const uint16 gk1PatchInterrogationBug[] = {
0x65, 0x4c, // aTop 4c
0x63, 0x50, // pToa 50
0x31, 0x15, // bnt 15 [05b9]
@@ -678,29 +638,29 @@ const uint16 gk1PatchInterrogationBug[] = {
0x76, // push0
0x4a, 0x04, 0x00, // send 0004
0xa5, 0x00, // sat 00
- 0x38, SIG_SELECTOR16 + SELECTOR_dispose, // pushi dispose
+ 0x38, SIG_SELECTOR16(dispose), // pushi dispose
0x76, // push0
0x63, 0x50, // pToa 50
0x4a, 0x04, 0x00, // send 0004
0x85, 0x00, // lat 00
0x65, 0x50, // aTop 50
0x67, 0x50, // pTos 50
- 0x34, PATCH_UINT16 + 0x10, 0x27, // ldi 2710
+ 0x34, PATCH_UINT16(0x2710), // ldi 2710
0x1e, // gt?
0x31, 0x08, // bnt 08 [05b9]
0x67, 0x50, // pTos 50
- 0x34, PATCH_UINT16 + 0x10, 0x27, // ldi 2710
+ 0x34, PATCH_UINT16(0x2710), // ldi 2710
0x04, // sub
0x65, 0x50, // aTop 50
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry gk1Signatures[] = {
- { true, 51, "interrogation bug", 1, 0, 0, gk1SignatureInterrogationBug, gk1PatchInterrogationBug },
- { true, 212, "day 5 phone freeze", 1, 0, 0, gk1SignatureDay5PhoneFreeze, gk1PatchDay5PhoneFreeze },
- { true, 230, "day 6 police beignet timer issue", 1, 0, 0, gk1SignatureDay6PoliceBeignet, gk1PatchDay6PoliceBeignet },
- { true, 230, "day 6 police sleep timer issue", 1, 0, 0, gk1SignatureDay6PoliceSleep, gk1PatchDay6PoliceSleep },
+// script, description, signature patch
+static const SciScriptPatcherEntry gk1Signatures[] = {
+ { true, 51, "interrogation bug", 1, gk1SignatureInterrogationBug, gk1PatchInterrogationBug },
+ { true, 212, "day 5 phone freeze", 1, gk1SignatureDay5PhoneFreeze, gk1PatchDay5PhoneFreeze },
+ { true, 230, "day 6 police beignet timer issue", 1, gk1SignatureDay6PoliceBeignet, gk1PatchDay6PoliceBeignet },
+ { true, 230, "day 6 police sleep timer issue", 1, gk1SignatureDay6PoliceSleep, gk1PatchDay6PoliceSleep },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -710,19 +670,19 @@ SciScriptPatcherEntry gk1Signatures[] = {
// is later used to set master volume. This issue makes sierra sci set
// the volume to max. We fix the export, so volume won't get modified in
// those cases.
-const uint16 kq5SignatureCdHarpyVolume[] = {
+static const uint16 kq5SignatureCdHarpyVolume[] = {
SIG_MAGICDWORD,
- 0x80, SIG_UINT16 + 0x91, 0x01, // lag global[191h]
+ 0x80, SIG_UINT16(0x0191), // lag global[191h]
0x18, // not
- 0x30, SIG_UINT16 + 0x2c, 0x00, // bnt [jump further] (jumping, if global 191h is 1)
+ 0x30, SIG_UINT16(0x002c), // bnt [jump further] (jumping, if global 191h is 1)
0x35, 0x01, // ldi 01
- 0xa0, SIG_UINT16 + 0x91, 0x01, // sag global[191h] (setting global 191h to 1)
- 0x38, SIG_UINT16 + 0x7b, 0x01, // pushi 017b
+ 0xa0, SIG_UINT16(0x0191), // sag global[191h] (setting global 191h to 1)
+ 0x38, SIG_UINT16(0x017b), // pushi 017b
0x76, // push0
0x81, 0x01, // lag global[1]
0x4a, 0x04, // send 04 - read KQ5::masterVolume
0xa5, 0x03, // sat temp[3] (store volume in temp 3)
- 0x38, SIG_UINT16 + 0x7b, 0x01, // pushi 017b
+ 0x38, SIG_UINT16(0x017b), // pushi 017b
0x76, // push0
0x81, 0x01, // lag global[1]
0x4a, 0x04, // send 04 - read KQ5::masterVolume
@@ -732,18 +692,18 @@ const uint16 kq5SignatureCdHarpyVolume[] = {
SIG_END
};
-const uint16 kq5PatchCdHarpyVolume[] = {
- 0x38, PATCH_UINT16 + 0x2f, 0x02, // pushi 022f (selector theVol) (3 new bytes)
+static const uint16 kq5PatchCdHarpyVolume[] = {
+ 0x38, PATCH_UINT16(0x022f), // pushi 022f (selector theVol) (3 new bytes)
0x76, // push0 (1 new byte)
0x51, 0x88, // class SpeakTimer (2 new bytes)
0x4a, 0x04, // send 04 (2 new bytes) -> read SpeakTimer::theVol
0xa5, 0x03, // sat temp[3] (2 new bytes) -> write to temp 3
- 0x80, PATCH_UINT16 + 0x91, 0x01, // lag global[191h]
+ 0x80, PATCH_UINT16(0x0191), // lag global[191h]
// saving 1 byte due optimization
- 0x2e, PATCH_UINT16 + 0x23, 0x00, // bt [jump further] (jumping, if global 191h is 1)
+ 0x2e, PATCH_UINT16(0x0023), // bt [jump further] (jumping, if global 191h is 1)
0x35, 0x01, // ldi 01
- 0xa0, PATCH_UINT16 + 0x91, 0x01, // sag global[191h] (setting global 191h to 1)
- 0x38, PATCH_UINT16 + 0x7b, 0x01, // pushi 017b
+ 0xa0, PATCH_UINT16(0x0191), // sag global[191h] (setting global 191h to 1)
+ 0x38, PATCH_UINT16(0x017b), // pushi 017b
0x76, // push0
0x81, 0x01, // lag global[1]
0x4a, 0x04, // send 04 - read KQ5::masterVolume
@@ -770,24 +730,24 @@ const uint16 kq5PatchCdHarpyVolume[] = {
// See also the warning+comment in Object::initBaseObject
//
// Fixes bug: #4964
-const uint16 kq5SignatureWitchCageInit[] = {
- SIG_UINT16 + 0x00, 0x00, // top
- SIG_UINT16 + 0x00, 0x00, // left
- SIG_UINT16 + 0x00, 0x00, // bottom
- SIG_UINT16 + 0x00, 0x00, // right
- SIG_UINT16 + 0x00, 0x00, // extra property #1
+static const uint16 kq5SignatureWitchCageInit[] = {
+ SIG_UINT16(0x0000), // top
+ SIG_UINT16(0x0000), // left
+ SIG_UINT16(0x0000), // bottom
+ SIG_UINT16(0x0000), // right
+ SIG_UINT16(0x0000), // extra property #1
SIG_MAGICDWORD,
- SIG_UINT16 + 0x7a, 0x00, // extra property #2
- SIG_UINT16 + 0xc8, 0x00, // extra property #3
- SIG_UINT16 + 0xa3, 0x00, // extra property #4
+ SIG_UINT16(0x007a), // extra property #2
+ SIG_UINT16(0x00c8), // extra property #3
+ SIG_UINT16(0x00a3), // extra property #4
SIG_END
};
-const uint16 kq5PatchWitchCageInit[] = {
- PATCH_UINT16 + 0x00, 0x00, // top
- PATCH_UINT16 + 0x7a, 0x00, // left
- PATCH_UINT16 + 0xc8, 0x00, // bottom
- PATCH_UINT16 + 0xa3, 0x00, // right
+static const uint16 kq5PatchWitchCageInit[] = {
+ PATCH_UINT16(0x0000), // top
+ PATCH_UINT16(0x007a), // left
+ PATCH_UINT16(0x00c8), // bottom
+ PATCH_UINT16(0x00a3), // right
PATCH_END
};
@@ -805,25 +765,25 @@ const uint16 kq5PatchWitchCageInit[] = {
// changes to GameFeatures::detectsetCursorType() ) and breaking savegame
// compatibilty between the DOS and Windows CD versions of KQ5.
// TODO: Investigate these side effects more closely.
-const uint16 kq5SignatureWinGMSignals[] = {
+static const uint16 kq5SignatureWinGMSignals[] = {
SIG_MAGICDWORD,
- 0x80, SIG_UINT16 + 0x90, 0x01, // lag 0x190
+ 0x80, SIG_UINT16(0x0190), // lag 0x190
0x18, // not
- 0x30, SIG_UINT16 + 0x1b, 0x00, // bnt +0x001B
+ 0x30, SIG_UINT16(0x001b), // bnt +0x001B
0x89, 0x57, // lsg 0x57
SIG_END
};
-const uint16 kq5PatchWinGMSignals[] = {
- 0x34, PATCH_UINT16 + 0x01, 0x00, // ldi 0x0001
+static const uint16 kq5PatchWinGMSignals[] = {
+ 0x34, PATCH_UINT16(0x0001), // ldi 0x0001
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry kq5Signatures[] = {
- { true, 0, "CD: harpy volume change", 1, 0, 0, kq5SignatureCdHarpyVolume, kq5PatchCdHarpyVolume },
- { true, 200, "CD: witch cage init", 1, 0, 0, kq5SignatureWitchCageInit, kq5PatchWitchCageInit },
- { false, 124, "Win: GM Music signal checks", 4, 0, 0, kq5SignatureWinGMSignals, kq5PatchWinGMSignals },
+// script, description, signature patch
+static const SciScriptPatcherEntry kq5Signatures[] = {
+ { true, 0, "CD: harpy volume change", 1, kq5SignatureCdHarpyVolume, kq5PatchCdHarpyVolume },
+ { true, 200, "CD: witch cage init", 1, kq5SignatureWitchCageInit, kq5PatchWitchCageInit },
+ { false, 124, "Win: GM Music signal checks", 4, kq5SignatureWinGMSignals, kq5PatchWinGMSignals },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -837,7 +797,7 @@ SciScriptPatcherEntry kq5Signatures[] = {
// constantly restarting (since it's being looped anyway), thus the normal
// game speech can work while the baby cry sound is heard.
// Fixes bug: #4955
-const uint16 kq6SignatureDuplicateBabyCry[] = {
+static const uint16 kq6SignatureDuplicateBabyCry[] = {
SIG_MAGICDWORD,
0x83, 0x00, // lal 00
0x31, 0x1e, // bnt 1e [07f4]
@@ -847,7 +807,7 @@ const uint16 kq6SignatureDuplicateBabyCry[] = {
SIG_END
};
-const uint16 kq6PatchDuplicateBabyCry[] = {
+static const uint16 kq6PatchDuplicateBabyCry[] = {
0x48, // ret
PATCH_END
};
@@ -860,9 +820,9 @@ const uint16 kq6PatchDuplicateBabyCry[] = {
// Applies to at least: PC-CD, English PC floppy, German PC floppy, English Mac
// Responsible method: KqInv::showSelf
// Fixes bug: #5681
-const uint16 kq6SignatureInventoryStackFix[] = {
+static const uint16 kq6SignatureInventoryStackFix[] = {
0x67, 0x30, // pTos state
- 0x34, SIG_UINT16 + 0x00, 0x20, // ldi 2000
+ 0x34, SIG_UINT16(0x2000), // ldi 2000
0x12, // and
0x18, // not
0x31, 0x04, // bnt [not first refresh]
@@ -870,10 +830,10 @@ const uint16 kq6SignatureInventoryStackFix[] = {
SIG_MAGICDWORD,
0x65, 0x1e, // aTop curIcon
0x67, 0x30, // pTos state
- 0x34, SIG_UINT16 + 0xff, 0xdf, // ldi dfff
+ 0x34, SIG_UINT16(0xdfff), // ldi dfff
0x12, // and
0x65, 0x30, // aTop state
- 0x38, SIG_SELECTOR16 + SELECTOR_show, // pushi "show" ("show" is e1h for KQ6CD)
+ 0x38, SIG_SELECTOR16(show), // pushi "show" ("show" is e1h for KQ6CD)
0x78, // push1
0x87, 0x00, // lap param[0]
0x31, 0x04, // bnt [use global for show]
@@ -882,18 +842,18 @@ const uint16 kq6SignatureInventoryStackFix[] = {
0x81, 0x00, // lag global[0]
0x36, // push
0x54, 0x06, // self 06 (KqInv::show)
- 0x31, SIG_ADDTOOFFSET + 1, // bnt [exit menu code] (0x08 for PC, 0x07 for mac)
+ 0x31, SIG_ADDTOOFFSET(+1), // bnt [exit menu code] (0x08 for PC, 0x07 for mac)
0x39, 0x39, // pushi 39
0x76, // push0
0x54, 0x04, // self 04 (KqInv::doit)
SIG_END // followed by jmp (0x32 for PC, 0x33 for mac)
};
-const uint16 kq6PatchInventoryStackFix[] = {
+static const uint16 kq6PatchInventoryStackFix[] = {
0x67, 0x30, // pTos state
0x3c, // dup (1 more byte, needed for patch)
0x3c, // dup (1 more byte, saves 1 byte later)
- 0x34, PATCH_UINT16 + 0x00, 0x20, // ldi 2000
+ 0x34, PATCH_UINT16(0x2000), // ldi 2000
0x12, // and
0x2f, 0x02, // bt [not first refresh] - saves 3 bytes in total
0x65, 0x1e, // aTop curIcon
@@ -901,8 +861,8 @@ const uint16 kq6PatchInventoryStackFix[] = {
0x12, // and
0x65, 0x30, // aTop state
0x38, // pushi "show"
- PATCH_GETORIGINALBYTE +22,
- PATCH_GETORIGINALBYTE +23,
+ PATCH_GETORIGINALBYTE(+22),
+ PATCH_GETORIGINALBYTE(+23),
0x78, // push1
0x87, 0x00, // lap param[0]
0x31, 0x04, // bnt [call show using global 0]
@@ -911,8 +871,8 @@ const uint16 kq6PatchInventoryStackFix[] = {
0x89, 0x00, // lsg global[0], save 1 byte total, see above
0x54, 0x06, // self 06 (call x::show)
0x31, // bnt [menu exit code]
- PATCH_GETORIGINALBYTEADJUST +39, +6,// dynamic offset must be 0x0E for PC and 0x0D for mac
- 0x34, PATCH_UINT16 + 0x00, 0x20, // ldi 2000
+ PATCH_GETORIGINALBYTEADJUST(+39, +6),// dynamic offset must be 0x0E for PC and 0x0D for mac
+ 0x34, PATCH_UINT16(0x2000), // ldi 2000
0x12, // and
0x2f, 0x05, // bt [to return]
0x39, 0x39, // pushi 39
@@ -922,28 +882,83 @@ const uint16 kq6PatchInventoryStackFix[] = {
PATCH_END
};
+// The "Drink Me" bottle code doesn't repaint the AddToPics elements to the screen,
+// when Alexander returns back from the effect of the bottle.
+// It's pretty strange that Sierra didn't find this bug, because it occurs when
+// drinking the bottle right on the screen, where the bottle is found.
+// This bug also occurs in Sierra SCI.
+// Applies to at least: PC-CD, English PC floppy, German PC floppy, English Mac
+// Responsible method: drinkMeScript::changeState
+// Fixes bug: #5252
+static const uint16 kq6SignatureDrinkMeFix[] = {
+ SIG_MAGICDWORD,
+ 0x3c, // dup
+ 0x35, 0x0f, // ldi 0f
+ 0x1a, // eq?
+ 0x30, SIG_UINT16(0x00a4), // bnt [skip to next check]
+ SIG_ADDTOOFFSET(+161),
+ 0x32, SIG_UINT16(0x007f), // jmp [return]
+ 0x3c, // dup
+ 0x35, 0x10, // ldi 10
+ 0x1a, // eq?
+ 0x31, 0x07, // bnt [skip to next check]
+ 0x35, 0x03, // ldi 03
+ 0x65, 0x1a, // aTop (cycles)
+ 0x32, SIG_UINT16(0x0072), // jmp [return]
+ 0x3c, // dup
+ 0x35, 0x11, // ldi 11
+ 0x1a, // eq?
+ 0x31, 0x13, // bnt [skip to next check]
+ SIG_ADDTOOFFSET(+20),
+ 0x35, 0x12, // ldi 12
+ SIG_ADDTOOFFSET(+23),
+ 0x35, 0x13, // ldi 13
+ SIG_END
+};
+
+static const uint16 kq6PatchDrinkMeFix[] = {
+ PATCH_ADDTOOFFSET(+5), // skip to bnt offset
+ PATCH_GETORIGINALBYTEADJUST(+5, +13), // adjust jump to [check for 11h code]
+ PATCH_ADDTOOFFSET(+162),
+ 0x39, PATCH_SELECTOR8(doit), // pushi (doit)
+ 0x76, // push0
+ 0x81, 0x0a, // lag 0a
+ 0x4a, 0x04, // send 04 (call addToPics::doit)
+ 0x3a, // toss
+ 0x48, // ret
+ PATCH_ADDTOOFFSET(+8), // skip to check 11h code
+ 0x35, 0x10, // ldi 10 instead of 11
+ PATCH_ADDTOOFFSET(+23), // skip to check 12h code
+ 0x35, 0x11, // ldi 11 instead of 12
+ PATCH_ADDTOOFFSET(+23), // skip to check 13h code
+ 0x35, 0x12, // ldi 12 instead of 13
+ PATCH_END
+};
+
// Audio + subtitles support - SHARED! - used for King's Quest 6 and Laura Bow 2
// this patch gets enabled, when the user selects "both" in the ScummVM "Speech + Subtitles" menu
// We currently use global 98d to hold a kMemory pointer.
+// Applies to at least: KQ6 PC-CD, LB2 PC-CD
// Patched method: Messager::sayNext / lb2Messager::sayNext (always use text branch)
-const uint16 kq6laurabow2CDSignatureAudioTextSupport1[] = {
+static const uint16 kq6laurabow2CDSignatureAudioTextSupport1[] = {
0x89, 0x5a, // lsg global[5a]
0x35, 0x02, // ldi 02
0x12, // and
SIG_MAGICDWORD,
0x31, 0x13, // bnt [audio call]
- 0x38, SIG_SELECTOR16 + SELECTOR_modNum, // pushi modNum
+ 0x38, SIG_SELECTOR16(modNum), // pushi modNum
SIG_END
};
-const uint16 kq6laurabow2CDPatchAudioTextSupport1[] = {
- PATCH_ADDTOOFFSET +5,
+static const uint16 kq6laurabow2CDPatchAudioTextSupport1[] = {
+ PATCH_ADDTOOFFSET(+5),
0x33, 0x13, // jmp [audio call]
PATCH_END
};
+// Applies to at least: KQ6 PC-CD, LB2 PC-CD
// Patched method: Messager::sayNext / lb2Messager::sayNext (allocate audio memory)
-const uint16 kq6laurabow2CDSignatureAudioTextSupport2[] = {
+static const uint16 kq6laurabow2CDSignatureAudioTextSupport2[] = {
0x7a, // push2
0x78, // push1
0x39, 0x0c, // pushi 0c
@@ -952,14 +967,15 @@ const uint16 kq6laurabow2CDSignatureAudioTextSupport2[] = {
SIG_END
};
-const uint16 kq6laurabow2CDPatchAudioTextSupport2[] = {
- PATCH_ADDTOOFFSET +7,
+static const uint16 kq6laurabow2CDPatchAudioTextSupport2[] = {
+ PATCH_ADDTOOFFSET(+7),
0xa1, 98, // sag global[98d]
PATCH_END
};
+// Applies to at least: KQ6 PC-CD, LB2 PC-CD
// Patched method: Messager::sayNext / lb2Messager::sayNext (release audio memory)
-const uint16 kq6laurabow2CDSignatureAudioTextSupport3[] = {
+static const uint16 kq6laurabow2CDSignatureAudioTextSupport3[] = {
0x7a, // push2
0x39, 0x03, // pushi 03
SIG_MAGICDWORD,
@@ -968,19 +984,30 @@ const uint16 kq6laurabow2CDSignatureAudioTextSupport3[] = {
SIG_END
};
-const uint16 kq6laurabow2CDPatchAudioTextSupport3[] = {
- PATCH_ADDTOOFFSET +3,
+static const uint16 kq6laurabow2CDPatchAudioTextSupport3[] = {
+ PATCH_ADDTOOFFSET(+3),
0x89, 98, // lsg global[98d]
PATCH_END
};
+// startText call gets acc = 0 for text-only and acc = 2 for audio+text
+// Applies to at least: KQ6 PC-CD, LB2 PC-CD
// Patched method: Narrator::say (use audio memory)
-const uint16 kq6laurabow2CDSignatureAudioTextSupport4[] = {
+static const uint16 kq6laurabow2CDSignatureAudioTextSupport4[] = {
+ // set caller property code
+ 0x31, 0x08, // bnt [set acc to 0 for caller]
+ 0x87, 0x02, // lap param[2]
+ 0x31, 0x04, // bnt [set acc to 0 for caller]
+ 0x87, 0x02, // lap param[2]
+ 0x33, 0x02, // jmp [set caller]
+ 0x35, 0x00, // ldi 00
+ 0x65, 0x68, // aTop caller
+ // call startText + startAudio code
0x89, 0x5a, // lsg global[5a]
0x35, 0x01, // ldi 01
0x12, // and
0x31, 0x08, // bnt [skip code]
- 0x38, SIG_SELECTOR16 + SELECTOR_startText, // pushi startText
+ 0x38, SIG_SELECTOR16(startText), // pushi startText
0x78, // push1
0x8f, 0x01, // lsp param[1]
0x54, 0x06, // self 06
@@ -989,49 +1016,297 @@ const uint16 kq6laurabow2CDSignatureAudioTextSupport4[] = {
0x12, // and
0x31, 0x08, // bnt [skip code]
SIG_MAGICDWORD,
- 0x38, SIG_SELECTOR16 + SELECTOR_startAudio, // pushi startAudio
+ 0x38, SIG_SELECTOR16(startAudio), // pushi startAudio
0x78, // push1
0x8f, 0x01, // lsp param[1]
0x54, 0x06, // self 06
SIG_END
};
-const uint16 kq6laurabow2CDPatchAudioTextSupport4[] = {
- PATCH_ADDTOOFFSET +5,
- 0x18, // not (never jump here)
- 0x18, // not (never jump here)
- PATCH_ADDTOOFFSET +19,
+static const uint16 kq6laurabow2CDPatchAudioTextSupport4[] = {
+ 0x31, 0x02, // bnt [set caller]
+ 0x87, 0x02, // lap param[2]
+ 0x65, 0x68, // aTop caller
+ 0x81, 0x5a, // lag global[5a]
+ 0x78, // push1
+ 0x12, // and
+ 0x31, 0x11, // bnt [skip startText code]
+ 0x81, 0x5a, // lag global[5a]
+ 0x7a, // push2
+ 0x12, // and
+ 0x33, 0x03, // skip over 3 unused bytes
+ PATCH_ADDTOOFFSET(+22),
0x89, 98, // lsp global[98d]
PATCH_END
};
+// Applies to at least: KQ6 PC-CD, LB2 PC-CD
// Patched method: Talker::display/Narrator::say (remove reset saved mouse cursor code)
// code would screw over mouse cursor
-const uint16 kq6laurabow2CDSignatureAudioTextSupport5[] = {
+static const uint16 kq6laurabow2CDSignatureAudioTextSupport5[] = {
SIG_MAGICDWORD,
0x35, 0x00, // ldi 00
0x65, 0x82, // aTop saveCursor
SIG_END
};
-const uint16 kq6laurabow2CDPatchAudioTextSupport5[] = {
+static const uint16 kq6laurabow2CDPatchAudioTextSupport5[] = {
0x18, 0x18, 0x18, 0x18, // waste bytes, do nothing
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry kq6Signatures[] = {
- { true, 481, "duplicate baby cry", 1, 0, 0, kq6SignatureDuplicateBabyCry, kq6PatchDuplicateBabyCry },
- { true, 907, "inventory stack fix", 1, 0, 0, kq6SignatureInventoryStackFix, kq6PatchInventoryStackFix },
+// Additional patch specifically for King's Quest 6
+// Fixes text window placement, when in "dual" mode
+// Applies to at least: PC-CD
+// Patched method: Kq6Talker::init
+static const uint16 kq6CDSignatureAudioTextSupport1[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq?
+ 0x31, SIG_ADDTOOFFSET(+1), // bnt [jump-to-text-code]
+ 0x78, // push1
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextSupport1[] = {
+ PATCH_ADDTOOFFSET(+4),
+ 0x12, // and
+ PATCH_END
+};
+
+// Additional patch specifically for King's Quest 6
+// Fixes low-res portrait staying on screen for hi-res mode
+// Applies to at least: PC-CD
+// Patched method: Talker::startText
+// this method is called by Narrator::say and acc is 0 for text-only and 2 for dual mode (audio+text)
+static const uint16 kq6CDSignatureAudioTextSupport2[] = {
+ SIG_MAGICDWORD,
+ 0x3f, 0x01, // link 01
+ 0x63, 0x8a, // pToa viewInPrint
+ 0x18, // not
+ 0x31, 0x06, // bnt [skip following code]
+ 0x38, SIG_UINT16(0x00e1), // pushi 00e1
+ 0x76, // push0
+ 0x54, 0x04, // self 04
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextSupport2[] = {
+ PATCH_ADDTOOFFSET(+2),
+ 0x67, 0x8a, // pTos viewInPrint
+ 0x14, // or
+ 0x2f, // bt [skip following code]
+ PATCH_END
+};
+
+// Additional patch specifically for King's Quest 6
+// Fixes special windows, used for example in the Pawn shop (room 280),
+// when the man in a robe complains about no more mints.
+// We have to change even more code, because the game uses PODialog class for
+// text windows and myDialog class for audio. Both are saved to KQ6Print::dialog
+// Sadly PODialog is created during KQ6Print::addText, myDialog is set during
+// KQ6Print::showSelf, which is called much later and KQ6Print::addText requires
+// KQ6Print::dialog to be set, which means we have to set it before calling addText
+// for audio mode, otherwise the user would have to click to get those windows disposed.
+// Applies to at least: PC-CD
+// Patched method: KQ6Print::say
+static const uint16 kq6CDSignatureAudioTextSupport3[] = {
+ 0x31, 0x6e, // bnt [to text code]
+ SIG_ADDTOOFFSET(+85),
+ SIG_MAGICDWORD,
+ 0x8f, 0x01, // lsp param[1]
+ 0x35, 0x01, // ldi 01
+ 0x1a, // eq?
+ 0x31, 0x0c, // bnt [code to set property repressText to 1]
+ 0x38, // pushi (selector addText)
+ SIG_ADDTOOFFSET(+9), // skip addText-calling code
+ 0x33, 0x10, // jmp [to ret]
+ 0x35, 0x01, // ldi 01
+ 0x65, 0x2e, // aTop repressText
+ 0x33, 0x0a, // jmp [to ret]
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextSupport3[] = {
+ 0x31, 0x5c, // adjust jump to reuse audio mode addText-calling code
+ PATCH_ADDTOOFFSET(102),
+ 0x48, // ret
+ 0x48, // ret (waste byte)
+ 0x72, 0x0e, 0x00, // lofsa myDialog
+ 0x65, 0x12, // aTop dialog
+ 0x33, 0xed, // jump back to audio mode addText-calling code
+ PATCH_END
+};
+
+// Additional patch specifically for King's Quest 6
+// Fixes text-window size for hires portraits mode
+// Otherwise at least at the end some text-windows will be way too small
+// Applies to at least: PC-CD
+// Patched method: Talker::init
+static const uint16 kq6CDSignatureAudioTextSupport4[] = {
+ SIG_MAGICDWORD,
+ 0x63, 0x94, // pToa raving
+ 0x31, 0x0a, // bnt [no rave code]
+ 0x35, 0x00, // ldi 00
+ SIG_ADDTOOFFSET(6), // skip reset of bust, eyes and mouth
+ 0x33, 0x24, // jmp [to super class code]
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextSupport4[] = {
+ PATCH_ADDTOOFFSET(+12),
+ 0x33, PATCH_GETORIGINALBYTEADJUST(+13, -6), // adjust jump to also include setSize call
+ PATCH_END
+};
+
+// Fixes text window placement, when dual mode is active (Guards in room 220)
+// Applies to at least: PC-CD
+// Patched method: tlkGateGuard1::init & tlkGateGuard2::init
+static const uint16 kq6CDSignatureAudioTextSupportGuards[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x01, // ldi 01
+ 0x1a, // eq?
+ SIG_END // followed by bnt for Guard1 and bt for Guard2
+};
+
+static const uint16 kq6CDPatchAudioTextSupportGuards[] = {
+ PATCH_ADDTOOFFSET(+2),
+ 0x35, 0x02, // ldi 02
+ 0x1c, // ne?
+ PATCH_END
+};
+
+// Fixes text window placement, when portrait+text is shown (Stepmother in room 250)
+// Applies to at least: PC-CD
+// Patched method: tlkStepmother::init
+static const uint16 kq6CDSignatureAudioTextSupportStepmother[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x02, // ldi 02
+ 0x12, // and
+ 0x31, // bnt [jump-for-text-code]
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextSupportJumpAlways[] = {
+ PATCH_ADDTOOFFSET(+4),
+ 0x1a, // eq?
+ PATCH_END
+};
+
+// Fixes "Girl In The Tower" to get played in dual mode as well
+// Applies to at least: PC-CD
+// Patched method: rm740::cue
+static const uint16 kq6CDSignatureAudioTextSupportGirlInTheTower[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq?
+ 0x31, // bnt [jump-for-text-code]
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextSupportGirlInTheTower[] = {
+ PATCH_ADDTOOFFSET(+4),
+ 0x12, // and
+ PATCH_END
+};
+
+// Additional patch specifically for King's Quest 6
+// Adds another button state for the text/audio button. We currently use the "speech" view for "dual" mode.
+// View 947, loop 9, cel 0+1 -> "text"
+// View 947, loop 8, cel 0+1 -> "speech"
+// View 947, loop 12, cel 0+1 -> "dual" (TODO: inject our own 2 views for the new "dual" mode)
+// Applies to at least: PC-CD
+// Patched method: iconTextSwitch::show, iconTextSwitch::doit
+static const uint16 kq6CDSignatureAudioTextMenuSupport[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq?
+ 0x31, 0x06, // bnt [set text view]
+ 0x35, 0x08, // ldi 08
+ 0x65, 0x14, // aTop loop
+ 0x33, 0x04, // jmp [skip over text view]
+ 0x35, 0x09, // ldi 09
+ 0x65, 0x14, // aTop loop
+ SIG_ADDTOOFFSET(+102), // skip to iconTextSwitch::doit code
+ 0x89, 0x5a, // lsg global[5a]
+ 0x3c, // dup
+ 0x35, 0x01, // ldi 01
+ 0x1a, // eq?
+ 0x31, 0x06, // bnt [set text mode]
+ 0x35, 0x02, // ldi 02
+ 0xa1, 0x5a, // sag global[5a]
+ 0x33, 0x0a, // jmp [skip over text mode code]
+ 0x3c, // dup
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq?
+ 0x31, 0x04, // bnt [skip over text ode code]
+ 0x35, 0x01, // ldi 01
+ 0xa1, 0x5a, // sag global[5a]
+ 0x3a, // toss
+ 0x67, 0x14, // pTos loop
+ 0x35, 0x09, // ldi 09
+ 0x1a, // eq?
+ 0x31, 0x04, // bnt [set text view]
+ 0x35, 0x08, // ldi 08
+ 0x33, 0x02, // jmp [skip text view]
+ 0x35, 0x09, // ldi 09
+ 0x65, 0x14, // aTop loop
+ SIG_END
+};
+
+static const uint16 kq6CDPatchAudioTextMenuSupport[] = {
+ PATCH_ADDTOOFFSET(+13),
+ 0x33, 0x79, // jmp to new text+dual code
+ PATCH_ADDTOOFFSET(+104), // seek to iconTextSwitch::doit
+ 0x81, 0x5a, // lag global[5a]
+ 0x78, // push1
+ 0x02, // add
+ 0xa1, 0x5a, // sag global[5a]
+ 0x36, // push
+ 0x35, 0x03, // ldi 03
+ 0x1e, // gt?
+ 0x31, 0x03, // bnt [skip over]
+ 0x78, // push1
+ 0xa9, 0x5a, // ssg global[5a]
+ 0x33, 0x17, // jmp [iconTextSwitch::show call]
+ // additional code for iconTextSwitch::show
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x01, // ldi 01
+ 0x1a, // eq?
+ 0x31, 0x04, // bnt [dual mode]
+ 0x35, 0x09, // ldi 09
+ 0x33, 0x02, // jmp [skip over dual mode]
+ 0x35, 0x0c, // ldi 0c (view 947, loop 12, cel 0+1 is our "dual" view, injected by view.cpp)
+ 0x65, 0x14, // aTop loop
+ 0x32, PATCH_UINT16(0xff75), // jmp [back to iconTextSwitch::show]
+ PATCH_END
+};
+
+// script, description, signature patch
+static const SciScriptPatcherEntry kq6Signatures[] = {
+ { true, 481, "duplicate baby cry", 1, kq6SignatureDuplicateBabyCry, kq6PatchDuplicateBabyCry },
+ { true, 907, "inventory stack fix", 1, kq6SignatureInventoryStackFix, kq6PatchInventoryStackFix },
+ { true, 87, "Drink Me bottle fix", 1, kq6SignatureDrinkMeFix, kq6PatchDrinkMeFix },
// King's Quest 6 and Laura Bow 2 share basic patches for audio + text support
- // *** King's Quest 6 audio + text support - CURRENTLY DISABLED ***
- // TODO: fix window placement (currently part of the text windows go off-screen)
- // TODO: fix hi-res portraits mode graphic glitches
- { false, 924, "CD: audio + text support 1", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport1, kq6laurabow2CDPatchAudioTextSupport1 },
- { false, 924, "CD: audio + text support 2", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport2, kq6laurabow2CDPatchAudioTextSupport2 },
- { false, 924, "CD: audio + text support 3", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport3, kq6laurabow2CDPatchAudioTextSupport3 },
- { false, 928, "CD: audio + text support 4", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport4, kq6laurabow2CDPatchAudioTextSupport4 },
- { false, 928, "CD: audio + text support 5", 2, 0, 0, kq6laurabow2CDSignatureAudioTextSupport5, kq6laurabow2CDPatchAudioTextSupport5 },
+ // *** King's Quest 6 audio + text support ***
+ { false, 924, "CD: audio + text support KQ6&LB2 1", 1, kq6laurabow2CDSignatureAudioTextSupport1, kq6laurabow2CDPatchAudioTextSupport1 },
+ { false, 924, "CD: audio + text support KQ6&LB2 2", 1, kq6laurabow2CDSignatureAudioTextSupport2, kq6laurabow2CDPatchAudioTextSupport2 },
+ { false, 924, "CD: audio + text support KQ6&LB2 3", 1, kq6laurabow2CDSignatureAudioTextSupport3, kq6laurabow2CDPatchAudioTextSupport3 },
+ { false, 928, "CD: audio + text support KQ6&LB2 4", 1, kq6laurabow2CDSignatureAudioTextSupport4, kq6laurabow2CDPatchAudioTextSupport4 },
+ { false, 928, "CD: audio + text support KQ6&LB2 5", 2, kq6laurabow2CDSignatureAudioTextSupport5, kq6laurabow2CDPatchAudioTextSupport5 },
+ { false, 909, "CD: audio + text support KQ6 1", 2, kq6CDSignatureAudioTextSupport1, kq6CDPatchAudioTextSupport1 },
+ { false, 928, "CD: audio + text support KQ6 2", 1, kq6CDSignatureAudioTextSupport2, kq6CDPatchAudioTextSupport2 },
+ { false, 104, "CD: audio + text support KQ6 3", 1, kq6CDSignatureAudioTextSupport3, kq6CDPatchAudioTextSupport3 },
+ { false, 928, "CD: audio + text support KQ6 4", 1, kq6CDSignatureAudioTextSupport4, kq6CDPatchAudioTextSupport4 },
+ { false, 1009, "CD: audio + text support KQ6 Guards", 2, kq6CDSignatureAudioTextSupportGuards, kq6CDPatchAudioTextSupportGuards },
+ { false, 1027, "CD: audio + text support KQ6 Stepmother", 1, kq6CDSignatureAudioTextSupportStepmother, kq6CDPatchAudioTextSupportJumpAlways },
+ { false, 740, "CD: audio + text support KQ6 Girl In The Tower", 1, kq6CDSignatureAudioTextSupportGirlInTheTower, kq6CDPatchAudioTextSupportGirlInTheTower },
+ { false, 903, "CD: audio + text support KQ6 menu", 1, kq6CDSignatureAudioTextMenuSupport, kq6CDPatchAudioTextMenuSupport },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1048,36 +1323,36 @@ SciScriptPatcherEntry kq6Signatures[] = {
// Applies to at least: German floppy
// Responsible method: unknown
// Fixes bug: #5264
-const uint16 longbowSignatureShowHandCode[] = {
+static const uint16 longbowSignatureShowHandCode[] = {
0x78, // push1
0x78, // push1
- 0x72, SIG_ADDTOOFFSET +2, // lofsa (letter, that was typed)
+ 0x72, SIG_ADDTOOFFSET(+2), // lofsa (letter, that was typed)
0x36, // push
- 0x40, SIG_ADDTOOFFSET +2, // call
+ 0x40, SIG_ADDTOOFFSET(+2), // call
0x02, // perform the call above with 2 parameters
0x36, // push
- 0x40, SIG_ADDTOOFFSET +2, // call
+ 0x40, SIG_ADDTOOFFSET(+2), // call
SIG_MAGICDWORD,
0x02, // perform the call above with 2 parameters
- 0x38, SIG_SELECTOR16 + SELECTOR_setMotion, // pushi "setMotion" (0x11c in Longbow German)
- 0x39, SIG_SELECTOR8 + SELECTOR_x, // pushi "x" (0x04 in Longbow German)
+ 0x38, SIG_SELECTOR16(setMotion), // pushi "setMotion" (0x11c in Longbow German)
+ 0x39, SIG_SELECTOR8(x), // pushi "x" (0x04 in Longbow German)
0x51, 0x1e, // class MoveTo
SIG_END
};
-const uint16 longbowPatchShowHandCode[] = {
+static const uint16 longbowPatchShowHandCode[] = {
0x39, 0x01, // pushi 1 (combine the two push1's in one, like in the English version)
- PATCH_ADDTOOFFSET +3, // leave the lofsa call untouched
+ PATCH_ADDTOOFFSET(+3), // leave the lofsa call untouched
// The following will remove the duplicate call
- 0x32, PATCH_UINT16 + 0x02, 0x00, // jmp 02 - skip 2 bytes (the remainder of the first call)
+ 0x32, PATCH_UINT16(0x0002), // jmp 02 - skip 2 bytes (the remainder of the first call)
0x48, // ret (dummy, should never be reached)
0x48, // ret (dummy, should never be reached)
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry longbowSignatures[] = {
- { true, 210, "hand code crash", 5, 0, 0, longbowSignatureShowHandCode, longbowPatchShowHandCode },
+// script, description, signature patch
+static const SciScriptPatcherEntry longbowSignatures[] = {
+ { true, 210, "hand code crash", 5, longbowSignatureShowHandCode, longbowPatchShowHandCode },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1098,28 +1373,28 @@ SciScriptPatcherEntry longbowSignatures[] = {
// Applies to at least: English floppy
// Responsible method: rm63Script::handleEvent
// Fixes bug: #6346
-const uint16 larry2SignatureWearParachutePoints[] = {
+static const uint16 larry2SignatureWearParachutePoints[] = {
0x35, 0x01, // ldi 01
0xa1, SIG_MAGICDWORD, 0x8e, // sag 8e
- 0x80, SIG_UINT16 + 0xe0, 0x01, // lag 1e0
+ 0x80, SIG_UINT16(0x01e0), // lag 1e0
0x18, // not
- 0x30, SIG_UINT16 + 0x0f, 0x00, // bnt [don't give points]
+ 0x30, SIG_UINT16(0x000f), // bnt [don't give points]
0x35, 0x01, // ldi 01
0xa0, 0xe0, 0x01, // sag 1e0
SIG_END
};
-const uint16 larry2PatchWearParachutePoints[] = {
- PATCH_ADDTOOFFSET +4,
- 0x80, PATCH_UINT16 + 0x5a, 0x00, // lag 5a (global 90)
- PATCH_ADDTOOFFSET +6,
- 0xa0, PATCH_UINT16 + 0x5a, 0x00, // sag 5a (global 90)
+static const uint16 larry2PatchWearParachutePoints[] = {
+ PATCH_ADDTOOFFSET(+4),
+ 0x80, PATCH_UINT16(0x005a), // lag 5a (global 90)
+ PATCH_ADDTOOFFSET(+6),
+ 0xa0, PATCH_UINT16(0x005a), // sag 5a (global 90)
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry larry2Signatures[] = {
- { true, 63, "plane: no points for wearing plane", 1, 0, 0, larry2SignatureWearParachutePoints, larry2PatchWearParachutePoints },
+// script, description, signature patch
+static const SciScriptPatcherEntry larry2Signatures[] = {
+ { true, 63, "plane: no points for wearing plane", 1, larry2SignatureWearParachutePoints, larry2PatchWearParachutePoints },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1131,24 +1406,24 @@ SciScriptPatcherEntry larry2Signatures[] = {
// Because of that the talking head of Patti is drawn over the textbox. A translation oversight.
// Applies to at least: German floppy
// Responsible method: none, position of talker object on screen needs to get modified
-const uint16 larry5SignatureGermanEndingPattiTalker[] = {
+static const uint16 larry5SignatureGermanEndingPattiTalker[] = {
SIG_MAGICDWORD,
- SIG_UINT16 + 0x6e, 0x00, // object pattiTalker::x (110)
- SIG_UINT16 + 0xb4, 0x00, // object pattiTalker::y (180)
- SIG_ADDTOOFFSET + 469, // verify that it's really the German version
+ SIG_UINT16(0x006e), // object pattiTalker::x (110)
+ SIG_UINT16(0x00b4), // object pattiTalker::y (180)
+ SIG_ADDTOOFFSET(+469), // verify that it's really the German version
0x59, 0x6f, 0x75, // (object name) "You"
0x23, 0x47, 0x44, 0x75, // "#GDu"
SIG_END
};
-const uint16 larry5PatchGermanEndingPattiTalker[] = {
- PATCH_UINT16 + 0x5a, 0x00, // change pattiTalker::x to 90
+static const uint16 larry5PatchGermanEndingPattiTalker[] = {
+ PATCH_UINT16(0x005a), // change pattiTalker::x to 90
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry larry5Signatures[] = {
- { true, 380, "German-only: Enlarge Patti Textbox", 1, 0, 0, larry5SignatureGermanEndingPattiTalker, larry5PatchGermanEndingPattiTalker },
+// script, description, signature patch
+static const SciScriptPatcherEntry larry5Signatures[] = {
+ { true, 380, "German-only: Enlarge Patti Textbox", 1, larry5SignatureGermanEndingPattiTalker, larry5PatchGermanEndingPattiTalker },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1162,50 +1437,50 @@ SciScriptPatcherEntry larry5Signatures[] = {
// in sierra sci)
// Applies to at least: German PC-CD
// Responsible method: unknown
-const uint16 larry6SignatureDeathDialog[] = {
+static const uint16 larry6SignatureDeathDialog[] = {
SIG_MAGICDWORD,
- 0x3e, SIG_UINT16 + 0x33, 0x01, // link 0133 (offset 0x20)
+ 0x3e, SIG_UINT16(0x0133), // link 0133 (offset 0x20)
0x35, 0xff, // ldi ff
0xa3, 0x00, // sal 00
- SIG_ADDTOOFFSET +680, // [skip 680 bytes]
+ SIG_ADDTOOFFSET(+680), // [skip 680 bytes]
0x8f, 0x01, // lsp 01 (offset 0x2cf)
0x7a, // push2
- 0x5a, SIG_UINT16 + 0x04, 0x00, SIG_UINT16 + 0x0e, 0x01, // lea 0004 010e
+ 0x5a, SIG_UINT16(0x0004), SIG_UINT16(0x010e), // lea 0004 010e
0x36, // push
0x43, 0x7c, 0x0e, // kMessage[7c] 0e
- SIG_ADDTOOFFSET +90, // [skip 90 bytes]
- 0x38, SIG_UINT16 + 0xd6, 0x00, // pushi 00d6 (offset 0x335)
+ SIG_ADDTOOFFSET(+90), // [skip 90 bytes]
+ 0x38, SIG_UINT16(0x00d6), // pushi 00d6 (offset 0x335)
0x78, // push1
- 0x5a, SIG_UINT16 + 0x04, 0x00, SIG_UINT16 + 0x0e, 0x01, // lea 0004 010e
+ 0x5a, SIG_UINT16(0x0004), SIG_UINT16(0x010e), // lea 0004 010e
0x36, // push
- SIG_ADDTOOFFSET +76, // [skip 76 bytes]
- 0x38, SIG_UINT16 + 0xcd, 0x00, // pushi 00cd (offset 0x38b)
+ SIG_ADDTOOFFSET(+76), // [skip 76 bytes]
+ 0x38, SIG_UINT16(0x00cd), // pushi 00cd (offset 0x38b)
0x39, 0x03, // pushi 03
- 0x5a, SIG_UINT16 + 0x04, 0x00, SIG_UINT16 + 0x0e, 0x01, // lea 0004 010e
+ 0x5a, SIG_UINT16(0x0004), SIG_UINT16(0x010e), // lea 0004 010e
0x36,
SIG_END
};
-const uint16 larry6PatchDeathDialog[] = {
+static const uint16 larry6PatchDeathDialog[] = {
0x3e, 0x00, 0x02, // link 0200
- PATCH_ADDTOOFFSET +687,
- 0x5a, PATCH_UINT16 + 0x04, 0x00, PATCH_UINT16 + 0x40, 0x01, // lea 0004 0140
- PATCH_ADDTOOFFSET +98,
- 0x5a, PATCH_UINT16 + 0x04, 0x00, PATCH_UINT16 + 0x40, 0x01, // lea 0004 0140
- PATCH_ADDTOOFFSET +82,
- 0x5a, PATCH_UINT16 + 0x04, 0x00, PATCH_UINT16 + 0x40, 0x01, // lea 0004 0140
+ PATCH_ADDTOOFFSET(+687),
+ 0x5a, PATCH_UINT16(0x0004), PATCH_UINT16(0x0140), // lea 0004 0140
+ PATCH_ADDTOOFFSET(+98),
+ 0x5a, PATCH_UINT16(0x0004), PATCH_UINT16(0x0140), // lea 0004 0140
+ PATCH_ADDTOOFFSET(+82),
+ 0x5a, PATCH_UINT16(0x0004), PATCH_UINT16(0x0140), // lea 0004 0140
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry larry6Signatures[] = {
- { true, 82, "death dialog memory corruption", 1, 0, 0, larry6SignatureDeathDialog, larry6PatchDeathDialog },
+// script, description, signature patch
+static const SciScriptPatcherEntry larry6Signatures[] = {
+ { true, 82, "death dialog memory corruption", 1, larry6SignatureDeathDialog, larry6PatchDeathDialog },
SCI_SIGNATUREENTRY_TERMINATOR
};
// ===========================================================================
// Laura Bow 2
-//
+//
// Moving away the painting in the room with the hidden safe is problematic
// for the CD version of the game. safePic::doVerb gets triggered by the mouse-click.
// This method sets local 0 as signal, which is only meant to get handled, when
@@ -1230,18 +1505,18 @@ SciScriptPatcherEntry larry6Signatures[] = {
// Applies to at least: English PC-CD
// Responsible method: rm560::doit
// Fixes bug: #6460
-const uint16 laurabow2CDSignaturePaintingClosing[] = {
+static const uint16 laurabow2CDSignaturePaintingClosing[] = {
0x39, 0x04, // pushi 04 (cel)
0x76, // push0
SIG_MAGICDWORD,
0x7a, // push2
- 0x38, SIG_UINT16 + 0x31, 0x02, // pushi 0231h (561)
+ 0x38, SIG_UINT16(0x0231), // pushi 0231h (561)
0x76, // push0
0x43, 0x02, 0x04, // kScriptID (get export 0 of script 561)
0x4a, 0x04, // send 04 (gets safePicture::cel)
0x18, // not
0x31, 0x21, // bnt [exit]
- 0x38, SIG_UINT16 + 0x83, 0x02, // pushi 0283h
+ 0x38, SIG_UINT16(0x0283), // pushi 0283h
0x76, // push0
0x7a, // push2
0x39, 0x20, // pushi 20
@@ -1257,20 +1532,20 @@ const uint16 laurabow2CDSignaturePaintingClosing[] = {
SIG_END
};
-const uint16 laurabow2CDPatchPaintingClosing[] = {
- PATCH_ADDTOOFFSET +2,
+static const uint16 laurabow2CDPatchPaintingClosing[] = {
+ PATCH_ADDTOOFFSET(+2),
0x3c, // dup (1 additional byte)
0x76, // push0
0x3c, // dup (1 additional byte)
0xab, 0x00, // ssl local[0] -> reset safePic signal
0x7a, // push2
- 0x38, PATCH_UINT16 + 0x31, 0x02, // pushi 0231h (561)
+ 0x38, PATCH_UINT16(0x0231), // pushi 0231h (561)
0x76, // push0
0x43, 0x02, 0x04, // kScriptID (get export 0 of script 561)
0x4a, 0x04, // send 04 (gets safePicture::cel)
0x1a, // eq?
0x31, 0x1d, // bnt [exit]
- 0x38, PATCH_UINT16 + 0x83, 0x02, // pushi 0283h
+ 0x38, PATCH_UINT16(0x0283), // pushi 0283h
0x76, // push0
0x7a, // push2
0x39, 0x20, // pushi 20
@@ -1303,16 +1578,16 @@ const uint16 laurabow2CDPatchPaintingClosing[] = {
// Applies to at least: English PC-CD
// Responsible method: LB2::newRoom, LB2::handsOff, LB2::handsOn
// Fixes bug: #6440
-const uint16 laurabow2CDSignatureFixProblematicIconBar[] = {
+static const uint16 laurabow2CDSignatureFixProblematicIconBar[] = {
SIG_MAGICDWORD,
- 0x38, SIG_UINT16 + 0xf1, 0x00, // pushi 00f1 (disable) - hardcoded, we only want to patch the CD version
+ 0x38, SIG_UINT16(0x00f1), // pushi 00f1 (disable) - hardcoded, we only want to patch the CD version
0x76, // push0
0x81, 0x45, // lag global[45]
0x4a, 0x04, // send 04
SIG_END
};
-const uint16 laurabow2CDPatchFixProblematicIconBar[] = {
+static const uint16 laurabow2CDPatchFixProblematicIconBar[] = {
0x35, 0x00, // ldi 00
0xa1, 0x74, // sag 74h
0x35, 0x00, // ldi 00 (waste bytes)
@@ -1320,17 +1595,105 @@ const uint16 laurabow2CDPatchFixProblematicIconBar[] = {
PATCH_END
};
+// Laura Bow 2 CD resets the audio mode to speech on init/restart
+// We already sync the settings from ScummVM (see SciEngine::syncIngameAudioOptions())
+// and this script code would make it impossible to see the intro using "dual" mode w/o using debugger command
+// That's why we remove the corresponding code
+// Patched method: LB2::init, rm100::init
+static const uint16 laurabow2CDSignatureAudioTextSupportModeReset[] = {
+ SIG_MAGICDWORD,
+ 0x35, 0x02, // ldi 02
+ 0xa1, 0x5a, // sag global[5a]
+ SIG_END
+};
+
+static const uint16 laurabow2CDPatchAudioTextSupportModeReset[] = {
+ 0x34, PATCH_UINT16(0x0001), // ldi 0001 (waste bytes)
+ 0x18, // not (waste bytes)
+ PATCH_END
+};
+
+// Directly use global 5a for view-cel id
+// That way it's possible to use a new "dual" mode view in the game menu
+// View 995, loop 13, cel 0 -> "text"
+// View 995, loop 13, cel 1 -> "speech"
+// View 995, loop 13, cel 2 -> "dual" (TODO: inject our own view for the new "dual" mode)
+// Patched method: gcWin::open
+static const uint16 laurabow2CDSignatureAudioTextMenuSupport1[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq?
+ 0x36, // push
+ SIG_END
+};
+
+static const uint16 laurabow2CDPatchAudioTextMenuSupport1[] = {
+ PATCH_ADDTOOFFSET(+2),
+ 0x35, 0x01, // ldi 01
+ 0x04, // sub
+ PATCH_END
+};
+
+// Adds another button state for the text/audio button. We currently use the "speech" view for "dual" mode.
+// TODO: inject our own 2 views for the new "dual" mode
+// Patched method: iconMode::doit
+static const uint16 laurabow2CDSignatureAudioTextMenuSupport2[] = {
+ SIG_MAGICDWORD,
+ 0x89, 0x5a, // lsg global[5a]
+ 0x3c, // dup
+ 0x1a, // eq?
+ 0x31, 0x0a, // bnt [set text mode]
+ 0x35, 0x02, // ldi 02
+ 0xa1, 0x5a, // sag global[5a]
+ 0x35, 0x01, // ldi 01
+ 0xa5, 0x00, // sat temp[0]
+ 0x33, 0x0e, // jmp [draw cel code]
+ 0x3c, // dup
+ 0x35, 0x02, // ldi 02
+ 0x1a, // eq?
+ 0x31, 0x08, // bnt [draw cel code]
+ 0x35, 0x01, // ldi 01
+ 0xa1, 0x5a, // sag global[5a]
+ 0x35, 0x00, // ldi 00
+ 0xa5, 0x00, // sat temp[0]
+ 0x3a, // toss
+ SIG_END
+};
+
+static const uint16 laurabow2CDPatchAudioTextMenuSupport2[] = {
+ 0x81, 0x5a, // lag global[5a]
+ 0x78, // push1
+ 0x02, // add
+ 0xa1, 0x5a, // sag global[5a]
+ 0x36, // push
+ 0x35, 0x03, // ldi 03
+ 0x1e, // gt?
+ 0x31, 0x03, // bnt [skip over]
+ 0x78, // push1
+ 0xa9, 0x5a, // ssg global[5a]
+ 0x89, 0x5a, // lsg global[5a]
+ 0x35, 0x01, // ldi 01
+ 0x04, // sub
+ 0xa5, 0x00, // sat temp[0] - calculate global[5a] - 1 to use as view cel id
+ 0x33, 0x07, // jmp [draw cel code, don't do toss]
+ PATCH_END
+};
-// script, description, signature patch
-SciScriptPatcherEntry laurabow2Signatures[] = {
- { true, 560, "CD: painting closing immediately", 1, 0, 0, laurabow2CDSignaturePaintingClosing, laurabow2CDPatchPaintingClosing },
- { true, 0, "CD: fix problematic icon bar", 1, 0, 0, laurabow2CDSignatureFixProblematicIconBar, laurabow2CDPatchFixProblematicIconBar },
+// script, description, signature patch
+static const SciScriptPatcherEntry laurabow2Signatures[] = {
+ { true, 560, "CD: painting closing immediately", 1, laurabow2CDSignaturePaintingClosing, laurabow2CDPatchPaintingClosing },
+ { true, 0, "CD: fix problematic icon bar", 1, laurabow2CDSignatureFixProblematicIconBar, laurabow2CDPatchFixProblematicIconBar },
// King's Quest 6 and Laura Bow 2 share basic patches for audio + text support
- { false, 924, "CD: audio + text support 1", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport1, kq6laurabow2CDPatchAudioTextSupport1 },
- { false, 924, "CD: audio + text support 2", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport2, kq6laurabow2CDPatchAudioTextSupport2 },
- { false, 924, "CD: audio + text support 3", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport3, kq6laurabow2CDPatchAudioTextSupport3 },
- { false, 928, "CD: audio + text support 4", 1, 0, 0, kq6laurabow2CDSignatureAudioTextSupport4, kq6laurabow2CDPatchAudioTextSupport4 },
- { false, 928, "CD: audio + text support 5", 2, 0, 0, kq6laurabow2CDSignatureAudioTextSupport5, kq6laurabow2CDPatchAudioTextSupport5 },
+ { false, 924, "CD: audio + text support 1", 1, kq6laurabow2CDSignatureAudioTextSupport1, kq6laurabow2CDPatchAudioTextSupport1 },
+ { false, 924, "CD: audio + text support 2", 1, kq6laurabow2CDSignatureAudioTextSupport2, kq6laurabow2CDPatchAudioTextSupport2 },
+ { false, 924, "CD: audio + text support 3", 1, kq6laurabow2CDSignatureAudioTextSupport3, kq6laurabow2CDPatchAudioTextSupport3 },
+ { false, 928, "CD: audio + text support 4", 1, kq6laurabow2CDSignatureAudioTextSupport4, kq6laurabow2CDPatchAudioTextSupport4 },
+ { false, 928, "CD: audio + text support 5", 2, kq6laurabow2CDSignatureAudioTextSupport5, kq6laurabow2CDPatchAudioTextSupport5 },
+ { false, 0, "CD: audio + text support disable mode reset", 1, laurabow2CDSignatureAudioTextSupportModeReset, laurabow2CDPatchAudioTextSupportModeReset },
+ { false, 100, "CD: audio + text support disable mode reset", 1, laurabow2CDSignatureAudioTextSupportModeReset, laurabow2CDPatchAudioTextSupportModeReset },
+ { false, 24, "CD: audio + text support LB2 menu 1", 1, laurabow2CDSignatureAudioTextMenuSupport1, laurabow2CDPatchAudioTextMenuSupport1 },
+ { false, 24, "CD: audio + text support LB2 menu 2", 1, laurabow2CDSignatureAudioTextMenuSupport2, laurabow2CDPatchAudioTextMenuSupport2 },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1339,7 +1702,7 @@ SciScriptPatcherEntry laurabow2Signatures[] = {
// MG::replay somewhat calculates the savedgame-id used when saving again
// this doesn't work right and we remove the code completely.
// We set the savedgame-id directly right after restoring in kRestoreGame.
-const uint16 mothergoose256SignatureReplay[] = {
+static const uint16 mothergoose256SignatureReplay[] = {
0x36, // push
0x35, SIG_MAGICDWORD, 0x20, // ldi 20
0x04, // sub
@@ -1347,32 +1710,32 @@ const uint16 mothergoose256SignatureReplay[] = {
SIG_END
};
-const uint16 mothergoose256PatchReplay[] = {
- 0x34, PATCH_UINT16 + 0x00, 0x00, // ldi 0000 (dummy)
- 0x34, PATCH_UINT16 + 0x00, 0x00, // ldi 0000 (dummy)
+static const uint16 mothergoose256PatchReplay[] = {
+ 0x34, PATCH_UINT16(0x0000), // ldi 0000 (dummy)
+ 0x34, PATCH_UINT16(0x0000), // ldi 0000 (dummy)
PATCH_END
};
// when saving, it also checks if the savegame ID is below 13.
// we change this to check if below 113 instead
-const uint16 mothergoose256SignatureSaveLimit[] = {
+static const uint16 mothergoose256SignatureSaveLimit[] = {
0x89, SIG_MAGICDWORD, 0xb3, // lsg global[b3]
0x35, 0x0d, // ldi 0d
0x20, // ge?
SIG_END
};
-const uint16 mothergoose256PatchSaveLimit[] = {
- PATCH_ADDTOOFFSET | +2,
+static const uint16 mothergoose256PatchSaveLimit[] = {
+ PATCH_ADDTOOFFSET(+2),
0x35, 0x0d + SAVEGAMEID_OFFICIALRANGE_START, // ldi 113d
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry mothergoose256Signatures[] = {
- { true, 0, "replay save issue", 1, 0, 0, mothergoose256SignatureReplay, mothergoose256PatchReplay },
- { true, 0, "save limit dialog (SCI1.1)", 1, 0, 0, mothergoose256SignatureSaveLimit, mothergoose256PatchSaveLimit },
- { true, 994, "save limit dialog (SCI1)", 1, 0, 0, mothergoose256SignatureSaveLimit, mothergoose256PatchSaveLimit },
+// script, description, signature patch
+static const SciScriptPatcherEntry mothergoose256Signatures[] = {
+ { true, 0, "replay save issue", 1, mothergoose256SignatureReplay, mothergoose256PatchReplay },
+ { true, 0, "save limit dialog (SCI1.1)", 1, mothergoose256SignatureSaveLimit, mothergoose256PatchSaveLimit },
+ { true, 994, "save limit dialog (SCI1)", 1, mothergoose256SignatureSaveLimit, mothergoose256PatchSaveLimit },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1389,13 +1752,13 @@ SciScriptPatcherEntry mothergoose256Signatures[] = {
// Applies to at least: English floppy
// Responsible method: putGun::changeState (script 341)
// Fixes bug: #5705 / #6400
-const uint16 pq1vgaSignaturePutGunInLockerBug[] = {
+static const uint16 pq1vgaSignaturePutGunInLockerBug[] = {
0x35, 0x00, // ldi 00
0x1a, // eq?
0x31, 0x25, // bnt [next state check]
- SIG_ADDTOOFFSET +22, // [skip 22 bytes]
+ SIG_ADDTOOFFSET(+22), // [skip 22 bytes]
SIG_MAGICDWORD,
- 0x38, SIG_SELECTOR16 + SELECTOR_put, // pushi "put"
+ 0x38, SIG_SELECTOR16(put), // pushi "put"
0x78, // push1
0x76, // push0
0x81, 0x00, // lag 00
@@ -1407,17 +1770,17 @@ const uint16 pq1vgaSignaturePutGunInLockerBug[] = {
0x35, 0x01, // ldi 01
0x1a, // eq?
0x31, 0x08, // bnt [end of method]
- 0x39, SIG_SELECTOR8 + SELECTOR_dispose, // pushi "dispose"
+ 0x39, SIG_SELECTOR8(dispose), // pushi "dispose"
0x76, // push0
- 0x72, SIG_UINT16 + 0x88, 0x00, // lofsa 0088
+ 0x72, SIG_UINT16(0x0088), // lofsa 0088
0x4a, 0x04, // send 04 - locker::dispose
SIG_END
};
-const uint16 pq1vgaPatchPutGunInLockerBug[] = {
- PATCH_ADDTOOFFSET +3,
+static const uint16 pq1vgaPatchPutGunInLockerBug[] = {
+ PATCH_ADDTOOFFSET(+3),
0x31, 0x1c, // bnt [next state check]
- PATCH_ADDTOOFFSET +22,
+ PATCH_ADDTOOFFSET(+22),
0x35, 0x02, // ldi 02
0x65, 0x1c, // aTop 1c (set timer to 2 seconds)
0x33, 0x17, // jmp [end of method]
@@ -1425,7 +1788,7 @@ const uint16 pq1vgaPatchPutGunInLockerBug[] = {
0x35, 0x01, // ldi 01
0x1a, // eq?
0x31, 0x11, // bnt [end of method]
- 0x38, PATCH_SELECTOR16 + SELECTOR_put, // pushi "put"
+ 0x38, PATCH_SELECTOR16(put), // pushi "put"
0x78, // push1
0x76, // push0
0x81, 0x00, // lag 00
@@ -1433,9 +1796,42 @@ const uint16 pq1vgaPatchPutGunInLockerBug[] = {
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry pq1vgaSignatures[] = {
- { true, 341, "put gun in locker bug", 1, 0, 0, pq1vgaSignaturePutGunInLockerBug, pq1vgaPatchPutGunInLockerBug },
+// When restoring a saved game, which was made while driving around,
+// the game didn't redraw the map. This also happened in Sierra SCI.
+//
+// The map is a picture resource and drawn over the main picture.
+// This is called an "overlay" in SCI. This wasn't implemented properly.
+// We fix it by actually implementing it properly.
+//
+// Applies to at least: English floppy
+// Responsible method: rm500::init, changeOverlay::changeState (script 500)
+// Fixes bug: #5016
+static const uint16 pq1vgaSignatureMapSaveRestoreBug[] = {
+ 0x39, 0x04, // pushi 04
+ SIG_ADDTOOFFSET(+2), // skip either lsg global[f9] or pTos register
+ SIG_MAGICDWORD,
+ 0x38, 0x64, 0x80, // pushi 8064
+ 0x76, // push0
+ 0x89, 0x28, // lsg global[28]
+ 0x43, 0x08, 0x08, // kDrawPic (8)
+ SIG_END
+};
+
+static const uint16 pq1vgaPatchMapSaveRestoreBug[] = {
+ 0x38, PATCH_SELECTOR16(overlay), // pushi "overlay"
+ 0x7a, // push2
+ 0x89, 0xf9, // lsg global[f9]
+ 0x39, 0x64, // pushi 64 (no transition)
+ 0x81, 0x02, // lag global[02] (current room object)
+ 0x4a, 0x08, // send 08
+ 0x18, // not (waste byte)
+ PATCH_END
+};
+
+// script, description, signature patch
+static const SciScriptPatcherEntry pq1vgaSignatures[] = {
+ { true, 341, "put gun in locker bug", 1, pq1vgaSignaturePutGunInLockerBug, pq1vgaPatchPutGunInLockerBug },
+ { true, 500, "map save/restore bug", 2, pq1vgaSignatureMapSaveRestoreBug, pq1vgaPatchMapSaveRestoreBug },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1450,9 +1846,9 @@ SciScriptPatcherEntry pq1vgaSignatures[] = {
// We just reuse the active event, thus removing the duplicate kGetEvent call.
// Applies to at least: English floppy
// Responsible method: pointBox::doit
-const uint16 qfg1vgaSignatureFightEvents[] = {
+static const uint16 qfg1vgaSignatureFightEvents[] = {
0x39, SIG_MAGICDWORD,
- SIG_SELECTOR8 + SELECTOR_new, // pushi "new"
+ SIG_SELECTOR8(new), // pushi "new"
0x76, // push0
0x51, 0x07, // class Event
0x4a, 0x04, // send 04 - call Event::new
@@ -1471,8 +1867,8 @@ const uint16 qfg1vgaSignatureFightEvents[] = {
SIG_END
};
-const uint16 qfg1vgaPatchFightEvents[] = {
- 0x38, PATCH_SELECTOR16 + SELECTOR_curEvent, // pushi 15a (selector curEvent)
+static const uint16 qfg1vgaPatchFightEvents[] = {
+ 0x38, PATCH_SELECTOR16(curEvent), // pushi 15a (selector curEvent)
0x76, // push0
0x81, 0x50, // lag global[50]
0x4a, 0x04, // send 04 - read User::curEvent -> needs one byte more than previous code
@@ -1500,27 +1896,27 @@ const uint16 qfg1vgaPatchFightEvents[] = {
// Fixes bug: #6139.
// Patch 1: Increase temp space
-const uint16 qfg1vgaSignatureTempSpace[] = {
+static const uint16 qfg1vgaSignatureTempSpace[] = {
SIG_MAGICDWORD,
0x3f, 0xba, // link 0xba
0x87, 0x00, // lap 0
SIG_END
};
-const uint16 qfg1vgaPatchTempSpace[] = {
+static const uint16 qfg1vgaPatchTempSpace[] = {
0x3f, 0xca, // link 0xca
PATCH_END
};
// Patch 2: Move the pointer used for the window header a little bit
-const uint16 qfg1vgaSignatureDialogHeader[] = {
+static const uint16 qfg1vgaSignatureDialogHeader[] = {
SIG_MAGICDWORD,
0x5b, 0x04, 0x80, // lea temp[0x80]
0x36, // push
SIG_END
};
-const uint16 qfg1vgaPatchDialogHeader[] = {
+static const uint16 qfg1vgaPatchDialogHeader[] = {
0x5b, 0x04, 0x90, // lea temp[0x90]
PATCH_END
};
@@ -1534,18 +1930,18 @@ const uint16 qfg1vgaPatchDialogHeader[] = {
// the crusher, ego is supposed to move close to position 79, 165. We change it
// to 85, 165, which is not an edge case thus the freeze is avoided.
// Fixes bug: #6180
-const uint16 qfg1vgaSignatureMoveToCrusher[] = {
+static const uint16 qfg1vgaSignatureMoveToCrusher[] = {
SIG_MAGICDWORD,
0x51, 0x1f, // class Motion
0x36, // push
0x39, 0x4f, // pushi 4f (79 - x)
- 0x38, SIG_UINT16 + 0xa5, 0x00, // pushi 00a5 (165 - y)
+ 0x38, SIG_UINT16(0x00a5), // pushi 00a5 (165 - y)
0x7c, // pushSelf
SIG_END
};
-const uint16 qfg1vgaPatchMoveToCrusher[] = {
- PATCH_ADDTOOFFSET +3,
+static const uint16 qfg1vgaPatchMoveToCrusher[] = {
+ PATCH_ADDTOOFFSET(+3),
0x39, 0x55, // pushi 55 (85 - x)
PATCH_END
};
@@ -1554,7 +1950,7 @@ const uint16 qfg1vgaPatchMoveToCrusher[] = {
// spot when sneaking. In GuardsTrumpet::changeState, we change the final
// location where Ego is moved from 111, 111 to 114, 114.
// Fixes bug: #6248
-const uint16 qfg1vgaSignatureMoveToCastleGate[] = {
+static const uint16 qfg1vgaSignatureMoveToCastleGate[] = {
SIG_MAGICDWORD,
0x51, 0x1f, // class MoveTo
0x36, // push
@@ -1564,8 +1960,8 @@ const uint16 qfg1vgaSignatureMoveToCastleGate[] = {
SIG_END
};
-const uint16 qfg1vgaPatchMoveToCastleGate[] = {
- PATCH_ADDTOOFFSET +3,
+static const uint16 qfg1vgaPatchMoveToCastleGate[] = {
+ PATCH_ADDTOOFFSET(+3),
0x39, 0x72, // pushi 72 (114 - x)
PATCH_END
};
@@ -1576,12 +1972,12 @@ const uint16 qfg1vgaPatchMoveToCastleGate[] = {
// Applies to at least: English floppy
// Responsible method: smallMonster::doVerb
// Fixes bug #6249
-const uint16 qfg1vgaSignatureCheetaurDescription[] = {
+static const uint16 qfg1vgaSignatureCheetaurDescription[] = {
SIG_MAGICDWORD,
- 0x34, SIG_UINT16 + 0xb8, 0x01, // ldi 01b8
+ 0x34, SIG_UINT16(0x01b8), // ldi 01b8
0x1a, // eq?
0x31, 0x16, // bnt 16
- 0x38, SIG_UINT16 + 0x27, 0x01, // pushi 0127
+ 0x38, SIG_UINT16(0x0127), // pushi 0127
0x39, 0x06, // pushi 06
0x39, 0x03, // pushi 03
0x78, // push1
@@ -1589,8 +1985,8 @@ const uint16 qfg1vgaSignatureCheetaurDescription[] = {
SIG_END
};
-const uint16 qfg1vgaPatchCheetaurDescription[] = {
- PATCH_ADDTOOFFSET +14,
+static const uint16 qfg1vgaPatchCheetaurDescription[] = {
+ PATCH_ADDTOOFFSET(+14),
0x39, 0x11, // pushi 11 -> monster type cheetaur
PATCH_END
};
@@ -1608,22 +2004,22 @@ const uint16 qfg1vgaPatchCheetaurDescription[] = {
// Applies to at least: English floppy
// Responsible method: happyFace::changeState, door11::doit
// Fixes bug #6181
-const uint16 qfg1vgaSignatureFunnyRoomFix[] = {
+static const uint16 qfg1vgaSignatureFunnyRoomFix[] = {
0x65, 0x14, // aTop 14 (state)
0x36, // push
0x3c, // dup
0x35, 0x00, // ldi 00
0x1a, // eq?
- 0x30, SIG_UINT16 + 0x25, 0x00, // bnt 0025 [-> next state]
+ 0x30, SIG_UINT16(0x0025), // bnt 0025 [-> next state]
SIG_MAGICDWORD,
0x35, 0x01, // ldi 01
0xa3, 0x4e, // sal 4e
SIG_END
};
-const uint16 qfg1vgaPatchFunnyRoomFix[] = {
- PATCH_ADDTOOFFSET +3,
- 0x2e, PATCH_UINT16 + 0x29, 0x00, // bt 0029 [-> next state] - saves 4 bytes
+static const uint16 qfg1vgaPatchFunnyRoomFix[] = {
+ PATCH_ADDTOOFFSET(+3),
+ 0x2e, PATCH_UINT16(0x0029), // bt 0029 [-> next state] - saves 4 bytes
0x35, 0x01, // ldi 01
0xa3, 0x4e, // sal 4e
0xa3, 0x05, // sal 05 (sets local 5 to 1)
@@ -1631,16 +2027,16 @@ const uint16 qfg1vgaPatchFunnyRoomFix[] = {
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry qfg1vgaSignatures[] = {
- { true, 215, "fight event issue", 1, 0, 0, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents },
- { true, 216, "weapon master event issue", 1, 0, 0, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents },
- { true, 814, "window text temp space", 1, 0, 0, qfg1vgaSignatureTempSpace, qfg1vgaPatchTempSpace },
- { true, 814, "dialog header offset", 3, 0, 0, qfg1vgaSignatureDialogHeader, qfg1vgaPatchDialogHeader },
- { true, 331, "moving to crusher", 1, 0, 0, qfg1vgaSignatureMoveToCrusher, qfg1vgaPatchMoveToCrusher },
- { true, 41, "moving to castle gate", 1, 0, 0, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate },
- { true, 210, "cheetaur description fixed", 1, 0, 0, qfg1vgaSignatureCheetaurDescription, qfg1vgaPatchCheetaurDescription },
- { true, 96, "funny room script bug fixed", 1, 0, 0, qfg1vgaSignatureFunnyRoomFix, qfg1vgaPatchFunnyRoomFix },
+// script, description, signature patch
+static const SciScriptPatcherEntry qfg1vgaSignatures[] = {
+ { true, 215, "fight event issue", 1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents },
+ { true, 216, "weapon master event issue", 1, qfg1vgaSignatureFightEvents, qfg1vgaPatchFightEvents },
+ { true, 814, "window text temp space", 1, qfg1vgaSignatureTempSpace, qfg1vgaPatchTempSpace },
+ { true, 814, "dialog header offset", 3, qfg1vgaSignatureDialogHeader, qfg1vgaPatchDialogHeader },
+ { true, 331, "moving to crusher", 1, qfg1vgaSignatureMoveToCrusher, qfg1vgaPatchMoveToCrusher },
+ { true, 41, "moving to castle gate", 1, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate },
+ { true, 210, "cheetaur description fixed", 1, qfg1vgaSignatureCheetaurDescription, qfg1vgaPatchCheetaurDescription },
+ { true, 96, "funny room script bug fixed", 1, qfg1vgaSignatureFunnyRoomFix, qfg1vgaPatchFunnyRoomFix },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1658,9 +2054,9 @@ SciScriptPatcherEntry qfg1vgaSignatures[] = {
// and text entry refreshes whenever a button is pressed, and prevent possible
// crashes because of these constant quick object reallocations.
// Fixes bug: #5096
-const uint16 qfg2SignatureImportDialog[] = {
+static const uint16 qfg2SignatureImportDialog[] = {
0x63, SIG_MAGICDWORD, 0x20, // pToa text
- 0x30, SIG_UINT16 + 0x0b, 0x00, // bnt [next state]
+ 0x30, SIG_UINT16(0x000b), // bnt [next state]
0x7a, // push2
0x39, 0x03, // pushi 03
0x36, // push
@@ -1670,21 +2066,21 @@ const uint16 qfg2SignatureImportDialog[] = {
SIG_END
};
-const uint16 qfg2PatchImportDialog[] = {
- PATCH_ADDTOOFFSET +5,
+static const uint16 qfg2PatchImportDialog[] = {
+ PATCH_ADDTOOFFSET(+5),
0x48, // ret
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry qfg2Signatures[] = {
- { true, 944, "import dialog continuous calls", 1, 0, 0, qfg2SignatureImportDialog, qfg2PatchImportDialog },
+// script, description, signature patch
+static const SciScriptPatcherEntry qfg2Signatures[] = {
+ { true, 944, "import dialog continuous calls", 1, qfg2SignatureImportDialog, qfg2PatchImportDialog },
SCI_SIGNATUREENTRY_TERMINATOR
};
// ===========================================================================
// Patch for the import screen in QFG3, same as the one for QFG2 above
-const uint16 qfg3SignatureImportDialog[] = {
+static const uint16 qfg3SignatureImportDialog[] = {
0x63, SIG_MAGICDWORD, 0x2a, // pToa text
0x31, 0x0b, // bnt [next state]
0x7a, // push2
@@ -1696,8 +2092,8 @@ const uint16 qfg3SignatureImportDialog[] = {
SIG_END
};
-const uint16 qfg3PatchImportDialog[] = {
- PATCH_ADDTOOFFSET +4,
+static const uint16 qfg3PatchImportDialog[] = {
+ PATCH_ADDTOOFFSET(+4),
0x48, // ret
PATCH_END
};
@@ -1720,7 +2116,7 @@ const uint16 qfg3PatchImportDialog[] = {
// Applies to at least: English, German, Italian, French, Spanish Floppy
// Responsible method: unknown
// Fixes bug: #5172
-const uint16 qfg3SignatureWooDialog[] = {
+static const uint16 qfg3SignatureWooDialog[] = {
SIG_MAGICDWORD,
0x67, 0x12, // pTos 12 (query)
0x35, 0xb6, // ldi b6
@@ -1730,9 +2126,9 @@ const uint16 qfg3SignatureWooDialog[] = {
0x35, 0x9b, // ldi 9b
0x1a, // eq?
0x31, 0x0c, // bnt 0c
- 0x38, SIG_SELECTOR16 + SELECTOR_solvePuzzle, // pushi 0297
+ 0x38, SIG_SELECTOR16(solvePuzzle), // pushi 0297
0x7a, // push2
- 0x38, SIG_UINT16 + 0x0c, 0x01, // pushi 010c
+ 0x38, SIG_UINT16(0x010c), // pushi 010c
0x7a, // push2
0x81, 0x00, // lag 00
0x4a, 0x08, // send 08
@@ -1741,16 +2137,16 @@ const uint16 qfg3SignatureWooDialog[] = {
SIG_END
};
-const uint16 qfg3PatchWooDialog[] = {
- PATCH_ADDTOOFFSET +0x29,
+static const uint16 qfg3PatchWooDialog[] = {
+ PATCH_ADDTOOFFSET(+0x29),
0x33, 0x11, // jmp to 0x6a2, the call to hero::solvePuzzle for 0xFFFC
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry qfg3Signatures[] = {
- { true, 944, "import dialog continuous calls", 1, 0, 0, qfg3SignatureImportDialog, qfg3PatchImportDialog },
- { true, 440, "dialog crash when asking about Woo", 1, 0, 0, qfg3SignatureWooDialog, qfg3PatchWooDialog },
+// script, description, signature patch
+static const SciScriptPatcherEntry qfg3Signatures[] = {
+ { true, 944, "import dialog continuous calls", 1, qfg3SignatureImportDialog, qfg3PatchImportDialog },
+ { true, 440, "dialog crash when asking about Woo", 1, qfg3SignatureWooDialog, qfg3PatchWooDialog },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1762,29 +2158,61 @@ SciScriptPatcherEntry qfg3Signatures[] = {
// we could either calculate property count differently somehow fixing this
// but I think just patching it out is cleaner.
// Fixes bug: #5093
-const uint16 sq4FloppySignatureEndlessFlight[] = {
+static const uint16 sq4FloppySignatureEndlessFlight[] = {
0x39, 0x04, // pushi 04 (selector x)
SIG_MAGICDWORD,
0x78, // push1
0x67, 0x08, // pTos 08 (property x)
- 0x63, SIG_ADDTOOFFSET + 1, // pToa (invalid property) - 44h for English floppy, 4ch for German floppy
+ 0x63, SIG_ADDTOOFFSET(+1), // pToa (invalid property) - 44h for English floppy, 4ch for German floppy
0x02, // add
SIG_END
};
-const uint16 sq4FloppyPatchEndlessFlight[] = {
- PATCH_ADDTOOFFSET +5,
+static const uint16 sq4FloppyPatchEndlessFlight[] = {
+ PATCH_ADDTOOFFSET(+5),
0x35, 0x03, // ldi 03 (which would be the content of the property)
PATCH_END
};
+// Floppy-only: When the player tries to throw something at the sequel police in Space Quest X (zero g zone),
+// the game will first show a textbox and then cause a signature mismatch in ScummVM/
+// crash the whole game in Sierra SCI/display garbage (the latter when the Sierra "patch" got applied).
+//
+// All of this is caused by a typo in the script. Right after the code for showing the textbox,
+// there is more similar code for showing another textbox, but without a pointer to the text.
+// This has to be a typo, because there is no unused text to be found within that script.
+//
+// Sierra's "patch" didn't include a proper fix (as in a modified script). Instead they shipped a dummy
+// text resource, which somewhat "solved" the issue in Sierra SCI, but it still showed another textbox
+// with garbage in it. Funnily Sierra must have known that, because that new text resource contains:
+// "Hi! This is a kludge!"
+//
+// We properly fix it by removing the faulty code.
+// Applies to at least: English Floppy
+// Responsible method: sp1::doVerb
+// Fixes bug: found by SCI developer
+static const uint16 sq4FloppySignatureThrowStuffAtSequelPoliceBug[] = {
+ 0x47, 0xff, 0x00, 0x02, // call export 255_0, 2
+ 0x3a, // toss
+ SIG_MAGICDWORD,
+ 0x36, // push
+ 0x47, 0xff, 0x00, 0x02, // call export 255_0, 2
+ SIG_END
+};
+
+static const uint16 sq4FloppyPatchThrowStuffAtSequelPoliceBug[] = {
+ PATCH_ADDTOOFFSET(+5),
+ 0x48, // ret
+ PATCH_END
+};
+
// The scripts in SQ4CD support simultaneous playing of speech and subtitles,
// but this was not available as an option. The following two patches enable
// this functionality in the game's GUI options dialog.
// Patch 1: iconTextSwitch::show, called when the text options button is shown.
// This is patched to add the "Both" text resource (i.e. we end up with
// "Speech", "Text" and "Both")
-const uint16 sq4CdSignatureTextOptionsButton[] = {
+static const uint16 sq4CdSignatureTextOptionsButton[] = {
SIG_MAGICDWORD,
0x35, 0x01, // ldi 0x01
0xa1, 0x53, // sag 0x53
@@ -1795,8 +2223,8 @@ const uint16 sq4CdSignatureTextOptionsButton[] = {
SIG_END
};
-const uint16 sq4CdPatchTextOptionsButton[] = {
- PATCH_ADDTOOFFSET +7,
+static const uint16 sq4CdPatchTextOptionsButton[] = {
+ PATCH_ADDTOOFFSET(+7),
0x39, 0x0b, // pushi 0x0b
PATCH_END
};
@@ -1804,7 +2232,7 @@ const uint16 sq4CdPatchTextOptionsButton[] = {
// Patch 2: Adjust a check in babbleIcon::init, which handles the babble icon
// (e.g. the two guys from Andromeda) shown when dying/quitting.
// Fixes bug: #6068
-const uint16 sq4CdSignatureBabbleIcon[] = {
+static const uint16 sq4CdSignatureBabbleIcon[] = {
SIG_MAGICDWORD,
0x89, 0x5a, // lsg 5a
0x35, 0x02, // ldi 02
@@ -1813,7 +2241,7 @@ const uint16 sq4CdSignatureBabbleIcon[] = {
SIG_END
};
-const uint16 sq4CdPatchBabbleIcon[] = {
+static const uint16 sq4CdPatchBabbleIcon[] = {
0x89, 0x5a, // lsg 5a
0x35, 0x01, // ldi 01
0x1a, // eq?
@@ -1825,7 +2253,7 @@ const uint16 sq4CdPatchBabbleIcon[] = {
// when the text options button is clicked: "Speech", "Text" and "Both".
// Refer to the patch above for additional details.
// iconTextSwitch::doit (called when the text options button is clicked)
-const uint16 sq4CdSignatureTextOptions[] = {
+static const uint16 sq4CdSignatureTextOptions[] = {
SIG_MAGICDWORD,
0x89, 0x5a, // lsg 0x5a (load global 90 to stack)
0x3c, // dup
@@ -1842,14 +2270,14 @@ const uint16 sq4CdSignatureTextOptions[] = {
0x35, 0x01, // ldi 0x01
0xa1, 0x5a, // sag 0x5a (save acc to global 90)
0x3a, // toss
- 0x38, SIG_SELECTOR16 + SELECTOR_show, // pushi 0x00d9
+ 0x38, SIG_SELECTOR16(show), // pushi 0x00d9
0x76, // push0
0x54, 0x04, // self 0x04
0x48, // ret
SIG_END
};
-const uint16 sq4CdPatchTextOptions[] = {
+static const uint16 sq4CdPatchTextOptions[] = {
0x89, 0x5a, // lsg 0x5a (load global 90 to stack)
0x3c, // dup
0x35, 0x03, // ldi 0x03 (acc = 3)
@@ -1862,18 +2290,19 @@ const uint16 sq4CdPatchTextOptions[] = {
0x35, 0x01, // ldi 0x01 (reset acc to 1)
0xa1, 0x5a, // sag 0x5a (save acc to global 90)
0x33, 0x03, // jmp 0x03 (jump over the wasted bytes below)
- 0x34, PATCH_UINT16 + 0x00, 0x00, // ldi 0x0000 (waste 3 bytes)
+ 0x34, PATCH_UINT16(0x0000), // ldi 0x0000 (waste 3 bytes)
0x3a, // toss
// (the rest of the code is the same)
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry sq4Signatures[] = {
- { true, 298, "Floppy: endless flight", 1, 0, 0, sq4FloppySignatureEndlessFlight, sq4FloppyPatchEndlessFlight },
- { true, 818, "CD: Speech and subtitles option", 1, 0, 0, sq4CdSignatureTextOptions, sq4CdPatchTextOptions },
- { true, 0, "CD: Babble icon speech and subtitles fix", 1, 0, 0, sq4CdSignatureBabbleIcon, sq4CdPatchBabbleIcon },
- { true, 818, "CD: Speech and subtitles option button", 1, 0, 0, sq4CdSignatureTextOptionsButton, sq4CdPatchTextOptionsButton },
+// script, description, signature patch
+static const SciScriptPatcherEntry sq4Signatures[] = {
+ { true, 298, "Floppy: endless flight", 1, sq4FloppySignatureEndlessFlight, sq4FloppyPatchEndlessFlight },
+ { true, 700, "Floppy: throw stuff at sequel police bug", 1, sq4FloppySignatureThrowStuffAtSequelPoliceBug, sq4FloppyPatchThrowStuffAtSequelPoliceBug },
+ { true, 818, "CD: Speech and subtitles option", 1, sq4CdSignatureTextOptions, sq4CdPatchTextOptions },
+ { true, 0, "CD: Babble icon speech and subtitles fix", 1, sq4CdSignatureBabbleIcon, sq4CdPatchBabbleIcon },
+ { true, 818, "CD: Speech and subtitles option button", 1, sq4CdSignatureTextOptionsButton, sq4CdPatchTextOptionsButton },
SCI_SIGNATUREENTRY_TERMINATOR
};
@@ -1888,26 +2317,26 @@ SciScriptPatcherEntry sq4Signatures[] = {
// The same issue happens in Sierra SCI.
// We simply set the correct starting cel number to fix the bug.
// Responsible method: robotIntoShip::changeState(9)
-const uint16 sq1vgaSignatureUlenceFlatsTimepodGfxGlitch[] = {
- 0x39,
- SIG_MAGICDWORD, SIG_SELECTOR8 + SELECTOR_cel, // pushi "cel"
+static const uint16 sq1vgaSignatureUlenceFlatsTimepodGfxGlitch[] = {
+ 0x39,
+ SIG_MAGICDWORD, SIG_SELECTOR8(cel), // pushi "cel"
0x78, // push1
0x39, 0x0a, // pushi 0x0a (set ship::cel to 10)
- 0x38, SIG_UINT16 + 0xa0, 0x00, // pushi 0x00a0 (ship::setLoop)
+ 0x38, SIG_UINT16(0x00a0), // pushi 0x00a0 (ship::setLoop)
SIG_END
};
-const uint16 sq1vgaPatchUlenceFlatsTimepodGfxGlitch[] = {
- PATCH_ADDTOOFFSET +3,
+static const uint16 sq1vgaPatchUlenceFlatsTimepodGfxGlitch[] = {
+ PATCH_ADDTOOFFSET(+3),
0x39, 0x09, // pushi 0x09 (set ship::cel to 9)
PATCH_END
};
-const uint16 sq1vgaSignatureEgoShowsCard[] = {
+static const uint16 sq1vgaSignatureEgoShowsCard[] = {
SIG_MAGICDWORD,
- 0x38, SIG_SELECTOR16 + SELECTOR_timesShownID, // push "timesShownID"
+ 0x38, SIG_SELECTOR16(timesShownID), // push "timesShownID"
0x78, // push1
- 0x38, SIG_SELECTOR16 + SELECTOR_timesShownID, // push "timesShownID"
+ 0x38, SIG_SELECTOR16(timesShownID), // push "timesShownID"
0x76, // push0
0x51, 0x7c, // class DeltaurRegion
0x4a, 0x04, // send 0x04 (get timesShownID)
@@ -1925,8 +2354,8 @@ const uint16 sq1vgaSignatureEgoShowsCard[] = {
// Note that this script patch is merely a reordering of the
// instructions in the original script.
-const uint16 sq1vgaPatchEgoShowsCard[] = {
- 0x38, PATCH_SELECTOR16 + SELECTOR_timesShownID, // push "timesShownID"
+static const uint16 sq1vgaPatchEgoShowsCard[] = {
+ 0x38, PATCH_SELECTOR16(timesShownID), // push "timesShownID"
0x76, // push0
0x51, 0x7c, // class DeltaurRegion
0x4a, 0x04, // send 0x04 (get timesShownID)
@@ -1934,7 +2363,7 @@ const uint16 sq1vgaPatchEgoShowsCard[] = {
0x35, 0x01, // ldi 1
0x02, // add
0x36, // push (this push corresponds to the wrong one above)
- 0x38, PATCH_SELECTOR16 + SELECTOR_timesShownID, // push "timesShownID"
+ 0x38, PATCH_SELECTOR16(timesShownID), // push "timesShownID"
0x78, // push1
0x36, // push
0x51, 0x7c, // class DeltaurRegion
@@ -1945,11 +2374,12 @@ const uint16 sq1vgaPatchEgoShowsCard[] = {
};
-// script, description, signature patch
-SciScriptPatcherEntry sq1vgaSignatures[] = {
- { true, 45, "Ulence Flats: timepod graphic glitch", 1, 0, 0, sq1vgaSignatureUlenceFlatsTimepodGfxGlitch, sq1vgaPatchUlenceFlatsTimepodGfxGlitch },
- { true, 58, "Sarien armory droid zapping ego first time", 1, 0, 0, sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard },
- SCI_SIGNATUREENTRY_TERMINATOR};
+// script, description, signature patch
+static const SciScriptPatcherEntry sq1vgaSignatures[] = {
+ { true, 45, "Ulence Flats: timepod graphic glitch", 1, sq1vgaSignatureUlenceFlatsTimepodGfxGlitch, sq1vgaPatchUlenceFlatsTimepodGfxGlitch },
+ { true, 58, "Sarien armory droid zapping ego first time", 1, sq1vgaSignatureEgoShowsCard, sq1vgaPatchEgoShowsCard },
+ SCI_SIGNATUREENTRY_TERMINATOR
+};
// ===========================================================================
// The toolbox in sq5 is buggy. When you click on the upper part of the "put
@@ -1973,10 +2403,10 @@ SciScriptPatcherEntry sq1vgaSignatures[] = {
// Applies to at least: English/German/French PC floppy
// Responsible method: takeTool::changeState
// Fixes bug: #6457
-const uint16 sq5SignatureToolboxFix[] = {
+static const uint16 sq5SignatureToolboxFix[] = {
0x31, 0x13, // bnt [check for state 1]
SIG_MAGICDWORD,
- 0x38, SIG_UINT16 + 0xaa, 0x00, // pushi 00aa
+ 0x38, SIG_UINT16(0x00aa), // pushi 00aa
0x39, 0x05, // pushi 05
0x39, 0x16, // pushi 16
0x76, // push0
@@ -1985,7 +2415,7 @@ const uint16 sq5SignatureToolboxFix[] = {
0x7c, // pushSelf
0x81, 0x5b, // lag 5b
0x4a, 0x0e, // send 0e
- 0x32, SIG_UINT16 + 0x88, 0x00, // jmp [end-of-method]
+ 0x32, SIG_UINT16(0x0088), // jmp [end-of-method]
0x3c, // dup
0x35, 0x01, // ldi 01
0x1a, // eq?
@@ -1993,9 +2423,9 @@ const uint16 sq5SignatureToolboxFix[] = {
SIG_END
};
-const uint16 sq5PatchToolboxFix[] = {
+static const uint16 sq5PatchToolboxFix[] = {
0x31, 0x41, // bnt [check for state 2]
- PATCH_ADDTOOFFSET +16, // skip to jmp offset
+ PATCH_ADDTOOFFSET(+16), // skip to jmp offset
0x35, 0x01, // ldi 01
0x65, 0x14, // aTop [state]
0x36, 0x00, 0x00, // ldi 0000 (waste 3 bytes)
@@ -2003,15 +2433,33 @@ const uint16 sq5PatchToolboxFix[] = {
PATCH_END
};
-// script, description, signature patch
-SciScriptPatcherEntry sq5Signatures[] = {
- { true, 226, "toolbox fix", 1, 0, 0, sq5SignatureToolboxFix, sq5PatchToolboxFix },
+// script, description, signature patch
+static const SciScriptPatcherEntry sq5Signatures[] = {
+ { true, 226, "toolbox fix", 1, sq5SignatureToolboxFix, sq5PatchToolboxFix },
SCI_SIGNATUREENTRY_TERMINATOR
};
+// =================================================================================
+
+ScriptPatcher::ScriptPatcher() {
+ int selectorCount = ARRAYSIZE(selectorNameTable);
+ int selectorNr;
+
+ // Allocate table for selector-IDs and initialize that table as well
+ _selectorIdTable = new Selector[ selectorCount ];
+ for (selectorNr = 0; selectorNr < selectorCount; selectorNr++)
+ _selectorIdTable[selectorNr] = -1;
+
+ _runtimeTable = NULL;
+}
+
+ScriptPatcher::~ScriptPatcher() {
+ delete[] _runtimeTable;
+ delete[] _selectorIdTable;
+}
// will actually patch previously found signature area
-void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, const bool isMacSci11) {
+void ScriptPatcher::applyPatch(const SciScriptPatcherEntry *patchEntry, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, const bool isMacSci11) {
const uint16 *patchData = patchEntry->patchData;
byte orgData[PATCH_VALUELIMIT];
int32 offset = signatureOffset;
@@ -2028,12 +2476,12 @@ void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *sc
uint16 patchCommand = patchWord & PATCH_COMMANDMASK;
uint16 patchValue = patchWord & PATCH_VALUEMASK;
switch (patchCommand) {
- case PATCH_ADDTOOFFSET: {
+ case PATCH_CODE_ADDTOOFFSET: {
// add value to offset
offset += patchValue;
break;
}
- case PATCH_GETORIGINALBYTE: {
+ case PATCH_CODE_GETORIGINALBYTE: {
// get original byte from script
if (patchValue >= orgDataSize)
error("Script-Patcher: can not get requested original byte from script");
@@ -2041,7 +2489,7 @@ void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *sc
offset++;
break;
}
- case PATCH_GETORIGINALBYTEADJUST: {
+ case PATCH_CODE_GETORIGINALBYTEADJUST: {
// get original byte from script and adjust it
if (patchValue >= orgDataSize)
error("Script-Patcher: can not get requested original byte from script");
@@ -2052,13 +2500,13 @@ void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *sc
offset++;
break;
}
- case PATCH_UINT16:
- case PATCH_SELECTOR16: {
+ case PATCH_CODE_UINT16:
+ case PATCH_CODE_SELECTOR16: {
byte byte1;
byte byte2;
-
+
switch (patchCommand) {
- case PATCH_UINT16: {
+ case PATCH_CODE_UINT16: {
byte1 = patchValue & PATCH_BYTEMASK;
patchData++; patchWord = *patchData;
if (patchWord & PATCH_COMMANDMASK)
@@ -2066,8 +2514,8 @@ void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *sc
byte2 = patchWord & PATCH_BYTEMASK;
break;
}
- case PATCH_SELECTOR16: {
- patchSelector = selectorTable[patchValue].id;
+ case PATCH_CODE_SELECTOR16: {
+ patchSelector = _selectorIdTable[patchValue];
byte1 = patchSelector & 0xFF;
byte2 = patchSelector >> 8;
break;
@@ -2085,15 +2533,15 @@ void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *sc
}
break;
}
- case PATCH_SELECTOR8: {
- patchSelector = selectorTable[patchValue].id;
+ case PATCH_CODE_SELECTOR8: {
+ patchSelector = _selectorIdTable[patchValue];
if (patchSelector & 0xFF00)
error("Script-Patcher: 8 bit selector required, game uses 16 bit selector");
scriptData[offset] = patchSelector & 0xFF;
offset++;
break;
}
- case PATCH_BYTE:
+ case PATCH_CODE_BYTE:
scriptData[offset] = patchValue & PATCH_BYTEMASK;
offset++;
}
@@ -2103,18 +2551,18 @@ void Script::patcherApplyPatch(const SciScriptPatcherEntry *patchEntry, byte *sc
}
// will return -1 if no match was found, otherwise an offset to the start of the signature match
-int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, const byte *scriptData, const uint32 scriptSize, const bool isMacSci11) {
+int32 ScriptPatcher::findSignature(const SciScriptPatcherEntry *patchEntry, SciScriptPatcherRuntimeEntry *runtimeEntry, const byte *scriptData, const uint32 scriptSize, const bool isMacSci11) {
if (scriptSize < 4) // we need to find a DWORD, so less than 4 bytes is not okay
return -1;
- const uint32 magicDWord = patchEntry->magicDWord; // is platform-specific BE/LE form, so that the later match will work
+ const uint32 magicDWord = runtimeEntry->magicDWord; // is platform-specific BE/LE form, so that the later match will work
const uint32 searchLimit = scriptSize - 3;
uint32 DWordOffset = 0;
// first search for the magic DWORD
while (DWordOffset < searchLimit) {
if (magicDWord == READ_UINT32(scriptData + DWordOffset)) {
// magic DWORD found, check if actual signature matches
- uint32 offset = DWordOffset + patchEntry->magicOffset;
+ uint32 offset = DWordOffset + runtimeEntry->magicOffset;
uint32 byteOffset = offset;
const uint16 *signatureData = patchEntry->signatureData;
uint16 sigSelector = 0;
@@ -2124,19 +2572,19 @@ int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, cons
uint16 sigCommand = sigWord & SIG_COMMANDMASK;
uint16 sigValue = sigWord & SIG_VALUEMASK;
switch (sigCommand) {
- case SIG_ADDTOOFFSET: {
+ case SIG_CODE_ADDTOOFFSET: {
// add value to offset
byteOffset += sigValue;
break;
}
- case SIG_UINT16:
- case SIG_SELECTOR16: {
+ case SIG_CODE_UINT16:
+ case SIG_CODE_SELECTOR16: {
if ((byteOffset + 1) < scriptSize) {
byte byte1;
byte byte2;
switch (sigCommand) {
- case SIG_UINT16: {
+ case SIG_CODE_UINT16: {
byte1 = sigValue & SIG_BYTEMASK;
signatureData++; sigWord = *signatureData;
if (sigWord & SIG_COMMANDMASK)
@@ -2144,8 +2592,8 @@ int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, cons
byte2 = sigWord & SIG_BYTEMASK;
break;
}
- case SIG_SELECTOR16: {
- sigSelector = selectorTable[sigValue].id;
+ case SIG_CODE_SELECTOR16: {
+ sigSelector = _selectorIdTable[sigValue];
byte1 = sigSelector & 0xFF;
byte2 = sigSelector >> 8;
break;
@@ -2167,9 +2615,9 @@ int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, cons
}
break;
}
- case SIG_SELECTOR8: {
+ case SIG_CODE_SELECTOR8: {
if (byteOffset < scriptSize) {
- sigSelector = selectorTable[sigValue].id;
+ sigSelector = _selectorIdTable[sigValue];
if (sigSelector & 0xFF00)
error("Script-Patcher: 8 bit selector required, game uses 16 bit selector\nFaulty patch: '%s'", patchEntry->description);
if (scriptData[byteOffset] != (sigSelector & 0xFF))
@@ -2180,7 +2628,7 @@ int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, cons
}
break;
}
- case SIG_BYTE:
+ case SIG_CODE_BYTE:
if (byteOffset < scriptSize) {
if (scriptData[byteOffset] != sigWord)
sigWord = SIG_MISMATCH;
@@ -2189,14 +2637,14 @@ int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, cons
sigWord = SIG_MISMATCH; // out of bounds
}
}
-
+
if (sigWord == SIG_MISMATCH)
break;
-
+
signatureData++;
sigWord = *signatureData;
}
-
+
if (sigWord == SIG_END) // signature fully matched?
return offset;
}
@@ -2208,30 +2656,45 @@ int32 Script::patcherFindSignature(const SciScriptPatcherEntry *patchEntry, cons
// This method calculates the magic DWORD for each entry in the signature table
// and it also initializes the selector table for selectors used in the signatures/patches of the current game
-void Script::patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacSci11) {
- SciScriptPatcherEntry *curEntry = patchTable;
- SciScriptPatcherSelector *curSelector = NULL;
+void ScriptPatcher::initSignature(const SciScriptPatcherEntry *patchTable, bool isMacSci11) {
+ const SciScriptPatcherEntry *curEntry = patchTable;
+ SciScriptPatcherRuntimeEntry *curRuntimeEntry;
+ Selector curSelector = -1;
int step;
int magicOffset;
byte magicDWord[4];
int magicDWordLeft = 0;
- const uint16 *curData;
- uint16 curWord;
- uint16 curCommand;
- uint32 curValue;
- byte byte1;
- byte byte2;
-
- while (curEntry->signatureData) {
+ const uint16 *curData;
+ uint16 curWord;
+ uint16 curCommand;
+ uint32 curValue;
+ byte byte1;
+ byte byte2;
+ int patchEntryCount = 0;
+
+ // Count entries and allocate runtime data
+ while (curEntry->signatureData) {
+ patchEntryCount++; curEntry++;
+ }
+ _runtimeTable = new SciScriptPatcherRuntimeEntry[patchEntryCount];
+ memset(_runtimeTable, 0, sizeof(SciScriptPatcherRuntimeEntry) * patchEntryCount);
+
+ curEntry = patchTable;
+ curRuntimeEntry = _runtimeTable;
+ while (curEntry->signatureData) {
// process signature
memset(magicDWord, 0, sizeof(magicDWord));
+ curRuntimeEntry->active = curEntry->defaultActive;
+ curRuntimeEntry->magicDWord = 0;
+ curRuntimeEntry->magicOffset = 0;
+
for (step = 0; step < 2; step++) {
switch (step) {
case 0: curData = curEntry->signatureData; break;
case 1: curData = curEntry->patchData; break;
}
-
+
curWord = *curData;
magicOffset = 0;
while (curWord != SIG_END) {
@@ -2240,24 +2703,24 @@ void Script::patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacS
switch (curCommand) {
case SIG_MAGICDWORD: {
if (step == 0) {
- if ((curEntry->magicDWord) || (magicDWordLeft))
+ if ((curRuntimeEntry->magicDWord) || (magicDWordLeft))
error("Script-Patcher: Magic-DWORD specified multiple times in signature\nFaulty patch: '%s'", curEntry->description);
magicDWordLeft = 4;
- curEntry->magicOffset = magicOffset;
+ curRuntimeEntry->magicOffset = magicOffset;
}
break;
}
- case SIG_ADDTOOFFSET: {
+ case SIG_CODE_ADDTOOFFSET: {
magicOffset -= curValue;
if (magicDWordLeft)
error("Script-Patcher: Magic-DWORD contains AddToOffset command\nFaulty patch: '%s'", curEntry->description);
break;
}
- case SIG_UINT16:
- case SIG_SELECTOR16: {
+ case SIG_CODE_UINT16:
+ case SIG_CODE_SELECTOR16: {
// UINT16 or 1
switch (curCommand) {
- case SIG_UINT16: {
+ case SIG_CODE_UINT16: {
curData++; curWord = *curData;
if (curWord & SIG_COMMANDMASK)
error("Script-Patcher: signature entry inconsistent\nFaulty patch: '%s'", curEntry->description);
@@ -2270,16 +2733,18 @@ void Script::patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacS
}
break;
}
- case SIG_SELECTOR16: {
- curSelector = &selectorTable[curValue];
- if (curSelector->id == -1)
- curSelector->id = g_sci->getKernel()->findSelector(curSelector->name);
+ case SIG_CODE_SELECTOR16: {
+ curSelector = _selectorIdTable[curValue];
+ if (curSelector == -1) {
+ curSelector = g_sci->getKernel()->findSelector(selectorNameTable[curValue]);
+ _selectorIdTable[curValue] = curSelector;
+ }
if (!isMacSci11) {
- byte1 = curSelector->id & 0x00FF;
- byte2 = curSelector->id >> 8;
+ byte1 = curSelector & 0x00FF;
+ byte2 = curSelector >> 8;
} else {
- byte1 = curSelector->id >> 8;
- byte2 = curSelector->id & 0x00FF;
+ byte1 = curSelector >> 8;
+ byte2 = curSelector & 0x00FF;
}
break;
}
@@ -2294,23 +2759,24 @@ void Script::patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacS
magicDWordLeft--;
}
if (!magicDWordLeft) {
- curEntry->magicDWord = READ_LE_UINT32(magicDWord);
+ curRuntimeEntry->magicDWord = READ_LE_UINT32(magicDWord);
}
}
break;
}
- case SIG_BYTE:
- case SIG_SELECTOR8: {
- if (curCommand == SIG_SELECTOR8) {
- curSelector = &selectorTable[curValue];
- if (curSelector->id == -1) {
- curSelector->id = g_sci->getKernel()->findSelector(curSelector->name);
- if (curSelector->id != -1) {
- if (curSelector->id & 0xFF00)
+ case SIG_CODE_BYTE:
+ case SIG_CODE_SELECTOR8: {
+ if (curCommand == SIG_CODE_SELECTOR8) {
+ curSelector = _selectorIdTable[curValue];
+ if (curSelector == -1) {
+ curSelector = g_sci->getKernel()->findSelector(selectorNameTable[curValue]);
+ _selectorIdTable[curValue] = curSelector;
+ if (curSelector != -1) {
+ if (curSelector & 0xFF00)
error("Script-Patcher: 8 bit selector required, game uses 16 bit selector\nFaulty patch: '%s'", curEntry->description);
}
}
- curValue = curSelector->id;
+ curValue = curSelector;
}
magicOffset--;
if (magicDWordLeft) {
@@ -2318,7 +2784,7 @@ void Script::patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacS
magicDWord[4 - magicDWordLeft] = (byte)curValue;
magicDWordLeft--;
if (!magicDWordLeft) {
- curEntry->magicDWord = READ_LE_UINT32(magicDWord);
+ curRuntimeEntry->magicDWord = READ_LE_UINT32(magicDWord);
}
}
}
@@ -2329,35 +2795,38 @@ void Script::patcherInitSignature(SciScriptPatcherEntry *patchTable, bool isMacS
}
if (magicDWordLeft)
error("Script-Patcher: Magic-DWORD beyond End-Of-Signature\nFaulty patch: '%s'", curEntry->description);
- if (!curEntry->magicDWord)
+ if (!curRuntimeEntry->magicDWord)
error("Script-Patcher: Magic-DWORD not specified in signature\nFaulty patch: '%s'", curEntry->description);
-
- curEntry++;
- }
+
+ curEntry++; curRuntimeEntry++;
+ }
}
// This method enables certain patches
// It's used for patches, which are not meant to get applied all the time
-void Script::patcherEnablePatch(SciScriptPatcherEntry *patchTable, const char *searchDescription) {
- SciScriptPatcherEntry *curEntry = patchTable;
- int searchDescriptionLen = strlen( searchDescription );
+void ScriptPatcher::enablePatch(const SciScriptPatcherEntry *patchTable, const char *searchDescription) {
+ const SciScriptPatcherEntry *curEntry = patchTable;
+ SciScriptPatcherRuntimeEntry *runtimeEntry = _runtimeTable;
+ int searchDescriptionLen = strlen(searchDescription);
int matchCount = 0;
-
- while (curEntry->signatureData) {
+
+ while (curEntry->signatureData) {
if (strncmp(curEntry->description, searchDescription, searchDescriptionLen) == 0) {
// match found, enable patch
- curEntry->active = true;
+ runtimeEntry->active = true;
matchCount++;
}
- curEntry++;
- }
-
- if (!matchCount)
+ curEntry++; runtimeEntry++;
+ }
+
+ if (!matchCount)
error("Script-Patcher: no patch found to enable");
}
-void Script::patcherProcessScript(uint16 scriptNr, byte *scriptData, const uint32 scriptSize) {
- SciScriptPatcherEntry *signatureTable = NULL;
+void ScriptPatcher::processScript(uint16 scriptNr, byte *scriptData, const uint32 scriptSize) {
+ const SciScriptPatcherEntry *signatureTable = NULL;
+ const SciScriptPatcherEntry *curEntry = NULL;
+ SciScriptPatcherRuntimeEntry *curRuntimeEntry = NULL;
const Sci::SciGameId gameId = g_sci->getGameId();
switch (gameId) {
@@ -2431,48 +2900,57 @@ void Script::patcherProcessScript(uint16 scriptNr, byte *scriptData, const uint3
if (signatureTable) {
bool isMacSci11 = (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1);
- if (!signatureTable->magicDWord) {
+ if (!_runtimeTable) {
// Abort, in case selectors are not yet initialized (happens for games w/o selector-dictionary)
if (!g_sci->getKernel()->selectorNamesAvailable())
return;
-
+
// signature table needs to get initialized (Magic DWORD set, selector table set)
- patcherInitSignature(signatureTable, isMacSci11);
-
+ initSignature(signatureTable, isMacSci11);
+
// Do additional game-specific initialization
switch (gameId) {
case GID_KQ5:
if (g_sci->_features->useAltWinGMSound()) {
// See the explanation in the kq5SignatureWinGMSignals comment
- patcherEnablePatch(signatureTable, "Win: GM Music signal checks");
+ enablePatch(signatureTable, "Win: GM Music signal checks");
+ }
+ break;
+ case GID_KQ6:
+ if (g_sci->isCD()) {
+ // Enables Dual mode patches (audio + subtitles at the same time) for King's Quest 6
+ enablePatch(signatureTable, "CD: audio + text support");
}
break;
case GID_LAURABOW2:
- if (g_sci->speechAndSubtitlesEnabled()) {
- // Enables Audio + subtitles patches for Laura Bow 2, when "Text and Speech: Both" is selected
- patcherEnablePatch(signatureTable, "CD: audio + text support");
+ if (g_sci->isCD()) {
+ // Enables Dual mode patches (audio + subtitles at the same time) for Laura Bow 2
+ enablePatch(signatureTable, "CD: audio + text support");
}
break;
default:
break;
}
}
-
- while (signatureTable->signatureData) {
- if ( (scriptNr == signatureTable->scriptNr) && (signatureTable->active) ) {
+
+ curEntry = signatureTable;
+ curRuntimeEntry = _runtimeTable;
+
+ while (curEntry->signatureData) {
+ if ((scriptNr == curEntry->scriptNr) && (curRuntimeEntry->active)) {
int32 foundOffset = 0;
- int16 applyCount = signatureTable->applyCount;
+ int16 applyCount = curEntry->applyCount;
do {
- foundOffset = patcherFindSignature(signatureTable, scriptData, scriptSize, isMacSci11);
+ foundOffset = findSignature(curEntry, curRuntimeEntry, scriptData, scriptSize, isMacSci11);
if (foundOffset != -1) {
// found, so apply the patch
- debugC(kDebugLevelScriptPatcher, "Script-Patcher: '%s' on script %d offset %d", signatureTable->description, scriptNr, foundOffset);
- patcherApplyPatch(signatureTable, scriptData, scriptSize, foundOffset, isMacSci11);
+ debugC(kDebugLevelScriptPatcher, "Script-Patcher: '%s' on script %d offset %d", curEntry->description, scriptNr, foundOffset);
+ applyPatch(curEntry, scriptData, scriptSize, foundOffset, isMacSci11);
}
applyCount--;
} while ((foundOffset != -1) && (applyCount));
}
- signatureTable++;
+ curEntry++; curRuntimeEntry++;
}
}
}
diff --git a/engines/sci/engine/script_patches.h b/engines/sci/engine/script_patches.h
new file mode 100644
index 0000000000..9e572f33fa
--- /dev/null
+++ b/engines/sci/engine/script_patches.h
@@ -0,0 +1,108 @@
+/* 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 SCI_ENGINE_SCRIPT_PATCHES_H
+#define SCI_ENGINE_SCRIPT_PATCHES_H
+
+#include "sci/sci.h"
+
+namespace Sci {
+
+// Please do not use the #defines, that are called SIG_CODE_* / PATCH_CODE_* inside signature/patch-tables
+#define SIG_END 0xFFFF
+#define SIG_MISMATCH 0xFFFE
+#define SIG_COMMANDMASK 0xF000
+#define SIG_VALUEMASK 0x0FFF
+#define SIG_BYTEMASK 0x00FF
+#define SIG_MAGICDWORD 0xF000
+#define SIG_CODE_ADDTOOFFSET 0xE000
+#define SIG_ADDTOOFFSET(_offset_) SIG_CODE_ADDTOOFFSET | _offset_
+#define SIG_CODE_SELECTOR16 0x9000
+#define SIG_SELECTOR16(_selectorID_) SIG_CODE_SELECTOR16 | SELECTOR_##_selectorID_
+#define SIG_CODE_SELECTOR8 0x8000
+#define SIG_SELECTOR8(_selectorID_) SIG_CODE_SELECTOR8 | SELECTOR_##_selectorID_
+#define SIG_CODE_UINT16 0x1000
+#define SIG_UINT16(_value_) SIG_CODE_UINT16 | (_value_ & 0xFF), (_value_ >> 8)
+#define SIG_CODE_BYTE 0x0000
+
+#define PATCH_END SIG_END
+#define PATCH_COMMANDMASK SIG_COMMANDMASK
+#define PATCH_VALUEMASK SIG_VALUEMASK
+#define PATCH_BYTEMASK SIG_BYTEMASK
+#define PATCH_CODE_ADDTOOFFSET SIG_CODE_ADDTOOFFSET
+#define PATCH_ADDTOOFFSET(_offset_) SIG_CODE_ADDTOOFFSET | _offset_
+#define PATCH_CODE_GETORIGINALBYTE 0xD000
+#define PATCH_GETORIGINALBYTE(_offset_) PATCH_CODE_GETORIGINALBYTE | _offset_
+#define PATCH_CODE_GETORIGINALBYTEADJUST 0xC000
+#define PATCH_GETORIGINALBYTEADJUST(_offset_, _adjustValue_) PATCH_CODE_GETORIGINALBYTEADJUST | _offset_, (uint16)(_adjustValue_)
+#define PATCH_CODE_SELECTOR16 SIG_CODE_SELECTOR16
+#define PATCH_SELECTOR16(_selectorID_) SIG_CODE_SELECTOR16 | SELECTOR_##_selectorID_
+#define PATCH_CODE_SELECTOR8 SIG_CODE_SELECTOR8
+#define PATCH_SELECTOR8(_selectorID_) SIG_CODE_SELECTOR8 | SELECTOR_##_selectorID_
+#define PATCH_CODE_UINT16 SIG_CODE_UINT16
+#define PATCH_UINT16(_value_) SIG_CODE_UINT16 | (_value_ & 0xFF), (_value_ >> 8)
+#define PATCH_CODE_BYTE SIG_CODE_BYTE
+
+// defines maximum scratch area for getting original bytes from unpatched script data
+#define PATCH_VALUELIMIT 4096
+
+struct SciScriptPatcherEntry {
+ bool defaultActive;
+ uint16 scriptNr;
+ const char *description;
+ int16 applyCount;
+ const uint16 *signatureData;
+ const uint16 *patchData;
+};
+
+//#define SCI_SIGNATUREENTRY_TERMINATOR { false, 0, NULL, 0, 0, 0, NULL, NULL }
+#define SCI_SIGNATUREENTRY_TERMINATOR { false, 0, NULL, 0, NULL, NULL }
+
+struct SciScriptPatcherRuntimeEntry {
+ bool active;
+ uint32 magicDWord;
+ int magicOffset;
+};
+
+/**
+ * ScriptPatcher class, handles on-the-fly patching of script data
+ */
+class ScriptPatcher {
+public:
+ ScriptPatcher();
+ ~ScriptPatcher();
+
+ void processScript(uint16 scriptNr, byte *scriptData, const uint32 scriptSize);
+
+private:
+ void initSignature(const SciScriptPatcherEntry *patchTable, bool isMacSci11);
+ void enablePatch(const SciScriptPatcherEntry *patchTable, const char *searchDescription);
+ int32 findSignature(const SciScriptPatcherEntry *patchEntry, SciScriptPatcherRuntimeEntry *runtimeEntry, const byte *scriptData, const uint32 scriptSize, bool isMacSci11);
+ void applyPatch(const SciScriptPatcherEntry *patchEntry, byte *scriptData, const uint32 scriptSize, int32 signatureOffset, bool isMacSci11);
+
+ Selector *_selectorIdTable;
+ SciScriptPatcherRuntimeEntry *_runtimeTable;
+};
+
+} // End of namespace Sci
+
+#endif // SCI_ENGINE_WORKAROUNDS_H
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index a059bee74e..161a4f5c79 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -28,7 +28,8 @@
namespace Sci {
-SegManager::SegManager(ResourceManager *resMan) {
+SegManager::SegManager(ResourceManager *resMan, ScriptPatcher *scriptPatcher)
+ : _resMan(resMan), _scriptPatcher(scriptPatcher) {
_heap.push_back(0);
_clonesSegId = 0;
@@ -44,8 +45,6 @@ SegManager::SegManager(ResourceManager *resMan) {
_stringSegId = 0;
#endif
- _resMan = resMan;
-
createClassTable();
}
@@ -983,7 +982,7 @@ int SegManager::instantiateScript(int scriptNum) {
scr = allocateScript(scriptNum, &segmentId);
}
- scr->load(scriptNum, _resMan);
+ scr->load(scriptNum, _resMan, _scriptPatcher);
scr->initializeLocals(this);
scr->initializeClasses(this);
scr->initializeObjects(this, segmentId);
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 074d3f6b0a..b587f4991a 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -49,7 +49,7 @@ public:
/**
* Initialize the segment manager.
*/
- SegManager(ResourceManager *resMan);
+ SegManager(ResourceManager *resMan, ScriptPatcher *scriptPatcher);
/**
* Deallocate all memory associated with the segment manager.
@@ -224,7 +224,7 @@ public:
* Allocate a fresh chunk of the hunk
* @param[in] size Number of bytes to allocate for the hunk entry
* @param[in] hunk_type A descriptive string for the hunk entry, for
- * debugging purposes
+ * debugging purposes
* @return The offset of the freshly allocated hunk entry
*/
reg_t allocateHunkEntry(const char *hunk_type, int size);
@@ -448,6 +448,7 @@ private:
Common::HashMap<int, SegmentId> _scriptSegMap;
ResourceManager *_resMan;
+ ScriptPatcher *_scriptPatcher;
SegmentId _clonesSegId; ///< ID of the (a) clones segment
SegmentId _listsSegId; ///< ID of the (a) list segment
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 6fdff1ce91..4b8500bbcb 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -32,137 +32,137 @@ namespace Sci {
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry arithmeticWorkarounds[] = {
- { GID_CAMELOT, 92, 92, 0, "endingCartoon2", "changeState", 0x20d, 0, { WORKAROUND_FAKE, 0 } }, // op_lai: during the ending, sub gets called with no parameters, uses parameter 1 which is theGrail in this case - bug #3044734
- { GID_ECOQUEST2, 100, 0, 0, "Rain", "points", 0xcc6, 0, { WORKAROUND_FAKE, 0 } }, // op_or: when giving the papers to the customs officer, gets called against a pointer instead of a number - bug #3034464
- { GID_ECOQUEST2, 100, 0, 0, "Rain", "points", 0xce0, 0, { WORKAROUND_FAKE, 0 } }, // Same as above, for the Spanish version - bug #3313962
- { GID_FANMADE, 516, 983, 0, "Wander", "setTarget", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #3038913
+ { GID_CAMELOT, 92, 92, 0, "endingCartoon2", "changeState", 0x20d, 0, { WORKAROUND_FAKE, 0 } }, // op_lai: during the ending, sub gets called with no parameters, uses parameter 1 which is theGrail in this case - bug #5237
+ { GID_ECOQUEST2, 100, 0, 0, "Rain", "points", 0xcc6, 0, { WORKAROUND_FAKE, 0 } }, // op_or: when giving the papers to the customs officer, gets called against a pointer instead of a number - bug #4939
+ { GID_ECOQUEST2, 100, 0, 0, "Rain", "points", 0xce0, 0, { WORKAROUND_FAKE, 0 } }, // Same as above, for the Spanish version - bug #5750
+ { GID_FANMADE, 516, 983, 0, "Wander", "setTarget", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_mul: The Legend of the Lost Jewel Demo (fan made): called with object as second parameter when attacked by insects - bug #5124
{ GID_GK1, 800,64992, 0, "Fwd", "doit", -1, 0, { WORKAROUND_FAKE, 1 } }, // op_gt: when Mosely finds Gabriel and Grace near the end of the game, compares the Grooper object with 7
{ GID_HOYLE4, 700, -1, 1, "Code", "doit", -1, 0, { WORKAROUND_FAKE, 1 } }, // op_add: while bidding in Bridge, an object ("Bid") is added to an object in another segment ("hand3")
{ GID_ICEMAN, 199, 977, 0, "Grooper", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_add: While dancing with the girl
{ GID_MOTHERGOOSE256, -1, 999, 0, "Event", "new", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_and: constantly during the game (SCI1 version)
- { GID_MOTHERGOOSE256, -1, 4, 0, "rm004", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_or: when going north and reaching the castle (rooms 4 and 37) - bug #3038228
+ { GID_MOTHERGOOSE256, -1, 4, 0, "rm004", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_or: when going north and reaching the castle (rooms 4 and 37) - bug #5101
{ GID_MOTHERGOOSEHIRES,90, 90, 0, "newGameButton", "select", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_ge: MUMG Deluxe, when selecting "New Game" in the main menu. It tries to compare an integer with a list. Needs to return false for the game to continue.
{ GID_PHANTASMAGORIA, 902, 0, 0, "", "export 7", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_shr: when starting a chapter in Phantasmagoria
{ GID_QFG1VGA, 301, 928, 0, "Blink", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_div: when entering the inn, gets called with 1 parameter, but 2nd parameter is used for div which happens to be an object
- { GID_QFG2, 200, 200, 0, "astro", "messages", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_lsi: when getting asked for your name by the astrologer bug #3039879
+ { GID_QFG2, 200, 200, 0, "astro", "messages", -1, 0, { WORKAROUND_FAKE, 0 } }, // op_lsi: when getting asked for your name by the astrologer bug #5152
{ GID_QFG4, 710,64941, 0, "RandCycle", "doit", -1, 0, { WORKAROUND_FAKE, 1 } }, // op_gt: when the tentacle appears in the third room of the caves
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
- { GID_CAMELOT, 40, 40, 0, "Rm40", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // when looking at the ground at the pool of Siloam - bug #3614968
- { GID_CASTLEBRAIN, 280, 280, 0, "programmer", "dispatchEvent", -1, 0, { WORKAROUND_FAKE, 0xf } }, // pressing 'q' on the computer screen in the robot room, and closing the help dialog that pops up (bug #3039656). Moves the cursor to the view with the ID returned (in this case, the robot hand)
- { GID_CNICK_KQ, -1, 0, 1, "Character", "say", -1, -1, { WORKAROUND_FAKE, 0 } }, // checkers/backgammon, like in hoyle 3 - temps 504 and 505 - bug #3606025
+ { GID_CAMELOT, 40, 40, 0, "Rm40", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // when looking at the ground at the pool of Siloam - bug #6401
+ { GID_CASTLEBRAIN, 280, 280, 0, "programmer", "dispatchEvent", -1, 0, { WORKAROUND_FAKE, 0xf } }, // pressing 'q' on the computer screen in the robot room, and closing the help dialog that pops up (bug #5143). Moves the cursor to the view with the ID returned (in this case, the robot hand)
+ { GID_CNICK_KQ, -1, 0, 1, "Character", "say", -1, -1, { WORKAROUND_FAKE, 0 } }, // checkers/backgammon, like in hoyle 3 - temps 504 and 505 - bug #6255
{ GID_CNICK_KQ, -1, 700, 0, "gcWindow", "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when entering the control menu, like in hoyle 3
- { GID_CNICK_KQ, 300, 303, 0, "theDoubleCube", "<noname520>", -1, 5, { WORKAROUND_FAKE, 0 } }, // while playing backgammon with doubling enabled - bug #3615121 (same as the theDoubleCube::make workaround for Hoyle 3)
+ { GID_CNICK_KQ, 300, 303, 0, "theDoubleCube", "<noname520>", -1, 5, { WORKAROUND_FAKE, 0 } }, // while playing backgammon with doubling enabled - bug #6426 (same as the theDoubleCube::make workaround for Hoyle 3)
{ GID_CNICK_KQ, 300, 303, 0, "theDoubleCube", "<noname519>", -1, 9, { WORKAROUND_FAKE, 0 } }, // when accepting a double, while playing backgammon with doubling enabled (same as the theDoubleCube::accept workaround for Hoyle 3)
- { GID_CNICK_LAURABOW, -1, 0, 1, "Character", "say", -1, -1, { WORKAROUND_FAKE, 0 } }, // Yatch, like in hoyle 3 - temps 504 and 505 - bug #3615119
- { GID_CNICK_LAURABOW, -1, 700, 0, NULL, "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when entering control menu - bug #3615118 (same as the gcWindow workaround for Hoyle 3)
- { GID_CNICK_LAURABOW,100, 100, 0, NULL, "<noname144>", -1, 1, { WORKAROUND_FAKE, 0 } }, // while playing domino - bug #3615129 (same as the dominoHand2 workaround for Hoyle 3)
- { GID_CNICK_LAURABOW,100, 110, 0, NULL, "doit", -1, -1, { WORKAROUND_FAKE, 0 } }, // when changing the "Dominoes per hand" setting - bug #3615130
+ { GID_CNICK_LAURABOW, -1, 0, 1, "Character", "say", -1, -1, { WORKAROUND_FAKE, 0 } }, // Yatch, like in hoyle 3 - temps 504 and 505 - bug #6424
+ { GID_CNICK_LAURABOW, -1, 700, 0, NULL, "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when entering control menu - bug #6423 (same as the gcWindow workaround for Hoyle 3)
+ { GID_CNICK_LAURABOW,100, 100, 0, NULL, "<noname144>", -1, 1, { WORKAROUND_FAKE, 0 } }, // while playing domino - bug #6429 (same as the dominoHand2 workaround for Hoyle 3)
+ { GID_CNICK_LAURABOW,100, 110, 0, NULL, "doit", -1, -1, { WORKAROUND_FAKE, 0 } }, // when changing the "Dominoes per hand" setting - bug #6430
{ GID_CNICK_LONGBOW, 0, 0, 0, "RH Budget", "init", -1, 1, { WORKAROUND_FAKE, 0 } }, // when starting the game
{ GID_ECOQUEST, -1, -1, 0, NULL, "doVerb", -1, 0, { WORKAROUND_FAKE, 0 } }, // almost clicking anywhere triggers this in almost all rooms
{ GID_FANMADE, 516, 979, 0, "", "export 0", -1, 20, { WORKAROUND_FAKE, 0 } }, // Happens in Grotesteing after the logos
- { GID_FANMADE, 528, 990, 0, "GDialog", "doit", -1, 4, { WORKAROUND_FAKE, 0 } }, // Happens in Cascade Quest when closing the glossary - bug #3038757
- { GID_FANMADE, 488, 1, 0, "RoomScript", "doit", 0x1f17, 1, { WORKAROUND_FAKE, 0 } }, // Happens in Ocean Battle while playing - bug #3059871
+ { GID_FANMADE, 528, 990, 0, "GDialog", "doit", -1, 4, { WORKAROUND_FAKE, 0 } }, // Happens in Cascade Quest when closing the glossary - bug #5116
+ { GID_FANMADE, 488, 1, 0, "RoomScript", "doit", 0x1f17, 1, { WORKAROUND_FAKE, 0 } }, // Happens in Ocean Battle while playing - bug #5335
{ GID_FREDDYPHARKAS, -1, 24, 0, "gcWin", "open", -1, 5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
{ GID_FREDDYPHARKAS, -1, 31, 0, "quitWin", "open", -1, 5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
- { GID_FREDDYPHARKAS, 540, 540, 0, "WaverCode", "init", -1, -1, { WORKAROUND_FAKE, 0 } }, // Gun pratice mini-game (bug #3044218)
+ { GID_FREDDYPHARKAS, 540, 540, 0, "WaverCode", "init", -1, -1, { WORKAROUND_FAKE, 0 } }, // Gun pratice mini-game - bug #5232
{ GID_GK1, -1, 64950, -1, "Feature", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // sometimes when walk-clicking
{ GID_GK2, -1, 11, 0, "", "export 10", -1, 3, { WORKAROUND_FAKE, 0 } }, // called when the game starts
{ GID_GK2, -1, 11, 0, "", "export 10", -1, 4, { WORKAROUND_FAKE, 0 } }, // called during the game
{ GID_HOYLE1, 4, 104, 0, "GinRummyCardList", "calcRuns", -1, 4, { WORKAROUND_FAKE, 0 } }, // Gin Rummy / right when the game starts
{ GID_HOYLE1, 5, 204, 0, "tableau", "checkRuns", -1, 2, { WORKAROUND_FAKE, 0 } }, // Cribbage / during the game
- { GID_HOYLE1, 3, 16, 0, "", "export 0", 0x37c, 3, { WORKAROUND_FAKE, 0 } }, // Hearts / during the game - bug #3052359
- { GID_HOYLE1, -1, 997, 0, "MenuBar", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // When changing game speed settings - bug #3108012
+ { GID_HOYLE1, 3, 16, 0, "", "export 0", 0x37c, 3, { WORKAROUND_FAKE, 0 } }, // Hearts / during the game - bug #5299
+ { GID_HOYLE1, -1, 997, 0, "MenuBar", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // When changing game speed settings - bug #5512
{ GID_HOYLE3, -1, 0, 1, "Character", "say", -1, -1, { WORKAROUND_FAKE, 0 } }, // when starting checkers or dominoes, first time a character says something - temps 504 and 505
{ GID_HOYLE3, -1, 700, 0, "gcWindow", "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when entering control menu
- { GID_HOYLE3, 100, 100, 0, "dominoHand2", "cue", -1, 1, { WORKAROUND_FAKE, 0 } }, // while playing domino - bug #3036918
- { GID_HOYLE3, 100, 110, 0, "OKButton", "doit", -1, -1, { WORKAROUND_FAKE, 0 } }, // when changing the "Dominoes per hand" setting - bug #3615130
+ { GID_HOYLE3, 100, 100, 0, "dominoHand2", "cue", -1, 1, { WORKAROUND_FAKE, 0 } }, // while playing domino - bug #5042
+ { GID_HOYLE3, 100, 110, 0, "OKButton", "doit", -1, -1, { WORKAROUND_FAKE, 0 } }, // when changing the "Dominoes per hand" setting - bug #6430
{ GID_HOYLE3, 300, 303, 0, "theDoubleCube", "make", -1, 5, { WORKAROUND_FAKE, 0 } }, // while playing backgammon with doubling enabled
{ GID_HOYLE3, 300, 303, 0, "theDoubleCube", "accept", -1, 9, { WORKAROUND_FAKE, 0 } }, // when accepting a double, while playing backgammon with doubling enabled
- { GID_HOYLE4, -1, 0, 0, NULL, "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when selecting "Control" from the menu (temp vars 0-3) - bug #3039294
- { GID_HOYLE4, 910, 18, 0, NULL, "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // during tutorial - bug #3042756
- { GID_HOYLE4, 910, 910, 0, NULL, "setup", -1, 3, { WORKAROUND_FAKE, 0 } }, // when selecting "Tutorial" from the main menu - bug #3039294
+ { GID_HOYLE4, -1, 0, 0, NULL, "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when selecting "Control" from the menu (temp vars 0-3) - bug #5132
+ { GID_HOYLE4, 910, 18, 0, NULL, "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // during tutorial - bug #5213
+ { GID_HOYLE4, 910, 910, 0, NULL, "setup", -1, 3, { WORKAROUND_FAKE, 0 } }, // when selecting "Tutorial" from the main menu - bug #5132
{ GID_HOYLE4, 700, 700, 1, "BridgeHand", "calcQTS", -1, 3, { WORKAROUND_FAKE, 0 } }, // when placing a bid in bridge (always)
- { GID_HOYLE4, 700, 710, 1, "BridgeStrategyPlay", "checkSplitTops", -1, 10, { WORKAROUND_FAKE, 0 } }, // while playing bridge, objects LeadReturn_Trump, SecondSeat_Trump, ThirdSeat_Trump and others - bug #3361925
+ { GID_HOYLE4, 700, 710, 1, "BridgeStrategyPlay", "checkSplitTops", -1, 10, { WORKAROUND_FAKE, 0 } }, // while playing bridge, objects LeadReturn_Trump, SecondSeat_Trump, ThirdSeat_Trump and others - bug #5794
{ GID_HOYLE4, 700, -1, 1, "BridgeDefense", "think", -1, -1, { WORKAROUND_FAKE, 0 } }, // sometimes while playing bridge, temp var 3, 17 and others, objects LeadReturn_Trump, ThirdSeat_Trump and others
{ GID_HOYLE4, 700, 730, 1, "BridgeDefense", "beatTheirBest", -1, 3, { WORKAROUND_FAKE, 0 } }, // rarely while playing bridge
- { GID_HOYLE4, 700, -1, 1, "Code", "doit", -1, -1, { WORKAROUND_FAKE, 0 } }, // when placing a bid in bridge (always), temp var 11, 24, 27, 46, 75, objects compete_tree, compwe_tree, other1_tree, b1 - bugs #3292332 and #3361925
+ { GID_HOYLE4, 700, -1, 1, "Code", "doit", -1, -1, { WORKAROUND_FAKE, 0 } }, // when placing a bid in bridge (always), temp var 11, 24, 27, 46, 75, objects compete_tree, compwe_tree, other1_tree, b1 - bugs #5663 and #5794
{ GID_HOYLE4, 300, 300, 0, "", "export 2", 0x1d4d, 0, { WORKAROUND_FAKE, 0 } }, // after passing around cards in hearts
- { GID_HOYLE4, 400, 400, 1, "GinHand", "calcRuns", -1, 4, { WORKAROUND_FAKE, 0 } }, // sometimes while playing Gin Rummy (e.g. when knocking and placing a card) - bug #3292334
- { GID_HOYLE4, 500, 17, 1, "Character", "say", -1, 504, { WORKAROUND_FAKE, 0 } }, // sometimes while playing Cribbage (e.g. when the opponent says "Last Card") - bug #3292327
- { GID_ISLANDBRAIN, 100, 937, 0, "IconBar", "dispatchEvent", -1, 58, { WORKAROUND_FAKE, 0 } }, // when using ENTER at the startup menu - bug #3045225
+ { GID_HOYLE4, 400, 400, 1, "GinHand", "calcRuns", -1, 4, { WORKAROUND_FAKE, 0 } }, // sometimes while playing Gin Rummy (e.g. when knocking and placing a card) - bug #5665
+ { GID_HOYLE4, 500, 17, 1, "Character", "say", -1, 504, { WORKAROUND_FAKE, 0 } }, // sometimes while playing Cribbage (e.g. when the opponent says "Last Card") - bug #5662
+ { GID_ISLANDBRAIN, 100, 937, 0, "IconBar", "dispatchEvent", -1, 58, { WORKAROUND_FAKE, 0 } }, // when using ENTER at the startup menu - bug #5241
{ GID_ISLANDBRAIN, 140, 140, 0, "piece", "init", -1, 3, { WORKAROUND_FAKE, 1 } }, // first puzzle right at the start, some initialization variable. bnt is done on it, and it should be non-0
{ GID_ISLANDBRAIN, 200, 268, 0, "anElement", "select", -1, 0, { WORKAROUND_FAKE, 0 } }, // elements puzzle, gets used before super TextIcon
{ GID_JONES, 1, 232, 0, "weekendText", "draw", 0x3d3, 0, { WORKAROUND_FAKE, 0 } }, // jones/cd only - gets called during the game
{ GID_JONES, 1, 255, 0, "", "export 0", -1, -1, { WORKAROUND_FAKE, 0 } }, // jones/cd only - called when a game ends, temps 13 and 14
{ GID_JONES, 764, 255, 0, "", "export 0", -1, -1, { WORKAROUND_FAKE, 0 } }, // jones/ega&vga only - called when the game starts, temps 13 and 14
- //{ GID_KQ5, -1, 0, 0, "", "export 29", -1, 3, { WORKAROUND_FAKE, 0xf } }, // called when playing harp for the harpies or when aborting dialog in toy shop, is used for kDoAudio - bug #3034700
+ //{ GID_KQ5, -1, 0, 0, "", "export 29", -1, 3, { WORKAROUND_FAKE, 0xf } }, // called when playing harp for the harpies or when aborting dialog in toy shop, is used for kDoAudio - bug #4961
// ^^ shouldn't be needed anymore, we got a script patch instead (kq5PatchCdHarpyVolume)
{ GID_KQ5, 25, 25, 0, "rm025", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // inside witch forest, when going to the room where the walking rock is
- { GID_KQ5, 55, 55, 0, "helpScript", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // when giving the tambourine to the monster in the labyrinth (only happens at one of the locations) - bug #3041262
+ { GID_KQ5, 55, 55, 0, "helpScript", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // when giving the tambourine to the monster in the labyrinth (only happens at one of the locations) - bug #5198
{ GID_KQ5, -1, 755, 0, "gcWin", "open", -1, -1, { WORKAROUND_FAKE, 0 } }, // when entering control menu in the FM-Towns version
- { GID_KQ6, -1, 30, 0, "rats", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // rats in the catacombs (temps 1 - 5) - bugs #3034597, #3035495, #3035824
- { GID_KQ6, 210, 210, 0, "rm210", "scriptCheck", -1, 0, { WORKAROUND_FAKE, 1 } }, // using inventory in that room - bug #3034565
+ { GID_KQ6, -1, 30, 0, "rats", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // rats in the catacombs (temps 1 - 5) - bugs #4958, #4998, #5017
+ { GID_KQ6, 210, 210, 0, "rm210", "scriptCheck", -1, 0, { WORKAROUND_FAKE, 1 } }, // using inventory in that room - bug #4953
{ GID_KQ6, 500, 500, 0, "rm500", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // going to island of the beast
{ GID_KQ6, 520, 520, 0, "rm520", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // going to boiling water trap on beast isle
{ GID_KQ6, -1, 903, 0, "controlWin", "open", -1, 4, { WORKAROUND_FAKE, 0 } }, // when opening the controls window (save, load etc)
- { GID_KQ6, -1, 907, 0, "tomato", "doVerb", -1, 2, { WORKAROUND_FAKE, 0 } }, // when looking at the rotten tomato in the inventory - bug #3059544
+ { GID_KQ6, -1, 907, 0, "tomato", "doVerb", -1, 2, { WORKAROUND_FAKE, 0 } }, // when looking at the rotten tomato in the inventory - bug #5331
{ GID_KQ6, -1, 928, 0, NULL, "startText", -1, 0, { WORKAROUND_FAKE, 0 } }, // gets caused by Text+Audio support (see script patcher)
{ GID_KQ7, -1, 64996, 0, "User", "handleEvent", -1, 1, { WORKAROUND_FAKE, 0 } }, // called when pushing a keyboard key
- { GID_LAURABOW, 37, 0, 0, "CB1", "doit", -1, 1, { WORKAROUND_FAKE, 0 } }, // when going up the stairs (bug #3037694)
- { GID_LAURABOW, -1, 967, 0, "myIcon", "cycle", -1, 1, { WORKAROUND_FAKE, 0 } }, // having any portrait conversation coming up (initial bug #3034985)
+ { GID_LAURABOW, 37, 0, 0, "CB1", "doit", -1, 1, { WORKAROUND_FAKE, 0 } }, // when going up the stairs - bug #5084
+ { GID_LAURABOW, -1, 967, 0, "myIcon", "cycle", -1, 1, { WORKAROUND_FAKE, 0 } }, // having any portrait conversation coming up - initial bug #4971
{ GID_LAURABOW2, -1, 24, 0, "gcWin", "open", -1, 5, { WORKAROUND_FAKE, 0xf } }, // is used as priority for game menu
- { GID_LAURABOW2, -1, 21, 0, "dropCluesCode", "doit", -1, 1, { WORKAROUND_FAKE, 0x7fff } }, // when asking some questions (e.g. the reporter about the burglary, or the policeman about Ziggy). Must be big, as the game scripts perform lt on it and start deleting journal entries - bugs #3035068, #3036274
- { GID_LAURABOW2, -1, 90, 1, "MuseumActor", "init", -1, 6, { WORKAROUND_FAKE, 0 } }, // Random actors in museum (bug #3041257)
- { GID_LAURABOW2, 240, 240, 0, "sSteveAnimates", "changeState", -1, 0, { WORKAROUND_FAKE, 0 } }, // Steve Dorian's idle animation at the docks - bug #3036291
+ { GID_LAURABOW2, -1, 21, 0, "dropCluesCode", "doit", -1, 1, { WORKAROUND_FAKE, 0x7fff } }, // when asking some questions (e.g. the reporter about the burglary, or the policeman about Ziggy). Must be big, as the game scripts perform lt on it and start deleting journal entries - bugs #4979, #5026
+ { GID_LAURABOW2, -1, 90, 1, "MuseumActor", "init", -1, 6, { WORKAROUND_FAKE, 0 } }, // Random actors in museum - bug #5197
+ { GID_LAURABOW2, 240, 240, 0, "sSteveAnimates", "changeState", -1, 0, { WORKAROUND_FAKE, 0 } }, // Steve Dorian's idle animation at the docks - bug #5028
{ GID_LAURABOW2, -1, 928, 0, NULL, "startText", -1, 0, { WORKAROUND_FAKE, 0 } }, // gets caused by Text+Audio support (see script patcher)
- { GID_LONGBOW, -1, 0, 0, "Longbow", "restart", -1, 0, { WORKAROUND_FAKE, 0 } }, // When canceling a restart game - bug #3046200
+ { GID_LONGBOW, -1, 0, 0, "Longbow", "restart", -1, 0, { WORKAROUND_FAKE, 0 } }, // When canceling a restart game - bug #5244
{ GID_LONGBOW, -1, 213, 0, "clear", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // When giving an answer using the druid hand sign code in any room
- { GID_LONGBOW, -1, 213, 0, "letter", "handleEvent", 0xa8, 1, { WORKAROUND_FAKE, 0 } }, // When using the druid hand sign code in any room - bug #3036601
+ { GID_LONGBOW, -1, 213, 0, "letter", "handleEvent", 0xa8, 1, { WORKAROUND_FAKE, 0 } }, // When using the druid hand sign code in any room - bug #5035
{ GID_LSL1, 250, 250, 0, "increase", "handleEvent", -1, 2, { WORKAROUND_FAKE, 0 } }, // casino, playing game, increasing bet
{ GID_LSL1, 720, 720, 0, "rm720", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // age check room
- { GID_LSL2, 38, 38, 0, "cloudScript", "changeState", -1, 1, { WORKAROUND_FAKE, 0 } }, // entering the room in the middle deck of the ship - bug #3036483
+ { GID_LSL2, 38, 38, 0, "cloudScript", "changeState", -1, 1, { WORKAROUND_FAKE, 0 } }, // entering the room in the middle deck of the ship - bug #5034
{ GID_LSL3, 340, 340, 0, "ComicScript", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // right after entering the 3 ethnic groups inside comedy club (temps 200, 201, 202, 203)
{ GID_LSL3, -1, 997, 0, "TheMenuBar", "handleEvent", -1, 1, { WORKAROUND_FAKE, 0xf } }, // when setting volume the first time, this temp is used to set volume on entry (normally it would have been initialized to 's')
- { GID_LSL6, 820, 82, 0, "", "export 0", -1, -1, { WORKAROUND_FAKE, 0 } }, // when touching the electric fence - bug #3038326
+ { GID_LSL6, 820, 82, 0, "", "export 0", -1, -1, { WORKAROUND_FAKE, 0 } }, // when touching the electric fence - bug #5103
{ GID_LSL6, -1, 85, 0, "washcloth", "doVerb", -1, 0, { WORKAROUND_FAKE, 0 } }, // washcloth in inventory
{ GID_LSL6, -1, 928, -1, "Narrator", "startText", -1, 0, { WORKAROUND_FAKE, 0 } }, // used by various objects that are even translated in foreign versions, that's why we use the base-class
{ GID_LSL6HIRES, 0, 85, 0, "LL6Inv", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // on startup
{ GID_LSL6HIRES, -1, 64950, 1, "Feature", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // at least when entering swimming pool area
{ GID_LSL6HIRES, -1, 64964, 0, "DPath", "init", -1, 1, { WORKAROUND_FAKE, 0 } }, // during the game
- { GID_MOTHERGOOSE256, -1, 0, 0, "MG", "doit", -1, 5, { WORKAROUND_FAKE, 0 } }, // SCI1.1: When moving the cursor all the way to the left during the game (bug #3043955)
- { GID_MOTHERGOOSE256, -1, 992, 0, "AIPath", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // Happens in the demo and full version. In the demo, it happens when walking two screens from mother goose's house to the north. In the full version, it happens in rooms 7 and 23 - bug #3049146
- { GID_MOTHERGOOSE256, 90, 90, 0, "introScript", "changeState", -1, 65, { WORKAROUND_FAKE, 0 } }, // SCI1(CD): At the very end, after the game is completed and restarted - bug #3268076
- { GID_MOTHERGOOSE256, 94, 94, 0, "sunrise", "changeState", -1, 367, { WORKAROUND_FAKE, 0 } }, // At the very end, after the game is completed - bug #3051163
+ { GID_MOTHERGOOSE256, -1, 0, 0, "MG", "doit", -1, 5, { WORKAROUND_FAKE, 0 } }, // SCI1.1: When moving the cursor all the way to the left during the game - bug #5224
+ { GID_MOTHERGOOSE256, -1, 992, 0, "AIPath", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // Happens in the demo and full version. In the demo, it happens when walking two screens from mother goose's house to the north. In the full version, it happens in rooms 7 and 23 - bug #5269
+ { GID_MOTHERGOOSE256, 90, 90, 0, "introScript", "changeState", -1, 65, { WORKAROUND_FAKE, 0 } }, // SCI1(CD): At the very end, after the game is completed and restarted - bug #5626
+ { GID_MOTHERGOOSE256, 94, 94, 0, "sunrise", "changeState", -1, 367, { WORKAROUND_FAKE, 0 } }, // At the very end, after the game is completed - bug #5294
{ GID_MOTHERGOOSEHIRES,-1,64950, 1, "Feature", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // right when clicking on a child at the start and probably also later
{ GID_MOTHERGOOSEHIRES,-1,64950, 1, "View", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // see above
- { GID_PEPPER, -1, 894, 0, "Package", "doVerb", -1, 3, { WORKAROUND_FAKE, 0 } }, // using the hand on the book in the inventory - bug #3040012
+ { GID_PEPPER, -1, 894, 0, "Package", "doVerb", -1, 3, { WORKAROUND_FAKE, 0 } }, // using the hand on the book in the inventory - bug #5154
{ GID_PEPPER, 150, 928, 0, "Narrator", "startText", -1, 0, { WORKAROUND_FAKE, 0 } }, // happens during the non-interactive demo of Pepper
{ GID_PQ4, -1, 25, 0, "iconToggle", "select", -1, 1, { WORKAROUND_FAKE, 0 } }, // when toggling the icon bar to auto-hide or not
{ GID_PQSWAT, -1, 64950, 0, "View", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // Using the menu in the beginning
{ GID_QFG1, -1, 210, 0, "Encounter", "init", 0xbd0, 0, { WORKAROUND_FAKE, 0 } }, // hq1: going to the brigands hideout
{ GID_QFG1, -1, 210, 0, "Encounter", "init", 0xbe4, 0, { WORKAROUND_FAKE, 0 } }, // qfg1: going to the brigands hideout
- { GID_QFG1VGA, 16, 16, 0, "lassoFailed", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // qfg1vga: casting the "fetch" spell in the screen with the flowers, temps 0 and 1 - bug #3053268
- { GID_QFG1VGA, -1, 210, 0, "Encounter", "init", 0xcee, 0, { WORKAROUND_FAKE, 0 } }, // qfg1vga: going to the brigands hideout - bug #3109299
+ { GID_QFG1VGA, 16, 16, 0, "lassoFailed", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // qfg1vga: casting the "fetch" spell in the screen with the flowers, temps 0 and 1 - bug #5309
+ { GID_QFG1VGA, -1, 210, 0, "Encounter", "init", 0xcee, 0, { WORKAROUND_FAKE, 0 } }, // qfg1vga: going to the brigands hideout - bug #5515
{ GID_QFG1VGA, -1, 210, 0, "Encounter", "init", 0xce7, 0, { WORKAROUND_FAKE, 0 } }, // qfg1vga: going to room 92
{ GID_QFG2, -1, 71, 0, "theInvSheet", "doit", -1, 1, { WORKAROUND_FAKE, 0 } }, // accessing the inventory
- { GID_QFG2, -1, 701, -1, "Alley", "at", -1, 0, { WORKAROUND_FAKE, 0 } }, // when walking inside the alleys in the town - bug #3035835 & #3038367
+ { GID_QFG2, -1, 701, -1, "Alley", "at", -1, 0, { WORKAROUND_FAKE, 0 } }, // when walking inside the alleys in the town - bug #5019 & #5106
{ GID_QFG2, -1, 990, 0, "Restore", "doit", -1, 364, { WORKAROUND_FAKE, 0 } }, // when pressing enter in restore dialog w/o any saved games present
- { GID_QFG2, 260, 260, 0, "abdulS", "changeState",0x2d22, -1, { WORKAROUND_FAKE, 0 } }, // During the thief's first mission (in the house), just before Abdul is about to enter the house (where you have to hide in the wardrobe), bug #3039891, temps 1 and 2
- { GID_QFG2, 260, 260, 0, "jabbarS", "changeState",0x2d22, -1, { WORKAROUND_FAKE, 0 } }, // During the thief's first mission (in the house), just before Jabbar is about to enter the house (where you have to hide in the wardrobe), bug #3040469, temps 1 and 2
- { GID_QFG2, 500, 500, 0, "lightNextCandleS", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // Inside the last room, while Ad Avis performs the ritual to summon the genie - bug #3148418
- { GID_QFG2, -1, 700, 0, NULL, "showSign", -1, 10, { WORKAROUND_FAKE, 0 } }, // Occurs sometimes when reading a sign in Raseir, Shapeir et al - bugs #3272735, #3275413
- { GID_QFG3, 510, 510, 0, "awardPrize", "changeState", -1, 0, { WORKAROUND_FAKE, 1 } }, // Simbani warrior challenge, after throwing the spears and retrieving the ring - bug #3049435. Must be non-zero, otherwise the prize is awarded twice - bug #3575570.
- { GID_QFG3, 140, 140, 0, "rm140", "init", 0x1008, 0, { WORKAROUND_FAKE, 0 } }, // when importing a character and selecting the previous profession - bug #3040460
- { GID_QFG3, 330, 330, -1, "Teller", "doChild", -1, -1, { WORKAROUND_FAKE, 0 } }, // when talking to King Rajah about "Rajah" (bug #3036390, temp 1) or "Tarna" (temp 0), or when clicking on yourself and saying "Greet" (bug #3039774, temp 1)
- { GID_QFG3, 700, 700, -1, "monsterIsDead", "changeState", -1, 0, { WORKAROUND_FAKE, 0 } }, // in the jungle, after winning any fight, bug #3040624
- { GID_QFG3, 470, 470, -1, "rm470", "notify", -1, 0, { WORKAROUND_FAKE, 0 } }, // closing the character screen in the Simbani village in the room with the bridge, bug #3040565
- { GID_QFG3, 490, 490, -1, "computersMove", "changeState", -1, 0, { WORKAROUND_FAKE, 0 } }, // when finishing awari game, bug #3040579
+ { GID_QFG2, 260, 260, 0, "abdulS", "changeState",0x2d22, -1, { WORKAROUND_FAKE, 0 } }, // During the thief's first mission (in the house), just before Abdul is about to enter the house (where you have to hide in the wardrobe), bug #5153, temps 1 and 2
+ { GID_QFG2, 260, 260, 0, "jabbarS", "changeState",0x2d22, -1, { WORKAROUND_FAKE, 0 } }, // During the thief's first mission (in the house), just before Jabbar is about to enter the house (where you have to hide in the wardrobe), bug #5164, temps 1 and 2
+ { GID_QFG2, 500, 500, 0, "lightNextCandleS", "changeState", -1, -1, { WORKAROUND_FAKE, 0 } }, // Inside the last room, while Ad Avis performs the ritual to summon the genie - bug #5566
+ { GID_QFG2, -1, 700, 0, NULL, "showSign", -1, 10, { WORKAROUND_FAKE, 0 } }, // Occurs sometimes when reading a sign in Raseir, Shapeir et al - bugs #5627, #5635
+ { GID_QFG3, 510, 510, 0, "awardPrize", "changeState", -1, 0, { WORKAROUND_FAKE, 1 } }, // Simbani warrior challenge, after throwing the spears and retrieving the ring - bug #5277. Must be non-zero, otherwise the prize is awarded twice - bug #6160
+ { GID_QFG3, 140, 140, 0, "rm140", "init", 0x1008, 0, { WORKAROUND_FAKE, 0 } }, // when importing a character and selecting the previous profession - bug #5163
+ { GID_QFG3, 330, 330, -1, "Teller", "doChild", -1, -1, { WORKAROUND_FAKE, 0 } }, // when talking to King Rajah about "Rajah" (bug #5033, temp 1) or "Tarna" (temp 0), or when clicking on yourself and saying "Greet" (bug #5148, temp 1)
+ { GID_QFG3, 700, 700, -1, "monsterIsDead", "changeState", -1, 0, { WORKAROUND_FAKE, 0 } }, // in the jungle, after winning any fight, bug #5169
+ { GID_QFG3, 470, 470, -1, "rm470", "notify", -1, 0, { WORKAROUND_FAKE, 0 } }, // closing the character screen in the Simbani village in the room with the bridge, bug #5165
+ { GID_QFG3, 490, 490, -1, "computersMove", "changeState", -1, 0, { WORKAROUND_FAKE, 0 } }, // when finishing awari game, bug #5167
{ GID_QFG3, 490, 490, -1, "computersMove", "changeState", 0xf53, 4, { WORKAROUND_FAKE, 0 } }, // also when finishing awari game
- { GID_QFG3, 851, 32, -1, "ProjObj", "doit", -1, 1, { WORKAROUND_FAKE, 0 } }, // near the end, when throwing the spear of death, bug #3050122
+ { GID_QFG3, 851, 32, -1, "ProjObj", "doit", -1, 1, { WORKAROUND_FAKE, 0 } }, // near the end, when throwing the spear of death, bug #5282
{ GID_QFG4, -1, 15, -1, "charInitScreen", "dispatchEvent", -1, 5, { WORKAROUND_FAKE, 0 } }, // floppy version, when viewing the character screen
{ GID_QFG4, -1, 64917, -1, "controlPlane", "setBitmap", -1, 3, { WORKAROUND_FAKE, 0 } }, // floppy version, when entering the game menu
{ GID_QFG4, -1, 64917, -1, "Plane", "setBitmap", -1, 3, { WORKAROUND_FAKE, 0 } }, // floppy version, happens sometimes in fight scenes
@@ -185,7 +185,7 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_SQ4, -1, 708, -1, "exitBut", "doVerb", -1, 0, { WORKAROUND_FAKE, 0 } }, // Floppy: happens, when looking at the "close" button in the sq4 hintbook - bug #6447
{ GID_SQ4, -1, 708, -1, "prevBut", "doVerb", -1, 0, { WORKAROUND_FAKE, 0 } }, // Floppy: happens, when looking at the "previous" button in the sq4 hintbook - bug #6447
{ GID_SQ4, -1, 708, -1, "nextBut", "doVerb", -1, 0, { WORKAROUND_FAKE, 0 } }, // Floppy: happens, when looking at the "next" button in the sq4 hintbook - bug #6447
- { GID_SQ5, 201, 201, 0, "buttonPanel", "doVerb", -1, 0, { WORKAROUND_FAKE, 1 } }, // when looking at the orange or red button - bug #3038563
+ { GID_SQ5, 201, 201, 0, "buttonPanel", "doVerb", -1, 0, { WORKAROUND_FAKE, 1 } }, // when looking at the orange or red button - bug #5112
{ GID_SQ6, -1, 0, 0, "SQ6", "init", -1, 2, { WORKAROUND_FAKE, 0 } }, // Demo and full version: called when the game starts (demo: room 0, full: room 100)
{ GID_SQ6, -1, 64950, -1, "Feature", "handleEvent", -1, 0, { WORKAROUND_FAKE, 0 } }, // called when pressing "Start game" in the main menu, when entering the Orion's Belt bar (room 300), and perhaps other places
{ GID_SQ6, -1, 64964, 0, "DPath", "init", -1, 1, { WORKAROUND_FAKE, 0 } }, // during the game
@@ -199,25 +199,25 @@ const SciWorkaroundEntry kAbs_workarounds[] = {
{ GID_HOYLE1, 2, 2, 0, "room2", "doit", -1, 0, { WORKAROUND_FAKE, 0x3e9 } }, // old maid - called with objects instead of integers
{ GID_HOYLE1, 3, 3, 0, "room3", "doit", -1, 0, { WORKAROUND_FAKE, 0x3e9 } }, // hearts - called with objects instead of integers
{ GID_QFG1VGA, -1, -1, 0, NULL, "doit", -1, 0, { WORKAROUND_FAKE, 0x3e9 } }, // when the game is patched with the NRS patch
- { GID_QFG3 , -1, -1, 0, NULL, "doit", -1, 0, { WORKAROUND_FAKE, 0x3e9 } }, // when the game is patched with the NRS patch (bugs #3528416, #3528542)
+ { GID_QFG3 , -1, -1, 0, NULL, "doit", -1, 0, { WORKAROUND_FAKE, 0x3e9 } }, // when the game is patched with the NRS patch - bugs #6042, #6043
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kCelHigh_workarounds[] = {
- { GID_KQ5, -1, 255, 0, "deathIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #3037003
+ { GID_KQ5, -1, 255, 0, "deathIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
{ GID_PQ2, -1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
- { GID_SQ1, 1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #3035720
- { GID_FANMADE, -1, 979, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #3039679
+ { GID_SQ1, 1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
+ { GID_FANMADE, -1, 979, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kCelWide_workarounds[] = {
- { GID_KQ5, -1, 255, 0, "deathIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #3037003
+ { GID_KQ5, -1, 255, 0, "deathIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
{ GID_PQ2, -1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
- { GID_SQ1, 1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #3035720
- { GID_FANMADE, -1, 979, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #3039679
+ { GID_SQ1, 1, 255, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // DEMO: Called with 2nd/3rd parameters as objects when clicking on the menu - bug #5012
+ { GID_FANMADE, -1, 979, 0, "DIcon", "setSize", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // In The Gem Scenario and perhaps other fanmade games, this is called with 2nd/3rd parameters as objects - bug #5144
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -239,9 +239,9 @@ const SciWorkaroundEntry kDeviceInfo_workarounds[] = {
const SciWorkaroundEntry kDisplay_workarounds[] = {
{ GID_ISLANDBRAIN, 300, 300, 0, "geneDude", "show", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the gene explanation chart - a parameter is an object
{ GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4ae, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id
- { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4c1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id (another pq2 version, bug #3043904)
+ { GID_PQ2, 23, 23, 0, "rm23Script", "elements", 0x4c1, 0, { WORKAROUND_IGNORE, 0 } }, // when looking at the 2nd page of pate's file - 0x75 as id (another pq2 version, bug #5223)
{ GID_QFG1, 11, 11, 0, "battle", "<noname90>", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: When entering battle, 0x75 as id
- { GID_SQ4, 397, 0, 0, "", "export 12", -1, 0, { WORKAROUND_IGNORE, 0 } }, // FLOPPY: when going into the computer store (bug #3044044)
+ { GID_SQ4, 397, 0, 0, "", "export 12", -1, 0, { WORKAROUND_IGNORE, 0 } }, // FLOPPY: when going into the computer store - bug #5227
{ GID_SQ4, 391, 391, 0, "doCatalog", "mode", 0x84, 0, { WORKAROUND_IGNORE, 0 } }, // CD: clicking on catalog in roboter sale - a parameter is an object
{ GID_SQ4, 391, 391, 0, "choosePlug", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // CD: ordering connector in roboter sale - a parameter is an object
SCI_WORKAROUNDENTRY_TERMINATOR
@@ -249,13 +249,13 @@ const SciWorkaroundEntry kDisplay_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kDirLoop_workarounds[] = {
- { GID_KQ4, 4, 992, 0, "Avoid", "doit", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when the ogre catches you in front of his house, second parameter points to the same object as the first parameter, instead of being an integer (the angle) - bug #3042964
+ { GID_KQ4, 4, 992, 0, "Avoid", "doit", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when the ogre catches you in front of his house, second parameter points to the same object as the first parameter, instead of being an integer (the angle) - bug #5217
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kDisposeScript_workarounds[] = {
- { GID_LAURABOW, 777, 777, 0, "myStab", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #3034907
+ { GID_LAURABOW, 777, 777, 0, "myStab", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: after the will is signed, parameter 0 is an object - bug #4967
{ GID_QFG1, -1, 64, 0, "rm64", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when leaving graveyard, parameter 0 is an object
{ GID_SQ4, 150, 151, 0, "fightScript", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during fight with Vohaul, parameter 0 is an object
{ GID_SQ4, 150, 152, 0, "driveCloseUp", "dispose", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when choosing "beam download", parameter 0 is an object
@@ -264,26 +264,26 @@ const SciWorkaroundEntry kDisposeScript_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kDoSoundFade_workarounds[] = {
- { GID_KQ5, 213, 989, 0, "globalSound3", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when bandits leave the secret temple, parameter 4 is an object - bug #3037594
+ { GID_KQ5, 213, 989, 0, "globalSound3", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when bandits leave the secret temple, parameter 4 is an object - bug #5078
{ GID_KQ6, 105, 989, 0, "globalSound", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // floppy: during intro, parameter 4 is an object
- { GID_KQ6, 460, 989, 0, "globalSound2", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // after pulling the black widow's web on the isle of wonder, parameter 4 is an object - bug #3034567
+ { GID_KQ6, 460, 989, 0, "globalSound2", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // after pulling the black widow's web on the isle of wonder, parameter 4 is an object - bug #4954
{ GID_QFG4, -1, 64989, 0, "longSong", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // CD version: many places, parameter 4 is an object (longSong)
- { GID_SQ5, 800, 989, 0, "sq5Music1", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when cutting the wrong part of Goliath with the laser - bug #3614145
+ { GID_SQ5, 800, 989, 0, "sq5Music1", "fade", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when cutting the wrong part of Goliath with the laser - bug #6341
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kGetAngle_workarounds[] = {
{ GID_FANMADE, 516, 992, 0, "Motion", "init", -1, 0, { WORKAROUND_FAKE, 0 } }, // The Legend of the Lost Jewel Demo (fan made): called with third/fourth parameters as objects
- { GID_KQ6, -1, 752, 0, "throwDazzle", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // room 740/790 after the Genie is exposed in the Palace (short and long ending), it starts shooting lightning bolts around. An extra 5th parameter is passed - bug #3034610 & #3041734
- { GID_SQ1, -1, 927, 0, "PAvoider", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // all rooms in Ulence Flats after getting the Pilot Droid: called with a single parameter when the droid is in Roger's path - bug #3513207
+ { GID_KQ6, -1, 752, 0, "throwDazzle", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // room 740/790 after the Genie is exposed in the Palace (short and long ending), it starts shooting lightning bolts around. An extra 5th parameter is passed - bug #4959 & #5203
+ { GID_SQ1, -1, 927, 0, "PAvoider", "doit", -1, 0, { WORKAROUND_FAKE, 0 } }, // all rooms in Ulence Flats after getting the Pilot Droid: called with a single parameter when the droid is in Roger's path - bug #6016
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kFindKey_workarounds[] = {
- { GID_ECOQUEST2, 100, 999, 0, "myList", "contains", -1, 0, { WORKAROUND_FAKE, 0 } }, // When Noah Greene gives Adam the Ecorder, and just before the game gives a demonstration, a null reference to a list is passed - bug #3035186
- { GID_HOYLE4, 300, 999, 0, "Piles", "contains", -1, 0, { WORKAROUND_FAKE, 0 } }, // When passing the three cards in Hearts, a null reference to a list is passed - bug #3292333
+ { GID_ECOQUEST2, 100, 999, 0, "myList", "contains", -1, 0, { WORKAROUND_FAKE, 0 } }, // When Noah Greene gives Adam the Ecorder, and just before the game gives a demonstration, a null reference to a list is passed - bug #4987
+ { GID_HOYLE4, 300, 999, 0, "Piles", "contains", -1, 0, { WORKAROUND_FAKE, 0 } }, // When passing the three cards in Hearts, a null reference to a list is passed - bug #5664
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -291,18 +291,18 @@ const SciWorkaroundEntry kFindKey_workarounds[] = {
const SciWorkaroundEntry kGraphDrawLine_workarounds[] = {
{ GID_ISLANDBRAIN, 300, 300, 0, "dudeViewer", "show", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when looking at the gene explanation chart, gets called with 1 extra parameter
{ GID_SQ1, 43, 43, 0, "someoneDied", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when ordering beer, gets called with 1 extra parameter
- { GID_SQ1, 71, 71, 0, "destroyXenon", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // during the Xenon destruction cutscene (which results in death), gets called with 1 extra parameter - bug #3040894
- { GID_SQ1, 53, 53, 0, "blastEgo", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when Roger is found and zapped by the cleaning robot, gets called with 1 extra parameter - bug #3040905
+ { GID_SQ1, 71, 71, 0, "destroyXenon", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // during the Xenon destruction cutscene (which results in death), gets called with 1 extra parameter - bug #5176
+ { GID_SQ1, 53, 53, 0, "blastEgo", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when Roger is found and zapped by the cleaning robot, gets called with 1 extra parameter - bug #5177
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kGraphSaveBox_workarounds[] = {
{ GID_CASTLEBRAIN, 420, 427, 0, "alienIcon", "select", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when selecting a card during the alien card game, gets called with 1 extra parameter
- { GID_ISLANDBRAIN, 290, 291, 0, "upElevator", "changeState",0x201f, 0, { WORKAROUND_STILLCALL, 0 } }, // when testing in the elevator puzzle, gets called with 1 argument less - 15 is on stack - bug #3034485
+ { GID_ISLANDBRAIN, 290, 291, 0, "upElevator", "changeState",0x201f, 0, { WORKAROUND_STILLCALL, 0 } }, // when testing in the elevator puzzle, gets called with 1 argument less - 15 is on stack - bug #4943
{ GID_ISLANDBRAIN, 290, 291, 0, "downElevator", "changeState",0x201f, 0, { WORKAROUND_STILLCALL, 0 } }, // see above
{ GID_ISLANDBRAIN, 290, 291, 0, "correctElevator", "changeState",0x201f, 0, { WORKAROUND_STILLCALL, 0 } }, // see above (when testing the correct solution)
- { GID_PQ3, 202, 202, 0, "MapEdit", "movePt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077
+ { GID_PQ3, 202, 202, 0, "MapEdit", "movePt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -332,12 +332,12 @@ const SciWorkaroundEntry kGraphRedrawBox_workarounds[] = {
{ GID_SQ4, 406, 406, 0, "swimAndShoot", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
{ GID_SQ4, 410, 410, 0, "swimAfterEgo", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
{ GID_SQ4, 411, 411, 0, "swimAndShoot", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // skateOrama when "swimming" in the air - accidental additional parameter specified
- { GID_SQ4, 150, 150, 0, "laserScript", "changeState", 0xb2, 0, { WORKAROUND_STILLCALL, 0 } }, // when visiting the pedestral where Roger Jr. is trapped, before trashing the brain icon in the programming chapter, accidental additional parameter specified - bug #3094235
- { GID_SQ4, 150, 150, 0, "laserScript", "changeState", 0x16, 0, { WORKAROUND_STILLCALL, 0 } }, // same as above, for the German version - bug #3116892
+ { GID_SQ4, 150, 150, 0, "laserScript", "changeState", 0xb2, 0, { WORKAROUND_STILLCALL, 0 } }, // when visiting the pedestral where Roger Jr. is trapped, before trashing the brain icon in the programming chapter, accidental additional parameter specified - bug #5479
+ { GID_SQ4, 150, 150, 0, "laserScript", "changeState", 0x16, 0, { WORKAROUND_STILLCALL, 0 } }, // same as above, for the German version - bug #5527
{ GID_SQ4, -1, 704, 0, "shootEgo", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // When shot by Droid in Super Computer Maze (Rooms 500, 505, 510...) - accidental additional parameter specified
- { GID_KQ5, -1, 981, 0, "myWindow", "dispose", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing any dialog box, accidental additional parameter specified - bug #3036331
+ { GID_KQ5, -1, 981, 0, "myWindow", "dispose", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing any dialog box, accidental additional parameter specified - bug #5031
{ GID_KQ5, -1, 995, 0, "invW", "doit", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when closing the inventory window, accidental additional parameter specified
- { GID_KQ5, -1, 995, 0, "", "export 0", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when opening the gem pouch, accidental additional parameter specified - bug #3039395
+ { GID_KQ5, -1, 995, 0, "", "export 0", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the floppy version, when opening the gem pouch, accidental additional parameter specified - bug #5138
{ GID_KQ5, -1, 403, 0, "KQ5Window", "dispose", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // Happens in the FM Towns version when closing any dialog box, accidental additional parameter specified
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -345,49 +345,49 @@ const SciWorkaroundEntry kGraphRedrawBox_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kGraphUpdateBox_workarounds[] = {
{ GID_ECOQUEST2, 100, 333, 0, "showEcorder", "changeState", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // necessary workaround for our ecorder script patch, because there isn't enough space to patch the function
- { GID_PQ3, 202, 202, 0, "MapEdit", "addPt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077
- { GID_PQ3, 202, 202, 0, "MapEdit", "movePt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #3038077
+ { GID_PQ3, 202, 202, 0, "MapEdit", "addPt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
+ { GID_PQ3, 202, 202, 0, "MapEdit", "movePt", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters - bug #5099
{ GID_PQ3, 202, 202, 0, "MapEdit", "dispose", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // when plotting crimes, gets called with 2 extra parameters
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kIsObject_workarounds[] = {
- { GID_GK1, 50, 999, 0, "List", "eachElementDo", -1, 0, { WORKAROUND_FAKE, 0 } }, // GK1 demo, when asking Grace for messages it gets called with an invalid parameter (type "error") - bug #3034519
- { GID_ISLANDBRAIN, -1, 999, 0, "List", "eachElementDo", -1, 0, { WORKAROUND_FAKE, 0 } }, // when going to the game options, choosing "Info" and selecting anything from the list, gets called with an invalid parameter (type "error") - bug #3035262
+ { GID_GK1, 50, 999, 0, "List", "eachElementDo", -1, 0, { WORKAROUND_FAKE, 0 } }, // GK1 demo, when asking Grace for messages it gets called with an invalid parameter (type "error") - bug #4950
+ { GID_ISLANDBRAIN, -1, 999, 0, "List", "eachElementDo", -1, 0, { WORKAROUND_FAKE, 0 } }, // when going to the game options, choosing "Info" and selecting anything from the list, gets called with an invalid parameter (type "error") - bug #4989
{ GID_QFG3, -1, 999, 0, "List", "eachElementDo", -1, 0, { WORKAROUND_FAKE, 0 } }, // when asking for something, gets called with type error parameter
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kMemory_workarounds[] = {
- { GID_LAURABOW2, -1, 999, 0, "", "export 6", -1, 0, { WORKAROUND_FAKE, 0 } }, // during the intro, when exiting the train (room 160), talking to Mr. Augustini, etc. - bug #3034490
- { GID_SQ1, -1, 999, 0, "", "export 6", -1, 0, { WORKAROUND_FAKE, 0 } }, // during walking Roger around Ulence Flats - bug #3513765
+ { GID_LAURABOW2, -1, 999, 0, "", "export 6", -1, 0, { WORKAROUND_FAKE, 0 } }, // during the intro, when exiting the train (room 160), talking to Mr. Augustini, etc. - bug #4944
+ { GID_SQ1, -1, 999, 0, "", "export 6", -1, 0, { WORKAROUND_FAKE, 0 } }, // during walking Roger around Ulence Flats - bug #6017
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kMoveCursor_workarounds[] = {
- { GID_KQ5, -1, 937, 0, "IconBar", "handleEvent", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when pressing escape to open the menu, gets called with one parameter instead of 2 - bug #3156472
+ { GID_KQ5, -1, 937, 0, "IconBar", "handleEvent", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when pressing escape to open the menu, gets called with one parameter instead of 2 - bug #5575
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kNewWindow_workarounds[] = {
- { GID_ECOQUEST, -1, 981, 0, "SysWindow", "open", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // EcoQuest 1 demo uses an in-between interpreter from SCI1 to SCI1.1. It's SCI1.1, but uses the SCI1 semantics for this call - bug #3035057
+ { GID_ECOQUEST, -1, 981, 0, "SysWindow", "open", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // EcoQuest 1 demo uses an in-between interpreter from SCI1 to SCI1.1. It's SCI1.1, but uses the SCI1 semantics for this call - bug #4976
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kReadNumber_workarounds[] = {
- { GID_CNICK_LAURABOW,100, 101, 0, "dominoes.opt", "doit", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #3615120
- { GID_HOYLE3, 100, 101, 0, "dominoes.opt", "doit", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #3615120
+ { GID_CNICK_LAURABOW,100, 101, 0, "dominoes.opt", "doit", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #6425
+ { GID_HOYLE3, 100, 101, 0, "dominoes.opt", "doit", -1, 0, { WORKAROUND_STILLCALL, 0 } }, // When dominoes.opt is present, the game scripts call kReadNumber with an extra integer parameter - bug #6425
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kPaletteUnsetFlag_workarounds[] = {
- { GID_QFG4, 100, 100, 0, "doMovie", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // after the Sierra logo, no flags are passed, thus the call is meaningless - bug #3034506
+ { GID_QFG4, 100, 100, 0, "doMovie", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // after the Sierra logo, no flags are passed, thus the call is meaningless - bug #4947
SCI_WORKAROUNDENTRY_TERMINATOR
};
@@ -400,28 +400,28 @@ const SciWorkaroundEntry kSetCursor_workarounds[] = {
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kSetPort_workarounds[] = {
{ GID_LSL6, 740, 740, 0, "rm740", "drawPic", -1, 0, { WORKAROUND_IGNORE, 0 } }, // ending scene, is called with additional 3 (!) parameters
- { GID_QFG3, 830, 830, 0, "portalOpens", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when the portal appears during the end, gets called with 4 parameters (bug #3040844)
+ { GID_QFG3, 830, 830, 0, "portalOpens", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // when the portal appears during the end, gets called with 4 parameters - bug #5174
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kStrAt_workarounds[] = {
- { GID_CASTLEBRAIN, 220, 220, 0, "robotJokes", "animateOnce", -1, 0, { WORKAROUND_FAKE, 0 } }, // when trying to view the terminal at the end of the maze without having collected any robot jokes - bug #3039036
- { GID_ISLANDBRAIN, 300, 310, 0, "childBreed", "changeState",0x1c7c, 0, { WORKAROUND_FAKE, 0 } }, // when clicking Breed to get the second-generation cyborg hybrid (Standard difficulty), the two parameters are swapped - bug #3037835
+ { GID_CASTLEBRAIN, 220, 220, 0, "robotJokes", "animateOnce", -1, 0, { WORKAROUND_FAKE, 0 } }, // when trying to view the terminal at the end of the maze without having collected any robot jokes - bug #5127
+ { GID_ISLANDBRAIN, 300, 310, 0, "childBreed", "changeState",0x1c7c, 0, { WORKAROUND_FAKE, 0 } }, // when clicking Breed to get the second-generation cyborg hybrid (Standard difficulty), the two parameters are swapped - bug #5088
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kStrLen_workarounds[] = {
- { GID_QFG2, 210, 2, 0, "", "export 21", 0xdeb, 0, { WORKAROUND_FAKE, 0 } }, // When saying something incorrect at the WIT, an integer is passed instead of a reference - bug #3100292
+ { GID_QFG2, 210, 2, 0, "", "export 21", 0xdeb, 0, { WORKAROUND_FAKE, 0 } }, // When saying something incorrect at the WIT, an integer is passed instead of a reference - bug #5489
SCI_WORKAROUNDENTRY_TERMINATOR
};
// gameID, room,script,lvl, object-name, method-name, call,index, workaround
const SciWorkaroundEntry kUnLoad_workarounds[] = {
{ GID_ECOQUEST, 380, 61, 0, "gotIt", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // CD version: after talking to the dolphin the first time, a 3rd parameter is passed by accident
- { GID_ECOQUEST, 380, 69, 0, "lookAtBlackBoard", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // German version, when closing the blackboard closeup in the dolphin room, a 3rd parameter is passed by accident - bug #3098353
- { GID_LAURABOW2, -1, -1, 0, "sCartoon", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: during the intro, a 3rd parameter is passed by accident - bug #3034902
+ { GID_ECOQUEST, 380, 69, 0, "lookAtBlackBoard", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // German version, when closing the blackboard closeup in the dolphin room, a 3rd parameter is passed by accident - bug #5483
+ { GID_LAURABOW2, -1, -1, 0, "sCartoon", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // DEMO: during the intro, a 3rd parameter is passed by accident - bug #4966
{ GID_LSL6, 130, 130, 0, "recruitLarryScr", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during intro, a 3rd parameter is passed by accident
{ GID_LSL6, 740, 740, 0, "showCartoon", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during ending, 4 additional parameters are passed by accident
{ GID_LSL6HIRES, 130, 130, 0, "recruitLarryScr", "changeState", -1, 0, { WORKAROUND_IGNORE, 0 } }, // during intro, a 3rd parameter is passed by accident
@@ -487,7 +487,7 @@ SciWorkaroundSolution trackOriginAndFindWorkaround(int index, const SciWorkaroun
// Special case: in the fanmade Russian translation of SQ4, all
// of the object names have been deleted or renamed to Russian,
- // thus we disable checking of the object name. Fixes bug #3155550.
+ // thus we disable checking of the object name. Fixes bug #5573.
if (g_sci->getLanguage() == Common::RU_RUS && g_sci->getGameId() == GID_SQ4)
objectNameMatches = true;
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index 8ad4f535f9..caab1d80da 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -132,7 +132,7 @@ void GfxPicture::drawSci11Vga() {
_palette->createFromData(inbuffer + palette_data_ptr, size - palette_data_ptr, &palette);
_palette->set(&palette, true);
- drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, 0, 0, 0, 0);
+ drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, 0, 0, 0, 0, false);
}
// process vector data
@@ -224,14 +224,14 @@ void GfxPicture::drawSci32Vga(int16 celNo, int16 drawX, int16 drawY, int16 pictu
cel_RlePos = READ_SCI11ENDIAN_UINT32(inbuffer + cel_headerPos + 24);
cel_LiteralPos = READ_SCI11ENDIAN_UINT32(inbuffer + cel_headerPos + 28);
- drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, drawX, drawY, pictureX, pictureY);
+ drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, drawX, drawY, pictureX, pictureY, false);
cel_headerPos += 42;
}
#endif
extern void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCount, int rlePos, int literalPos, ViewType viewType, uint16 width, bool isMacSci11ViewData);
-void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY) {
+void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY, bool isEGA) {
byte *celBitmap = NULL;
byte *ptr = NULL;
byte *headerPtr = inbuffer + headerPos;
@@ -239,13 +239,17 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
// displaceX, displaceY fields are ignored, and may contain garbage
// (e.g. pic 261 in Dr. Brain 1 Spanish - bug #3614914)
//int16 displaceX, displaceY;
- byte priority = _addToFlag ? _priority : 0;
+ byte priority = _priority;
byte clearColor;
bool compression = true;
byte curByte;
int16 y, lastY, x, leftX, rightX;
int pixelCount;
uint16 width, height;
+
+ // if the picture is not an overlay and we are also not in EGA mode, use priority 0
+ if (!isEGA && !_addToFlag)
+ priority = 0;
#ifdef ENABLE_SCI32
if (_resourceType != SCI_PICTURE_TYPE_SCI32) {
@@ -279,8 +283,6 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
// That needs to be done cause a mirrored picture may be requested
pixelCount = width * height;
celBitmap = new byte[pixelCount];
- if (!celBitmap)
- error("Unable to allocate temporary memory for picture drawing");
if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_2) {
// See GfxView::unpackCel() for why this black/white swap is done
@@ -360,37 +362,78 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
ptr = celBitmap;
ptr += skipCelBitmapPixels;
ptr += skipCelBitmapLines * width;
- if (!_mirroredFlag) {
- // Draw bitmap to screen
- x = leftX;
- while (y < lastY) {
- curByte = *ptr++;
- if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
- _screen->putPixel(x, y, drawMask, curByte, priority, 0);
-
- x++;
-
- if (x >= rightX) {
- ptr += sourcePixelSkipPerRow;
- x = leftX;
- y++;
+
+ if ((!isEGA) || (priority < 16)) {
+ // VGA + EGA, EGA only checks priority, when given priority is below 16
+ if (!_mirroredFlag) {
+ // Draw bitmap to screen
+ x = leftX;
+ while (y < lastY) {
+ curByte = *ptr++;
+ if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
+ _screen->putPixel(x, y, drawMask, curByte, priority, 0);
+
+ x++;
+
+ if (x >= rightX) {
+ ptr += sourcePixelSkipPerRow;
+ x = leftX;
+ y++;
+ }
+ }
+ } else {
+ // Draw bitmap to screen (mirrored)
+ x = rightX - 1;
+ while (y < lastY) {
+ curByte = *ptr++;
+ if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
+ _screen->putPixel(x, y, drawMask, curByte, priority, 0);
+
+ if (x == leftX) {
+ ptr += sourcePixelSkipPerRow;
+ x = rightX;
+ y++;
+ }
+
+ x--;
}
}
} else {
- // Draw bitmap to screen (mirrored)
- x = rightX - 1;
- while (y < lastY) {
- curByte = *ptr++;
- if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
- _screen->putPixel(x, y, drawMask, curByte, priority, 0);
-
- if (x == leftX) {
- ptr += sourcePixelSkipPerRow;
- x = rightX;
- y++;
+ // EGA, when priority is above 15
+ // we don't check priority and also won't set priority at all
+ // fixes picture 48 of kq5 (island overview). Bug #5182
+ if (!_mirroredFlag) {
+ // EGA+priority>15: Draw bitmap to screen
+ x = leftX;
+ while (y < lastY) {
+ curByte = *ptr++;
+ if (curByte != clearColor)
+ _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, curByte, 0, 0);
+
+ x++;
+
+ if (x >= rightX) {
+ ptr += sourcePixelSkipPerRow;
+ x = leftX;
+ y++;
+ }
}
+ } else {
+ // EGA+priority>15: Draw bitmap to screen (mirrored)
+ x = rightX - 1;
+ while (y < lastY) {
+ curByte = *ptr++;
+ if (curByte != clearColor)
+ _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, curByte, 0, 0);
+
+ if (x == leftX) {
+ ptr += sourcePixelSkipPerRow;
+ x = rightX;
+ y++;
+ }
- x--;
+ x--;
+ }
}
}
}
@@ -540,22 +583,6 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {
if ((_screen->isUnditheringEnabled()) && ((_resourceId >= 53 && _resourceId <= 58) || (_resourceId == 61)))
icemanDrawFix = true;
}
- if (g_sci->getGameId() == GID_KQ5) {
- // WORKAROUND: ignore the seemingly broken priority of picture 48
- // (island overview). Fixes bug #3041044.
- if (_resourceId == 48)
- ignoreBrokenPriority = true;
- }
- if (g_sci->getGameId() == GID_SQ4) {
- // WORKAROUND: ignore the seemingly broken priority of pictures 546
- // and 547 (Vohaul's head and Roger Jr trapped). Fixes bug #3046543.
- if (_resourceId == 546 || _resourceId == 547)
- ignoreBrokenPriority = true;
- // WORKAROUND: ignore the seemingly broken priority of picture 631
- // (SQ1 view from the cockpit). Fixes bug #3046513.
- if (_resourceId == 631)
- ignoreBrokenPriority = true;
- }
}
// Drawing
@@ -740,8 +767,15 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {
case PIC_OPX_EGA_EMBEDDED_VIEW:
vectorGetAbsCoordsNoMirror(data, curPos, x, y);
size = READ_LE_UINT16(data + curPos); curPos += 2;
- _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
- drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0);
+ // hardcoded in SSCI, 16 for SCI1early excluding Space Quest 4, 0 for anything else
+ // fixes sq4 pictures 546+547 (Vohaul's head and Roger Jr trapped). Bug #5250
+ // fixes sq4 picture 631 (SQ1 view from cockpit). Bug 5249
+ if ((getSciVersion() <= SCI_VERSION_1_EARLY) && (g_sci->getGameId() != GID_SQ4)) {
+ _priority = 16;
+ } else {
+ _priority = 0;
+ }
+ drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0, true);
curPos += size;
break;
case PIC_OPX_EGA_SET_PRIORITY_TABLE:
@@ -783,8 +817,14 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) {
case PIC_OPX_VGA_EMBEDDED_VIEW: // draw cel
vectorGetAbsCoordsNoMirror(data, curPos, x, y);
size = READ_LE_UINT16(data + curPos); curPos += 2;
- _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
- drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0);
+ if (getSciVersion() <= SCI_VERSION_1_EARLY) {
+ // During SCI1Early sierra always used 0 as priority for cels inside picture resources
+ // fixes Space Quest 4 orange ship lifting off (bug #6446)
+ _priority = 0;
+ } else {
+ _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
+ }
+ drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0, false);
curPos += size;
break;
case PIC_OPX_VGA_PRIORITY_TABLE_EQDIST:
@@ -967,6 +1007,12 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by
_screen->putPixel(--w, p.y, screenMask, color, priority, control);
while (e < r && (matchedMask = _screen->isFillMatch(e + 1, p.y, matchMask, searchColor, searchPriority, searchControl, isEGA)))
_screen->putPixel(++e, p.y, screenMask, color, priority, control);
+#if 0
+ // debug code for floodfill
+ _screen->copyToScreen();
+ g_system->updateScreen();
+ g_system->delayMillis(100);
+#endif
// checking lines above and below for possible flood targets
a_set = b_set = 0;
while (w <= e) {
diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h
index 4f075a6226..53f83bc09f 100644
--- a/engines/sci/graphics/picture.h
+++ b/engines/sci/graphics/picture.h
@@ -65,7 +65,7 @@ private:
void initData(GuiResourceId resourceId);
void reset();
void drawSci11Vga();
- void drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY);
+ void drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY, bool isEGA);
void drawVectorData(byte *data, int size);
bool vectorIsNonOpcode(byte pixel);
void vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16 &y);
diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp
index d5227126e2..d589ee17f9 100644
--- a/engines/sci/graphics/portrait.cpp
+++ b/engines/sci/graphics/portrait.cpp
@@ -21,6 +21,7 @@
*/
#include "common/archive.h"
+#include "common/file.h" // for DumpFile
#include "common/system.h"
#include "sci/sci.h"
@@ -39,6 +40,7 @@ Portrait::Portrait(ResourceManager *resMan, EventManager *event, GfxScreen *scre
}
Portrait::~Portrait() {
+ delete[] _lipSyncDataOffsetTable;
delete[] _bitmaps;
delete[] _fileData;
}
@@ -51,7 +53,7 @@ void Portrait::init() {
// 2 bytes main height (should be the same as first bitmap header height)
// 2 bytes animation count
// 2 bytes unknown
- // 2 bytes unknown
+ // 2 bytes lip sync ID count
// 4 bytes paletteSize (base 1)
// -> 17 bytes
// paletteSize bytes paletteData
@@ -81,6 +83,8 @@ void Portrait::init() {
_width = READ_LE_UINT16(_fileData + 3);
_height = READ_LE_UINT16(_fileData + 5);
_bitmapCount = READ_LE_UINT16(_fileData + 7);
+ _lipSyncIDCount = READ_LE_UINT16(_fileData + 11);
+
_bitmaps = new PortraitBitmap[_bitmapCount];
uint16 portraitPaletteSize = READ_LE_UINT16(_fileData + 13);
@@ -128,17 +132,103 @@ void Portrait::init() {
}
data += offsetTableSize;
- // raw lip-sync data follows
+ // raw lip-sync ID table follows
+ uint32 lipSyncIDTableSize;
+
+ lipSyncIDTableSize = READ_LE_UINT32(data);
+ data += 4;
+ assert( lipSyncIDTableSize == (_lipSyncIDCount * 4) );
+ _lipSyncIDTable = data;
+ data += lipSyncIDTableSize;
+
+ // raw lip-sync frame table follows
+ uint32 lipSyncDataTableSize;
+ uint32 lipSyncDataTableLastOffset;
+ byte lipSyncData;
+ uint16 lipSyncDataNr;
+ uint16 lipSyncCurOffset;
+
+ lipSyncDataTableSize = READ_LE_UINT32(data);
+ data += 4;
+ assert( lipSyncDataTableSize == 0x220 ); // always this size, just a safety-check
+
+ _lipSyncData = data;
+ lipSyncDataTableLastOffset = lipSyncDataTableSize - 1;
+ _lipSyncDataOffsetTable = new uint16[ _lipSyncIDCount ];
+
+ lipSyncDataNr = 0;
+ lipSyncCurOffset = 0;
+ while ( (lipSyncCurOffset < lipSyncDataTableSize) && (lipSyncDataNr < _lipSyncIDCount) ) {
+ // We are currently at the start of ID-frame data
+ _lipSyncDataOffsetTable[lipSyncDataNr] = lipSyncCurOffset;
+
+ // Look for end of ID-frame data
+ lipSyncData = *data++; lipSyncCurOffset++;
+ while ( (lipSyncData != 0xFF) && (lipSyncCurOffset < lipSyncDataTableLastOffset) ) {
+ // Either terminator (0xFF) or frame-data (1 byte tick count and 1 byte bitmap ID)
+ data++;
+ lipSyncData = *data++;
+ lipSyncCurOffset += 2;
+ }
+ lipSyncDataNr++;
+ }
+ _lipSyncDataOffsetTableEnd = data;
+ // last 4 bytes seem to be garbage
}
+// use this to print out kPortrait debug data
+//#define DEBUG_PORTRAIT
+// use this to use sync resources instead of rave resources (rave resources are better though)
+//#define DEBUG_PORTRAIT_USE_SYNC_RESOURCES
+
void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) {
_position = position;
// Now init audio and sync resource
uint32 audioNumber = ((noun & 0xff) << 24) | ((verb & 0xff) << 16) | ((cond & 0xff) << 8) | (seq & 0xff);
+#ifndef DEBUG_PORTRAIT_USE_SYNC_RESOURCES
+ ResourceId raveResourceId = ResourceId(kResourceTypeRave, resourceId, noun, verb, cond, seq);
+ Resource *raveResource = _resMan->findResource(raveResourceId, true);
+ uint raveOffset = 0;
+#else
ResourceId syncResourceId = ResourceId(kResourceTypeSync36, resourceId, noun, verb, cond, seq);
Resource *syncResource = _resMan->findResource(syncResourceId, true);
uint syncOffset = 0;
+#endif
+
+#ifdef DEBUG_PORTRAIT
+ // prints out the current lip sync ASCII data
+ char debugPrint[4000];
+ if (raveResource->size < 4000) {
+ memcpy(debugPrint, raveResource->data, raveResource->size);
+ debugPrint[raveResource->size] = 0; // set terminating NUL
+ debug("kPortrait (noun %d, verb %d, cond %d, seq %d)", noun, verb, cond, seq);
+ debug("kPortrait: %s", debugPrint);
+ }
+#endif
+
+ // TODO: maybe try to create the missing sync resources for low-res KQ6 out of the rave resources
+
+#ifdef DEBUG_PORTRAIT_USE_SYNC_RESOURCES
+ // Dump the sync resources to disk
+ Common::DumpFile *outFile = new Common::DumpFile();
+ Common::String outName = syncResourceId.toPatchNameBase36() + ".sync36";
+ outFile->open(outName);
+ syncResource->writeToStream(outFile);
+ outFile->finalize();
+ outFile->close();
+
+ ResourceId raveResourceId = ResourceId(kResourceTypeRave, resourceId, noun, verb, cond, seq);
+ Resource *raveResource = _resMan->findResource(raveResourceId, true);
+ outName = raveResourceId.toPatchNameBase36() + ".rave";
+ outFile->open(outName);
+ raveResource->writeToStream(outFile);
+ outFile->finalize();
+ outFile->close();
+ _resMan->unlockResource(raveResource);
+
+ delete outFile;
+#endif
// Set the portrait palette
_palette->set(&_portraitPalette, false, true);
@@ -151,6 +241,90 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
_audio->stopAudio();
_audio->startAudio(resourceId, audioNumber);
+#ifndef DEBUG_PORTRAIT_USE_SYNC_RESOURCES
+ if (!raveResource) {
+ warning("kPortrait: no rave resource %d %X", resourceId, audioNumber);
+ return;
+ }
+
+ // Do animation depending on rave resource till audio is done playing
+ int16 raveTicks;
+ uint16 raveID;
+ byte *raveLipSyncData;
+ byte raveLipSyncTicks;
+ byte raveLipSyncBitmapNr;
+ int timerPosition = 0;
+ int timerPositionWithin = 0;
+ int curPosition;
+ SciEvent curEvent;
+ bool userAbort = false;
+
+ while ((raveOffset < raveResource->size) && (!userAbort)) {
+ // rave string starts with tick count, followed by lipSyncID, tick count and so on
+ raveTicks = raveGetTicks(raveResource, &raveOffset);
+ if (raveTicks < 0)
+ break;
+
+ // get lipSyncID
+ raveID = raveGetID(raveResource, &raveOffset);
+ if (raveID) {
+ raveLipSyncData = raveGetLipSyncData(raveID);
+ } else {
+ raveLipSyncData = NULL;
+ }
+
+ timerPosition += raveTicks;
+
+ // Wait till syncTime passed, then show specific animation bitmap
+ if (timerPosition > 0) {
+ do {
+ g_sci->getEngineState()->wait(1);
+ curEvent = _event->getSciEvent(SCI_EVENT_ANY);
+ if (curEvent.type == SCI_EVENT_MOUSE_PRESS ||
+ (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) ||
+ g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame)
+ userAbort = true;
+ curPosition = _audio->getAudioPosition();
+ } while ((curPosition != -1) && (curPosition < timerPosition) && (!userAbort));
+ }
+
+ if (raveLipSyncData) {
+ // lip sync data is
+ // Tick:Byte, Bitmap-Nr:BYTE
+ // Tick = 0xFF is the terminator for the data
+ timerPositionWithin = timerPosition;
+ raveLipSyncTicks = *raveLipSyncData++;
+ while ( (raveLipSyncData < _lipSyncDataOffsetTableEnd) && (raveLipSyncTicks != 0xFF) ) {
+ timerPositionWithin += raveLipSyncTicks;
+
+ do {
+ g_sci->getEngineState()->wait(1);
+ curEvent = _event->getSciEvent(SCI_EVENT_ANY);
+ if (curEvent.type == SCI_EVENT_MOUSE_PRESS ||
+ (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) ||
+ g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame)
+ userAbort = true;
+ curPosition = _audio->getAudioPosition();
+ } while ((curPosition != -1) && (curPosition < timerPositionWithin) && (!userAbort));
+
+ raveLipSyncBitmapNr = *raveLipSyncData++;
+
+ // bitmap nr within sync data is base 1, we need base 0
+ raveLipSyncBitmapNr--;
+
+ if (raveLipSyncBitmapNr < _bitmapCount) {
+ drawBitmap(0);
+ drawBitmap(raveLipSyncBitmapNr);
+ bitsShow();
+ } else {
+ warning("kPortrait: rave lip sync data tried to draw non-existent bitmap %d", raveLipSyncBitmapNr);
+ }
+
+ raveLipSyncTicks = *raveLipSyncData++;
+ }
+ }
+ }
+#else
if (!syncResource) {
// Getting the book in the book shop calls kPortrait where no sync exists
// TODO: find out what to do then
@@ -197,15 +371,90 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint
}
}
}
-
+#endif
+
+ // Reset the portrait bitmap to "closed mouth" state (rave.dll seems to do the same)
+ drawBitmap(0);
+ bitsShow();
if (userAbort) {
- // Reset the portrait bitmap to "closed mouth" state, when skipping dialogs
- drawBitmap(0);
- bitsShow();
_audio->stopAudio();
}
+#ifndef DEBUG_PORTRAIT_USE_SYNC_RESOURCES
+ _resMan->unlockResource(raveResource);
+#else
_resMan->unlockResource(syncResource);
+#endif
+}
+
+// returns ASCII ticks from lip sync string as uint16
+int16 Portrait::raveGetTicks(Resource *resource, uint *offset) {
+ uint curOffset = *offset;
+ byte *curData = resource->data + curOffset;
+ byte curByte;
+ uint16 curValue = 0;
+
+ if (curOffset >= resource->size)
+ return -1;
+
+ while (curOffset < resource->size) {
+ curByte = *curData++; curOffset++;
+ if ( curByte == ' ' )
+ break;
+ if ( (curByte >= '0') && (curByte <= '9') ) {
+ curValue = curValue * 10 + ( curByte - '0' );
+ } else {
+ // no number -> assume there is an ID at current offset
+ return 0;
+ }
+ }
+ *offset = curOffset;
+ return curValue;
+}
+
+// returns ASCII ID from lip sync string as uint16
+uint16 Portrait::raveGetID(Resource *resource, uint *offset) {
+ uint curOffset = *offset;
+ byte *curData = resource->data + curOffset;
+ byte curByte = 0;
+ uint16 curValue = 0;
+
+ while (curOffset < resource->size) {
+ curByte = *curData++; curOffset++;
+ if ( curByte == ' ' )
+ break;
+ if (!curValue) {
+ curValue = curByte << 8;
+ } else {
+ curValue |= curByte;
+ }
+ }
+
+ *offset = curOffset;
+ return curValue;
+}
+
+// Searches for a specific lip sync ID and returns pointer to lip sync data or NULL in case ID was not found
+byte *Portrait::raveGetLipSyncData(uint16 raveID) {
+ uint lipSyncIDNr = 0;
+ byte *lipSyncIDPtr = _lipSyncIDTable;
+ byte lipSyncIDByte1, lipSyncIDByte2;
+ uint16 lipSyncID;
+
+ lipSyncIDPtr++; // skip over first byte
+ while (lipSyncIDNr < _lipSyncIDCount) {
+ lipSyncIDByte1 = *lipSyncIDPtr++;
+ lipSyncIDByte2 = *lipSyncIDPtr++;
+ lipSyncID = ( lipSyncIDByte1 << 8 ) | lipSyncIDByte2;
+
+ if ( lipSyncID == raveID ) {
+ return _lipSyncData + _lipSyncDataOffsetTable[lipSyncIDNr];
+ }
+
+ lipSyncIDNr++;
+ lipSyncIDPtr += 2; // ID is every 4 bytes
+ }
+ return NULL;
}
void Portrait::drawBitmap(uint16 bitmapNr) {
diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h
index 75baa9a56b..de0dbffb3f 100644
--- a/engines/sci/graphics/portrait.h
+++ b/engines/sci/graphics/portrait.h
@@ -52,6 +52,10 @@ private:
void drawBitmap(uint16 bitmapNr);
void bitsShow();
+ int16 raveGetTicks(Resource *resource, uint *offset);
+ uint16 raveGetID(Resource *resource, uint *offset);
+ byte *raveGetLipSyncData(uint16 raveID);
+
ResourceManager *_resMan;
EventManager *_event;
GfxPalette *_palette;
@@ -68,6 +72,13 @@ private:
Common::String _resourceName;
byte *_fileData;
+
+ uint32 _lipSyncIDCount;
+ byte *_lipSyncIDTable;
+
+ byte *_lipSyncData;
+ uint16 *_lipSyncDataOffsetTable;
+ byte *_lipSyncDataOffsetTableEnd;
Common::Point _position;
};
diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp
index 6d9dc03195..ed0013b491 100644
--- a/engines/sci/graphics/ports.cpp
+++ b/engines/sci/graphics/ports.cpp
@@ -300,11 +300,6 @@ Window *GfxPorts::addWindow(const Common::Rect &dims, const Common::Rect *restor
Window *pwnd = new Window(id);
Common::Rect r;
- if (!pwnd) {
- error("Can't open window");
- return 0;
- }
-
_windowsById[id] = pwnd;
// KQ1sci, KQ4, iceman, QfG2 always add windows to the back of the list.
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 36aaae9232..3d72743ff4 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -55,6 +55,56 @@ static const byte EGAmappingStraight[SCI_VIEW_EGAMAPPING_SIZE] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
+static const byte ViewInject_LauraBow2_Dual[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x37,0x37,0x37,0x37,0x00,0x00,0x37,0x37,0x00,0x00,0x37,0x37,0x00,0x00,0x00,0x37,0x37,0x37,0x00,0x00,0x37,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x08,0x08,0x08,0x37,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x08,0x08,0x37,0x00,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x33,0x32,0x37,0x08,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x32,0x33,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x33,0x37,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x08,0x08,0x08,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x32,0x33,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x33,0x37,0x37,0x08,0x32,0x37,0x08,0x33,0x37,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x33,0x37,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x08,0x08,0x08,0x32,0x00,0x00,0x37,0x08,0x08,0x08,0x32,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x08,0x08,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x32,0x32,0x32,0x00,0x00,0x00,0x00,0x32,0x32,0x32,0x00,0x00,0x00,0x32,0x32,0x00,0x00,0x32,0x32,0x00,0x32,0x32,0x32,0x32,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
+};
+
+static const byte ViewInject_KingsQuest6_Dual1[] = {
+ 0x17,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x13,
+ 0x17,0x17,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x13,0x11,
+ 0x16,0x17,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x17,0x16,0x16,0x16,0x16,0x13,0x13,0x17,0x16,0x13,0x13,0x17,0x16,0x13,0x13,0x13,0x17,0x16,0x16,0x13,0x13,0x17,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x10,0x10,0x10,0x16,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x10,0x10,0x16,0x13,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x11,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x11,0x13,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x13,0x16,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x10,0x10,0x10,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x11,0x13,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x13,0x16,0x16,0x10,0x11,0x16,0x10,0x13,0x16,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x13,0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x10,0x10,0x10,0x11,0x11,0x13,0x16,0x10,0x10,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x10,0x10,0x10,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x11,0x11,0x11,0x13,0x13,0x13,0x11,0x11,0x13,0x13,0x11,0x11,0x13,0x11,0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,
+ 0x16,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
+ 0x13,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x11
+};
+
+static const byte ViewInject_KingsQuest6_Dual2[] = {
+ 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+ 0x10,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x10,
+ 0x10,0x13,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x16,0x13,0x13,0x13,0x13,0x11,0x11,0x16,0x13,0x11,0x11,0x16,0x13,0x11,0x11,0x11,0x16,0x13,0x13,0x11,0x11,0x16,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x16,0x16,0x16,0x13,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x16,0x16,0x13,0x11,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x10,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x10,0x11,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x11,0x13,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x16,0x16,0x16,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x10,0x11,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x11,0x13,0x13,0x16,0x10,0x13,0x16,0x11,0x13,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x11,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x16,0x16,0x16,0x10,0x10,0x11,0x13,0x16,0x16,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x16,0x16,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x10,0x10,0x10,0x11,0x11,0x11,0x10,0x10,0x11,0x11,0x10,0x10,0x11,0x10,0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,
+ 0x10,0x11,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
+ 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10
+};
+
void GfxView::initData(GuiResourceId resourceId) {
_resource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), true);
if (!_resource) {
@@ -316,6 +366,68 @@ void GfxView::initData(GuiResourceId resourceId) {
default:
error("ViewType was not detected, can't continue");
}
+
+ // Inject our own views
+ // Currently only used for Dual mode (speech + text) for games, that do not have a "dual" icon already
+ // Which is Laura Bow 2 + King's Quest 6
+ switch (g_sci->getGameId()) {
+ case GID_LAURABOW2:
+ // View 995, Loop 13, Cel 0 = "TEXT"
+ // View 995, Loop 13, Cel 1 = "SPEECH"
+ // View 995, Loop 13, Cel 2 = "DUAL" (<- our injected view)
+ if ((g_sci->isCD()) && (resourceId == 995)) {
+ // security checks
+ if (_loopCount >= 14) {
+ if ((_loop[13].celCount == 2) && (_loop[13].cel[0].width == 46) && (_loop[13].cel[0].height == 11)) {
+ // copy current cels over
+ CelInfo *newCels = new CelInfo[3];
+ memcpy(newCels, _loop[13].cel, sizeof(CelInfo) * 2);
+ delete[] _loop[13].cel;
+ _loop[13].celCount++;
+ _loop[13].cel = newCels;
+ // Duplicate cel 0 to cel 2
+ memcpy(&_loop[13].cel[2], &_loop[13].cel[0], sizeof(CelInfo));
+ // copy over our data (which is uncompressed bitmap data)
+ _loop[13].cel[2].rawBitmap = new byte[sizeof(ViewInject_LauraBow2_Dual)];
+ memcpy(_loop[13].cel[2].rawBitmap, ViewInject_LauraBow2_Dual, sizeof(ViewInject_LauraBow2_Dual));
+ }
+ }
+ }
+ break;
+ case GID_KQ6:
+ // View 947, Loop 8, Cel 0 = "SPEECH" (not pressed)
+ // View 947, Loop 8, Cel 1 = "SPEECH" (pressed)
+ // View 947, Loop 9, Cel 0 = "TEXT" (not pressed)
+ // View 947, Loop 9, Cel 1 = "TEXT" (pressed)
+ // View 947, Loop 12, Cel 0 = "DUAL" (not pressed) (<- our injected view)
+ // View 947, Loop 12, Cel 1 = "DUAL" (pressed) (<- our injected view)
+ if ((g_sci->isCD()) && (resourceId == 947)) {
+ // security checks
+ if (_loopCount == 12) {
+ if ((_loop[8].celCount == 2) && (_loop[8].cel[0].width == 50) && (_loop[8].cel[0].height == 15)) {
+ // add another loop
+ LoopInfo *newLoops = new LoopInfo[_loopCount + 1];
+ memcpy(newLoops, _loop, sizeof(LoopInfo) * _loopCount);
+ delete[] _loop;
+ _loop = newLoops;
+ _loopCount++;
+ // copy loop 8 to loop 12
+ memcpy(&_loop[12], &_loop[8], sizeof(LoopInfo));
+ _loop[12].cel = new CelInfo[2];
+ // duplicate all cels of loop 8 and into loop 12
+ memcpy(_loop[12].cel, _loop[8].cel, sizeof(CelInfo) * _loop[8].celCount);
+ // copy over our data (which is uncompressed bitmap data)
+ _loop[12].cel[0].rawBitmap = new byte[sizeof(ViewInject_KingsQuest6_Dual1)];
+ memcpy(_loop[12].cel[0].rawBitmap, ViewInject_KingsQuest6_Dual1, sizeof(ViewInject_KingsQuest6_Dual1));
+ _loop[12].cel[1].rawBitmap = new byte[sizeof(ViewInject_KingsQuest6_Dual2)];
+ memcpy(_loop[12].cel[1].rawBitmap, ViewInject_KingsQuest6_Dual2, sizeof(ViewInject_KingsQuest6_Dual2));
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
GuiResourceId GfxView::getResourceId() const {
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index d14c965ebb..52155cd09a 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -112,11 +112,12 @@ static const char *const s_resourceTypeNames[] = {
"audio", "sync", "message", "map", "heap",
"audio36", "sync36", "xlate", "robot", "vmd",
"chunk", "animation", "etc", "duck", "clut",
- "tga", "zzz", "macibin", "macibis", "macpict"
+ "tga", "zzz", "macibin", "macibis", "macpict",
+ "rave"
};
// Resource type suffixes. Note that the
-// suffic of SCI3 scripts has been changed from
+// suffix of SCI3 scripts has been changed from
// scr to csc
static const char *const s_resourceTypeSuffixes[] = {
"v56", "p56", "scr", "tex", "snd",
@@ -125,7 +126,7 @@ static const char *const s_resourceTypeSuffixes[] = {
"msg", "map", "hep", "", "",
"trn", "rbt", "vmd", "chk", "",
"etc", "duk", "clu", "tga", "zzz",
- "", "", ""
+ "", "", "", ""
};
const char *getResourceTypeName(ResourceType restype) {
@@ -141,7 +142,7 @@ static const ResourceType s_resTypeMapSci0[] = {
kResourceTypeCursor, kResourceTypePatch, kResourceTypeBitmap, kResourceTypePalette, // 0x08-0x0B
kResourceTypeCdAudio, kResourceTypeAudio, kResourceTypeSync, kResourceTypeMessage, // 0x0C-0x0F
kResourceTypeMap, kResourceTypeHeap, kResourceTypeAudio36, kResourceTypeSync36, // 0x10-0x13
- kResourceTypeTranslation // 0x14
+ kResourceTypeTranslation, kResourceTypeRave // 0x14
};
// TODO: 12 should be "Wave", but SCI seems to just store it in Audio resources
@@ -207,7 +208,7 @@ void Resource::unalloc() {
}
void Resource::writeToStream(Common::WriteStream *stream) const {
- stream->writeByte(getType() | 0x80); // 0x80 is required by old sierra sci, otherwise it wont accept the patch file
+ stream->writeByte(getType() | 0x80); // 0x80 is required by old Sierra SCI, otherwise it wont accept the patch file
stream->writeByte(_headerSize);
if (_headerSize > 0)
stream->write(_header, _headerSize);
@@ -383,42 +384,13 @@ void PatchResourceSource::loadResource(ResourceManager *resMan, Resource *res) {
static Common::Array<uint32> resTypeToMacTags(ResourceType type);
-static Common::String intToBase36(uint32 number, int minChar) {
- // Convert from an integer to a base36 string
- Common::String string;
-
- while (minChar--) {
- int character = number % 36;
- string = ((character < 10) ? (character + '0') : (character + 'A' - 10)) + string;
- number /= 36;
- }
-
- return string;
-}
-
-static Common::String constructPatchNameBase36(ResourceId resId) {
- // Convert from a resource ID to a base36 patch name
- Common::String output;
-
- output += (resId.getType() == kResourceTypeAudio36) ? '@' : '#'; // Identifier
- output += intToBase36(resId.getNumber(), 3); // Map
- output += intToBase36(resId.getTuple() >> 24, 2); // Noun
- output += intToBase36((resId.getTuple() >> 16) & 0xff, 2); // Verb
- output += '.'; // Separator
- output += intToBase36((resId.getTuple() >> 8) & 0xff, 2); // Cond
- output += intToBase36(resId.getTuple() & 0xff, 1); // Seq
-
- assert(output.size() == 12); // We should always get 12 characters in the end
- return output;
-}
-
void MacResourceForkResourceSource::loadResource(ResourceManager *resMan, Resource *res) {
ResourceType type = res->getType();
Common::SeekableReadStream *stream = 0;
if (type == kResourceTypeAudio36 || type == kResourceTypeSync36) {
// Handle audio36/sync36, convert back to audio/sync
- stream = _macResMan->getResource(constructPatchNameBase36(res->_id));
+ stream = _macResMan->getResource(res->_id.toPatchNameBase36());
} else {
// Plain resource handling
Common::Array<uint32> tagArray = resTypeToMacTags(type);
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 4baf39c67f..6a22f48086 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -112,6 +112,8 @@ enum ResourceType {
kResourceTypeMacIconBarPictS, // IBIS resources (icon bar, selected)
kResourceTypeMacPict, // PICT resources (inventory)
+ kResourceTypeRave, // KQ6 hires RAVE (special sync) resources
+
kResourceTypeInvalid
};
@@ -143,6 +145,19 @@ class ResourceId {
uint16 _number;
uint32 _tuple; // Only used for audio36 and sync36
+ static Common::String intToBase36(uint32 number, int minChar) {
+ // Convert from an integer to a base36 string
+ Common::String string;
+
+ while (minChar--) {
+ int character = number % 36;
+ string = ((character < 10) ? (character + '0') : (character + 'A' - 10)) + string;
+ number /= 36;
+ }
+
+ return string;
+ }
+
public:
ResourceId() : _type(kResourceTypeInvalid), _number(0), _tuple(0) { }
@@ -169,6 +184,22 @@ public:
return retStr;
}
+ // Convert from a resource ID to a base36 patch name
+ Common::String toPatchNameBase36() {
+ Common::String output;
+
+ output += (getType() == kResourceTypeAudio36) ? '@' : '#'; // Identifier
+ output += intToBase36(getNumber(), 3); // Map
+ output += intToBase36(getTuple() >> 24, 2); // Noun
+ output += intToBase36((getTuple() >> 16) & 0xff, 2); // Verb
+ output += '.'; // Separator
+ output += intToBase36((getTuple() >> 8) & 0xff, 2); // Cond
+ output += intToBase36(getTuple() & 0xff, 1); // Seq
+
+ assert(output.size() == 12); // We should always get 12 characters in the end
+ return output;
+ }
+
inline ResourceType getType() const { return _type; }
inline uint16 getNumber() const { return _number; }
inline uint32 getTuple() const { return _tuple; }
@@ -498,7 +529,7 @@ protected:
void readWaveAudioPatches();
void processWavePatch(ResourceId resourceId, Common::String name);
- /**
+ /**
* Applies to all versions before 0.000.395 (i.e. KQ4 old, XMAS 1988 and LSL2).
* Old SCI versions used two word header for script blocks (first word equal
* to 0x82, meaning of the second one unknown). New SCI versions used one
@@ -523,6 +554,7 @@ class SoundResource {
public:
struct Channel {
byte number;
+ byte flags;
byte poly;
uint16 prio;
uint16 size;
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 744f05f2b9..8e1568f564 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -101,32 +101,34 @@ bool Resource::loadFromAudioVolumeSCI11(Common::SeekableReadStream *file) {
}
file->seek(-4, SEEK_CUR);
- ResourceType type = _resMan->convertResType(file->readByte());
- if (((getType() == kResourceTypeAudio || getType() == kResourceTypeAudio36) && (type != kResourceTypeAudio))
- || ((getType() == kResourceTypeSync || getType() == kResourceTypeSync36) && (type != kResourceTypeSync))) {
- warning("Resource type mismatch loading %s", _id.toString().c_str());
- unalloc();
- return false;
- }
-
- _headerSize = file->readByte();
-
- if (type == kResourceTypeAudio) {
- if (_headerSize != 7 && _headerSize != 11 && _headerSize != 12) {
- warning("Unsupported audio header");
+ // Rave-resources (King's Quest 6) don't have any header at all
+ if (getType() != kResourceTypeRave) {
+ ResourceType type = _resMan->convertResType(file->readByte());
+ if (((getType() == kResourceTypeAudio || getType() == kResourceTypeAudio36) && (type != kResourceTypeAudio))
+ || ((getType() == kResourceTypeSync || getType() == kResourceTypeSync36) && (type != kResourceTypeSync))) {
+ warning("Resource type mismatch loading %s", _id.toString().c_str());
unalloc();
return false;
}
+
+ _headerSize = file->readByte();
+
+ if (type == kResourceTypeAudio) {
+ if (_headerSize != 7 && _headerSize != 11 && _headerSize != 12) {
+ warning("Unsupported audio header");
+ unalloc();
+ return false;
+ }
- if (_headerSize != 7) { // Size is defined already from the map
- // Load sample size
- file->seek(7, SEEK_CUR);
- size = file->readUint32LE();
- // Adjust offset to point at the header data again
- file->seek(-11, SEEK_CUR);
+ if (_headerSize != 7) { // Size is defined already from the map
+ // Load sample size
+ file->seek(7, SEEK_CUR);
+ size = file->readUint32LE();
+ // Adjust offset to point at the header data again
+ file->seek(-11, SEEK_CUR);
+ }
}
}
-
return loadPatch(file);
}
@@ -395,15 +397,22 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) {
syncSize = READ_LE_UINT16(ptr);
ptr += 2;
+ // FIXME: The sync36 resource seems to be two bytes too big in KQ6CD
+ // (bytes taken from the RAVE resource right after it)
if (syncSize > 0)
addResource(ResourceId(kResourceTypeSync36, map->_volumeNumber, n & 0xffffff3f), src, offset, syncSize);
}
if (n & 0x40) {
// This seems to define the size of raw lipsync data (at least
- // in kq6), may also just be general appended data.
- syncSize += READ_LE_UINT16(ptr);
+ // in KQ6 CD Windows).
+ int kq6HiresSyncSize = READ_LE_UINT16(ptr);
ptr += 2;
+
+ if (kq6HiresSyncSize > 0) {
+ addResource(ResourceId(kResourceTypeRave, map->_volumeNumber, n & 0xffffff3f), src, offset + syncSize, kq6HiresSyncSize);
+ syncSize += kq6HiresSyncSize;
+ }
}
addResource(ResourceId(kResourceTypeAudio36, map->_volumeNumber, n & 0xffffff3f), src, offset + syncSize);
@@ -590,6 +599,7 @@ SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVers
_tracks->channels = new Channel[_tracks->channelCount];
memset(_tracks->channels, 0, sizeof(Channel) * _tracks->channelCount);
channel = &_tracks->channels[0];
+ channel->flags |= 2; // don't remap (SCI0 doesn't have remapping)
if (_soundVersion == SCI_VERSION_0_EARLY) {
channel->data = resource->data + 0x11;
channel->size = resource->size - 0x11;
@@ -667,33 +677,52 @@ SoundResource::SoundResource(uint32 resourceNr, ResourceManager *resMan, SciVers
channelNr = 0;
while (channelCount--) {
channel = &_tracks[trackNr].channels[channelNr];
- channel->prio = READ_LE_UINT16(data);
uint dataOffset = READ_LE_UINT16(data + 2);
- if (dataOffset < resource->size) {
- channel->data = resource->data + dataOffset;
- channel->size = READ_LE_UINT16(data + 4);
- channel->curPos = 0;
- // FIXME: number contains (low nibble) channel and (high nibble) flags
- // 0x20 is set on rhythm channels to prevent remapping
- channel->number = *channel->data;
- channel->poly = *(channel->data + 1);
- channel->time = channel->prev = 0;
- channel->data += 2; // skip over header
- channel->size -= 2; // remove header size
- if (channel->number == 0xFE) { // Digital channel
- _tracks[trackNr].digitalChannelNr = channelNr;
- _tracks[trackNr].digitalSampleRate = READ_LE_UINT16(channel->data);
- _tracks[trackNr].digitalSampleSize = READ_LE_UINT16(channel->data + 2);
- _tracks[trackNr].digitalSampleStart = READ_LE_UINT16(channel->data + 4);
- _tracks[trackNr].digitalSampleEnd = READ_LE_UINT16(channel->data + 6);
- channel->data += 8; // Skip over header
- channel->size -= 8;
- }
- _tracks[trackNr].channelCount++;
- channelNr++;
- } else {
+
+ if (dataOffset >= resource->size) {
warning("Invalid offset inside sound resource %d: track %d, channel %d", resourceNr, trackNr, channelNr);
+ data += 6;
+ continue;
+ }
+
+ channel->data = resource->data + dataOffset;
+ channel->size = READ_LE_UINT16(data + 4);
+ channel->curPos = 0;
+ channel->number = *channel->data;
+
+ channel->poly = *(channel->data + 1) & 0x0F;
+ channel->prio = *(channel->data + 1) >> 4;
+ channel->time = channel->prev = 0;
+ channel->data += 2; // skip over header
+ channel->size -= 2; // remove header size
+ if (channel->number == 0xFE) { // Digital channel
+ _tracks[trackNr].digitalChannelNr = channelNr;
+ _tracks[trackNr].digitalSampleRate = READ_LE_UINT16(channel->data);
+ _tracks[trackNr].digitalSampleSize = READ_LE_UINT16(channel->data + 2);
+ _tracks[trackNr].digitalSampleStart = READ_LE_UINT16(channel->data + 4);
+ _tracks[trackNr].digitalSampleEnd = READ_LE_UINT16(channel->data + 6);
+ channel->data += 8; // Skip over header
+ channel->size -= 8;
+ channel->flags = 0;
+ } else {
+ channel->flags = channel->number >> 4;
+ channel->number = channel->number & 0x0F;
+
+ // 0x20 is set on rhythm channels to prevent remapping
+ // CHECKME: Which SCI versions need that set manually?
+ channel->flags = (*channel->data) >> 4;
+ if (channel->number == 9)
+ channel->flags |= 2;
+ // Note: flag 1: channel start offset is 0 instead of 10
+ // (currently: everything 0)
+ // also: don't map the channel to device
+ // flag 2: don't remap
+ // flag 4: start muted
+ // QfG2 lacks flags 2 and 4, and uses (flags >= 1) as
+ // the condition for starting offset 0, without the "don't map"
}
+ _tracks[trackNr].channelCount++;
+ channelNr++;
data += 6;
}
} else {
@@ -856,6 +885,7 @@ void AudioVolumeResourceSource::loadResource(ResourceManager *resMan, Resource *
switch (res->getType()) {
case kResourceTypeSync:
case kResourceTypeSync36:
+ case kResourceTypeRave:
// we should already have a (valid) size
break;
default:
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 065565d8de..f32e0e16f9 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -38,6 +38,7 @@
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
#include "sci/engine/script.h" // for script_adjust_opcode_formats
+#include "sci/engine/script_patches.h"
#include "sci/engine/selector.h" // for SELECTOR
#include "sci/sound/audio.h"
@@ -136,7 +137,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc, SciGameId gam
SearchMan.addSubDirectoryMatching(gameDataDir, "duk"); // Duck movie files in Phantasmagoria 2
SearchMan.addSubDirectoryMatching(gameDataDir, "Robot Folder"); // Mac robot files
SearchMan.addSubDirectoryMatching(gameDataDir, "Sound Folder"); // Mac audio files
- SearchMan.addSubDirectoryMatching(gameDataDir, "Voices Folder"); // Mac audio36 files
+ SearchMan.addSubDirectoryMatching(gameDataDir, "Voices Folder", 0, 2, true); // Mac audio36 files (recursive for Torin)
SearchMan.addSubDirectoryMatching(gameDataDir, "Voices"); // Mac audio36 files
SearchMan.addSubDirectoryMatching(gameDataDir, "VMD Folder"); // Mac VMD files
@@ -184,6 +185,7 @@ SciEngine::~SciEngine() {
delete[] _opcode_formats;
+ delete _scriptPatcher;
delete _resMan; // should be deleted last
g_sci = 0;
}
@@ -217,8 +219,9 @@ Common::Error SciEngine::run() {
// Add the after market GM patches for the specified game, if they exist
_resMan->addNewGMPatch(_gameId);
_gameObjectAddress = _resMan->findGameObject();
-
- SegManager *segMan = new SegManager(_resMan);
+
+ _scriptPatcher = new ScriptPatcher();
+ SegManager *segMan = new SegManager(_resMan, _scriptPatcher);
// Initialize the game screen
_gfxScreen = new GfxScreen(_resMan);
@@ -883,12 +886,12 @@ void SciEngine::syncSoundSettings() {
}
}
-// used by Script Patcher. Used to find out, if Laura Bow 2 needs patching for Speech+Subtitles - or not
+// used by Script Patcher. Used to find out, if Laura Bow 2/King's Quest 6 need patching for Speech+Subtitles - or not
bool SciEngine::speechAndSubtitlesEnabled() {
bool subtitlesOn = ConfMan.getBool("subtitles");
bool speechOn = !ConfMan.getBool("speech_mute");
- if (subtitlesOn && speechOn)
+ if (isCD() && subtitlesOn && speechOn)
return true;
return false;
}
@@ -910,13 +913,10 @@ void SciEngine::syncIngameAudioOptions() {
case GID_FREDDYPHARKAS:
case GID_ECOQUEST:
case GID_LSL6:
- // TODO: The following need script patches for simultaneous speech and subtitles
- // GID_KQ6
+ case GID_LAURABOW2:
+ case GID_KQ6:
_gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles
break;
- case GID_LAURABOW2:
- // Laura Bow 2 gets patched when speech and subtitles are enabled
- // It then does both, when the user has "speech" selected. That's why we select speech here
default:
// Game does not support speech and subtitles, set it to speech
_gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
@@ -930,8 +930,6 @@ void SciEngine::updateScummVMAudioOptions() {
// depending on the in-game settings
if (isCD() && getSciVersion() == SCI_VERSION_1_1) {
uint16 ingameSetting = _gamestate->variables[VAR_GLOBAL][90].getOffset();
- bool subtitlesOn = ConfMan.getBool("subtitles");
- bool speechOn = !ConfMan.getBool("speech_mute");
switch (ingameSetting) {
case 1:
@@ -941,16 +939,6 @@ void SciEngine::updateScummVMAudioOptions() {
break;
case 2:
// speech
- switch (_gameId) {
- case GID_LAURABOW2:
- // We don't sync "speech" for Laura Bow 2 in case the user choose "both" in the setting
- // Because "speech" (2) within SCI means "speech + subtitles" for Laura Bow 2
- if (subtitlesOn && speechOn)
- return;
- break;
- default:
- break;
- }
ConfMan.setBool("subtitles", false);
ConfMan.setBool("speech_mute", false);
break;
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index c91606fbc9..418f8c5e50 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -55,6 +55,7 @@ class AudioPlayer;
class SoundCommandParser;
class EventManager;
class SegManager;
+class ScriptPatcher;
class GfxAnimate;
class GfxCache;
@@ -269,6 +270,7 @@ public:
bool hasMacIconBar() const;
inline ResourceManager *getResMan() const { return _resMan; }
+ inline ScriptPatcher *getScriptPatcher() const { return _scriptPatcher; }
inline Kernel *getKernel() const { return _kernel; }
inline EngineState *getEngineState() const { return _gamestate; }
inline Vocabulary *getVocabulary() const { return _vocabulary; }
@@ -400,6 +402,7 @@ private:
const ADGameDescription *_gameDescription;
const SciGameId _gameId;
ResourceManager *_resMan; /**< The resource manager */
+ ScriptPatcher *_scriptPatcher; /**< The script patcher */
EngineState *_gamestate;
Kernel *_kernel;
Vocabulary *_vocabulary;
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 186fc18a5c..6f250e0a3a 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -58,6 +58,10 @@ MidiParser_SCI::MidiParser_SCI(SciVersion soundVersion, SciMusic *music) :
_resetOnPause = false;
_pSnd = 0;
+
+ _mainThreadCalled = false;
+
+ resetStateTracking();
}
MidiParser_SCI::~MidiParser_SCI() {
@@ -68,10 +72,12 @@ MidiParser_SCI::~MidiParser_SCI() {
}
void MidiParser_SCI::mainThreadBegin() {
+ assert(!_mainThreadCalled);
_mainThreadCalled = true;
}
void MidiParser_SCI::mainThreadEnd() {
+ assert(_mainThreadCalled);
_mainThreadCalled = false;
}
@@ -83,12 +89,21 @@ bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, in
for (int i = 0; i < 16; i++) {
_channelUsed[i] = false;
- _channelRemap[i] = -1;
_channelMuted[i] = false;
_channelVolume[i] = 127;
+
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ _channelRemap[i] = i;
+ else
+ _channelRemap[i] = -1;
}
- _channelRemap[9] = 9; // never map channel 9, because that's used for percussion
- _channelRemap[15] = 15; // never map channel 15, because thats used by sierra internally
+
+ // FIXME: SSCI does not always start playing a track at the first byte.
+ // By default it skips 10 (or 13?) bytes containing prio/voices, patch,
+ // volume, pan commands in fixed locations, and possibly a signal
+ // in channel 15. We should initialize state tracking to those values
+ // so that they automatically get set up properly when the channels get
+ // mapped. See also the related FIXME in MidiParser_SCI::processEvent.
if (channelFilterMask) {
// SCI0 only has 1 data stream, but we need to filter out channels depending on music hardware selection
@@ -314,31 +329,26 @@ byte *MidiParser_SCI::midiFilterChannels(int channelMask) {
return _mixedData;
}
-// This will get called right before actual playing and will try to own the used channels
-void MidiParser_SCI::tryToOwnChannels() {
- // We don't have SciMusic in case debug command show_instruments is used
- if (!_music)
- return;
- for (int curChannel = 0; curChannel < 15; curChannel++) {
- if (_channelUsed[curChannel]) {
- if (_channelRemap[curChannel] == -1) {
- _channelRemap[curChannel] = _music->tryToOwnChannel(_pSnd, curChannel);
- }
- }
- }
-}
+void MidiParser_SCI::resetStateTracking() {
+ for (int i = 0; i < 16; ++i) {
+ ChannelState &s = _channelState[i];
+ s._modWheel = 0;
+ s._pan = 64;
+ s._patch = 0; // TODO: Initialize properly (from data in LoadMusic?)
+ s._note = -1;
+ s._sustain = false;
+ s._pitchWheel = 0x2000;
+ s._voices = 0;
-void MidiParser_SCI::lostChannels() {
- for (int curChannel = 0; curChannel < 15; curChannel++)
- if ((_channelUsed[curChannel]) && (curChannel != 9))
- _channelRemap[curChannel] = -1;
+ _channelVolume[i] = 127;
+ }
}
void MidiParser_SCI::sendInitCommands() {
- // reset our "global" volume and channel volumes
+ resetStateTracking();
+
+ // reset our "global" volume
_volume = 127;
- for (int i = 0; i < 16; i++)
- _channelVolume[i] = 127;
// Set initial voice count
if (_pSnd) {
@@ -390,53 +400,119 @@ void MidiParser_SCI::sendFromScriptToDriver(uint32 midi) {
// this happens for cmdSendMidi at least in sq1vga right at the start, it's a script issue
return;
}
- if (_channelRemap[midiChannel] == -1) {
- // trying to send to an unmapped channel
- // this happens for cmdSendMidi at least in sq1vga right at the start, scripts are pausing the sound
- // and then sending manually. it's a script issue
- return;
- }
sendToDriver(midi);
}
void MidiParser_SCI::sendToDriver(uint32 midi) {
- byte midiChannel = midi & 0xf;
-
- if ((midi & 0xFFF0) == 0x4EB0) {
- // this is channel mute only for sci1
- // it's velocity control for sci0
- if (_soundVersion >= SCI_VERSION_1_EARLY) {
- _channelMuted[midiChannel] = midi & 0xFF0000 ? true : false;
- return; // don't send this to driver at all
- }
- }
+ // State tracking
+ trackState(midi);
- // Is channel muted? if so, don't send command
- if (_channelMuted[midiChannel])
+ if ((midi & 0xFFF0) == 0x4EB0 && _soundVersion >= SCI_VERSION_1_EARLY) {
+ // Mute. Handled in trackState().
+ // CHECKME: Should we send this on to the driver?
return;
+ }
if ((midi & 0xFFF0) == 0x07B0) {
// someone trying to set channel volume?
int channelVolume = (midi >> 16) & 0xFF;
- // Remember, if we need to set it ourselves
- _channelVolume[midiChannel] = channelVolume;
// Adjust volume accordingly to current local volume
channelVolume = channelVolume * _volume / 127;
- midi = (midi & 0xFFF0) | ((channelVolume & 0xFF) << 16);
+ midi = (midi & 0xFFFF) | ((channelVolume & 0xFF) << 16);
}
+
// Channel remapping
+ byte midiChannel = midi & 0xf;
int16 realChannel = _channelRemap[midiChannel];
if (realChannel == -1)
return;
midi = (midi & 0xFFFFFFF0) | realChannel;
+ sendToDriver_raw(midi);
+}
+
+void MidiParser_SCI::sendToDriver_raw(uint32 midi) {
if (_mainThreadCalled)
_music->putMidiCommandInQueue(midi);
else
_driver->send(midi);
}
+void MidiParser_SCI::trackState(uint32 b) {
+ // We keep track of most of the state of a midi channel, so we can
+ // at any time reset the device to the current state, even if the
+ // channel has been temporarily disabled due to remapping.
+
+ byte command = b & 0xf0;
+ byte channel = b & 0xf;
+ byte op1 = (b >> 8) & 0x7f;
+ byte op2 = (b >> 16) & 0x7f;
+
+ ChannelState &s = _channelState[channel];
+
+ switch (command) {
+ case 0x90:
+ if (op2 != 0) {
+ // note on
+ s._note = op1;
+ break;
+ }
+ // else, fall-through
+ case 0x80:
+ // note off
+ if (s._note == op1)
+ s._note = -1;
+ break;
+ case 0xB0:
+ // control change
+ switch (op1) {
+ case 0x01: // mod wheel
+ s._modWheel = op2;
+ break;
+ case 0x07: // channel volume
+ _channelVolume[channel] = op2;
+ break;
+ case 0x0A: // pan
+ s._pan = op2;
+ break;
+ case 0x40: // sustain
+ s._sustain = (op2 != 0);
+ break;
+ case 0x4B: // voices
+ s._voices = op2;
+ _pSnd->_chan[channel]._voices = op2; // Also sync our MusicEntry
+ break;
+ case 0x4E: // mute
+ // This is channel mute only for sci1.
+ // (It's velocity control for sci0, but we don't need state in sci0)
+ if (_soundVersion >= SCI_VERSION_1_EARLY) {
+ // FIXME: mute is a level, not a bool, in some SCI versions
+ bool m = op2;
+ if (_pSnd->_chan[channel]._mute != m) {
+ _pSnd->_chan[channel]._mute = m;
+ // TODO: If muting/unmuting a channel, remap channels.
+ warning("Mute change without immediate remapping (mainThread = %d)", _mainThreadCalled);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ break;
+ case 0xC0:
+ // program change
+ s._patch = op1;
+ break;
+ case 0xE0:
+ // pitchwheel
+ s._pitchWheel = (op2 << 7) | op1;
+ break;
+ default:
+ break;
+ }
+}
+
void MidiParser_SCI::parseNextEvent(EventInfo &info) {
info.start = _position._playPos;
info.delta = 0;
@@ -477,8 +553,10 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
case 0xE:
info.basic.param1 = *(_position._playPos++);
info.basic.param2 = *(_position._playPos++);
- if (info.command() == 0x9 && info.basic.param2 == 0)
+ if (info.command() == 0x9 && info.basic.param2 == 0) {
+ // NoteOn with param2==0 is a NoteOff
info.event = info.channel() | 0x80;
+ }
info.length = 0;
break;
@@ -809,4 +887,44 @@ void MidiParser_SCI::setVolume(byte volume) {
}
}
+void MidiParser_SCI::remapChannel(int channel, int devChannel) {
+ if (_channelRemap[channel] == devChannel)
+ return;
+
+ _channelRemap[channel] = devChannel;
+
+ if (devChannel == -1)
+ return;
+
+// debug(" restoring state: channel %d on devChannel %d", channel, devChannel);
+
+ // restore state
+ ChannelState &s = _channelState[channel];
+
+ int channelVolume = _channelVolume[channel];
+ channelVolume = (channelVolume * _volume / 127) & 0xFF;
+ byte pitch1 = s._pitchWheel & 0x7F;
+ byte pitch2 = (s._pitchWheel >> 7) & 0x7F;
+
+ sendToDriver_raw(0x0040B0 | devChannel); // sustain off
+ sendToDriver_raw(0x004BB0 | devChannel | (s._voices << 16));
+ sendToDriver_raw(0x0000C0 | devChannel | (s._patch << 8));
+ sendToDriver_raw(0x0007B0 | devChannel | (channelVolume << 16));
+ sendToDriver_raw(0x000AB0 | devChannel | (s._pan << 16));
+ sendToDriver_raw(0x0001B0 | devChannel | (s._modWheel << 16));
+ sendToDriver_raw(0x0040B0 | devChannel | (s._sustain ? 0x7F0000 : 0));
+ sendToDriver_raw(0x0000E0 | devChannel | (pitch1 << 8) | (pitch2 << 16));
+
+ // CHECKME: Some SSCI version send a control change 0x4E with s._note as
+ // parameter.
+ // We need to investigate how (and if) drivers should act on this.
+ // Related: controller 0x4E is used for 'mute' in the midiparser.
+ // This could be a bug in SSCI that went unnoticed because few (or no?)
+ // drivers implement controller 0x4E
+
+ // NB: The line below is _not_ valid since s._note can be 0xFF.
+ // SSCI handles this out of band in the driver interface.
+ // sendToDriver_raw(0x004EB0 | devChannel | (s._note << 16);
+}
+
} // End of namespace Sci
diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
index 5784dca1ab..7e24c34144 100644
--- a/engines/sci/sound/midiparser_sci.h
+++ b/engines/sci/sound/midiparser_sci.h
@@ -79,20 +79,23 @@ public:
const byte *getMixedData() const { return _mixedData; }
byte getSongReverb();
- void tryToOwnChannels();
- void lostChannels();
void sendFromScriptToDriver(uint32 midi);
void sendToDriver(uint32 midi);
void sendToDriver(byte status, byte firstOp, byte secondOp) {
sendToDriver(status | ((uint32)firstOp << 8) | ((uint32)secondOp << 16));
}
+ void remapChannel(int channel, int devChannel);
+
protected:
void parseNextEvent(EventInfo &info);
void processEvent(const EventInfo &info, bool fireEvents = true);
byte *midiMixChannels();
byte *midiFilterChannels(int channelMask);
byte midiGetNextChannel(long ticker);
+ void resetStateTracking();
+ void trackState(uint32 midi);
+ void sendToDriver_raw(uint32 midi);
SciMusic *_music;
@@ -113,6 +116,19 @@ protected:
int16 _channelRemap[16];
bool _channelMuted[16];
byte _channelVolume[16];
+
+ struct ChannelState {
+ int8 _modWheel;
+ int8 _pan;
+ int8 _patch;
+ int8 _note;
+ bool _sustain;
+ int16 _pitchWheel;
+ int8 _voices;
+ };
+
+ ChannelState _channelState[16];
+
};
} // End of namespace Sci
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 8c6d0d6431..f46c1dfbb0 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -33,7 +33,7 @@
#include "sci/sound/midiparser_sci.h"
#include "sci/sound/music.h"
-//#define DISABLE_REMAPPING
+//#define DEBUG_REMAP
namespace Sci {
@@ -47,6 +47,8 @@ SciMusic::SciMusic(SciVersion soundVersion, bool useDigitalSFX)
for (int i = 0; i < 16; i++) {
_usedChannel[i] = 0;
_channelRemap[i] = -1;
+ _channelMap[i]._song = 0;
+ _channelMap[i]._channel = -1;
}
_queuedCommands.reserve(1000);
@@ -291,6 +293,15 @@ void SciMusic::sortPlayList() {
}
void SciMusic::soundInitSnd(MusicEntry *pSnd) {
+ // Remove all currently mapped channels of this MusicEntry first,
+ // since they will no longer be valid.
+ for (int i = 0; i < 16; ++i) {
+ if (_channelMap[i]._song == pSnd) {
+ _channelMap[i]._song = 0;
+ _channelMap[i]._channel = -1;
+ }
+ }
+
int channelFilterMask = 0;
SoundResource::Track *track = pSnd->soundRes->getTrackByType(_pMidiDrv->getPlayId());
@@ -337,6 +348,27 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
// Find out what channels to filter for SCI0
channelFilterMask = pSnd->soundRes->getChannelFilterMask(_pMidiDrv->getPlayId(), _pMidiDrv->hasRhythmChannel());
+ for (int i = 0; i < 16; ++i)
+ pSnd->_usedChannels[i] = 0xFF;
+ for (int i = 0; i < track->channelCount; ++i) {
+ SoundResource::Channel &chan = track->channels[i];
+
+ pSnd->_usedChannels[i] = chan.number;
+ pSnd->_chan[chan.number]._dontRemap = (chan.flags & 2);
+ pSnd->_chan[chan.number]._prio = chan.prio;
+ pSnd->_chan[chan.number]._voices = chan.poly;
+
+ // CHECKME: Some SCI versions use chan.flags & 1 for this:
+ pSnd->_chan[chan.number]._dontMap = false;
+
+ // FIXME: Most MIDI tracks use the first 10 bytes for
+ // fixed MIDI commands. SSCI skips those the first iteration,
+ // but _does_ update channel state (including volume) with
+ // them. Specifically, prio/voices, patch, volume, pan.
+ // This should probably be implemented in
+ // MidiParser_SCI::loadMusic.
+ }
+
pSnd->pMidiParser->mainThreadBegin();
// loadMusic() below calls jumpToTick.
// Disable sound looping and hold before jumpToTick is called,
@@ -358,64 +390,6 @@ void SciMusic::soundInitSnd(MusicEntry *pSnd) {
}
}
-// This one checks, if requested channel is available -> in that case give
-// caller that channel. Otherwise look for an unused one
-int16 SciMusic::tryToOwnChannel(MusicEntry *caller, int16 bestChannel) {
-#ifdef DISABLE_REMAPPING
- return bestChannel;
-#endif
-
- // Don't even try this for SCI0
- if (_soundVersion <= SCI_VERSION_0_LATE)
- return bestChannel;
- if (!_usedChannel[bestChannel]) {
- // currently unused, so give it to caller directly
- _usedChannel[bestChannel] = caller;
- _channelRemap[bestChannel] = bestChannel;
- return bestChannel;
- }
- // otherwise look for unused channel
- for (int channelNr = _driverFirstChannel; channelNr < 15; channelNr++) {
- if (channelNr == 9) // never map to channel 9 (percussion)
- continue;
- if (!_usedChannel[channelNr]) {
- _usedChannel[channelNr] = caller;
- _channelRemap[bestChannel] = channelNr;
- return channelNr;
- }
- }
- // nothing found, don't map channel at all
- // sierra did this as well, although i'm not sure if we act exactly the same way
- // maybe they removed channels from previous playing music
- return -1;
-}
-
-void SciMusic::freeChannels(MusicEntry *caller) {
- // Remove used channels
- for (int i = 0; i < 15; i++) {
- if (_usedChannel[i] == caller) {
- if (_channelRemap[i] != -1) {
- // athrxx: The original handles this differently. It seems to be checking for (and effecting) necessary
- // remaps / resets etc. more or less all the time. There are several more tables to keep track of everything.
- // I don't know whether all of that is needed and to which SCI versions it applies, though.
- // At least it is necessary to release the allocated channels inside the driver. Otherwise these channels
- // won't be available any more (e.g. after half of the KQ5 FM-Towns intro there will be no more music
- // since the driver can't pick up any more channels). The channels also have to be reset to
- // default values, since the original does the same (although in a different manny) and the music will be wrong
- // otherwise (at least KQ5 FM-Towns).
-
- sendMidiCommand(0x4000e0 | _channelRemap[i]); // Reset pitch wheel
- sendMidiCommand(0x0040b0 | _channelRemap[i]); // Release pedal
- sendMidiCommand(0x004bb0 | _channelRemap[i]); // Release assigned driver channels
- }
- _usedChannel[i] = 0;
- _channelRemap[i] = -1;
- }
- }
- // Also tell midiparser, that he lost ownership
- caller->pMidiParser->lostChannels();
-}
-
void SciMusic::soundPlay(MusicEntry *pSnd) {
_mutex.lock();
@@ -481,28 +455,6 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
Common::StackLock lock(_mutex);
pSnd->pMidiParser->mainThreadBegin();
- if (pSnd->status != kSoundPaused) {
- // Stop any in progress music fading, as that will reset the
- // volume of the sound channels that the faded song occupies..
- // Fixes bug #3266480 and partially fixes bug #3041738.
- // CHECKME: Is this the right thing to do? Are these
- // overlapping channels not a deeper underlying problem?
- for (uint i = 0; i < playListCount; i++) {
- // Is another MIDI song being faded down? If yes, stop it
- // immediately instead
- if (_playList[i]->fadeStep < 0 && _playList[i]->pMidiParser) {
- _playList[i]->status = kSoundStopped;
- if (_soundVersion <= SCI_VERSION_0_LATE)
- _playList[i]->isQueued = false;
- _playList[i]->pMidiParser->stop();
- freeChannels(_playList[i]);
- _playList[i]->fadeStep = 0;
- _playList[i]->fadeCompleted = true;
- }
- }
- }
-
- pSnd->pMidiParser->tryToOwnChannels();
if (pSnd->status != kSoundPaused)
pSnd->pMidiParser->sendInitCommands();
pSnd->pMidiParser->setVolume(pSnd->volume);
@@ -532,6 +484,10 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
}
pSnd->status = kSoundPlaying;
+
+ _mutex.lock();
+ remapChannels();
+ _mutex.unlock();
}
void SciMusic::soundStop(MusicEntry *pSnd) {
@@ -549,8 +505,8 @@ void SciMusic::soundStop(MusicEntry *pSnd) {
// allNotesOff() again
if (previousStatus == kSoundPlaying)
pSnd->pMidiParser->stop();
- freeChannels(pSnd);
pSnd->pMidiParser->mainThreadEnd();
+ remapChannels();
}
pSnd->fadeStep = 0; // end fading, if fading was in progress
@@ -586,8 +542,10 @@ void SciMusic::soundSetPriority(MusicEntry *pSnd, byte prio) {
void SciMusic::soundKill(MusicEntry *pSnd) {
pSnd->status = kSoundStopped;
+ _mutex.lock();
+ remapChannels();
+
if (pSnd->pMidiParser) {
- Common::StackLock lock(_mutex);
pSnd->pMidiParser->mainThreadBegin();
pSnd->pMidiParser->unloadMusic();
pSnd->pMidiParser->mainThreadEnd();
@@ -595,6 +553,8 @@ void SciMusic::soundKill(MusicEntry *pSnd) {
pSnd->pMidiParser = NULL;
}
+ _mutex.unlock();
+
if (pSnd->pStreamAud) {
_pMixer->stopHandle(pSnd->hCurrentAud);
delete pSnd->pStreamAud;
@@ -603,7 +563,7 @@ void SciMusic::soundKill(MusicEntry *pSnd) {
pSnd->pLoopStream = 0;
}
- Common::StackLock lock(_mutex);
+ _mutex.lock();
uint sz = _playList.size(), i;
// Remove sound from playlist
for (i = 0; i < sz; i++) {
@@ -614,6 +574,7 @@ void SciMusic::soundKill(MusicEntry *pSnd) {
break;
}
}
+ _mutex.unlock();
}
void SciMusic::soundPause(MusicEntry *pSnd) {
@@ -639,8 +600,8 @@ void SciMusic::soundPause(MusicEntry *pSnd) {
Common::StackLock lock(_mutex);
pSnd->pMidiParser->mainThreadBegin();
pSnd->pMidiParser->pause();
- freeChannels(pSnd);
pSnd->pMidiParser->mainThreadEnd();
+ remapChannels();
}
}
}
@@ -789,6 +750,14 @@ MusicEntry::MusicEntry() {
pStreamAud = 0;
pLoopStream = 0;
pMidiParser = 0;
+
+ for (int i = 0; i < 16; ++i) {
+ _usedChannels[i] = 0xFF;
+ _chan[i]._prio = 127;
+ _chan[i]._voices = 0;
+ _chan[i]._dontRemap = false;
+ _chan[i]._mute = false;
+ }
}
MusicEntry::~MusicEntry() {
@@ -857,4 +826,447 @@ void MusicEntry::setSignal(int newSignal) {
}
}
+
+void ChannelRemapping::swap(int i, int j) {
+ DeviceChannelUsage t1;
+ int t2;
+ bool t3;
+
+ t1 = _map[i]; _map[i] = _map[j]; _map[j] = t1;
+ t2 = _prio[i]; _prio[i] = _prio[j]; _prio[j] = t2;
+ t2 = _voices[i]; _voices[i] = _voices[j]; _voices[j] = t2;
+ t3 = _dontRemap[i]; _dontRemap[i] = _dontRemap[j]; _dontRemap[j] = t3;
+}
+
+void ChannelRemapping::evict(int i) {
+ _freeVoices += _voices[i];
+
+ _map[i]._song = 0;
+ _map[i]._channel = -1;
+ _prio[i] = 0;
+ _voices[i] = 0;
+ _dontRemap[i] = false;
+}
+
+void ChannelRemapping::clear() {
+ for (int i = 0; i < 16; ++i) {
+ _map[i]._song = 0;
+ _map[i]._channel = -1;
+ _prio[i] = 0;
+ _voices[i] = 0;
+ _dontRemap[i] = false;
+ }
+}
+
+ChannelRemapping& ChannelRemapping::operator=(ChannelRemapping& other) {
+ for (int i = 0; i < 16; ++i) {
+ _map[i] = other._map[i];
+ _prio[i] = other._prio[i];
+ _voices[i] = other._voices[i];
+ _dontRemap[i] = other._dontRemap[i];
+ }
+ _freeVoices = other._freeVoices;
+
+ return *this;
+}
+
+int ChannelRemapping::lowestPrio() const {
+ int max = 0;
+ int channel = -1;
+ for (int i = 0; i < 16; ++i) {
+ if (_prio[i] > max) {
+ max = _prio[i];
+ channel = i;
+ }
+ }
+ return channel;
+}
+
+
+void SciMusic::remapChannels() {
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ return;
+
+ // NB: This function should only be called from the main thread,
+ // with _mutex locked
+
+
+ ChannelRemapping *map = determineChannelMap();
+
+ DeviceChannelUsage currentMap[16];
+
+#ifdef DEBUG_REMAP
+ debug("Remap results:");
+#endif
+
+ // Save current map, and then start from an empty map
+ for (int i = 0; i < 16; ++i) {
+ currentMap[i] = _channelMap[i];
+ _channelMap[i]._song = 0;
+ _channelMap[i]._channel = -1;
+ }
+
+ // Inform MidiParsers of any unmapped channels
+ const MusicList::iterator end = _playList.end();
+ int songIndex = -1;
+ for (MusicList::iterator i = _playList.begin(); i != end; ++i) {
+ MusicEntry *song = *i;
+ songIndex++;
+
+ if (!song || !song->pMidiParser)
+ continue;
+
+ bool channelMapped[16];
+#ifdef DEBUG_REMAP
+ bool channelUsed[16];
+#endif
+ for (int j = 0; j < 16; ++j) {
+ channelMapped[j] = false;
+#ifdef DEBUG_REMAP
+ channelUsed[j] = false;
+#endif
+ }
+
+ for (int j = 0; j < 16; ++j) {
+ if (map->_map[j]._song == song) {
+ int channel = map->_map[j]._channel;
+ assert(channel >= 0 && channel <= 0x0F);
+ channelMapped[channel] = true;
+ }
+#ifdef DEBUG_REMAP
+ if (song->_usedChannels[j] <= 0x0F)
+ channelUsed[song->_usedChannels[j]] = true;
+#endif
+ }
+
+ for (int j = 0; j < 16; ++j) {
+ if (!channelMapped[j]) {
+ song->pMidiParser->mainThreadBegin();
+ song->pMidiParser->remapChannel(j, -1);
+ song->pMidiParser->mainThreadEnd();
+#ifdef DEBUG_REMAP
+ if (channelUsed[j])
+ debug(" Unmapping song %d, channel %d", songIndex, j);
+#endif
+ }
+ }
+ }
+
+ // Now reshuffle the channels on the device.
+
+ // First, set up any dontRemap channels
+ for (int i = 0; i < 16; ++i) {
+
+ if (!map->_map[i]._song || !map->_map[i]._song->pMidiParser || !map->_dontRemap[i])
+ continue;
+
+ songIndex = -1;
+ for (MusicList::iterator iter = _playList.begin(); iter != end; ++iter) {
+ songIndex++;
+ if (map->_map[i]._song == *iter)
+ break;
+ }
+
+ _channelMap[i] = map->_map[i];
+ map->_map[i]._song = 0; // mark as done
+
+ // If this channel was not yet mapped to the device, reset it
+ if (currentMap[i] != _channelMap[i]) {
+#ifdef DEBUG_REMAP
+ debug(" Mapping (dontRemap) song %d, channel %d to device channel %d", songIndex, _channelMap[i]._channel, i);
+#endif
+ _channelMap[i]._song->pMidiParser->mainThreadBegin();
+ _channelMap[i]._song->pMidiParser->remapChannel(_channelMap[i]._channel, i);
+ _channelMap[i]._song->pMidiParser->mainThreadEnd();
+ }
+
+ }
+
+ // Next, we look for channels which were already playing.
+ // We keep those on the same device channel as before.
+ for (int i = 0; i < 16; ++i) {
+
+ if (!map->_map[i]._song)
+ continue;
+
+ songIndex = -1;
+ for (MusicList::iterator iter = _playList.begin(); iter != end; ++iter) {
+ songIndex++;
+ if (map->_map[i]._song == *iter)
+ break;
+ }
+
+
+ for (int j = 0; j < 16; ++j) {
+ if (map->_map[i] == currentMap[j]) {
+ // found it
+ _channelMap[j] = map->_map[i];
+ map->_map[i]._song = 0; // mark as done
+#ifdef DEBUG_REMAP
+ debug(" Keeping song %d, channel %d on device channel %d", songIndex, _channelMap[j]._channel, j);
+#endif
+ break;
+ }
+ }
+ }
+
+ // Then, remap the rest.
+ for (int i = 0; i < 16; ++i) {
+
+ if (!map->_map[i]._song || !map->_map[i]._song->pMidiParser)
+ continue;
+
+ songIndex = -1;
+ for (MusicList::iterator iter = _playList.begin(); iter != end; ++iter) {
+ songIndex++;
+ if (map->_map[i]._song == *iter)
+ break;
+ }
+
+ for (int j = _driverLastChannel; j >= _driverFirstChannel; --j) {
+ if (_channelMap[j]._song == 0) {
+ _channelMap[j] = map->_map[i];
+ map->_map[i]._song = 0;
+#ifdef DEBUG_REMAP
+ debug(" Mapping song %d, channel %d to device channel %d", songIndex, _channelMap[j]._channel, j);
+#endif
+ _channelMap[j]._song->pMidiParser->mainThreadBegin();
+ _channelMap[j]._song->pMidiParser->remapChannel(_channelMap[j]._channel, j);
+ _channelMap[j]._song->pMidiParser->mainThreadEnd();
+ break;
+ }
+ }
+
+ }
+
+ // And finally, stop any empty channels
+ for (int i = _driverFirstChannel; i <= _driverLastChannel; ++i) {
+ if (!_channelMap[i]._song)
+ resetDeviceChannel(i);
+ }
+
+ delete map;
+}
+
+
+ChannelRemapping *SciMusic::determineChannelMap() {
+#ifdef DEBUG_REMAP
+ debug("Remap: avail chans: %d-%d", _driverFirstChannel, _driverLastChannel);
+#endif
+
+ ChannelRemapping *map = new ChannelRemapping;
+ ChannelRemapping backupMap;
+ map->clear();
+ map->_freeVoices = _pMidiDrv->getPolyphony();
+
+ if (_playList.empty())
+ return map;
+
+ // TODO: set reverb, either from first song, or from global???
+
+ MusicList::iterator songIter;
+ int songIndex = -1;
+ for (songIter = _playList.begin(); songIter != _playList.end(); ++songIter) {
+ songIndex++;
+ MusicEntry *song = *songIter;
+ if (song->status != kSoundPlaying)
+ continue;
+
+ // If song is digital, skip.
+ // CHECKME: Is this condition correct?
+ if (!song->pMidiParser) {
+#ifdef DEBUG_REMAP
+ debug(" Song %d (%p), digital?", songIndex, (void*)song);
+#endif
+ continue;
+ }
+
+
+#ifdef DEBUG_REMAP
+ debug(" Song %d (%p), prio %d", songIndex, (void*)song, song->priority);
+#endif
+
+ // Store backup. If we fail to map this song, we will revert to this.
+ backupMap = *map;
+
+ bool songMapped = true;
+
+ for (int i = 0; i < 16; ++i) {
+ int c = song->_usedChannels[i];
+ if (c == 0xFF || c == 0xFE || c == 0x0F)
+ continue;
+ const MusicEntryChannel &channel = song->_chan[c];
+ if (channel._dontMap)
+ continue;
+ if (channel._mute)
+ continue;
+
+#ifdef DEBUG_REMAP
+ debug(" Channel %d: prio %d, %d voice%s%s", c, channel._prio, channel._voices, channel._voices == 1 ? "" : "s", channel._dontRemap ? ", dontRemap" : "" );
+#endif
+
+ DeviceChannelUsage dc = { song, c };
+
+ // our target
+ int devChannel = -1;
+
+ if (channel._dontRemap && map->_map[c]._song == 0) {
+ // unremappable channel, with channel still free
+ devChannel = c;
+ }
+
+ // try to find a free channel
+ if (devChannel == -1) {
+ for (int j = 0; j < 16; ++j) {
+ if (map->_map[j] == dc) {
+ // already mapped?! (Can this happen?)
+ devChannel = j;
+ break;
+ }
+ if (map->_map[j]._song)
+ continue;
+
+ if (j >= _driverFirstChannel && j <= _driverLastChannel)
+ devChannel = j;
+ }
+ }
+
+ int prio = channel._prio;
+ if (prio > 0) {
+ // prio > 0 means non-essential
+ prio = (16 - prio) + 16*songIndex;
+ }
+
+ if (devChannel == -1 && prio > 0) {
+ // no empty channel, but this isn't an essential channel,
+ // so we just skip it.
+#ifdef DEBUG_REMAP
+ debug(" skipping non-essential");
+#endif
+ continue;
+ }
+
+ // try to empty a previous channel if this is an essential channel
+ if (devChannel == -1) {
+ devChannel = map->lowestPrio();
+ if (devChannel != -1)
+ map->evict(devChannel);
+ }
+
+ if (devChannel == -1) {
+ // failed to map this song.
+#ifdef DEBUG_REMAP
+ debug(" no free (or lower priority) channel found");
+#endif
+ songMapped = false;
+ break;
+ }
+
+ if (map->_map[devChannel] == dc) {
+ // already mapped?! (Can this happen?)
+ continue;
+ }
+
+ int neededVoices = channel._voices;
+ // do we have enough free voices?
+ // We only care for essential channels
+ if (map->_freeVoices < neededVoices && prio > 0) {
+ do {
+ int j = map->lowestPrio();
+ if (j == -1) {
+#ifdef DEBUG_REMAP
+ debug(" not enough voices; need %d, have %d", neededVoices, map->_freeVoices);
+#endif
+ // failed to free enough voices.
+ songMapped = false;
+ break;
+ }
+#ifdef DEBUG_REMAP
+ debug(" creating room for voices; evict %d", j);
+#endif
+ map->evict(j);
+ } while (map->_freeVoices < neededVoices);
+
+ if (!songMapped) {
+ // failed to map this song.
+ break;
+ }
+ }
+
+ // We have a channel and enough free voices now.
+#ifdef DEBUG_REMAP
+ debug(" trying to map to %d", devChannel);
+#endif
+
+ map->_map[devChannel] = dc;
+ map->_voices[devChannel] = neededVoices;
+ map->_prio[devChannel] = prio;
+ map->_dontRemap[devChannel] = channel._dontRemap;
+ map->_freeVoices -= neededVoices;
+
+ if (!channel._dontRemap || devChannel == c) {
+ // If this channel fits here, we're done.
+#ifdef DEBUG_REMAP
+ debug(" OK");
+#endif
+ continue;
+ }
+
+ // If this channel can't be remapped, we need to move it or fail.
+
+ if (!map->_dontRemap[c]) {
+ // Target channel can be remapped, so just swap
+ map->swap(devChannel, c);
+ continue;
+ }
+#ifdef DEBUG_REMAP
+ debug(" but %d is already dontRemap", c);
+#endif
+
+ if (prio > 0) {
+ // Channel collision, but this channel is non-essential,
+ // so drop it.
+ // TODO: Maybe we should have checked this before making room?
+ map->evict(devChannel);
+ continue;
+ }
+
+ if (map->_prio[c] > 0) {
+ // Channel collision, but the other channel is non-essential,
+ // so we take its place.
+ map->evict(c);
+ map->swap(devChannel, c);
+ continue;
+ }
+
+ // Otherwise, we have two essential channels claiming the same
+ // device channel.
+ songMapped = false;
+ break;
+ }
+
+ if (!songMapped) {
+ // We failed to map this song, so unmap all its channels.
+#ifdef DEBUG_REMAP
+ debug(" Failed song");
+#endif
+ *map = backupMap;
+ }
+ }
+
+ return map;
+}
+
+void SciMusic::resetDeviceChannel(int devChannel) {
+ // NB: This function should only be called from the main thread
+
+ assert(devChannel >= 0 && devChannel <= 0x0F);
+
+ putMidiCommandInQueue(0x0040B0 | devChannel); // sustain off
+ putMidiCommandInQueue(0x007BB0 | devChannel); // notes off
+ putMidiCommandInQueue(0x004BB0 | devChannel); // release voices
+}
+
+
+
} // End of namespace Sci
diff --git a/engines/sci/sound/music.h b/engines/sci/sound/music.h
index 40236c8445..23a072cb26 100644
--- a/engines/sci/sound/music.h
+++ b/engines/sci/sound/music.h
@@ -52,6 +52,17 @@ class SegManager;
typedef Common::Array<uint16> SignalQueue;
+
+struct MusicEntryChannel {
+ // Channel info
+ int8 _prio; // 0 = essential; lower is higher priority
+ int8 _voices;
+ bool _dontRemap;
+ bool _dontMap;
+ bool _mute;
+};
+
+
class MusicEntry : public Common::Serializable {
public:
// Do not get these directly for the sound objects!
@@ -90,6 +101,8 @@ public:
Audio::Mixer::SoundType soundType;
+ int _usedChannels[16];
+ MusicEntryChannel _chan[16];
MidiParser_SCI *pMidiParser;
// this is used for storing signals, when the current signal is not yet
@@ -114,6 +127,27 @@ public:
virtual void saveLoadWithSerializer(Common::Serializer &ser);
};
+struct DeviceChannelUsage {
+ MusicEntry *_song;
+ int _channel;
+ bool operator==(const DeviceChannelUsage& other) const { return _song == other._song && _channel == other._channel; }
+ bool operator!=(const DeviceChannelUsage& other) const { return !(*this == other); }
+};
+
+struct ChannelRemapping {
+ DeviceChannelUsage _map[16];
+ int _prio[16];
+ int _voices[16];
+ bool _dontRemap[16];
+ int _freeVoices;
+
+ void clear();
+ void swap(int i, int j);
+ void evict(int i);
+ ChannelRemapping& operator=(ChannelRemapping& other);
+ int lowestPrio() const;
+};
+
typedef Common::Array<MusicEntry *> MusicList;
typedef Common::Array<uint32> MidiCommandQueue;
@@ -198,9 +232,6 @@ public:
// where a deadlock can occur
Common::Mutex _mutex;
- int16 tryToOwnChannel(MusicEntry *caller, int16 bestChannel);
- void freeChannels(MusicEntry *caller);
-
protected:
void sortPlayList();
@@ -213,6 +244,11 @@ protected:
// If true and a sound has a digital track, the sound from the AdLib track is played
bool _useDigitalSFX;
+ // remapping:
+ void remapChannels();
+ ChannelRemapping *determineChannelMap();
+ void resetDeviceChannel(int devChannel);
+
private:
MusicList _playList;
bool _soundOn;
@@ -221,6 +257,8 @@ private:
int8 _channelRemap[16];
int8 _globalReverb;
+ DeviceChannelUsage _channelMap[16];
+
MidiCommandQueue _queuedCommands;
MusicType _musicType;
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index e36c5705ab..aa2a309f4d 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -508,9 +508,19 @@ void SoundCommandParser::processUpdateCues(reg_t obj) {
// fireworks).
// It is also needed in other games, e.g. LSL6 when talking to the
// receptionist (bug #3192166).
- // CHECKME: At least kq5cd/win and kq6 set signal to 0xFE here, but
- // kq5cd/dos does not set signal at all. Needs more investigation.
- writeSelectorValue(_segMan, obj, SELECTOR(signal), SIGNAL_OFFSET);
+ // TODO: More thorougly check the different SCI version:
+ // * SCI1late sets signal to 0xFE here. (With signal 0xFF
+ // duplicate music plays in LauraBow2CD - bug #6462)
+ // SCI1middle LSL1 1.000.510 does not have the 0xFE;
+ // SCI1late CastleDrBrain demo 1.000.005 does have the 0xFE.
+ // * Other SCI1 games seem to rely on processStopSound to set the signal
+ // * Need to check SCI0 behaviour.
+ uint16 sig;
+ if (getSciVersion() >= SCI_VERSION_1_LATE)
+ sig = 0xFFFE;
+ else
+ sig = SIGNAL_OFFSET;
+ writeSelectorValue(_segMan, obj, SELECTOR(signal), sig);
if (_soundVersion <= SCI_VERSION_0_LATE) {
processStopSound(obj, false);
} else {
diff --git a/engines/scumm/configure.engine b/engines/scumm/configure.engine
new file mode 100644
index 0000000000..e1de788061
--- /dev/null
+++ b/engines/scumm/configure.engine
@@ -0,0 +1,5 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
+add_engine scumm "SCUMM" yes "scumm_7_8 he" "v0-v6 games"
+add_engine scumm_7_8 "v7 & v8 games" yes
+add_engine he "HE71+ games" yes
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 170ca0993c..aa7e60930a 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -1223,8 +1223,8 @@ const char *ScummMetaEngine::getOriginalCopyright() const {
}
namespace Scumm {
- extern bool getSavegameName(Common::InSaveFile *in, Common::String &desc, int heversion);
-}
+bool getSavegameName(Common::InSaveFile *in, Common::String &desc, int heversion);
+} // End of namespace Scumm
int ScummMetaEngine::getMaximumSaveSlot() const { return 99; }
@@ -1262,25 +1262,21 @@ void ScummMetaEngine::removeSaveState(const char *target, int slot) const {
}
SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
- Common::String filename = ScummEngine::makeSavegameName(target, slot, false);
- Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename);
-
- if (!in)
- return SaveStateDescriptor();
-
Common::String saveDesc;
- Scumm::getSavegameName(in, saveDesc, 0); // FIXME: heversion?!?
- delete in;
+ Graphics::Surface *thumbnail = nullptr;
+ SaveStateMetaInfos infos;
+ memset(&infos, 0, sizeof(infos));
+ SaveStateMetaInfos *infoPtr = &infos;
- // TODO: Cleanup
- Graphics::Surface *thumbnail = ScummEngine::loadThumbnailFromSlot(target, slot);
+ // FIXME: heversion?!?
+ if (!ScummEngine::querySaveMetaInfos(target, slot, 0, saveDesc, thumbnail, infoPtr)) {
+ return SaveStateDescriptor();
+ }
SaveStateDescriptor desc(slot, saveDesc);
desc.setThumbnail(thumbnail);
- SaveStateMetaInfos infos;
- memset(&infos, 0, sizeof(infos));
- if (ScummEngine::loadInfosFromSlot(target, slot, &infos)) {
+ if (infoPtr) {
int day = (infos.date >> 24) & 0xFF;
int month = (infos.date >> 16) & 0xFF;
int year = infos.date & 0xFFFF;
diff --git a/engines/scumm/he/animation_he.cpp b/engines/scumm/he/animation_he.cpp
index d01b456c8b..c736c6a04c 100644
--- a/engines/scumm/he/animation_he.cpp
+++ b/engines/scumm/he/animation_he.cpp
@@ -57,7 +57,7 @@ int MoviePlayer::getImageNum() {
return _wizResNum;
}
-int MoviePlayer::load(const char *filename, int flags, int image) {
+int MoviePlayer::load(const Common::String &filename, int flags, int image) {
if (_video->isVideoLoaded())
_video->close();
@@ -65,13 +65,13 @@ int MoviePlayer::load(const char *filename, int flags, int image) {
_video->setDefaultHighColorFormat(g_system->getScreenFormat());
if (!_video->loadFile(filename)) {
- warning("Failed to load video file %s", filename);
+ warning("Failed to load video file %s", filename.c_str());
return -1;
}
_video->start();
- debug(1, "Playing video %s", filename);
+ debug(1, "Playing video %s", filename.c_str());
if (flags & 2)
_vm->_wiz->createWizEmptyImage(image, 0, 0, _video->getWidth(), _video->getHeight());
diff --git a/engines/scumm/he/animation_he.h b/engines/scumm/he/animation_he.h
index e17c1b9a39..48234b8072 100644
--- a/engines/scumm/he/animation_he.h
+++ b/engines/scumm/he/animation_he.h
@@ -25,8 +25,12 @@
#include "audio/mixer.h"
+namespace Common {
+class String;
+}
+
namespace Video {
- class VideoDecoder;
+class VideoDecoder;
}
namespace Scumm {
@@ -39,7 +43,7 @@ public:
~MoviePlayer();
int getImageNum();
- int load(const char *filename, int flags, int image = 0);
+ int load(const Common::String &filename, int flags, int image = 0);
void copyFrameToBuffer(byte *dst, int dstType, uint x, uint y, uint pitch);
void handleNextFrame();
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index a674288775..067f508d2c 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -81,10 +81,23 @@ protected:
int virtScreenSave(byte *dst, int x1, int y1, int x2, int y2);
void virtScreenLoad(int resIdx, int x1, int y1, int x2, int y2);
- int convertFilePath(byte *dst, int dstSize);
virtual void decodeParseString(int a, int b);
void swapObjects(int object1, int object2);
+ Common::String convertFilePath(const byte *src);
+ Common::String convertSavePath(const byte *src);
+ Common::String convertSavePathOld(const byte *src);
+
+ Common::SeekableReadStream *openFileForReading(const byte *fileName);
+ Common::SeekableReadStream *openSaveFileForReading(const byte *fileName);
+ Common::WriteStream *openSaveFileForWriting(const byte *fileName);
+ Common::WriteStream *openSaveFileForAppending(const byte *fileName);
+ void deleteSaveFile(const byte *fileName);
+ void renameSaveFile(const byte *from, const byte *to);
+
+ Common::SeekableReadStream *openSaveFileForReading(int slot, bool compat, Common::String &fileName);
+ Common::WriteStream *openSaveFileForWriting(int slot, bool compat, Common::String &fileName);
+
/* HE version 60 script opcodes */
void o60_setState();
void o60_roomOps();
diff --git a/engines/scumm/he/logic/football.cpp b/engines/scumm/he/logic/football.cpp
index ea990ca86b..215fdf0179 100644
--- a/engines/scumm/he/logic/football.cpp
+++ b/engines/scumm/he/logic/football.cpp
@@ -449,25 +449,26 @@ int LogicHEfootball2002::initScreenTranslations() {
int LogicHEfootball2002::getPlaybookFiles(int32 *args) {
// Get the pattern and then skip over the directory prefix ("*\" or "*:")
- Common::String pattern = (const char *)_vm->getStringAddress(args[0] & ~0x33539000) + 2;
+ // Also prepend the target name
+ Common::String targetName = _vm->getTargetName();
+ Common::String basePattern = ((const char *)_vm->getStringAddress(args[0] & ~0x33539000) + 2);
+ Common::String pattern = targetName + '-' + basePattern;
// Prepare a buffer to hold the file names
- char buffer[1000];
- buffer[0] = 0;
+ Common::String output;
// Get the list of file names that match the pattern and iterate over it
Common::StringArray fileList = _vm->getSaveFileManager()->listSavefiles(pattern);
- for (uint32 i = 0; i < fileList.size() && strlen(buffer) < 970; i++) {
+ for (uint32 i = 0; i < fileList.size(); i++) {
// Isolate the base part of the filename and concatenate it to our buffer
- Common::String fileName = Common::String(fileList[i].c_str(), fileList[i].size() - (pattern.size() - 1));
- strcat(buffer, fileName.c_str());
- strcat(buffer, ">"); // names separated by '>'
+ Common::String fileName(fileList[i].c_str() + targetName.size() + 1, fileList[i].size() - (basePattern.size() - 1) - (targetName.size() + 1));
+ output += fileName + '>'; // names separated by '>'
}
// Now store the result in an array
- int array = _vm->setupStringArray(strlen(buffer));
- strcpy((char *)_vm->getStringAddress(array), buffer);
+ int array = _vm->setupStringArray(output.size());
+ strcpy((char *)_vm->getStringAddress(array), output.c_str());
// And store the array index in variable 108
writeScummVar(108, array);
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 987f74957c..c26e3f57ea 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -1642,7 +1642,7 @@ void ScummEngine_v100he::o100_roomOps() {
copyScriptString((byte *)buffer, sizeof(buffer));
- _saveLoadFileName = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
+ _saveLoadFileName = (char *)buffer;
debug(1, "o100_roomOps: case 137: filename %s", _saveLoadFileName.c_str());
_saveLoadFlag = pop();
@@ -2263,11 +2263,10 @@ void ScummEngine_v100he::o100_videoOps() {
if (_videoParams.flags == 0)
_videoParams.flags = 4;
- const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename, sizeof(_videoParams.filename));
if (_videoParams.flags == 2) {
- VAR(119) = _moviePlay->load(filename, _videoParams.flags, _videoParams.wizResNum);
+ VAR(119) = _moviePlay->load(convertFilePath(_videoParams.filename), _videoParams.flags, _videoParams.wizResNum);
} else {
- VAR(119) = _moviePlay->load(filename, _videoParams.flags);
+ VAR(119) = _moviePlay->load(convertFilePath(_videoParams.filename), _videoParams.flags);
}
} else if (_videoParams.status == 19) {
// Stop video
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index bbd8725904..409fb7edf7 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -90,59 +90,214 @@ void ScummEngine_v60he::setupOpcodes() {
_opcodes[0xed].setProc(0, 0);
}
-int ScummEngine_v60he::convertFilePath(byte *dst, int dstSize) {
- debug(1, "convertFilePath: original filePath is %s", dst);
-
- int len = resStrLen(dst);
-
- // Switch all \ to / for portablity
- for (int i = 0; i < len; i++)
- if (dst[i] == '\\')
- dst[i] = '/';
-
- if (_game.platform == Common::kPlatformMacintosh) {
- // Remove : prefix in HE71 games
- if (dst[0] == ':') {
- len -= 1;
- memmove(dst, dst + 1, len);
- dst[len] = 0;
+Common::String ScummEngine_v60he::convertFilePath(const byte *src) {
+ debug(2, "convertFilePath in: '%s'", (const char *)src);
+
+ int srcSize = resStrLen(src);
+ int start = 0;
+
+ if (srcSize > 2) {
+ if (src[0] == ':') { // Game Data Path (Macintosh)
+ // The default game data path is set to ':' by ScummVM
+ start = 1;
+ } else if (src[0] == '.' && src[1] == '\\') { // Game Data Path (Windows)
+ // The default game data path is set to '.\\' by ScummVM
+ start = 2;
+ } else if (src[0] == '*' && src[1] == '\\') { // Save Game Path (Windows HE72 - HE100)
+ // The default save game path is set to '*\\' by ScummVM
+ start = 2;
+ } else if (src[0] == '*' && src[1] == ':') { // Save Game Path (Macintosh HE72 - HE100)
+ // The default save game path is set to '*:' by ScummVM
+ start = 2;
+ } else if (src[0] == 'c' && src[1] == ':') { // Save Game Path (HE60 - HE71)
+ // The default save path is game path (DOS) or 'c:\\hegames\\' (Windows)
+ for (start = srcSize; start != 0; start--)
+ if (src[start - 1] == '\\')
+ break;
+ } else if (src[0] == 'u' && src[1] == 's') { // Save Game Path (Moonbase Commander)
+ // The default save path is 'user\\'
+ start = 5;
}
+ }
- // Switch all : to / for portablity
- for (int i = 0; i < len; i++) {
- if (dst[i] == ':')
- dst[i] = '/';
- }
+ Common::String dst;
+
+ for (int i = start; i < srcSize; i++) {
+ // Convert path separators
+ if (src[i] == '\\' || src[i] == ':')
+ dst += '/';
+ else
+ dst += src[i];
}
- // Strip path
- int r = 0;
- if (dst[len - 3] == 's' && dst[len - 2] == 'g') { // Save Game File
- // Change filename prefix to target name, for save game files.
- const char c = dst[len - 1];
- snprintf((char *)dst, dstSize, "%s.sg%c", _targetName.c_str(), c);
- } else if (dst[0] == '.' && dst[1] == '/') { // Game Data Path
- // The default game data path is set to './' by ScummVM
- r = 2;
- } else if (dst[0] == '*' && dst[1] == '/') { // Save Game Path (Windows HE72 - HE100)
- // The default save game path is set to '*/' by ScummVM
- r = 2;
- } else if (dst[0] == '*' && dst[1] == ':') { // Save Game Path (Macintosh HE72 - HE100)
- // The default save game path is set to ':/' by ScummVM
- r = 2;
- } else if (dst[0] == 'c' && dst[1] == ':') { // Save Game Path (HE60 - HE71)
- // The default save path is game path (DOS) or 'c:/hegames/' (Windows)
- for (r = len; r != 0; r--) {
- if (dst[r - 1] == '/')
- break;
+ // Sanity check
+ if (dst.lastChar() == '/')
+ dst.deleteLastChar();
+
+ debug(2, "convertFilePath out: '%s'", dst.c_str());
+
+ return dst;
+}
+
+Common::String ScummEngine_v60he::convertSavePath(const byte *src) {
+ debug(2, "convertSavePath in: '%s'", (const char *)src);
+
+ Common::String filePath = convertFilePath(src);
+
+ // Strip us down to only the file
+ for (int32 i = filePath.size() - 1; i >= 0; i--) {
+ if (filePath[i] == '/') {
+ filePath = Common::String(filePath.c_str() + i + 1);
+ break;
}
- } else if (dst[0] == 'u' && dst[1] == 's') { // Save Game Path (Moonbase Commander)
+ }
+
+ // Prepend the target name
+ filePath = _targetName + '-' + filePath;
+
+ debug(2, "convertSavePath out: '%s'", filePath.c_str());
+
+ return filePath;
+}
+
+Common::String ScummEngine_v60he::convertSavePathOld(const byte *src) {
+ // This is provided solely for loading older saved games.
+ // No new saves should go through this function.
+
+ int srcSize = resStrLen(src);
+
+ // Old hacky target name insertion
+ // (This breaks the soccer and football games)
+ if (src[srcSize - 3] == 's' && src[srcSize - 2] == 'g')
+ return _targetName + ".sg" + (char)src[srcSize - 1];
+
+ if (src[0] == 'u' && src[1] == 's') {
+ // Save Game Path (Moonbase Commander)
// The default save path is 'user/'
- r = 5;
+ return (const char *)src + 5;
+ } else if (src[0] == '*' && (src[1] == '\\' || src[1] == ':')) {
+ // Save Game Path (HE72 - HE100)
+ // The default save game path is set to '*\\' by ScummVM for Windows
+ // and '*:' for Macintosh
+ return (const char *)src + 2;
+ } else if (src[0] == 'c' && src[1] == ':') {
+ // The default save path is game path (DOS) or 'c:\\hegames\\' (Windows)
+ for (int i = srcSize; i > 0; i--)
+ if (src[i] == '\\')
+ return (const char *)src + i + 1;
+ }
+
+ // Can't reach here
+ return "";
+}
+
+Common::SeekableReadStream *ScummEngine_v60he::openFileForReading(const byte *fileName) {
+ Common::SeekableReadStream *saveFile = openSaveFileForReading(fileName);
+
+ if (saveFile)
+ return saveFile;
+
+ return SearchMan.createReadStreamForMember(convertFilePath(fileName));
+}
+
+Common::SeekableReadStream *ScummEngine_v60he::openSaveFileForReading(const byte *fileName) {
+ Common::SeekableReadStream *file = _saveFileMan->openForLoading(convertSavePath(fileName));
+
+ if (file)
+ return file;
+
+ return _saveFileMan->openForLoading(convertSavePathOld(fileName));
+}
+
+Common::WriteStream *ScummEngine_v60he::openSaveFileForWriting(const byte *fileName) {
+ return _saveFileMan->openForSaving(convertSavePath(fileName));
+}
+
+void ScummEngine_v60he::deleteSaveFile(const byte *fileName) {
+ Common::String convertedName = convertSavePath(fileName);
+
+ if (!_saveFileMan->listSavefiles(convertedName).empty()) {
+ _saveFileMan->removeSavefile(convertedName);
+ return;
}
- debug(1, "convertFilePath: converted filePath is %s", dst + r);
- return r;
+ convertedName = convertSavePathOld(fileName);
+
+ if (!_saveFileMan->listSavefiles(convertedName).empty())
+ _saveFileMan->removeSavefile(convertedName);
+}
+
+void ScummEngine_v60he::renameSaveFile(const byte *from, const byte *to) {
+ Common::String toName = convertSavePath(to);
+
+ if (_saveFileMan->renameSavefile(convertSavePathOld(from), toName))
+ return;
+
+ _saveFileMan->renameSavefile(convertSavePath(from), toName);
+}
+
+Common::WriteStream *ScummEngine_v60he::openSaveFileForAppending(const byte *fileName) {
+ Common::SeekableReadStream *initialFile = openSaveFileForReading(fileName);
+ byte *initialData = 0;
+ uint32 initialDataSize = 0;
+
+ if (initialFile) {
+ initialDataSize = initialFile->size();
+
+ if (initialDataSize > 0) {
+ initialData = new byte[initialDataSize];
+ initialFile->read(initialData, initialDataSize);
+ }
+
+ delete initialFile;
+ }
+
+ Common::WriteStream *output = openSaveFileForWriting(fileName);
+
+ if (!output) {
+ delete[] initialData;
+ return nullptr;
+ }
+
+ if (initialData) {
+ output->write(initialData, initialDataSize);
+ delete[] initialData;
+ }
+
+ return output;
+}
+
+Common::SeekableReadStream *ScummEngine_v60he::openSaveFileForReading(int slot, bool compat, Common::String &fileName) {
+ if (slot == 255) {
+ // HACK: Allow custom filenames for save game system in HE Games
+ fileName = convertSavePath((const byte *)_saveLoadFileName.c_str());
+
+ Common::SeekableReadStream *stream = _saveFileMan->openForLoading(fileName);
+ if (stream)
+ return stream;
+
+ Common::String oldFileName = convertSavePathOld((const byte *)_saveLoadFileName.c_str());
+ stream = _saveFileMan->openForLoading(oldFileName);
+
+ if (stream) {
+ fileName = oldFileName;
+ return stream;
+ }
+
+ return 0;
+ }
+
+ return ScummEngine::openSaveFileForReading(slot, compat, fileName);
+}
+
+Common::WriteStream *ScummEngine_v60he::openSaveFileForWriting(int slot, bool compat, Common::String &fileName) {
+ if (slot == 255) {
+ // HACK: Allow custom filenames for save game system in HE Games
+ fileName = convertSavePath((const byte *)_saveLoadFileName.c_str());
+ return _saveFileMan->openForSaving(fileName);
+ }
+
+ return ScummEngine::openSaveFileForWriting(slot, compat, fileName);
}
void ScummEngine_v60he::o60_setState() {
@@ -284,7 +439,7 @@ void ScummEngine_v60he::o60_roomOps() {
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
- _saveLoadFileName = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
+ _saveLoadFileName = (char *)buffer;
debug(1, "o60_roomOps: case 221: filename %s", _saveLoadFileName.c_str());
_saveLoadFlag = pop();
@@ -692,14 +847,12 @@ void virtScreenSavePackByte(vsPackCtx *ctx, uint8 *&dst, int len, uint8 b) {
void ScummEngine_v60he::o60_openFile() {
int mode, len, slot, i;
byte buffer[100];
- const char *filename;
convertMessageToString(_scriptPointer, buffer, sizeof(buffer));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
- filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
- debug(1, "Final filename to %s", filename);
+ debug(1, "Trying to open file '%s'", (char *)buffer);
mode = pop();
slot = -1;
@@ -713,14 +866,10 @@ void ScummEngine_v60he::o60_openFile() {
if (slot != -1) {
switch (mode) {
case 1:
- // TODO / FIXME: Consider using listSavefiles to avoid unneccessary openForLoading calls
- _hInFileTable[slot] = _saveFileMan->openForLoading(filename);
- if (_hInFileTable[slot] == 0) {
- _hInFileTable[slot] = SearchMan.createReadStreamForMember(filename);
- }
+ _hInFileTable[slot] = openFileForReading(buffer);
break;
case 2:
- _hOutFileTable[slot] = _saveFileMan->openForSaving(filename);
+ _hOutFileTable[slot] = openSaveFileForWriting(buffer);
break;
default:
error("o60_openFile(): wrong open file mode %d", mode);
@@ -750,25 +899,19 @@ void ScummEngine_v60he::o60_closeFile() {
void ScummEngine_v60he::o60_deleteFile() {
int len;
byte buffer[100];
- const char *filename;
convertMessageToString(_scriptPointer, buffer, sizeof(buffer));
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
- filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
-
- debug(1, "o60_deleteFile (\"%s\")", filename);
+ debug(1, "o60_deleteFile (\"%s\")", (char *)buffer);
- if (!_saveFileMan->listSavefiles(filename).empty()) {
- _saveFileMan->removeSavefile(filename);
- }
+ deleteSaveFile(buffer);
}
void ScummEngine_v60he::o60_rename() {
int len;
byte buffer1[100], buffer2[100];
- const char *newFilename, *oldFilename;
convertMessageToString(_scriptPointer, buffer1, sizeof(buffer1));
len = resStrLen(_scriptPointer);
@@ -778,12 +921,9 @@ void ScummEngine_v60he::o60_rename() {
len = resStrLen(_scriptPointer);
_scriptPointer += len + 1;
- oldFilename = (char *)buffer1 + convertFilePath(buffer1, sizeof(buffer1));
- newFilename = (char *)buffer2 + convertFilePath(buffer2, sizeof(buffer2));
-
- debug(1, "o60_rename (\"%s\" to \"%s\")", oldFilename, newFilename);
+ debug(1, "o60_rename (\"%s\" to \"%s\")", (char *)buffer1, (char *)buffer2);
- _saveFileMan->renameSavefile(oldFilename, newFilename);
+ renameSaveFile(buffer1, buffer2);
}
int ScummEngine_v60he::readFileToArray(int slot, int32 size) {
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 42bf9a4bb6..cfa2be7275 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -710,7 +710,7 @@ void ScummEngine_v72he::o72_roomOps() {
copyScriptString((byte *)buffer, sizeof(buffer));
- _saveLoadFileName = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
+ _saveLoadFileName = (char *)buffer;
debug(1, "o72_roomOps: case 221: filename %s", _saveLoadFileName.c_str());
_saveLoadFlag = pop();
@@ -1390,10 +1390,7 @@ void ScummEngine_v72he::o72_openFile() {
mode = pop();
copyScriptString(buffer, sizeof(buffer));
- debug(1, "Original filename %s", buffer);
-
- const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
- debug(1, "Final filename to %s", filename);
+ debug(1, "Trying to open file '%s'", (char *)buffer);
slot = -1;
for (i = 1; i < 17; i++) {
@@ -1406,48 +1403,17 @@ void ScummEngine_v72he::o72_openFile() {
if (slot != -1) {
switch (mode) {
case 1: // Read mode
- if (!_saveFileMan->listSavefiles(filename).empty()) {
- _hInFileTable[slot] = _saveFileMan->openForLoading(filename);
- } else {
- _hInFileTable[slot] = SearchMan.createReadStreamForMember(filename);
- }
+ _hInFileTable[slot] = openFileForReading(buffer);
break;
case 2: // Write mode
- if (!strchr(filename, '/')) {
- _hOutFileTable[slot] = _saveFileMan->openForSaving(filename);
+ if (!strchr((char *)buffer, '/')) {
+ _hOutFileTable[slot] = openSaveFileForWriting(buffer);
}
break;
- case 6: { // Append mode
- if (strchr(filename, '/'))
- break;
-
- // First check if the file already exists
- Common::InSaveFile *initialState = 0;
- if (!_saveFileMan->listSavefiles(filename).empty())
- initialState = _saveFileMan->openForLoading(filename);
- else
- initialState = SearchMan.createReadStreamForMember(filename);
-
- // Read in the data from the initial file
- uint32 initialSize = 0;
- byte *initialData = 0;
- if (initialState) {
- initialSize = initialState->size();
- initialData = new byte[initialSize];
- initialState->read(initialData, initialSize);
- delete initialState;
- }
-
- // Attempt to open a save file
- _hOutFileTable[slot] = _saveFileMan->openForSaving(filename);
-
- // Begin us off with the data from the previous file
- if (_hOutFileTable[slot] && initialData) {
- _hOutFileTable[slot]->write(initialData, initialSize);
- delete[] initialData;
- }
-
- } break;
+ case 6: // Append mode
+ if (!strchr((char *)buffer, '/'))
+ _hOutFileTable[slot] = openSaveFileForAppending(buffer);
+ break;
default:
error("o72_openFile(): wrong open file mode %d", mode);
}
@@ -1565,13 +1531,10 @@ void ScummEngine_v72he::o72_deleteFile() {
byte buffer[256];
copyScriptString(buffer, sizeof(buffer));
- const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
- debug(1, "o72_deleteFile(%s)", filename);
+ debug(1, "o72_deleteFile(%s)", (char *)buffer);
- if (!_saveFileMan->listSavefiles(filename).empty()) {
- _saveFileMan->removeSavefile(filename);
- }
+ deleteSaveFile(buffer);
}
void ScummEngine_v72he::o72_rename() {
@@ -1580,12 +1543,9 @@ void ScummEngine_v72he::o72_rename() {
copyScriptString(buffer1, sizeof(buffer1));
copyScriptString(buffer2, sizeof(buffer2));
- const char *newFilename = (char *)buffer1 + convertFilePath(buffer1, sizeof(buffer1));
- const char *oldFilename = (char *)buffer2 + convertFilePath(buffer2, sizeof(buffer2));
-
- _saveFileMan->renameSavefile(oldFilename, newFilename);
+ debug(1, "o72_rename(%s to %s)", (char *)buffer2, (char *)buffer1);
- debug(1, "o72_rename(%s to %s)", oldFilename, newFilename);
+ renameSaveFile(buffer2, buffer1);
}
void ScummEngine_v72he::o72_getPixel() {
diff --git a/engines/scumm/he/script_v80he.cpp b/engines/scumm/he/script_v80he.cpp
index ae43d714ad..7a8f230fc0 100644
--- a/engines/scumm/he/script_v80he.cpp
+++ b/engines/scumm/he/script_v80he.cpp
@@ -89,14 +89,8 @@ void ScummEngine_v80he::o80_getFileSize() {
byte buffer[256];
copyScriptString(buffer, sizeof(buffer));
- const char *filename = (char *)buffer + convertFilePath(buffer, sizeof(buffer));
- Common::SeekableReadStream *f = 0;
- if (!_saveFileMan->listSavefiles(filename).empty()) {
- f = _saveFileMan->openForLoading(filename);
- } else {
- f = SearchMan.createReadStreamForMember(filename);
- }
+ Common::SeekableReadStream *f = openFileForReading(buffer);
if (!f) {
push(-1);
@@ -143,14 +137,12 @@ void ScummEngine_v80he::o80_readConfigFile() {
byte option[128], section[128], filename[256];
byte *data;
Common::String entry;
- int len, r;
+ int len;
copyScriptString(option, sizeof(option));
copyScriptString(section, sizeof(section));
copyScriptString(filename, sizeof(filename));
- r = convertFilePath(filename, sizeof(filename));
-
if (_game.id == GID_TREASUREHUNT) {
// WORKAROUND: Remove invalid characters
if (!strcmp((char *)section, "Blue'sTreasureHunt-Disc1"))
@@ -159,13 +151,13 @@ void ScummEngine_v80he::o80_readConfigFile() {
memcpy(section, "BluesTreasureHunt-Disc2\0", 24);
}
- if (!strcmp((const char *)filename, "map (i)")) {
+ if (!strcmp((const char *)filename, ":map (i)")) {
// Mac resource fork config file
// (as used by only mustard mac for map data?)
Common::MacResManager resFork;
- if (!resFork.open((const char *)filename) || !resFork.hasResFork())
- error("Could not open '%s'", filename);
+ if (!resFork.open("map (i)") || !resFork.hasResFork())
+ error("Could not open 'map (i)'");
Common::String prefResName = Common::String::format("Pref:%s.%s", (const char *)section, (const char *)option);
Common::SeekableReadStream *res = resFork.getResource(prefResName);
@@ -180,13 +172,14 @@ void ScummEngine_v80he::o80_readConfigFile() {
}
} else {
// Normal Windows INI files
- Common::INIFile confFile;
- if (!strcmp((char *)filename + r, "map.ini"))
- confFile.loadFromFile((const char *)filename + r);
- else
- confFile.loadFromSaveFile((const char *)filename + r);
+ Common::SeekableReadStream *stream = openFileForReading(filename);
- confFile.getKey((const char *)option, (const char *)section, entry);
+ if (stream) {
+ Common::INIFile iniFile;
+ iniFile.loadFromStream(*stream);
+ iniFile.getKey((const char *)option, (const char *)section, entry);
+ delete stream;
+ }
}
byte subOp = fetchScriptByte();
@@ -216,7 +209,7 @@ void ScummEngine_v80he::o80_readConfigFile() {
void ScummEngine_v80he::o80_writeConfigFile() {
byte filename[256], section[256], option[256], string[1024];
- int r, value;
+ int value;
byte subOp = fetchScriptByte();
@@ -240,8 +233,6 @@ void ScummEngine_v80he::o80_writeConfigFile() {
error("o80_writeConfigFile: default type %d", subOp);
}
- r = convertFilePath(filename, sizeof(filename));
-
if (_game.id == GID_TREASUREHUNT) {
// WORKAROUND: Remove invalid characters
if (!strcmp((char *)section, "Blue'sTreasureHunt-Disc1"))
@@ -250,10 +241,16 @@ void ScummEngine_v80he::o80_writeConfigFile() {
memcpy(section, "BluesTreasureHunt-Disc2\0", 24);
}
- Common::INIFile ConfFile;
- ConfFile.loadFromSaveFile((const char *)filename + r);
- ConfFile.setKey((char *)option, (char *)section, (char *)string);
- ConfFile.saveToSaveFile((const char *)filename + r);
+ Common::INIFile iniFile;
+ Common::SeekableReadStream *iniStream = openSaveFileForReading(filename);
+
+ if (iniStream) {
+ iniFile.loadFromStream(*iniStream);
+ delete iniStream;
+ }
+
+ iniFile.setKey((char *)option, (char *)section, (char *)string);
+ iniFile.saveToSaveFile(convertSavePath(filename));
debug(1,"o80_writeConfigFile: Filename %s Section %s Option %s String %s", filename, section, option, string);
}
diff --git a/engines/scumm/he/script_v90he.cpp b/engines/scumm/he/script_v90he.cpp
index 1ea9960a18..f844c51cc6 100644
--- a/engines/scumm/he/script_v90he.cpp
+++ b/engines/scumm/he/script_v90he.cpp
@@ -1429,11 +1429,10 @@ void ScummEngine_v90he::o90_videoOps() {
if (_videoParams.flags == 0)
_videoParams.flags = 4;
- const char *filename = (char *)_videoParams.filename + convertFilePath(_videoParams.filename, sizeof(_videoParams.filename));
if (_videoParams.flags & 2) {
- VAR(119) = _moviePlay->load(filename, _videoParams.flags, _videoParams.wizResNum);
+ VAR(119) = _moviePlay->load(convertFilePath(_videoParams.filename), _videoParams.flags, _videoParams.wizResNum);
} else {
- VAR(119) = _moviePlay->load(filename, _videoParams.flags);
+ VAR(119) = _moviePlay->load(convertFilePath(_videoParams.filename), _videoParams.flags);
}
} else if (_videoParams.status == 165) {
// Stop video
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp
index ca360803bd..b3511648bd 100644
--- a/engines/scumm/he/wiz_he.cpp
+++ b/engines/scumm/he/wiz_he.cpp
@@ -2355,8 +2355,6 @@ void Wiz::remapWizImagePal(const WizParameters *params) {
}
void Wiz::processWizImage(const WizParameters *params) {
- byte buffer[260];
-
debug(3, "processWizImage: processMode %d", params->processMode);
switch (params->processMode) {
case 0:
@@ -2370,15 +2368,7 @@ void Wiz::processWizImage(const WizParameters *params) {
break;
case 3:
if (params->processFlags & kWPFUseFile) {
- Common::SeekableReadStream *f = NULL;
- memcpy(buffer, params->filename, 260);
- const char *filename = (char *)buffer + _vm->convertFilePath(buffer, sizeof(buffer));
-
- if (!_vm->_saveFileMan->listSavefiles(filename).empty()) {
- f = _vm->_saveFileMan->openForLoading(filename);
- } else {
- f = SearchMan.createReadStreamForMember(filename);
- }
+ Common::SeekableReadStream *f = _vm->openFileForReading(params->filename);
if (f) {
uint32 id = f->readUint32BE();
@@ -2388,7 +2378,7 @@ void Wiz::processWizImage(const WizParameters *params) {
byte *p = _vm->_res->createResource(rtImage, params->img.resNum, size);
if (f->read(p, size) != size) {
_vm->_res->nukeResource(rtImage, params->img.resNum);
- error("i/o error when reading '%s'", filename);
+ error("i/o error when reading '%s'", params->filename);
_vm->VAR(_vm->VAR_GAME_LOADED) = -2;
_vm->VAR(119) = -2;
} else {
@@ -2404,16 +2394,12 @@ void Wiz::processWizImage(const WizParameters *params) {
} else {
_vm->VAR(_vm->VAR_GAME_LOADED) = -3;
_vm->VAR(119) = -3;
- debug(0, "Unable to open for read '%s'", filename);
+ debug(0, "Unable to open for read '%s'", params->filename);
}
}
break;
case 4:
if (params->processFlags & kWPFUseFile) {
- Common::OutSaveFile *f;
- memcpy(buffer, params->filename, 260);
- const char *filename = (char *)buffer + _vm->convertFilePath(buffer, sizeof(buffer));
-
switch (params->fileWriteMode) {
case 2:
_vm->VAR(119) = -1;
@@ -2421,15 +2407,17 @@ void Wiz::processWizImage(const WizParameters *params) {
case 1:
// TODO Write image to file
break;
- case 0:
- if (!(f = _vm->_saveFileMan->openForSaving(filename))) {
- debug(0, "Unable to open for write '%s'", filename);
+ case 0: {
+ Common::WriteStream *f = _vm->openSaveFileForWriting(params->filename);
+
+ if (!f) {
+ debug(0, "Unable to open for write '%s'", params->filename);
_vm->VAR(119) = -3;
} else {
byte *p = _vm->getResourceAddress(rtImage, params->img.resNum);
uint32 size = READ_BE_UINT32(p + 4);
if (f->write(p, size) != size) {
- error("i/o error when writing '%s'", filename);
+ error("i/o error when writing '%s'", params->filename);
_vm->VAR(119) = -2;
} else {
_vm->VAR(119) = 0;
@@ -2438,6 +2426,7 @@ void Wiz::processWizImage(const WizParameters *params) {
delete f;
}
break;
+ }
default:
error("processWizImage: processMode 4 unhandled fileWriteMode %d", params->fileWriteMode);
}
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 8170a032d9..848e288589 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -148,7 +148,17 @@ void ScummEngine::requestLoad(int slot) {
_saveLoadFlag = 2; // 2 for load
}
-static bool saveSaveGameHeader(Common::OutSaveFile *out, SaveGameHeader &hdr) {
+Common::SeekableReadStream *ScummEngine::openSaveFileForReading(int slot, bool compat, Common::String &fileName) {
+ fileName = makeSavegameName(slot, compat);
+ return _saveFileMan->openForLoading(fileName);
+}
+
+Common::WriteStream *ScummEngine::openSaveFileForWriting(int slot, bool compat, Common::String &fileName) {
+ fileName = makeSavegameName(slot, compat);
+ return _saveFileMan->openForSaving(fileName);
+}
+
+static bool saveSaveGameHeader(Common::WriteStream *out, SaveGameHeader &hdr) {
hdr.type = MKTAG('S','C','V','M');
hdr.size = 0;
hdr.ver = CURRENT_VER;
@@ -160,7 +170,7 @@ static bool saveSaveGameHeader(Common::OutSaveFile *out, SaveGameHeader &hdr) {
return true;
}
-bool ScummEngine::saveState(Common::OutSaveFile *out, bool writeHeader) {
+bool ScummEngine::saveState(Common::WriteStream *out, bool writeHeader) {
SaveGameHeader hdr;
if (writeHeader) {
@@ -177,20 +187,13 @@ bool ScummEngine::saveState(Common::OutSaveFile *out, bool writeHeader) {
return true;
}
-bool ScummEngine::saveState(int slot, bool compat) {
+bool ScummEngine::saveState(int slot, bool compat, Common::String &filename) {
bool saveFailed;
- Common::String filename;
- Common::OutSaveFile *out;
pauseEngine(true);
- if (_saveLoadSlot == 255) {
- // Allow custom filenames for save game system in HE Games
- filename = _saveLoadFileName;
- } else {
- filename = makeSavegameName(slot, compat);
- }
- if (!(out = _saveFileMan->openForSaving(filename)))
+ Common::WriteStream *out = openSaveFileForWriting(slot, compat, filename);
+ if (!out)
return false;
saveFailed = false;
@@ -307,18 +310,17 @@ static bool loadSaveGameHeader(Common::SeekableReadStream *in, SaveGameHeader &h
}
bool ScummEngine::loadState(int slot, bool compat) {
+ // Wrapper around the other variant
Common::String filename;
- Common::SeekableReadStream *in;
+ return loadState(slot, compat, filename);
+}
+
+bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
SaveGameHeader hdr;
int sb, sh;
- if (_saveLoadSlot == 255) {
- // Allow custom filenames for save game system in HE Games
- filename = _saveLoadFileName;
- } else {
- filename = makeSavegameName(slot, compat);
- }
- if (!(in = _saveFileMan->openForLoading(filename)))
+ Common::SeekableReadStream *in = openSaveFileForReading(slot, compat, filename);
+ if (!in)
return false;
if (!loadSaveGameHeader(in, hdr)) {
@@ -634,100 +636,83 @@ bool ScummEngine::getSavegameName(int slot, Common::String &desc) {
return result;
}
-bool getSavegameName(Common::InSaveFile *in, Common::String &desc, int heversion) {
- SaveGameHeader hdr;
-
+namespace {
+bool loadAndCheckSaveGameHeader(Common::InSaveFile *in, int heversion, SaveGameHeader &hdr, Common::String *error = nullptr) {
if (!loadSaveGameHeader(in, hdr)) {
- desc = "Invalid savegame";
+ if (error) {
+ *error = "Invalid savegame";
+ }
return false;
}
- if (hdr.ver > CURRENT_VER)
+ if (hdr.ver > CURRENT_VER) {
hdr.ver = TO_LE_32(hdr.ver);
+ }
+
if (hdr.ver < VER(7) || hdr.ver > CURRENT_VER) {
- desc = "Invalid version";
+ if (error) {
+ *error = "Invalid version";
+ }
return false;
}
// We (deliberately) broke HE savegame compatibility at some point.
if (hdr.ver < VER(57) && heversion >= 60) {
- desc = "Unsupported version";
+ if (error) {
+ *error = "Unsupported version";
+ }
return false;
}
hdr.name[sizeof(hdr.name) - 1] = 0;
- desc = hdr.name;
return true;
}
+} // End of anonymous namespace
-Graphics::Surface *ScummEngine::loadThumbnailFromSlot(const char *target, int slot) {
- Common::SeekableReadStream *in;
+bool getSavegameName(Common::InSaveFile *in, Common::String &desc, int heversion) {
SaveGameHeader hdr;
- if (slot < 0)
- return 0;
-
- Common::String filename = ScummEngine::makeSavegameName(target, slot, false);
- if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
- return 0;
- }
-
- if (!loadSaveGameHeader(in, hdr)) {
- delete in;
- return 0;
+ if (!loadAndCheckSaveGameHeader(in, heversion, hdr, &desc)) {
+ return false;
}
- if (hdr.ver > CURRENT_VER)
- hdr.ver = TO_LE_32(hdr.ver);
- if (hdr.ver < VER(52)) {
- delete in;
- return 0;
- }
+ desc = hdr.name;
+ return true;
+}
- Graphics::Surface *thumb = 0;
- if (Graphics::checkThumbnailHeader(*in)) {
- thumb = Graphics::loadThumbnail(*in);
+bool ScummEngine::querySaveMetaInfos(const char *target, int slot, int heversion, Common::String &desc, Graphics::Surface *&thumbnail, SaveStateMetaInfos *&timeInfos) {
+ if (slot < 0) {
+ return false;
}
- delete in;
- return thumb;
-}
-
-bool ScummEngine::loadInfosFromSlot(const char *target, int slot, SaveStateMetaInfos *stuff) {
- Common::SeekableReadStream *in;
SaveGameHeader hdr;
+ const Common::String filename = ScummEngine::makeSavegameName(target, slot, false);
+ Common::ScopedPtr<Common::SeekableReadStream> in(g_system->getSavefileManager()->openForLoading(filename));
- if (slot < 0)
- return 0;
-
- Common::String filename = makeSavegameName(target, slot, false);
- if (!(in = g_system->getSavefileManager()->openForLoading(filename))) {
+ if (!in) {
return false;
}
- if (!loadSaveGameHeader(in, hdr)) {
- delete in;
+ if (!loadAndCheckSaveGameHeader(in.get(), heversion, hdr)) {
return false;
}
- if (hdr.ver > CURRENT_VER)
- hdr.ver = TO_LE_32(hdr.ver);
- if (hdr.ver < VER(56)) {
- delete in;
- return false;
- }
+ desc = hdr.name;
- if (!Graphics::skipThumbnail(*in)) {
- delete in;
- return false;
- }
+ if (hdr.ver > VER(52)) {
+ if (Graphics::checkThumbnailHeader(*in)) {
+ thumbnail = Graphics::loadThumbnail(*in);
+ }
- if (!loadInfos(in, stuff)) {
- delete in;
- return false;
+ if (hdr.ver > VER(57)) {
+ if (!loadInfos(in.get(), timeInfos)) {
+ return false;
+ }
+ } else {
+ timeInfos = nullptr;
+ }
}
- delete in;
return true;
}
@@ -781,7 +766,7 @@ bool ScummEngine::loadInfos(Common::SeekableReadStream *file, SaveStateMetaInfos
return true;
}
-void ScummEngine::saveInfos(Common::WriteStream* file) {
+void ScummEngine::saveInfos(Common::WriteStream *file) {
SaveInfoSection section;
section.type = MKTAG('I','N','F','O');
section.version = INFOSECTION_VERSION;
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index cc8665e450..39fbae8147 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2307,15 +2307,16 @@ void ScummEngine::scummLoop_handleSaveLoad() {
if (_game.version == 8 && _saveTemporaryState)
VAR(VAR_GAME_LOADED) = 0;
+ Common::String filename;
if (_saveLoadFlag == 1) {
- success = saveState(_saveLoadSlot, _saveTemporaryState);
+ success = saveState(_saveLoadSlot, _saveTemporaryState, filename);
if (!success)
errMsg = _("Failed to save game state to file:\n\n%s");
if (success && _saveTemporaryState && VAR_GAME_LOADED != 0xFF && _game.version <= 7)
VAR(VAR_GAME_LOADED) = 201;
} else {
- success = loadState(_saveLoadSlot, _saveTemporaryState);
+ success = loadState(_saveLoadSlot, _saveTemporaryState, filename);
if (!success)
errMsg = _("Failed to load game state from file:\n\n%s");
@@ -2323,7 +2324,6 @@ void ScummEngine::scummLoop_handleSaveLoad() {
VAR(VAR_GAME_LOADED) = (_game.version == 8) ? 1 : 203;
}
- Common::String filename = makeSavegameName(_saveLoadSlot, _saveTemporaryState);
if (!success) {
displayMessage(0, errMsg, filename.c_str());
} else if (_saveLoadFlag == 1 && _saveLoadSlot != 0 && !_saveTemporaryState) {
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index ca05c90936..7d3a01b895 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -595,14 +595,18 @@ protected:
Common::String _saveLoadFileName;
Common::String _saveLoadDescription;
- bool saveState(Common::OutSaveFile *out, bool writeHeader = true);
- bool saveState(int slot, bool compat);
+ bool saveState(Common::WriteStream *out, bool writeHeader = true);
+ bool saveState(int slot, bool compat, Common::String &fileName);
bool loadState(int slot, bool compat);
+ bool loadState(int slot, bool compat, Common::String &fileName);
virtual void saveOrLoad(Serializer *s);
void saveResource(Serializer *ser, ResType type, ResId idx);
void loadResource(Serializer *ser, ResType type, ResId idx);
void loadResourceOLD(Serializer *ser, ResType type, ResId idx); // "Obsolete"
+ virtual Common::SeekableReadStream *openSaveFileForReading(int slot, bool compat, Common::String &fileName);
+ virtual Common::WriteStream *openSaveFileForWriting(int slot, bool compat, Common::String &fileName);
+
Common::String makeSavegameName(int slot, bool temporary) const {
return makeSavegameName(_targetName, slot, temporary);
}
@@ -618,17 +622,14 @@ public:
void requestSave(int slot, const Common::String &name);
void requestLoad(int slot);
+ Common::String getTargetName() const { return _targetName; }
+
// thumbnail + info stuff
public:
- Graphics::Surface *loadThumbnailFromSlot(int slot) {
- return loadThumbnailFromSlot(_targetName.c_str(), slot);
- }
- static Graphics::Surface *loadThumbnailFromSlot(const char *target, int slot);
-
- static bool loadInfosFromSlot(const char *target, int slot, SaveStateMetaInfos *stuff);
+ static bool querySaveMetaInfos(const char *target, int slot, int heversion, Common::String &desc, Graphics::Surface *&thumbnail, SaveStateMetaInfos *&timeInfos);
protected:
- void saveInfos(Common::WriteStream* file);
+ void saveInfos(Common::WriteStream *file);
static bool loadInfos(Common::SeekableReadStream *file, SaveStateMetaInfos *stuff);
protected:
diff --git a/engines/sky/configure.engine b/engines/sky/configure.engine
new file mode 100644
index 0000000000..32b84849cb
--- /dev/null
+++ b/engines/sky/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 sky "Beneath a Steel Sky" yes
diff --git a/engines/sword1/configure.engine b/engines/sword1/configure.engine
new file mode 100644
index 0000000000..0578d176a9
--- /dev/null
+++ b/engines/sword1/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 sword1 "Broken Sword" yes
diff --git a/engines/sword2/configure.engine b/engines/sword2/configure.engine
new file mode 100644
index 0000000000..7153605433
--- /dev/null
+++ b/engines/sword2/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 sword2 "Broken Sword II" yes
diff --git a/engines/sword25/configure.engine b/engines/sword25/configure.engine
new file mode 100644
index 0000000000..1729bbeb33
--- /dev/null
+++ b/engines/sword25/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 sword25 "Broken Sword 2.5" no "" "" "png zlib 16bit"
diff --git a/engines/sword25/gfx/image/art.cpp b/engines/sword25/gfx/image/art.cpp
index 9c4b9fe8bd..e2eeaca33f 100644
--- a/engines/sword25/gfx/image/art.cpp
+++ b/engines/sword25/gfx/image/art.cpp
@@ -424,8 +424,7 @@ static void art_vpath_render_bez(ArtVpath **p_vpath, int *pn, int *pn_max,
x_m, y_m, xb1, yb1, xb2, yb2, x3, y3, flatness);
} else {
// don't subdivide
- art_vpath_add_point(p_vpath, pn, pn_max,
- ART_LINETO, x3, y3);
+ art_vpath_add_point(p_vpath, pn, pn_max, ART_LINETO, x3, y3);
}
}
diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp
index 57c8ec318f..bc7dd02636 100644
--- a/engines/sword25/gfx/renderobjectmanager.cpp
+++ b/engines/sword25/gfx/renderobjectmanager.cpp
@@ -103,13 +103,16 @@ bool RenderObjectManager::render() {
_uta->clear();
// Add rectangles of objects which don't exist in this frame any more
- for (RenderObjectQueue::iterator it = _prevQueue->begin(); it != _prevQueue->end(); ++it)
- if (!_currQueue->exists(*it))
- _uta->addRect((*it)._bbox);
- // Add rectangles of objects which are different from the previous frame
- for (RenderObjectQueue::iterator it = _currQueue->begin(); it != _currQueue->end(); ++it)
- if (!_prevQueue->exists(*it))
- _uta->addRect((*it)._bbox);
+ for (RenderObjectQueue::iterator it = _prevQueue->begin(); it != _prevQueue->end(); ++it) {
+ if (!_currQueue->exists(*it))
+ _uta->addRect((*it)._bbox);
+ }
+
+ // Add rectangles of objects which are different from the previous frame
+ for (RenderObjectQueue::iterator it = _currQueue->begin(); it != _currQueue->end(); ++it) {
+ if (!_prevQueue->exists(*it))
+ _uta->addRect((*it)._bbox);
+ }
RectangleList *updateRects = _uta->getRectangles();
Common::Array<int> updateRectsMinZ;
diff --git a/engines/sword25/util/lua/lopcodes.cpp b/engines/sword25/util/lua/lopcodes.cpp
index 9d76862ae2..8b0a3ab330 100644
--- a/engines/sword25/util/lua/lopcodes.cpp
+++ b/engines/sword25/util/lua/lopcodes.cpp
@@ -61,7 +61,7 @@ const char *const luaP_opnames[NUM_OPCODES+1] = {
const lu_byte luaP_opmodes[NUM_OPCODES] = {
/* T A B C mode opcode */
- opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
+ opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */
,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */
,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */
,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */
diff --git a/engines/sword25/util/lua/lua.h b/engines/sword25/util/lua/lua.h
index a3b7573ca5..4f557e462b 100644
--- a/engines/sword25/util/lua/lua.h
+++ b/engines/sword25/util/lua/lua.h
@@ -22,7 +22,7 @@
#define LUA_RELEASE "Lua 5.1.3"
#define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio"
-#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
+#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
/* mark for precompiled code (`<esc>Lua') */
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 3e6e40a8fa..9fe9e68a76 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -1808,6 +1808,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
displayMessage(dsAddr_uninterestingHaystackMsg); // "I don't see anything interesting about this haystack"
break;
+ case 0x6663:
+ displayMessage(dsAddr_uninterestingHaystackMsg); // "I don't see anything interesting about this haystack"
+ break;
+
case 0x666a:
displayMessage(dsAddr_moreComplicatedMsg); // "It's more complicated than that"
break;
@@ -2382,6 +2386,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
fnEgoDefaultPosition();
break;
+ case 0x5634:
+ displayMessage(dsAddr_pullObjMsg2); // "I can't reach it"
+ break;
+
case 0x563b:
playSound(5, 10);
setOns(1, 0);
@@ -3322,6 +3330,10 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
fnMansionIntrusionAttempt();
break;
+ case 0x830b:
+ displayMessage(dsAddr_noChainsawFuelMsg); // "There's no fuel in the chainsaw"
+ break;
+
case 0x8312: // hedgehog + plastic apple
dialog->showMark(76, scene);
setLan(1, 0);
diff --git a/engines/teenagent/configure.engine b/engines/teenagent/configure.engine
new file mode 100644
index 0000000000..223a0e884c
--- /dev/null
+++ b/engines/teenagent/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 teenagent "Teen Agent" yes
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index d6a2c0d3c6..3c3bc25e56 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -31,6 +31,9 @@
#include "common/rect.h"
#include "common/array.h"
+#include "gui/debugger.h"
+
+#include "teenagent/console.h"
#include "teenagent/dialog.h"
struct ADGameDescription;
@@ -50,7 +53,6 @@ struct UseHotspot;
class Scene;
class MusicPlayer;
class Dialog;
-class Console;
class Resources;
class Inventory;
@@ -84,6 +86,8 @@ public:
virtual bool canSaveGameStateCurrently() { return !_sceneBusy; }
virtual bool hasFeature(EngineFeature f) const;
+ GUI::Debugger *getDebugger() { return console; }
+
void init();
enum Action { kActionNone, kActionExamine, kActionUse };
diff --git a/engines/testbed/configure.engine b/engines/testbed/configure.engine
new file mode 100644
index 0000000000..c0a68c8eb8
--- /dev/null
+++ b/engines/testbed/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 testbed "TestBed: the Testing framework" no
diff --git a/engines/tinsel/configure.engine b/engines/tinsel/configure.engine
new file mode 100644
index 0000000000..c0f3e0a18d
--- /dev/null
+++ b/engines/tinsel/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 tinsel "Tinsel" yes
diff --git a/engines/tinsel/detection_tables.h b/engines/tinsel/detection_tables.h
index cc8166f295..6e83fce3b1 100644
--- a/engines/tinsel/detection_tables.h
+++ b/engines/tinsel/detection_tables.h
@@ -319,7 +319,7 @@ static const TinselGameDescription gameDescriptions[] = {
},
Common::DE_DEU,
Common::kPlatformDOS,
- ADGF_DROPLANGUAGE,
+ ADGF_DROPLANGUAGE | ADGF_CD,
GUIO0()
},
GID_DW1,
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp
index 3144ea7f94..bf7257f876 100644
--- a/engines/tinsel/music.cpp
+++ b/engines/tinsel/music.cpp
@@ -91,28 +91,29 @@ static const int enhancedAudioGRAVersion[] = {
};
static const int enhancedAudioSCNVersion[] = {
- 301, 302, 2, 1, 1, 301, 302, 3, 3, 4, // 1-10
- 4, 5, 6, 1, 7, 8, 9, 10, 8, 11, // 11-20
- 11, 12, 13, 13, 13, 13, 13, 14, 13, 13, // 21-30
- 15, 16, 17, 15, 18, 19, 20, 338, 21, 21, // 31-40
- 341, 342, 22, 22, 23, 24, 25, 26, 27, 28, // 41-50
- 29, 30, 31, 32, 33, 34, 35, 35, 36, 37, // 51-60
- 38, 39, 39, 39, 39, 40, 39, 41, 41, 42, // 61-70
- 43, 42, 44, 45, 41, 46, 48, 47, 48, 49, // 71-80
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, // 81-90
- 60, 61, 62, 63, 61, 64, 65, 66, 67, 68, // 91-100
- 69, 70, 68, 71, 72, 73, 74, 75, 12, 76, // 101-110
- 77, 78, 79, 80, 4, 4, 82, 83, 77, 4, // 111-120
- 84, 85, 86, 3124, 88, 89, 90, 88, 2, 2, // 121-130
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 131-140
- 3142, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150
- 97, 98, 99, 99 // 151-154
+ 301, 302, 2, 1, 1, 301, 302, 3, 3, 4, // 1-10
+ 4, 5, 6, 1, 7, 8, 9, 10, 8, 11, // 11-20
+ 11, 12, 13, 13, 13, 13, 13, 14, 13, 13, // 21-30
+ 15, 16, 17, 15, 18, 19, 20, 338, 21, 21, // 31-40
+ 341, 342, 22, 22, 23, 24, 25, 26, 27, 28, // 41-50
+ 29, 30, 31, 32, 33, 34, 35, 35, 36, 37, // 51-60
+ 38, 39, 39, 39, 39, 40, 39, 41, 41, 42, // 61-70
+ 43, 42, 44, 45, 41, 46, 48, 47, 48, 49, // 71-80
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, // 81-90
+ 60, 61, 62, 63, 61, 64, 65, 66, 67, 68, // 91-100
+ 69, 70, 68, 71, 72, 73, 74, 75, 12, 76, // 101-110
+ 77, 78, 79, 80, 4, 4, 82, 83, 77, 4, // 111-120
+ 84, 85, 86, 3124, 88, 89, 90, 88, 2, 2, // 121-130
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 131-140
+ 3142, 91, 92, 93, 94, 94, 95, 96, 52, 4, // 141-150
+ 97, 98, 99, 99 // 151-154
};
int GetTrackNumber(SCNHANDLE hMidi) {
- for (int i = 0; i < ARRAYSIZE(g_midiOffsets); i++)
+ for (int i = 0; i < ARRAYSIZE(g_midiOffsets); i++) {
if (g_midiOffsets[i] == hMidi)
return i;
+ }
return -1;
}
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp
index 043b18b8c5..6b6f4a5cd3 100644
--- a/engines/tinsel/scene.cpp
+++ b/engines/tinsel/scene.cpp
@@ -130,14 +130,14 @@ const SCENE_STRUC *GetSceneStruc(const byte *pStruc) {
const byte *p = pStruc;
memset(&g_tempStruc, 0, sizeof(SCENE_STRUC));
- g_tempStruc.numEntrance = READ_32(p); p += sizeof(uint32);
- g_tempStruc.numPoly = READ_32(p); p += sizeof(uint32);
- g_tempStruc.numTaggedActor = READ_32(p); p += sizeof(uint32);
- g_tempStruc.defRefer = READ_32(p); p += sizeof(uint32);
- g_tempStruc.hSceneScript = READ_32(p); p += sizeof(uint32);
- g_tempStruc.hEntrance = READ_32(p); p += sizeof(uint32);
- g_tempStruc.hPoly = READ_32(p); p += sizeof(uint32);
- g_tempStruc.hTaggedActor = READ_32(p); p += sizeof(uint32);
+ g_tempStruc.numEntrance = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.numPoly = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.numTaggedActor = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.defRefer = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.hSceneScript = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.hEntrance = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.hPoly = READ_UINT32(p); p += sizeof(uint32);
+ g_tempStruc.hTaggedActor = READ_UINT32(p); p += sizeof(uint32);
return &g_tempStruc;
}
@@ -168,7 +168,7 @@ static void SceneTinselProcess(CORO_PARAM, const void *param) {
assert(_ctx->pInit->hTinselCode); // Must have some code to run
_ctx->pic = InitInterpretContext(GS_SCENE,
- _ctx->pInit->hTinselCode,
+ FROM_32(_ctx->pInit->hTinselCode),
TinselV2 ? _ctx->pInit->event : NOEVENT,
NOPOLY, // No polygon
0, // No actor
@@ -210,7 +210,7 @@ void SendSceneTinselProcess(TINSEL_EVENT event) {
*/
static void LoadScene(SCNHANDLE scene, int entry) {
- int32 i;
+ uint32 i;
TP_INIT init;
const SCENE_STRUC *ss;
const ENTRANCE_STRUC *es;
@@ -239,17 +239,17 @@ static void LoadScene(SCNHANDLE scene, int entry) {
// Music stuff
char *cptr = (char *)FindChunk(scene, CHUNK_MUSIC_FILENAME);
assert(cptr);
- _vm->_pcmMusic->setMusicSceneDetails(ss->hMusicScript, ss->hMusicSegment, cptr);
+ _vm->_pcmMusic->setMusicSceneDetails(FROM_32(ss->hMusicScript), FROM_32(ss->hMusicSegment), cptr);
}
if (entry == NO_ENTRY_NUM) {
// Restoring scene
// Initialize all the polygons for this scene
- InitPolygons(ss->hPoly, ss->numPoly, true);
+ InitPolygons(FROM_32(ss->hPoly), FROM_32(ss->numPoly), true);
// Initialize the actors for this scene
- StartTaggedActors(ss->hTaggedActor, ss->numTaggedActor, false);
+ StartTaggedActors(FROM_32(ss->hTaggedActor), FROM_32(ss->numTaggedActor), false);
if (TinselV2)
// Returning from cutscene
@@ -259,18 +259,18 @@ static void LoadScene(SCNHANDLE scene, int entry) {
// Genuine new scene
// Initialize all the polygons for this scene
- InitPolygons(ss->hPoly, ss->numPoly, false);
+ InitPolygons(FROM_32(ss->hPoly), FROM_32(ss->numPoly), false);
// Initialize the actors for this scene
- StartTaggedActors(ss->hTaggedActor, ss->numTaggedActor, true);
+ StartTaggedActors(FROM_32(ss->hTaggedActor), FROM_32(ss->numTaggedActor), true);
// Run the appropriate entrance code (if any)
- es = (const ENTRANCE_STRUC *)LockMem(ss->hEntrance);
- for (i = 0; i < ss->numEntrance; i++) {
+ es = (const ENTRANCE_STRUC *)LockMem(FROM_32(ss->hEntrance));
+ for (i = 0; i < FROM_32(ss->numEntrance); i++) {
if (FROM_32(es->eNumber) == (uint)entry) {
if (es->hScript) {
init.event = STARTUP;
- init.hTinselCode = FROM_32(es->hScript);
+ init.hTinselCode = es->hScript;
CoroScheduler.createProcess(PID_TCODE, SceneTinselProcess, &init, sizeof(init));
}
@@ -285,7 +285,7 @@ static void LoadScene(SCNHANDLE scene, int entry) {
}
- if (i == ss->numEntrance)
+ if (i == FROM_32(ss->numEntrance))
error("Non-existent scene entry number");
if (ss->hSceneScript) {
@@ -297,10 +297,10 @@ static void LoadScene(SCNHANDLE scene, int entry) {
}
// Default refer type
- SetDefaultRefer(ss->defRefer);
+ SetDefaultRefer(FROM_32(ss->defRefer));
// Scene's processes
- SceneProcesses(ss->numProcess, ss->hProcess);
+ SceneProcesses(FROM_32(ss->numProcess), FROM_32(ss->hProcess));
}
diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h
index 5eb3b7d7b8..d26153245d 100644
--- a/engines/tinsel/tinsel.h
+++ b/engines/tinsel/tinsel.h
@@ -32,6 +32,8 @@
#include "common/util.h"
#include "engines/engine.h"
+#include "gui/debugger.h"
+
#include "tinsel/debugger.h"
#include "tinsel/graphics.h"
#include "tinsel/sound.h"
@@ -150,6 +152,7 @@ class TinselEngine : public Engine {
Common::Point _mousePos;
uint8 _dosPlayerDir;
Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
static const char *const _sampleIndices[][3];
static const char *const _sampleFiles[][3];
diff --git a/engines/toltecs/configure.engine b/engines/toltecs/configure.engine
new file mode 100644
index 0000000000..be5533efa2
--- /dev/null
+++ b/engines/toltecs/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 toltecs "3 Skulls of the Toltecs" yes
diff --git a/engines/toltecs/render.cpp b/engines/toltecs/render.cpp
index 4c41e6ce00..ae458d40a3 100644
--- a/engines/toltecs/render.cpp
+++ b/engines/toltecs/render.cpp
@@ -156,7 +156,7 @@ void RenderQueue::update() {
byte *srcp = _vm->_screen->_backScreen + _vm->_cameraX + _vm->_cameraY * _vm->_sceneWidth;
int16 w = MIN<int16>(640, _vm->_sceneWidth);
int16 h = MIN<int16>(400, _vm->_cameraHeight);
- while (h--) {
+ while (h--) {
memcpy(destp, srcp, w);
destp += 640;
srcp += _vm->_sceneWidth;
diff --git a/engines/toltecs/saveload.cpp b/engines/toltecs/saveload.cpp
index 6c195a34c2..4edcc601b8 100644
--- a/engines/toltecs/saveload.cpp
+++ b/engines/toltecs/saveload.cpp
@@ -183,7 +183,7 @@ void ToltecsEngine::loadgame(const char *filename) {
_mouseDisabled = in->readUint16LE();
_system->warpMouse(_mouseX, _mouseY);
- _system->showMouse(_mouseDisabled == 0);
+ _system->showMouse(_mouseDisabled == 0);
_palette->loadState(in);
_script->loadState(in);
diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp
index 1eb2f41fd2..dd418be71f 100644
--- a/engines/toltecs/screen.cpp
+++ b/engines/toltecs/screen.cpp
@@ -599,7 +599,7 @@ int16 Screen::drawString(int16 x, int16 y, byte color, uint fontResIndex, const
if (ywobble)
yadd = *ywobble;
- while (len--) {
+ while (len--) {
byte ch = *text++;
if (ch <= 0x20) {
x += font.getWidth();
@@ -634,7 +634,7 @@ void Screen::drawChar(const Font &font, byte *dest, int16 x, int16 y, byte ch, b
byte flags = charData[0] & 0xF0;
charData++;
if ((flags & 0x80) == 0) {
- if (flags & 0x10) {
+ if (flags & 0x10) {
memset(dest, color, count);
} else if (outline) {
memset(dest, 0, count);
diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp
index 476c3a4fcf..83c4ef15fe 100644
--- a/engines/toltecs/script.cpp
+++ b/engines/toltecs/script.cpp
@@ -65,7 +65,7 @@ ScriptInterpreter::ScriptInterpreter(ToltecsEngine *vm) : _vm(vm) {
_savedSp = 0;
_slots[kMaxScriptSlots - 1].size = 1024;
- _slots[kMaxScriptSlots - 1].data = new byte[_slots[kMaxScriptSlots - 1].size];
+ _slots[kMaxScriptSlots - 1].data = new byte[_slots[kMaxScriptSlots - 1].size];
setupScriptFunctions();
@@ -184,11 +184,11 @@ void ScriptInterpreter::loadScript(uint resIndex, uint slotIndex) {
delete[] _slots[slotIndex].data;
- _slots[slotIndex].resIndex = resIndex;
+ _slots[slotIndex].resIndex = resIndex;
Resource *scriptResource = _vm->_res->load(resIndex);
_slots[slotIndex].size = scriptResource->size;
- _slots[slotIndex].data = new byte[_slots[slotIndex].size];
- memcpy(_slots[slotIndex].data, scriptResource->data, _slots[slotIndex].size);
+ _slots[slotIndex].data = new byte[_slots[slotIndex].size];
+ memcpy(_slots[slotIndex].data, scriptResource->data, _slots[slotIndex].size);
}
void ScriptInterpreter::setMainScript(uint slotIndex) {
@@ -852,7 +852,7 @@ void ScriptInterpreter::sfFindMouseInRectIndex2() {
}
void ScriptInterpreter::sfDrawGuiImage() {
- _vm->_screen->drawGuiImage(arg16(5), arg16(3), arg16(7));
+ _vm->_screen->drawGuiImage(arg16(5), arg16(3), arg16(7));
}
void ScriptInterpreter::sfAddAnimatedSpriteNoLoop() {
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp
index 188facd63c..8bd824cfee 100644
--- a/engines/toltecs/toltecs.cpp
+++ b/engines/toltecs/toltecs.cpp
@@ -235,7 +235,7 @@ void ToltecsEngine::loadScene(uint resIndex) {
byte *source = scene + 392;
byte *destp = _screen->_backScreen;
byte *destEnd = destp + _sceneWidth * _sceneHeight;
- while (destp < destEnd) {
+ while (destp < destEnd) {
int count = 1;
byte pixel = *source++;
if (pixel & 0x80) {
@@ -250,7 +250,7 @@ void ToltecsEngine::loadScene(uint resIndex) {
debug(0, "_sceneWidth = %d; _sceneHeight = %d", _sceneWidth, _sceneHeight);
// Load scene segmap
- _segmap->load(scene + imageSize + 4);
+ _segmap->load(scene + imageSize + 4);
_screen->_fullRefresh = true;
_screen->_renderQueue->clear();
@@ -574,9 +574,9 @@ void ToltecsEngine::walk(byte *walkData) {
if (ydelta > ABS(walkInfo.x1 - walkInfo.x2) * _walkSpeedX) {
v10 = 100 - walkInfo.scaling;
v11 = v8;
- } else {
+ } else {
v10 = v8;
- v11 = 100 - walkInfo.scaling;
+ v11 = 100 - walkInfo.scaling;
}
walkInfo.yerror += walkInfo.mulValue * v10;
diff --git a/engines/toltecs/toltecs.h b/engines/toltecs/toltecs.h
index 0be2d2a646..b405d099c4 100644
--- a/engines/toltecs/toltecs.h
+++ b/engines/toltecs/toltecs.h
@@ -36,13 +36,16 @@
#include "graphics/surface.h"
+#include "gui/debugger.h"
+
+#include "toltecs/console.h"
+
namespace Toltecs {
struct ToltecsGameDescription;
class AnimationPlayer;
class ArchiveReader;
-class Console;
class Input;
class MenuSystem;
class MoviePlayer;
@@ -110,6 +113,8 @@ public:
const Common::String& getTargetName() const { return _targetName; }
void syncSoundSettings();
+ GUI::Debugger *getDebugger() { return _console; }
+
void setupSysStrings();
void requestSavegame(int slotNum, Common::String &description);
void requestLoadgame(int slotNum);
diff --git a/engines/tony/configure.engine b/engines/tony/configure.engine
new file mode 100644
index 0000000000..f85f45d158
--- /dev/null
+++ b/engines/tony/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 tony "Tony Tough and the Night of Roasted Moths" yes "" "" "16bit"
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index 7010c238b5..19e3d43df4 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -963,7 +963,7 @@ void LocationPollThread(CORO_PARAM, const void *param) {
// Ok, we can perform the action. For convenience, we do it in a new process
_ctx->newItem = (LpMpalItem)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizeof(MpalItem));
- if (_ctx->newItem == false) {
+ if (!_ctx->newItem) {
globalDestroy(_ctx->myThreads);
globalDestroy(_ctx->myActions);
@@ -1935,7 +1935,7 @@ bool mpalExecuteScript(int nScript) {
// !!! New process management
if (CoroScheduler.createProcess(ScriptThread, &s, sizeof(LpMpalScript)) == CORO_INVALID_PID_VALUE)
- return false;
+ return false;
return true;
}
diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index 547f31906e..74d32c7c0f 100644
--- a/engines/tony/sound.cpp
+++ b/engines/tony/sound.cpp
@@ -88,7 +88,7 @@ FPSound::~FPSound() {
bool FPSound::createStream(FPStream **streamPtr) {
(*streamPtr) = new FPStream(_soundSupported);
- return (*streamPtr != NULL);
+ return true;
}
/**
diff --git a/engines/tony/tony.h b/engines/tony/tony.h
index 750673061d..cdc7d7e20a 100644
--- a/engines/tony/tony.h
+++ b/engines/tony/tony.h
@@ -31,6 +31,7 @@
#include "common/random.h"
#include "common/util.h"
#include "engines/engine.h"
+#include "gui/debugger.h"
#include "tony/mpal/mpal.h"
#include "tony/mpal/memory.h"
@@ -108,6 +109,7 @@ public:
Common::List<FPSfx *> _activeSfx;
Globals _globals;
Debugger *_debugger;
+ GUI::Debugger *getDebugger() { return _debugger; }
int16 _cTableDialog[256];
int16 _lTableDialog[256];
diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp
index a732862854..02991975ce 100644
--- a/engines/tony/window.cpp
+++ b/engines/tony/window.cpp
@@ -40,7 +40,7 @@ namespace Tony {
\****************************************************************************/
RMWindow::RMWindow() {
- _showDirtyRects = false;
+ reset();
}
RMWindow::~RMWindow() {
@@ -55,11 +55,21 @@ RMWindow::~RMWindow() {
void RMWindow::init() {
Graphics::PixelFormat pixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
initGraphics(RM_SX, RM_SY, true, &pixelFormat);
+
+ reset();
+}
+/**
+ * Reset the variables
+ */
+void RMWindow::reset() {
+ _showDirtyRects = false;
_bGrabScreenshot = false;
_bGrabThumbnail = false;
_bGrabMovie = false;
_wiping = false;
+
+ _wThumbBuf = nullptr;
}
void RMWindow::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
diff --git a/engines/tony/window.h b/engines/tony/window.h
index 3874652f64..2cc9bfd37c 100644
--- a/engines/tony/window.h
+++ b/engines/tony/window.h
@@ -72,6 +72,7 @@ public:
* Initialization
*/
void init();
+ void reset();
void close();
/**
diff --git a/engines/toon/configure.engine b/engines/toon/configure.engine
new file mode 100644
index 0000000000..00c98f7d8a
--- /dev/null
+++ b/engines/toon/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 toon "Toonstruck" yes
diff --git a/engines/touche/configure.engine b/engines/touche/configure.engine
new file mode 100644
index 0000000000..777578e623
--- /dev/null
+++ b/engines/touche/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 touche "Touche: The Adventures of the Fifth Musketeer" yes
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp
index 5674773177..c8a0117bcf 100644
--- a/engines/tsage/blue_force/blueforce_logic.cpp
+++ b/engines/tsage/blue_force/blueforce_logic.cpp
@@ -648,8 +648,6 @@ void FocusObject::postInit(SceneObjectList *OwnerList) {
_lookLineNum = 43;
_talkLineNum = 44;
_useLineNum = -1;
- _v90 = 0;
- _v92 = 1;
SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene;
scene->_focusObject = this;
@@ -658,8 +656,11 @@ void FocusObject::postInit(SceneObjectList *OwnerList) {
void FocusObject::synchronize(Serializer &s) {
NamedObject::synchronize(s);
- s.syncAsSint16LE(_v90);
- s.syncAsSint16LE(_v92);
+ if (s.getVersion() < 12) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ s.syncAsSint16LE(useless);
+ }
}
void FocusObject::remove() {
@@ -705,7 +706,6 @@ SceneExt::SceneExt(): Scene() {
_stripManager._onBegin = SceneExt::startStrip;
_stripManager._onEnd = SceneExt::endStrip;
- _field372 = _field37A = 0;
_savedPlayerEnabled = false;
_savedUiEnabled = false;
_savedCanWalk = false;
@@ -748,6 +748,7 @@ void SceneExt::process(Event &event) {
void SceneExt::dispatch() {
_timerList.dispatch();
+ /*
if (_field37A) {
if ((--_field37A == 0) && BF_GLOBALS._dayNumber) {
if (T2_GLOBALS._uiElements._active && BF_GLOBALS._player._enabled) {
@@ -757,6 +758,7 @@ void SceneExt::dispatch() {
_field37A = 0;
}
}
+ */
Scene::dispatch();
}
@@ -764,8 +766,6 @@ void SceneExt::dispatch() {
void SceneExt::loadScene(int sceneNum) {
Scene::loadScene(sceneNum);
- _v51C34.top = 0;
- _v51C34.bottom = 300;
BF_GLOBALS._sceneHandler->_delayTicks = 1;
}
@@ -833,7 +833,6 @@ void SceneExt::gunDisplay() {
void SceneExt::startStrip() {
SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene;
- scene->_field372 = 1;
scene->_savedPlayerEnabled = BF_GLOBALS._player._enabled;
if (scene->_savedPlayerEnabled) {
@@ -848,7 +847,6 @@ void SceneExt::startStrip() {
void SceneExt::endStrip() {
SceneExt *scene = (SceneExt *)BF_GLOBALS._sceneManager._scene;
- scene->_field372 = 0;
if (scene->_savedPlayerEnabled) {
BF_GLOBALS._player.enableControl();
@@ -867,23 +865,22 @@ void SceneExt::clearScreen() {
/*--------------------------------------------------------------------------*/
PalettedScene::PalettedScene(): SceneExt() {
- _field794 = 0;
+ _hasFader = false;
}
void PalettedScene::synchronize(Serializer &s) {
SceneExt::synchronize(s);
- s.syncAsSint16LE(_field794);
+ s.syncAsSint16LE(_hasFader);
}
void PalettedScene::postInit(SceneObjectList *OwnerList) {
- _field794 = 0;
- _palette._field412 = 1;
+ _hasFader = false;
SceneExt::postInit(OwnerList);
}
void PalettedScene::remove() {
SceneExt::remove();
- if (_field794 == 1) {
+ if (_hasFader) {
for (SynchronizedList<SceneObject *>::iterator i = BF_GLOBALS._sceneObjects->begin();
i != BF_GLOBALS._sceneObjects->end(); ++i)
(*i)->remove();
@@ -892,12 +889,10 @@ void PalettedScene::remove() {
BF_GLOBALS._scenePalette.loadPalette(2);
BF_GLOBALS._sceneManager._hasPalette = true;
}
-
- BF_GLOBALS._scenePalette._field412 = 0;
}
PaletteFader *PalettedScene::addFader(const byte *arrBufferRGB, int step, Action *action) {
- _field794 = 1;
+ _hasFader = true;
return BF_GLOBALS._scenePalette.addFader(arrBufferRGB, 1, step, action);
}
diff --git a/engines/tsage/blue_force/blueforce_logic.h b/engines/tsage/blue_force/blueforce_logic.h
index 59bc2b7a51..0045980820 100644
--- a/engines/tsage/blue_force/blueforce_logic.h
+++ b/engines/tsage/blue_force/blueforce_logic.h
@@ -139,14 +139,17 @@ public:
class NamedObject2: public NamedObject {
public:
- int _v1, _v2;
+ int _talkCount;
- NamedObject2() { _v1 = _v2 = 0; }
+ NamedObject2() { _talkCount = 0; }
virtual Common::String getClassName() { return "NamedObject2"; }
virtual void synchronize(Serializer &s) {
NamedObject::synchronize(s);
- s.syncAsSint16LE(_v1);
- s.syncAsSint16LE(_v2);
+ if (s.getVersion() < 12) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ }
+ s.syncAsSint16LE(_talkCount);
}
};
@@ -177,7 +180,6 @@ public:
class FocusObject: public NamedObject {
public:
- int _v90, _v92;
GfxSurface _img;
FocusObject();
@@ -196,16 +198,12 @@ private:
static void endStrip();
public:
AObjectArray _timerList, _objArray2;
- int _field372;
bool _savedPlayerEnabled;
bool _savedUiEnabled;
bool _savedCanWalk;
- int _field37A;
EventHandler *_focusObject;
Visage _cursorVisage;
-
- Rect _v51C34;
public:
SceneExt();
@@ -228,7 +226,7 @@ public:
class PalettedScene: public SceneExt {
public:
ScenePalette _palette;
- int _field794;
+ bool _hasFader;
public:
PalettedScene();
diff --git a/engines/tsage/blue_force/blueforce_scenes2.cpp b/engines/tsage/blue_force/blueforce_scenes2.cpp
index 1b0ed2a145..e444c8b91d 100644
--- a/engines/tsage/blue_force/blueforce_scenes2.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes2.cpp
@@ -1748,7 +1748,7 @@ void Scene280::Action1::signal() {
case 1:
scene->_jake.setStrip(2);
scene->_jake.setFrame(1);
- scene->_jake.animate(ANIM_MODE_8, NULL);
+ scene->_jake.animate(ANIM_MODE_8, 0, NULL);
scene->_jake._numFrames = 5;
scene->_stripManager.start(2800, this);
diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp
index 5dd795cb39..feaf789392 100644
--- a/engines/tsage/blue_force/blueforce_scenes3.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes3.cpp
@@ -1978,12 +1978,7 @@ void Scene340::Action8::signal() {
setDelay(6);
break;
- case 4:
- remove();
- break;
default:
- // This is present in the original game
- warning("Bugs");
remove();
break;
}
@@ -2873,9 +2868,9 @@ void Scene350::checkGun() {
void Scene355::Doorway::synchronize(Serializer &s) {
NamedObject::synchronize(s);
- s.syncAsSint16LE(_v1);
- s.syncAsSint16LE(_v2);
- s.syncAsSint16LE(_v3);
+ s.syncAsSint16LE(_mode1356Count);
+ s.syncAsSint16LE(_talkCount);
+ s.syncAsSint16LE(_onDuty);
}
bool Scene355::Doorway::startAction(CursorType action, Event &event) {
@@ -2895,9 +2890,9 @@ bool Scene355::Doorway::startAction(CursorType action, Event &event) {
return true;
case CURSOR_TALK:
if (BF_GLOBALS._dayNumber >= 5) {
- switch (_v2) {
+ switch (_talkCount) {
case 0:
- ++_v2;
+ ++_talkCount;
BF_GLOBALS._sound1.play(109);
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 0;
@@ -2925,7 +2920,7 @@ bool Scene355::Doorway::startAction(CursorType action, Event &event) {
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 3562;
scene->setAction(&scene->_sequenceManager, scene, 3562, &BF_GLOBALS._player, NULL);
- _v3 = !_v3 ? 1 : 0;
+ _onDuty = !_onDuty;
return true;
default:
break;
@@ -3360,14 +3355,14 @@ bool Scene355::Item11::startAction(CursorType action, Event &event) {
return true;
case CURSOR_TALK:
if (BF_GLOBALS._dayNumber == 5) {
- switch (scene->_doorway._v2) {
+ switch (scene->_doorway._talkCount) {
case 0:
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 0;
BF_GLOBALS.setFlag(fTookTrailerAmmo);
scene->_stripManager.start(3575, scene);
scene->_lyle._flag = 1;
- scene->_doorway._v2 = 1;
+ scene->_doorway._talkCount = 1;
break;
case 1:
BF_GLOBALS._player.disableControl();
@@ -3539,28 +3534,28 @@ void Scene355::postInit(SceneObjectList *OwnerList) {
_doorway.setVisage(355);
_doorway.setPosition(Common::Point(193, 105));
_doorway.fixPriority(18);
- _doorway._v1 = 0;
- _doorway._v3 = 0;
+ _doorway._mode1356Count = 0;
+ _doorway._onDuty = false;
BF_GLOBALS._sceneItems.push_back(&_doorway);
switch (BF_GLOBALS._dayNumber) {
case 1:
if (!BF_GLOBALS.getFlag(onDuty))
- _doorway._v3 = 1;
+ _doorway._onDuty = true;
else if (BF_INVENTORY.getObjectScene(INV_GREENS_GUN) == 320)
- _doorway._v3 = 1;
+ _doorway._onDuty = true;
break;
case 2:
case 3:
case 4:
- _doorway._v3 = 1;
+ _doorway._onDuty = true;
break;
default:
break;
}
if (BF_GLOBALS._dayNumber == 5)
- _doorway._v2 = BF_GLOBALS.getFlag(fTookTrailerAmmo) ? 1 : 0;
+ _doorway._talkCount = BF_GLOBALS.getFlag(fTookTrailerAmmo) ? 1 : 0;
_object8.postInit();
_object8.setVisage(355);
@@ -3619,8 +3614,8 @@ void Scene355::postInit(SceneObjectList *OwnerList) {
_object11.animate(ANIM_MODE_2);
_doorway.setPosition(Common::Point(146, 107));
- _doorway._v3 = 0;
- _doorway._v2 = 2;
+ _doorway._onDuty = false;
+ _doorway._talkCount = 2;
_lyle._flag = 2;
_green.postInit();
@@ -3718,16 +3713,16 @@ void Scene355::signal() {
_stripManager.start(BF_GLOBALS.getFlag(fBackupIn350) ? 3559 : 3554, this);
break;
case 1356:
- switch (_doorway._v1) {
+ switch (_doorway._mode1356Count) {
case 0:
- ++_doorway._v1;
+ ++_doorway._mode1356Count;
_sceneMode = 9999;
_stripManager.start(3550, this);
break;
case 1:
_sceneMode = 9999;
_stripManager.start(3551, this);
- ++_doorway._v1;
+ ++_doorway._mode1356Count;
break;
default:
break;
@@ -3792,7 +3787,7 @@ void Scene355::signal() {
T2_GLOBALS._uiElements.addScore(10);
}
- SceneItem::display2(355, !_doorway._v3 ? 24 : 25);
+ SceneItem::display2(355, !_doorway._onDuty ? 24 : 25);
BF_GLOBALS._player.enableControl();
break;
case 4550:
@@ -3801,8 +3796,8 @@ void Scene355::signal() {
BF_GLOBALS._sound1.play(90);
BF_GLOBALS._player._regionBitList |= 0x10;
- _doorway._v3 = 0;
- _doorway._v2 = 2;
+ _doorway._onDuty = false;
+ _doorway._talkCount = 2;
_lyle._flag = 2;
BF_GLOBALS._player.enableControl();
break;
@@ -3872,13 +3867,13 @@ void Scene355::signal() {
case 9984:
if (BF_GLOBALS._dayNumber == 5) {
_sceneMode = 0;
- switch (_doorway._v2) {
+ switch (_doorway._talkCount) {
case 0:
BF_GLOBALS._sound1.play(109);
BF_GLOBALS.setFlag(fTookTrailerAmmo);
_stripManager.start(3575, this);
_lyle._flag = 1;
- ++_doorway._v2;
+ ++_doorway._talkCount;
break;
case 1:
_stripManager.start(3573, this);
@@ -3889,7 +3884,7 @@ void Scene355::signal() {
break;
}
} else if (BF_GLOBALS.getFlag(greenTaken) || (BF_GLOBALS._dayNumber > 1)) {
- if (_doorway._v3) {
+ if (_doorway._onDuty) {
SceneItem::display2(355, 23);
_sceneMode = 0;
signal();
@@ -4014,14 +4009,14 @@ void Scene355::signal() {
}
case 9997:
_sceneMode = 9999;
- _doorway._v1 = 2;
+ _doorway._mode1356Count = 2;
_stripManager.start(3562, this);
break;
case 9998:
error("Talkdoor state");
break;
case 9999:
- if (_doorway._v1 != 2) {
+ if (_doorway._mode1356Count != 2) {
BF_GLOBALS._player.enableControl();
BF_GLOBALS._player._canWalk = false;
} else if (BF_GLOBALS.getFlag(gunDrawn)) {
@@ -4531,7 +4526,7 @@ void Scene360::signal() {
BF_GLOBALS._player.enableControl();
break;
case 3608:
- BF_GLOBALS._sceneManager.changeScene(355);
+ BF_GLOBALS._sceneManager.changeScene(355);
break;
case 3610:
BF_GLOBALS._sceneManager.changeScene(666);
@@ -4656,10 +4651,10 @@ bool Scene370::Green::startAction(CursorType action, Event &event) {
switch (action) {
case CURSOR_LOOK:
- SceneItem::display2(370, (_v2 < 3) ? 10 : 0);
+ SceneItem::display2(370, (_talkCount < 3) ? 10 : 0);
return true;
case CURSOR_USE:
- if (_v2 != 3)
+ if (_talkCount != 3)
SceneItem::display2(370, 1);
else if (BF_INVENTORY.getObjectScene(INV_HANDCUFFS) == 1)
SceneItem::display2(370, 26);
@@ -4675,14 +4670,14 @@ bool Scene370::Green::startAction(CursorType action, Event &event) {
return true;
case CURSOR_TALK:
BF_GLOBALS._player.disableControl();
- switch (_v2) {
+ switch (_talkCount) {
case 0:
- ++_v2;
+ ++_talkCount;
scene->_sceneMode = 3706;
scene->setAction(&scene->_sequenceManager, scene, 3706, NULL);
break;
case 1:
- ++_v2;
+ ++_talkCount;
scene->_sceneMode = 3707;
scene->_object5.postInit();
@@ -4694,7 +4689,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) {
scene->setAction(&scene->_sequenceManager, scene, 3707, &scene->_harrison, &scene->_object5, NULL);
break;
case 2:
- ++_v2;
+ ++_talkCount;
scene->_sceneMode = 3708;
scene->setAction(&scene->_sequenceManager, scene, 3708, this, &scene->_laura, &scene->_harrison,
&scene->_object5, &scene->_greensGun, NULL);
@@ -4720,7 +4715,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) {
}
return true;
case INV_HANDCUFFS:
- if (_v2 != 3)
+ if (_talkCount != 3)
SceneItem::display2(370, 2);
else {
T2_GLOBALS._uiElements.addScore(50);
@@ -4757,7 +4752,7 @@ bool Scene370::Harrison::startAction(CursorType action, Event &event) {
SceneItem::display2(370, 8);
return true;
case CURSOR_TALK:
- if (scene->_green._v2 != 3) {
+ if (scene->_green._talkCount != 3) {
scene->_sceneMode = 3;
scene->_stripManager.start(3714, scene);
} else if ((BF_INVENTORY.getObjectScene(INV_GREENS_KNIFE) == 1) ||
diff --git a/engines/tsage/blue_force/blueforce_scenes3.h b/engines/tsage/blue_force/blueforce_scenes3.h
index d9f0d32edc..894c3e5ffd 100644
--- a/engines/tsage/blue_force/blueforce_scenes3.h
+++ b/engines/tsage/blue_force/blueforce_scenes3.h
@@ -493,9 +493,10 @@ class Scene355: public PalettedScene {
/* Objects */
class Doorway: public NamedObject {
public:
- int _v1, _v2, _v3;
+ int _mode1356Count, _talkCount;
+ bool _onDuty;
- Doorway() { _v1 = _v2 = _v3 = 0; }
+ Doorway() { _mode1356Count = _talkCount = 0; _onDuty = false; }
virtual Common::String getClassName() { return "Scene355_Doorway"; }
virtual void synchronize(Serializer &s);
virtual bool startAction(CursorType action, Event &event);
diff --git a/engines/tsage/blue_force/blueforce_scenes4.cpp b/engines/tsage/blue_force/blueforce_scenes4.cpp
index 072761b5ac..2b4c0ff348 100644
--- a/engines/tsage/blue_force/blueforce_scenes4.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes4.cpp
@@ -136,11 +136,11 @@ void Scene410::Action5::signal() {
switch (_actionIndex++) {
case 0:
- if (scene->_harrisonMovedFl == 0) {
+ if (!scene->_harrisonMovedFl) {
ADD_PLAYER_MOVER(114, 133);
} else {
ADD_PLAYER_MOVER(195, 139);
- }
+ }
break;
case 1:
BF_GLOBALS._player.updateAngle(scene->_passenger._position);
@@ -167,7 +167,7 @@ void Scene410::Action6::signal() {
switch (_actionIndex++) {
case 0:
- if (scene->_harrisonMovedFl == 0) {
+ if (!scene->_harrisonMovedFl) {
ADD_PLAYER_MOVER(114, 133);
} else {
ADD_PLAYER_MOVER(126, 99);
@@ -243,7 +243,7 @@ bool Scene410::Motorcycle::startAction(CursorType action, Event &event) {
} else if (BF_GLOBALS.getFlag(fSearchedTruck) && !BF_GLOBALS._sceneObjects->contains(&scene->_harrison)) {
scene->_sceneMode = 4103;
scene->signal();
- } else if (scene->_cuffedDriverFl != 0) {
+ } else if (scene->_cuffedDriverFl) {
SceneItem::display2(410, 12);
} else {
scene->_sceneMode = 4103;
@@ -260,7 +260,7 @@ bool Scene410::TruckFront::startAction(CursorType action, Event &event) {
switch (action) {
case CURSOR_USE:
- if ((BF_GLOBALS._bookmark < bStoppedFrankie) && (!scene->_cuffedDriverFl || !scene->_field1FBA))
+ if ((BF_GLOBALS._bookmark < bStoppedFrankie) && (!scene->_cuffedDriverFl || !scene->_harrissonTalkFl))
break;
else if (BF_GLOBALS.getFlag(fSearchedTruck))
SceneItem::display2(410, 13);
@@ -295,9 +295,9 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) {
}
} else if (!scene->_cuffedDriverFl) {
SceneItem::display2(410, 7);
- } else if (!scene->_field1FC0) {
+ } else if (!scene->_getDriverFl) {
scene->_sceneMode = 4124;
- scene->_field1FC0 = 1;
+ scene->_getDriverFl = true;
T2_GLOBALS._uiElements.addScore(30);
scene->signal();
} else {
@@ -309,13 +309,13 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) {
return true;
case INV_HANDCUFFS:
if (BF_GLOBALS.getFlag(fCalledBackup)) {
- if ((scene->_talkCount < 5) || (scene->_action1Count < 1) || (scene->_cuffedDriverFl != 0))
+ if ((scene->_talkCount < 5) || (scene->_action1Count < 1) || scene->_cuffedDriverFl)
break;
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 4123;
scene->_stripManager.start(4125, scene);
- scene->_cuffedDriverFl = 1;
+ scene->_cuffedDriverFl = true;
T2_GLOBALS._uiElements.addScore(30);
} else {
if (BF_GLOBALS.getFlag(fTalkedDriverNoBkup)) {
@@ -332,10 +332,10 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) {
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 2;
scene->setAction(&scene->_sequenceManager1, scene, 4120, &scene->_passenger, &BF_GLOBALS._player, NULL);
- } else if ((scene->_cuffedDriverFl != 0) || (scene->_field1FC2 != 0)) {
+ } else if (scene->_cuffedDriverFl || scene->_driverOutOfTruckFl) {
break;
} else {
- scene->_field1FC2 = 1;
+ scene->_driverOutOfTruckFl = true;
T2_GLOBALS._uiElements.addScore(30);
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 4127;
@@ -343,7 +343,7 @@ bool Scene410::Driver::startAction(CursorType action, Event &event) {
}
return true;
case INV_MIRANDA_CARD:
- if (scene->_cuffedDriverFl == 0)
+ if (!scene->_cuffedDriverFl)
return false;
if (BF_GLOBALS.getFlag(readFrankRights)) {
@@ -379,15 +379,15 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) {
SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + UI_INTERFACE_Y + 2,
SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 96, SET_EXT_BGCOLOR, 99,
SET_EXT_FGCOLOR, 13, LIST_END);
- } else if (!scene->_field1FBA) {
+ } else if (!scene->_harrissonTalkFl) {
SceneItem::display(410, 5, SET_WIDTH, 300,
SET_X, 10 + GLOBALS._sceneManager._scene->_sceneBounds.left,
SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + UI_INTERFACE_Y + 2,
SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 96, SET_EXT_BGCOLOR, 99,
SET_EXT_FGCOLOR, 13, LIST_END);
- } else if (!scene->_field1FBE) {
+ } else if (!scene->_cuffedPassengerFl) {
scene->_sceneMode = 4121;
- scene->_field1FBE = 1;
+ scene->_cuffedPassengerFl = true;
T2_GLOBALS._uiElements.addScore(50);
scene->signal();
} else
@@ -398,7 +398,7 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) {
return true;
case INV_HANDCUFFS:
if (BF_GLOBALS.getFlag(fCalledBackup)) {
- if ((scene->_talkCount < 5) || (scene->_field1FBA != 0))
+ if ((scene->_talkCount < 5) || (scene->_harrissonTalkFl))
break;
BF_GLOBALS._player.disableControl();
@@ -413,7 +413,7 @@ bool Scene410::Passenger::startAction(CursorType action, Event &event) {
}
return true;
case INV_MIRANDA_CARD:
- if (!scene->_field1FBA)
+ if (!scene->_harrissonTalkFl)
break;
if (BF_GLOBALS.getFlag(readFrankRights)) {
@@ -455,7 +455,7 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) {
SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 32, SET_EXT_BGCOLOR, 49,
SET_EXT_FGCOLOR, 13, LIST_END);
}
- } else if ((scene->_field1FBA != 0) && (scene->_cuffedDriverFl != 0)) {
+ } else if (scene->_harrissonTalkFl && scene->_cuffedDriverFl) {
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 4112;
scene->_stripManager.start(4113, scene);
@@ -463,27 +463,27 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) {
BF_GLOBALS.set2Flags(f1098Frankie);
BF_GLOBALS.clearFlag(f1098Marina);
} else if ((BF_INVENTORY.getObjectScene(INV_HANDCUFFS) == 1) ||
- (!scene->_field1FBA && (scene->_talkCount < 5))) {
+ (!scene->_harrissonTalkFl && (scene->_talkCount < 5))) {
SceneItem::display(350, 13, SET_WIDTH, 300,
SET_X, 10 + GLOBALS._sceneManager._scene->_sceneBounds.left,
SET_Y, GLOBALS._sceneManager._scene->_sceneBounds.top + UI_INTERFACE_Y + 2,
SET_FONT, 4, SET_BG_COLOR, 1, SET_FG_COLOR, 32, SET_EXT_BGCOLOR, 49,
SET_EXT_FGCOLOR, 13, LIST_END);
- } else if (!scene->_field1FBA) {
+ } else if (!scene->_harrissonTalkFl) {
BF_GLOBALS._player.disableControl();
- scene->_field1FBA = 1;
- scene->_field1FBE = 1;
+ scene->_harrissonTalkFl = true;
+ scene->_cuffedPassengerFl = true;
BF_GLOBALS._walkRegions.enableRegion(22);
scene->_sceneMode = 4122;
scene->_stripManager.start(4112, scene);
} else if (scene->_action1Count < 1) {
break;
- } else if (scene->_cuffedDriverFl != 0) {
+ } else if (scene->_cuffedDriverFl) {
error("Error - want to cuff driver, but he's cuffed already");
} else {
BF_GLOBALS._player.disableControl();
- scene->_cuffedDriverFl = 1;
- scene->_field1FC0 = 1;
+ scene->_cuffedDriverFl = true;
+ scene->_getDriverFl = true;
BF_GLOBALS._walkRegions.enableRegion(22);
scene->_sceneMode = 4109;
scene->_stripManager.start(4112, scene);
@@ -500,19 +500,23 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) {
/*--------------------------------------------------------------------------*/
Scene410::Scene410(): SceneExt() {
- _action1Count = _talkCount = _field1FBA = _cuffedDriverFl = 0;
- _field1FBE = _field1FC0 = _field1FC2 = _harrisonMovedFl = 0;
+ _cuffedDriverFl = _harrissonTalkFl = _driverOutOfTruckFl = false;
+ _harrisonMovedFl = false;
+
+ _action1Count = _talkCount = 0;
+ _cuffedPassengerFl = false;
+ _getDriverFl = false;
}
void Scene410::synchronize(Serializer &s) {
SceneExt::synchronize(s);
s.syncAsSint16LE(_action1Count);
s.syncAsSint16LE(_talkCount);
- s.syncAsSint16LE(_field1FBA);
+ s.syncAsSint16LE(_harrissonTalkFl);
s.syncAsSint16LE(_cuffedDriverFl);
- s.syncAsSint16LE(_field1FBE);
- s.syncAsSint16LE(_field1FC0);
- s.syncAsSint16LE(_field1FC2);
+ s.syncAsSint16LE(_cuffedPassengerFl);
+ s.syncAsSint16LE(_getDriverFl);
+ s.syncAsSint16LE(_driverOutOfTruckFl);
s.syncAsSint16LE(_harrisonMovedFl);
}
@@ -593,7 +597,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) {
_patrolCar.fixPriority(148);
_patrolCar.setPosition(Common::Point(39, 168));
- _harrisonMovedFl = 1;
+ _harrisonMovedFl = true;
_sceneMode = 0;
signal();
break;
@@ -604,7 +608,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) {
_sceneMode = 0;
} else {
_harrisonMovedFl = BF_GLOBALS._scene410HarrisonMovedFl;
- _field1FBA = BF_GLOBALS._v50CC2;
+ _harrissonTalkFl = BF_GLOBALS._scene410HarrisonTalkFl;
_talkCount = BF_GLOBALS._scene410TalkCount;
_action1Count = BF_GLOBALS._scene410Action1Count;
@@ -617,7 +621,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) {
_passenger.setStrip(2);
_passenger.setFrame(5);
}
- if (_field1FBA) {
+ if (_harrissonTalkFl) {
_passenger.setVisage(415);
_passenger.setStrip(6);
_passenger.setFrame(8);
@@ -664,7 +668,7 @@ void Scene410::postInit(SceneObjectList *OwnerList) {
_sceneMode = 0;
}
- _harrisonMovedFl = 1;
+ _harrisonMovedFl = true;
}
break;
case 50:
@@ -687,7 +691,7 @@ void Scene410::signal() {
BF_GLOBALS.clearFlag(f1097Marina);
BF_GLOBALS._scene410HarrisonMovedFl = _harrisonMovedFl;
- BF_GLOBALS._v50CC2 = _field1FBA;
+ BF_GLOBALS._scene410HarrisonTalkFl = _harrissonTalkFl;
BF_GLOBALS._scene410TalkCount = _talkCount;
BF_GLOBALS._scene410Action1Count = _action1Count;
BF_GLOBALS._sceneManager.changeScene(60);
@@ -730,7 +734,7 @@ void Scene410::signal() {
case 9:
_sceneMode = 4106;
_stripManager.start(4111, this);
- _field1FBA = 1;
+ _harrissonTalkFl = true;
BF_GLOBALS.setFlag(fCuffedFrankie);
T2_GLOBALS._uiElements.addScore(30);
break;
@@ -760,7 +764,7 @@ void Scene410::signal() {
break;
case 4104:
// After call for backup, patrol car is coming
- _harrisonMovedFl = 1;
+ _harrisonMovedFl = true;
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
setAction(&_sequenceManager1, this, 4104, &_patrolCar, &_harrison, NULL);
@@ -1432,21 +1436,21 @@ bool Scene450::Manager::startAction(CursorType action, Event &event) {
} else {
animate(ANIM_MODE_8, 1, NULL);
- if (scene->_field19AC) {
+ if (scene->_managerCallsWeaselFl) {
scene->_sceneMode = 2;
- if (scene->_field19AE) {
+ if (scene->_talkManagerFl) {
scene->_stripManager.start(4521, scene);
} else {
- scene->_field19AE = 1;
+ scene->_talkManagerFl = true;
scene->_stripManager.start(4512, scene);
}
} else {
scene->_sceneMode = 4506;
- if (scene->_field19AE) {
+ if (scene->_talkManagerFl) {
scene->setAction(&scene->_sequenceManager, scene, 4518, &BF_GLOBALS._player, this, NULL);
} else {
scene->_sceneMode = 4506;
- scene->_field19AE = 1;
+ scene->_talkManagerFl = true;
scene->setAction(&scene->_sequenceManager, scene, 4506, &BF_GLOBALS._player, this, NULL);
}
}
@@ -1524,13 +1528,13 @@ bool Scene450::Exit::startAction(CursorType action, Event &event) {
/*--------------------------------------------------------------------------*/
Scene450::Scene450(): SceneExt() {
- _field19AC = _field19AE = 0;
+ _managerCallsWeaselFl = _talkManagerFl = false;
}
void Scene450::synchronize(Serializer &s) {
SceneExt::synchronize(s);
- s.syncAsSint16LE(_field19AC);
- s.syncAsSint16LE(_field19AE);
+ s.syncAsSint16LE(_managerCallsWeaselFl);
+ s.syncAsSint16LE(_talkManagerFl);
}
void Scene450::postInit(SceneObjectList *OwnerList) {
@@ -1654,7 +1658,7 @@ void Scene450::signal() {
case 4510:
case 4511:
BF_GLOBALS.setFlag(fMgrCallsWeasel);
- _field19AC = 1;
+ _managerCallsWeaselFl = true;
_sceneMode = 4503;
setAction(&_sequenceManager, this, 4503, &_weasel, &_door, &_manager, NULL);
break;
diff --git a/engines/tsage/blue_force/blueforce_scenes4.h b/engines/tsage/blue_force/blueforce_scenes4.h
index 895970e4ee..e5877df4f0 100644
--- a/engines/tsage/blue_force/blueforce_scenes4.h
+++ b/engines/tsage/blue_force/blueforce_scenes4.h
@@ -116,10 +116,12 @@ public:
SpeakerDriver _driverSpeaker;
SpeakerShooter _shooterSpeaker;
ASoundExt _sound1;
- int _action1Count, _talkCount, _field1FBA;
- int _cuffedDriverFl, _field1FBE;
- int _field1FC0;
- int _field1FC2, _harrisonMovedFl;
+ int _action1Count, _talkCount;
+ bool _harrissonTalkFl;
+ bool _cuffedDriverFl;
+ bool _cuffedPassengerFl;
+ bool _getDriverFl;
+ bool _driverOutOfTruckFl, _harrisonMovedFl;
Scene410();
virtual void postInit(SceneObjectList *OwnerList = NULL);
@@ -255,7 +257,8 @@ public:
NamedObject _door, _counterDoor;
Exit _exit;
NamedHotspot _interior, _shelf, _counter;
- int _field19AC, _field19AE;
+ bool _managerCallsWeaselFl;
+ bool _talkManagerFl;
Scene450();
virtual void synchronize(Serializer &s);
diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp
index ebaa3e372e..101a39c4b7 100644
--- a/engines/tsage/blue_force/blueforce_scenes5.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes5.cpp
@@ -1909,7 +1909,7 @@ bool Scene570::Icon::startAction(CursorType action, Event &event) {
}
}
-void Scene570::Icon::setDetails(int iconId, int folderId, int parentFolderId, int unused, const Common::String &msg) {
+void Scene570::Icon::setDetails(int iconId, int folderId, int parentFolderId, const Common::String &msg) {
Scene570 *scene = (Scene570 *)BF_GLOBALS._sceneManager._scene;
NamedObject::postInit();
@@ -2076,23 +2076,23 @@ void Scene570::signal() {
_printerIcon.setDetails(570, 14, 15, -1, 2, (SceneItem *)NULL);
_iconManager.setup(2);
- _folder1.setDetails(1, 1, 0, 2, SCENE570_C_DRIVE);
- _folder2.setDetails(1, 2, 1, 2, SCENE570_RING);
- _folder3.setDetails(1, 3, 1, 2, SCENE570_PROTO);
- _folder4.setDetails(1, 4, 1, 2, SCENE570_WACKY);
+ _folder1.setDetails(1, 1, 0, SCENE570_C_DRIVE);
+ _folder2.setDetails(1, 2, 1, SCENE570_RING);
+ _folder3.setDetails(1, 3, 1, SCENE570_PROTO);
+ _folder4.setDetails(1, 4, 1, SCENE570_WACKY);
if (!BF_GLOBALS.getFlag(fDecryptedBluePrints))
- _icon1.setDetails(3, 5, 0, 2, SCENE570_COBB);
- _icon2.setDetails(2, 7, 0, 2, SCENE570_LETTER);
+ _icon1.setDetails(3, 5, 0, SCENE570_COBB);
+ _icon2.setDetails(2, 7, 0, SCENE570_LETTER);
if (BF_GLOBALS.getFlag(fDecryptedBluePrints))
- _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB);
+ _icon3.setDetails(7, 6, 0, SCENE570_COBB);
- _icon4.setDetails(6, 8, 1, 2, SCENE570_RINGEXE);
- _icon5.setDetails(5, 9, 1, 2, SCENE570_RINGDATA);
- _icon6.setDetails(6, 10, 2, 2, SCENE570_PROTOEXE);
- _icon7.setDetails(5, 11, 2, 2, SCENE570_PROTODATA);
- _icon8.setDetails(6, 12, 3, 2, SCENE570_WACKYEXE);
- _icon9.setDetails(5, 13, 3, 2, SCENE570_WACKYDATA);
+ _icon4.setDetails(6, 8, 1, SCENE570_RINGEXE);
+ _icon5.setDetails(5, 9, 1, SCENE570_RINGDATA);
+ _icon6.setDetails(6, 10, 2, SCENE570_PROTOEXE);
+ _icon7.setDetails(5, 11, 2, SCENE570_PROTODATA);
+ _icon8.setDetails(6, 12, 3, SCENE570_WACKYEXE);
+ _icon9.setDetails(5, 13, 3, SCENE570_WACKYDATA);
_iconManager.refreshList();
BF_GLOBALS._player.enableControl();
@@ -2107,7 +2107,7 @@ void Scene570::signal() {
_object3.setFrame(1);
_object3.fixPriority(1);
- _icon3.setDetails(7, 6, 0, 2, SCENE570_COBB);
+ _icon3.setDetails(7, 6, 0, SCENE570_COBB);
_iconManager.refreshList();
T2_GLOBALS._uiElements._active = true;
T2_GLOBALS._uiElements.show();
diff --git a/engines/tsage/blue_force/blueforce_scenes5.h b/engines/tsage/blue_force/blueforce_scenes5.h
index 5337b6426b..71c7f3d8f1 100644
--- a/engines/tsage/blue_force/blueforce_scenes5.h
+++ b/engines/tsage/blue_force/blueforce_scenes5.h
@@ -266,7 +266,7 @@ class Scene570: public SceneExt {
virtual void remove();
virtual bool startAction(CursorType action, Event &event);
- void setDetails(int iconId, int folderId, int parentFolderId, int unused, const Common::String &msg);
+ void setDetails(int iconId, int folderId, int parentFolderId, const Common::String &msg);
};
class IconManager: public EventHandler {
public:
diff --git a/engines/tsage/blue_force/blueforce_scenes7.cpp b/engines/tsage/blue_force/blueforce_scenes7.cpp
index 4cdd2f3f15..2f52c4df95 100644
--- a/engines/tsage/blue_force/blueforce_scenes7.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes7.cpp
@@ -148,7 +148,7 @@ void Scene710::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._sound1.fadeSound(14);
_soundExt1.fadeSound(48);
- _v51C34.set(40, 0, 280, 240);
+
BF_GLOBALS._player.postInit();
BF_GLOBALS._player.hide();
BF_GLOBALS._player._moveDiff = Common::Point(4, 2);
diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp
index 867b6a9f6e..f78a332be9 100644
--- a/engines/tsage/blue_force/blueforce_scenes8.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes8.cpp
@@ -1958,7 +1958,7 @@ void Scene840::BoatKeysInset::postInit(SceneObjectList *OwnerList) {
_waveKeys.setDetails(840, 53, 8, -1, 2, (SceneItem *)NULL);
}
- _v1B4 = _v1B6 = 0;
+ _usedRentalKeys = _usedWaveKeys = false;
}
void Scene840::BoatKeysInset::remove() {
@@ -2067,7 +2067,7 @@ bool Scene840::BoatKeysInset::RentalKeys::startAction(CursorType action, Event &
BF_INVENTORY.setObjectScene(INV_RENTAL_KEYS, 1);
T2_GLOBALS._uiElements.addScore(30);
- scene->_boatKeysInset._v1B4 = 1;
+ scene->_boatKeysInset._usedRentalKeys = true;
remove();
}
return true;
@@ -2085,7 +2085,7 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev
SceneItem::display2(840, 56);
BF_INVENTORY.setObjectScene(INV_WAVE_KEYS, 1);
T2_GLOBALS._uiElements.addScore(50);
- scene->_boatKeysInset._v1B6 = 1;
+ scene->_boatKeysInset._usedWaveKeys = true;
remove();
} else {
SceneItem::display2(840, 9);
@@ -2096,6 +2096,15 @@ bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &ev
}
}
+void Scene840::BoatKeysInset::synchronize(Serializer &s) {
+ FocusObject::synchronize(s);
+
+ if (s.getVersion() >= 12) {
+ s.syncAsSint16LE(_usedWaveKeys);
+ s.syncAsSint16LE(_usedRentalKeys);
+ }
+}
+
bool Scene840::BoatKeys::startAction(CursorType action, Event &event) {
Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene;
@@ -2467,10 +2476,10 @@ void Scene840::signal() {
_boatKeysInset.setDetails(840, 50, 8, 51);
break;
case 8412:
- if (_boatKeysInset._v1B6) {
+ if (_boatKeysInset._usedWaveKeys) {
_sceneMode = 8409;
setAction(&_sequenceManager1, this, 8409, &BF_GLOBALS._player, &_carter, &_doors, NULL);
- } else if (!_boatKeysInset._v1B4) {
+ } else if (!_boatKeysInset._usedRentalKeys) {
BF_GLOBALS._player.enableControl();
} else {
_sceneMode = 3;
diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h
index ef5ef81563..b9e6ebd640 100644
--- a/engines/tsage/blue_force/blueforce_scenes8.h
+++ b/engines/tsage/blue_force/blueforce_scenes8.h
@@ -348,8 +348,9 @@ class Scene840: public PalettedScene {
public:
RentalKeys _rentalKeys;
WaveKeys _waveKeys;
- int _v1B4, _v1B6;
+ bool _usedRentalKeys,_usedWaveKeys;
+ virtual void synchronize(Serializer &s);
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void remove();
virtual void process(Event &event);
diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp
index cef9e8135c..405a436f55 100644
--- a/engines/tsage/blue_force/blueforce_scenes9.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes9.cpp
@@ -840,14 +840,14 @@ bool Scene910::Nico::startAction(CursorType action, Event &event) {
if (BF_GLOBALS._nico910State >= 4)
return NamedObject::startAction(action, event);
- if (BF_GLOBALS._v4CEE6 < 4)
- BF_GLOBALS._v4CEE6++;
+ if (BF_GLOBALS._nico910Talk < 4)
+ BF_GLOBALS._nico910Talk++;
- if (BF_GLOBALS._v4CEE6 == 2) {
+ if (BF_GLOBALS._nico910Talk == 2) {
scene->_sceneMode = 13;
scene->_stripManager.start(9105, scene);
} else
- scene->_stripManager.start(9103 + BF_GLOBALS._v4CEE6, &BF_GLOBALS._stripProxy);
+ scene->_stripManager.start(9103 + BF_GLOBALS._nico910Talk, &BF_GLOBALS._stripProxy);
return true;
break;
case INV_COLT45:
@@ -887,14 +887,14 @@ bool Scene910::Nico::startAction(CursorType action, Event &event) {
if (BF_GLOBALS._nico910State >= 4)
return NamedObject::startAction(action, event);
- if (BF_GLOBALS._v4CEE6 < 4)
- BF_GLOBALS._v4CEE6++;
+ if (BF_GLOBALS._nico910Talk < 4)
+ BF_GLOBALS._nico910Talk++;
- if (BF_GLOBALS._v4CEE6 == 2) {
+ if (BF_GLOBALS._nico910Talk == 2) {
scene->_sceneMode = 13;
scene->_stripManager.start(9105, scene);
} else
- scene->_stripManager.start(9103 + BF_GLOBALS._v4CEE6, &BF_GLOBALS._stripProxy);
+ scene->_stripManager.start(9103 + BF_GLOBALS._nico910Talk, &BF_GLOBALS._stripProxy);
return true;
break;
@@ -966,16 +966,16 @@ bool Scene910::Stuart::startAction(CursorType action, Event &event) {
return true;
break;
case CURSOR_TALK:
- if (BF_GLOBALS._v4CEE8 < 3)
- BF_GLOBALS._v4CEE8++;
+ if (BF_GLOBALS._stuart910Talk < 3)
+ BF_GLOBALS._stuart910Talk++;
- scene->_stripManager.start(9107 + BF_GLOBALS._v4CEE8, &BF_GLOBALS._stripProxy);
+ scene->_stripManager.start(9107 + BF_GLOBALS._stuart910Talk, &BF_GLOBALS._stripProxy);
return true;
break;
case INV_COLT45:
if ((BF_GLOBALS.getFlag(gunDrawn)) && (BF_GLOBALS.getFlag(fGunLoaded)) && (BF_GLOBALS.getHasBullets())){
BF_GLOBALS._player.disableControl();
- if (BF_GLOBALS._v4CEE4 == 2) {
+ if (BF_GLOBALS._stuart910State == 2) {
scene->_sceneMode = 9132;
scene->setAction(&scene->_sequenceManager1, scene, 9132, &scene->_stuart, NULL);
return NamedObject::startAction(action, event);
@@ -1878,7 +1878,7 @@ bool Scene910::Item2::startAction(CursorType action, Event &event) {
bool Scene910::Item3::startAction(CursorType action, Event &event) {
Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene;
- if ((action == CURSOR_TALK) && (BF_GLOBALS._nico910State == 4) && (BF_GLOBALS._v4CEE4 == 0)) {
+ if ((action == CURSOR_TALK) && (BF_GLOBALS._nico910State == 4) && (BF_GLOBALS._stuart910State == 0)) {
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 15;
scene->_stripManager.start(9102, scene);
@@ -2057,7 +2057,7 @@ void Scene910::postInit(SceneObjectList *OwnerList) {
|| (BF_GLOBALS._sceneManager._previousScene == 300)) {
BF_GLOBALS._sceneManager._previousScene = 900;
BF_GLOBALS._nico910State = 0;
- BF_GLOBALS._v4CEE4 = 0;
+ BF_GLOBALS._stuart910State = 0;
}
_field2DE0 = 0;
@@ -2149,7 +2149,7 @@ void Scene910::postInit(SceneObjectList *OwnerList) {
_nico.setVisage(913);
_nico.setPosition(Common::Point(262, 124));
_nico.setStrip(6);
- BF_GLOBALS._v4CEE6 = 0;
+ BF_GLOBALS._nico910Talk = 0;
BF_GLOBALS._nico910State = 1;
_nico.setDetails(910, 63, 64, 67, 5, &_item4);
BF_GLOBALS._v4CECA = 2;
@@ -2309,7 +2309,7 @@ void Scene910::signal() {
case 15:
_stuart.postInit();
_stuart.setDetails(910, 66, 67, 68, 5, &_nico);
- BF_GLOBALS._v4CEE8 = 0;
+ BF_GLOBALS._stuart910Talk = 0;
_sceneMode = 9121;
setAction(&_sequenceManager1, this, 9121, &_stuart, NULL);
break;
@@ -2349,7 +2349,7 @@ void Scene910::signal() {
case 18:
BF_GLOBALS._player._strip = 7;
BF_GLOBALS._player._frame = 1;
- if (BF_GLOBALS._v4CEE4 == 3) {
+ if (BF_GLOBALS._stuart910State == 3) {
if (_field2DE4 == 0) {
_field2DE4 = 1;
_sceneMode = 9142;
@@ -2460,7 +2460,7 @@ void Scene910::signal() {
BF_GLOBALS._player.disableControl();
_nico.postInit();
_nico.setDetails(910, 63, 64, 65, 5, &_item4);
- BF_GLOBALS._v4CEE6 = 0;
+ BF_GLOBALS._nico910Talk = 0;
_shadow.postInit();
_action2.remove();
_sceneMode = 9116;
@@ -2498,7 +2498,7 @@ void Scene910::signal() {
break;
case 9121:
_item3.setDetails(7, 910, 96, 60, 61, 3);
- BF_GLOBALS._v4CEE4 = 2;
+ BF_GLOBALS._stuart910State = 2;
if (BF_GLOBALS._nico910State == 4) {
_sceneMode = 20;
_stripManager.start(9115, this);
@@ -2582,7 +2582,7 @@ void Scene910::signal() {
_yellowCord.hide();
_sceneMode = 9136;
setAction(&_sequenceManager1, this, 9136, &BF_GLOBALS._player, &_stuart, &_yellowCord, NULL);
- BF_GLOBALS._v4CEE4 = 3;
+ BF_GLOBALS._stuart910State = 3;
break;
case 11:
_sceneMode = 9137;
@@ -2605,13 +2605,13 @@ void Scene910::signal() {
_stuart.postInit();
_nico.setDetails(910, 72, 73, 74, 3, (SceneItem *)NULL);
_stuart.setDetails(910, 66, 67, 68, 5, &_nico);
- BF_GLOBALS._v4CEE8 = 0;
+ BF_GLOBALS._stuart910Talk = 0;
_sceneMode = 9121;
setAction(&_sequenceManager1, this, 9121, &_stuart, NULL);
break;
case 9126:
_sceneMode = 19;
- if (BF_GLOBALS._v4CEE4 == 0)
+ if (BF_GLOBALS._stuart910State == 0)
signal();
else
_stripManager.start(9115, this);
@@ -2630,7 +2630,7 @@ void Scene910::signal() {
break;
case 9132:
BF_GLOBALS._player.enableControl();
- BF_GLOBALS._v4CEE4 = 4;
+ BF_GLOBALS._stuart910State = 4;
BF_GLOBALS._deathReason = 13;
BF_GLOBALS._sceneManager.changeScene(666);
break;
@@ -2977,7 +2977,6 @@ bool Scene920::Item8::startAction(CursorType action, Event &event) {
// On the other hand, it's not really important as just after the hero leaves the scene
// so the variable is no longer used.
// scene->_oldCoord = &scene;
- _field10 = 1;
} else {
scene->_sceneMode = 9201;
scene->setAction(&scene->_sequenceManager1, scene, 9201, &BF_GLOBALS._player, NULL);
diff --git a/engines/tsage/configure.engine b/engines/tsage/configure.engine
new file mode 100644
index 0000000000..2b8edf8266
--- /dev/null
+++ b/engines/tsage/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 tsage "TsAGE" yes
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 2298d28e0d..ba8cfb82a9 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -451,6 +451,13 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
draw();
g_globals->_events.showCursor();
+ // WORKAROUND: On-screen dialogs are really meant to use a GfxManager instance
+ // for their lifetime, which prevents saving or loading. Since I don't want to spend a lot
+ // of time refactoring this already working dialog, fake it by putting a dummy gfxmanager at
+ // the end of the gfx manager list so as to prevent saving or loading
+ GfxManager gfxManager;
+ GLOBALS._gfxManagers.push_back(&gfxManager);
+
// Event handling loop
Event event;
while (!g_vm->shouldQuit()) {
@@ -502,6 +509,7 @@ int ConversationChoiceDialog::execute(const Common::StringArray &choiceList) {
// Remove the dialog
remove();
+ GLOBALS._gfxManagers.remove(&gfxManager);
return _selectedIndex;
}
@@ -640,11 +648,11 @@ void StripManager::reset() {
_delayFrames = 0;
_owner = NULL;
_endHandler = NULL;
- _field2E6 = false;
+ _uselessFl = false;
_stripNum = -1;
- _obj44Index = 0;
- _field2E8 = 0;
- _field20 = 0;
+ _obj44ListIndex = 0;
+ _currObj44Id = 0;
+ _useless = 0;
_activeSpeaker = NULL;
_textShown = false;
_callbackObject = NULL;
@@ -688,14 +696,14 @@ void StripManager::synchronize(Serializer &s) {
Action::synchronize(s);
s.syncAsSint32LE(_stripNum);
- s.syncAsSint32LE(_obj44Index);
- s.syncAsSint32LE(_field20);
+ s.syncAsSint32LE(_obj44ListIndex);
+ s.syncAsSint32LE(_useless);
s.syncAsSint32LE(_sceneNumber);
_sceneBounds.synchronize(s);
SYNC_POINTER(_activeSpeaker);
s.syncAsByte(_textShown);
- s.syncAsByte(_field2E6);
- s.syncAsSint32LE(_field2E8);
+ s.syncAsByte(_uselessFl);
+ s.syncAsSint32LE(_currObj44Id);
if (g_vm->getGameID() == GType_Ringworld2)
s.syncAsSint16LE(_exitMode);
@@ -777,14 +785,14 @@ void StripManager::signal() {
_textShown = false;
}
- if (_obj44Index < 0) {
+ if (_obj44ListIndex < 0) {
EventHandler *owner = _endHandler;
- int stripNum = ABS(_obj44Index);
+ int stripNum = ABS(_obj44ListIndex);
remove();
start(stripNum, owner);
return;
- } else if (_obj44Index == 10000) {
+ } else if (_obj44ListIndex == 10000) {
// Reached end of strip
EventHandler *endHandler = _endHandler;
remove();
@@ -801,7 +809,7 @@ void StripManager::signal() {
// Load the data for the strip
load();
- Obj44 &obj44 = _obj44List[_obj44Index];
+ Obj44 &obj44 = _obj44List[_obj44ListIndex];
if (g_vm->getGameID() == GType_Ringworld2) {
// Return to Ringworld specific handling
@@ -823,7 +831,7 @@ void StripManager::signal() {
}
}
- _field2E8 = obj44._id;
+ _currObj44Id = obj44._id;
Common::StringArray choiceList;
// Build up a list of script entries
@@ -917,7 +925,7 @@ void StripManager::signal() {
// Get the user to select a conversation option
strIndex = _choiceDialog.execute(choiceList);
- if ((delayFlag || choiceList.size() != 1) && !_field2E6)
+ if ((delayFlag || choiceList.size() != 1) && !_uselessFl)
_delayFrames = 1;
else {
Speaker *speakerP = getSpeaker((const char *)&_script[0] + obj44._speakerOffset);
@@ -970,10 +978,10 @@ void StripManager::signal() {
}
}
- _obj44Index = getNewIndex(obj44._list[strIndex]._id);
- if (_obj44Index == 10001) {
+ _obj44ListIndex = getNewIndex(obj44._list[strIndex]._id);
+ if (_obj44ListIndex == 10001) {
MessageDialog::show("Strip Failure: Node not found", OK_BTN_STRING);
- _obj44Index = 0;
+ _obj44ListIndex = 0;
}
}
@@ -983,16 +991,16 @@ void StripManager::process(Event &event) {
return;
if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) {
- if (_obj44Index != 10000) {
- int currIndex = _obj44Index;
- while (!_obj44List[_obj44Index]._list[1]._id) {
- _obj44Index = getNewIndex(_obj44List[_obj44Index]._list[0]._id);
- if ((_obj44Index < 0) || (_obj44Index == 10000))
+ if (_obj44ListIndex != 10000) {
+ int currIndex = _obj44ListIndex;
+ while (!_obj44List[_obj44ListIndex]._list[1]._id) {
+ _obj44ListIndex = getNewIndex(_obj44List[_obj44ListIndex]._list[0]._id);
+ if ((_obj44ListIndex < 0) || (_obj44ListIndex == 10000))
break;
- currIndex = _obj44Index;
+ currIndex = _obj44ListIndex;
}
- _field2E8 = _obj44List[currIndex]._id;
+ _currObj44Id = _obj44List[currIndex]._id;
}
// Signal the end of the strip
diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h
index e7b8e811ca..8aa91ec3ef 100644
--- a/engines/tsage/converse.h
+++ b/engines/tsage/converse.h
@@ -212,8 +212,8 @@ private:
int getNewIndex(int newId);
public:
int _stripNum;
- int _obj44Index;
- int _field20;
+ int _obj44ListIndex;
+ int _useless;
int _sceneNumber;
Rect _sceneBounds;
ConversationChoiceDialog _choiceDialog;
@@ -221,8 +221,8 @@ public:
StripCallback *_callbackObject;
Speaker *_activeSpeaker;
bool _textShown;
- bool _field2E6;
- int _field2E8;
+ bool _uselessFl;
+ int _currObj44Id;
int _exitMode;
Common::Array<Obj44> _obj44List;
Common::Array<byte> _script;
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 040dbc8c25..16fe45044b 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -1153,6 +1153,13 @@ void PaletteRotation::signal() {
if (flag)
_currIndex = _start;
}
+
+ // Added in Return to Ringworld
+ if (_currIndex < _start) {
+ flag = decDuration();
+ if (flag)
+ _currIndex = _end;
+ }
break;
case 2:
_currIndex += _idxChange;
@@ -1294,7 +1301,6 @@ ScenePalette::ScenePalette() {
*palData++ = idx;
}
- _field412 = 0;
_redColor = _greenColor = _blueColor = 0;
_aquaColor = 0;
_purpleColor = 0;
@@ -1306,7 +1312,6 @@ ScenePalette::~ScenePalette() {
}
ScenePalette::ScenePalette(int paletteNum) {
- _field412 = 0;
_redColor = _greenColor = _blueColor = 0;
_aquaColor = 0;
_purpleColor = 0;
@@ -1538,7 +1543,11 @@ void ScenePalette::synchronize(Serializer &s) {
s.syncAsSint32LE(_colors.foreground);
s.syncAsSint32LE(_colors.background);
- s.syncAsSint32LE(_field412);
+ if (s.getVersion() < 12) {
+ int useless = 0;
+ s.syncAsSint32LE(useless);
+ }
+
s.syncAsByte(_redColor);
s.syncAsByte(_greenColor);
s.syncAsByte(_blueColor);
@@ -1554,8 +1563,13 @@ void SceneItem::synchronize(Serializer &s) {
_bounds.synchronize(s);
s.syncString(_msg);
- s.syncAsSint32LE(_fieldE);
- s.syncAsSint32LE(_field10);
+
+ if (s.getVersion() < 15) {
+ int useless = 0;
+ s.syncAsSint32LE(useless);
+ s.syncAsSint32LE(useless);
+ }
+
s.syncAsSint16LE(_position.x); s.syncAsSint32LE(_position.y);
s.syncAsSint16LE(_yDiff);
s.syncAsSint32LE(_sceneRegionId);
@@ -2103,12 +2117,12 @@ SceneObject::SceneObject() : SceneHotspot() {
_shade = _oldShade = 0;
_linkedActor = NULL;
- _field8A = Common::Point(0, 0);
+ _actorDestPos = Common::Point(0, 0);
_angle = 0;
_xs = 0;
_xe = 0;
_endFrame = 0;
- _field68 = 0;
+ _loopCount = 0;
_regionIndex = 0;
_shadowMap = NULL;
}
@@ -2357,7 +2371,7 @@ void SceneObject::animate(AnimateMode animMode, ...) {
case ANIM_MODE_1:
_frameChange = 1;
- _field2E = _position;
+ _oldPosition = _position;
_endAction = 0;
break;
@@ -2405,9 +2419,9 @@ void SceneObject::animate(AnimateMode animMode, ...) {
case ANIM_MODE_9:
if (_animateMode == ANIM_MODE_9 && g_vm->getGameID() == GType_Ringworld2) {
_frameChange = -1;
- _field2E = _position;
+ _oldPosition = _position;
} else {
- _field68 = va_arg(va, int);
+ _loopCount = va_arg(va, int);
_endAction = va_arg(va, Action *);
_frameChange = 1;
_endFrame = getFrameCount();
@@ -2474,7 +2488,7 @@ void SceneObject::synchronize(Serializer &s) {
s.syncAsUint32LE(_updateStartFrame);
s.syncAsUint32LE(_walkStartFrame);
- s.syncAsSint16LE(_field2E.x); s.syncAsSint16LE(_field2E.y);
+ s.syncAsSint16LE(_oldPosition.x); s.syncAsSint16LE(_oldPosition.y);
s.syncAsSint16LE(_percent);
s.syncAsSint16LE(_priority);
s.syncAsSint16LE(_angle);
@@ -2489,7 +2503,7 @@ void SceneObject::synchronize(Serializer &s) {
SYNC_ENUM(_animateMode, AnimateMode);
s.syncAsSint32LE(_frame);
s.syncAsSint32LE(_endFrame);
- s.syncAsSint32LE(_field68);
+ s.syncAsSint32LE(_loopCount);
s.syncAsSint32LE(_frameChange);
s.syncAsSint32LE(_numFrames);
s.syncAsSint32LE(_regionIndex);
@@ -2497,8 +2511,8 @@ void SceneObject::synchronize(Serializer &s) {
s.syncAsSint16LE(_moveDiff.x); s.syncAsSint16LE(_moveDiff.y);
s.syncAsSint32LE(_moveRate);
if (g_vm->getGameID() == GType_Ringworld2) {
- s.syncAsSint16LE(_field8A.x);
- s.syncAsSint16LE(_field8A.y);
+ s.syncAsSint16LE(_actorDestPos.x);
+ s.syncAsSint16LE(_actorDestPos.y);
}
SYNC_POINTER(_endAction);
s.syncAsUint32LE(_regionBitList);
@@ -2576,9 +2590,9 @@ void SceneObject::dispatch() {
case ANIM_MODE_1:
if (isNoMover())
setFrame(1);
- else if ((_field2E.x != _position.x) || (_field2E.y != _position.y)) {
+ else if ((_oldPosition.x != _position.x) || (_oldPosition.y != _position.y)) {
setFrame(changeFrame());
- _field2E = _position;
+ _oldPosition = _position;
}
break;
@@ -2621,7 +2635,7 @@ void SceneObject::dispatch() {
_endFrame = 1;
setFrame(changeFrame());
- } else if (!_field68 || (--_field68 > 0)) {
+ } else if (!_loopCount || (--_loopCount > 0)) {
_frameChange = 1;
_endFrame = getFrameCount();
@@ -2640,7 +2654,7 @@ void SceneObject::dispatch() {
_frameChange = -1;
_strip = ((_strip - 1) ^ 1) + 1;
_endFrame = 1;
- } else if ((_field68 == 0) || (--_field68 != 0)) {
+ } else if (!_loopCount || (--_loopCount > 0)) {
_frameChange = 1;
_endFrame = getFrameCount();
@@ -2707,6 +2721,17 @@ GfxSurface SceneObject::getFrame() {
_visageImages.setVisage(_visage, _strip);
GfxSurface frame = _visageImages.getFrame(_frame);
+ // Reset any centroid adjustment flags, in
+ frame._flags &= ~(FRAME_FLIP_CENTROID_X | FRAME_FLIP_CENTROID_Y);
+
+ // For later games, check whether the appropriate object flags are set for flipping
+ if (g_vm->getGameID() != GType_Ringworld) {
+ if ((_flags & OBJFLAG_FLIP_CENTROID_X) || _visageImages._flipHoriz)
+ frame._flags |= FRAME_FLIP_CENTROID_X;
+ if ((_flags & OBJFLAG_FLIP_CENTROID_Y) || _visageImages._flipVert)
+ frame._flags |= FRAME_FLIP_CENTROID_Y;
+ }
+
// If shading is needed, post apply the shadiing onto the frame
if ((g_vm->getGameID() == GType_Ringworld2) && (_shade >= 1)) {
Graphics::Surface s = frame.lockSurface();
@@ -2726,7 +2751,14 @@ GfxSurface SceneObject::getFrame() {
}
void SceneObject::reposition() {
+ if (g_vm->getGameID() == GType_Ringworld2) {
+ if (!(_flags & OBJFLAG_ZOOMED)) {
+ setZoom(g_globals->_sceneManager._scene->_zoomPercents[MIN(_position.y, (int16)255)]);
+ }
+ }
+
GfxSurface frame = getFrame();
+
_bounds.resize(frame, _position.x, _position.y - _yDiff, _percent);
_xs = _bounds.left;
_xe = _bounds.right;
@@ -2859,6 +2891,8 @@ void BackgroundSceneObject::setup2(int visage, int stripFrameNum, int frameNum,
setFrame(frameNum);
setPosition(Common::Point(posX, posY));
fixPriority(priority);
+
+ _effect = effect;
}
void BackgroundSceneObject::copySceneToBackground() {
@@ -2930,8 +2964,9 @@ void SceneObjectList::draw() {
g_globals->_sceneManager._sceneBgOffset.y);
}
- // Set up the flag mask
- uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1;
+ // Set up the flag mask. Currently, paneNum is always set to 0, so the check is meaningless
+ // uint32 flagMask = (paneNum == 0) ? OBJFLAG_PANE_0 : OBJFLAG_PANE_1;
+ uint32 flagMask = OBJFLAG_PANE_0;
// Initial loop to set up object list and update object position, priority, and flags
for (SynchronizedList<SceneObject *>::iterator i = g_globals->_sceneObjects->begin();
@@ -3334,7 +3369,6 @@ Player::Player(): SceneObject() {
_canWalk = false;
_enabled = false;
_uiEnabled = false;
- _field8C = 0;
// Return to Ringworld specific fields
_characterIndex = R2_NONE;
@@ -3353,15 +3387,11 @@ void Player::postInit(SceneObjectList *OwnerList) {
_canWalk = true;
_uiEnabled = true;
_percent = 100;
- _field8C = 10;
- if (g_vm->getGameID() != GType_Ringworld2)
- {
+ if (g_vm->getGameID() != GType_Ringworld2) {
_moveDiff.x = 4;
_moveDiff.y = 2;
- }
- else
- {
+ } else {
_moveDiff.x = 3;
_moveDiff.y = 2;
_effect = EFFECT_SHADED;
@@ -3469,7 +3499,10 @@ void Player::synchronize(Serializer &s) {
s.syncAsByte(_canWalk);
s.syncAsByte(_uiEnabled);
- s.syncAsSint16LE(_field8C);
+ if (s.getVersion() < 15) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ }
if (g_vm->getGameID() != GType_Ringworld)
s.syncAsByte(_enabled);
@@ -4217,7 +4250,6 @@ double FloatSet::sqrt(FloatSet &floatSet) {
GameHandler::GameHandler() : EventHandler() {
_nextWaitCtr = 1;
_waitCtr.setCtr(1);
- _field14 = 10;
}
GameHandler::~GameHandler() {
@@ -4239,7 +4271,11 @@ void GameHandler::synchronize(Serializer &s) {
_lockCtr.synchronize(s);
_waitCtr.synchronize(s);
s.syncAsSint16LE(_nextWaitCtr);
- s.syncAsSint16LE(_field14);
+
+ if (s.getVersion() < 14) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ }
}
/*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 05f6f4b3a0..c285fba669 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -358,7 +358,6 @@ public:
byte _palette[256 * 3];
GfxColors _colors;
SynchronizedList<PaletteModifier *> _listeners;
- int _field412;
uint8 _redColor;
uint8 _greenColor;
@@ -410,12 +409,11 @@ class SceneItem : public EventHandler {
public:
Rect _bounds;
Common::String _msg;
- int _fieldE, _field10;
Common::Point _position;
int _yDiff;
int _sceneRegionId;
public:
- SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; _yDiff = 0; _fieldE = _field10 = 0;}
+ SceneItem() : EventHandler() { _msg = "Feature"; _action = NULL; _sceneRegionId = 0; _yDiff = 0;}
virtual void synchronize(Serializer &s);
virtual Common::String getClassName() { return "SceneItem"; }
@@ -515,7 +513,8 @@ public:
enum ObjectFlags {OBJFLAG_FIXED_PRIORITY = 1, OBJFLAG_NO_UPDATES = 2, OBJFLAG_ZOOMED = 4,
OBJFLAG_SUPPRESS_DISPATCH = 8, OBJFLAG_HIDE = 0x100, OBJFLAG_HIDING = 0x200, OBJFLAG_REMOVE = 0x400,
OBJFLAG_CLONED = 0x800, OBJFLAG_CHECK_REGION = 0x1000, OBJFLAG_PANE_0 = 0x4000, OBJFLAG_PANE_1 = 0x8000,
- OBJFLAG_PANES = OBJFLAG_PANE_0 | OBJFLAG_PANE_1
+ OBJFLAG_PANES = OBJFLAG_PANE_0 | OBJFLAG_PANE_1,
+ OBJFLAG_FLIP_CENTROID_X = 0x10000, OBJFLAG_FLIP_CENTROID_Y = 0x20000
};
class SceneObject : public SceneHotspot {
@@ -528,7 +527,7 @@ public:
int changeFrame();
uint32 _updateStartFrame;
uint32 _walkStartFrame;
- Common::Point _field2E;
+ Common::Point _oldPosition;
int _percent;
int _priority;
int _angle;
@@ -541,14 +540,14 @@ public:
AnimateMode _animateMode;
int _frame;
int _endFrame;
- int _field68;
+ int _loopCount;
int _frameChange;
int _numFrames;
int _regionIndex;
EventHandler *_mover;
Common::Point _moveDiff;
int _moveRate;
- Common::Point _field8A;
+ Common::Point _actorDestPos;
Action *_endAction;
uint32 _regionBitList;
@@ -650,7 +649,6 @@ class Player : public SceneObject {
public:
bool _canWalk;
bool _uiEnabled;
- int _field8C;
bool _enabled;
// Return to Ringworld specific fields
@@ -777,8 +775,6 @@ public:
class ScenePriorities : public Common::List<Region> {
public:
int _resNum;
- int _field14;
- int _field16;
Region _defaultPriorityRegion;
public:
void load(int resNum);
@@ -884,7 +880,6 @@ public:
RefCounter _lockCtr;
RefCounter _waitCtr;
int _nextWaitCtr;
- int _field14;
public:
GameHandler();
virtual ~GameHandler();
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index c7da5f5d30..e81e5cddb3 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -30,18 +30,19 @@
namespace TsAGE {
Debugger::Debugger() : GUI::Debugger() {
- DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
- DCmd_Register("scene", WRAP_METHOD(Debugger, Cmd_Scene));
- DCmd_Register("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions));
- DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions));
- DCmd_Register("scene_regions", WRAP_METHOD(Debugger, Cmd_SceneRegions));
- DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag));
- DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag));
- DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag));
- DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects));
- DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject));
- DCmd_Register("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots));
- DCmd_Register("sound", WRAP_METHOD(Debugger, Cmd_Sound));
+ DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
+ DCmd_Register("scene", WRAP_METHOD(Debugger, Cmd_Scene));
+ DCmd_Register("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions));
+ DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions));
+ DCmd_Register("scene_regions", WRAP_METHOD(Debugger, Cmd_SceneRegions));
+ DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag));
+ DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag));
+ DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag));
+ DCmd_Register("listobjects", WRAP_METHOD(Debugger, Cmd_ListObjects));
+ DCmd_Register("moveobject", WRAP_METHOD(Debugger, Cmd_MoveObject));
+ DCmd_Register("hotspots", WRAP_METHOD(Debugger, Cmd_Hotspots));
+ DCmd_Register("sound", WRAP_METHOD(Debugger, Cmd_Sound));
+ DCmd_Register("setdebug", WRAP_METHOD(Debugger, Cmd_SetDebug));
}
static int strToInt(const char *s) {
@@ -340,6 +341,14 @@ bool Debugger::Cmd_Sound(int argc, const char **argv) {
return false;
}
+/**
+ * Activate internal debugger, when available
+ */
+bool Debugger::Cmd_SetDebug(int argc, const char **argv) {
+ DebugPrintf("Not available in this game\n");
+ return true;
+}
+
/*
* This command lists the objects available, and their ID
*/
@@ -707,4 +716,19 @@ bool Ringworld2Debugger::Cmd_MoveObject(int argc, const char **argv) {
return true;
}
+
+/**
+ * Activate internal debugger, when available
+ */
+bool Ringworld2Debugger::Cmd_SetDebug(int argc, const char **argv) {
+ if (argc != 1) {
+ DebugPrintf("Usage: %s\n", argv[0]);
+ return true;
+ }
+
+ // Set the internal debugger flag(s?) to true
+ // _debugCardGame is reset by scene1337::subPostInit()
+ R2_GLOBALS._debugCardGame = true;
+ return true;
+}
} // End of namespace TsAGE
diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h
index bf826a3f77..c9b7e75039 100644
--- a/engines/tsage/debugger.h
+++ b/engines/tsage/debugger.h
@@ -45,6 +45,7 @@ protected:
bool Cmd_Sound(int argc, const char **argv);
virtual bool Cmd_ListObjects(int argc, const char **argv) = 0;
virtual bool Cmd_MoveObject(int argc, const char **argv) = 0;
+ virtual bool Cmd_SetDebug(int argc, const char **argv);
};
class DemoDebugger : public Debugger {
@@ -69,6 +70,7 @@ class Ringworld2Debugger : public Debugger {
protected:
virtual bool Cmd_ListObjects(int argc, const char **argv);
virtual bool Cmd_MoveObject(int argc, const char **argv);
+ virtual bool Cmd_SetDebug(int argc, const char **argv);
};
} // End of namespace TsAGE
diff --git a/engines/tsage/detection_tables.h b/engines/tsage/detection_tables.h
index b374dbc98b..123f04f8e2 100644
--- a/engines/tsage/detection_tables.h
+++ b/engines/tsage/detection_tables.h
@@ -165,13 +165,26 @@ static const tSageGameDescription gameDescriptions[] = {
AD_ENTRY1s("r2rw.rlb", "df6c25622387007788ca36d99362c1f0", 47586928),
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_CD | ADGF_UNSTABLE,
+ ADGF_CD | ADGF_TESTING,
GUIO0()
},
GType_Ringworld2,
GF_CD | GF_ALT_REGIONS
},
-
+ // Return to Ringworld - Demo
+ {
+ {
+ "ringworld2",
+ "CD Demo",
+ AD_ENTRY1s("r2rw.rlb", "c8e1a82c67c3caf57368eadde13dc15f", 32384464),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_CD | ADGF_TESTING,
+ GUIO0()
+ },
+ GType_Ringworld2,
+ GF_CD | GF_ALT_REGIONS | GF_DEMO
+ },
{ AD_TABLE_END_MARKER, 0, 0 }
};
diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp
index d2d8464763..0ba60384bf 100644
--- a/engines/tsage/events.cpp
+++ b/engines/tsage/events.cpp
@@ -71,7 +71,7 @@ bool EventsClass::pollEvent() {
break;
default:
- break;
+ break;
}
return true;
@@ -156,7 +156,7 @@ void EventsClass::setCursor(CursorType cursorType) {
// No cursor
g_globals->setFlag(122);
- if ((g_vm->getFeatures() & GF_DEMO) || (g_vm->getGameID() != GType_Ringworld)) {
+ if ((g_vm->getGameID() != GType_Ringworld) || ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_DEMO))) {
CursorMan.showMouse(false);
return;
}
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 768c51ca16..9b1b0f1dcb 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -64,17 +64,39 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
_stripNum = 0;
_gfxEdgeAdjust = 3;
- if (g_vm->getFeatures() & GF_DEMO) {
- _gfxFontNumber = 0;
- _gfxColors.background = 6;
- _gfxColors.foreground = 0;
- _fontColors.background = 255;
- _fontColors.foreground = 6;
- _dialogCenter.y = 80;
- // Workaround in order to use later version of the engine
- _color1 = _gfxColors.foreground;
- _color2 = _gfxColors.foreground;
- _color3 = _gfxColors.foreground;
+ if (g_vm->getGameID() == GType_Ringworld) {
+ if (g_vm->getFeatures() & GF_DEMO) {
+ _gfxFontNumber = 0;
+ _gfxColors.background = 6;
+ _gfxColors.foreground = 0;
+ _fontColors.background = 255;
+ _fontColors.foreground = 6;
+ _dialogCenter.y = 80;
+ // Workaround in order to use later version of the engine
+ _color1 = _gfxColors.foreground;
+ _color2 = _gfxColors.foreground;
+ _color3 = _gfxColors.foreground;
+ } else if (g_vm->getFeatures() & GF_CD) {
+ _gfxFontNumber = 50;
+ _gfxColors.background = 53;
+ _gfxColors.foreground = 0;
+ _fontColors.background = 51;
+ _fontColors.foreground = 54;
+ _color1 = 18;
+ _color2 = 18;
+ _color3 = 18;
+ } else {
+ // Floppy version
+ _gfxFontNumber = 50;
+ _gfxColors.background = 53;
+ _gfxColors.foreground = 18;
+ _fontColors.background = 51;
+ _fontColors.foreground = 54;
+ // Workaround in order to use later version of the engine
+ _color1 = _gfxColors.foreground;
+ _color2 = _gfxColors.foreground;
+ _color3 = _gfxColors.foreground;
+ }
} else if (g_vm->getGameID() == GType_BlueForce) {
// Blue Force
_gfxFontNumber = 0;
@@ -94,26 +116,6 @@ Globals::Globals() : _dialogCenter(160, 140), _gfxManagerInstance(_screenSurface
_color2 = 15;
_color3 = 4;
_dialogCenter.y = 100;
- } else if ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_CD)) {
- _gfxFontNumber = 50;
- _gfxColors.background = 53;
- _gfxColors.foreground = 0;
- _fontColors.background = 51;
- _fontColors.foreground = 54;
- _color1 = 18;
- _color2 = 18;
- _color3 = 18;
- } else {
- // Ringworld
- _gfxFontNumber = 50;
- _gfxColors.background = 53;
- _gfxColors.foreground = 18;
- _fontColors.background = 51;
- _fontColors.foreground = 54;
- // Workaround in order to use later version of the engine
- _color1 = _gfxColors.foreground;
- _color2 = _gfxColors.foreground;
- _color3 = _gfxColors.foreground;
}
_screenSurface.setScreenSurface();
_gfxManagers.push_back(&_gfxManagerInstance);
@@ -241,19 +243,19 @@ namespace BlueForce {
BlueForceGlobals::BlueForceGlobals(): TsAGE2Globals() {
_hiddenDoorStatus = 0;
_nico910State = 0;
- _v4CEE4 = 0;
- _v4CEE6 = 0;
- _v4CEE8 = 0;
+ _stuart910State = 0;
+ _nico910Talk = 0;
+ _stuart910Talk = 0;
_deziTopic = 0;
_deathReason = 0;
_driveFromScene = 300;
_driveToScene = 0;
_subFlagBitArr1 = 0;
_subFlagBitArr2 = 0;
- _v50CC2 = 0;
+ _scene410HarrisonTalkFl = false;
_scene410Action1Count = 0;
_scene410TalkCount = 0;
- _scene410HarrisonMovedFl = 0;
+ _scene410HarrisonMovedFl = false;
_bookmark = bNone;
_mapLocationId = 1;
_clip1Bullets = 8;
@@ -296,9 +298,9 @@ void BlueForceGlobals::synchronize(Serializer &s) {
s.syncAsByte(_breakerBoxStatusArr[i]);
s.syncAsSint16LE(_hiddenDoorStatus);
s.syncAsSint16LE(_nico910State);
- s.syncAsSint16LE(_v4CEE4);
- s.syncAsSint16LE(_v4CEE6);
- s.syncAsSint16LE(_v4CEE8);
+ s.syncAsSint16LE(_stuart910State);
+ s.syncAsSint16LE(_nico910Talk);
+ s.syncAsSint16LE(_stuart910Talk);
s.syncAsSint16LE(_deziTopic);
s.syncAsSint16LE(_deathReason);
s.syncAsSint16LE(_driveFromScene);
@@ -312,7 +314,7 @@ void BlueForceGlobals::synchronize(Serializer &s) {
}
s.syncAsSint16LE(_subFlagBitArr1);
s.syncAsSint16LE(_subFlagBitArr2);
- s.syncAsSint16LE(_v50CC2);
+ s.syncAsSint16LE(_scene410HarrisonTalkFl);
s.syncAsSint16LE(_scene410Action1Count);
s.syncAsSint16LE(_scene410TalkCount);
s.syncAsSint16LE(_scene410HarrisonMovedFl);
@@ -372,17 +374,17 @@ void BlueForceGlobals::reset() {
_breakerBoxStatusArr[17] = 0;
_hiddenDoorStatus = 0;
_nico910State = 0;
- _v4CEE4 = 0;
- _v4CEE6 = 0;
- _v4CEE8 = 0;
+ _stuart910State = 0;
+ _nico910Talk = 0;
+ _stuart910Talk = 0;
_deziTopic = 0;
_deathReason = 0;
_subFlagBitArr1 = 0;
_subFlagBitArr2 = 0;
- _v50CC2 = 0;
+ _scene410HarrisonTalkFl = false;
_scene410Action1Count = 0;
_scene410TalkCount = 0;
- _scene410HarrisonMovedFl = 0;
+ _scene410HarrisonMovedFl = false;
_clip1Bullets = 8;
_clip2Bullets = 8;
}
@@ -443,7 +445,7 @@ Ringworld2Globals::Ringworld2Globals() {
_scene180Mode = -1;
_v57709 = 0;
_v5780C = 0;
- _v5780E = 0;
+ _mouseCursorId = 0;
_v57810 = 0;
_fadePaletteFlag = false;
@@ -457,6 +459,8 @@ Ringworld2Globals::Ringworld2Globals() {
_foodCount = 0;
_rimLocation = 0;
_rimTransportLocation = 0;
+
+ _debugCardGame = false;
}
Ringworld2Globals::~Ringworld2Globals() {
@@ -555,7 +559,7 @@ void Ringworld2Globals::reset() {
_scene180Mode = -1;
_v57709 = 0;
_v5780C = 0;
- _v5780E = 0;
+ _mouseCursorId = 0;
_v57810 = 0;
_s1550PlayerArea[R2_QUINN] = Common::Point(27, 4);
_s1550PlayerArea[R2_SEEKER] = Common::Point(27, 4);
@@ -583,6 +587,8 @@ void Ringworld2Globals::reset() {
_player._characterScene[R2_QUINN] = 100;
_player._characterScene[R2_SEEKER] = 300;
_player._characterScene[R2_MIRANDA] = 300;
+
+ _debugCardGame = false;
}
void Ringworld2Globals::synchronize(Serializer &s) {
@@ -607,7 +613,7 @@ void Ringworld2Globals::synchronize(Serializer &s) {
s.syncAsSint16LE(_scene180Mode);
s.syncAsSint16LE(_v57709);
s.syncAsSint16LE(_v5780C);
- s.syncAsSint16LE(_v5780E);
+ s.syncAsSint16LE(_mouseCursorId);
s.syncAsSint16LE(_v57810);
s.syncAsByte(_s1550PlayerArea[R2_QUINN].x);
diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h
index 4523a7bca0..777697edbd 100644
--- a/engines/tsage/globals.h
+++ b/engines/tsage/globals.h
@@ -200,19 +200,19 @@ public:
int8 _breakerBoxStatusArr[18];
int _hiddenDoorStatus;
int _nico910State;
- int _v4CEE4;
- int _v4CEE6;
- int _v4CEE8;
+ int _stuart910State;
+ int _nico910Talk;
+ int _stuart910Talk;
int _deziTopic;
int _deathReason;
int _driveFromScene;
int _driveToScene;
uint8 _subFlagBitArr1;
uint8 _subFlagBitArr2;
- int _v50CC2;
+ bool _scene410HarrisonTalkFl;
int _scene410Action1Count;
int _scene410TalkCount;
- int _scene410HarrisonMovedFl;
+ bool _scene410HarrisonMovedFl;
Bookmark _bookmark;
int _mapLocationId;
int _clip1Bullets, _clip2Bullets;
@@ -284,7 +284,7 @@ public:
int _scene180Mode; // _v575f7
int _v57709;
int _v5780C;
- int _v5780E;
+ int _mouseCursorId;
int _v57810;
int _speechSubtitles;
Common::Point _s1550PlayerArea[3]; // only used for Quinn and Seeker
@@ -292,6 +292,7 @@ public:
byte _stripManager_lookupList[12];
byte _scene1550JunkLocations[508];
Common::Point _balloonPosition;
+ bool _debugCardGame; // moved from scene 1337 so it can be easily set in the debugger
ScannerDialog *_scannerDialog;
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index 446c56662a..97857aca34 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -71,19 +71,14 @@ GfxSurface surfaceFromRes(const byte *imgData) {
s._transColor = *(imgData + 8);
byte flags = imgData[9];
+ s._flags = (g_vm->getGameID() != GType_Ringworld) ? flags : 0;
+
bool rleEncoded = (flags & 2) != 0;
// Figure out the centroid
s._centroid.x = READ_LE_UINT16(imgData + 4);
s._centroid.y = READ_LE_UINT16(imgData + 6);
- if (g_vm->getGameID() != GType_Ringworld) {
- if (flags & 4)
- s._centroid.x = r.width() - (s._centroid.x + 1);
- if (flags & 8)
- s._centroid.y = r.height() - (s._centroid.y + 1);
- }
-
const byte *srcP = imgData + 10;
Graphics::Surface destSurface = s.lockSurface();
byte *destP = (byte *)destSurface.getPixels();
@@ -194,8 +189,9 @@ void Rect::contain(const Rect &r) {
* @percent Scaling percentage
*/
void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) {
- int xe = surface.getBounds().width() * percent / 100;
- int ye = surface.getBounds().height() * percent / 100;
+ const Rect &bounds = surface.getBounds();
+ int xe = bounds.width() * percent / 100;
+ int ye = bounds.height() * percent / 100;
this->set(0, 0, xe, ye);
if (!right) ++right;
@@ -203,8 +199,13 @@ void Rect::resize(const GfxSurface &surface, int xp, int yp, int percent) {
this->moveTo(xp, yp);
- int xd = surface._centroid.x * percent / 100;
- int yd = surface._centroid.y * percent / 100;
+ int xa = (surface._flags & FRAME_FLIP_CENTROID_X) == 0 ? surface._centroid.x :
+ bounds.width() - (surface._centroid.x + 1);
+ int ya = (surface._flags & FRAME_FLIP_CENTROID_Y) == 0 ? surface._centroid.y :
+ bounds.height() - (surface._centroid.y + 1);
+
+ int xd = xa * percent / 100;
+ int yd = ya * percent / 100;
this->translate(-xd, -yd);
}
@@ -234,6 +235,7 @@ GfxSurface::GfxSurface() : _bounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) {
_customSurface = NULL;
_transColor = -1;
_trackDirtyRects = false;
+ _flags = 0;
}
GfxSurface::GfxSurface(const GfxSurface &s) {
@@ -417,6 +419,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) {
_bounds = s._bounds;
_centroid = s._centroid;
_transColor = s._transColor;
+ _flags = s._flags;
if (_customSurface) {
// Surface owns the internal data, so replicate it so new surface owns it's own
@@ -1242,8 +1245,9 @@ GfxButton *GfxDialog::execute(GfxButton *defaultButton) {
}
void GfxDialog::setPalette() {
- if (g_vm->getGameID() == GType_BlueForce) {
- g_globals->_scenePalette.loadPalette(2);
+ if (g_vm->getGameID() != GType_Ringworld) {
+ if (g_vm->getGameID() == GType_BlueForce)
+ g_globals->_scenePalette.loadPalette(2);
g_globals->_scenePalette.setPalette(0, 1);
g_globals->_scenePalette.setPalette(g_globals->_gfxColors.background, 1);
g_globals->_scenePalette.setPalette(g_globals->_gfxColors.foreground, 1);
@@ -1386,7 +1390,10 @@ void GfxManager::copyFrom(GfxSurface &src, const Rect &srcBounds, const Rect &de
GfxFont::GfxFont() {
- _fontNumber = (g_vm->getFeatures() & GF_DEMO) ? 0 : 50;
+ if ((g_vm->getGameID() == GType_Ringworld) && (g_vm->getFeatures() & GF_DEMO))
+ _fontNumber = 0;
+ else
+ _fontNumber = 50;
_numChars = 0;
_bpp = 0;
_fontData = NULL;
diff --git a/engines/tsage/graphics.h b/engines/tsage/graphics.h
index 858731a1ac..47961dd02a 100644
--- a/engines/tsage/graphics.h
+++ b/engines/tsage/graphics.h
@@ -71,6 +71,8 @@ public:
LineSlice(int xStart, int xEnd) { xs = xStart; xe = xEnd; }
};
+enum FrameFlag { FRAME_FLIP_CENTROID_X = 4, FRAME_FLIP_CENTROID_Y = 8 };
+
class GfxSurface {
private:
Graphics::Surface *_customSurface;
@@ -89,6 +91,7 @@ public:
Common::Point _centroid;
int _transColor;
Rect _clipRect;
+ byte _flags;
public:
GfxSurface();
GfxSurface(const GfxSurface &s);
diff --git a/engines/tsage/ringworld/ringworld_scenes1.cpp b/engines/tsage/ringworld/ringworld_scenes1.cpp
index 5a42bc530d..df456f9ced 100644
--- a/engines/tsage/ringworld/ringworld_scenes1.cpp
+++ b/engines/tsage/ringworld/ringworld_scenes1.cpp
@@ -1623,7 +1623,7 @@ void Scene50::Action1::signal() {
scene->_stripManager.start(63, this);
break;
case 2:
- if (scene->_stripManager._field2E8 != 107) {
+ if (scene->_stripManager._currObj44Id != 107) {
g_globals->_player.enableControl();
remove();
} else {
@@ -2498,7 +2498,7 @@ void Scene90::Action1::signal() {
case 5:
scene->_soundHandler2.play(58);
- if (scene->_stripManager._field2E8 == 220)
+ if (scene->_stripManager._currObj44Id == 220)
scene->_stripManager.start(91, this, scene);
else {
scene->_stripManager.start(g_globals->getFlag(104) ? 93 : 92, this, scene);
@@ -2714,7 +2714,7 @@ void Scene90::signal() {
g_globals->_player.enableControl();
break;
case 97:
- _stripManager._field2E8 = 0;
+ _stripManager._currObj44Id = 0;
_action1.setActionIndex(5);
_action1.setDelay(1);
break;
@@ -2939,7 +2939,7 @@ void Scene6100::Action3::signal() {
case 4:
g_globals->setFlag(76);
g_globals->_sceneManager.changeScene(
- (scene->_stripManager._field2E8 == 135) ? 6100 : 2320);
+ (scene->_stripManager._currObj44Id == 135) ? 6100 : 2320);
remove();
break;
}
diff --git a/engines/tsage/ringworld/ringworld_scenes1.h b/engines/tsage/ringworld/ringworld_scenes1.h
index 5dd882af93..d52d4fb6ec 100644
--- a/engines/tsage/ringworld/ringworld_scenes1.h
+++ b/engines/tsage/ringworld/ringworld_scenes1.h
@@ -315,8 +315,6 @@ public:
Action1 _action1;
Action2 _action2;
Action3 _action3;
- // CHECKME: Object1 looks useless
- Object1 _object1;
LeftFlyCycle _leftFlyCycle;
CenterFlyCycle _centerFlyCycle;
RightFlyCycle _rightFlyCycle;
@@ -324,10 +322,7 @@ public:
SpeakerSText _speakerSText;
SpeakerQText _speakerQText;
DisplayHotspot _background;
-
- //CHECKME: Useless Hotspot, never initialized
DisplayHotspot _item1;
- //CHECKME: Useless Hotspot, never initialized
DisplayHotspot _entrance;
DisplayHotspot _bulwark;
DisplayHotspot _tree;
diff --git a/engines/tsage/ringworld/ringworld_scenes10.cpp b/engines/tsage/ringworld/ringworld_scenes10.cpp
index f9a8e7996a..eac181e350 100644
--- a/engines/tsage/ringworld/ringworld_scenes10.cpp
+++ b/engines/tsage/ringworld/ringworld_scenes10.cpp
@@ -1870,7 +1870,7 @@ void Scene9900::signal() {
setAction(&_sequenceManager, this, 9908, &_object1, &_object2, &_object3, &_object4, &_object5, &_object6);
break;
case 162:
- warning("TBC: shutdown();");
+ // shutdown();
g_globals->_game->quitGame();
break;
case 9901:
diff --git a/engines/tsage/ringworld/ringworld_scenes3.cpp b/engines/tsage/ringworld/ringworld_scenes3.cpp
index b2ed986331..e834e659b5 100644
--- a/engines/tsage/ringworld/ringworld_scenes3.cpp
+++ b/engines/tsage/ringworld/ringworld_scenes3.cpp
@@ -799,7 +799,7 @@ void Scene2100::Action9::signal() {
scene->_stripManager.start(6010, this);
break;
case 6:
- if (scene->_stripManager._field2E8 != 165)
+ if (scene->_stripManager._currObj44Id != 165)
setAction(&scene->_action10);
else
setAction(&scene->_action11);
@@ -1010,7 +1010,7 @@ void Scene2100::Action12::signal() {
scene->_stripManager.start(6052, this);
break;
case 8:
- if (scene->_stripManager._field2E8 == 320)
+ if (scene->_stripManager._currObj44Id == 320)
g_globals->setFlag(74);
setDelay(30);
break;
@@ -2352,11 +2352,11 @@ void Scene2150::Action2::signal() {
scene->_hotspot14.setStrip(6);
scene->_hotspot14.setPosition(Common::Point(59, 54));
- if (scene->_stripManager._field2E8 == 15) {
+ if (scene->_stripManager._currObj44Id == 15) {
scene->_hotspot14.setFrame(5);
RING_INVENTORY._ale._sceneNumber = 1;
} else {
- scene->_hotspot14.setFrame(scene->_stripManager._field2E8 - 5);
+ scene->_hotspot14.setFrame(scene->_stripManager._currObj44Id - 5);
}
g_globals->_player.setFrame(1);
@@ -3160,7 +3160,7 @@ void Scene2230::Action1::signal() {
switch (_actionIndex++) {
case 0:
- switch (scene->_field30A) {
+ switch (scene->_sceneMode) {
case 1:
scene->setAction(&scene->_action3);
break;
@@ -3201,7 +3201,7 @@ void Scene2230::Action2::signal() {
switch (_actionIndex++) {
case 0:
- switch (scene->_field30A) {
+ switch (scene->_sceneMode) {
case 2:
scene->setAction(&scene->_action6, this);
break;
@@ -3212,7 +3212,7 @@ void Scene2230::Action2::signal() {
break;
case 1: {
g_globals->_player.disableControl();
- scene->_field30A = 1;
+ scene->_sceneMode = 1;
g_globals->_player._regionBitList |= ~0x80;
Common::Point pt(160, 96);
NpcMover *mover = new NpcMover();
@@ -3262,7 +3262,7 @@ void Scene2230::Action3::signal() {
break;
case 2:
g_globals->_player._regionBitList |= 0x80;
- scene->_field30A = 0;
+ scene->_sceneMode = 0;
g_globals->_player.setVisage(0);
g_globals->_player.setStrip2(-1);
@@ -3292,7 +3292,7 @@ void Scene2230::Action5::signal() {
switch (_actionIndex++) {
case 0:
- switch (scene->_field30A) {
+ switch (scene->_sceneMode) {
case 2:
scene->setAction(&scene->_action3, this);
break;
@@ -3318,7 +3318,7 @@ void Scene2230::Action5::signal() {
case 3:
g_globals->_events.setCursor(CURSOR_USE);
g_globals->_player._uiEnabled = true;
- scene->_field30A = 2;
+ scene->_sceneMode = 2;
remove();
break;
}
@@ -3335,7 +3335,7 @@ void Scene2230::Action6::signal() {
g_globals->_player.animate(ANIM_MODE_5, this);
break;
case 1:
- scene->_field30A = 0;
+ scene->_sceneMode = 0;
g_globals->_player.setVisage(0);
g_globals->_player._strip = 1;
g_globals->_player._canWalk = true;
@@ -3352,7 +3352,7 @@ void Scene2230::Action7::signal() {
case 0:
g_globals->_player.disableControl();
- switch (scene->_field30A) {
+ switch (scene->_sceneMode) {
case 1:
scene->setAction(&scene->_action3, this);
break;
@@ -3408,7 +3408,7 @@ void Scene2230::Action8::signal() {
case 0:
g_globals->_player.disableControl();
- switch (scene->_field30A) {
+ switch (scene->_sceneMode) {
case 1:
scene->setAction(&scene->_action3, this);
break;
@@ -3431,7 +3431,7 @@ void Scene2230::Action8::signal() {
g_globals->_sceneItems.remove(&scene->_hotspot11);
g_globals->_sceneItems.remove(&scene->_hotspot12);
- switch (scene->_field30A) {
+ switch (scene->_sceneMode) {
case 1:
scene->setAction(&scene->_action3, this);
break;
@@ -3560,7 +3560,7 @@ void Scene2230::Hotspot6::doAction(int action) {
}
break;
case CURSOR_USE:
- if (scene->_field30A == 1)
+ if (scene->_sceneMode == 1)
scene->setAction(&scene->_action3);
else if (g_globals->getFlag(13))
SceneItem::display2(2230, 28);
@@ -3586,7 +3586,7 @@ void Scene2230::Hotspot7::doAction(int action) {
}
break;
case CURSOR_USE:
- if (scene->_field30A == 2)
+ if (scene->_sceneMode == 2)
scene->setAction(&scene->_action6);
else if (g_globals->getFlag(13))
SceneItem::display2(2230, 29);
@@ -3692,7 +3692,7 @@ void Scene2230::Hotspot12::doAction(int action) {
/*--------------------------------------------------------------------------*/
Scene2230::Scene2230() : _hotspot9(0, CURSOR_LOOK, 2230, 16, CURSOR_USE, 2230, 18, LIST_END) {
- _field30A = 0;
+ _sceneMode = 0;
}
void Scene2230::postInit(SceneObjectList *OwnerList) {
@@ -3726,7 +3726,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) {
g_globals->_player._regionBitList |= 0x80;
g_globals->_player.changeZoom(-1);
- _field30A = 0;
+ _sceneMode = 0;
g_globals->_player.enableControl();
_hotspot5.setBounds(Rect(108, 34, 142, 76));
@@ -3748,7 +3748,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) {
void Scene2230::synchronize(Serializer &s) {
Scene::synchronize(s);
_rect1.synchronize(s);
- s.syncAsSint16LE(_field30A);
+ s.syncAsSint16LE(_sceneMode);
}
void Scene2230::dispatch() {
diff --git a/engines/tsage/ringworld/ringworld_scenes3.h b/engines/tsage/ringworld/ringworld_scenes3.h
index 682ef44fc6..fafb72fcea 100644
--- a/engines/tsage/ringworld/ringworld_scenes3.h
+++ b/engines/tsage/ringworld/ringworld_scenes3.h
@@ -579,7 +579,7 @@ public:
Hotspot11 _hotspot11;
Hotspot12 _hotspot12;
Rect _rect1;
- int _field30A;
+ int _sceneMode;
Scene2230();
virtual void postInit(SceneObjectList *OwnerList = NULL);
diff --git a/engines/tsage/ringworld/ringworld_scenes5.cpp b/engines/tsage/ringworld/ringworld_scenes5.cpp
index 1b6cd78223..1242f9f448 100644
--- a/engines/tsage/ringworld/ringworld_scenes5.cpp
+++ b/engines/tsage/ringworld/ringworld_scenes5.cpp
@@ -462,7 +462,7 @@ void Scene4000::Action12::signal() {
break;
case 2:
g_globals->setFlag(32);
- if (scene->_stripManager._field2E8 == 275) {
+ if (scene->_stripManager._currObj44Id == 275) {
g_globals->setFlag(82);
ADD_MOVER_NULL(scene->_guardRock, 292, 138);
ADD_PLAYER_MOVER(283, 147);
@@ -471,7 +471,7 @@ void Scene4000::Action12::signal() {
}
break;
case 3:
- if (scene->_stripManager._field2E8 == 275) {
+ if (scene->_stripManager._currObj44Id == 275) {
g_globals->_sceneManager.changeScene(4100);
} else {
ADD_PLAYER_MOVER_THIS(scene->_guardRock, 300, 132);
@@ -4222,7 +4222,12 @@ void Scene4300::process(Event &event) {
void Scene4301::Action1::synchronize(Serializer &s) {
Action::synchronize(s);
- s.syncAsSint16LE(_field34E);
+
+ if (s.getVersion() < 14) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ }
+
for (int idx = 0; idx < 6; ++idx)
s.syncAsSint16LE(_indexList[idx]);
}
@@ -4268,7 +4273,6 @@ void Scene4301::Action1::signal() {
scene->_hotspot3.fixPriority(255);
scene->_hotspot3.hide();
- _field34E = 0;
_state = 0;
_actionIndex = 2;
break;
diff --git a/engines/tsage/ringworld/ringworld_scenes5.h b/engines/tsage/ringworld/ringworld_scenes5.h
index 2fe26d9712..b49d2a6f02 100644
--- a/engines/tsage/ringworld/ringworld_scenes5.h
+++ b/engines/tsage/ringworld/ringworld_scenes5.h
@@ -656,7 +656,6 @@ class Scene4301 : public Scene {
class Action1 : public ActionExt {
public:
SceneObject _buttonList[6];
- int _field34E;
int _indexList[6];
virtual void synchronize(Serializer &s);
diff --git a/engines/tsage/ringworld/ringworld_scenes6.cpp b/engines/tsage/ringworld/ringworld_scenes6.cpp
index 65c1ed39c6..777eed2aab 100644
--- a/engines/tsage/ringworld/ringworld_scenes6.cpp
+++ b/engines/tsage/ringworld/ringworld_scenes6.cpp
@@ -1608,8 +1608,6 @@ Scene5200::Scene5200() :
void Scene5200::postInit(SceneObjectList *OwnerList) {
Scene::postInit();
setZoomPercents(0, 150, 199, 150);
- _fieldA = 5600;
- _fieldE = 5100;
_hotspot9._state = 0;
_hotspot10._state = 0;
diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.cpp b/engines/tsage/ringworld2/ringworld2_dialogs.cpp
index 12147f7ee5..eb15585247 100644
--- a/engines/tsage/ringworld2/ringworld2_dialogs.cpp
+++ b/engines/tsage/ringworld2/ringworld2_dialogs.cpp
@@ -50,6 +50,7 @@ RightClickDialog::RightClickDialog() : GfxDialog() {
_btnList[5] = Common::Point(83, 47);
// Set the palette and change the cursor
+ _previousCursor = R2_GLOBALS._events.getCursor();
R2_GLOBALS._events.setCursor(CURSOR_ARROW);
setPalette();
@@ -136,7 +137,7 @@ bool RightClickDialog::process(Event &event) {
return false;
}
-void RightClickDialog::execute() {
+int RightClickDialog::execute() {
// Draw the dialog
draw();
@@ -157,7 +158,8 @@ void RightClickDialog::execute() {
}
// Execute the specified action
- CursorType cursorNum = CURSOR_NONE;
+ CursorType cursorNum = _previousCursor;
+ int result = -1;
switch (_selectedAction) {
case 0:
// Look action
@@ -177,17 +179,18 @@ void RightClickDialog::execute() {
break;
case 4:
// Change player
- CharacterDialog::show();
+ result = 0;
break;
case 5:
// Options dialog
+ result = 1;
break;
}
- if (cursorNum != CURSOR_NONE)
- R2_GLOBALS._events.setCursor(cursorNum);
-
+ R2_GLOBALS._events.setCursor(cursorNum);
_gfxManager.deactivate();
+
+ return result;
}
/*--------------------------------------------------------------------------*/
@@ -381,6 +384,8 @@ void HelpDialog::show() {
// If a action button was selected, dispatch to handle it
if (evt.kbd.keycode != Common::KEYCODE_INVALID)
R2_GLOBALS._game->processEvent(evt);
+ else
+ R2_GLOBALS._events.setCursorFromFlag();
}
HelpDialog::HelpDialog() {
diff --git a/engines/tsage/ringworld2/ringworld2_dialogs.h b/engines/tsage/ringworld2/ringworld2_dialogs.h
index 02a1aed81c..0c19ae4371 100644
--- a/engines/tsage/ringworld2/ringworld2_dialogs.h
+++ b/engines/tsage/ringworld2/ringworld2_dialogs.h
@@ -50,13 +50,14 @@ private:
int _highlightedAction;
int _selectedAction;
+ CursorType _previousCursor;
public:
RightClickDialog();
~RightClickDialog();
virtual void draw();
virtual bool process(Event &event);
- void execute();
+ int execute();
};
class CharacterDialog: public GfxDialog {
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 57d8afb57f..39e398023d 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -65,8 +65,12 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Deck #2 - By Lift
return new Scene200();
case 205:
- // Star-field Credits
- return new Scene205();
+ if (g_vm->getFeatures() & GF_DEMO)
+ // End of Demo
+ return new Scene205Demo();
+ else
+ // Star-field Credits
+ return new Scene205();
case 250:
// Lift
return new Scene250();
@@ -290,7 +294,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
// Confrontation
return new Scene3400();
case 3500:
- // Maze action sequencec
+ // Flub tube maze
return new Scene3500();
case 3600:
// Cutscene - walking at gunpoint
@@ -368,15 +372,24 @@ void SceneExt::postInit(SceneObjectList *OwnerList) {
// Initialize fields
_action = NULL;
- _field12 = 0;
_sceneMode = 0;
+ static_cast<SceneHandlerExt *>(R2_GLOBALS._sceneHandler)->setupPaletteMaps();
+
int prevScene = R2_GLOBALS._sceneManager._previousScene;
int sceneNumber = R2_GLOBALS._sceneManager._sceneNumber;
- if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50))
+ if (g_vm->getFeatures() & GF_DEMO) {
+ if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50))
+ || (prevScene == 0) || (sceneNumber == 600)
+ || ((prevScene == 205 || prevScene == 180) && (sceneNumber == 100))) {
+ R2_GLOBALS._uiElements._active = true;
+ R2_GLOBALS._uiElements.show();
+ } else {
+ R2_GLOBALS._uiElements.updateInventory();
+ }
+ } else if (((prevScene == -1) && (sceneNumber != 180) && (sceneNumber != 205) && (sceneNumber != 50))
|| (sceneNumber == 50)
|| ((sceneNumber == 100) && (prevScene == 0 || prevScene == 180 || prevScene == 205))) {
- static_cast<SceneHandlerExt *>(R2_GLOBALS._sceneHandler)->setupPaletteMaps();
R2_GLOBALS._uiElements._active = true;
R2_GLOBALS._uiElements.show();
} else {
@@ -400,19 +413,6 @@ void SceneExt::process(Event &event) {
}
void SceneExt::dispatch() {
-/*
- _timerList.dispatch();
-
- if (_field37A) {
- if ((--_field37A == 0) && R2_GLOBALS._dayNumber) {
- if (R2_GLOBALS._uiElements._active && R2_GLOBALS._player._enabled) {
- R2_GLOBALS._uiElements.show();
- }
-
- _field37A = 0;
- }
- }
-*/
Scene::dispatch();
}
@@ -1128,7 +1128,6 @@ void Ringworld2Game::start() {
R2_GLOBALS._sceneHandler->_loadGameSlot = slot;
else {
// Switch to the first title screen
- R2_GLOBALS._events.setCursor(CURSOR_WALK);
R2_GLOBALS._uiElements._active = true;
R2_GLOBALS._sceneManager.setNewScene(180);
}
@@ -1237,8 +1236,13 @@ void Ringworld2Game::processEvent(Event &event) {
void Ringworld2Game::rightClick() {
RightClickDialog *dlg = new RightClickDialog();
- dlg->execute();
+ int option = dlg->execute();
delete dlg;
+
+ if (option == 0)
+ CharacterDialog::show();
+ else if (option == 1)
+ HelpDialog::show();
}
/*--------------------------------------------------------------------------*/
@@ -1502,7 +1506,7 @@ MazeUI::MazeUI() {
_cellSize.x = _cellSize.y = 0;
_mapOffset.x = _mapOffset.y = 0;
_resNum = _cellsResNum = 0;
- _frameCount = _resCount = _mapImagePitch = _unused = 0;
+ _frameCount = _resCount = _mapImagePitch = 0;
}
MazeUI::~MazeUI() {
@@ -1518,7 +1522,9 @@ void MazeUI::synchronize(Serializer &s) {
s.syncAsSint16LE(_mapOffset.x);
s.syncAsSint16LE(_mapOffset.y);
- s.syncAsSint16LE(_unused);
+
+ int dummy = 0;
+ s.syncAsSint16LE(dummy);
}
void MazeUI::load(int resNum) {
@@ -1603,12 +1609,13 @@ void MazeUI::draw() {
(_cellSize.y - 1)) / _cellSize.y;
// Loop to handle the cell rows of the visible display area one at a time
- for (int yCtr = 0; yCtr < _cellsVisible.y; ++yCtr, yPos += ySize) {
+ for (int yCtr = 0; yCtr <= _cellsVisible.y; ++yCtr, yPos += ySize) {
int cellY = _mapOffset.y / _cellSize.y + yCtr;
// Loop to iterate through the horizontal visible cells to build up
- // an entire cell high horizontal slice of the map
- for (int xCtr = 0; xCtr < _cellsVisible.x; ++xCtr) {
+ // an entire cell high horizontal slice of the map, plus one extra cell
+ // to allow for partial cell scrolling on-screen on the left/right sides
+ for (int xCtr = 0; xCtr <= _cellsVisible.x; ++xCtr) {
int cellX = _mapOffset.x / _cellSize.x + xCtr;
// Get the type of content to display in the cell
@@ -1861,6 +1868,10 @@ bool AnimationPlayer::load(int animId, Action *endAction) {
_frameDelay = (60 / _subData._frameRate);
_gameFrame = R2_GLOBALS._events.getFrameNumber();
+ // WORKAROUND: Slow down the title sequences to better match the original
+ if (animId <= 4 || animId == 15)
+ _frameDelay *= 8;
+
if (_subData._totalSize) {
_dataNeeded = _subData._totalSize;
} else {
diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h
index 41ddb277de..c9695c921d 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.h
+++ b/engines/tsage/ringworld2/ringworld2_logic.h
@@ -307,7 +307,6 @@ public:
int _frameCount;
int _resCount;
int _mapImagePitch;
- int _unused;
public:
MazeUI();
virtual ~MazeUI();
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
index f483b1e47c..3fd728ce5b 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp
@@ -712,7 +712,7 @@ void Scene125::signal() {
R2_GLOBALS._player._canWalk = false;
break;
case 10:
- switch (_consoleMode) {
+ switch (_consoleMode) {
case 12:
_sceneMode = 129;
@@ -1541,7 +1541,7 @@ void Scene180::postInit(SceneObjectList *OwnerList) {
}
void Scene180::remove() {
- _stripManager._field2E8 = -1;
+ _stripManager._currObj44Id = -1;
// _stripManager._field2EA = -1;
SceneExt::remove();
@@ -2519,6 +2519,72 @@ void Scene205::handleText() {
}
/*--------------------------------------------------------------------------
+ * Scene 205 Demo - End of Demo
+ *
+ *--------------------------------------------------------------------------*/
+
+void Scene205Demo::Action1::signal() {
+ Scene205Demo *scene = (Scene205Demo *)R2_GLOBALS._sceneManager._scene;
+
+ switch (_actionIndex++) {
+ case 0:
+ setDelay(2);
+ break;
+ case 1:
+ MessageDialog::show2(BUY_FULL_GAME_MSG, OK_BTN_STRING);
+ setDelay(1);
+ break;
+ case 2:
+ scene->leaveScene();
+ break;
+ default:
+ break;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene205Demo::leaveScene() {
+ if (g_globals->getFlag(85))
+ R2_GLOBALS._sceneManager.changeScene(160);
+ else
+ R2_GLOBALS._sceneManager.changeScene(R2_GLOBALS._sceneManager._previousScene);
+
+ BF_GLOBALS._scenePalette.loadPalette(0);
+ BF_GLOBALS._scenePalette.refresh();
+}
+
+void Scene205Demo::postInit(SceneObjectList *OwnerList) {
+ R2_GLOBALS._sceneManager._hasPalette = true;
+ R2_GLOBALS._scenePalette.loadPalette(0);
+
+ loadScene(1000);
+ R2_GLOBALS._uiElements._active = false;
+ R2_GLOBALS._player.enableControl();
+
+ SceneExt::postInit();
+
+ _sound1.play(337);
+ _stripManager.addSpeaker(&_animationPlayer);
+
+ setAction(&_action1);
+}
+
+void Scene205Demo::remove() {
+ R2_GLOBALS._sound1.fadeOut2(NULL);
+ SceneExt::remove();
+}
+
+void Scene205Demo::process(Event &event) {
+ if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) {
+ event.handled = true;
+ leaveScene();
+ } else {
+ Scene::process(event);
+ }
+}
+
+/*--------------------------------------------------------------------------
* Scene 250 - Lift
*
*--------------------------------------------------------------------------*/
@@ -3550,13 +3616,17 @@ void Scene300::signal() {
R2_GLOBALS.setFlag(40);
break;
case 6:
- R2_GLOBALS._sceneManager.changeScene(1000);
+ if (g_vm->getFeatures() & GF_DEMO) {
+ R2_GLOBALS.setFlag(85);
+ R2_GLOBALS._sceneManager.changeScene(205);
+ } else
+ R2_GLOBALS._sceneManager.changeScene(1000);
break;
default:
break;
}
- _stripManager._field2E8 = 0;
+ _stripManager._currObj44Id = 0;
switch (_stripId) {
case 400:
R2_GLOBALS._player.disableControl();
@@ -3611,8 +3681,14 @@ void Scene300::signal() {
case 16:
if (_stripManager._exitMode == 1) {
- R2_GLOBALS._player.setAction(NULL);
- R2_GLOBALS._sceneManager.changeScene(1000);
+ if (g_vm->getFeatures() & GF_DEMO) {
+ R2_GLOBALS._player.setAction(NULL);
+ R2_GLOBALS.setFlag(85);
+ R2_GLOBALS._sceneManager.changeScene(205);
+ } else {
+ R2_GLOBALS._player.setAction(NULL);
+ R2_GLOBALS._sceneManager.changeScene(1000);
+ }
} else {
R2_GLOBALS._player.setAction(&_action1);
R2_GLOBALS._player.enableControl(CURSOR_TALK);
@@ -5281,7 +5357,7 @@ void Scene500::PanelDialog::Button::doButtonPress() {
&scene->_suit, &scene->_transparentDoor, NULL);
} else {
scene->_sound1.play(127);
- scene->_suits.animate(ANIM_MODE_6, scene);
+ scene->_suits.animate(ANIM_MODE_5, scene);
}
break;
diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h
index 0e68b67ee7..216039a348 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes0.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes0.h
@@ -304,6 +304,24 @@ public:
virtual void dispatch();
};
+class Scene205Demo: public SceneExt {
+ /* Actions */
+ class Action1: public Action {
+ public:
+ virtual void signal();
+ };
+private:
+ void leaveScene();
+public:
+ VisualSpeaker _animationPlayer;
+ ASound _sound1;
+ Action1 _action1;
+public:
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void remove();
+ virtual void process(Event &event);
+};
+
class Scene250: public SceneExt {
class Button: public SceneActor {
public:
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 2d957990b9..075420a1c9 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -20,6 +20,8 @@
*
*/
+#include "graphics/cursorman.h"
+
#include "tsage/scenes.h"
#include "tsage/tsage.h"
#include "tsage/staticres.h"
@@ -874,8 +876,8 @@ void Scene1100::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player._moveRate = 30;
R2_GLOBALS._player._moveDiff = Common::Point(16, 2);
- _rightLandslide.setup2(1104, 2, 1, 175, 125, 102, 1);
- _purplePlant.setup2(1102, 5, 1, 216, 167, 1, 0);
+ _rightLandslide.setup2(1104, 2, 1, 175, 125, 102, EFFECT_SHADED);
+ _purplePlant.setup2(1102, 5, 1, 216, 167, 1, EFFECT_NONE);
_leftImpacts.postInit();
_leftImpacts.setup(1113, 2, 1);
@@ -1200,18 +1202,10 @@ void Scene1100::signal() {
R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
if (_nextStripNum == 0) {
R2_GLOBALS.setFlag(55);
- if (R2_GLOBALS.getFlag(55)) {
- if (R2_GLOBALS._player._characterIndex == R2_QUINN)
- _stripManager.start(318, this);
- else
- _stripManager.start(323, this);
- } else {
- // This part is totally useless as flag 55 has been set right before the check
- if (R2_GLOBALS._player._characterIndex == R2_QUINN)
- _stripManager.start(317, this);
- else
- _stripManager.start(322, this);
- }
+ if (R2_GLOBALS._player._characterIndex == R2_QUINN)
+ _stripManager.start(318, this);
+ else
+ _stripManager.start(323, this);
} else
_stripManager.start3(_nextStripNum, this, _stripManager._lookupList);
@@ -1568,7 +1562,7 @@ void Scene1200::signal() {
// No break on purpose
case 1203:
R2_GLOBALS._player.enableControl();
- warning("_eventManager.waitEvent()");
+ // CHECKME: The original is calling _eventManager.waitEvent();
_sceneMode = 2;
break;
case 10:
@@ -1790,7 +1784,7 @@ void Scene1200::signal() {
R2_GLOBALS._player.animate(ANIM_MODE_6, this);
break;
default:
- warning("_eventManager.waitEvent()");
+ // CHECKME: The original is walling _eventManager.waitEvent();
_sceneMode = 2;
break;
}
@@ -2210,70 +2204,86 @@ void Scene1200::startCrawling(CrawlDirection dir) {
*
*--------------------------------------------------------------------------*/
-Scene1337::unkObj1337sub1::unkObj1337sub1() {
- _field34 = 0;
- _field36 = Common::Point(0, 0);
+Scene1337::Card::Card() {
+ _cardId = 0;
+ _stationPos = Common::Point(0, 0);
}
-void Scene1337::unkObj1337sub1::synchronize(Serializer &s) {
- warning("STUBBED: unkObj1337sub1::synchronize()");
+void Scene1337::Card::synchronize(Serializer &s) {
+ warning("STUBBED: Card::synchronize()");
}
-Scene1337::unkObj1337_1::unkObj1337_1() {
- _fieldB94 = Common::Point(0, 0);
- _fieldB98 = Common::Point(0, 0);
- _fieldB9C = Common::Point(0, 0);
- _fieldBA0 = Common::Point(0, 0);
- _fieldBA4 = 0;
+bool Scene1337::Card::isIn(Common::Point pt) {
+ if ((_stationPos.x > pt.x) || (_stationPos.x + 24 < pt.x))
+ return false;
+
+ if ((_stationPos.y > pt.y) || (_stationPos.y + 24 < pt.y))
+ return false;
+
+ return true;
+}
+
+Scene1337::GameBoardSide::GameBoardSide() {
+ _card1Pos = Common::Point(0, 0);
+ _card2Pos = Common::Point(0, 0);
+ _card3Pos = Common::Point(0, 0);
+ _card4Pos = Common::Point(0, 0);
+ _frameNum = 0;
}
-void Scene1337::unkObj1337_1::synchronize(Serializer &s) {
- warning("STUBBED: unkObj1337_1::synchronize()");
+void Scene1337::GameBoardSide::synchronize(Serializer &s) {
+ warning("STUBBED: GameBoardSide::synchronize()");
}
Scene1337::Scene1337() {
_autoplay = false;
- _field3E24 = 0;
- _field3E26 = 0;
+ _cardsAvailableNumb = 0;
+ _currentDiscardIndex = 0;
for (int i = 0; i < 100; i++)
- _field3E28[i] = 0;
+ _availableCardsPile[i] = 0;
+
+ _shuffleEndedFl = false;
+ _currentPlayerNumb = 0;
+ _actionIdx1 = 0;
+ _actionIdx2 = 0;
+ _showPlayerTurn = false;
+ _displayHelpFl = false;
+ _winnerId = -1;
+ _instructionsDisplayedFl = false;
+ _instructionsWaitCount = 0;
- _field423C = 0;
- _field423E = 0;
- _field4240 = 0;
- _field4242 = 0;
- _field4244 = 0;
- _field4246 = 0;
- _field4248 = 0;
- _field424A = 0;
- _field424C = 0;
- _field424E = 0;
+ _delayedFunction = nullptr;
+ _actionCard1 = nullptr;
+ _actionCard2 = nullptr;
+ _actionCard3 = nullptr;
- _unkFctPtr412 = nullptr;
- _field3EF0 = nullptr;
- _field3EF4 = nullptr;
- _field3EF8 = nullptr;
+ _cursorCurRes = 0;
+ _cursorCurStrip = 0;
+ _cursorCurFrame = 0;
}
void Scene1337::synchronize(Serializer &s) {
warning("STUBBED: Scene1337::synchronize()");
}
-void Scene1337::Action1337::subD18B5(int resNum, int stripNum, int frameNum) {
- warning("STUBBED: Action1337::subD18B5()");
-}
-
-void Scene1337::Action1337::skipFrames(int32 skipCount) {
+void Scene1337::Action1337::waitFrames(int32 frameCount) {
uint32 firstFrameNumber = g_globals->_events.getFrameNumber();
- uint32 tmpFrameNumber = firstFrameNumber;
+ uint32 curFrame = firstFrameNumber;
+ uint32 destFrame = firstFrameNumber + frameCount;
- while (tmpFrameNumber < firstFrameNumber + skipCount)
- tmpFrameNumber = g_globals->_events.getFrameNumber();
-
- warning("_eventManager.waitEvent(-1)");
+ while ((curFrame < destFrame) && !g_vm->shouldQuit()) {
+ TsAGE::Event event;
+ g_globals->_events.getEvent(event);
+ curFrame = g_globals->_events.getFrameNumber();
+ }
+
+ // CHECKME: The original is calling _eventManager.waitEvent();
}
+/**
+ * Display instructions
+ */
void Scene1337::Action1::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -2284,393 +2294,396 @@ void Scene1337::Action1::signal() {
scene->actionDisplay(1331, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
scene->actionDisplay(1331, 8, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_arrunkObj1337[1]._arr2[0]._field34 = 2;
- scene->_arrunkObj1337[1]._arr2[0]._object1.postInit();
- scene->_arrunkObj1337[1]._arr2[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[1]._arr2[0]._field36, 0);
- scene->_arrunkObj1337[1]._arr2[0]._object1.setStrip(2);
- scene->_arrunkObj1337[1]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[1]._arr2[0]._field34);
- scene->_arrunkObj1337[1]._arr2[0]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[1]._arr2[0]);
-
- scene->_arrunkObj1337[1]._arr2[1]._field34 = 3;
- scene->_arrunkObj1337[1]._arr2[1]._object1.postInit();
- scene->_arrunkObj1337[1]._arr2[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[1]._arr2[1]._field36, 0);
- scene->_arrunkObj1337[1]._arr2[1]._object1.setStrip(2);
- scene->_arrunkObj1337[1]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[1]._arr2[1]._field34);
- scene->_arrunkObj1337[1]._arr2[1]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[1]._arr2[1]);
-
- scene->_arrunkObj1337[2]._arr2[0]._field34 = 4;
- scene->_arrunkObj1337[2]._arr2[0]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[0]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[0]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[0]._field34);
- scene->_arrunkObj1337[2]._arr2[0]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[0]);
-
- scene->_arrunkObj1337[3]._arr2[0]._field34 = 5;
- scene->_arrunkObj1337[3]._arr2[0]._object1.postInit();
- scene->_arrunkObj1337[3]._arr2[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[3]._arr2[0]._field36, 0);
- scene->_arrunkObj1337[3]._arr2[0]._object1.setStrip(2);
- scene->_arrunkObj1337[3]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[3]._arr2[0]._field34);
- scene->_arrunkObj1337[3]._arr2[0]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[3]._arr2[0]);
-
- scene->_arrunkObj1337[3]._arr2[1]._field34 = 6;
- scene->_arrunkObj1337[3]._arr2[1]._object1.postInit();
- scene->_arrunkObj1337[3]._arr2[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[3]._arr2[1]._field36, 0);
- scene->_arrunkObj1337[3]._arr2[1]._object1.setStrip(2);
- scene->_arrunkObj1337[3]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[3]._arr2[1]._field34);
- scene->_arrunkObj1337[3]._arr2[1]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[3]._arr2[1]);
-
- scene->_arrunkObj1337[3]._arr2[2]._field34 = 7;
- scene->_arrunkObj1337[3]._arr2[2]._object1.postInit();
- scene->_arrunkObj1337[3]._arr2[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr2[2]._object1.setPosition(scene->_arrunkObj1337[3]._arr2[2]._field36, 0);
- scene->_arrunkObj1337[3]._arr2[2]._object1.setStrip(2);
- scene->_arrunkObj1337[3]._arr2[2]._object1.setFrame(scene->_arrunkObj1337[3]._arr2[2]._field34);
- scene->_arrunkObj1337[3]._arr2[2]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[3]._arr2[2]);
-
- scene->_arrunkObj1337[0]._arr2[0]._field34 = 8;
- scene->_arrunkObj1337[0]._arr2[0]._object1.postInit();
- scene->_arrunkObj1337[0]._arr2[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr2[0]._object1.setPosition(scene->_arrunkObj1337[0]._arr2[0]._field36, 0);
- scene->_arrunkObj1337[0]._arr2[0]._object1.setStrip(2);
- scene->_arrunkObj1337[0]._arr2[0]._object1.setFrame(scene->_arrunkObj1337[0]._arr2[0]._field34);
- scene->_arrunkObj1337[0]._arr2[0]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[0]._arr2[0]);
-
- scene->_arrunkObj1337[0]._arr2[1]._field34 = 9;
- scene->_arrunkObj1337[0]._arr2[1]._object1.postInit();
- scene->_arrunkObj1337[0]._arr2[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[0]._arr2[1]._field36, 0);
- scene->_arrunkObj1337[0]._arr2[1]._object1.setStrip(2);
- scene->_arrunkObj1337[0]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[0]._arr2[1]._field34);
- scene->_arrunkObj1337[0]._arr2[1]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[0]._arr2[1]);
+ scene->_gameBoardSide[1]._outpostStation[0]._cardId = 2;
+ scene->_gameBoardSide[1]._outpostStation[0]._card.postInit();
+ scene->_gameBoardSide[1]._outpostStation[0]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[1]._outpostStation[0]._stationPos, 0);
+ scene->_gameBoardSide[1]._outpostStation[0]._card.setStrip(2);
+ scene->_gameBoardSide[1]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[1]._outpostStation[0]._cardId);
+ scene->_gameBoardSide[1]._outpostStation[0]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[1]._outpostStation[0]);
+
+ scene->_gameBoardSide[1]._outpostStation[1]._cardId = 3;
+ scene->_gameBoardSide[1]._outpostStation[1]._card.postInit();
+ scene->_gameBoardSide[1]._outpostStation[1]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[1]._outpostStation[1]._stationPos, 0);
+ scene->_gameBoardSide[1]._outpostStation[1]._card.setStrip(2);
+ scene->_gameBoardSide[1]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[1]._outpostStation[1]._cardId);
+ scene->_gameBoardSide[1]._outpostStation[1]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[1]._outpostStation[1]);
+
+ scene->_gameBoardSide[2]._outpostStation[0]._cardId = 4;
+ scene->_gameBoardSide[2]._outpostStation[0]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[0]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[0]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[0]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[0]._cardId);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[0]);
+
+ scene->_gameBoardSide[3]._outpostStation[0]._cardId = 5;
+ scene->_gameBoardSide[3]._outpostStation[0]._card.postInit();
+ scene->_gameBoardSide[3]._outpostStation[0]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[3]._outpostStation[0]._stationPos, 0);
+ scene->_gameBoardSide[3]._outpostStation[0]._card.setStrip(2);
+ scene->_gameBoardSide[3]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[3]._outpostStation[0]._cardId);
+ scene->_gameBoardSide[3]._outpostStation[0]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[3]._outpostStation[0]);
+
+ scene->_gameBoardSide[3]._outpostStation[1]._cardId = 6;
+ scene->_gameBoardSide[3]._outpostStation[1]._card.postInit();
+ scene->_gameBoardSide[3]._outpostStation[1]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[3]._outpostStation[1]._stationPos, 0);
+ scene->_gameBoardSide[3]._outpostStation[1]._card.setStrip(2);
+ scene->_gameBoardSide[3]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[3]._outpostStation[1]._cardId);
+ scene->_gameBoardSide[3]._outpostStation[1]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[3]._outpostStation[1]);
+
+ scene->_gameBoardSide[3]._outpostStation[2]._cardId = 7;
+ scene->_gameBoardSide[3]._outpostStation[2]._card.postInit();
+ scene->_gameBoardSide[3]._outpostStation[2]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._outpostStation[2]._card.setPosition(scene->_gameBoardSide[3]._outpostStation[2]._stationPos, 0);
+ scene->_gameBoardSide[3]._outpostStation[2]._card.setStrip(2);
+ scene->_gameBoardSide[3]._outpostStation[2]._card.setFrame(scene->_gameBoardSide[3]._outpostStation[2]._cardId);
+ scene->_gameBoardSide[3]._outpostStation[2]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[3]._outpostStation[2]);
+
+ scene->_gameBoardSide[0]._outpostStation[0]._cardId = 8;
+ scene->_gameBoardSide[0]._outpostStation[0]._card.postInit();
+ scene->_gameBoardSide[0]._outpostStation[0]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._outpostStation[0]._card.setPosition(scene->_gameBoardSide[0]._outpostStation[0]._stationPos, 0);
+ scene->_gameBoardSide[0]._outpostStation[0]._card.setStrip(2);
+ scene->_gameBoardSide[0]._outpostStation[0]._card.setFrame(scene->_gameBoardSide[0]._outpostStation[0]._cardId);
+ scene->_gameBoardSide[0]._outpostStation[0]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[0]._outpostStation[0]);
+
+ scene->_gameBoardSide[0]._outpostStation[1]._cardId = 9;
+ scene->_gameBoardSide[0]._outpostStation[1]._card.postInit();
+ scene->_gameBoardSide[0]._outpostStation[1]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[0]._outpostStation[1]._stationPos, 0);
+ scene->_gameBoardSide[0]._outpostStation[1]._card.setStrip(2);
+ scene->_gameBoardSide[0]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[0]._outpostStation[1]._cardId);
+ scene->_gameBoardSide[0]._outpostStation[1]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[0]._outpostStation[1]);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(60);
+ waitFrames(60);
scene->actionDisplay(1331, 9, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_arrunkObj1337[2]._arr2[1]._field34 = 2;
- scene->_arrunkObj1337[2]._arr2[1]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[1]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[1]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[1]._field34);
- scene->_arrunkObj1337[2]._arr2[1]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[1]);
-
- scene->_arrunkObj1337[2]._arr2[2]._field34 = 3;
- scene->_arrunkObj1337[2]._arr2[2]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[2]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[2]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[2]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[2]._field34);
- scene->_arrunkObj1337[2]._arr2[2]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[2]);
-
- scene->_arrunkObj1337[2]._arr2[3]._field34 = 5;
- scene->_arrunkObj1337[2]._arr2[3]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[3]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[3]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[3]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[3]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[3]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[3]._field34);
- scene->_arrunkObj1337[2]._arr2[3]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[3]);
-
- scene->_arrunkObj1337[2]._arr2[4]._field34 = 6;
- scene->_arrunkObj1337[2]._arr2[4]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[4]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[4]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[4]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[4]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[4]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[4]._field34);
- scene->_arrunkObj1337[2]._arr2[4]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[4]);
-
- scene->_arrunkObj1337[2]._arr2[5]._field34 = 7;
- scene->_arrunkObj1337[2]._arr2[5]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[5]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[5]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[5]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[5]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[5]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[5]._field34);
- scene->_arrunkObj1337[2]._arr2[5]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[5]);
-
- scene->_arrunkObj1337[2]._arr2[6]._field34 = 8;
- scene->_arrunkObj1337[2]._arr2[6]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[6]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[6]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[6]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[6]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[6]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[6]._field34);
- scene->_arrunkObj1337[2]._arr2[6]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[6]);
-
- scene->_arrunkObj1337[2]._arr2[7]._field34 = 9;
- scene->_arrunkObj1337[2]._arr2[7]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[7]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[7]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[7]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[7]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr2[7]._object1.setFrame(scene->_arrunkObj1337[2]._arr2[7]._field34);
- scene->_arrunkObj1337[2]._arr2[7]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[7]);
+ scene->_gameBoardSide[2]._outpostStation[1]._cardId = 2;
+ scene->_gameBoardSide[2]._outpostStation[1]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[1]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[1]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[1]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[1]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[1]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[1]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[1]);
+
+ scene->_gameBoardSide[2]._outpostStation[2]._cardId = 3;
+ scene->_gameBoardSide[2]._outpostStation[2]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[2]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[2]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[2]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[2]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[2]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[2]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[2]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[2]);
+
+ scene->_gameBoardSide[2]._outpostStation[3]._cardId = 5;
+ scene->_gameBoardSide[2]._outpostStation[3]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[3]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[3]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[3]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[3]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[3]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[3]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[3]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[3]);
+
+ scene->_gameBoardSide[2]._outpostStation[4]._cardId = 6;
+ scene->_gameBoardSide[2]._outpostStation[4]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[4]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[4]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[4]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[4]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[4]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[4]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[4]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[4]);
+
+ scene->_gameBoardSide[2]._outpostStation[5]._cardId = 7;
+ scene->_gameBoardSide[2]._outpostStation[5]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[5]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[5]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[5]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[5]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[5]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[5]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[5]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[5]);
+
+ scene->_gameBoardSide[2]._outpostStation[6]._cardId = 8;
+ scene->_gameBoardSide[2]._outpostStation[6]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[6]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[6]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[6]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[6]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[6]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[6]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[6]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[6]);
+
+ scene->_gameBoardSide[2]._outpostStation[7]._cardId = 9;
+ scene->_gameBoardSide[2]._outpostStation[7]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[7]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[7]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[7]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[7]._card.setStrip(2);
+ scene->_gameBoardSide[2]._outpostStation[7]._card.setFrame(scene->_gameBoardSide[2]._outpostStation[7]._cardId);
+ scene->_gameBoardSide[2]._outpostStation[7]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[7]);
scene->_aSound1.play(62);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(120);
- scene->_arrunkObj1337[2]._arr2[0]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[1]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[2]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[3]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[4]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[5]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[6]._object1.remove();
- scene->_arrunkObj1337[2]._arr2[7]._object1.remove();
-
- scene->_arrunkObj1337[1]._arr2[0]._object1.remove();
- scene->_arrunkObj1337[1]._arr2[1]._object1.remove();
-
- scene->_arrunkObj1337[3]._arr2[0]._object1.remove();
- scene->_arrunkObj1337[3]._arr2[1]._object1.remove();
- scene->_arrunkObj1337[3]._arr2[2]._object1.remove();
-
- scene->_arrunkObj1337[0]._arr2[0]._object1.remove();
- scene->_arrunkObj1337[0]._arr2[1]._object1.remove();
-
- scene->_background2.setup2(1332, 5, 1, 165, 95, 110, 1);
-
- scene->_arrunkObj1337[1]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[1]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setFrame(4);
- scene->_arrunkObj1337[1]._arr1[0]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[1]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[1]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setFrame(4);
- scene->_arrunkObj1337[1]._arr1[1]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[1]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[1]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setFrame(4);
- scene->_arrunkObj1337[1]._arr1[2]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[2]._arr1[0]._field34 = 30;
- scene->_arrunkObj1337[2]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(2);
- scene->_arrunkObj1337[2]._arr1[0]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[0]);
-
- scene->_arrunkObj1337[2]._arr1[1]._field34 = 16;
- scene->_arrunkObj1337[2]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(2);
- scene->_arrunkObj1337[2]._arr1[1]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[1]);
-
- scene->_arrunkObj1337[2]._arr1[2]._field34 = 1;
- scene->_arrunkObj1337[2]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(2);
- scene->_arrunkObj1337[2]._arr1[2]._object1.fixPriority(170);
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[2]);
-
- scene->_arrunkObj1337[3]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[3]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setFrame(3);
- scene->_arrunkObj1337[3]._arr1[0]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[3]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[3]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setFrame(3);
- scene->_arrunkObj1337[3]._arr1[1]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[3]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[3]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setFrame(3);
- scene->_arrunkObj1337[3]._arr1[2]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[0]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[0]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setFrame(2);
- scene->_arrunkObj1337[0]._arr1[0]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[0]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[0]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setFrame(2);
- scene->_arrunkObj1337[0]._arr1[1]._object1.fixPriority(170);
-
- scene->_arrunkObj1337[0]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[0]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setFrame(2);
- scene->_arrunkObj1337[0]._arr1[2]._object1.fixPriority(170);
+ waitFrames(120);
+ scene->_gameBoardSide[2]._outpostStation[0]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[1]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[2]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[3]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[4]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[5]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[6]._card.remove();
+ scene->_gameBoardSide[2]._outpostStation[7]._card.remove();
+
+ scene->_gameBoardSide[1]._outpostStation[0]._card.remove();
+ scene->_gameBoardSide[1]._outpostStation[1]._card.remove();
+
+ scene->_gameBoardSide[3]._outpostStation[0]._card.remove();
+ scene->_gameBoardSide[3]._outpostStation[1]._card.remove();
+ scene->_gameBoardSide[3]._outpostStation[2]._card.remove();
+
+ scene->_gameBoardSide[0]._outpostStation[0]._card.remove();
+ scene->_gameBoardSide[0]._outpostStation[1]._card.remove();
+
+ scene->_stockPile.setup(1332, 5, 1);
+ scene->_stockPile.setPosition(Common::Point(165, 95));
+ scene->_stockPile.setPriority(110);
+ scene->_stockPile._effect = EFFECT_SHADED;
+ scene->_stockPile.show();
+
+ scene->_gameBoardSide[1]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[1]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._handCard[0]._card.setPosition(scene->_gameBoardSide[1]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[1]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[1]._handCard[0]._card.setFrame(4);
+ scene->_gameBoardSide[1]._handCard[0]._card.fixPriority(170);
+
+ scene->_gameBoardSide[1]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[1]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._handCard[1]._card.setPosition(scene->_gameBoardSide[1]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[1]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[1]._handCard[1]._card.setFrame(4);
+ scene->_gameBoardSide[1]._handCard[1]._card.fixPriority(170);
+
+ scene->_gameBoardSide[1]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[1]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._handCard[2]._card.setPosition(scene->_gameBoardSide[1]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[1]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[1]._handCard[2]._card.setFrame(4);
+ scene->_gameBoardSide[1]._handCard[2]._card.fixPriority(170);
+
+ scene->_gameBoardSide[2]._handCard[0]._cardId = 30;
+ scene->_gameBoardSide[2]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[0]._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[2]._handCard[0]._card.setFrame(2);
+ scene->_gameBoardSide[2]._handCard[0]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[0]);
+
+ scene->_gameBoardSide[2]._handCard[1]._cardId = 16;
+ scene->_gameBoardSide[2]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[1]._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[2]._handCard[1]._card.setFrame(2);
+ scene->_gameBoardSide[2]._handCard[1]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[1]);
+
+ scene->_gameBoardSide[2]._handCard[2]._cardId = 1;
+ scene->_gameBoardSide[2]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[2]._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[2]._handCard[2]._card.setFrame(2);
+ scene->_gameBoardSide[2]._handCard[2]._card.fixPriority(170);
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[2]);
+
+ scene->_gameBoardSide[3]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[3]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._handCard[0]._card.setPosition(scene->_gameBoardSide[3]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[3]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[3]._handCard[0]._card.setFrame(3);
+ scene->_gameBoardSide[3]._handCard[0]._card.fixPriority(170);
+
+ scene->_gameBoardSide[3]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[3]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._handCard[1]._card.setPosition(scene->_gameBoardSide[3]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[3]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[3]._handCard[1]._card.setFrame(3);
+ scene->_gameBoardSide[3]._handCard[1]._card.fixPriority(170);
+
+ scene->_gameBoardSide[3]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[3]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._handCard[2]._card.setPosition(scene->_gameBoardSide[3]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[3]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[3]._handCard[2]._card.setFrame(3);
+ scene->_gameBoardSide[3]._handCard[2]._card.fixPriority(170);
+
+ scene->_gameBoardSide[0]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[0]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._handCard[0]._card.setPosition(scene->_gameBoardSide[0]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[0]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[0]._handCard[0]._card.setFrame(2);
+ scene->_gameBoardSide[0]._handCard[0]._card.fixPriority(170);
+
+ scene->_gameBoardSide[0]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[0]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._handCard[1]._card.setPosition(scene->_gameBoardSide[0]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[0]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[0]._handCard[1]._card.setFrame(2);
+ scene->_gameBoardSide[0]._handCard[1]._card.fixPriority(170);
+
+ scene->_gameBoardSide[0]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[0]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._handCard[2]._card.setPosition(scene->_gameBoardSide[0]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[0]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[0]._handCard[2]._card.setFrame(2);
+ scene->_gameBoardSide[0]._handCard[2]._card.fixPriority(170);
R2_GLOBALS._sceneObjects->draw();
scene->actionDisplay(1331, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_item2._object1.setPosition(Common::Point(162, 95), 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0);
+ scene->_animatedCard._card.show();
scene->_aSound2.play(61);
Common::Point pt(91, 174);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
}
break;
case 2: {
- scene->_arrunkObj1337[2]._arr1[3]._field34 = 2;
- scene->_arrunkObj1337[2]._arr1[3]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[3]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[3]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[3]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[3]._object1.setStrip(1);
- scene->_arrunkObj1337[2]._arr1[3]._object1.setFrame(2);
- scene->_arrunkObj1337[2]._arr1[3]._object1.fixPriority(170);
+ scene->_gameBoardSide[2]._handCard[3]._cardId = 2;
+ scene->_gameBoardSide[2]._handCard[3]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[3]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[3]._card.setPosition(scene->_gameBoardSide[2]._handCard[3]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[3]._card.setStrip(1);
+ scene->_gameBoardSide[2]._handCard[3]._card.setFrame(2);
+ scene->_gameBoardSide[2]._handCard[3]._card.fixPriority(170);
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr1[3]);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._handCard[3]);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(60);
+ waitFrames(60);
scene->actionDisplay(1331, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
scene->actionDisplay(1331, 12, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_arrunkObj1337[2]._arr2[1]._field34 = 1;
- scene->_arrunkObj1337[2]._arr2[1]._object1.postInit();
- scene->_arrunkObj1337[2]._arr2[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr2[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr2[1]._field36, 0);
- scene->_arrunkObj1337[2]._arr2[1]._object1.hide();
+ scene->_gameBoardSide[2]._outpostStation[1]._cardId = 1;
+ scene->_gameBoardSide[2]._outpostStation[1]._card.postInit();
+ scene->_gameBoardSide[2]._outpostStation[1]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._outpostStation[1]._card.setPosition(scene->_gameBoardSide[2]._outpostStation[1]._stationPos, 0);
+ scene->_gameBoardSide[2]._outpostStation[1]._card.hide();
- scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[2]._object1._strip);
- scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._object1._frame);
- scene->_item2._object1.animate(ANIM_MODE_NONE, NULL);
+ scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[2]._card._strip);
+ scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._card._frame);
+ scene->_animatedCard._card.animate(ANIM_MODE_NONE, NULL);
- scene->_arrunkObj1337[2]._arr1[2]._field34 = 0;
- scene->_arrunkObj1337[2]._arr1[2]._object1.remove();
+ scene->_gameBoardSide[2]._handCard[2]._cardId = 0;
+ scene->_gameBoardSide[2]._handCard[2]._card.remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[2]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr2[1]._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._outpostStation[1]._stationPos, this);
}
break;
case 3: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[1]);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[1]);
scene->_aSound1.play(59);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(60);
+ waitFrames(60);
scene->actionDisplay(1331, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_arrunkObj1337[2]._arr2[1]._field34 = scene->_arrunkObj1337[2]._arr1[3]._field34;
+ scene->_gameBoardSide[2]._outpostStation[1]._cardId = scene->_gameBoardSide[2]._handCard[3]._cardId;
- scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[3]._object1._strip);
- scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[3]._object1._frame);
+ scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[3]._card._strip);
+ scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[3]._card._frame);
- scene->_arrunkObj1337[2]._arr1[3]._field34 = 0;
- scene->_arrunkObj1337[2]._arr1[3]._object1.remove();
+ scene->_gameBoardSide[2]._handCard[3]._cardId = 0;
+ scene->_gameBoardSide[2]._handCard[3]._card.remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[3]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[3]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr2[1]._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._outpostStation[1]._stationPos, this);
}
break;
case 4: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr2[1]);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._outpostStation[1]);
scene->_aSound1.play(59);
- scene->_item7._field34 = 1;
- scene->_item7._object1.hide();
+ scene->_discardPile._cardId = 1;
+ scene->_discardPile._card.hide();
- scene->_item2._object1.setStrip(5);
- scene->_item2._object1.setFrame(1);
- scene->_item2._object1.animate(ANIM_MODE_2, NULL);
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr2[1]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setStrip(5);
+ scene->_animatedCard._card.setFrame(1);
+ scene->_animatedCard._card.animate(ANIM_MODE_2, NULL);
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._outpostStation[1]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_item7._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this);
}
break;
case 5: {
- scene->_item2._object1.hide();
+ scene->_animatedCard._card.hide();
- scene->_item7._object1.postInit();
- scene->_item7._object1.setVisage(1332);
- scene->_item7._object1.setPosition(scene->_item7._field36, 0);
- scene->setAnimationInfo(&scene->_item7);
+ scene->_discardPile._card.postInit();
+ scene->_discardPile._card.setVisage(1332);
+ scene->_discardPile._card.setPosition(scene->_discardPile._stationPos, 0);
+ scene->setAnimationInfo(&scene->_discardPile);
scene->_aSound2.play(61);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(60);
+ waitFrames(60);
scene->actionDisplay(1331, 14, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_arrunkObj1337[2]._arr3[0]._object1.postInit();
- scene->_arrunkObj1337[2]._arr3[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr3[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0);
- scene->_arrunkObj1337[2]._arr3[0]._object1.hide();
+ scene->_gameBoardSide[2]._delayCard._card.postInit();
+ scene->_gameBoardSide[2]._delayCard._card.setVisage(1332);
+ scene->_gameBoardSide[2]._delayCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0);
+ scene->_gameBoardSide[2]._delayCard._card.hide();
- scene->_arrunkObj1337[3]._arr1[2]._field34 = 0;
- scene->_arrunkObj1337[3]._arr1[2].remove();
+ scene->_gameBoardSide[3]._handCard[2]._cardId = 0;
+ scene->_gameBoardSide[3]._handCard[2].remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[3]._arr1[2]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[3]._handCard[2]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr3[0]._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._delayCard._stationPos, this);
}
break;
case 6: {
- scene->_item2._object1.hide();
- scene->_arrunkObj1337[2]._arr3[0]._field34 = 21;
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr3[0]);
+ scene->_animatedCard._card.hide();
+ scene->_gameBoardSide[2]._delayCard._cardId = 21;
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._delayCard);
scene->_aSound1.play(57);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(60);
+ waitFrames(60);
scene->actionDisplay(1331, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154);
int tmpVal = 15;
@@ -2679,89 +2692,89 @@ void Scene1337::Action1::signal() {
for (i = 0; i <= 7; i++) {
tmpVal += 29;
- scene->_arrObject1[i].postInit();
- scene->_arrObject1[i].setVisage(1332);
- scene->_arrObject1[i].setPosition(Common::Point(tmpVal, 90), 0);
- scene->_arrObject1[i].setStrip(3);
- scene->_arrObject1[i].fixPriority(190);
-
- scene->_arrObject2[i].postInit();
- scene->_arrObject2[i].setVisage(1332);
- scene->_arrObject2[i].setPosition(Common::Point(tmpVal, 90), 0);
- scene->_arrObject2[i].setStrip(7);
- scene->_arrObject2[i].setFrame(1);
- scene->_arrObject2[i].fixPriority(180);
- }
-
- scene->_arrObject1[0].setFrame(1);
- scene->_arrObject1[1].setFrame(3);
- scene->_arrObject1[2].setFrame(6);
- scene->_arrObject1[3].setFrame(8);
- scene->_arrObject1[4].setFrame(9);
- scene->_arrObject1[5].setFrame(10);
- scene->_arrObject1[6].setFrame(11);
- scene->_arrObject1[7].setFrame(12);
+ scene->_upperDisplayCard[i].postInit();
+ scene->_upperDisplayCard[i].setVisage(1332);
+ scene->_upperDisplayCard[i].setPosition(Common::Point(tmpVal, 90), 0);
+ scene->_upperDisplayCard[i].setStrip(3);
+ scene->_upperDisplayCard[i].fixPriority(190);
+
+ scene->_lowerDisplayCard[i].postInit();
+ scene->_lowerDisplayCard[i].setVisage(1332);
+ scene->_lowerDisplayCard[i].setPosition(Common::Point(tmpVal, 90), 0);
+ scene->_lowerDisplayCard[i].setStrip(7);
+ scene->_lowerDisplayCard[i].setFrame(1);
+ scene->_lowerDisplayCard[i].fixPriority(180);
+ }
+
+ scene->_upperDisplayCard[0].setFrame(1);
+ scene->_upperDisplayCard[1].setFrame(3);
+ scene->_upperDisplayCard[2].setFrame(6);
+ scene->_upperDisplayCard[3].setFrame(8);
+ scene->_upperDisplayCard[4].setFrame(9);
+ scene->_upperDisplayCard[5].setFrame(10);
+ scene->_upperDisplayCard[6].setFrame(11);
+ scene->_upperDisplayCard[7].setFrame(12);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(240);
+ waitFrames(240);
- scene->_arrObject1[0].remove();
- scene->_arrObject1[1].remove();
- scene->_arrObject1[2].remove();
- scene->_arrObject1[3].remove();
- scene->_arrObject1[4].remove();
- scene->_arrObject1[5].remove();
- scene->_arrObject1[6].remove();
- scene->_arrObject1[7].remove();
+ scene->_upperDisplayCard[0].remove();
+ scene->_upperDisplayCard[1].remove();
+ scene->_upperDisplayCard[2].remove();
+ scene->_upperDisplayCard[3].remove();
+ scene->_upperDisplayCard[4].remove();
+ scene->_upperDisplayCard[5].remove();
+ scene->_upperDisplayCard[6].remove();
+ scene->_upperDisplayCard[7].remove();
- scene->_arrObject2[0].remove();
- scene->_arrObject2[1].remove();
- scene->_arrObject2[2].remove();
- scene->_arrObject2[3].remove();
- scene->_arrObject2[4].remove();
- scene->_arrObject2[5].remove();
- scene->_arrObject2[6].remove();
- scene->_arrObject2[7].remove();
+ scene->_lowerDisplayCard[0].remove();
+ scene->_lowerDisplayCard[1].remove();
+ scene->_lowerDisplayCard[2].remove();
+ scene->_lowerDisplayCard[3].remove();
+ scene->_lowerDisplayCard[4].remove();
+ scene->_lowerDisplayCard[5].remove();
+ scene->_lowerDisplayCard[6].remove();
+ scene->_lowerDisplayCard[7].remove();
- scene->_item7._field34 = scene->_arrunkObj1337[2]._arr3[0]._field34;
+ scene->_discardPile._cardId = scene->_gameBoardSide[2]._delayCard._cardId;
- scene->_arrunkObj1337[2]._arr3[0]._field34 = 0;
- scene->_arrunkObj1337[2]._arr3[0]._object1.remove();
+ scene->_gameBoardSide[2]._delayCard._cardId = 0;
+ scene->_gameBoardSide[2]._delayCard._card.remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_item7._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this);
}
break;
case 7: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_item7);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_discardPile);
scene->_aSound2.play(61);
R2_GLOBALS._sceneObjects->draw();
- scene->_arrunkObj1337[2]._arr3[0]._object1.postInit();
- scene->_arrunkObj1337[2]._arr3[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr3[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0);
- scene->_arrunkObj1337[2]._arr3[0]._object1.hide();
+ scene->_gameBoardSide[2]._delayCard._card.postInit();
+ scene->_gameBoardSide[2]._delayCard._card.setVisage(1332);
+ scene->_gameBoardSide[2]._delayCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0);
+ scene->_gameBoardSide[2]._delayCard._card.hide();
- scene->_arrunkObj1337[3]._arr1[1]._field34 = 0;
- scene->_arrunkObj1337[3]._arr1[1].remove();
+ scene->_gameBoardSide[3]._handCard[1]._cardId = 0;
+ scene->_gameBoardSide[3]._handCard[1].remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[3]._arr1[1]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[3]._handCard[1]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr3[0]._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._delayCard._stationPos, this);
}
break;
case 8: {
- scene->_item2._object1.hide();
- scene->_arrunkObj1337[2]._arr3[0]._field34 = 14;
- scene->setAnimationInfo(&scene->_arrunkObj1337[2]._arr3[0]);
+ scene->_animatedCard._card.hide();
+ scene->_gameBoardSide[2]._delayCard._cardId = 14;
+ scene->setAnimationInfo(&scene->_gameBoardSide[2]._delayCard);
scene->_aSound1.play(57);
R2_GLOBALS._sceneObjects->draw();
@@ -2772,219 +2785,219 @@ void Scene1337::Action1::signal() {
for (i = 0; i <= 3; i++) {
tmpVal += 29;
- scene->_arrObject1[i].postInit();
- scene->_arrObject1[i].setVisage(1332);
- scene->_arrObject1[i].setPosition(Common::Point(tmpVal, 71), 0);
- scene->_arrObject1[i].setStrip(3);
- scene->_arrObject1[i].fixPriority(190);
+ scene->_upperDisplayCard[i].postInit();
+ scene->_upperDisplayCard[i].setVisage(1332);
+ scene->_upperDisplayCard[i].setPosition(Common::Point(tmpVal, 71), 0);
+ scene->_upperDisplayCard[i].setStrip(3);
+ scene->_upperDisplayCard[i].fixPriority(190);
- scene->_arrObject2[i].postInit();
- scene->_arrObject2[i].setVisage(1332);
- scene->_arrObject2[i].setPosition(Common::Point(tmpVal, 71), 0);
- scene->_arrObject2[i].setStrip(7);
- scene->_arrObject2[i].setFrame(1);
- scene->_arrObject2[i].fixPriority(180);
+ scene->_lowerDisplayCard[i].postInit();
+ scene->_lowerDisplayCard[i].setVisage(1332);
+ scene->_lowerDisplayCard[i].setPosition(Common::Point(tmpVal, 71), 0);
+ scene->_lowerDisplayCard[i].setStrip(7);
+ scene->_lowerDisplayCard[i].setFrame(1);
+ scene->_lowerDisplayCard[i].fixPriority(180);
}
- scene->_arrObject1[0].setFrame(2);
- scene->_arrObject1[1].setFrame(5);
- scene->_arrObject1[2].setFrame(7);
- scene->_arrObject1[3].setFrame(15);
+ scene->_upperDisplayCard[0].setFrame(2);
+ scene->_upperDisplayCard[1].setFrame(5);
+ scene->_upperDisplayCard[2].setFrame(7);
+ scene->_upperDisplayCard[3].setFrame(15);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(240);
+ waitFrames(240);
scene->actionDisplay(1331, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154);
tmpVal = 72;
for (i = 4; i <= 7; i++) {
tmpVal += 29;
- scene->_arrObject1[i].postInit();
- scene->_arrObject1[i].setVisage(1332);
- scene->_arrObject1[i].setPosition(Common::Point(tmpVal, 100), 0);
- scene->_arrObject1[i].setStrip(4);
- scene->_arrObject1[i].fixPriority(190);
+ scene->_upperDisplayCard[i].postInit();
+ scene->_upperDisplayCard[i].setVisage(1332);
+ scene->_upperDisplayCard[i].setPosition(Common::Point(tmpVal, 100), 0);
+ scene->_upperDisplayCard[i].setStrip(4);
+ scene->_upperDisplayCard[i].fixPriority(190);
- scene->_arrObject2[i].postInit();
- scene->_arrObject2[i].setVisage(1332);
- scene->_arrObject2[i].setPosition(Common::Point(tmpVal, 100), 0);
- scene->_arrObject2[i].setStrip(7);
- scene->_arrObject2[i].setFrame(1);
- scene->_arrObject2[i].fixPriority(180);
+ scene->_lowerDisplayCard[i].postInit();
+ scene->_lowerDisplayCard[i].setVisage(1332);
+ scene->_lowerDisplayCard[i].setPosition(Common::Point(tmpVal, 100), 0);
+ scene->_lowerDisplayCard[i].setStrip(7);
+ scene->_lowerDisplayCard[i].setFrame(1);
+ scene->_lowerDisplayCard[i].fixPriority(180);
}
- scene->_arrObject1[4].setFrame(1);
- scene->_arrObject1[5].setFrame(5);
- scene->_arrObject1[6].setFrame(7);
- scene->_arrObject1[7].setFrame(3);
+ scene->_upperDisplayCard[4].setFrame(1);
+ scene->_upperDisplayCard[5].setFrame(5);
+ scene->_upperDisplayCard[6].setFrame(7);
+ scene->_upperDisplayCard[7].setFrame(3);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(240);
+ waitFrames(240);
- scene->_arrObject1[0].remove();
- scene->_arrObject1[1].remove();
- scene->_arrObject1[2].remove();
- scene->_arrObject1[3].remove();
- scene->_arrObject1[4].remove();
- scene->_arrObject1[5].remove();
- scene->_arrObject1[6].remove();
- scene->_arrObject1[7].remove();
+ scene->_upperDisplayCard[0].remove();
+ scene->_upperDisplayCard[1].remove();
+ scene->_upperDisplayCard[2].remove();
+ scene->_upperDisplayCard[3].remove();
+ scene->_upperDisplayCard[4].remove();
+ scene->_upperDisplayCard[5].remove();
+ scene->_upperDisplayCard[6].remove();
+ scene->_upperDisplayCard[7].remove();
- scene->_arrObject2[0].remove();
- scene->_arrObject2[1].remove();
- scene->_arrObject2[2].remove();
- scene->_arrObject2[3].remove();
- scene->_arrObject2[4].remove();
- scene->_arrObject2[5].remove();
- scene->_arrObject2[6].remove();
- scene->_arrObject2[7].remove();
+ scene->_lowerDisplayCard[0].remove();
+ scene->_lowerDisplayCard[1].remove();
+ scene->_lowerDisplayCard[2].remove();
+ scene->_lowerDisplayCard[3].remove();
+ scene->_lowerDisplayCard[4].remove();
+ scene->_lowerDisplayCard[5].remove();
+ scene->_lowerDisplayCard[6].remove();
+ scene->_lowerDisplayCard[7].remove();
- scene->_item7._field34 = scene->_arrunkObj1337[2]._arr1[0]._field34;
+ scene->_discardPile._cardId = scene->_gameBoardSide[2]._handCard[0]._cardId;
- scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[0]._object1._strip);
- scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._object1._frame);
- scene->_item2._object1.animate(ANIM_MODE_NONE, NULL);
+ scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[0]._card._strip);
+ scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._card._frame);
+ scene->_animatedCard._card.animate(ANIM_MODE_NONE, NULL);
- scene->_arrunkObj1337[2]._arr1[0]._field34 = 0;
- scene->_arrunkObj1337[2]._arr1[0]._object1.remove();
+ scene->_gameBoardSide[2]._handCard[0]._cardId = 0;
+ scene->_gameBoardSide[2]._handCard[0]._card.remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[0]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[2]._arr3[0]._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[2]._delayCard._stationPos, this);
}
break;
case 9: {
scene->_aSound1.play(58);
- scene->_arrunkObj1337[2]._arr3[0]._field34 = 0;
- scene->_arrunkObj1337[2]._arr3[0].remove();
- scene->_item2._object1.setStrip(5);
- scene->_item2._object1.setFrame(1);
- scene->_item2._object1.animate(ANIM_MODE_2, NULL);
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr3[0]._field36, 0);
- scene->_item2._object1.show();
+ scene->_gameBoardSide[2]._delayCard._cardId = 0;
+ scene->_gameBoardSide[2]._delayCard.remove();
+ scene->_animatedCard._card.setStrip(5);
+ scene->_animatedCard._card.setFrame(1);
+ scene->_animatedCard._card.animate(ANIM_MODE_2, NULL);
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._delayCard._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_item7._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this);
}
break;
case 10: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_item7);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_discardPile);
scene->_aSound2.play(61);
R2_GLOBALS._sceneObjects->draw();
scene->actionDisplay(1331, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->_arrObject1[0].postInit();
- scene->_arrObject1[0].setVisage(1332);
- scene->_arrObject1[0].setPosition(Common::Point(131, 71), 0);
- scene->_arrObject1[0].fixPriority(190);
- scene->_arrObject1[0].setStrip(3);
- scene->_arrObject1[0].setFrame(4);
-
- scene->_arrObject2[0].postInit();
- scene->_arrObject2[0].setVisage(1332);
- scene->_arrObject2[0].setPosition(Common::Point(131, 71), 0);
- scene->_arrObject2[0].setStrip(7);
- scene->_arrObject2[0].setFrame(1);
- scene->_arrObject2[0].fixPriority(180);
-
- scene->_arrObject1[1].postInit();
- scene->_arrObject1[1].setVisage(1332);
- scene->_arrObject1[1].setPosition(Common::Point(160, 71), 0);
- scene->_arrObject1[1].fixPriority(190);
- scene->_arrObject1[1].setStrip(3);
- scene->_arrObject1[1].setFrame(16);
-
- scene->_arrObject2[1].postInit();
- scene->_arrObject2[1].setVisage(1332);
- scene->_arrObject2[1].setPosition(Common::Point(160, 71), 0);
- scene->_arrObject2[1].setStrip(7);
- scene->_arrObject2[1].setFrame(1);
- scene->_arrObject2[1].fixPriority(180);
-
- scene->_arrObject1[2].postInit();
- scene->_arrObject1[2].setVisage(1332);
- scene->_arrObject1[2].setPosition(Common::Point(131, 100), 0);
- scene->_arrObject1[2].fixPriority(190);
- scene->_arrObject1[2].setStrip(4);
- scene->_arrObject1[2].setFrame(4);
-
- scene->_arrObject2[2].postInit();
- scene->_arrObject2[2].setVisage(1332);
- scene->_arrObject2[2].setPosition(Common::Point(131, 100), 0);
- scene->_arrObject2[2].setStrip(7);
- scene->_arrObject2[2].setFrame(1);
- scene->_arrObject2[2].fixPriority(180);
-
- scene->_arrObject1[3].postInit();
- scene->_arrObject1[3].setVisage(1332);
- scene->_arrObject1[3].setPosition(Common::Point(160, 100), 0);
- scene->_arrObject1[3].fixPriority(190);
- scene->_arrObject1[3].setStrip(4);
- scene->_arrObject1[3].setFrame(2);
-
- scene->_arrObject2[3].postInit();
- scene->_arrObject2[3].setVisage(1332);
- scene->_arrObject2[3].setPosition(Common::Point(160, 100), 0);
- scene->_arrObject2[3].setStrip(7);
- scene->_arrObject2[3].setFrame(1);
- scene->_arrObject2[3].fixPriority(180);
+ scene->_upperDisplayCard[0].postInit();
+ scene->_upperDisplayCard[0].setVisage(1332);
+ scene->_upperDisplayCard[0].setPosition(Common::Point(131, 71), 0);
+ scene->_upperDisplayCard[0].fixPriority(190);
+ scene->_upperDisplayCard[0].setStrip(3);
+ scene->_upperDisplayCard[0].setFrame(4);
+
+ scene->_lowerDisplayCard[0].postInit();
+ scene->_lowerDisplayCard[0].setVisage(1332);
+ scene->_lowerDisplayCard[0].setPosition(Common::Point(131, 71), 0);
+ scene->_lowerDisplayCard[0].setStrip(7);
+ scene->_lowerDisplayCard[0].setFrame(1);
+ scene->_lowerDisplayCard[0].fixPriority(180);
+
+ scene->_upperDisplayCard[1].postInit();
+ scene->_upperDisplayCard[1].setVisage(1332);
+ scene->_upperDisplayCard[1].setPosition(Common::Point(160, 71), 0);
+ scene->_upperDisplayCard[1].fixPriority(190);
+ scene->_upperDisplayCard[1].setStrip(3);
+ scene->_upperDisplayCard[1].setFrame(16);
+
+ scene->_lowerDisplayCard[1].postInit();
+ scene->_lowerDisplayCard[1].setVisage(1332);
+ scene->_lowerDisplayCard[1].setPosition(Common::Point(160, 71), 0);
+ scene->_lowerDisplayCard[1].setStrip(7);
+ scene->_lowerDisplayCard[1].setFrame(1);
+ scene->_lowerDisplayCard[1].fixPriority(180);
+
+ scene->_upperDisplayCard[2].postInit();
+ scene->_upperDisplayCard[2].setVisage(1332);
+ scene->_upperDisplayCard[2].setPosition(Common::Point(131, 100), 0);
+ scene->_upperDisplayCard[2].fixPriority(190);
+ scene->_upperDisplayCard[2].setStrip(4);
+ scene->_upperDisplayCard[2].setFrame(4);
+
+ scene->_lowerDisplayCard[2].postInit();
+ scene->_lowerDisplayCard[2].setVisage(1332);
+ scene->_lowerDisplayCard[2].setPosition(Common::Point(131, 100), 0);
+ scene->_lowerDisplayCard[2].setStrip(7);
+ scene->_lowerDisplayCard[2].setFrame(1);
+ scene->_lowerDisplayCard[2].fixPriority(180);
+
+ scene->_upperDisplayCard[3].postInit();
+ scene->_upperDisplayCard[3].setVisage(1332);
+ scene->_upperDisplayCard[3].setPosition(Common::Point(160, 100), 0);
+ scene->_upperDisplayCard[3].fixPriority(190);
+ scene->_upperDisplayCard[3].setStrip(4);
+ scene->_upperDisplayCard[3].setFrame(2);
+
+ scene->_lowerDisplayCard[3].postInit();
+ scene->_lowerDisplayCard[3].setVisage(1332);
+ scene->_lowerDisplayCard[3].setPosition(Common::Point(160, 100), 0);
+ scene->_lowerDisplayCard[3].setStrip(7);
+ scene->_lowerDisplayCard[3].setFrame(1);
+ scene->_lowerDisplayCard[3].fixPriority(180);
R2_GLOBALS._sceneObjects->draw();
- skipFrames(240);
+ waitFrames(240);
- scene->_arrObject1[0].remove();
- scene->_arrObject1[1].remove();
- scene->_arrObject1[2].remove();
- scene->_arrObject1[3].remove();
+ scene->_upperDisplayCard[0].remove();
+ scene->_upperDisplayCard[1].remove();
+ scene->_upperDisplayCard[2].remove();
+ scene->_upperDisplayCard[3].remove();
- scene->_arrObject2[0].remove();
- scene->_arrObject2[1].remove();
- scene->_arrObject2[2].remove();
- scene->_arrObject2[3].remove();
+ scene->_lowerDisplayCard[0].remove();
+ scene->_lowerDisplayCard[1].remove();
+ scene->_lowerDisplayCard[2].remove();
+ scene->_lowerDisplayCard[3].remove();
- scene->_object1.setFrame(1);
- scene->_object1.show();
- scene->_object1.animate(ANIM_MODE_2, NULL);
+ scene->_currentPlayerArrow.setFrame(1);
+ scene->_currentPlayerArrow.show();
+ scene->_currentPlayerArrow.animate(ANIM_MODE_2, NULL);
R2_GLOBALS._sceneObjects->draw();
scene->actionDisplay(1331, 19, 159, 10, 1, 220, 0, 7, 0, 154, 154);
- scene->_object1.hide();
+ scene->_currentPlayerArrow.hide();
scene->actionDisplay(1331, 20, 159, 10, 1, 220, 0, 7, 0, 154, 154);
scene->actionDisplay(1331, 21, 159, 10, 1, 220, 0, 7, 0, 154, 154);
- scene->_item7._field34 = scene->_arrunkObj1337[2]._arr1[1]._field34;
+ scene->_discardPile._cardId = scene->_gameBoardSide[2]._handCard[1]._cardId;
- scene->_item2._object1.setStrip(scene->_arrunkObj1337[2]._arr1[1]._object1._strip);
- scene->_item2._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._object1._frame);
- scene->_item2._object1.animate(ANIM_MODE_NONE, NULL);
+ scene->_animatedCard._card.setStrip(scene->_gameBoardSide[2]._handCard[1]._card._strip);
+ scene->_animatedCard._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._card._frame);
+ scene->_animatedCard._card.animate(ANIM_MODE_NONE, NULL);
- scene->_arrunkObj1337[2]._arr1[1]._field34 = 0;
- scene->_arrunkObj1337[2]._arr1[1]._object1.remove();
+ scene->_gameBoardSide[2]._handCard[1]._cardId = 0;
+ scene->_gameBoardSide[2]._handCard[1]._card.remove();
- scene->_item2._object1.setPosition(scene->_arrunkObj1337[2]._arr1[1]._field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_item7._field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_discardPile._stationPos, this);
}
break;
case 11: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_item7);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_discardPile);
scene->_aSound2.play(61);
- scene->_item2._object1.setStrip(5);
- scene->_item2._object1.setFrame(1);
- scene->_item2._object1.animate(ANIM_MODE_2, NULL);
+ scene->_animatedCard._card.setStrip(5);
+ scene->_animatedCard._card.setFrame(1);
+ scene->_animatedCard._card.animate(ANIM_MODE_2, NULL);
R2_GLOBALS._sceneObjects->draw();
@@ -2992,40 +3005,40 @@ void Scene1337::Action1::signal() {
int i = -1;
for (i = 0; i <= 3; i ++) {
- scene->_arrunkObj1337[3]._arr1[i]._field34 = 0;
- scene->_arrunkObj1337[3]._arr1[i]._object1.remove();
+ scene->_gameBoardSide[3]._handCard[i]._cardId = 0;
+ scene->_gameBoardSide[3]._handCard[i]._card.remove();
- scene->_arrunkObj1337[2]._arr1[i]._field34 = 0;
- scene->_arrunkObj1337[2]._arr1[i]._object1.remove();
+ scene->_gameBoardSide[2]._handCard[i]._cardId = 0;
+ scene->_gameBoardSide[2]._handCard[i]._card.remove();
- scene->_arrunkObj1337[0]._arr1[i]._field34 = 0;
- scene->_arrunkObj1337[0]._arr1[i]._object1.remove();
+ scene->_gameBoardSide[0]._handCard[i]._cardId = 0;
+ scene->_gameBoardSide[0]._handCard[i]._card.remove();
- scene->_arrunkObj1337[1]._arr1[i]._field34 = 0;
- scene->_arrunkObj1337[1]._arr1[i]._object1.remove();
+ scene->_gameBoardSide[1]._handCard[i]._cardId = 0;
+ scene->_gameBoardSide[1]._handCard[i]._card.remove();
}
for (i = 0; i <= 7; i++) {
- scene->_arrunkObj1337[3]._arr2[i]._field34 = 0;
- scene->_arrunkObj1337[3]._arr2[i]._object1.remove();
+ scene->_gameBoardSide[3]._outpostStation[i]._cardId = 0;
+ scene->_gameBoardSide[3]._outpostStation[i]._card.remove();
- scene->_arrunkObj1337[2]._arr2[i]._field34 = 0;
- scene->_arrunkObj1337[2]._arr2[i]._object1.remove();
+ scene->_gameBoardSide[2]._outpostStation[i]._cardId = 0;
+ scene->_gameBoardSide[2]._outpostStation[i]._card.remove();
- scene->_arrunkObj1337[0]._arr2[i]._field34 = 0;
- scene->_arrunkObj1337[0]._arr2[i]._object1.remove();
+ scene->_gameBoardSide[0]._outpostStation[i]._cardId = 0;
+ scene->_gameBoardSide[0]._outpostStation[i]._card.remove();
- scene->_arrunkObj1337[1]._arr2[i]._field34 = 0;
- scene->_arrunkObj1337[1]._arr2[i]._object1.remove();
+ scene->_gameBoardSide[1]._outpostStation[i]._cardId = 0;
+ scene->_gameBoardSide[1]._outpostStation[i]._card.remove();
}
- scene->_arrunkObj1337[2]._arr3[0]._field34 = 0;
- scene->_arrunkObj1337[2]._arr3[0]._object1.remove();
+ scene->_gameBoardSide[2]._delayCard._cardId = 0;
+ scene->_gameBoardSide[2]._delayCard._card.remove();
- scene->_item7._field34 = 0;
- scene->_item7._object1.remove();
+ scene->_discardPile._cardId = 0;
+ scene->_discardPile._card.remove();
- scene->_background2.remove();
+ scene->_stockPile.remove();
}
// No break on purpose
case 0:
@@ -3041,473 +3054,484 @@ void Scene1337::Action1::signal() {
}
}
+/**
+ * Shuffle cards animation
+ */
void Scene1337::Action2::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0:
- scene->_item3._object1.postInit();
- scene->_item3._object1.setVisage(1332);
- scene->_item3._object1.setStrip(8);
- scene->_item3._object1.setFrame(1);
- scene->_item3._object1.fixPriority(300);
- scene->_item3._object1.setPosition(Common::Point(156, 108));
+ scene->_shuffleAnimation._card.postInit();
+ scene->_shuffleAnimation._card.setVisage(1332);
+ scene->_shuffleAnimation._card.setStrip(8);
+ scene->_shuffleAnimation._card.setFrame(1);
+ scene->_shuffleAnimation._card.fixPriority(300);
+ scene->_shuffleAnimation._card.setPosition(Common::Point(156, 108));
- scene->_item7._object1.remove();
- scene->_item7._field34 = 0;
+ scene->_discardPile._card.remove();
+ scene->_discardPile._cardId = 0;
scene->_aSound1.play(60);
- scene->_item3._object1.animate(ANIM_MODE_5, this);
+ scene->_shuffleAnimation._card.animate(ANIM_MODE_5, this);
break;
case 1:
- scene->_item3._object1.setFrame(1);
+ scene->_shuffleAnimation._card.setFrame(1);
scene->_aSound1.play(60);
- scene->_item3._object1.animate(ANIM_MODE_5, this);
+ scene->_shuffleAnimation._card.animate(ANIM_MODE_5, this);
break;
case 2: {
Common::Point pt(156, 108);
NpcMover *mover = new NpcMover();
- scene->_item3._object1.addMover(mover, &pt, this);
+ scene->_shuffleAnimation._card.addMover(mover, &pt, this);
}
break;
case 3:
- scene->_item3._object1.remove();
- scene->_background2.setup2(1332, 5, 1, 162, 95, 110, 1);
- scene->_field423C = 1;
+ scene->_shuffleAnimation._card.remove();
+ scene->_stockPile.setup(1332, 5, 1);
+ scene->_stockPile.setPosition(Common::Point(162, 95));
+ scene->_stockPile.setPriority(110);
+ scene->_stockPile._effect = EFFECT_SHADED;
+ scene->_stockPile.show();
+ scene->_shuffleEndedFl = true;
break;
default:
break;
}
}
+/**
+ * Deal cards
+ */
void Scene1337::Action3::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
- scene->_item2._object1.setPosition(Common::Point(162, 95), 0);
+ scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0);
switch (_actionIndex++) {
case 0: {
- scene->_item2._object1._moveDiff = Common::Point(30, 30);
- scene->_item2._object1.setVisage(1332);
- scene->_item2._object1.setStrip(5);
- scene->_item2._object1.setFrame(1);
- scene->_item2._object1.fixPriority(400);
- scene->_item2._object1.animate(ANIM_MODE_2, NULL);
+ scene->_animatedCard._card._moveDiff = Common::Point(30, 30);
+ scene->_animatedCard._card.setVisage(1332);
+ scene->_animatedCard._card.setStrip(5);
+ scene->_animatedCard._card.setFrame(1);
+ scene->_animatedCard._card.fixPriority(400);
+ scene->_animatedCard._card.animate(ANIM_MODE_2, NULL);
scene->_aSound2.play(61);
Common::Point pt(283, 146);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_item2._object1.show();
- scene->_arrunkObj1337[1]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_animatedCard._card.show();
+ scene->_gameBoardSide[1]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 1: {
- scene->_arrunkObj1337[1]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[1]._arr1[0]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[1]._arr1[0]._object1.setFrame(4);
- scene->_arrunkObj1337[1]._arr1[0]._object1.fixPriority(170);
+ scene->_gameBoardSide[1]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[1]._handCard[0]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[1]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._handCard[0]._card.setPosition(scene->_gameBoardSide[1]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[1]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[1]._handCard[0]._card.setFrame(4);
+ scene->_gameBoardSide[1]._handCard[0]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(10, 174);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[2]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[2]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 2: {
- scene->_arrunkObj1337[2]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[0]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[0]._object1.fixPriority(170);
- if (scene->_arrunkObj1337[2]._arr1[0]._field34 > 9) {
- if (scene->_arrunkObj1337[2]._arr1[0]._field34 > 25) {
- scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(4);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._field34 - 25);
- } else {
- scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(3);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._field34 - 9);
- }
+ scene->_gameBoardSide[2]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[0]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[2]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[0]._card.setPosition(scene->_gameBoardSide[2]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[0]._card.fixPriority(170);
+ if (scene->_gameBoardSide[2]._handCard[0]._cardId > 25) {
+ scene->_gameBoardSide[2]._handCard[0]._card.setStrip(4);
+ scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 25);
+ } else if (scene->_gameBoardSide[2]._handCard[0]._cardId > 9) {
+ scene->_gameBoardSide[2]._handCard[0]._card.setStrip(3);
+ scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId - 9);
} else {
- scene->_arrunkObj1337[2]._arr1[0]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[0]._field34);
+ scene->_gameBoardSide[2]._handCard[0]._card.setStrip(2);
+ scene->_gameBoardSide[2]._handCard[0]._card.setFrame(scene->_gameBoardSide[2]._handCard[0]._cardId);
}
scene->_aSound2.play(61);
Common::Point pt(14, 14);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[3]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[3]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 3: {
- scene->_arrunkObj1337[3]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[3]._arr1[0]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[3]._arr1[0]._object1.setFrame(3);
- scene->_arrunkObj1337[3]._arr1[0]._object1.fixPriority(170);
+ scene->_gameBoardSide[3]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[3]._handCard[0]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[3]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._handCard[0]._card.setPosition(scene->_gameBoardSide[3]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[3]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[3]._handCard[0]._card.setFrame(3);
+ scene->_gameBoardSide[3]._handCard[0]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(280, 5);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[0]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[0]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 4: {
- scene->_arrunkObj1337[0]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[0]._arr1[0]._object1._moveDiff = Common::Point(30,30);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setStrip(5);
- scene->_arrunkObj1337[0]._arr1[0]._object1.setFrame(1);
- scene->_arrunkObj1337[0]._arr1[0]._object1.fixPriority(170);
+ scene->_gameBoardSide[0]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[0]._handCard[0]._card._moveDiff = Common::Point(30,30);
+ scene->_gameBoardSide[0]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._handCard[0]._card.setPosition(scene->_gameBoardSide[0]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[0]._handCard[0]._card.setStrip(5);
+ scene->_gameBoardSide[0]._handCard[0]._card.setFrame(1);
+ scene->_gameBoardSide[0]._handCard[0]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(283, 124);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[1]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[1]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 5: {
- scene->_arrunkObj1337[1]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[1]._arr1[1]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[1]._arr1[1]._object1.setFrame(4);
- scene->_arrunkObj1337[1]._arr1[1]._object1.fixPriority(170);
+ scene->_gameBoardSide[1]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[1]._handCard[1]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[1]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._handCard[1]._card.setPosition(scene->_gameBoardSide[1]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[1]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[1]._handCard[1]._card.setFrame(4);
+ scene->_gameBoardSide[1]._handCard[1]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(37, 174);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[2]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[2]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 6: {
- scene->_arrunkObj1337[2]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[1]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[1]._object1.fixPriority(170);
-
- if (scene->_arrunkObj1337[2]._arr1[1]._field34 > 9) {
- if (scene->_arrunkObj1337[2]._arr1[1]._field34 > 25) {
- scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(4);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._field34 - 25);
- } else {
- scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(3);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._field34 - 9);
- }
+ scene->_gameBoardSide[2]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[1]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[2]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[1]._card.setPosition(scene->_gameBoardSide[2]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[1]._card.fixPriority(170);
+
+ if (scene->_gameBoardSide[2]._handCard[1]._cardId > 25) {
+ scene->_gameBoardSide[2]._handCard[1]._card.setStrip(4);
+ scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 25);
+ } else if (scene->_gameBoardSide[2]._handCard[1]._cardId > 9) {
+ scene->_gameBoardSide[2]._handCard[1]._card.setStrip(3);
+ scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId - 9);
} else {
- scene->_arrunkObj1337[2]._arr1[1]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[1]._field34);
+ scene->_gameBoardSide[2]._handCard[1]._card.setStrip(2);
+ scene->_gameBoardSide[2]._handCard[1]._card.setFrame(scene->_gameBoardSide[2]._handCard[1]._cardId);
}
scene->_aSound2.play(61);
Common::Point pt(14, 36);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[3]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[3]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 7: {
- scene->_arrunkObj1337[3]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[3]._arr1[1]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[1]._field36);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[3]._arr1[1]._object1.setFrame(3);
- scene->_arrunkObj1337[3]._arr1[1]._object1.fixPriority(170);
+ scene->_gameBoardSide[3]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[3]._handCard[1]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[3]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._handCard[1]._card.setPosition(scene->_gameBoardSide[3]._handCard[1]._stationPos);
+ scene->_gameBoardSide[3]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[3]._handCard[1]._card.setFrame(3);
+ scene->_gameBoardSide[3]._handCard[1]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(253, 5);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[0]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[0]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 8: {
- scene->_arrunkObj1337[0]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[0]._arr1[1]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setStrip(5);
- scene->_arrunkObj1337[0]._arr1[1]._object1.setFrame(1);
- scene->_arrunkObj1337[0]._arr1[1]._object1.fixPriority(170);
+ scene->_gameBoardSide[0]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[0]._handCard[1]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[0]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._handCard[1]._card.setPosition(scene->_gameBoardSide[0]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[0]._handCard[1]._card.setStrip(5);
+ scene->_gameBoardSide[0]._handCard[1]._card.setFrame(1);
+ scene->_gameBoardSide[0]._handCard[1]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(283, 102);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[1]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[1]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 9: {
- scene->_arrunkObj1337[1]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[1]._arr1[2]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[1]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[1]._arr1[2]._object1.setFrame(4);
- scene->_arrunkObj1337[1]._arr1[2]._object1.fixPriority(170);
+ scene->_gameBoardSide[1]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[1]._handCard[2]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[1]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[1]._handCard[2]._card.setPosition(scene->_gameBoardSide[1]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[1]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[1]._handCard[2]._card.setFrame(4);
+ scene->_gameBoardSide[1]._handCard[2]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(64, 174);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[2]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[2]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 10: {
- scene->_arrunkObj1337[2]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[2]._arr1[2]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[2]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[2]._arr1[2]._object1.fixPriority(170);
-
- if (scene->_arrunkObj1337[2]._arr1[2]._field34 > 9) {
- if (scene->_arrunkObj1337[2]._arr1[2]._field34 > 25) {
- scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(4);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._field34 - 25);
- } else {
- scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(3);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._field34 - 9);
- }
+ scene->_gameBoardSide[2]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[2]._handCard[2]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[2]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[2]._handCard[2]._card.setPosition(scene->_gameBoardSide[2]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[2]._handCard[2]._card.fixPriority(170);
+
+ if (scene->_gameBoardSide[2]._handCard[2]._cardId > 25) {
+ scene->_gameBoardSide[2]._handCard[2]._card.setStrip(4);
+ scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 25);
+ } else if (scene->_gameBoardSide[2]._handCard[2]._cardId > 9) {
+ scene->_gameBoardSide[2]._handCard[2]._card.setStrip(3);
+ scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId - 9);
} else {
- scene->_arrunkObj1337[2]._arr1[2]._object1.setStrip(2);
- scene->_arrunkObj1337[2]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[2]._arr1[2]._field34);
+ scene->_gameBoardSide[2]._handCard[2]._card.setStrip(2);
+ scene->_gameBoardSide[2]._handCard[2]._card.setFrame(scene->_gameBoardSide[2]._handCard[2]._cardId);
}
scene->_aSound2.play(61);
Common::Point pt(14, 58);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[3]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[3]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 11: {
- scene->_arrunkObj1337[3]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[3]._arr1[2]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[3]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[3]._arr1[2]._object1.setFrame(3);
- scene->_arrunkObj1337[3]._arr1[2]._object1.fixPriority(170);
+ scene->_gameBoardSide[3]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[3]._handCard[2]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[3]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[3]._handCard[2]._card.setPosition(scene->_gameBoardSide[3]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[3]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[3]._handCard[2]._card.setFrame(3);
+ scene->_gameBoardSide[3]._handCard[2]._card.fixPriority(170);
scene->_aSound2.play(61);
Common::Point pt(226, 5);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
- scene->_arrunkObj1337[0]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24];
+ scene->_gameBoardSide[0]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
}
break;
case 12:
- scene->_arrunkObj1337[0]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[0]._arr1[2]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[0]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setStrip(5);
- scene->_arrunkObj1337[0]._arr1[2]._object1.setFrame(1);
- scene->_arrunkObj1337[0]._arr1[2]._object1.fixPriority(170);
- scene->_arrunkObj1337[0]._arr1[2]._object1.hide();
+ scene->_gameBoardSide[0]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[0]._handCard[2]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[0]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[0]._handCard[2]._card.setPosition(scene->_gameBoardSide[0]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[0]._handCard[2]._card.setStrip(5);
+ scene->_gameBoardSide[0]._handCard[2]._card.setFrame(1);
+ scene->_gameBoardSide[0]._handCard[2]._card.fixPriority(170);
+ scene->_animatedCard._card.hide();
default:
break;
}
if (_actionIndex > 12) {
- scene->_field423E = 0;
+ scene->_currentPlayerNumb = 0;
R2_GLOBALS._sceneObjects->draw();
scene->actionDisplay(1330, 0, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- scene->subC20F9();
+ scene->handleNextTurn();
} else if (_actionIndex >= 1) {
- scene->_field3E28[scene->_field3E24] = 0;
- scene->_field3E24--;
+ scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0;
+ scene->_cardsAvailableNumb--;
}
}
+/**
+ * Action used to handle the other players' turn
+ */
void Scene1337::Action4::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0:
- if ((scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34))) {
- if (scene->_field3E24 < 0)
- scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34);
- scene->_item2._object1.setPosition(Common::Point(162, 95), 0);
- scene->_item2._object1.show();
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if (scene->_cardsAvailableNumb < 0)
+ scene->shuffleCards();
+ scene->_animatedCard._card.setPosition(Common::Point(162, 95), 0);
+ scene->_animatedCard._card.show();
scene->_aSound2.play(61);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldB94, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos, this);
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field34 = scene->_field3E28[scene->_field3E24];
- scene->_field3E28[scene->_field3E24] = 0;
- scene->_field3E24--;
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
+ scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0;
+ scene->_cardsAvailableNumb--;
- if (scene->_field3E24 < 0)
- scene->_background2.remove();
+ if (scene->_cardsAvailableNumb < 0)
+ scene->_stockPile.remove();
} else {
// Self call, forcing next actionIndex
signal();
}
break;
case 1:
- if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldB94.x)
- && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldB94.y) ) {
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.postInit();
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setVisage(1332);
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field36, 0);
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setStrip(1);
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4);
- scene->_arrunkObj1337[scene->_field423E]._arr1[0]._object1.fixPriority(170);
- }
-
- if ((scene->_field4248 == 1) || (scene->_field423E == 2))
- scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[0]);
-
- scene->_item2._object1.hide();
- if ((scene->_arrunkObj1337[scene->_field423E]._arr1[0]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34 == 0))) {
- if (scene->_field3E24 < 0)
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card1Pos.y) ) {
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.postInit();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setVisage(1332);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._stationPos, 0);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setStrip(1);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._card.fixPriority(170);
+ }
+
+ if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
+ scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]);
+
+ scene->_animatedCard._card.hide();
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[0]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
- scene->_item2._object1.setPosition(Common::Point(162, 95));
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(Common::Point(162, 95));
+ scene->_animatedCard._card.show();
scene->_aSound2.play(61);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldB98, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos, this);
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._field34 = scene->_field3E28[scene->_field3E24];
- scene->_field3E28[scene->_field3E24] = 0;
- scene->_field3E24--;
- if (scene->_field3E24 < 0)
- scene->_background2.remove();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
+ scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0;
+ scene->_cardsAvailableNumb--;
+ if (scene->_cardsAvailableNumb < 0)
+ scene->_stockPile.remove();
} else
signal();
break;
case 2:
- if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldB98.x)
- && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldB98.y) ) {
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.postInit();
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setVisage(1332);
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[1]._field36, 0);
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setStrip(1);
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4);
- scene->_arrunkObj1337[scene->_field423E]._arr1[1]._object1.fixPriority(170);
- }
-
- if ((scene->_field4248 == 1) || (scene->_field423E == 2))
- scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[1]);
-
- scene->_item2._object1.hide();
- if ((scene->_arrunkObj1337[scene->_field423E]._arr1[2]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34 == 0))) {
- if (scene->_field3E24 < 0)
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card2Pos.y) ) {
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.postInit();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setVisage(1332);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._stationPos, 0);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setStrip(1);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]._card.fixPriority(170);
+ }
+
+ if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
+ scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[1]);
+
+ scene->_animatedCard._card.hide();
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
- scene->_item2._object1.setPosition(Common::Point(162, 95));
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(Common::Point(162, 95));
+ scene->_animatedCard._card.show();
scene->_aSound2.play(61);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldB9C, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos, this);
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._field34 = scene->_field3E28[scene->_field3E24];
- scene->_field3E28[scene->_field3E24] = 0;
- scene->_field3E24--;
- if (scene->_field3E24 < 0)
- scene->_background2.remove();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
+ scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0;
+ scene->_cardsAvailableNumb--;
+ if (scene->_cardsAvailableNumb < 0)
+ scene->_stockPile.remove();
} else
signal();
break;
case 3:
- if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldB9C.x)
- && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldB9C.y) ) {
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.postInit();
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setVisage(1332);
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[2]._field36, 0);
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setStrip(1);
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4);
- scene->_arrunkObj1337[scene->_field423E]._arr1[2]._object1.fixPriority(170);
- }
-
- if ((scene->_field4248 == 1) || (scene->_field423E == 2))
- scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[2]);
-
- scene->_item2._object1.hide();
- if ((scene->_arrunkObj1337[scene->_field423E]._arr1[3]._field34 == 0) && (scene->subC264B(scene->_arrunkObj1337[scene->_field423E]._arr3[0]._field34 == 0))) {
- if (scene->_field3E24 < 0)
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card3Pos.y) ) {
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.postInit();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setVisage(1332);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._stationPos, 0);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setStrip(1);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]._card.fixPriority(170);
+ }
+
+ if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
+ scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[2]);
+
+ scene->_animatedCard._card.hide();
+ if ( (scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId == 0)
+ && (!scene->isStationCard(scene->_gameBoardSide[scene->_currentPlayerNumb]._delayCard._cardId))) {
+ if (scene->_cardsAvailableNumb < 0)
scene->shuffleCards();
- scene->_item2._object1.setPosition(Common::Point(162, 95));
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(Common::Point(162, 95));
+ scene->_animatedCard._card.show();
scene->_aSound2.play(61);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_arrunkObj1337[scene->_field423E]._fieldBA0, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos, this);
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._field34 = scene->_field3E28[scene->_field3E24];
- scene->_field3E28[scene->_field3E24] = 0;
- scene->_field3E24--;
- if (scene->_field3E24 < 0)
- scene->_background2.remove();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._cardId = scene->_availableCardsPile[scene->_cardsAvailableNumb];
+ scene->_availableCardsPile[scene->_cardsAvailableNumb] = 0;
+ scene->_cardsAvailableNumb--;
+ if (scene->_cardsAvailableNumb < 0)
+ scene->_stockPile.remove();
} else
signal();
break;
case 4:
- if ( ( scene->_item2._object1._position.x == scene->_arrunkObj1337[scene->_field423E]._fieldBA0.x)
- && ( scene->_item2._object1._position.y == scene->_arrunkObj1337[scene->_field423E]._fieldBA0.y) ) {
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.postInit();
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1._moveDiff = Common::Point(30, 30);
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setVisage(1332);
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setPosition(scene->_arrunkObj1337[scene->_field423E]._arr1[3]._field36, 0);
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setStrip(1);
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.setFrame(scene->_arrunkObj1337[scene->_field423E]._fieldBA4);
- scene->_arrunkObj1337[scene->_field423E]._arr1[3]._object1.fixPriority(170);
- }
-
- if ((scene->_field4248 == 1) || (scene->_field423E == 2))
- scene->setAnimationInfo(&scene->_arrunkObj1337[scene->_field423E]._arr1[3]);
-
- scene->_item2._object1.hide();
- switch (scene->_field423E) {
+ if ( (scene->_animatedCard._card._position.x == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.x)
+ && (scene->_animatedCard._card._position.y == scene->_gameBoardSide[scene->_currentPlayerNumb]._card4Pos.y) ) {
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.postInit();
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card._moveDiff = Common::Point(30, 30);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setVisage(1332);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setPosition(scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._stationPos, 0);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setStrip(1);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.setFrame(scene->_gameBoardSide[scene->_currentPlayerNumb]._frameNum);
+ scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]._card.fixPriority(170);
+ }
+
+ if ((R2_GLOBALS._debugCardGame) || (scene->_currentPlayerNumb == 2))
+ scene->setAnimationInfo(&scene->_gameBoardSide[scene->_currentPlayerNumb]._handCard[3]);
+
+ scene->_animatedCard._card.hide();
+ switch (scene->_currentPlayerNumb) {
case 0:
- scene->subCF979();
+ scene->handlePlayer0();
break;
case 1:
- scene->subCF31D();
+ scene->handlePlayer1();
break;
case 2:
- scene->subD0281();
+ scene->handleAutoplayPlayer2();
break;
case 3:
- scene->subC2C2F();
+ scene->handlePlayer3();
break;
default:
break;
@@ -3518,115 +3542,124 @@ void Scene1337::Action4::signal() {
}
}
+/**
+ * Animations for discarding a card
+ */
void Scene1337::Action5::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0: {
- scene->_field3E28[scene->_field3E26] = scene->_field3EF0->_field34;
- scene->_field3E26--;
- if (!g_globals->_sceneObjects->contains(&scene->_item7._object1)) {
- scene->_item7._object1.postInit();
- scene->_item7._object1.hide();
- scene->_item7._object1.setVisage(1332);
- scene->_item7._object1.setPosition(scene->_item7._field36, 0);
- scene->_item7._object1.fixPriority(170);
- }
-
- scene->_item7._field34 = scene->_field3EF0->_field34;
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
-
- if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard1->_cardId;
+ scene->_currentDiscardIndex--;
+ if (!g_globals->_sceneObjects->contains(&scene->_discardPile._card)) {
+ // The first discarded card makes the pile appear
+ scene->_discardPile._card.postInit();
+ scene->_discardPile._card.hide();
+ scene->_discardPile._card.setVisage(1332);
+ scene->_discardPile._card.setPosition(scene->_discardPile._stationPos, 0);
+ scene->_discardPile._card.fixPriority(170);
+ }
+
+ scene->_discardPile._cardId = scene->_actionCard1->_cardId;
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
+
+ if (scene->_actionCard1 == &scene->_selectedCard) {
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
Common::Point pt(128, 95);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &pt, this);
+ scene->_animatedCard._card.addMover(mover, &pt, this);
}
break;
case 1:
- scene->_item2._object1.hide();
- scene->setAnimationInfo(&scene->_item7);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(&scene->_discardPile);
scene->_aSound2.play(61);
- scene->subC20F9();
+ scene->handleNextTurn();
break;
default:
break;
}
}
+/**
+ * Animations for playing a platform card
+ */
void Scene1337::Action6::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0: {
- scene->_field3EF4->_field34 = 1;
- scene->_field3EF4->_object1.postInit();
- scene->_field3EF4->_object1.hide();
- scene->_field3EF4->_object1.setVisage(1332);
- scene->_field3EF4->_object1.setPosition(scene->_field3EF4->_field36);
- scene->_field3EF4->_object1.fixPriority(170);
+ scene->_actionCard2->_cardId = 1;
+ scene->_actionCard2->_card.postInit();
+ scene->_actionCard2->_card.hide();
+ scene->_actionCard2->_card.setVisage(1332);
+ scene->_actionCard2->_card.setPosition(scene->_actionCard2->_stationPos);
+ scene->_actionCard2->_card.fixPriority(170);
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 1:
- scene->_item2._object1.hide();
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(59);
- if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ if (scene->_actionCard1 == &scene->_selectedCard) {
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
- scene->subC20F9();
+ scene->handleNextTurn();
break;
default:
break;
}
}
+/**
+ * Upgrade platform to station by playing a station card on top of it
+ */
void Scene1337::Action7::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0: {
- scene->_field3EF4->_field34 = scene->_field3EF0->_field34;
+ scene->_actionCard2->_cardId = scene->_actionCard1->_cardId;
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 1:
- if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ if (scene->_actionCard1 == &scene->_selectedCard) {
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(59);
- scene->_item5._field34 = 1;
- scene->_item5._field36.x = scene->_field3EF4->_field36.x;
- scene->_item5._field36.y = scene->_field3EF4->_field36.y;
- scene->_item5._object1.postInit();
- scene->_item5._object1.hide();
- scene->_item5._object1._flags = 0x200;
+ scene->_discardedPlatformCard._cardId = 1;
+ scene->_discardedPlatformCard._stationPos = scene->_actionCard2->_stationPos;
+ scene->_discardedPlatformCard._card.postInit();
+ scene->_discardedPlatformCard._card.hide();
+ scene->_discardedPlatformCard._card._flags = OBJFLAG_HIDING;
- scene->subC4A39(&scene->_item5);
+ scene->discardCard(&scene->_discardedPlatformCard);
break;
default:
break;
@@ -3638,112 +3671,114 @@ void Scene1337::Action8::signal() {
switch (_actionIndex++) {
case 0: {
- scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34;
- scene->_field3E26--;
+ scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId;
+ scene->_currentDiscardIndex--;
- scene->_field3EF4->_field34 = scene->_field3EF0->_field34;
- scene->_field3EF0->_object1.remove();
+ scene->_actionCard2->_cardId = scene->_actionCard1->_cardId;
+ scene->_actionCard1->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 1:
- scene->_item2._object1.hide();
+ scene->_animatedCard._card.hide();
- if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ if (scene->_actionCard1 == &scene->_selectedCard) {
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(58);
- scene->subC4A39(scene->_field3EF4);
+ scene->discardCard(scene->_actionCard2);
break;
default:
break;
}
}
+// Play delay card
void Scene1337::Action9::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0: {
- scene->_field3EF4->_field34 = scene->_field3EF0->_field34;
- scene->_field3EF4->_object1.postInit();
- scene->_field3EF4->_object1.hide();
- scene->_field3EF4->_object1.setVisage(1332);
- scene->_field3EF4->_object1.setPosition(scene->_field3EF4->_field36, 0);
- scene->_field3EF4->_object1.fixPriority(170);
+ scene->_actionCard2->_cardId = scene->_actionCard1->_cardId;
+ scene->_actionCard2->_card.postInit();
+ scene->_actionCard2->_card.hide();
+ scene->_actionCard2->_card.setVisage(1332);
+ scene->_actionCard2->_card.setPosition(scene->_actionCard2->_stationPos, 0);
+ scene->_actionCard2->_card.fixPriority(170);
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 1:
- scene->_item2._object1.hide();
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(57);
- if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ if (scene->_actionCard1 == &scene->_selectedCard) {
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
- scene->subC20F9();
+ scene->handleNextTurn();
break;
default:
break;
}
}
+// Counter a trick with a card
void Scene1337::Action10::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
switch (_actionIndex++) {
case 0: {
- scene->_field3EF8->_object1.postInit();
- scene->_field3EF8->_object1.hide();
- scene->_field3EF8->_object1.setVisage(1332);
- scene->_field3EF8->_object1.setPosition(scene->_field3EF8->_field36, 0);
- scene->_field3EF8->_object1.fixPriority(170);
- scene->_field3EF8->_field34 = scene->_field3EF0->_field34;
-
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
-
- if (scene->_field3EF0 == &scene->_item6) {
- subD18B5(5, 1, 4);
+ scene->_actionCard3->_card.postInit();
+ scene->_actionCard3->_card.hide();
+ scene->_actionCard3->_card.setVisage(1332);
+ scene->_actionCard3->_card.setPosition(scene->_actionCard3->_stationPos, 0);
+ scene->_actionCard3->_card.fixPriority(170);
+ scene->_actionCard3->_cardId = scene->_actionCard1->_cardId;
+
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
+
+ if (scene->_actionCard1 == &scene->_selectedCard) {
+ scene->setCursorData(5, 1, 4);
scene->subC4CEC();
}
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF8->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard3->_stationPos, this);
}
break;
case 1: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(scene->_field3EF8);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(scene->_actionCard3);
scene->_aSound1.play(57);
bool found = false;
int indexFound = -1;
- switch (scene->_field4240) {
+ switch (scene->_actionIdx1) {
case 0:
for (indexFound = 0; indexFound < 3; indexFound++) {
- if (scene->_arrunkObj1337[0]._arr1[indexFound]._field34 == 29) {
+ if (scene->_gameBoardSide[0]._handCard[indexFound]._cardId == 29) {
found = true;
break;
}
@@ -3751,7 +3786,7 @@ void Scene1337::Action10::signal() {
break;
case 1:
for (indexFound = 0; indexFound < 3; indexFound++) {
- if (scene->_arrunkObj1337[1]._arr1[indexFound]._field34 == 29) {
+ if (scene->_gameBoardSide[1]._handCard[indexFound]._cardId == 29) {
found = true;
break;
}
@@ -3759,7 +3794,7 @@ void Scene1337::Action10::signal() {
break;
case 2:
for (indexFound = 0; indexFound < 3; indexFound++) {
- if (scene->_arrunkObj1337[2]._arr1[indexFound]._field34 == 29) {
+ if (scene->_gameBoardSide[2]._handCard[indexFound]._cardId == 29) {
found = true;
break;
}
@@ -3767,7 +3802,7 @@ void Scene1337::Action10::signal() {
break;
case 3:
for (indexFound = 0; indexFound < 3; indexFound++) {
- if (scene->_arrunkObj1337[3]._arr1[indexFound]._field34 == 29) {
+ if (scene->_gameBoardSide[3]._handCard[indexFound]._cardId == 29) {
found = true;
break;
}
@@ -3780,13 +3815,13 @@ void Scene1337::Action10::signal() {
bool found2 = false;
if (found) {
- switch (scene->_field4240) {
+ switch (scene->_actionIdx1) {
case 0:
- scene->subC51A0(&scene->_arrunkObj1337[0]._arr1[indexFound], scene->_field3EF8);
+ scene->subC51A0(&scene->_gameBoardSide[0]._handCard[indexFound], scene->_actionCard3);
found2 = true;
break;
case 1:
- scene->subC51A0(&scene->_arrunkObj1337[1]._arr1[indexFound], scene->_field3EF8);
+ scene->subC51A0(&scene->_gameBoardSide[1]._handCard[indexFound], scene->_actionCard3);
found2 = true;
break;
case 2:
@@ -3794,12 +3829,12 @@ void Scene1337::Action10::signal() {
if (MessageDialog::show(USE_INTERCEPTOR, NO_MSG, YES_MSG) == 0)
scene->subC4CEC();
else {
- scene->subC51A0(&scene->_arrunkObj1337[2]._arr1[indexFound], scene->_field3EF8);
+ scene->subC51A0(&scene->_gameBoardSide[2]._handCard[indexFound], scene->_actionCard3);
found2 = true;
}
break;
case 3:
- scene->subC51A0(&scene->_arrunkObj1337[3]._arr1[indexFound], scene->_field3EF8);
+ scene->subC51A0(&scene->_gameBoardSide[3]._handCard[indexFound], scene->_actionCard3);
found2 = true;
break;
default:
@@ -3810,17 +3845,17 @@ void Scene1337::Action10::signal() {
if (!found2)
break;
- if (scene->_field4240 == 2) {
+ if (scene->_actionIdx1 == 2) {
int j = 0;
for (int i = 0; i <= 7; i++) {
- if (scene->_arrunkObj1337[2]._arr2[i]._field34 != 0)
+ if (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0)
++j;
}
if (j <= 1) {
for (int i = 0; i <= 7; i++) {
- if (scene->_arrunkObj1337[2]._arr2[i]._field34 != 0) {
- scene->_field3EF4 = &scene->_arrunkObj1337[2]._arr2[i];
+ if (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0) {
+ scene->_actionCard2 = &scene->_gameBoardSide[2]._outpostStation[i];
break;
}
}
@@ -3839,11 +3874,11 @@ void Scene1337::Action10::signal() {
g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks);
}
- scene->_item6._field36 = event.mousePos;
+ scene->_selectedCard._stationPos = event.mousePos;
for (int i = 0; i <= 7; i++) {
- if ((scene->subC2BF8(&scene->_arrunkObj1337[2]._arr2[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[2]._arr2[i]._field34 != 0)) {
- scene->_field3EF4 = &scene->_arrunkObj1337[2]._arr2[0];
+ if (scene->_gameBoardSide[2]._outpostStation[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[2]._outpostStation[i]._cardId != 0)) {
+ scene->_actionCard2 = &scene->_gameBoardSide[2]._outpostStation[0];
found2 = true;
break;
}
@@ -3853,27 +3888,28 @@ void Scene1337::Action10::signal() {
}
}
- scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34;
- scene->_field3E26--;
- scene->_field3EF4->_field34 = 0;
- scene->_field3EF4->_object1.remove();
+ scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId;
+ scene->_currentDiscardIndex--;
+ scene->_actionCard2->_cardId = 0;
+ scene->_actionCard2->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF4->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard2->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF8->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard3->_stationPos, this);
}
break;
case 2:
- scene->_item2._object1.hide();
- scene->subC4A39(scene->_field3EF8);
+ scene->_animatedCard._card.hide();
+ scene->discardCard(scene->_actionCard3);
break;
default:
break;
}
}
+// Use trick (card #25 - thieft ?) and pick a card from the opponent
void Scene1337::Action11::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -3881,115 +3917,115 @@ void Scene1337::Action11::signal() {
switch (_actionIndex++) {
case 0: {
- scene->_field3EF4->_object1.postInit();
- scene->_field3EF4->_object1.hide();
- scene->_field3EF4->_object1.setVisage(1332);
- scene->_field3EF4->_object1.setPosition(scene->_field3EF4->_field36, 0);
- scene->_field3EF4->_object1.fixPriority(170);
- scene->_field3EF4->_field34 = 25;
-
- if (scene->_field4240 == 2) {
- scene->_item2._object1.setPosition(scene->_field3EF4->_field36, 0);
- subD18B5(5, 1, 4);
+ scene->_actionCard2->_card.postInit();
+ scene->_actionCard2->_card.hide();
+ scene->_actionCard2->_card.setVisage(1332);
+ scene->_actionCard2->_card.setPosition(scene->_actionCard2->_stationPos, 0);
+ scene->_actionCard2->_card.fixPriority(170);
+ scene->_actionCard2->_cardId = 25;
+
+ if (scene->_actionIdx1 == 2) {
+ scene->_animatedCard._card.setPosition(scene->_actionCard2->_stationPos, 0);
+ scene->setCursorData(5, 1, 4);
} else {
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
}
- scene->_item2._object1.show();
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 1: {
- scene->_item2._object1.hide();
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(57);
bool found = false;
int i = -1;
- switch (scene->_field4242) {
+ switch (scene->_actionIdx2) {
case 0:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[0]._arr1[i]._field34 == 27) {
+ if (scene->_gameBoardSide[0]._handCard[i]._cardId == 27) {
found = true;
break;
}
}
- if ((found) && (scene->subC3E92(scene->_field4240) != -1)) {
- scene->_field3EF0 = &scene->_arrunkObj1337[0]._arr1[i];
- scene->_field3EF4 = &scene->_arrunkObj1337[0]._arr4[0];
- if (scene->_field4240 != 0) {
- int tmpVal = scene->subC3E92(scene->_field4240);
- scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal];
+ if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ scene->_actionCard1 = &scene->_gameBoardSide[0]._handCard[i];
+ scene->_actionCard2 = &scene->_gameBoardSide[0]._emptyStationPos;
+ if (scene->_actionIdx1 != 0) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
}
- scene->_item1.setAction(&scene->_action12);
+ scene->_actionItem.setAction(&scene->_action12);
noAction = false;
}
break;
case 1:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[1]._arr1[i]._field34 == 27) {
+ if (scene->_gameBoardSide[1]._handCard[i]._cardId == 27) {
found = true;
break;
}
}
- if ((found) && (scene->subC3E92(scene->_field4240) != -1)) {
- scene->_field3EF0 = &scene->_arrunkObj1337[1]._arr1[i];
- scene->_field3EF4 = &scene->_arrunkObj1337[1]._arr4[0];
- if (scene->_field4240 != 1) {
- int tmpVal = scene->subC3E92(scene->_field4240);
- scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal];
+ if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ scene->_actionCard1 = &scene->_gameBoardSide[1]._handCard[i];
+ scene->_actionCard2 = &scene->_gameBoardSide[1]._emptyStationPos;
+ if (scene->_actionIdx1 != 1) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
}
- scene->_item1.setAction(&scene->_action12);
+ scene->_actionItem.setAction(&scene->_action12);
noAction = false;
}
break;
case 2:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[2]._arr1[i]._field34 == 27) {
+ if (scene->_gameBoardSide[2]._handCard[i]._cardId == 27) {
found = true;
break;
}
}
- if ((found) && (scene->subC3E92(scene->_field4240) != -1)) {
+ if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
scene->subC4CD2();
if (MessageDialog::show(USE_DOUBLE_AGENT, NO_MSG, YES_MSG) == 0)
scene->subC4CEC();
else {
scene->subC4CEC();
- scene->_field3EF0 = &scene->_arrunkObj1337[2]._arr1[i];
- scene->_field3EF4 = &scene->_arrunkObj1337[2]._arr4[0];
- if (scene->_field4240 != 2) {
- int tmpVal = scene->subC3E92(scene->_field4240);
- scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal];
+ scene->_actionCard1 = &scene->_gameBoardSide[2]._handCard[i];
+ scene->_actionCard2 = &scene->_gameBoardSide[2]._emptyStationPos;
+ if (scene->_actionIdx1 != 2) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
}
- scene->_item1.setAction(&scene->_action12);
+ scene->_actionItem.setAction(&scene->_action12);
noAction = false;
}
}
break;
case 3:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[3]._arr1[i]._field34 == 27) {
+ if (scene->_gameBoardSide[3]._handCard[i]._cardId == 27) {
found = true;
break;
}
}
- if ((found) && (scene->subC3E92(scene->_field4240) != -1)) {
- scene->_field3EF0 = &scene->_arrunkObj1337[3]._arr1[i];
- scene->_field3EF4 = &scene->_arrunkObj1337[3]._arr4[0];
- if (scene->_field4240 != 3) {
- int tmpVal = scene->subC3E92(scene->_field4240);
- scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4240]._arr1[tmpVal];
+ if ((found) && (scene->getFreeHandCard(scene->_actionIdx1) != -1)) {
+ scene->_actionCard1 = &scene->_gameBoardSide[3]._handCard[i];
+ scene->_actionCard2 = &scene->_gameBoardSide[3]._emptyStationPos;
+ if (scene->_actionIdx1 != 3) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionIdx1);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx1]._handCard[tmpVal];
}
- scene->_item1.setAction(&scene->_action12);
+ scene->_actionItem.setAction(&scene->_action12);
noAction = false;
}
break;
@@ -4000,11 +4036,11 @@ void Scene1337::Action11::signal() {
if (!noAction)
return;
- if (scene->_field4240 == 2) {
+ if (scene->_actionIdx1 == 2) {
int count = 0;
- if (scene->_field4242 != 2) {
+ if (scene->_actionIdx2 != 2) {
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[scene->_field4242]._arr1[i]._field34 == 0)
+ if (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]._cardId == 0)
++count;
}
}
@@ -4014,7 +4050,7 @@ void Scene1337::Action11::signal() {
found = false;
while (!found) {
- switch (scene->_field4242) {
+ switch (scene->_actionIdx2) {
case 0:
scene->actionDisplay(1330, 131, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
@@ -4035,81 +4071,76 @@ void Scene1337::Action11::signal() {
g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks);
}
- scene->_item6._field36 = event.mousePos;
+ scene->_selectedCard._stationPos = event.mousePos;
found = false;
- if (scene->_field4242 != 2) {
+ if (scene->_actionIdx2 != 2) {
for (i = 0; i <= 3; i++) {
- if ((scene->subC2BF8(&scene->_arrunkObj1337[scene->_field4242]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[scene->_field4242]._arr1[i]._field34 != 0)) {
- scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4242]._arr1[i];
+ if (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[scene->_actionIdx2]._handCard[i]._cardId != 0)) {
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[i];
found = true;
break;
}
}
}
} // while
- scene->_field4246 = 1;
+ scene->_displayHelpFl = true;
scene->subC4CEC();
- } else {
- if (scene->_field4242 != 2) {
- int tmpVal = scene->subC3E92(scene->_field4242);
- scene->_field3EF8 = &scene->_arrunkObj1337[scene->_field4242]._arr1[tmpVal];
- }
+ } else if (scene->_actionIdx2 != 2) {
+ int tmpVal = scene->getFreeHandCard(scene->_actionIdx2);
+ scene->_actionCard3 = &scene->_gameBoardSide[scene->_actionIdx2]._handCard[tmpVal];
}
}
- scene->_field3EF0->_object1.postInit();
- scene->_field3EF0->_object1.hide();
- scene->_field3EF0->_object1.setVisage(1332);
- scene->_field3EF0->_object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_field3EF0->_object1.fixPriority(170);
- scene->_field3EF0->_object1.setStrip2(1);
- scene->_field3EF0->_field34 = scene->_field3EF8->_field34;
+ scene->_actionCard1->_card.postInit();
+ scene->_actionCard1->_card.hide();
+ scene->_actionCard1->_card.setVisage(1332);
+ scene->_actionCard1->_card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_actionCard1->_card.fixPriority(170);
+ scene->_actionCard1->_card.setStrip2(1);
+ scene->_actionCard1->_cardId = scene->_actionCard3->_cardId;
- scene->_field3EF8->_field34 = 0;
- scene->_field3EF8->_object1.remove();
+ scene->_actionCard3->_cardId = 0;
+ scene->_actionCard3->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF8->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard3->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF0->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard1->_stationPos, this);
}
break;
case 2:
- scene->_item2._object1.hide();
- switch (scene->_field4240) {
+ scene->_animatedCard._card.hide();
+ switch (scene->_actionIdx1) {
case 0:
- scene->_field3EF0->_object1.setFrame(2);
- scene->_field3EF0->_object1.show();
- scene->_field423E--;
- scene->_field4244 = 0;
+ scene->_actionCard1->_card.setFrame2(2);
+ scene->_actionCard1->_card.show();
break;
case 1:
- scene->_field3EF0->_object1.setFrame(4);
- scene->_field3EF0->_object1.show();
- scene->_field423E--;
- scene->_field4244 = 0;
+ scene->_actionCard1->_card.setFrame2(4);
+ scene->_actionCard1->_card.show();
break;
case 3:
- scene->_field3EF0->_object1.setFrame(3);
- scene->_field3EF0->_object1.show();
- scene->_field423E--;
- scene->_field4244 = 0;
+ scene->_actionCard1->_card.setFrame2(3);
+ scene->_actionCard1->_card.show();
break;
default:
- scene->setAnimationInfo(scene->_field3EF0);
+ scene->setAnimationInfo(scene->_actionCard1);
break;
}
- scene->subC4A39(scene->_field3EF4);
+ scene->_currentPlayerNumb--;
+ scene->_showPlayerTurn = false;
+ scene->discardCard(scene->_actionCard2);
break;
default:
break;
}
}
+// Pick a card in opponent hand
void Scene1337::Action12::signal() {
Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
@@ -4118,40 +4149,42 @@ void Scene1337::Action12::signal() {
signal();
break;
case 1: {
- scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34;
- scene->_field3EF4->_field34 = scene->_field3EF0->_field34;
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId;
+ scene->_currentDiscardIndex++;
+ scene->_actionCard2->_cardId = scene->_actionCard1->_cardId;
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 2:
- scene->_item2._object1.hide();
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(58);
- if (scene->_field4242 == 2) {
+ if (scene->_actionIdx2 == 2) {
int count = 0;
int i = -1;
- switch (scene->_field4240) {
+ switch (scene->_actionIdx1) {
case 0:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[0]._arr1[i]._field34 != 0)
+ if (scene->_gameBoardSide[0]._handCard[i]._cardId != 0)
++count;
}
break;
case 1:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[3]._arr1[i]._field34 != 0)
+ // The original game was counting in the hand of player 3, which is obviously wrong
+ if (scene->_gameBoardSide[1]._handCard[i]._cardId != 0)
++count;
}
break;
case 3:
for (i = 0; i <= 3; i++) {
- if (scene->_arrunkObj1337[3]._arr1[i]._field34 != 0)
+ if (scene->_gameBoardSide[3]._handCard[i]._cardId != 0)
++count;
}
break;
@@ -4165,7 +4198,7 @@ void Scene1337::Action12::signal() {
bool found = false;
while (!found) {
- switch (scene->_field4240) {
+ switch (scene->_actionIdx1) {
case 0:
scene->actionDisplay(1330, 131, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
@@ -4186,95 +4219,94 @@ void Scene1337::Action12::signal() {
g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks);
}
- scene->_item6._field36 = event.mousePos;
+ scene->_selectedCard._stationPos = event.mousePos;
- if (scene->_field4240 == 0) {
+ if (scene->_actionIdx1 == 0) {
for (i = 0; i <= 3; i++) {
- if ((scene->subC2BF8(&scene->_arrunkObj1337[0]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[0]._arr1[i]._field34 != 0)) {
+ if (scene->_gameBoardSide[0]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[0]._handCard[i]._cardId != 0)) {
found = true;
- scene->_field3EF8 = &scene->_arrunkObj1337[0]._arr1[i];
+ scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[i];
break;
}
}
}
- if (scene->_field4240 == 3) {
+ if (scene->_actionIdx1 == 3) {
for (i = 0; i <= 3; i++) {
- if ((scene->subC2BF8(&scene->_arrunkObj1337[3]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[3]._arr1[i]._field34 != 0)) {
+ if (scene->_gameBoardSide[3]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[3]._handCard[i]._cardId != 0)) {
found = true;
- scene->_field3EF8 = &scene->_arrunkObj1337[3]._arr1[i];
+ scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[i];
break;
}
}
}
- if (scene->_field4240 == 1) {
+ if (scene->_actionIdx1 == 1) {
for (i = 0; i <= 3; i++) {
- if ((scene->subC2BF8(&scene->_arrunkObj1337[1]._arr1[i], scene->_item6._field36) != 0) && (scene->_arrunkObj1337[1]._arr1[i]._field34 != 0)) {
+ if (scene->_gameBoardSide[1]._handCard[i].isIn(scene->_selectedCard._stationPos) && (scene->_gameBoardSide[1]._handCard[i]._cardId != 0)) {
found = true;
- scene->_field3EF8 = &scene->_arrunkObj1337[1]._arr1[i];
+ scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[i];
break;
}
}
}
}
scene->subC4CEC();
- } else {
- if (scene->_field4240 != 1) {
- switch (scene->_field4240) {
- case 0:
- scene->_field3EF8 = &scene->_arrunkObj1337[0]._arr1[scene->subC3E92(0)];
- break;
- case 3:
- scene->_field3EF8 = &scene->_arrunkObj1337[3]._arr1[scene->subC3E92(3)];
- break;
- default:
- break;
- }
- } else {
- scene->_field3EF8 = &scene->_arrunkObj1337[1]._arr1[scene->subC3E92(1)];
+ } else if (scene->_actionIdx1 != 1) {
+ switch (scene->_actionIdx1) {
+ case 0:
+ scene->_actionCard3 = &scene->_gameBoardSide[0]._handCard[scene->getFreeHandCard(0)];
+ break;
+ case 3:
+ scene->_actionCard3 = &scene->_gameBoardSide[3]._handCard[scene->getFreeHandCard(3)];
+ break;
+ default:
+ break;
}
+ } else {
+ scene->_actionCard3 = &scene->_gameBoardSide[1]._handCard[scene->getFreeHandCard(1)];
}
- scene->_field3EF0->_object1.postInit();
- scene->_field3EF0->_object1.hide();
- scene->_field3EF0->_object1.setVisage(1332);
- scene->_field3EF0->_object1.setPosition(scene->_field3EF0->_field36);
- scene->_field3EF0->_object1.fixPriority(170);
- scene->_field3EF0->_object1.setStrip2(1);
- scene->_field3EF0->_field34 = scene->_field3EF8->_field34;
+ scene->_actionCard1->_card.postInit();
+ scene->_actionCard1->_card.hide();
+ scene->_actionCard1->_card.setVisage(1332);
+ scene->_actionCard1->_card.setPosition(scene->_actionCard1->_stationPos);
+ scene->_actionCard1->_card.fixPriority(170);
+ scene->_actionCard1->_card.setStrip2(1);
+ scene->_actionCard1->_cardId = scene->_actionCard3->_cardId;
- scene->_field3EF8->_field34 = 0;
- scene->_field3EF8->_object1.remove();
+ scene->_actionCard3->_cardId = 0;
+ scene->_actionCard3->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF8->_field36);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard3->_stationPos);
+ scene->_animatedCard._card.show();
scene->_aSound1.play(57);
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF0->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard1->_stationPos, this);
}
break;
case 3:
- scene->_item2._object1.hide();
- switch (scene->_field4242) {
+ scene->_animatedCard._card.hide();
+ switch (scene->_actionIdx2) {
case 0:
- scene->_field3EF0->_object1.setFrame2(2);
- scene->_field3EF0->_object1.show();
+ scene->_actionCard1->_card.setFrame2(2);
+ scene->_actionCard1->_card.show();
break;
case 1:
- scene->_field3EF0->_object1.setFrame2(4);
- scene->_field3EF0->_object1.show();
+ scene->_actionCard1->_card.setFrame2(4);
+ scene->_actionCard1->_card.show();
break;
case 3:
- scene->_field3EF0->_object1.setFrame2(3);
- scene->_field3EF0->_object1.show();
+ scene->_actionCard1->_card.setFrame2(3);
+ scene->_actionCard1->_card.show();
break;
default:
- scene->setAnimationInfo(scene->_field3EF0);
+ scene->setAnimationInfo(scene->_actionCard1);
break;
}
- scene->subC4A39(scene->_field3EF4);
+ scene->discardCard(scene->_actionCard2);
+ scene->handleNextTurn();
break;
default:
break;
@@ -4286,29 +4318,29 @@ void Scene1337::Action13::signal() {
switch (_actionIndex++) {
case 0: {
- scene->_field3E28[scene->_field3E26] = scene->_field3EF4->_field34;
- scene->_field3E26--;
+ scene->_availableCardsPile[scene->_currentDiscardIndex] = scene->_actionCard2->_cardId;
+ scene->_currentDiscardIndex--;
- scene->_field3EF4->_field34 = scene->_field3EF0->_field34;
+ scene->_actionCard2->_cardId = scene->_actionCard1->_cardId;
- scene->_field3EF0->_field34 = 0;
- scene->_field3EF0->_object1.remove();
+ scene->_actionCard1->_cardId = 0;
+ scene->_actionCard1->_card.remove();
- scene->_item2._object1.setPosition(scene->_field3EF0->_field36, 0);
- scene->_item2._object1.show();
+ scene->_animatedCard._card.setPosition(scene->_actionCard1->_stationPos, 0);
+ scene->_animatedCard._card.show();
NpcMover *mover = new NpcMover();
- scene->_item2._object1.addMover(mover, &scene->_field3EF4->_field36, this);
+ scene->_animatedCard._card.addMover(mover, &scene->_actionCard2->_stationPos, this);
}
break;
case 1:
- scene->_item2._object1.hide();
- scene->setAnimationInfo(scene->_field3EF4);
+ scene->_animatedCard._card.hide();
+ scene->setAnimationInfo(scene->_actionCard2);
scene->_aSound1.play(58);
signal();
break;
case 2:
- scene->subC4A39(scene->_field3EF4);
+ scene->discardCard(scene->_actionCard2);
break;
default:
break;
@@ -4325,113 +4357,117 @@ void Scene1337::postInit(SceneObjectList *OwnerList) {
// Hide the user interface
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
+ R2_GLOBALS._uiElements._visible = false;
R2_GLOBALS._player.enableControl();
R2_GLOBALS._player._canWalk = false;
-
- _unkFctPtr412 = NULL;
-
- _field3EF0 = NULL;
- _field3EF4 = NULL;
- _field3EF8 = NULL;
-
- _arrunkObj1337[2]._arr1[0]._field36 = Common::Point(10, 174);
- _arrunkObj1337[2]._arr1[1]._field36 = Common::Point(37, 174);
- _arrunkObj1337[2]._arr1[2]._field36 = Common::Point(64, 174);
- _arrunkObj1337[2]._arr1[3]._field36 = Common::Point(91, 174);
-
- _arrunkObj1337[2]._arr2[0]._field36 = Common::Point(119, 174);
- _arrunkObj1337[2]._arr2[1]._field36 = Common::Point(119, 148);
- _arrunkObj1337[2]._arr2[2]._field36 = Common::Point(119, 122);
- _arrunkObj1337[2]._arr2[3]._field36 = Common::Point(145, 122);
- _arrunkObj1337[2]._arr2[4]._field36 = Common::Point(171, 122);
- _arrunkObj1337[2]._arr2[5]._field36 = Common::Point(171, 148);
- _arrunkObj1337[2]._arr2[6]._field36 = Common::Point(171, 174);
- _arrunkObj1337[2]._arr2[7]._field36 = Common::Point(145, 174);
-
- _arrunkObj1337[2]._arr3[0]._field36 = Common::Point(199, 174);
-
- _arrunkObj1337[2]._arr4[0]._field36 = Common::Point(145, 148);
-
- _arrunkObj1337[2]._fieldB94 = Common::Point(10, 174);
- _arrunkObj1337[2]._fieldB98 = Common::Point(37, 174);
- _arrunkObj1337[2]._fieldB9C = Common::Point(64, 174);
- _arrunkObj1337[2]._fieldBA0 = Common::Point(91, 174);
- _arrunkObj1337[2]._fieldBA4 = 2;
-
- _arrunkObj1337[3]._arr1[0]._field36 = Common::Point(14, 14);
- _arrunkObj1337[3]._arr1[1]._field36 = Common::Point(14, 36);
- _arrunkObj1337[3]._arr1[2]._field36 = Common::Point(14, 58);
- _arrunkObj1337[3]._arr1[3]._field36 = Common::Point(14, 80);
-
- _arrunkObj1337[3]._arr2[0]._field36 = Common::Point(37, 66);
- _arrunkObj1337[3]._arr2[1]._field36 = Common::Point(63, 66);
- _arrunkObj1337[3]._arr2[2]._field36 = Common::Point(89, 66);
- _arrunkObj1337[3]._arr2[3]._field36 = Common::Point(89, 92);
- _arrunkObj1337[3]._arr2[4]._field36 = Common::Point(89, 118);
- _arrunkObj1337[3]._arr2[5]._field36 = Common::Point(63, 118);
- _arrunkObj1337[3]._arr2[6]._field36 = Common::Point(37, 118);
- _arrunkObj1337[3]._arr2[7]._field36 = Common::Point(37, 92);
-
- _arrunkObj1337[3]._arr3[0]._field36 = Common::Point(37, 145);
-
- _arrunkObj1337[3]._arr4[0]._field36 = Common::Point(63, 92);
-
- _arrunkObj1337[3]._fieldB94 = Common::Point(14, 14);
- _arrunkObj1337[3]._fieldB98 = Common::Point(14, 36);
- _arrunkObj1337[3]._fieldB9C = Common::Point(14, 58);
- _arrunkObj1337[3]._fieldBA0 = Common::Point(14, 80);
- _arrunkObj1337[3]._fieldBA4 = 3;
-
- _arrunkObj1337[0]._arr1[0]._field36 = Common::Point(280, 5);
- _arrunkObj1337[0]._arr1[1]._field36 = Common::Point(253, 5);
- _arrunkObj1337[0]._arr1[2]._field36 = Common::Point(226, 5);
- _arrunkObj1337[0]._arr1[3]._field36 = Common::Point(199, 5);
-
- _arrunkObj1337[0]._arr2[0]._field36 = Common::Point(171, 16);
- _arrunkObj1337[0]._arr2[1]._field36 = Common::Point(171, 42);
- _arrunkObj1337[0]._arr2[2]._field36 = Common::Point(171, 68);
- _arrunkObj1337[0]._arr2[3]._field36 = Common::Point(145, 68);
- _arrunkObj1337[0]._arr2[4]._field36 = Common::Point(119, 68);
- _arrunkObj1337[0]._arr2[5]._field36 = Common::Point(119, 42);
- _arrunkObj1337[0]._arr2[6]._field36 = Common::Point(119, 16);
- _arrunkObj1337[0]._arr2[7]._field36 = Common::Point(145, 16);
-
- _arrunkObj1337[0]._arr3[0]._field36 = Common::Point(91, 16);
-
- _arrunkObj1337[0]._arr4[0]._field36 = Common::Point(145, 42);
-
- _arrunkObj1337[0]._fieldB94 = Common::Point(280, 5);
- _arrunkObj1337[0]._fieldB98 = Common::Point(253, 5);
- _arrunkObj1337[0]._fieldB9C = Common::Point(226, 5);
- _arrunkObj1337[0]._fieldBA0 = Common::Point(199, 5);
- _arrunkObj1337[0]._fieldBA4 = 2;
-
- _arrunkObj1337[1]._arr1[0]._field36 = Common::Point(283, 146);
- _arrunkObj1337[1]._arr1[1]._field36 = Common::Point(283, 124);
- _arrunkObj1337[1]._arr1[2]._field36 = Common::Point(283, 102);
- _arrunkObj1337[1]._arr1[3]._field36 = Common::Point(283, 80);
-
- _arrunkObj1337[1]._arr2[0]._field36 = Common::Point(253, 122);
- _arrunkObj1337[1]._arr2[1]._field36 = Common::Point(227, 122);
- _arrunkObj1337[1]._arr2[2]._field36 = Common::Point(201, 122);
- _arrunkObj1337[1]._arr2[3]._field36 = Common::Point(201, 96);
- _arrunkObj1337[1]._arr2[4]._field36 = Common::Point(201, 70);
- _arrunkObj1337[1]._arr2[5]._field36 = Common::Point(227, 70);
- _arrunkObj1337[1]._arr2[6]._field36 = Common::Point(253, 70);
- _arrunkObj1337[1]._arr2[7]._field36 = Common::Point(253, 96);
-
- _arrunkObj1337[1]._arr3[0]._field36 = Common::Point(253, 43);
-
- _arrunkObj1337[1]._arr4[0]._field36 = Common::Point(227, 96);
-
- _arrunkObj1337[1]._fieldB94 = Common::Point(283, 146);
- _arrunkObj1337[1]._fieldB98 = Common::Point(283, 124);
- _arrunkObj1337[1]._fieldB9C = Common::Point(283, 102);
- _arrunkObj1337[1]._fieldBA0 = Common::Point(283, 80);
- _arrunkObj1337[1]._fieldBA4 = 4;
+ R2_GLOBALS._player._uiEnabled = false;
+
+ _delayedFunction = nullptr;
+
+ _actionCard1 = nullptr;
+ _actionCard2 = nullptr;
+ _actionCard3 = nullptr;
+
+ _gameBoardSide[2]._handCard[0]._stationPos = Common::Point(10, 174);
+ _gameBoardSide[2]._handCard[1]._stationPos = Common::Point(37, 174);
+ _gameBoardSide[2]._handCard[2]._stationPos = Common::Point(64, 174);
+ _gameBoardSide[2]._handCard[3]._stationPos = Common::Point(91, 174);
+
+ _gameBoardSide[2]._outpostStation[0]._stationPos = Common::Point(119, 174);
+ _gameBoardSide[2]._outpostStation[1]._stationPos = Common::Point(119, 148);
+ _gameBoardSide[2]._outpostStation[2]._stationPos = Common::Point(119, 122);
+ _gameBoardSide[2]._outpostStation[3]._stationPos = Common::Point(145, 122);
+ _gameBoardSide[2]._outpostStation[4]._stationPos = Common::Point(171, 122);
+ _gameBoardSide[2]._outpostStation[5]._stationPos = Common::Point(171, 148);
+ _gameBoardSide[2]._outpostStation[6]._stationPos = Common::Point(171, 174);
+ _gameBoardSide[2]._outpostStation[7]._stationPos = Common::Point(145, 174);
+
+ _gameBoardSide[2]._delayCard._stationPos = Common::Point(199, 174);
+
+ _gameBoardSide[2]._emptyStationPos._stationPos = Common::Point(145, 148);
+
+ _gameBoardSide[2]._card1Pos = Common::Point(10, 174);
+ _gameBoardSide[2]._card2Pos = Common::Point(37, 174);
+ _gameBoardSide[2]._card3Pos = Common::Point(64, 174);
+ _gameBoardSide[2]._card4Pos = Common::Point(91, 174);
+ _gameBoardSide[2]._frameNum = 2;
+
+ _gameBoardSide[3]._handCard[0]._stationPos = Common::Point(14, 14);
+ _gameBoardSide[3]._handCard[1]._stationPos = Common::Point(14, 36);
+ _gameBoardSide[3]._handCard[2]._stationPos = Common::Point(14, 58);
+ _gameBoardSide[3]._handCard[3]._stationPos = Common::Point(14, 80);
+
+ _gameBoardSide[3]._outpostStation[0]._stationPos = Common::Point(37, 66);
+ _gameBoardSide[3]._outpostStation[1]._stationPos = Common::Point(63, 66);
+ _gameBoardSide[3]._outpostStation[2]._stationPos = Common::Point(89, 66);
+ _gameBoardSide[3]._outpostStation[3]._stationPos = Common::Point(89, 92);
+ _gameBoardSide[3]._outpostStation[4]._stationPos = Common::Point(89, 118);
+ _gameBoardSide[3]._outpostStation[5]._stationPos = Common::Point(63, 118);
+ _gameBoardSide[3]._outpostStation[6]._stationPos = Common::Point(37, 118);
+ _gameBoardSide[3]._outpostStation[7]._stationPos = Common::Point(37, 92);
+
+ _gameBoardSide[3]._delayCard._stationPos = Common::Point(37, 145);
+
+ _gameBoardSide[3]._emptyStationPos._stationPos = Common::Point(63, 92);
+
+ _gameBoardSide[3]._card1Pos = Common::Point(14, 14);
+ _gameBoardSide[3]._card2Pos = Common::Point(14, 36);
+ _gameBoardSide[3]._card3Pos = Common::Point(14, 58);
+ _gameBoardSide[3]._card4Pos = Common::Point(14, 80);
+ _gameBoardSide[3]._frameNum = 3;
+
+ _gameBoardSide[0]._handCard[0]._stationPos = Common::Point(280, 5);
+ _gameBoardSide[0]._handCard[1]._stationPos = Common::Point(253, 5);
+ _gameBoardSide[0]._handCard[2]._stationPos = Common::Point(226, 5);
+ _gameBoardSide[0]._handCard[3]._stationPos = Common::Point(199, 5);
+
+ _gameBoardSide[0]._outpostStation[0]._stationPos = Common::Point(171, 16);
+ _gameBoardSide[0]._outpostStation[1]._stationPos = Common::Point(171, 42);
+ _gameBoardSide[0]._outpostStation[2]._stationPos = Common::Point(171, 68);
+ _gameBoardSide[0]._outpostStation[3]._stationPos = Common::Point(145, 68);
+ _gameBoardSide[0]._outpostStation[4]._stationPos = Common::Point(119, 68);
+ _gameBoardSide[0]._outpostStation[5]._stationPos = Common::Point(119, 42);
+ _gameBoardSide[0]._outpostStation[6]._stationPos = Common::Point(119, 16);
+ _gameBoardSide[0]._outpostStation[7]._stationPos = Common::Point(145, 16);
+
+ _gameBoardSide[0]._delayCard._stationPos = Common::Point(91, 16);
+
+ _gameBoardSide[0]._emptyStationPos._stationPos = Common::Point(145, 42);
+
+ _gameBoardSide[0]._card1Pos = Common::Point(280, 5);
+ _gameBoardSide[0]._card2Pos = Common::Point(253, 5);
+ _gameBoardSide[0]._card3Pos = Common::Point(226, 5);
+ _gameBoardSide[0]._card4Pos = Common::Point(199, 5);
+ _gameBoardSide[0]._frameNum = 2;
+
+ _gameBoardSide[1]._handCard[0]._stationPos = Common::Point(283, 146);
+ _gameBoardSide[1]._handCard[1]._stationPos = Common::Point(283, 124);
+ _gameBoardSide[1]._handCard[2]._stationPos = Common::Point(283, 102);
+ _gameBoardSide[1]._handCard[3]._stationPos = Common::Point(283, 80);
+
+ _gameBoardSide[1]._outpostStation[0]._stationPos = Common::Point(253, 122);
+ _gameBoardSide[1]._outpostStation[1]._stationPos = Common::Point(227, 122);
+ _gameBoardSide[1]._outpostStation[2]._stationPos = Common::Point(201, 122);
+ _gameBoardSide[1]._outpostStation[3]._stationPos = Common::Point(201, 96);
+ _gameBoardSide[1]._outpostStation[4]._stationPos = Common::Point(201, 70);
+ _gameBoardSide[1]._outpostStation[5]._stationPos = Common::Point(227, 70);
+ _gameBoardSide[1]._outpostStation[6]._stationPos = Common::Point(253, 70);
+ _gameBoardSide[1]._outpostStation[7]._stationPos = Common::Point(253, 96);
+
+ _gameBoardSide[1]._delayCard._stationPos = Common::Point(253, 43);
+
+ _gameBoardSide[1]._emptyStationPos._stationPos = Common::Point(227, 96);
+
+ _gameBoardSide[1]._card1Pos = Common::Point(283, 146);
+ _gameBoardSide[1]._card2Pos = Common::Point(283, 124);
+ _gameBoardSide[1]._card3Pos = Common::Point(283, 102);
+ _gameBoardSide[1]._card4Pos = Common::Point(283, 80);
+ _gameBoardSide[1]._frameNum = 4;
subPostInit();
+
+ _stockPile.postInit();
}
void Scene1337::remove() {
@@ -4441,25 +4477,26 @@ void Scene1337::remove() {
}
R2_GLOBALS._uiElements._active = true;
+ R2_GLOBALS._uiElements._visible = true;
SceneExt::remove();
}
void Scene1337::process(Event &event) {
if (event.eventType == EVENT_BUTTON_DOWN) {
- if (event.btnState != BTNSHIFT_RIGHT) {
- subD183F(R2_GLOBALS._v5780E, 1);
+ if (event.btnState == BTNSHIFT_RIGHT) {
+ updateCursorId(R2_GLOBALS._mouseCursorId, true);
event.handled = true;
- } else if (_unkFctPtr412) {
- FunctionPtrType tmpFctPtr = _unkFctPtr412;
- _unkFctPtr412 = NULL;
+ } else if (_delayedFunction) {
+ FunctionPtrType tmpFctPtr = _delayedFunction;
+ _delayedFunction = nullptr;
(this->*tmpFctPtr)();
event.handled = true;
}
} else if (event.eventType == EVENT_KEYPRESS) {
if (event.kbd.keycode == Common::KEYCODE_SPACE) {
- if (_unkFctPtr412) {
- FunctionPtrType tmpFctPtr = _unkFctPtr412;
- _unkFctPtr412 = NULL;
+ if (_delayedFunction) {
+ FunctionPtrType tmpFctPtr = _delayedFunction;
+ _delayedFunction = nullptr;
(this->*tmpFctPtr)();
event.handled = true;
}
@@ -4472,82 +4509,85 @@ void Scene1337::process(Event &event) {
}
void Scene1337::dispatch() {
- if (_field424C == 0) {
- ++_field424E;
- if (_field424E == 4) {
- _field424C = 1;
+ if (!_instructionsDisplayedFl) {
+ ++_instructionsWaitCount;
+ if (_instructionsWaitCount == 4) {
+ _instructionsDisplayedFl = true;
suggestInstructions();
}
}
+
+ // The following code is in the original in sceneHandler::process(),
+ // which is terrible as it's checked in every scene of the game.
+ setCursorData(5, _cursorCurStrip, _cursorCurFrame);
+ //
+
Scene::dispatch();
}
-void Scene1337::actionDisplay(int resNum, int lineNum, int x, int y, int arg5, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt) {
+void Scene1337::actionDisplay(int resNum, int lineNum, int x, int y, int keepOnScreen, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt) {
// TODO: Check if it's normal that arg5 is unused and replaced by an hardcoded 0 value
// May hide an original bug
- SceneItem::display(resNum, lineNum, SET_X, x, SET_Y, y, SET_KEEP_ONSCREEN, 0, SET_WIDTH, width, SET_POS_MODE, -1, SET_TEXT_MODE, textMode, SET_FONT, fontNum, SET_FG_COLOR, colFG, SET_EXT_BGCOLOR, colBGExt, SET_EXT_FGCOLOR, colFGExt, LIST_END);
+ SceneItem::display(resNum, lineNum, SET_X, x, SET_Y, y, SET_KEEP_ONSCREEN, 0,
+ SET_WIDTH, width, SET_POS_MODE, -1, SET_TEXT_MODE, textMode,
+ SET_FONT, fontNum, SET_FG_COLOR, colFG, SET_EXT_BGCOLOR, colBGExt,
+ SET_EXT_FGCOLOR, colFGExt, LIST_END);
}
-void Scene1337::setAnimationInfo(unkObj1337sub1 *subObj) {
- if (!subObj)
+void Scene1337::setAnimationInfo(Card *card) {
+ if (!card)
return;
- if (subObj->_field34 > 9) {
- if (subObj->_field34 > 25) {
- subObj->_object1.setStrip2(4);
- subObj->_object1.setFrame(subObj->_field34 - 25);
- } else {
- subObj->_object1.setStrip2(3);
- subObj->_object1.setFrame(subObj->_field34 - 9);
- }
+ if (card->_cardId > 25) {
+ card->_card.setStrip2(4);
+ card->_card.setFrame(card->_cardId - 25);
+ } else if (card->_cardId > 9) {
+ card->_card.setStrip2(3);
+ card->_card.setFrame(card->_cardId - 9);
} else {
- subObj->_object1.setStrip2(2);
- subObj->_object1.setFrame(subObj->_field34);
+ card->_card.setStrip2(2);
+ card->_card.setFrame(card->_cardId);
}
- subObj->_object1.show();
+ card->_card.show();
R2_GLOBALS._sceneObjects->draw();
}
-void Scene1337::subC20E5() {
- subC2586();
-}
-
-void Scene1337::subC20F9() {
- switch (_field424A) {
+void Scene1337::handleNextTurn() {
+ switch (_winnerId) {
case -1:
- ++_field423E;
- if (_field423E == 3)
- _field423E = 0;
+ ++_currentPlayerNumb;
+ if (_currentPlayerNumb > 3)
+ _currentPlayerNumb = 0;
- if (_field4244 == 1) {
- _object1.show();
- switch (_field423E) {
+ if (_showPlayerTurn) {
+ _currentPlayerArrow.show();
+ switch (_currentPlayerNumb) {
case 0:
- _object1.setStrip(3);
+ _currentPlayerArrow.setStrip(3);
break;
case 1:
- _object1.setStrip(4);
+ _currentPlayerArrow.setStrip(4);
break;
case 2:
subD1975(174, 107);
- _object1.setStrip(1);
+ _currentPlayerArrow.setStrip(1);
break;
case 3:
subC4CEC();
- _object1.setStrip(2);
+ _currentPlayerArrow.setStrip(2);
break;
default:
break;
}
if (!_autoplay)
- _unkFctPtr412 = &Scene1337::subC20E5;
+ _delayedFunction = &Scene1337::handlePlayerTurn;
else
- subC20E5();
+ handlePlayerTurn();
} else {
- subC20E5();
+ handlePlayerTurn();
}
break;
case 0:
@@ -4586,38 +4626,38 @@ void Scene1337::subC20F9() {
break;
}
- if (_field424A != -1)
+ if (_winnerId != -1)
R2_GLOBALS._sceneManager.changeScene(125);
}
-void Scene1337::subC2586() {
- if (_field4244 != 0)
- _object1.hide();
+void Scene1337::handlePlayerTurn() {
+ if (_showPlayerTurn)
+ _currentPlayerArrow.hide();
- switch (_field423E) {
+ switch (_currentPlayerNumb) {
case 2:
subC4CD2();
- if (_field4246 == 1)
+ if (_displayHelpFl)
actionDisplay(1330, 114, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- _field4246 = 0;
+ _displayHelpFl = false;
// No break on purpose
case 0:
// No break on purpose
case 1:
// No break on purpose
case 3:
- _item1.setAction(&_action4);
+ _actionItem.setAction(&_action4);
default:
break;
}
- _field4244 = 1;
+ _showPlayerTurn = true;
}
-bool Scene1337::subC264B(int arg1) {
- switch (arg1) {
+bool Scene1337::isStationCard(int cardId) {
+ switch (cardId) {
case 10:
// No break on purpose
case 12:
@@ -4639,8 +4679,8 @@ bool Scene1337::subC264B(int arg1) {
}
}
-bool Scene1337::subC2687(int arg1) {
- switch (arg1) {
+bool Scene1337::isStopConstructionCard(int cardId) {
+ switch (cardId) {
case 11:
// No break on purpose
case 14:
@@ -4654,43 +4694,42 @@ bool Scene1337::subC2687(int arg1) {
}
}
-int Scene1337::subC26CB(int arg1, int arg2) {
- if ((_arrunkObj1337[arg1]._arr1[arg2]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[arg2]._field34 <= 9)) {
- return arg2;
- }
+int Scene1337::getStationId(int playerId, int handCardId) {
+ if ((_gameBoardSide[playerId]._handCard[handCardId]._cardId > 1) && (_gameBoardSide[playerId]._handCard[handCardId]._cardId <= 9))
+ return handCardId;
return -1;
}
-int Scene1337::subC2719(int arg1) {
+int Scene1337::findPlatformCardInHand(int playerId) {
for (int i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1)
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 1)
return i;
}
return -1;
}
-int Scene1337::subC274D(int arg1) {
+int Scene1337::findCard13InHand(int playerId) {
for (int i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13)
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 13)
return i;
}
return -1;
}
-int Scene1337::subC2781(int arg1) {
+int Scene1337::checkThieftCard(int playerId) {
for (int i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25)
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 25)
return i;
}
return -1;
}
-int Scene1337::subC27B5(int arg1) {
- switch (arg1) {
+int Scene1337::isDelayCard(int cardId) {
+ switch (cardId) {
case 11:
// No break on purpose
case 14:
@@ -4698,7 +4737,7 @@ int Scene1337::subC27B5(int arg1) {
case 16:
// No break on purpose
case 24:
- return arg1;
+ return cardId;
break;
default:
return -1;
@@ -4706,8 +4745,8 @@ int Scene1337::subC27B5(int arg1) {
}
}
-int Scene1337::subC27F9(int arg1) {
- switch (arg1) {
+int Scene1337::getStationCardId(int cardId) {
+ switch (cardId) {
case 10:
// No break on purpose
case 12:
@@ -4723,377 +4762,143 @@ int Scene1337::subC27F9(int arg1) {
case 20:
// No break on purpose
case 21:
- return arg1;
+ return cardId;
default:
return -1;
}
}
-void Scene1337::subC2835(int arg1) {
- int i;
- bool found = false;
- switch (arg1) {
+void Scene1337::handlePlayer01Discard(int playerId) {
+ switch (playerId) {
case 0:
- for (i = 0; i <= 3; i++) {
- if (subC27F9(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (getStationCardId(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (subC27B5(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (isDelayCard(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if ((_arrunkObj1337[arg1]._arr1[i]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 9)) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if ((_gameBoardSide[playerId]._handCard[i]._cardId > 1) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 9)) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if ((_arrunkObj1337[arg1]._arr1[i]._field34 >= 26) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 33)) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if ((_gameBoardSide[playerId]._handCard[i]._cardId >= 26) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 33)) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
break;
case 1:
- for (i = 0; i <= 3; i++) {
- if ((_arrunkObj1337[arg1]._arr1[i]._field34 >= 26) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 33)) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if ((_gameBoardSide[playerId]._handCard[i]._cardId >= 26) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 33)) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 1) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 1) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if ((_arrunkObj1337[arg1]._arr1[i]._field34 > 1) && (_arrunkObj1337[arg1]._arr1[i]._field34 <= 9)) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if ((_gameBoardSide[playerId]._handCard[i]._cardId > 1) && (_gameBoardSide[playerId]._handCard[i]._cardId <= 9)) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (subC27F9(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (getStationCardId(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (subC27B5(_arrunkObj1337[arg1]._arr1[i]._field34) != -1) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (isDelayCard(_gameBoardSide[playerId]._handCard[i]._cardId) != -1) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 25) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 25) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
- if (found)
- break;
-
- for (i = 0; i <= 3; i++) {
- if (_arrunkObj1337[arg1]._arr1[i]._field34 == 13) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (_gameBoardSide[playerId]._handCard[i]._cardId == 13) {
+ discardCard(&_gameBoardSide[playerId]._handCard[i]);
+ return;
}
}
break;
default:
- return;
- }
-
- subC4A39(&_arrunkObj1337[arg1]._arr1[i]);
-}
-
-bool Scene1337::subC2BF8(unkObj1337sub1 *subObj1, Common::Point pt) {
- if ((subObj1->_field36.x > pt.x) || (subObj1->_field36.x + 24 < pt.x))
- return false;
-
- if ((subObj1->_field36.y > pt.y) || (subObj1->_field36.y + 24 < pt.y))
- return false;
-
- return true;
-}
-
-void Scene1337::subC2C2F() {
- bool found = true;
-
- if (_arrunkObj1337[3]._arr3[0]._field34 != 0) {
- switch (_arrunkObj1337[3]._arr3[0]._field34) {
- case 10:
- // No break on purpose
- case 12:
- // No break on purpose
- case 15:
- // No break on purpose
- case 17:
- // No break on purpose
- case 18:
- // No break on purpose
- case 19:
- // No break on purpose
- case 20:
- // No break on purpose
- case 21:
- subC4A39(&_arrunkObj1337[3]._arr3[0]);
- found = false;
- break;
- default:
- found = false;
- int i;
- for (i = 0; i <= 3; i++) {
- if (subC3386(_arrunkObj1337[3]._arr3[0]._field34, _arrunkObj1337[3]._arr1[i]._field34)) {
- found = true;
- break;
- }
- }
-
- if (found) {
- found = false;
- subC34A1(&_arrunkObj1337[3]._arr1[i], &_arrunkObj1337[3]._arr3[0]);
- }
- break;
- }
- }
-
- if (!found)
- return;
-
- int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
-
- if (_arrunkObj1337[3]._arr1[randIndx]._field34 == 1) {
- found = false;
-
- for (int i = 0; i <= 7; i++) {
- if ((_arrunkObj1337[3]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[3]._arr3[0]._field34))) {
- subC340B(&_arrunkObj1337[3]._arr1[randIndx], &_arrunkObj1337[3]._arr2[i]);
- found = true;
- break;
- }
- }
-
- if (found) {
- return;
- }
- } else if (_arrunkObj1337[3]._arr1[randIndx]._field34 <= 9) {
- found = false;
-
- for (int i = 0; i <= 7; i++) {
- if (_arrunkObj1337[3]._arr2[i]._field34 == _arrunkObj1337[3]._arr1[randIndx]._field34) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- for (int i = 0; i <= 7; i++) {
- if ((_arrunkObj1337[3]._arr2[i]._field34 == 1) && (!subC2687(_arrunkObj1337[3]._arr3[0]._field34))) {
- int tmpVal = 0;
-
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[3]._arr2[j]._field34 > 1) && (_arrunkObj1337[3]._arr2[j]._field34 <= 9))
- ++tmpVal;
- }
-
- if (tmpVal == 7)
- _field424A = 3;
-
- subC33C0(&_arrunkObj1337[3]._arr1[randIndx], &_arrunkObj1337[3]._arr2[i]);
- found = true;
- break;
- }
- }
- if (found)
- return;
- }
- } else if (_arrunkObj1337[3]._arr1[randIndx]._field34 == 13) {
- int tmpVal = subC331B(3);
-
- if (tmpVal != -1) {
- subC358E(&_arrunkObj1337[3]._arr1[randIndx], tmpVal);
- return;
- }
- } else if (_arrunkObj1337[3]._arr1[randIndx]._field34 == 25) {
- int tmpVal = -1;
- found = false;
- int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
-
- for (int i = 0; i <= 3; i++) {
- if ( (tmpRandIndx != 3)
- && ( (_arrunkObj1337[tmpRandIndx]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[tmpRandIndx]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[tmpRandIndx]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[tmpRandIndx]._arr1[3]._field34 != 0) )) {
- tmpVal = tmpRandIndx;
- break;
- }
-
- ++tmpRandIndx;
- if (tmpRandIndx > 3)
- tmpRandIndx = 0;
- }
-
- if (tmpVal != -1) {
- subC318B(3, &_arrunkObj1337[3]._arr1[randIndx], tmpVal);
- return;
- }
- } else {
- switch (_arrunkObj1337[3]._arr1[randIndx]._field34) {
- case 10:
- // No break on purpose
- case 11:
- // No break on purpose
- case 12:
- // No break on purpose
- case 14:
- // No break on purpose
- case 15:
- // No break on purpose
- case 16:
- // No break on purpose
- case 17:
- // No break on purpose
- case 18:
- // No break on purpose
- case 19:
- // No break on purpose
- case 20:
- // No break on purpose
- case 21:
- // No break on purpose
- case 24: {
- int tmpVal = -1;
- int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
-
- for (int i = 0; i <= 3; i++) {
- if (tmpRandIndx != 3) {
- // The variables 'i' and 'j' are not used in the inner code of the loop.
- // It's understandable for 'i', which helps making sure that tmpVal is used properly,
- // but it's suspect for j
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[tmpRandIndx]._arr3[0]._field34 == 0) && (subC32B1(tmpRandIndx, _arrunkObj1337[3]._arr1[randIndx]._field34))) {
- tmpVal = j;
- }
- }
- }
-
- ++tmpRandIndx;
- if (tmpRandIndx > 3)
- tmpRandIndx = 0;
-
- if (tmpVal != -1)
- break;
- }
-
- if (tmpVal != -1) {
- // Useless second identical check skipped
- subC3456(&_arrunkObj1337[3]._arr1[randIndx], &_arrunkObj1337[tmpVal]._arr3[0]);
- return;
- }
- }
- default:
- break;
- }
+ break;
}
-
- subC4A39(&_arrunkObj1337[3]._arr1[randIndx]);
}
-void Scene1337::subC318B(int arg1, unkObj1337sub1 *subObj1, int arg3) {
- _field4240 = arg1;
- _field4242 = arg3;
+void Scene1337::playThieftCard(int playerId, Card *card, int victimId) {
+ _actionIdx1 = playerId;
+ _actionIdx2 = victimId;
int randIndx;
for (;;) {
randIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
- if (_arrunkObj1337[arg3]._arr1[randIndx]._field34 != 0)
+ if (_gameBoardSide[victimId]._handCard[randIndx]._cardId != 0)
break;
}
- _field3EF0 = subObj1;
- _field3EF4 = &_arrunkObj1337[arg3]._arr4[0];
- _field3EF8 = &_arrunkObj1337[arg3]._arr1[randIndx];
+ _actionCard1 = card;
+ _actionCard2 = &_gameBoardSide[victimId]._emptyStationPos;
+ _actionCard3 = &_gameBoardSide[victimId]._handCard[randIndx];
- _item1.setAction(&_action11);
+ _actionItem.setAction(&_action11);
}
-int Scene1337::subC3257(int arg1) {
+int Scene1337::getPreventionCardId(int cardId) {
int retVal;
- switch (arg1) {
+ switch (cardId) {
case 10:
retVal = 2;
break;
@@ -5125,152 +4930,147 @@ int Scene1337::subC3257(int arg1) {
return retVal;
}
-bool Scene1337::subC32B1(int arg1, int arg2) {
+bool Scene1337::isAttackPossible(int victimId, int cardId) {
for (int i = 0; i <= 7; i++) {
- if (_arrunkObj1337[arg1]._arr2[i]._field34 != 0) {
- int tmpVal = subC3257(arg2);
- if (tmpVal == _arrunkObj1337[arg1]._arr2[i]._field34)
+ if (_gameBoardSide[victimId]._outpostStation[i]._cardId != 0) {
+ if (getPreventionCardId(cardId) == _gameBoardSide[victimId]._outpostStation[i]._cardId)
return false;
}
}
return true;
}
-int Scene1337::subC331B(int arg1) {
- int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
+int Scene1337::getPlayerWithOutpost(int playerId) {
+ int randPlayerId = R2_GLOBALS._randomSource.getRandomNumber(3);
for (int i = 0; i <= 3; i++) {
- if (randIndx != arg1) {
+ if (randPlayerId != playerId) {
for (int j = 0; j <= 7; j++) {
- if (_arrunkObj1337[randIndx]._arr2[j]._field34 != 0)
- return randIndx;
+ if (_gameBoardSide[randPlayerId]._outpostStation[j]._cardId != 0)
+ return randPlayerId;
}
}
- if (arg1 == 1) {
- randIndx--;
- if (randIndx < 0)
- randIndx = 3;
+ if (playerId == 1) {
+ randPlayerId--;
+ if (randPlayerId < 0)
+ randPlayerId = 3;
} else {
- ++randIndx;
- if (randIndx > 3)
- randIndx = 0;
+ ++randPlayerId;
+ if (randPlayerId > 3)
+ randPlayerId = 0;
}
}
return -1;
}
-bool Scene1337::subC3386(int arg1, int arg2) {
- if ((arg1 == 11) && (arg2 == 26))
+bool Scene1337::checkAntiDelayCard(int delayCardId, int cardId) {
+ if ((delayCardId == 11) && (cardId == 26))
return true;
- if ((arg1 == 14) && (arg2 == 30))
+ if ((delayCardId == 14) && (cardId == 30))
return true;
- if ((arg1 == 16) && (arg2 == 32))
+ if ((delayCardId == 16) && (cardId == 32))
return true;
- if ((arg1 == 24) && (arg2 == 28))
+ if ((delayCardId == 24) && (cardId == 28))
return true;
return false;
}
-void Scene1337::subC33C0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) {
- _field3EF4 = subObj2;
- _field3EF0 = subObj1;
- _item1.setAction(&_action7);
+void Scene1337::playStationCard(Card *station, Card *platform) {
+ _actionCard1 = station;
+ _actionCard2 = platform;
+ _actionItem.setAction(&_action7);
}
-int Scene1337::subC3E92(int arg1) {
- if ( (_arrunkObj1337[arg1]._arr1[0]._field34 == 0)
- && (_arrunkObj1337[arg1]._arr1[1]._field34 == 0)
- && (_arrunkObj1337[arg1]._arr1[2]._field34 == 0)
- && (_arrunkObj1337[arg1]._arr1[3]._field34 == 0))
+int Scene1337::getFreeHandCard(int playerId) {
+ if ( (_gameBoardSide[playerId]._handCard[0]._cardId == 0)
+ && (_gameBoardSide[playerId]._handCard[1]._cardId == 0)
+ && (_gameBoardSide[playerId]._handCard[2]._cardId == 0)
+ && (_gameBoardSide[playerId]._handCard[3]._cardId == 0))
return -1;
int randIndx;
for (;;) {
randIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
- if (_arrunkObj1337[arg1]._arr1[randIndx]._field34 == 0)
+ if (_gameBoardSide[playerId]._handCard[randIndx]._cardId == 0)
break;
}
return randIndx;
}
-void Scene1337::subC340B(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) {
- _field3EF0 = subObj1;
- _field3EF4 = subObj2;
+void Scene1337::playPlatformCard(Card *card, Card *dest) {
+ _actionCard1 = card;
+ _actionCard2 = dest;
- _item1.setAction(&_action6);
+ _actionItem.setAction(&_action6);
}
-void Scene1337::subC3456(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) {
- _field3EF0 = subObj1;
- _field3EF4 = subObj2;
+void Scene1337::playDelayCard(Card *card, Card *dest) {
+ _actionCard1 = card;
+ _actionCard2 = dest;
- _item1.setAction(&_action9);
+ _actionItem.setAction(&_action9);
}
-void Scene1337::subC34A1(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) {
- _field3EF0 = subObj1;
- _field3EF4 = subObj2;
+void Scene1337::playAntiDelayCard(Card *card, Card *dest) {
+ _actionCard1 = card;
+ _actionCard2 = dest;
- _item1.setAction(&_action8);
+ _actionItem.setAction(&_action8);
+
+ handleNextTurn();
}
-Scene1337::unkObj1337sub1 *Scene1337::subC34EC(int arg1) {
- for (int i = 0; i <= 7; i++) {
- if (_arrunkObj1337[arg1]._arr2[i]._field34 == 1) {
- return &_arrunkObj1337[arg1]._arr2[i];
- }
- }
+Scene1337::Card *Scene1337::getStationCard(int playerId) {
for (int i = 0; i <= 7; i++) {
- if ((_arrunkObj1337[arg1]._arr2[i]._field34 != 0) && (_arrunkObj1337[arg1]._arr2[i]._field34 < 10)) {
- return &_arrunkObj1337[arg1]._arr2[i];
- }
+ if ((_gameBoardSide[playerId]._outpostStation[i]._cardId >= 1) && (_gameBoardSide[playerId]._outpostStation[i]._cardId <= 9))
+ return &_gameBoardSide[playerId]._outpostStation[i];
}
- return NULL;
+ return nullptr;
}
-void Scene1337::subC358E(unkObj1337sub1 *subObj1, int arg2) {
- _field3EF0 = subObj1;
- _field3EF4 = subC34EC(arg2);
- _field3EF8 = &_arrunkObj1337[arg2]._arr4[0];
- _field4240 = arg2;
- _item1.setAction(&_action10);
+void Scene1337::playCounterTrickCard(Card *card, int playerId) {
+ _actionCard1 = card;
+ _actionCard2 = getStationCard(playerId);
+ _actionCard3 = &_gameBoardSide[playerId]._emptyStationPos;
+ _actionIdx1 = playerId;
+ _actionItem.setAction(&_action10);
+ handleNextTurn();
}
-void Scene1337::subC4A39(unkObj1337sub1 *subObj) {
- _field3EF0 = subObj;
+void Scene1337::discardCard(Card *card) {
+ _actionCard1 = card;
- _item1.setAction(&_action5);
+ _actionItem.setAction(&_action5);
}
void Scene1337::subC4CD2() {
if (R2_GLOBALS._v57709 > 0) {
subD1917();
- subD1940(false);
+ subD1940(false); // _v5780C--
}
}
void Scene1337::subC4CEC() {
- if (R2_GLOBALS._v57709 != 0)
- return;
-
- subD18F5();
- subD1940(1);
+ if (R2_GLOBALS._v57709 == 0) {
+ subD18F5();
+ subD1940(true); // _v5780C++
+ }
}
-void Scene1337::subC51A0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2) {
- _field3EF0 = subObj1;
- _field3EF4 = subObj2;
+void Scene1337::subC51A0(Card *subObj1, Card *subObj2) {
+ _actionCard1 = subObj1;
+ _actionCard2 = subObj2;
- _item1.setAction(&_action13);
+ _actionItem.setAction(&_action13);
}
void Scene1337::displayDialog(int dialogNumb) {
@@ -5374,8 +5174,8 @@ void Scene1337::displayDialog(int dialogNumb) {
void Scene1337::subPostInit() {
R2_GLOBALS._v57709 = 0;
R2_GLOBALS._v5780C = 0;
- subD183F(1, 0);
- subD1940(true);
+ updateCursorId(1, false);
+ subD1940(true); // _v5780C++
subD18F5();
// loadScene(1330);
@@ -5383,237 +5183,244 @@ void Scene1337::subPostInit() {
R2_GLOBALS._scenePalette.addRotation(224, 235, 1);
- _field3E28[0] = 1;
- _field3E28[1] = 1;
- _field3E28[2] = 1;
- _field3E28[3] = 1;
- _field3E28[4] = 1;
- _field3E28[5] = 1;
- _field3E28[6] = 1;
- _field3E28[7] = 1;
- _field3E28[8] = 26;
- _field3E28[9] = 2;
- _field3E28[10] = 2;
- _field3E28[11] = 2;
- _field3E28[12] = 2;
- _field3E28[13] = 2;
- _field3E28[14] = 26;
- _field3E28[15] = 3;
- _field3E28[16] = 3;
- _field3E28[17] = 3;
- _field3E28[18] = 3;
- _field3E28[19] = 3;
- _field3E28[20] = 28;
- _field3E28[21] = 4;
- _field3E28[22] = 4;
- _field3E28[23] = 4;
- _field3E28[24] = 4;
- _field3E28[25] = 4;
- _field3E28[26] = 28;
- _field3E28[27] = 5;
- _field3E28[28] = 5;
- _field3E28[29] = 5;
- _field3E28[30] = 5;
- _field3E28[31] = 5;
- _field3E28[32] = 30;
- _field3E28[33] = 6;
- _field3E28[34] = 6;
- _field3E28[35] = 6;
- _field3E28[36] = 6;
- _field3E28[37] = 6;
- _field3E28[38] = 30;
- _field3E28[39] = 7;
- _field3E28[40] = 7;
- _field3E28[41] = 7;
- _field3E28[42] = 7;
- _field3E28[43] = 7;
- _field3E28[44] = 32;
- _field3E28[45] = 8;
- _field3E28[46] = 8;
- _field3E28[47] = 8;
- _field3E28[48] = 8;
- _field3E28[49] = 8;
- _field3E28[50] = 32;
- _field3E28[51] = 9;
- _field3E28[52] = 9;
- _field3E28[53] = 9;
- _field3E28[54] = 9;
- _field3E28[55] = 9;
- _field3E28[56] = 10;
- _field3E28[57] = 11;
- _field3E28[58] = 12;
- _field3E28[59] = 13;
- _field3E28[60] = 13;
- _field3E28[61] = 14;
- _field3E28[62] = 15;
- _field3E28[63] = 16;
- _field3E28[64] = 17;
- _field3E28[65] = 18;
- _field3E28[66] = 19;
- _field3E28[67] = 20;
- _field3E28[68] = 21;
- _field3E28[69] = 26;
- _field3E28[70] = 28;
- _field3E28[71] = 24;
- _field3E28[72] = 25;
- _field3E28[73] = 25;
- _field3E28[74] = 25;
- _field3E28[75] = 25;
- _field3E28[76] = 26;
- _field3E28[77] = 26;
- _field3E28[78] = 26;
- _field3E28[79] = 27;
- _field3E28[80] = 27;
- _field3E28[81] = 28;
- _field3E28[82] = 28;
- _field3E28[83] = 28;
- _field3E28[84] = 29;
- _field3E28[85] = 29;
- _field3E28[86] = 29;
- _field3E28[87] = 30;
- _field3E28[88] = 30;
- _field3E28[89] = 30;
- _field3E28[90] = 30;
- _field3E28[91] = 32;
- _field3E28[92] = 1;
- _field3E28[93] = 32;
- _field3E28[94] = 32;
- _field3E28[95] = 32;
- _field3E28[96] = 1;
- _field3E28[97] = 1;
- _field3E28[98] = 1;
- _field3E28[99] = 0;
-
- _field3E24 = 98;
- _field3E26 = 98;
-
- _item7._field34 = 0;
- _item7._field36 = Common::Point(128, 95);
-
- _item8._field34 = 0;
- _item8._field36 = Common::Point(162, 95);
-
- _item6._field34 = 0;
-
- _item2._object1.postInit();
- _item2._object1.setVisage(1332);
- _item2._object1.setStrip(5);
- _item2._object1.setFrame(1);
- _item2._object1._moveDiff = Common::Point(10, 10);
- _item2._object1.fixPriority(400);
- _item2._object1.setPosition(Common::Point(128, 95), 0);
- _item2._object1.animate(ANIM_MODE_2, NULL);
- _item2._object1.hide();
-
- _object1.postInit();
- _object1.setVisage(1334);
- _object1.setStrip(1);
- _object1.setFrame(1);
- _object1._numFrames = 12;
- _object1.fixPriority(500);
- _object1.setPosition(Common::Point(174, 107), 0);
- _object1.animate(ANIM_MODE_2, NULL);
- _object1.hide();
-
- _field4244 = 1;
- _field4246 = 0;
- _field4248 = 0;
- _field424A = -1;
-
- _background1.setup2(9531, 1, 1, 249, 168, 155, 0);
+ _availableCardsPile[0] = 1;
+ _availableCardsPile[1] = 1;
+ _availableCardsPile[2] = 1;
+ _availableCardsPile[3] = 1;
+ _availableCardsPile[4] = 1;
+ _availableCardsPile[5] = 1;
+ _availableCardsPile[6] = 1;
+ _availableCardsPile[7] = 1;
+ _availableCardsPile[8] = 26;
+ _availableCardsPile[9] = 2;
+ _availableCardsPile[10] = 2;
+ _availableCardsPile[11] = 2;
+ _availableCardsPile[12] = 2;
+ _availableCardsPile[13] = 2;
+ _availableCardsPile[14] = 26;
+ _availableCardsPile[15] = 3;
+ _availableCardsPile[16] = 3;
+ _availableCardsPile[17] = 3;
+ _availableCardsPile[18] = 3;
+ _availableCardsPile[19] = 3;
+ _availableCardsPile[20] = 28;
+ _availableCardsPile[21] = 4;
+ _availableCardsPile[22] = 4;
+ _availableCardsPile[23] = 4;
+ _availableCardsPile[24] = 4;
+ _availableCardsPile[25] = 4;
+ _availableCardsPile[26] = 28;
+ _availableCardsPile[27] = 5;
+ _availableCardsPile[28] = 5;
+ _availableCardsPile[29] = 5;
+ _availableCardsPile[30] = 5;
+ _availableCardsPile[31] = 5;
+ _availableCardsPile[32] = 30;
+ _availableCardsPile[33] = 6;
+ _availableCardsPile[34] = 6;
+ _availableCardsPile[35] = 6;
+ _availableCardsPile[36] = 6;
+ _availableCardsPile[37] = 6;
+ _availableCardsPile[38] = 30;
+ _availableCardsPile[39] = 7;
+ _availableCardsPile[40] = 7;
+ _availableCardsPile[41] = 7;
+ _availableCardsPile[42] = 7;
+ _availableCardsPile[43] = 7;
+ _availableCardsPile[44] = 32;
+ _availableCardsPile[45] = 8;
+ _availableCardsPile[46] = 8;
+ _availableCardsPile[47] = 8;
+ _availableCardsPile[48] = 8;
+ _availableCardsPile[49] = 8;
+ _availableCardsPile[50] = 32;
+ _availableCardsPile[51] = 9;
+ _availableCardsPile[52] = 9;
+ _availableCardsPile[53] = 9;
+ _availableCardsPile[54] = 9;
+ _availableCardsPile[55] = 9;
+ _availableCardsPile[56] = 10;
+ _availableCardsPile[57] = 11;
+ _availableCardsPile[58] = 12;
+ _availableCardsPile[59] = 13;
+ _availableCardsPile[60] = 13;
+ _availableCardsPile[61] = 14;
+ _availableCardsPile[62] = 15;
+ _availableCardsPile[63] = 16;
+ _availableCardsPile[64] = 17;
+ _availableCardsPile[65] = 18;
+ _availableCardsPile[66] = 19;
+ _availableCardsPile[67] = 20;
+ _availableCardsPile[68] = 21;
+ _availableCardsPile[69] = 26;
+ _availableCardsPile[70] = 28;
+ _availableCardsPile[71] = 24;
+ _availableCardsPile[72] = 25;
+ _availableCardsPile[73] = 25;
+ _availableCardsPile[74] = 25;
+ _availableCardsPile[75] = 25;
+ _availableCardsPile[76] = 26;
+ _availableCardsPile[77] = 26;
+ _availableCardsPile[78] = 26;
+ _availableCardsPile[79] = 27;
+ _availableCardsPile[80] = 27;
+ _availableCardsPile[81] = 28;
+ _availableCardsPile[82] = 28;
+ _availableCardsPile[83] = 28;
+ _availableCardsPile[84] = 29;
+ _availableCardsPile[85] = 29;
+ _availableCardsPile[86] = 29;
+ _availableCardsPile[87] = 30;
+ _availableCardsPile[88] = 30;
+ _availableCardsPile[89] = 30;
+ _availableCardsPile[90] = 30;
+ _availableCardsPile[91] = 32;
+ _availableCardsPile[92] = 1;
+ _availableCardsPile[93] = 32;
+ _availableCardsPile[94] = 32;
+ _availableCardsPile[95] = 32;
+ _availableCardsPile[96] = 1;
+ _availableCardsPile[97] = 1;
+ _availableCardsPile[98] = 1;
+ _availableCardsPile[99] = 0;
+
+ _cardsAvailableNumb = 98;
+ _currentDiscardIndex = 98; // CHECKME: Would make more sense at pos 99
+
+ _discardPile._cardId = 0;
+ _discardPile._stationPos = Common::Point(128, 95);
+
+ _stockCard._cardId = 0;
+ _stockCard._stationPos = Common::Point(162, 95);
+
+ _selectedCard._cardId = 0;
+
+ _animatedCard._card.postInit();
+ _animatedCard._card.setVisage(1332);
+ _animatedCard._card.setStrip(5);
+ _animatedCard._card.setFrame(1);
+ _animatedCard._card._moveDiff = Common::Point(10, 10);
+ _animatedCard._card.fixPriority(400);
+ _animatedCard._card.setPosition(Common::Point(128, 95), 0);
+ _animatedCard._card.animate(ANIM_MODE_2, NULL);
+ _animatedCard._card.hide();
+
+ _currentPlayerArrow.postInit();
+ _currentPlayerArrow.setVisage(1334);
+ _currentPlayerArrow.setStrip(1);
+ _currentPlayerArrow.setFrame(1);
+ _currentPlayerArrow._numFrames = 12;
+ _currentPlayerArrow.fixPriority(500);
+ _currentPlayerArrow.setPosition(Common::Point(174, 107), 0);
+ _currentPlayerArrow.animate(ANIM_MODE_2, NULL);
+ _currentPlayerArrow.hide();
+
+ _showPlayerTurn = true;
+ _displayHelpFl = false;
+ _winnerId = -1;
+
+ _helpIcon.postInit();
+ _helpIcon.setup(9531, 1, 1);
+ _helpIcon.setPosition(Common::Point(249, 168));
+ _helpIcon.setPriority(155);
+ _helpIcon._effect = EFFECT_NONE;
+ _helpIcon.show();
_autoplay = false;
- _field424C = 0;
- _field424E = 0;
+ _instructionsDisplayedFl = false;
+ _instructionsWaitCount = 0;
}
void Scene1337::suggestInstructions() {
if (R2_GLOBALS._v57709 > 0)
subD1917();
+
if (MessageDialog::show(NEED_INSTRUCTIONS, NO_MSG, YES_MSG) == 0) {
if (R2_GLOBALS._v57709 == 0)
subD18F5();
- subCCF26();
+ dealCards();
} else {
if (R2_GLOBALS._v57709 == 0)
subD18F5();
- subCB59B();
+ displayInstructions();
}
}
-void Scene1337::subCB59B() {
- _item1.setAction(&_action1);
+void Scene1337::displayInstructions() {
+ _actionItem.setAction(&_action1);
}
void Scene1337::shuffleCards() {
R2_GLOBALS._sceneObjects->draw();
+ // Remove holes in card pile
for (int i = 0; i <= 98; i++) {
- if (_field3E28[i] == 0) {
+ if (_availableCardsPile[i] == 0) {
for (int j = i + 1; j <= 98; j ++) {
- if (_field3E28[j] != 0) {
- _field3E28[i] = _field3E28[j];
- _field3E28[j] = 0;
+ if (_availableCardsPile[j] != 0) {
+ _availableCardsPile[i] = _availableCardsPile[j];
+ _availableCardsPile[j] = 0;
break;
}
}
}
}
+ // Compute the number of available cards
for (int i = 0; i <= 99; i ++) {
- if (_field3E28[i] == 0) {
- _field3E24 = i - 1;
- _field3E26 = 98;
+ if (_availableCardsPile[i] == 0) {
+ // CHECKME: This will fail if i == 0, which shouldn't happen
+ // as we don't shuffle cards when no card is available.
+ _cardsAvailableNumb = i - 1;
+ _currentDiscardIndex = 98; // CHECKME: Would make more sense at pos 99
break;
}
}
- // tmpVal is never modified in the original. It looks weird but it works: at the end, the cards are suffled!
- int tmpVal = 0;
- int randIndx;
- int swap;
for (int i = 0; i < 2000; i ++) {
- randIndx = R2_GLOBALS._randomSource.getRandomNumber(_field3E24);
- swap = _field3E28[tmpVal];
- _field3E28[tmpVal] = _field3E28[randIndx];
- _field3E28[randIndx] = swap;
+ int randIndx = R2_GLOBALS._randomSource.getRandomNumber(_cardsAvailableNumb);
+ int swap = _availableCardsPile[0];
+ _availableCardsPile[0] = _availableCardsPile[randIndx];
+ _availableCardsPile[randIndx] = swap;
}
- _field423C = 0;
- _item2._object1.setAction(&_action2);
+ _shuffleEndedFl = false;
- while(_field423C == 0) {
+ // Shuffle cards
+ _animatedCard._card.setAction(&_action2);
+
+ while(!_shuffleEndedFl && !g_vm->shouldQuit()) {
+ g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject);
g_globals->_scenePalette.signalListeners();
R2_GLOBALS._sceneObjects->draw();
- warning("TODO: recurse on draw() and on signalListeners()?");
g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks);
-
- // Hack to avoid eternal loop
- // To be removed when the recurse is working properly
- _field423C = 1;
}
}
-void Scene1337::subCCF26() {
- _item2._object1._moveDiff = Common::Point(30, 30);
+void Scene1337::dealCards() {
+ _animatedCard._card._moveDiff = Common::Point(30, 30);
shuffleCards();
- _item1.setAction(&_action3);
+
+ // Deal cards
+ _actionItem.setAction(&_action3);
}
-void Scene1337::subCD193() {
- warning("STUBBED: subCD193()");
+
+void Scene1337::showOptionsDialog() {
+ // Display menu with "Auto Play", "New Game", "Quit" and "Continue"
+ OptionsDialog::show();
}
-void Scene1337::subCDB90(int arg1, Common::Point pt) {
+void Scene1337::handleClick(int arg1, Common::Point pt) {
bool found = false;
int curReg = R2_GLOBALS._sceneRegions.indexOf(g_globals->_events._mousePos);
if (arg1 == 3) {
int i;
for (i = 0; i <= 7; i++) {
- if ( (subC2BF8(&_arrunkObj1337[2]._arr2[i], pt))
- || (subC2BF8(&_arrunkObj1337[0]._arr2[i], pt))
- || (subC2BF8(&_arrunkObj1337[1]._arr2[i], pt))
- || (subC2BF8(&_arrunkObj1337[3]._arr2[i], pt)) ) {
+ if ( _gameBoardSide[2]._outpostStation[i].isIn(pt)
+ || _gameBoardSide[0]._outpostStation[i].isIn(pt)
+ || _gameBoardSide[1]._outpostStation[i].isIn(pt)
+ || _gameBoardSide[3]._outpostStation[i].isIn(pt) ) {
found = true;
break;
}
@@ -5622,124 +5429,114 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
if (found) {
switch (curReg) {
case 5:
- if (_arrunkObj1337[2]._arr2[i]._field34 != 0)
- displayDialog(_arrunkObj1337[2]._arr2[i]._field34);
+ if (_gameBoardSide[2]._outpostStation[i]._cardId != 0)
+ displayDialog(_gameBoardSide[2]._outpostStation[i]._cardId);
else
actionDisplay(1330, 20, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
case 10:
- if (_arrunkObj1337[3]._arr2[i]._field34 != 0)
- displayDialog(_arrunkObj1337[3]._arr2[i]._field34);
+ if (_gameBoardSide[3]._outpostStation[i]._cardId != 0)
+ displayDialog(_gameBoardSide[3]._outpostStation[i]._cardId);
else
actionDisplay(1330, 22, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
case 15:
- if (_arrunkObj1337[0]._arr2[i]._field34 != 0)
- displayDialog(_arrunkObj1337[0]._arr2[i]._field34);
+ if (_gameBoardSide[0]._outpostStation[i]._cardId != 0)
+ displayDialog(_gameBoardSide[0]._outpostStation[i]._cardId);
else
actionDisplay(1330, 21, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
case 20:
- if (_arrunkObj1337[1]._arr2[i]._field34 != 0)
- displayDialog(_arrunkObj1337[1]._arr2[i]._field34);
+ if (_gameBoardSide[1]._outpostStation[i]._cardId != 0)
+ displayDialog(_gameBoardSide[1]._outpostStation[i]._cardId);
else
actionDisplay(1330, 23, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
default:
break;
}
- } else {
- if ( (subC2BF8(&_arrunkObj1337[2]._arr3[0], pt))
- || (subC2BF8(&_arrunkObj1337[0]._arr3[0], pt))
- || (subC2BF8(&_arrunkObj1337[1]._arr3[0], pt))
- || (subC2BF8(&_arrunkObj1337[3]._arr3[0], pt)) ) {
- found = true;
+ } else if ( _gameBoardSide[2]._delayCard.isIn(pt)
+ || _gameBoardSide[0]._delayCard.isIn(pt)
+ || _gameBoardSide[1]._delayCard.isIn(pt)
+ || _gameBoardSide[3]._delayCard.isIn(pt) ) {
+ switch (curReg) {
+ case 5:
+ if (_gameBoardSide[2]._delayCard._cardId != 0)
+ displayDialog(_gameBoardSide[2]._delayCard._cardId);
+ else
+ actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 10:
+ if (_gameBoardSide[3]._delayCard._cardId != 0)
+ displayDialog(_gameBoardSide[3]._delayCard._cardId);
+ else
+ actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 15:
+ if (_gameBoardSide[0]._delayCard._cardId != 0)
+ displayDialog(_gameBoardSide[0]._delayCard._cardId);
+ else
+ actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 20:
+ if (_gameBoardSide[1]._delayCard._cardId != 0)
+ displayDialog(_gameBoardSide[1]._delayCard._cardId);
+ else
+ actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ default:
+ break;
}
-
- if (found) {
- switch (curReg) {
- case 5:
- if (_arrunkObj1337[2]._arr3[0]._field34 != 0)
- displayDialog(_arrunkObj1337[2]._arr3[0]._field34);
- else
- actionDisplay(1330, 10, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 10:
- if (_arrunkObj1337[3]._arr3[0]._field34 != 0)
- displayDialog(_arrunkObj1337[3]._arr3[0]._field34);
- else
- actionDisplay(1330, 16, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 15:
- if (_arrunkObj1337[0]._arr3[0]._field34 != 0)
- displayDialog(_arrunkObj1337[3]._arr3[0]._field34);
- else
- actionDisplay(1330, 13, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 20:
- if (_arrunkObj1337[1]._arr3[0]._field34 != 0)
- displayDialog(_arrunkObj1337[1]._arr3[0]._field34);
- else
- actionDisplay(1330, 18, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- default:
- break;
- }
- } else {
- if (subC2BF8(&_item7, pt)) {
- if (_item7._field34 != 0)
- displayDialog(_item7._field34);
- else
- actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (_background1._bounds.contains(pt)) {
- actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (subC2BF8(&_item8, pt)) {
- actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if ( (subC2BF8(&_arrunkObj1337[2]._arr4[0], pt))
- || (subC2BF8(&_arrunkObj1337[3]._arr4[0], pt))
- || (subC2BF8(&_arrunkObj1337[0]._arr4[0], pt))
- || (subC2BF8(&_arrunkObj1337[1]._arr4[0], pt)) ) {
- actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else {
- if (subC2BF8(&_arrunkObj1337[2]._arr1[0], pt))
- displayDialog(_arrunkObj1337[2]._arr1[0]._field34);
- else if (subC2BF8(&_arrunkObj1337[2]._arr1[1], pt))
- displayDialog(_arrunkObj1337[2]._arr1[1]._field34);
- else if (subC2BF8(&_arrunkObj1337[2]._arr1[2], pt))
- displayDialog(_arrunkObj1337[2]._arr1[2]._field34);
- else if (subC2BF8(&_arrunkObj1337[2]._arr1[3], pt))
- displayDialog(_arrunkObj1337[2]._arr1[3]._field34);
- else if ((curReg >= 6) && (curReg <= 9))
- actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- else if ((curReg >= 11) && (curReg <= 14))
- actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- else if ((curReg >= 16) && (curReg <= 19))
- actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- else {
- switch (curReg) {
- case 0:
- actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105);
- break;
- case 5:
- actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 10:
- actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 15:
- actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 20:
- actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 21:
- actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- default:
- break;
- }
- }
- }
+ } else if (_discardPile.isIn(pt)) {
+ if (_discardPile._cardId != 0)
+ displayDialog(_discardPile._cardId);
+ else
+ actionDisplay(1330, 7, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (_helpIcon._bounds.contains(pt))
+ actionDisplay(1330, 43, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ else if (_stockCard.isIn(pt))
+ actionDisplay(1330, 4, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ else if ( (_gameBoardSide[2]._emptyStationPos.isIn(pt))
+ || (_gameBoardSide[3]._emptyStationPos.isIn(pt))
+ || (_gameBoardSide[0]._emptyStationPos.isIn(pt))
+ || (_gameBoardSide[1]._emptyStationPos.isIn(pt)) )
+ actionDisplay(1330, 32, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ else if (_gameBoardSide[2]._handCard[0].isIn(pt))
+ displayDialog(_gameBoardSide[2]._handCard[0]._cardId);
+ else if (_gameBoardSide[2]._handCard[1].isIn(pt))
+ displayDialog(_gameBoardSide[2]._handCard[1]._cardId);
+ else if (_gameBoardSide[2]._handCard[2].isIn(pt))
+ displayDialog(_gameBoardSide[2]._handCard[2]._cardId);
+ else if (_gameBoardSide[2]._handCard[3].isIn(pt))
+ displayDialog(_gameBoardSide[2]._handCard[3]._cardId);
+ else if ((curReg >= 6) && (curReg <= 9))
+ actionDisplay(1330, 29, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ else if ((curReg >= 11) && (curReg <= 14))
+ actionDisplay(1330, 31, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ else if ((curReg >= 16) && (curReg <= 19))
+ actionDisplay(1330, 30, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ else {
+ switch (curReg) {
+ case 0:
+ actionDisplay(1330, 2, 159, 134, 1, 200, 0, 7, 0, 105, 105);
+ break;
+ case 5:
+ actionDisplay(1330, 25, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 10:
+ actionDisplay(1330, 27, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 15:
+ actionDisplay(1330, 26, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 20:
+ actionDisplay(1330, 28, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 21:
+ actionDisplay(1330, 24, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ default:
+ break;
}
}
}
@@ -5748,8 +5545,8 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
return;
for (int i = 0; i <= 7; i++) {
- if (subC2BF8(&_arrunkObj1337[2]._arr2[i], pt)) {
- switch (_arrunkObj1337[2]._arr2[i]._field34) {
+ if (_gameBoardSide[2]._outpostStation[i].isIn(pt)) {
+ switch (_gameBoardSide[2]._outpostStation[i]._cardId) {
case 0:
actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
@@ -5760,10 +5557,10 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
}
- found = true;
- break;
- } else if (subC2BF8(&_arrunkObj1337[0]._arr2[i], pt)) {
- switch (_arrunkObj1337[0]._arr2[i]._field34) {
+ return;
+ }
+ if (_gameBoardSide[0]._outpostStation[i].isIn(pt)) {
+ switch (_gameBoardSide[0]._outpostStation[i]._cardId) {
case 0:
actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
@@ -5771,10 +5568,10 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154);
break;
}
- found = true;
- break;
- } else if (subC2BF8(&_arrunkObj1337[1]._arr2[i], pt)) {
- switch (_arrunkObj1337[1]._arr2[i]._field34) {
+ return;
+ }
+ if (_gameBoardSide[1]._outpostStation[i].isIn(pt)) {
+ switch (_gameBoardSide[1]._outpostStation[i]._cardId) {
case 0:
actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117);
break;
@@ -5782,10 +5579,10 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117);
break;
}
- found = true;
- break;
- } else if (subC2BF8(&_arrunkObj1337[3]._arr2[i], pt)) {
- switch (_arrunkObj1337[3]._arr2[i]._field34) {
+ return;
+ }
+ if (_gameBoardSide[3]._outpostStation[i].isIn(pt)) {
+ switch (_gameBoardSide[3]._outpostStation[i]._cardId) {
case 0:
actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172);
break;
@@ -5793,73 +5590,64 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172);
break;
}
- found = true;
- break;
+ return;
}
}
- if (subC2BF8(&_arrunkObj1337[2]._arr3[0], pt)) {
- if (_arrunkObj1337[0]._arr3[0]._field34 != 0) {
+ if (_gameBoardSide[2]._delayCard.isIn(pt)) {
+ // The original uses _gameBoardSide[0], which is obviously a bug.
+ if (_gameBoardSide[2]._delayCard._cardId != 0)
actionDisplay(1330, 39, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else {
+ else
actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- found = true;
- }
- if (subC2BF8(&_arrunkObj1337[3]._arr3[0], pt)) {
- if (_arrunkObj1337[3]._arr3[0]._field34 != 0) {
+ return;
+ }
+ if (_gameBoardSide[3]._delayCard.isIn(pt)) {
+ if (_gameBoardSide[3]._delayCard._cardId != 0)
actionDisplay(1330, 145, 20, 99, 1, 136, 0, 7, 0, 172, 172);
- } else {
+ else
actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172);
- }
- found = true;
- }
- if (subC2BF8(&_arrunkObj1337[1]._arr3[0], pt)) {
- if (_arrunkObj1337[1]._arr3[0]._field34 != 0) {
+ return;
+ }
+ if (_gameBoardSide[1]._delayCard.isIn(pt)) {
+ if (_gameBoardSide[1]._delayCard._cardId != 0)
actionDisplay(1330, 144, 300, 99, 1, 136, 0, 7, 0, 117, 117);
- } else {
+ else
actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117);
- }
- found = true;
- }
- if (subC2BF8(&_arrunkObj1337[0]._arr3[0], pt)) {
- if (_arrunkObj1337[0]._arr3[0]._field34 != 0) {
+ return;
+ }
+ if (_gameBoardSide[0]._delayCard.isIn(pt)) {
+ if (_gameBoardSide[0]._delayCard._cardId != 0)
actionDisplay(1330, 1, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else {
+ else
actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- found = true;
- }
- if (subC2BF8(&_arrunkObj1337[3]._arr4[0], pt)) {
+ return;
+ }
+ if (_gameBoardSide[3]._emptyStationPos.isIn(pt)) {
actionDisplay(1330, 147, 20, 99, 1, 136, 0, 7, 0, 172, 172);
- found = true;
+ return;
}
-
- if (subC2BF8(&_arrunkObj1337[1]._arr4[0], pt)) {
+ if (_gameBoardSide[1]._emptyStationPos.isIn(pt)) {
actionDisplay(1330, 146, 300, 99, 1, 136, 0, 7, 0, 117, 117);
- found = true;
+ return;
}
-
- if (subC2BF8(&_arrunkObj1337[0]._arr4[0], pt)) {
+ if (_gameBoardSide[0]._emptyStationPos.isIn(pt)) {
actionDisplay(1330, 11, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- found = true;
- }
-
- if (found)
return;
+ }
- if (_background1._bounds.contains(pt)) {
- subCD193();
+ if (_helpIcon._bounds.contains(pt)) {
+ showOptionsDialog();
return;
}
- if (subC2BF8(&_item7, pt))
+ if (_discardPile.isIn(pt))
actionDisplay(1330, 9, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- else if (subC2BF8(&_item8, pt))
+ else if (_stockCard.isIn(pt))
actionDisplay(1330, 5, 159, 10, 1, 200, 0, 7, 0, 154, 154);
else {
switch (curReg) {
@@ -5906,60 +5694,211 @@ void Scene1337::subCDB90(int arg1, Common::Point pt) {
}
}
-void Scene1337::subCF31D() {
- int tmpVal = 1;
- bool found;
- int count;
-
- if (this->_arrunkObj1337[1]._arr3[0]._field34 != 0) {
- switch (_arrunkObj1337[1]._arr3[0]._field34) {
+void Scene1337::handlePlayer0() {
+ if (_gameBoardSide[0]._delayCard._cardId != 0) {
+ switch (_gameBoardSide[0]._delayCard._cardId) {
case 10:
- // No break on purpose
+ //No break on purpose
case 12:
- // No break on purpose
+ //No break on purpose
case 15:
- // No break on purpose
+ //No break on purpose
case 17:
- // No break on purpose
+ //No break on purpose
case 18:
- // No break on purpose
+ //No break on purpose
case 19:
- // No break on purpose
+ //No break on purpose
case 20:
- // No break on purpose
+ //No break on purpose
case 21:
- tmpVal = 0;
- subC4A39(&_arrunkObj1337[1]._arr3[0]);
+ discardCard(&_gameBoardSide[0]._delayCard);
break;
default:
- found = false;
- int i;
- for (i = 0; i <= 3; i++) {
- if (subC3386(_arrunkObj1337[1]._arr3[0]._field34, _arrunkObj1337[1]._arr1[i]._field34)) {
- found = true;
+ for (int i = 0; i <= 3; i++) {
+ if (checkAntiDelayCard(_gameBoardSide[0]._delayCard._cardId, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playAntiDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[0]._delayCard);
+ return;
+ }
+ }
+
+ break;
+ }
+ }
+
+ for (int i = 0; i <= 3; i++) {
+ int tmpVal = getStationId(0, i);
+
+ if (tmpVal != -1) {
+ bool stationAlreadyPresentFl = false;
+ for (int j = 0; j <= 7; j++) {
+ if (_gameBoardSide[0]._outpostStation[j]._cardId == _gameBoardSide[0]._handCard[tmpVal]._cardId) {
+ stationAlreadyPresentFl = true;
break;
}
}
- if (found) {
- tmpVal = 0;
- subC34A1(&_arrunkObj1337[1]._arr1[i], &_arrunkObj1337[1]._arr3[0]);
+ if (!stationAlreadyPresentFl) {
+ for (int j = 0; j <= 7; j++) {
+ if ((_gameBoardSide[0]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) {
+ int stationCount = 0;
+ for (int k = 0; k <= 7; k++) {
+ if ((_gameBoardSide[0]._outpostStation[k]._cardId > 1) && (_gameBoardSide[0]._outpostStation[k]._cardId <= 9)) {
+ ++stationCount;
+ }
+ }
+
+ if (stationCount == 7)
+ _winnerId = 0;
+
+ playStationCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[j]);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ int tmpVal = findPlatformCardInHand(0);
+
+ if (tmpVal != -1) {
+ for (int i = 0; i <= 7; i++) {
+ if ((_gameBoardSide[0]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[0]._delayCard._cardId)) {
+ playPlatformCard(&_gameBoardSide[0]._handCard[tmpVal], &_gameBoardSide[0]._outpostStation[i]);
+ return;
}
}
}
- if (tmpVal != 1)
+ int card13Id = findCard13InHand(0);
+ if (card13Id != -1) {
+ for (int i = 0; i <= 7; i++) {
+ if (_gameBoardSide[2]._outpostStation[i]._cardId != 0) {
+ playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], 2);
+ return;
+ }
+ }
+ }
+
+ int thieftId = checkThieftCard(0);
+ if (thieftId != -1) {
+ if ( (_gameBoardSide[2]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[2]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[2]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[2]._handCard[3]._cardId != 0) ) {
+ playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 2);
+ return;
+ }
+ }
+
+ for (int i = 0; i <= 3; i++) {
+ if ((isDelayCard(_gameBoardSide[0]._handCard[i]._cardId) != -1)
+ && (_gameBoardSide[2]._delayCard._cardId == 0)
+ && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard);
+ return;
+ }
+ }
+
+ for (int i = 0; i <= 3; i++) {
+ if ((getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1)
+ && (_gameBoardSide[2]._delayCard._cardId == 0)
+ && isAttackPossible(2, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[2]._delayCard);
+ return;
+ }
+ }
+
+ card13Id = findCard13InHand(0);
+ int victimPlayerId = getPlayerWithOutpost(0);
+
+ if ((card13Id != -1) && (victimPlayerId != -1)) {
+ playCounterTrickCard(&_gameBoardSide[0]._handCard[card13Id], victimPlayerId);
return;
+ }
+
+ thieftId = checkThieftCard(0);
+ if (thieftId != -1) {
+ if ( (_gameBoardSide[1]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[1]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[1]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) {
+ playThieftCard(0, &_gameBoardSide[0]._handCard[thieftId], 1);
+ return;
+ }
+ }
+
+ for (int i = 0; i <= 3; i++) {
+ if (getStationCardId(_gameBoardSide[0]._handCard[i]._cardId) != -1) {
+ if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard);
+ return;
+ }
+
+ if ((_gameBoardSide[3]._delayCard._cardId == 0) && isAttackPossible(3, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard);
+ return;
+ }
+ }
+ }
+
+ for (int i = 0; i <= 3; i++) {
+ tmpVal = isDelayCard(_gameBoardSide[0]._handCard[i]._cardId);
+ if (tmpVal != -1) {
+ if ((_gameBoardSide[1]._delayCard._cardId == 0) && isAttackPossible(1, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[1]._delayCard);
+ return;
+ }
+
+ if ((_gameBoardSide[3]._delayCard._cardId == 0) && isAttackPossible(3, _gameBoardSide[0]._handCard[i]._cardId)) {
+ playDelayCard(&_gameBoardSide[0]._handCard[i], &_gameBoardSide[3]._delayCard);
+ return;
+ }
+ }
+ }
+
+ handlePlayer01Discard(0);
+}
+
+void Scene1337::handlePlayer1() {
+ if (this->_gameBoardSide[1]._delayCard._cardId != 0) {
+ switch (_gameBoardSide[1]._delayCard._cardId) {
+ case 10:
+ // No break on purpose
+ case 12:
+ // No break on purpose
+ case 15:
+ // No break on purpose
+ case 17:
+ // No break on purpose
+ case 18:
+ // No break on purpose
+ case 19:
+ // No break on purpose
+ case 20:
+ // No break on purpose
+ case 21:
+ discardCard(&_gameBoardSide[1]._delayCard);
+ return;
+ default:
+ for (int i = 0; i <= 3; i++) {
+ if (checkAntiDelayCard(_gameBoardSide[1]._delayCard._cardId, _gameBoardSide[1]._handCard[i]._cardId)) {
+ playAntiDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[1]._delayCard);
+ return;
+ }
+ }
+ break;
+ }
+ }
- found = false;
for (int i = 0; i <= 3; i++) {
- int tmpIndx = subC26CB(1, i);
+ int tmpIndx = getStationId(1, i);
if (tmpIndx == -1)
break;
- tmpVal = 0;
+ int tmpVal = 0;
for (int j = 0; j <= 7; j++) {
- if (_arrunkObj1337[1]._arr2[j]._field34 == _arrunkObj1337[1]._arr1[tmpIndx]._field34) {
+ if (_gameBoardSide[1]._outpostStation[j]._cardId == _gameBoardSide[1]._handCard[tmpIndx]._cardId) {
tmpVal = 1;
break;
}
@@ -5969,923 +5908,869 @@ void Scene1337::subCF31D() {
break;
for (int j = 0; j <= 7; j++) {
- if (_arrunkObj1337[1]._arr2[j]._field34 == 1) {
- if (!subC2687(_arrunkObj1337[1]._arr3[0]._field34)) {
- count = 0;
- for (int k = 0; k <= 7; k++) {
- if ((_arrunkObj1337[1]._arr2[k]._field34 > 1) && (_arrunkObj1337[1]._arr2[k]._field34 <= 9))
- ++count;
- }
+ if ((_gameBoardSide[1]._outpostStation[j]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[1]._delayCard._cardId)) {
+ int stationCount = 0;
+ for (int k = 0; k <= 7; k++) {
+ if ((_gameBoardSide[1]._outpostStation[k]._cardId > 1) && (_gameBoardSide[1]._outpostStation[k]._cardId <= 9))
+ ++stationCount;
+ }
- if (count == 7)
- _field424A = 1;
+ if (stationCount == 7)
+ _winnerId = 1;
- subC33C0(&_arrunkObj1337[1]._arr1[tmpIndx], &_arrunkObj1337[1]._arr2[j]);
- found = true;
- break;
- }
+ playStationCard(&_gameBoardSide[1]._handCard[tmpIndx], &_gameBoardSide[1]._outpostStation[j]);
+ return;
}
}
}
- if (found)
- return;
-
- tmpVal = subC2719(1);
- if (tmpVal != -1) {
+ int normalCardId = findPlatformCardInHand(1);
+ if (normalCardId != -1) {
for (int i = 0; i <= 7; i++) {
- if ((_arrunkObj1337[1]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[1]._arr3[0]._field34))) {
- subC340B(&_arrunkObj1337[1]._arr1[tmpVal], &_arrunkObj1337[1]._arr2[i]);
- found = true;
- break;
+ if ((_gameBoardSide[1]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[1]._delayCard._cardId)) {
+ playPlatformCard(&_gameBoardSide[1]._handCard[normalCardId], &_gameBoardSide[1]._outpostStation[i]);
+ return;
}
}
}
- if (found)
- return;
-
- tmpVal = subC274D(1);
- int tmpVal2 = subC331B(1);
+ int card13Id = findCard13InHand(1);
+ int tmpVal2 = getPlayerWithOutpost(1);
- if ((tmpVal != -1) && ( tmpVal2 != -1)) {
- subC358E(&_arrunkObj1337[1]._arr1[tmpVal], tmpVal2);
- found = true;
- }
-
- if (found)
+ if ((card13Id != -1) && (tmpVal2 != -1)) {
+ playCounterTrickCard(&_gameBoardSide[1]._handCard[card13Id], tmpVal2);
return;
+ }
- tmpVal = subC2781(1);
- if (tmpVal != -1) {
- count = -1;
+ int thieftId = checkThieftCard(1);
+ if (thieftId != -1) {
+ int playerIdFound = -1;
int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3);
for (int i = 0; i <= 3; i++) {
if (rndVal != 1) {
- if ( (_arrunkObj1337[rndVal]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[rndVal]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[rndVal]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[rndVal]._arr1[3]._field34 == 0)) {
- count = rndVal;
- break;
+ if ( (_gameBoardSide[rndVal]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[rndVal]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[rndVal]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[rndVal]._handCard[3]._cardId == 0)) {
+ playerIdFound = rndVal;
+ break;
}
- // CHECKME: inside the check on rndVal?
- rndVal--;
- if (rndVal < 0)
- rndVal = 3;
}
+ // The original was only updating in the rndVal block,
+ // which was a bug as the checks were stopping at this point
+ rndVal--;
+ if (rndVal < 0)
+ rndVal = 3;
}
- if (count != -1) {
- subC318B(1, &_arrunkObj1337[1]._arr1[tmpVal], count);
- found = true;
+ if (playerIdFound != -1) {
+ playThieftCard(1, &_gameBoardSide[1]._handCard[thieftId], playerIdFound);
+ return;
}
}
- if (found)
- return;
-
- count = -1;
+ int count = -1;
int i;
for (i = 0; i <= 3; i++) {
- tmpVal = subC27B5(_arrunkObj1337[1]._arr1[i]._field34);
+ int tmpVal = isDelayCard(_gameBoardSide[1]._handCard[i]._cardId);
if (tmpVal != -1) {
int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3);
for (int j = 0; j <= 3; j++) {
//CHECKME: tmpVal or rndVal?
if (tmpVal != 1) {
- for (int k = 0; k <= 7; k++) {
- // CHECKME: 'k' is not used in that loop.
- // It looks suspicious.
- if ((_arrunkObj1337[tmpVal]._arr3[0]._field34 == 0) && (subC32B1(tmpVal, _arrunkObj1337[1]._arr1[i]._field34))) {
- count = tmpVal;
- break;
- }
- }
+ if ((_gameBoardSide[tmpVal]._delayCard._cardId == 0) && isAttackPossible(tmpVal, _gameBoardSide[1]._handCard[i]._cardId))
+ count = tmpVal;
}
if (count != -1) {
- found = true;
- break;
+ playDelayCard(&_gameBoardSide[1]._handCard[i], &_gameBoardSide[count]._delayCard);
+ return;
} else {
rndVal--;
if (rndVal < 0)
rndVal = 3;
}
}
-
- if (found)
- break;
}
}
- if (found)
- subC3456(&_arrunkObj1337[1]._arr1[i], &_arrunkObj1337[count]._arr3[0]);
- else {
- int j;
- for (j = 0; j <= 3; j++) {
- if (subC27F9(_arrunkObj1337[1]._arr1[j]._field34) != -1) {
- count = -1;
- int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3);
- for (int l = 0; l <= 3; l++) {
- if (rndVal != 1) {
- for (int m = 0; m <= 7; m++) {
- // 'm' is not used in that loop. It looks suspicious.
- if ((_arrunkObj1337[rndVal]._arr3[0]._field34 == 0) && (_arrunkObj1337[1]._arr1[j]._field34 == 1)) {
- count = rndVal;
- break;
- }
- }
- }
- if (count != -1) {
- found = true;
- break;
- } else {
- rndVal--;
- if (rndVal < 0)
- rndVal = 3;
- }
+ int j;
+ for (j = 0; j <= 3; j++) {
+ if (getStationCardId(_gameBoardSide[1]._handCard[j]._cardId) != -1) {
+ count = -1;
+ int rndVal = R2_GLOBALS._randomSource.getRandomNumber(3);
+ for (int l = 0; l <= 3; l++) {
+ if (rndVal != 1) {
+ if ((_gameBoardSide[rndVal]._delayCard._cardId == 0) && (_gameBoardSide[1]._handCard[j]._cardId == 1))
+ count = rndVal;
+ }
+ if (count != -1) {
+ playDelayCard(&_gameBoardSide[1]._handCard[j], &_gameBoardSide[count]._delayCard);
+ return;
+ } else {
+ rndVal--;
+ if (rndVal < 0)
+ rndVal = 3;
}
- if (found)
- break;
}
}
-
- if (found)
- subC3456(&_arrunkObj1337[1]._arr1[j], &_arrunkObj1337[count]._arr3[0]);
- else
- subC2835(1);
}
+ handlePlayer01Discard(1);
}
-void Scene1337::subCF979() {
- bool found = true;
-
- if (_arrunkObj1337[0]._arr3[0]._field34 != 0) {
- switch (_arrunkObj1337[0]._arr3[0]._field34) {
+void Scene1337::handlePlayer3() {
+ if (_gameBoardSide[3]._delayCard._cardId != 0) {
+ switch (_gameBoardSide[3]._delayCard._cardId) {
case 10:
- //No break on purpose
+ // No break on purpose
case 12:
- //No break on purpose
+ // No break on purpose
case 15:
- //No break on purpose
+ // No break on purpose
case 17:
- //No break on purpose
+ // No break on purpose
case 18:
- //No break on purpose
+ // No break on purpose
case 19:
- //No break on purpose
+ // No break on purpose
case 20:
- //No break on purpose
+ // No break on purpose
case 21:
- subC4A39(&_arrunkObj1337[0]._arr3[0]);
- found = false;
- break;
+ discardCard(&_gameBoardSide[3]._delayCard);
+ return;
default:
- int i;
- found = false;
-
- for (i = 0; i <= 3; i++) {
- if (subC3386(_arrunkObj1337[0]._arr3[0]._field34, _arrunkObj1337[0]._arr1[i]._field34)) {
- found = true;
- break;
+ for (int i = 0; i <= 3; i++) {
+ if (checkAntiDelayCard(_gameBoardSide[3]._delayCard._cardId, _gameBoardSide[3]._handCard[i]._cardId)) {
+ playAntiDelayCard(&_gameBoardSide[3]._handCard[i], &_gameBoardSide[3]._delayCard);
+ return;
}
}
-
- if (found) {
- found = false;
- subC34A1(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[0]._arr3[0]);
- }
break;
}
}
- if (found)
- return;
-
- int tmpVal;
- found = false;
- for (int i = 0; i <= 3; i++) {
- tmpVal = subC26CB(0, i);
-
- if (tmpVal != -1) {
- bool flag = false;
- for (int j = 0; j <= 7; j++) {
- if (_arrunkObj1337[0]._arr2[j]._field34 == _arrunkObj1337[0]._arr1[tmpVal]._field34) {
- flag = true;
- break;
- }
- }
-
- if (!flag) {
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[0]._arr2[j]._field34 == 1) && (!subC2687(_arrunkObj1337[0]._arr3[0]._field34))) {
- int count = 0;
- for (int k = 0; k <= 7; k++) {
- if ((_arrunkObj1337[0]._arr2[k]._field34 > 1) && (_arrunkObj1337[0]._arr2[k]._field34 <= 9)) {
- ++count;
- }
- }
-
- if (count == 7)
- _field424A = 0;
-
- subC33C0(&_arrunkObj1337[0]._arr1[tmpVal], &_arrunkObj1337[0]._arr2[j]);
- found = true;
- }
- }
- }
- }
-
- if (found)
- break;
- }
-
- if (found)
- return;
-
- found = false;
- tmpVal = subC2719(0);
+ int randIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
- if (tmpVal != -1) {
+ if (_gameBoardSide[3]._handCard[randIndx]._cardId == 1) {
for (int i = 0; i <= 7; i++) {
- if ((_arrunkObj1337[0]._arr2[i]._field34 == 0) && (!subC2687(_arrunkObj1337[0]._arr3[0]._field34))) {
- subC340B(&_arrunkObj1337[0]._arr1[tmpVal], &_arrunkObj1337[0]._arr2[i]);
- found = true;
- break;
+ if ((_gameBoardSide[3]._outpostStation[i]._cardId == 0) && !isStopConstructionCard(_gameBoardSide[3]._delayCard._cardId)) {
+ playPlatformCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]);
+ return;
}
}
- }
-
- if (found)
- return;
-
- tmpVal = subC274D(0);
- if (tmpVal != -1) {
+ } else if (_gameBoardSide[3]._handCard[randIndx]._cardId <= 9) {
for (int i = 0; i <= 7; i++) {
- if (_arrunkObj1337[2]._arr2[i]._field34 != 0) {
- subC358E(&_arrunkObj1337[0]._arr1[tmpVal], 2);
- found = true;
- break;
+ if (_gameBoardSide[3]._outpostStation[i]._cardId == _gameBoardSide[3]._handCard[randIndx]._cardId) {
+ discardCard(&_gameBoardSide[3]._handCard[randIndx]);
+ return;
}
}
- }
-
- if (found)
- return;
- tmpVal = subC2781(0);
- if (tmpVal != -1) {
- if ( (_arrunkObj1337[2]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[2]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[2]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[2]._arr1[3]._field34 != 0) ) {
- subC318B(0, &_arrunkObj1337[0]._arr1[tmpVal], 2);
- found = true;
- }
- }
+ for (int i = 0; i <= 7; i++) {
+ if ((_gameBoardSide[3]._outpostStation[i]._cardId == 1) && !isStopConstructionCard(_gameBoardSide[3]._delayCard._cardId)) {
+ int stationCount = 0;
+ for (int j = 0; j <= 7; j++) {
+ if ((_gameBoardSide[3]._outpostStation[j]._cardId > 1) && (_gameBoardSide[3]._outpostStation[j]._cardId <= 9))
+ ++stationCount;
+ }
- if (found)
- return;
+ if (stationCount == 7)
+ _winnerId = 3;
- for (int i = 0; i <= 3; i++) {
- if (subC27B5(_arrunkObj1337[0]._arr1[i]._field34) != -1) {
- // The variable 'j' is not used in the inner code of the loop. It's suspect
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]);
- found = true;
- break;
- }
+ playStationCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[3]._outpostStation[i]);
+ return;
}
-
- if (found)
- break;
}
- }
+ } else if (_gameBoardSide[3]._handCard[randIndx]._cardId == 13) {
+ int victimId = getPlayerWithOutpost(3);
- if (found)
- return;
+ if (victimId != -1) {
+ playCounterTrickCard(&_gameBoardSide[3]._handCard[randIndx], victimId);
+ return;
+ }
+ } else if (_gameBoardSide[3]._handCard[randIndx]._cardId == 25) {
+ int victimId = -1;
+ int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
- for (int i = 0; i <= 3; i++) {
- if (subC27F9(_arrunkObj1337[0]._arr1[i]._field34) != -1) {
- // The variable 'j' is not used in the inner code of the loop. It's suspect
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[2]._arr3[0]._field34 == 0) && (subC32B1(2, _arrunkObj1337[0]._arr1[i]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[2]._arr3[0]);
- found = true;
- }
+ for (int i = 0; i <= 3; i++) {
+ if ( (tmpRandIndx != 3)
+ && ( (_gameBoardSide[tmpRandIndx]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[tmpRandIndx]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[tmpRandIndx]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[tmpRandIndx]._handCard[3]._cardId != 0) )) {
+ victimId = tmpRandIndx;
+ break;
}
- if (found)
- break;
+ ++tmpRandIndx;
+ if (tmpRandIndx > 3)
+ tmpRandIndx = 0;
}
- }
-
- if (found)
- return;
-
- tmpVal = subC274D(0);
- int tmpVal2 = subC331B(0);
-
- if ((tmpVal != -1) && (tmpVal2 != -1)) {
- subC358E(&_arrunkObj1337[0]._arr1[tmpVal], tmpVal2);
- found = true;
- }
- if (found)
- return;
-
- tmpVal = subC2781(0);
- if (tmpVal != -1) {
- if ( (_arrunkObj1337[1]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[1]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[1]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[1]._arr1[3]._field34 != 0) ) {
- subC318B(0, &_arrunkObj1337[0]._arr1[tmpVal], 1);
- found = true;
+ if (victimId != -1) {
+ playThieftCard(3, &_gameBoardSide[3]._handCard[randIndx], victimId);
+ return;
}
- }
-
- if (found)
- return;
-
- for (int i = 0; i <= 3; i++) {
- tmpVal = subC27F9(_arrunkObj1337[0]._arr1[i]._field34);
- if (tmpVal != -1) {
- // The variable 'j' is not used in the inner code of the loop. It's suspect.
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[1]._arr3[0]._field34 == 0) && (subC32B1(1, _arrunkObj1337[0]._arr1[i]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[1]._arr3[0]);
- found = true;
- }
- }
+ } else {
+ switch (_gameBoardSide[3]._handCard[randIndx]._cardId) {
+ case 10:
+ // No break on purpose
+ case 11:
+ // No break on purpose
+ case 12:
+ // No break on purpose
+ case 14:
+ // No break on purpose
+ case 15:
+ // No break on purpose
+ case 16:
+ // No break on purpose
+ case 17:
+ // No break on purpose
+ case 18:
+ // No break on purpose
+ case 19:
+ // No break on purpose
+ case 20:
+ // No break on purpose
+ case 21:
+ // No break on purpose
+ case 24: {
+ int victimId = -1;
+ int tmpRandIndx = R2_GLOBALS._randomSource.getRandomNumber(3);
- if (!found) {
- // The variable 'j' is not used in the inner code of the loop. It's suspect.
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[3]._arr3[0]._field34 == 0) && (subC32B1(3, _arrunkObj1337[0]._arr1[i]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[3]._arr3[0]);
- found = true;
- }
+ for (int i = 0; i <= 3; i++) {
+ if (tmpRandIndx != 3) {
+ if ((_gameBoardSide[tmpRandIndx]._delayCard._cardId == 0)
+ && isAttackPossible(tmpRandIndx, _gameBoardSide[3]._handCard[randIndx]._cardId))
+ victimId = tmpRandIndx;
}
- }
- if (found)
- break;
- }
- }
-
- if (found)
- return;
+ ++tmpRandIndx;
+ if (tmpRandIndx > 3)
+ tmpRandIndx = 0;
- for (int i = 0; i <= 3; i++) {
- tmpVal = subC27B5(_arrunkObj1337[0]._arr1[i]._field34);
- if (tmpVal != -1) {
- // The variable 'j' is not used in the inner code of the loop. It's suspect.
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[1]._arr3[0]._field34 == 0) && (subC32B1(1, _arrunkObj1337[0]._arr1[i]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[1]._arr3[0]);
- found = true;
- }
+ if (victimId != -1)
+ break;
}
- if (!found) {
- // The variable 'j' is not used in the inner code of the loop. It's suspect.
- for (int j = 0; j <= 7; j++) {
- if ((_arrunkObj1337[3]._arr3[0]._field34 == 0) && (subC32B1(3, _arrunkObj1337[0]._arr1[i]._field34))) {
- subC3456(&_arrunkObj1337[0]._arr1[i], &_arrunkObj1337[3]._arr3[0]);
- found = true;
- }
- }
+ if (victimId != -1) {
+ // Useless second identical check skipped
+ playDelayCard(&_gameBoardSide[3]._handCard[randIndx], &_gameBoardSide[victimId]._delayCard);
+ return;
}
-
- if (found)
- break;
+ }
+ default:
+ break;
}
}
- if (found)
- return;
-
- subC2835(0);
+ discardCard(&_gameBoardSide[3]._handCard[randIndx]);
}
-void Scene1337::subD026D() {
- subD02CA();
-}
-
-void Scene1337::subD0281() {
- if (subC27F9(this->_arrunkObj1337[2]._arr3[0]._field34) == -1)
- _unkFctPtr412 = &Scene1337::subD026D;
+void Scene1337::handleAutoplayPlayer2() {
+ if (getStationCardId(this->_gameBoardSide[2]._delayCard._cardId) == -1)
+ _delayedFunction = &Scene1337::handlePlayer2;
else
- subC4A39(&_arrunkObj1337[2]._arr3[0]);
+ discardCard(&_gameBoardSide[2]._delayCard);
}
-void Scene1337::subD02CA() {
- _item6._field36 = g_globals->_events._mousePos;
+void Scene1337::handlePlayer2() {
+ _selectedCard._stationPos = g_globals->_events._mousePos;
if (R2_GLOBALS._v57810 == 200) {
- int di;
- for (di = 0; di < 4; di++) {
- if ((subC2BF8(&_arrunkObj1337[2]._arr1[di], _item6._field36) != 0) && (_arrunkObj1337[2]._arr1[di]._field34 != 0)) {
- _item6._field34 = _arrunkObj1337[2]._arr1[di]._field34;
- _item6._field36 = _arrunkObj1337[2]._arr1[di]._field36;
- // _item6._actorName = _arrunkObj1337[2]._arr1[di]._actorName;
- _item6._fieldE = _arrunkObj1337[2]._arr1[di]._fieldE;
- _item6._field10 = _arrunkObj1337[2]._arr1[di]._field10;
- warning("_item6._field12 = _arrunkObj1337[2]._arr1[di]._field12;");
- warning("_item6._field14 = _arrunkObj1337[2]._arr1[di]._field14;");
- warning("_item6._field16 = _arrunkObj1337[2]._arr1[di]._field16;");
- _item6._sceneRegionId = _arrunkObj1337[2]._arr1[di]._sceneRegionId;
- _item6._position = _arrunkObj1337[2]._arr1[di]._position;
- _item6._yDiff = _arrunkObj1337[2]._arr1[di]._yDiff;
- _item6._bounds = _arrunkObj1337[2]._arr1[di]._bounds;
- _item6._resNum = _arrunkObj1337[2]._arr1[di]._resNum;
- _item6._lookLineNum = _arrunkObj1337[2]._arr1[di]._lookLineNum;
- _item6._talkLineNum = _arrunkObj1337[2]._arr1[di]._talkLineNum;
- _item6._useLineNum = _arrunkObj1337[2]._arr1[di]._useLineNum;
- _item6._action = _arrunkObj1337[2]._arr1[di]._action;
- warning("_item6._field0 = _arrunkObj1337[2]._arr1[di]._field0;");
- _item6._object1._updateStartFrame = _arrunkObj1337[2]._arr1[di]._object1._updateStartFrame;
- _item6._object1._walkStartFrame = _arrunkObj1337[2]._arr1[di]._object1._walkStartFrame;
+ // Hand
+ int i;
+ for (i = 0; i < 4; i++) {
+ if ((_gameBoardSide[2]._handCard[i].isIn(_selectedCard._stationPos)) && (_gameBoardSide[2]._handCard[i]._cardId != 0)) {
+ Card *handcard = &_gameBoardSide[2]._handCard[i];
+ _selectedCard._cardId = handcard->_cardId;
+ _selectedCard._stationPos = handcard->_stationPos;
+ //warning("_selectedCard._actorName = handcard->_actorName;");
+ //warning("_selectedCard._fieldE = handcard->_fieldE;");
+ //warning("_selectedCard._field10 = handcard->_field10;");
+ //warning("_selectedCard._field12 = handcard->_field12;");
+ //warning("_selectedCard._field14 = handcard->_field14;");
+ //warning("_selectedCard._field16 = handcard->_field16;");
+ _selectedCard._sceneRegionId = handcard->_sceneRegionId;
+ _selectedCard._position = handcard->_position;
+ _selectedCard._yDiff = handcard->_yDiff;
+ _selectedCard._bounds = handcard->_bounds;
+ _selectedCard._resNum = handcard->_resNum;
+ _selectedCard._lookLineNum = handcard->_lookLineNum;
+ _selectedCard._talkLineNum = handcard->_talkLineNum;
+ _selectedCard._useLineNum = handcard->_useLineNum;
+ _selectedCard._action = handcard->_action;
+ //warning("_selectedCard._field0 = handcard->_field0;");
+ _selectedCard._card._updateStartFrame = handcard->_card._updateStartFrame;
+ _selectedCard._card._walkStartFrame = handcard->_card._walkStartFrame;
// _field2E is named _field3C in R2R
- _item6._object1._field2E = _arrunkObj1337[2]._arr1[di]._object1._field2E;
- _item6._object1._percent = _arrunkObj1337[2]._arr1[di]._object1._percent;
- _item6._object1._priority = _arrunkObj1337[2]._arr1[di]._object1._priority;
- _item6._object1._angle = _arrunkObj1337[2]._arr1[di]._object1._angle;
- _item6._object1._flags = _arrunkObj1337[2]._arr1[di]._object1._flags;
- _item6._object1._xe = _arrunkObj1337[2]._arr1[di]._object1._xe;
- _item6._object1._xs = _arrunkObj1337[2]._arr1[di]._object1._xs;
- _item6._object1._paneRects[0] = _arrunkObj1337[2]._arr1[di]._object1._paneRects[0];
- _item6._object1._paneRects[1] = _arrunkObj1337[2]._arr1[di]._object1._paneRects[1];
- _item6._object1._visage = _arrunkObj1337[2]._arr1[di]._object1._visage;
- _item6._object1._objectWrapper = _arrunkObj1337[2]._arr1[di]._object1._objectWrapper;
- _item6._object1._strip = _arrunkObj1337[2]._arr1[di]._object1._strip;
- _item6._object1._animateMode = _arrunkObj1337[2]._arr1[di]._object1._animateMode;
- _item6._object1._frame = _arrunkObj1337[2]._arr1[di]._object1._frame;
- _item6._object1._endFrame = _arrunkObj1337[2]._arr1[di]._object1._endFrame;
+ _selectedCard._card._oldPosition = handcard->_card._oldPosition;
+ _selectedCard._card._percent = handcard->_card._percent;
+ _selectedCard._card._priority = handcard->_card._priority;
+ _selectedCard._card._angle = handcard->_card._angle;
+ _selectedCard._card._flags = handcard->_card._flags;
+ _selectedCard._card._xe = handcard->_card._xe;
+ _selectedCard._card._xs = handcard->_card._xs;
+ _selectedCard._card._paneRects[0] = handcard->_card._paneRects[0];
+ _selectedCard._card._paneRects[1] = handcard->_card._paneRects[1];
+ _selectedCard._card._visage = handcard->_card._visage;
+ _selectedCard._card._objectWrapper = handcard->_card._objectWrapper;
+ _selectedCard._card._strip = handcard->_card._strip;
+ _selectedCard._card._animateMode = handcard->_card._animateMode;
+ _selectedCard._card._frame = handcard->_card._frame;
+ _selectedCard._card._endFrame = handcard->_card._endFrame;
// _field68 is named _field76 in R2R
- _item6._object1._field68 = _arrunkObj1337[2]._arr1[di]._object1._field68;
- _item6._object1._frameChange = _arrunkObj1337[2]._arr1[di]._object1._frameChange;
- _item6._object1._numFrames = _arrunkObj1337[2]._arr1[di]._object1._numFrames;
- _item6._object1._regionIndex = _arrunkObj1337[2]._arr1[di]._object1._regionIndex;
- _item6._object1._mover = _arrunkObj1337[2]._arr1[di]._object1._mover;
- _item6._object1._moveDiff = _arrunkObj1337[2]._arr1[di]._object1._moveDiff;
- _item6._object1._moveRate = _arrunkObj1337[2]._arr1[di]._object1._moveRate;
- _item6._object1._field8A = _arrunkObj1337[2]._arr1[di]._object1._field8A;
- _item6._object1._endAction = _arrunkObj1337[2]._arr1[di]._object1._endAction;
- _item6._object1._regionBitList = _arrunkObj1337[2]._arr1[di]._object1._regionBitList;
- // _item6._object1._actorName = _arrunkObj1337[2]._arr1[di]._object1._actorName;
- _item6._object1._fieldE = _arrunkObj1337[2]._arr1[di]._object1._fieldE;
- _item6._object1._field10 = _arrunkObj1337[2]._arr1[di]._object1._field10;
- warning("_item6._object1._field12 = _arrunkObj1337[2]._arr1[di]._object1._field12;");
- warning("_item6._object1._field14 = _arrunkObj1337[2]._arr1[di]._object1._field14;");
- warning("_item6._object1._field16 = _arrunkObj1337[2]._arr1[di]._object1._field16;");
- _item6._object1 = _arrunkObj1337[2]._arr1[di]._object1;
- }
- }
-
- if (di == 4) {
- subCDB90(1, _item6._field36);
- subD0281();
+ _selectedCard._card._loopCount = handcard->_card._loopCount;
+ _selectedCard._card._frameChange = handcard->_card._frameChange;
+ _selectedCard._card._numFrames = handcard->_card._numFrames;
+ _selectedCard._card._regionIndex = handcard->_card._regionIndex;
+ _selectedCard._card._mover = handcard->_card._mover;
+ _selectedCard._card._moveDiff = handcard->_card._moveDiff;
+ _selectedCard._card._moveRate = handcard->_card._moveRate;
+ _selectedCard._card._actorDestPos = handcard->_card._actorDestPos;
+ _selectedCard._card._endAction = handcard->_card._endAction;
+ _selectedCard._card._regionBitList = handcard->_card._regionBitList;
+ // _selectedCard._object1._actorName = handcard->_object1._actorName;
+ //warning("_selectedCard._card._fieldE = handcard->_card._fieldE;");
+ //warning("_selectedCard._card._field10 = handcard->_card._field10;");
+ //warning("_selectedCard._card._field12 = handcard->_card._field12;");
+ //warning("_selectedCard._card._field14 = handcard->_card._field14;");
+ //warning("_selectedCard._card._field16 = handcard->_card._field16;");
+
+ _gameBoardSide[2]._handCard[i]._cardId = 0;
+ _gameBoardSide[2]._handCard[i]._card.remove();
+ break;
+ }
+ }
+
+ if (i == 4) {
+ handleClick(1, _selectedCard._stationPos);
+ handleAutoplayPlayer2();
return;
+ } else {
+ setCursorData(1332, _selectedCard._card._strip, _selectedCard._card._frame);
+ R2_GLOBALS._sceneObjects->draw();
}
} else if (R2_GLOBALS._v57810 == 300) {
- subCDB90(3, _item6._field36);
- subD0281();
+ // Eye
+ handleClick(3, _selectedCard._stationPos);
+ handleAutoplayPlayer2();
return;
} else {
- subD1A48(R2_GLOBALS._v57810);
- subD0281();
+ // The original code is calling a function full of dead code.
+ // Only this message remains after a cleanup.
+ MessageDialog::show(WRONG_ANSWER_MSG, OK_BTN_STRING);
+ //
+ handleAutoplayPlayer2();
return;
}
- // That continues the block when R2_GLOBALS._v57810 == 200 and di != 4
- subD18B5(1332, _item6._object1._strip, _item6._object1._frame);
- R2_GLOBALS._sceneObjects->draw();
Event event;
- bool found = false;
- bool found_di;
+ bool found;
for (;;) {
if ( ((g_globals->_events.getEvent(event, EVENT_BUTTON_DOWN)) && (event.btnState == BTNSHIFT_RIGHT))
|| (g_globals->_events.getEvent(event, EVENT_KEYPRESS)) ){
- _item6._field36 = g_globals->_events._mousePos;
- found_di = false;
+ _selectedCard._stationPos = g_globals->_events._mousePos;
+ found = false;
for (int i = 0; i <= 3; i ++) {
- if (subC2BF8(&_arrunkObj1337[2]._arr1[i], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if (_arrunkObj1337[2]._arr1[i]._field34 == 0) {
- _arrunkObj1337[2]._arr1[i]._field34 = _item6._field34;
- _arrunkObj1337[2]._arr1[i]._object1.postInit();
- _arrunkObj1337[2]._arr1[i]._object1.hide();
- _arrunkObj1337[2]._arr1[i]._object1.setVisage(1332);
- _arrunkObj1337[2]._arr1[i]._object1.setPosition(_arrunkObj1337[2]._arr1[i]._field36, 0);
- _arrunkObj1337[2]._arr1[i]._object1.fixPriority(170);
- setAnimationInfo(&_arrunkObj1337[2]._arr1[i]);
- subD18B5(5, 1, 4);
- found = true;
- _field423E--;
- _field4244 = 0;
- subC20F9();
+ if (_gameBoardSide[2]._handCard[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if (_gameBoardSide[2]._handCard[i]._cardId == 0) {
+ _gameBoardSide[2]._handCard[i]._cardId = _selectedCard._cardId;
+ _gameBoardSide[2]._handCard[i]._card.postInit();
+ _gameBoardSide[2]._handCard[i]._card.hide();
+ _gameBoardSide[2]._handCard[i]._card.setVisage(1332);
+ _gameBoardSide[2]._handCard[i]._card.setPosition(_gameBoardSide[2]._handCard[i]._stationPos, 0);
+ _gameBoardSide[2]._handCard[i]._card.fixPriority(170);
+ setAnimationInfo(&_gameBoardSide[2]._handCard[i]);
+ setCursorData(5, 1, 4);
+ _currentPlayerNumb--;
+ _showPlayerTurn = false;
+ handleNextTurn();
+ return;
} else {
actionDisplay(1330, 127, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- found_di = true;
+ found = true;
}
break;
}
}
- if ((!found) && (!found_di)) {
- if (subC2BF8(&_item7, Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- subC4A39(&_item6);
- } else if (!found) {
- bool foundVar4;
+ if (!found) {
+ if (_discardPile.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ discardCard(&_selectedCard);
+ return;
+ } else if (_selectedCard._cardId == 1) {
+ bool isInCardFl = false;
int i;
- if (_item6._field34 == 1) {
- foundVar4 = false;
- for (i = 0; i <= 7; i++) {
- if (subC2BF8(&_arrunkObj1337[2]._arr2[i], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- foundVar4 = true;
- break;
- }
+ for (i = 0; i <= 7; i++) {
+ if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ isInCardFl = true;
+ break;
}
+ }
- if ((foundVar4) && (_arrunkObj1337[2]._arr2[i]._field34 == 0)) {
- if (subC27B5(_arrunkObj1337[2]._arr3[0]._field34) != -1) {
- actionDisplay(1330, 55, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else {
- subC340B(&_item6, &_arrunkObj1337[2]._arr2[i]);
- return;
- }
+ if ((isInCardFl) && (_gameBoardSide[2]._outpostStation[i]._cardId == 0)) {
+ if (isDelayCard(_gameBoardSide[2]._delayCard._cardId) != -1) {
+ actionDisplay(1330, 55, 159, 10, 1, 200, 0, 7, 0, 154, 154);
} else {
- actionDisplay(1330, 56, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ playPlatformCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]);
+ return;
}
- } else if (_item6._field34 <= 9) {
- foundVar4 = false;
- for (i = 0; i <= 7; i++) {
- if (subC2BF8(&_arrunkObj1337[2]._arr2[i], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- foundVar4 = true;
+ } else {
+ actionDisplay(1330, 56, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if (_selectedCard._cardId <= 9) {
+ bool isInCardFl = false;
+ int i;
+ for (i = 0; i <= 7; i++) {
+ if (_gameBoardSide[2]._outpostStation[i].isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ isInCardFl = true;
+ break;
+ }
+ }
+ if ((isInCardFl) && (_gameBoardSide[2]._outpostStation[i]._cardId == 1)) {
+ isInCardFl = false;
+ for (int j = 0; j <= 7; j++) {
+ if (_selectedCard._cardId == _gameBoardSide[2]._outpostStation[j]._cardId) {
+ isInCardFl = true;
break;
}
}
- if ((foundVar4) && (_arrunkObj1337[2]._arr2[i]._field34 == 1)) {
- foundVar4 = false;
- int j;
- for (j = 0; j <= 7; j++) {
- if (_item6._field34 == _arrunkObj1337[2]._arr2[j]._field34) {
- foundVar4 = true;
- break;
- }
+ if (isInCardFl) {
+ // This station is already in place
+ actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (isDelayCard(_gameBoardSide[2]._delayCard._cardId) != -1) {
+ // You must eliminate your delay before you can play a station
+ actionDisplay(1330, 35, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else {
+ int stationCount = 0;
+ for (int k = 0; k <= 7; k++) {
+ if ((_gameBoardSide[2]._outpostStation[k]._cardId > 1) && (_gameBoardSide[2]._outpostStation[k]._cardId <= 9))
+ ++stationCount;
}
- if (foundVar4) {
- actionDisplay(1330, 34, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (subC27B5(_arrunkObj1337[2]._arr3[0]._field34) != -1) {
- actionDisplay(1330, 35, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else {
- if (j == 7)
- _field424A = 2;
- subC33C0(&_item6, &_arrunkObj1337[2]._arr2[i]);
- return;
+ if (stationCount == 7)
+ _winnerId = 2;
+
+ playStationCard(&_selectedCard, &_gameBoardSide[2]._outpostStation[i]);
+ return;
+ }
+ } else {
+ actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if ((_selectedCard._cardId == 26) || (_selectedCard._cardId == 30) ||(_selectedCard._cardId == 32) || (_selectedCard._cardId == 28)) {
+ // Check anti-delay card
+ if (_gameBoardSide[2]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (checkAntiDelayCard(_gameBoardSide[2]._delayCard._cardId, _selectedCard._cardId)) {
+ playAntiDelayCard(&_selectedCard, &_gameBoardSide[2]._delayCard);
+ return;
+ } else {
+ if (_gameBoardSide[2]._delayCard._cardId != 0) {
+ switch (_gameBoardSide[2]._delayCard._cardId) {
+ case 11:
+ actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 14:
+ actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 16:
+ actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 24:
+ actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ default:
+ break;
}
} else {
- actionDisplay(1330, 37, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154);
}
- } else {
- if ((_item6._field34 == 26) || (_item6._field34 == 30) ||(_item6._field34 == 32) || (_item6._field34 == 28)) {
- if (subC2BF8(&_arrunkObj1337[2]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- actionDisplay(1330, 42, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (!subC3386(_arrunkObj1337[2]._arr3[0]._field34, _item6._field34)) {
- if (_arrunkObj1337[2]._arr3[0]._field34 != 0) {
- switch (_arrunkObj1337[2]._arr3[0]._field34) {
- case 11:
- actionDisplay(1330, 68, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 14:
- actionDisplay(1330, 80, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 16:
- actionDisplay(1330, 84, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 24:
- actionDisplay(1330, 96, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- default:
- break;
- }
- } else {
- actionDisplay(1330, 41, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if ((getStationCardId(_selectedCard._cardId) == -1) && (isDelayCard(_selectedCard._cardId) == -1)) {
+ if (_selectedCard._cardId == 13) {
+ if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ for (int k = 0; k <= 7; k++) {
+ if (_gameBoardSide[0]._outpostStation[k]._cardId != 0) {
+ playCounterTrickCard(&_selectedCard, 0);
+ return;
+ }
+ }
+ actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ for (int k = 0; k <= 7; k++) {
+ if (_gameBoardSide[3]._outpostStation[k]._cardId != 0) {
+ playCounterTrickCard(&_selectedCard, 3);
+ return;
+ }
+ }
+ actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ for (int k = 0; k <= 7; k++) {
+ if (_gameBoardSide[1]._outpostStation[k]._cardId == 0) {
+ playCounterTrickCard(&_selectedCard, 1);
+ return;
}
- } else {
- subC34A1(&_item6, &_arrunkObj1337[2]._arr3[0]);
- return;
}
+ actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
} else {
- if ((subC27F9(_item6._field34) == -1) && (subC27B5(_item6._field34) == -1)) {
- if (_item6._field34 == 13) {
- if (subC2BF8(&_arrunkObj1337[0]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- for (int k = 0; k <= 7; k++) {
- if (_arrunkObj1337[0]._arr2[k]._field34 != 0) {
- found = true;
- subC358E(&_item6, 0);
- }
- }
-
- if (!found)
- actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (subC2BF8(&_arrunkObj1337[3]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- for (int k = 0; k <= 7; k++) {
- if (_arrunkObj1337[3]._arr2[k]._field34 != 0) {
- found = true;
- subC358E(&_item6, 3);
- }
- }
- if (!found)
- actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (subC2BF8(&_arrunkObj1337[1]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- for (int k = 0; k <= 7; k++) {
- if (_arrunkObj1337[1]._arr2[k]._field34 == 0) {
- found = true;
- subC358E(&_item6, 1);
- }
- }
- if (!found)
- actionDisplay(1330, 74, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else {
- actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- } else if (_item6._field34 == 25) {
+ actionDisplay(1330, 128, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if (_selectedCard._cardId == 25) {
+ if (_gameBoardSide[0]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if ( (_gameBoardSide[0]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[0]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[0]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[0]._handCard[3]._cardId != 0) ) {
int k;
- if (subC2BF8(&_arrunkObj1337[0]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if ( (_arrunkObj1337[0]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[0]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[0]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[0]._arr1[3]._field34 != 0) ) {
- for (k = 0; k <= 3; k++){
- if (_arrunkObj1337[2]._arr1[k]._field34 == 0)
- break;
- }
- subC318B(2, &_arrunkObj1337[2]._arr1[k], 0);
- return;
- } else {
- actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- } else if (subC2BF8(&_arrunkObj1337[1]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if ( (_arrunkObj1337[1]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[1]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[1]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[1]._arr1[3]._field34 != 0) ) {
- for (k = 0; k <= 3; k++){
- if (_arrunkObj1337[2]._arr1[k]._field34 == 0)
- break;
- }
- subC318B(2, &_arrunkObj1337[2]._arr1[k], 1);
- return;
- } else {
- actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- }
-
- if (subC2BF8(&_arrunkObj1337[3]._arr4[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if ( (_arrunkObj1337[3]._arr1[0]._field34 != 0)
- || (_arrunkObj1337[3]._arr1[1]._field34 != 0)
- || (_arrunkObj1337[3]._arr1[2]._field34 != 0)
- || (_arrunkObj1337[3]._arr1[3]._field34 != 0) ) {
- for (k = 0; k <= 3; k++){
- if (_arrunkObj1337[2]._arr1[k]._field34 == 0)
- break;
- }
- subC318B(2, &_arrunkObj1337[2]._arr1[k], 3);
- return;
- } else {
- actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- } else {
- actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- } else if (_item6._field34 == 29) {
- actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (_item6._field34 == 27) {
- actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
- } else {
- if (subC2BF8(&_arrunkObj1337[0]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if (_arrunkObj1337[0]._arr3[0]._field34 != 0) {
- actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (!subC32B1(0, _item6._field34)) {
- switch (_item6._field34) {
- case 10:
- actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ for (k = 0; k <= 3; k++){
+ if (_gameBoardSide[2]._handCard[k]._cardId == 0)
break;
- case 12:
- actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 15:
- actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 17:
- actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 18:
- actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 19:
- actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 20:
- actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 21:
- actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- default:
- break;
- }
- } else {
- subC3456(&_item6, &_arrunkObj1337[0]._arr3[0]);
- found = true;
}
- } else if (subC2BF8(&_arrunkObj1337[3]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if (_arrunkObj1337[3]._arr3[0]._field34 != 0) {
- actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (!subC32B1(3, _item6._field34)) {
- switch (_item6._field34) {
- case 10:
- actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 12:
- actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 15:
- actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 17:
- actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 18:
- actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 19:
- actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 20:
- actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 21:
- actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- default:
+ playThieftCard(2, &_gameBoardSide[2]._handCard[k], 0);
+ return;
+ } else {
+ actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if (_gameBoardSide[1]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if ( (_gameBoardSide[1]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[1]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[1]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[1]._handCard[3]._cardId != 0) ) {
+ int k;
+ for (k = 0; k <= 3; k++){
+ if (_gameBoardSide[2]._handCard[k]._cardId == 0)
break;
- }
- } else {
- subC3456(&_item6, &_arrunkObj1337[3]._arr3[0]);
- found = true;
}
- } else if (subC2BF8(&_arrunkObj1337[1]._arr3[0], Common::Point(_item6._field36.x + 12, _item6._field36.y + 12)) != 0) {
- if (_arrunkObj1337[1]._arr3[0]._field34 != 0) {
- actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- } else if (!subC32B1(1, _item6._field34)) {
- switch (_item6._field34) {
- case 10:
- actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 12:
- actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 15:
- actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 17:
- actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 18:
- actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 19:
- actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 20:
- actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- case 21:
- actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- break;
- default:
+ playThieftCard(2, &_gameBoardSide[2]._handCard[k], 1);
+ return;
+ } else {
+ actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ }
+
+ if (_gameBoardSide[3]._emptyStationPos.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if ( (_gameBoardSide[3]._handCard[0]._cardId != 0)
+ || (_gameBoardSide[3]._handCard[1]._cardId != 0)
+ || (_gameBoardSide[3]._handCard[2]._cardId != 0)
+ || (_gameBoardSide[3]._handCard[3]._cardId != 0) ) {
+ int k;
+ for (k = 0; k <= 3; k++){
+ if (_gameBoardSide[2]._handCard[k]._cardId == 0)
break;
- }
- } else {
- subC3456(&_item6, &_arrunkObj1337[1]._arr3[0]);
- found = true;
}
- } else {
- actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154);
- }
+ playThieftCard(2, &_gameBoardSide[2]._handCard[k], 3);
+ return;
+ } else {
+ actionDisplay(1330, 99, 159, 10, 1, 200, 0, 7, 0, 154, 154);
}
+ } else {
+ actionDisplay(1330, 129, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if (_selectedCard._cardId == 29) {
+ // Interceptor cards are used to prevent collision
+ actionDisplay(1330, 136, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (_selectedCard._cardId == 27) {
+ actionDisplay(1330, 137, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ }
+ } else if (_gameBoardSide[0]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if (_gameBoardSide[0]._delayCard._cardId != 0) {
+ actionDisplay(1330, 15, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (!isAttackPossible(0, _selectedCard._cardId)) {
+ switch (_selectedCard._cardId) {
+ case 10:
+ actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 12:
+ actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 15:
+ actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 17:
+ actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 18:
+ actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 19:
+ actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 20:
+ actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 21:
+ actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ default:
+ break;
+ }
+ } else {
+ playDelayCard(&_selectedCard, &_gameBoardSide[0]._delayCard);
+ return;
+ }
+ } else if (_gameBoardSide[3]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if (_gameBoardSide[3]._delayCard._cardId != 0) {
+ actionDisplay(1330, 17, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (!isAttackPossible(3, _selectedCard._cardId)) {
+ switch (_selectedCard._cardId) {
+ case 10:
+ actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 12:
+ actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 15:
+ actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 17:
+ actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 18:
+ actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 19:
+ actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 20:
+ actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 21:
+ actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ default:
+ break;
+ }
+ } else {
+ playDelayCard(&_selectedCard, &_gameBoardSide[3]._delayCard);
+ return;
+ }
+ } else if (_gameBoardSide[1]._delayCard.isIn(Common::Point(_selectedCard._stationPos.x + 12, _selectedCard._stationPos.y + 12))) {
+ if (_gameBoardSide[1]._delayCard._cardId != 0) {
+ actionDisplay(1330, 19, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ } else if (!isAttackPossible(1, _selectedCard._cardId)) {
+ switch (_selectedCard._cardId) {
+ case 10:
+ actionDisplay(1330, 66, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 12:
+ actionDisplay(1330, 70, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 15:
+ actionDisplay(1330, 82, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 17:
+ actionDisplay(1330, 86, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 18:
+ actionDisplay(1330, 88, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 19:
+ actionDisplay(1330, 90, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 20:
+ actionDisplay(1330, 92, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ case 21:
+ actionDisplay(1330, 94, 159, 10, 1, 200, 0, 7, 0, 154, 154);
+ break;
+ default:
+ break;
}
+ } else {
+ playDelayCard(&_selectedCard, &_gameBoardSide[1]._delayCard);
+ return;
}
+ } else {
+ actionDisplay(1330, 38, 159, 10, 1, 200, 0, 7, 0, 154, 154);
}
}
-
- if (found)
- return;
} else {
g_globals->_scenePalette.signalListeners();
R2_GLOBALS._sceneObjects->draw();
g_globals->_events.delay(g_globals->_sceneHandler->_delayTicks);
}
+
+ g_globals->_sceneObjects->recurse(SceneHandler::dispatchObject);
}
}
-void Scene1337::subD183F(int arg1, int arg2) {
+void Scene1337::updateCursorId(int cursorId, bool updateFl) {
if ((R2_GLOBALS._v57709 != 0) || (R2_GLOBALS._v5780C != 0))
return;
- R2_GLOBALS._v5780E = arg1 + arg2;
+ R2_GLOBALS._mouseCursorId = cursorId;
- if (arg2 != 0) {
- if (R2_GLOBALS._v5780E < 1)
- R2_GLOBALS._v5780E = 2;
+ if (updateFl) {
+ R2_GLOBALS._mouseCursorId++;
- if (R2_GLOBALS._v5780E > 2)
- R2_GLOBALS._v5780E = 1;
+ if (R2_GLOBALS._mouseCursorId < 1)
+ R2_GLOBALS._mouseCursorId = 2;
+
+ if (R2_GLOBALS._mouseCursorId > 2)
+ R2_GLOBALS._mouseCursorId = 1;
}
- if (R2_GLOBALS._v5780E == 1) {
+ // The original was using an intermediate function to call setCursorData.
+ // It has been removed to improve readability
+ if (R2_GLOBALS._mouseCursorId == 1) {
R2_GLOBALS._v57810 = 200;
- subD195F(1, 4);
- } else if (R2_GLOBALS._v5780E == 2) {
+ setCursorData(5, 1, 4);
+ } else if (R2_GLOBALS._mouseCursorId == 2) {
R2_GLOBALS._v57810 = 300;
- subD195F(1, 5);
+ setCursorData(5, 1, 5);
} else {
R2_GLOBALS._v57810 = 0;
- subD195F(0, 0);
+ setCursorData(5, 0, 0);
}
}
-void Scene1337::subD18B5(int resNum, int rlbNum, int arg3) {
- warning("STUBBED lvl3 Scene1337::subD18B5()");
+void Scene1337::setCursorData(int resNum, int rlbNum, int frameNum) {
+ _cursorCurRes = resNum;
+ _cursorCurStrip = rlbNum;
+ _cursorCurFrame = frameNum;
+
+ if (!frameNum) {
+ // Should be a hardcoded cursor displaying only a dot.
+ // FIXME: Use another cursor when possible
+ R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
+ } else {
+ // TODO: The original was using some ressource caching, which was useless and complex
+ // and which has been removed. This cursor behavior clearly made intensive use of this caching...
+ // We now have to find a way to cache these cursor pointers and avoid loading them multiple times per seconds
+ uint size;
+ byte *cursor = g_resourceManager->getSubResource(resNum, rlbNum, frameNum, &size);
+ // Decode the cursor
+ GfxSurface s = surfaceFromRes(cursor);
+
+ Graphics::Surface surface = s.lockSurface();
+ const byte *cursorData = (const byte *)surface.getPixels();
+ CursorMan.replaceCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor);
+ s.unlockSurface();
+
+ DEALLOCATE(cursor);
+ }
}
-int Scene1337::subD18F5() {
+void Scene1337::subD18F5() {
if (R2_GLOBALS._v57709 == 0)
- // The cursor looks... very dummy
- // To be checked
- warning("TODO: CursorManager.setData(R2_GLOBALS.off_57705)");
+ R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
++R2_GLOBALS._v57709;
-
- return R2_GLOBALS._v57709;
}
-int Scene1337::subD1917() {
+void Scene1337::subD1917() {
if (R2_GLOBALS._v57709 != 0) {
R2_GLOBALS._v57709--;
- if (R2_GLOBALS._v57709 != 0)
- warning("FIXME: subD195F(_width, _data);");
+ if (R2_GLOBALS._v57709 != 0) {
+ // The original was using an intermediate function to call setCursorData.
+ // It has been removed to improve readability
+ setCursorData(5, _cursorCurStrip, _cursorCurFrame);
+ }
}
-
- return R2_GLOBALS._v57709;
}
-int Scene1337::subD1940(bool flag) {
+void Scene1337::subD1940(bool flag) {
if (flag)
++R2_GLOBALS._v5780C;
else if (R2_GLOBALS._v5780C != 0)
--R2_GLOBALS._v5780C;
-
- return R2_GLOBALS._v5780C;
-}
-
-void Scene1337::subD195F(int arg1, int arg2) {
- subD18B5(5, arg1, arg2);
}
void Scene1337::subD1975(int arg1, int arg2) {
warning("STUBBED lvl2 Scene1337::subD1975()");
}
-void Scene1337::subD1A48(int arg1) {
- int tmpVal = -1;
+void Scene1337::OptionsDialog::show() {
+ OptionsDialog *dlg = new OptionsDialog();
+ dlg->draw();
- switch (arg1) {
- case 200:
- tmpVal = 141;
- break;
- case 300:
- tmpVal = 142;
- break;
- default:
- MessageDialog::show(WRONG_ANSWER_MSG, OK_BTN_STRING);
- break;
- }
+ // Show the dialog
+ GfxButton *btn = dlg->execute(NULL);
- if (tmpVal == -1)
- return;
+ // Figure out the new selected character
+ if (btn == &dlg->_quitGame)
+ R2_GLOBALS._sceneManager.changeScene(125);
+ else if (btn == &dlg->_restartGame)
+ R2_GLOBALS._sceneManager.changeScene(1330);
+
+ // Remove the dialog
+ dlg->remove();
+ delete dlg;
+}
- actionDisplay(1330, tmpVal, -1, -1, 1, 220, 1, 5, 0, 105, 0);
+Scene1337::OptionsDialog::OptionsDialog() {
+ // Set the elements text
+ Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
+ _autoplay.setText(scene->_autoplay ? AUTO_PLAY_ON : AUTO_PLAY_OFF);
+ _restartGame.setText(START_NEW_CARD_GAME);
+ _quitGame.setText(QUIT_CARD_GAME);
+ _continueGame.setText(CONTINUE_CARD_GAME);
+
+ // Set position of the elements
+ _autoplay._bounds.moveTo(5, 2);
+ _restartGame._bounds.moveTo(5, _autoplay._bounds.bottom + 2);
+ _quitGame._bounds.moveTo(5, _restartGame._bounds.bottom + 2);
+ _continueGame._bounds.moveTo(5, _quitGame._bounds.bottom + 2);
+
+ // Add the items to the dialog
+ addElements(&_autoplay, &_restartGame, &_quitGame, &_continueGame, NULL);
+
+ // Set the dialog size and position
+ frame();
+ _bounds.collapse(-6, -6);
+ setCenter(160, 100);
+}
+
+GfxButton *Scene1337::OptionsDialog::execute(GfxButton *defaultButton) {
+ _gfxManager.activate();
+
+ // Event loop
+ GfxButton *selectedButton = NULL;
+
+ bool breakFlag = false;
+ while (!g_vm->shouldQuit() && !breakFlag) {
+ Event event;
+ while (g_globals->_events.getEvent(event) && !breakFlag) {
+ // Adjust mouse positions to be relative within the dialog
+ event.mousePos.x -= _gfxManager._bounds.left;
+ event.mousePos.y -= _gfxManager._bounds.top;
+
+ for (GfxElementList::iterator i = _elements.begin(); i != _elements.end(); ++i) {
+ if ((*i)->process(event))
+ selectedButton = static_cast<GfxButton *>(*i);
+ }
+
+ if (selectedButton == &_autoplay) {
+ // Toggle Autoplay
+ selectedButton = NULL;
+ Scene1337 *scene = (Scene1337 *)R2_GLOBALS._sceneManager._scene;
+ scene->_autoplay = !scene->_autoplay;
+
+ _autoplay.setText(scene->_autoplay ? AUTO_PLAY_ON : AUTO_PLAY_OFF);
+ _autoplay.draw();
+ } else if (selectedButton) {
+ breakFlag = true;
+ break;
+ } else if (!event.handled) {
+ if ((event.eventType == EVENT_KEYPRESS) && (event.kbd.keycode == Common::KEYCODE_ESCAPE)) {
+ selectedButton = NULL;
+ breakFlag = true;
+ break;
+ }
+ }
+ }
+
+ g_system->delayMillis(10);
+ GLOBALS._screenSurface.updateScreen();
+ }
+
+ _gfxManager.deactivate();
+ return selectedButton;
}
/*--------------------------------------------------------------------------
@@ -6952,6 +6837,7 @@ void Scene1500::postInit(SceneObjectList *OwnerList) {
_sceneMode = 0;
R2_GLOBALS._sound1.play(102);
}
+
signal();
}
@@ -8786,12 +8672,10 @@ void Scene1550::enterArea() {
R2_GLOBALS._sceneManager._hasPalette = false;
_wallType = 0;
}
- } else {
- if (_screenNumber == 1234) {
- R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE;
- loadScene(1550);
- R2_GLOBALS._sceneManager._hasPalette = false;
- }
+ } else if (_screenNumber == 1234) {
+ R2_GLOBALS._sceneManager._fadeMode = FADEMODE_IMMEDIATE;
+ loadScene(1550);
+ R2_GLOBALS._sceneManager._hasPalette = false;
}
if (_screenNumber == 1234)
@@ -10175,7 +10059,7 @@ void Scene1625::signal() {
break;
}
//_field412 = _stripManager._field2E8;
- _stripManager._field2E8 = 0;
+ _stripManager._currObj44Id = 0;
break;
case 1625:
_tealHead.postInit();
@@ -11259,30 +11143,28 @@ bool Scene1800::PassengerDoor::startAction(CursorType action, Event &event) {
}
}
}
+ } else if (scene->_leftStaircase._frame == 1) {
+ return SceneActor::startAction(action, event);
} else {
- if (scene->_leftStaircase._frame == 1) {
- return SceneActor::startAction(action, event);
+ R2_GLOBALS.clearFlag(29);
+ R2_GLOBALS._player.disableControl();
+ if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ if (R2_GLOBALS.getFlag(14)) {
+ scene->_sceneMode = 2;
+ scene->setAction(&scene->_sequenceManager, scene, 1809, &scene->_companion, &scene->_doors, NULL);
+ R2_GLOBALS.clearFlag(14);
+ } else {
+ scene->_sceneMode = 1806;
+ scene->setAction(&scene->_sequenceManager, scene, 1806, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL);
+ }
} else {
- R2_GLOBALS.clearFlag(29);
- R2_GLOBALS._player.disableControl();
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- if (R2_GLOBALS.getFlag(14)) {
- scene->_sceneMode = 2;
- scene->setAction(&scene->_sequenceManager, scene, 1809, &scene->_companion, &scene->_doors, NULL);
- R2_GLOBALS.clearFlag(14);
- } else {
- scene->_sceneMode = 1806;
- scene->setAction(&scene->_sequenceManager, scene, 1806, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL);
- }
+ if (R2_GLOBALS.getFlag(14)) {
+ scene->_sceneMode = 2;
+ scene->setAction(&scene->_sequenceManager, scene, 1809, &R2_GLOBALS._player, &scene->_doors, NULL);
+ R2_GLOBALS.clearFlag(14);
} else {
- if (R2_GLOBALS.getFlag(14)) {
- scene->_sceneMode = 2;
- scene->setAction(&scene->_sequenceManager, scene, 1809, &R2_GLOBALS._player, &scene->_doors, NULL);
- R2_GLOBALS.clearFlag(14);
- } else {
- scene->_sceneMode = 1807;
- scene->setAction(&scene->_sequenceManager, scene, 1807, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL);
- }
+ scene->_sceneMode = 1807;
+ scene->setAction(&scene->_sequenceManager, scene, 1807, &R2_GLOBALS._player, &scene->_companion, &scene->_rightDoor, NULL);
}
}
}
@@ -11439,14 +11321,12 @@ void Scene1800::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._walkRegions.disableRegion(10);
R2_GLOBALS._walkRegions.disableRegion(11);
}
+ } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ R2_GLOBALS._player.setPosition(Common::Point(140, 160));
+ _companion.setPosition(Common::Point(180, 160));
} else {
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- R2_GLOBALS._player.setPosition(Common::Point(140, 160));
- _companion.setPosition(Common::Point(180, 160));
- } else {
- R2_GLOBALS._player.setPosition(Common::Point(180, 160));
- _companion.setPosition(Common::Point(140, 160));
- }
+ R2_GLOBALS._player.setPosition(Common::Point(180, 160));
+ _companion.setPosition(Common::Point(140, 160));
}
_playerShadow.postInit();
@@ -11501,23 +11381,19 @@ void Scene1800::postInit(SceneObjectList *OwnerList) {
_sceneMode = 1815;
setAction(&_sequenceManager, this, 1815, &R2_GLOBALS._player, &_companion, &_leftDoor, NULL);
}
+ } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ _sceneMode = 1816;
+ setAction(&_sequenceManager, this, 1816, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL);
} else {
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- _sceneMode = 1816;
- setAction(&_sequenceManager, this, 1816, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL);
- } else {
- _sceneMode = 1817;
- setAction(&_sequenceManager, this, 1817, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL);
- }
+ _sceneMode = 1817;
+ setAction(&_sequenceManager, this, 1817, &R2_GLOBALS._player, &_companion, &_rightDoor, NULL);
}
+ } else if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
+ _sceneMode = 1800;
+ setAction(&_sequenceManager, this, 1800, &R2_GLOBALS._player, &_companion, NULL);
} else {
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- _sceneMode = 1800;
- setAction(&_sequenceManager, this, 1800, &R2_GLOBALS._player, &_companion, NULL);
- } else {
- _sceneMode = 1801;
- setAction(&_sequenceManager, this, 1801, &R2_GLOBALS._player, &_companion, NULL);
- }
+ _sceneMode = 1801;
+ setAction(&_sequenceManager, this, 1801, &R2_GLOBALS._player, &_companion, NULL);
}
R2_GLOBALS._player._oldCharacterScene[R2_QUINN] = 1800;
@@ -11564,7 +11440,7 @@ void Scene1800::signal() {
_sceneMode = 14;
R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
R2_GLOBALS._player.setup(1801, 7, 1);
- R2_GLOBALS._player.animate(ANIM_MODE_8, NULL);
+ R2_GLOBALS._player.animate(ANIM_MODE_8, 0, NULL);
_stripManager.start(550, this);
break;
case 14:
@@ -11584,7 +11460,7 @@ void Scene1800::signal() {
_sceneMode = 24;
R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
R2_GLOBALS._player.setup(1801, 5, 1);
- R2_GLOBALS._player.animate(ANIM_MODE_8, NULL);
+ R2_GLOBALS._player.animate(ANIM_MODE_8, 0, NULL);
_stripManager.start(550, this);
break;
case 24:
@@ -11615,16 +11491,7 @@ void Scene1800::signal() {
R2_GLOBALS._walkRegions.disableRegion(10);
R2_GLOBALS._walkRegions.disableRegion(11);
R2_GLOBALS.setFlag(63);
-
- // The following check is completely dumb.
- // Either an original bug, or dead code.
- if (R2_GLOBALS.getFlag(63)) {
- R2_GLOBALS._player.enableControl(CURSOR_WALK);
- } else {
- _sceneMode = 10;
- R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
- _stripManager.start(545, this);
- }
+ R2_GLOBALS._player.enableControl(CURSOR_WALK);
break;
case 1802:
R2_GLOBALS.clearFlag(14);
@@ -12003,28 +11870,14 @@ void Scene1850::postInit(SceneObjectList *OwnerList) {
_screen.setPosition(Common::Point(122, 113));
_screen.fixPriority(114);
_screen._effect = EFFECT_SHADED2;
-
- // Totally useless test
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
- } else {
- // And the associated dead code
- _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL);
- }
+ _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
_helmet.postInit();
_helmet.setup(1853, 3, 2);
_helmet.setPosition(Common::Point(139, 111));
_helmet.fixPriority(114);
_helmet._effect = EFFECT_SHADED2;
-
- // Still totally useless test
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- _helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL);
- } else {
- // Another piece of dead code
- _helmet.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
- }
+ _helmet.setDetails(1850, 29, -1, -1, 2, (SceneItem *) NULL);
if (R2_GLOBALS.getFlag(31)) {
_screen._shade = 0;
@@ -12037,50 +11890,36 @@ void Scene1850::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player.setVisage(1500);
_companion.setVisage(1505);
}
- } else { // Not Quinn
- if (R2_GLOBALS.getFlag(32)) {
- R2_GLOBALS._player.setVisage(1508);
- _companion.setVisage(1511);
-
- _screen.postInit();
- _screen.setup(1853, 3, 1);
- _screen.setPosition(Common::Point(122, 113));
- _screen.fixPriority(114);
- _screen._effect = EFFECT_SHADED2;
-
- // Totally useless test
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- // Dead code
- _screen.setDetails(1850, 28, -1, -1, 2, (SceneItem *) NULL);
- } else {
- _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL);
- }
-
- _helmet.postInit();
- _helmet.setup(1853, 3, 2);
- _helmet.setPosition(Common::Point(139, 111));
- _helmet.fixPriority(114);
- _helmet._effect = EFFECT_SHADED2;
-
- // Again, useless test
- if (R2_GLOBALS._player._characterIndex == R2_QUINN) {
- // and dead code
- _helmet.setDetails(1850, 29, -1, -1, 1, (SceneItem *) NULL);
- } else {
- _helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL);
- }
-
- if (R2_GLOBALS.getFlag(31)) {
- _screen._shade = 0;
- _helmet._shade = 0;
- } else {
- _screen._shade = 6;
- _helmet._shade = 6;
- }
+ } else if (R2_GLOBALS.getFlag(32)) {
+ // Not Quinn, flag 32
+ R2_GLOBALS._player.setVisage(1508);
+ _companion.setVisage(1511);
+
+ _screen.postInit();
+ _screen.setup(1853, 3, 1);
+ _screen.setPosition(Common::Point(122, 113));
+ _screen.fixPriority(114);
+ _screen._effect = EFFECT_SHADED2;
+ _screen.setDetails(1850, 30, -1, -1, 2, (SceneItem *) NULL);
+
+ _helmet.postInit();
+ _helmet.setup(1853, 3, 2);
+ _helmet.setPosition(Common::Point(139, 111));
+ _helmet.fixPriority(114);
+ _helmet._effect = EFFECT_SHADED2;
+ _helmet.setDetails(1850, 28, -1, -1, 1, (SceneItem *) NULL);
+
+ if (R2_GLOBALS.getFlag(31)) {
+ _screen._shade = 0;
+ _helmet._shade = 0;
} else {
- R2_GLOBALS._player.setVisage(1505);
- _companion.setVisage(1500);
+ _screen._shade = 6;
+ _helmet._shade = 6;
}
+ } else {
+ // Not Quinn, nor flag 32
+ R2_GLOBALS._player.setVisage(1505);
+ _companion.setVisage(1500);
}
R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
@@ -15256,7 +15095,7 @@ void Scene1950::signal() {
R2_GLOBALS._player.disableControl(CURSOR_WALK);
R2_GLOBALS._player._canWalk = true;
R2_GLOBALS._player.setVisage(22);
- R2_GLOBALS._player.animate(ANIM_MODE_9, NULL);
+ R2_GLOBALS._player.animate(ANIM_MODE_9);
Common::Point pt(340, 160);
NpcMover *mover = new NpcMover();
R2_GLOBALS._player.addMover(mover, &pt, this);
@@ -15272,7 +15111,7 @@ void Scene1950::signal() {
R2_GLOBALS._player.disableControl(CURSOR_WALK);
R2_GLOBALS._player._canWalk = true;
R2_GLOBALS._player.setVisage(22);
- R2_GLOBALS._player.animate(ANIM_MODE_9, NULL);
+ R2_GLOBALS._player.animate(ANIM_MODE_9);
Common::Point pt(-20, 160);
NpcMover *mover = new NpcMover();
R2_GLOBALS._player.addMover(mover, &pt, this);
@@ -15336,7 +15175,6 @@ void Scene1950::signal() {
R2_GLOBALS._player.setVisage(22);
R2_GLOBALS._player.animate(ANIM_MODE_1, NULL);
- warning("%d %d", R2_GLOBALS._player._position.x, R2_GLOBALS._player._position.y);
// This is a hack to work around a pathfinding issue. original destination is (218, 165)
Common::Point pt(128, 165);
NpcMover *mover = new NpcMover();
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index cc114b2033..c809353051 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -183,38 +183,52 @@ public:
};
class Scene1337 : public SceneExt {
- class unkObj1337sub1: public SceneHotspot {
+ class OptionsDialog: public GfxDialog {
+ private:
+ GfxButton _autoplay;
+ GfxButton _restartGame;
+ GfxButton _quitGame;
+ GfxButton _continueGame;
+
+ OptionsDialog();
+ virtual ~OptionsDialog() {}
+ virtual GfxButton *execute(GfxButton *defaultButton);
+ public:
+ static void show();
+ };
+
+ class Card: public SceneHotspot {
public:
- SceneObject _object1;
+ SceneObject _card;
- int _field34;
- Common::Point _field36;
+ int _cardId;
+ Common::Point _stationPos;
- unkObj1337sub1();
+ Card();
void synchronize(Serializer &s);
+ bool isIn(Common::Point pt);
};
- class unkObj1337_1: public SceneHotspot {
+ class GameBoardSide: public SceneHotspot {
public:
- unkObj1337sub1 _arr1[4];
- unkObj1337sub1 _arr2[8];
- unkObj1337sub1 _arr3[1];
- unkObj1337sub1 _arr4[1];
+ Card _handCard[4];
+ Card _outpostStation[8];
+ Card _delayCard;
+ Card _emptyStationPos;
- Common::Point _fieldB94;
- Common::Point _fieldB98;
- Common::Point _fieldB9C;
- Common::Point _fieldBA0;
- int _fieldBA4;
+ Common::Point _card1Pos;
+ Common::Point _card2Pos;
+ Common::Point _card3Pos;
+ Common::Point _card4Pos;
+ int _frameNum;
- unkObj1337_1();
+ GameBoardSide();
void synchronize(Serializer &s);
};
class Action1337: public Action {
public:
- void subD18B5(int resNum, int stripNum, int frameNum);
- void skipFrames(int32 skipCount);
+ void waitFrames(int32 frameCount);
};
class Action1: public Action1337 {
@@ -270,16 +284,6 @@ class Scene1337 : public SceneExt {
void signal();
};
public:
- typedef void (Scene1337::*FunctionPtrType)();
- FunctionPtrType _unkFctPtr412;
-
- ASound _aSound1;
- ASound _aSound2;
- BackgroundSceneObject _background1;
- bool _autoplay;
- unkObj1337_1 _arrunkObj1337[4];
- SceneItem _item1;
- SceneObject _object1;
Action1 _action1;
Action2 _action2;
Action3 _action3;
@@ -293,90 +297,101 @@ public:
Action11 _action11;
Action12 _action12;
Action13 _action13;
- unkObj1337sub1 _item2;
- unkObj1337sub1 _item3;
- unkObj1337sub1 _item4;
- BackgroundSceneObject _background2;
- int _field3E24;
- int _field3E26;
- int _field3E28[100];
- unkObj1337sub1 *_field3EF0;
- unkObj1337sub1 *_field3EF4;
- unkObj1337sub1 *_field3EF8;
- unkObj1337sub1 _item5;
- unkObj1337sub1 _item6;
- unkObj1337sub1 _item7;
- unkObj1337sub1 _item8;
- int _field423C;
- int _field423E;
- int _field4240;
- int _field4242;
- int _field4244;
- int _field4246;
- int _field4248;
- int _field424A;
- int _field424C;
- int _field424E;
-
- SceneObject _arrObject1[8];
- SceneObject _arrObject2[8];
+
+ typedef void (Scene1337::*FunctionPtrType)();
+ FunctionPtrType _delayedFunction;
+
+ bool _autoplay;
+ bool _shuffleEndedFl;
+ bool _showPlayerTurn;
+ bool _displayHelpFl;
+ bool _instructionsDisplayedFl;
+
+ // Discarded cards are put in the available cards pile, with an higher index so there no conflict
+ int _currentDiscardIndex;
+ int _availableCardsPile[100];
+ int _cardsAvailableNumb;
+ int _currentPlayerNumb;
+ int _actionIdx1;
+ int _actionIdx2;
+ int _winnerId;
+ int _instructionsWaitCount;
+ int _cursorCurRes;
+ int _cursorCurStrip;
+ int _cursorCurFrame;
+
+ ASound _aSound1;
+ ASound _aSound2;
+ GameBoardSide _gameBoardSide[4];
+ SceneActor _helpIcon;
+ SceneActor _stockPile;
+ SceneItem _actionItem;
+ SceneObject _currentPlayerArrow;
+
+ Card *_actionCard1;
+ Card *_actionCard2;
+ Card *_actionCard3;
+ Card _animatedCard;
+ Card _shuffleAnimation;
+ Card _discardedPlatformCard;
+ Card _selectedCard;
+ Card _discardPile;
+ Card _stockCard;
+
+ SceneObject _upperDisplayCard[8];
+ SceneObject _lowerDisplayCard[8];
Scene1337();
virtual void synchronize(Serializer &s);
- void actionDisplay(int resNum, int lineNum, int x, int y, int arg5, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt);
- void setAnimationInfo(unkObj1337sub1 *subObj);
- void subC20E5();
- void subC20F9();
- void subC2586();
- bool subC264B(int arg1);
- bool subC2687(int arg1);
- int subC26CB(int arg1, int arg2);
- int subC2719(int arg1);
- int subC274D(int arg1);
- int subC2781(int arg1);
- int subC27B5(int arg1);
- int subC27F9(int arg1);
- void subC2835(int arg1);
- bool subC2BF8(unkObj1337sub1 *subObj1, Common::Point pt);
- void subC2C2F();
- void subC318B(int arg1, unkObj1337sub1 *subObj2, int arg3);
- int subC3257(int arg1);
- bool subC32B1(int arg1, int arg2);
- int subC331B(int arg1);
- bool subC3386(int arg1, int arg2);
- void subC33C0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2);
- void subC3456(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2);
- void subC340B(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2);
- void subC34A1(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2);
- unkObj1337sub1 *subC34EC(int arg1);
- void subC358E(unkObj1337sub1 *subObj1, int arg2);
- int subC3E92(int arg1);
- void subC4A39(unkObj1337sub1 *subObj);
+ void actionDisplay(int resNum, int lineNum, int x, int y, int keepOnScreen, int width, int textMode, int fontNum, int colFG, int colBGExt, int colFGExt);
+ void setAnimationInfo(Card *card);
+ void handleNextTurn();
+ void handlePlayerTurn();
+ bool isStationCard(int cardId);
+ bool isStopConstructionCard(int cardId);
+ int getStationId(int playerId, int handCardId);
+ int findPlatformCardInHand(int playerId);
+ int findCard13InHand(int playerId);
+ int checkThieftCard(int playerId);
+ int isDelayCard(int cardId);
+ int getStationCardId(int cardId);
+ void handlePlayer01Discard(int playerId);
+ void playThieftCard(int playerId, Card *card, int victimId);
+ int getPreventionCardId(int cardId);
+ bool isAttackPossible(int victimId, int cardId);
+ int getPlayerWithOutpost(int playerId);
+ bool checkAntiDelayCard(int delayCardId, int cardId);
+ void playStationCard(Card *station, Card *platform);
+ void playDelayCard(Card *card, Card *dest);
+ void playPlatformCard(Card *card, Card *dest);
+ void playAntiDelayCard(Card *card, Card *dest);
+ Card *getStationCard(int arg1);
+ void playCounterTrickCard(Card *card, int playerId);
+ int getFreeHandCard(int playerId);
+ void discardCard(Card *card);
void subC4CD2();
void subC4CEC();
- void subC51A0(unkObj1337sub1 *subObj1, unkObj1337sub1 *subObj2);
+ void subC51A0(Card *subObj1, Card *subObj2);
void displayDialog(int dialogNumb);
void subPostInit();
- void subCB59B();
+ void displayInstructions();
void suggestInstructions();
void shuffleCards();
- void subCCF26();
- void subCD193();
- void subCDB90(int arg1, Common::Point pt);
- void subCF31D();
- void subCF979();
- void subD026D();
- void subD0281();
- void subD02CA();
- void subD183F(int arg1, int arg2);
- void subD18B5(int resNum, int rlbNum, int arg3);
- int subD18F5();
- int subD1917();
- int subD1940(bool flag);
- void subD195F(int arg1, int arg2);
+ void dealCards();
+ void showOptionsDialog();
+ void handleClick(int arg1, Common::Point pt);
+ void handlePlayer0();
+ void handlePlayer1();
+ void handlePlayer2();
+ void handlePlayer3();
+ void handleAutoplayPlayer2();
+ void updateCursorId(int arg1, bool arg2);
+ void setCursorData(int resNum, int rlbNum, int frameNum);
+ void subD18F5();
+ void subD1917();
+ void subD1940(bool flag);
void subD1975(int arg1, int arg2);
- void subD1A48(int arg1);
virtual void postInit(SceneObjectList *OwnerList = NULL);
virtual void remove();
diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
index b3b512e75d..5b41a85326 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp
@@ -1996,11 +1996,11 @@ void Scene3375::postInit(SceneObjectList *OwnerList) {
setZoomPercents(126, 55, 200, 167);
R2_GLOBALS._player.postInit();
- if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
+ if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
R2_GLOBALS._player._moveDiff = Common::Point(5, 3);
- } else {
+ else
R2_GLOBALS._player._moveDiff = Common::Point(3, 2);
- }
+
R2_GLOBALS._player.changeZoom(-1);
switch (R2_GLOBALS._player._characterIndex) {
@@ -2191,6 +2191,14 @@ void Scene3375::signal() {
_companion2._shade = 4;
_webbster._effect = EFFECT_SHADED2;
_webbster._shade = 4;
+
+ // HACK: Reset zooms in order to avoid giant characters on the upper right of the screen
+ R2_GLOBALS._player.setZoom(-1);
+ _companion1.setZoom(-1);
+ _companion2.setZoom(-1);
+ _webbster.setZoom(-1);
+ //
+
enterArea(_sceneMode);
break;
case 3379:
@@ -2813,7 +2821,7 @@ void Scene3400::remove() {
void Scene3400::signal() {
switch (_sceneMode) {
case 3305: {
- // Removed (useless ?) call to sub_1D227
+ // First part of discussion
_tealSpeaker._object1.hide();
_teal.show();
_teal.setStrip(1);
@@ -2825,6 +2833,7 @@ void Scene3400::signal() {
}
break;
case 3306:
+ // Teal picks up the sapphire
R2_GLOBALS._sound2.play(318);
_companion1.setStrip(2);
R2_GLOBALS._player.setStrip(6);
@@ -2835,15 +2844,16 @@ void Scene3400::signal() {
_stripManager.start(3307, this);
if (R2_GLOBALS._player._characterIndex == R2_SEEKER) {
_sceneMode = 3400;
- R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_actor8, NULL);
+ R2_GLOBALS._player.setAction(&_sequenceManager, this, 3400, &R2_GLOBALS._player, &_teal, &_sapphire, NULL);
} else {
_sceneMode = 3408;
- _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_actor8, NULL);
+ _companion1.setAction(&_sequenceManager, this, 3408, &_companion1, &_teal, &_sapphire, NULL);
}
break;
case 3307:
case 3404:
case 3408:
+ // A tasp!
if (!_soundFaded) {
R2_GLOBALS._sound2.fadeOut2(NULL);
_soundFaded = true;
@@ -2853,7 +2863,7 @@ void Scene3400::signal() {
}
break;
case 3308:
- // Removed (useless ?) call to sub_1D227
+ // Characters teleport one after the other
_companion1.setStrip(2);
R2_GLOBALS._player.setStrip(6);
_companion2.setStrip(6);
@@ -2866,7 +2876,7 @@ void Scene3400::signal() {
setAction(&_sequenceManager, this, 3403, &_companion1, &_webbster, &_manholeCover, NULL);
break;
case 3309:
- // Removed (useless ?) call to sub_1D227
+ // Miranda teleports away
_teal.setStrip(1);
_sceneMode = 3405;
if (R2_GLOBALS._player._characterIndex == R2_MIRANDA)
@@ -2875,7 +2885,7 @@ void Scene3400::signal() {
setAction(&_sequenceManager, this, 3405, &_companion2, &_manholeCover, NULL);
break;
case 3310:
- // Removed (useless ?) call to sub_1D227
+ // Quinn teleports away
_teal.setStrip(1);
_sceneMode = 3406;
if (R2_GLOBALS._player._characterIndex == R2_QUINN)
@@ -2886,7 +2896,7 @@ void Scene3400::signal() {
setAction(&_sequenceManager, this, 3406, &_companion2, &_manholeCover, NULL);
break;
case 3311:
- // Removed (useless ?) call to sub_1D227
+ // Teal teleports away
_tealSpeaker._object1.hide();
_teal.show();
_teal.setStrip(1);
@@ -2894,8 +2904,9 @@ void Scene3400::signal() {
setAction(&_sequenceManager, this, 3407, &_teal, &_manholeCover, NULL);
break;
case 3400: {
- _actor8.postInit();
- _actor8.hide();
+ // Teal enters the room
+ _sapphire.postInit();
+ _sapphire.hide();
_teal.postInit();
_teal._numFrames = 7;
_teal._moveDiff = Common::Point(3, 2);
@@ -2915,54 +2926,63 @@ void Scene3400::signal() {
}
break;
case 3401:
+ // Teal first speech
_sceneMode = 3305;
_stripManager.start(3305, this);
break;
case 3402:
+ // Betrayal of Webbster
_sceneMode = 3306;
_stripManager.start(3306, this);
break;
case 3403:
+ // Teal: "Miranda..."
R2_GLOBALS._scrollFollower = &R2_GLOBALS._player;
_sceneMode = 3309;
_stripManager.start(3309, this);
break;
case 3405:
+ // Teal: "And Quinn..."
_sceneMode = 3310;
_stripManager.start(3310, this);
break;
case 3406:
+ // Teal final sentence before teleporting
_sceneMode = 3311;
_stripManager.start(3311, this);
break;
case 3407:
+ // End of scene
R2_GLOBALS._sceneManager.changeScene(3600);
break;
default:
+ // Unexpected scene mode
R2_GLOBALS._player.enableControl();
break;
}
}
/*--------------------------------------------------------------------------
- * Scene 3500 - Cavern Maze
+ * Scene 3500 - Flub tube maze
*
*--------------------------------------------------------------------------*/
Scene3500::Action1::Action1() {
_direction = 0;
- _field20 = false;
- _field22 = 0;
- _field24 = false;
+ _headingRightFl = false;
+ _turningFl = false;
}
void Scene3500::Action1::synchronize(Serializer &s) {
Action::synchronize(s);
s.syncAsSint16LE(_direction);
- s.syncAsSint16LE(_field20);
- s.syncAsSint16LE(_field22);
- s.syncAsSint16LE(_field24);
+ s.syncAsSint16LE(_headingRightFl);
+ if (s.getVersion() < 13) {
+ int useless = 0;
+ s.syncAsSint32LE(useless);
+ }
+ s.syncAsSint16LE(_turningFl);
}
void Scene3500::Action1::handleHorzButton(int direction) {
@@ -2970,8 +2990,8 @@ void Scene3500::Action1::handleHorzButton(int direction) {
// Direction: -1 == Left, 1 == Right
_direction = direction;
- _field20 = true;
- _field24 = true;
+ _headingRightFl = true;
+ _turningFl = true;
scene->_tunnelHorzCircle.setStrip(2);
scene->_tunnelHorzCircle.show();
@@ -2992,7 +3012,7 @@ void Scene3500::Action1::handleHorzButton(int direction) {
void Scene3500::Action1::turnShuttle(bool arg1) {
Scene3500 *scene = (Scene3500 *)R2_GLOBALS._sceneManager._scene;
- _field20 = arg1;
+ _headingRightFl = arg1;
_direction = -_direction;
if (_direction == 1) {
@@ -3050,7 +3070,7 @@ void Scene3500::Action1::signal() {
if (scene->_speed != 0) {
scene->_speed = 0;
scene->_mazeChangeAmount = 0;
- scene->_field1272 = false;
+ scene->_updateIdxChangeFl = false;
scene->_rotation->_idxChange = 0;
}
break;
@@ -3091,49 +3111,49 @@ void Scene3500::Action1::signal() {
if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 11))
|| (var6 != 0)) {
if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId != 15))
- _field20 = false;
+ _headingRightFl = false;
else if ((var6 != 0) || (di <= 3)) // useless, skipped: "|| (di == 0)"
- _field20 = false;
+ _headingRightFl = false;
else
- _field20 = true;
+ _headingRightFl = true;
} else
- _field20 = true;
+ _headingRightFl = true;
break;
case MAZEDIR_EAST:
if ( ((cellId != 12) && (cellId != 13) && (cellId != 11) && (cellId != 16) && (cellId != 26) && (cellId != 24) && (cellId != 15) && (cellId != 6) && (cellId != 31))
|| (di != 0)) {
if ((cellId != 25) && (cellId != 23) && (cellId != 14) && (cellId != 5) && (cellId != 4))
- _field20 = false;
+ _headingRightFl = false;
else if ((di != 0) || (var6 <= 3)) // useless, skipped: "|| (var6 == 0)"
- _field20 = false;
+ _headingRightFl = false;
else
- _field20 = true;
+ _headingRightFl = true;
} else
- _field20 = true;
+ _headingRightFl = true;
break;
case MAZEDIR_SOUTH:
if ( ((cellId != 2) && (cellId != 3) && (cellId != 6) && (cellId != 1) && (cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 16) && (cellId != 31))
|| (var6 != 0)) {
if ((cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 14) && (cellId != 15))
- _field20 = false;
+ _headingRightFl = false;
else if ((var6 != 0) || (di <= 3)) // useless, skipped: "|| (di == 0)"
- _field20 = false;
+ _headingRightFl = false;
else
- _field20 = true;
+ _headingRightFl = true;
} else
- _field20 = true;
+ _headingRightFl = true;
break;
case MAZEDIR_WEST:
if ( ((cellId != 12) && (cellId != 13) && (cellId != 11) && (cellId != 16) && (cellId != 25) && (cellId != 23) && (cellId != 14) && (cellId != 1) && (cellId != 31))
|| (var6 != 0)) {
if ((cellId != 26) && (cellId != 24) && (cellId != 15) && (cellId != 5) && (cellId != 4))
- _field20 = false;
+ _headingRightFl = false;
else if ((var6 <= 0) || (di != 0)) // useless, skipped: "|| (var6 == 0)"
- _field20 = false;
+ _headingRightFl = false;
else
- _field20 = true;
+ _headingRightFl = true;
} else
- _field20 = true;
+ _headingRightFl = true;
default:
break;
}
@@ -3163,7 +3183,7 @@ void Scene3500::Action1::signal() {
break;
case 6:
scene->_tunnelVertCircle.setPosition(Common::Point(160, 73));
- if (!_field20)
+ if (!_headingRightFl)
scene->_tunnelVertCircle.setStrip(1);
else
scene->_tunnelVertCircle.setStrip(2);
@@ -3191,10 +3211,9 @@ void Scene3500::Action1::signal() {
scene->_shuttle._frameChange = _direction;
scene->_shuttle.setFrame(scene->_shuttle.changeFrame());
}
- // All the var_8 initialization was missing in the original
+ // CHECKME: All the var_8 initialization was missing in the original
// but it's clearly a cut and paste error from case 4.
// The following code allows the switch to work properly.
- warning("Checkme: fix for dead code");
int var_8 = (_direction * 2 + scene->_mazeDirection);
if (var_8 > 7)
var_8 = 1;
@@ -3218,8 +3237,8 @@ void Scene3500::Action1::signal() {
}
scene->_symbolLeft.hide();
scene->_symbolRight.hide();
- _field24 = false;
- if (!_field20) {
+ _turningFl = false;
+ if (!_headingRightFl) {
scene->_throttle.updateSpeed();
if (scene->_mazeChangeAmount == scene->_speed)
scene->_aSound1.play(276);
@@ -3247,7 +3266,7 @@ void Scene3500::Action1::signal() {
NpcMover *mover = new NpcMover();
scene->_tunnelVertCircle.addMover(mover, &pt, NULL);
scene->_tunnelVertCircle.fixPriority(11);
- if (!_field20)
+ if (!_headingRightFl)
scene->_tunnelHorzCircle.setStrip(1);
else
scene->_tunnelHorzCircle.setStrip(2);
@@ -3448,7 +3467,7 @@ void Scene3500::Throttle::process(Event &event) {
if ((event.eventType == EVENT_BUTTON_UP) && (_deltaMouseY != 0)) {
_deltaMouseY = 0;
event.handled = true;
- if (!scene->_action1._field24)
+ if (!scene->_action1._turningFl)
updateSpeed();
}
@@ -3483,11 +3502,11 @@ bool Scene3500::Throttle::startAction(CursorType action, Event &event) {
/*--------------------------------------------------------------------------*/
-int Scene3500::MazeUI3500::cellFromX(int x) {
+int16 Scene3500::MazeUI3500::cellFromX(int x) {
return (_cellSize.x / 2) + x - (x % _cellSize.x);
}
-int Scene3500::MazeUI3500::cellFromY(int y) {
+int16 Scene3500::MazeUI3500::cellFromY(int y) {
return (_cellSize.y / 2) + y - (y % _cellSize.y) - 1;
}
@@ -3516,13 +3535,13 @@ Scene3500::Scene3500() {
_rotation = NULL;
_mazeChangeAmount = 0;
_speed = 0;
- _field1272 = false;
+ _updateIdxChangeFl = false;
_mazeDirection = MAZEDIR_NONE;
_nextMove = 0;
_mazePosition.x = 0;
_mazePosition.y = 0;
- _field1282 = true; // Set to true in fixup()
- _field1284 = 0;
+ _postFixupFl = true; // Set to true in fixup()
+ _exitCounter = 0;
_directionChangesEnabled = false;
}
@@ -3534,13 +3553,13 @@ void Scene3500::synchronize(Serializer &s) {
s.syncAsSint16LE(_moverHorzX);
s.syncAsSint16LE(_mazeChangeAmount);
s.syncAsSint16LE(_speed);
- s.syncAsSint16LE(_field1272);
+ s.syncAsSint16LE(_updateIdxChangeFl);
s.syncAsSint16LE(_mazeDirection);
s.syncAsSint16LE(_nextMove);
s.syncAsSint16LE(_mazePosition.x);
s.syncAsSint16LE(_mazePosition.y);
- s.syncAsSint16LE(_field1282);
- s.syncAsSint16LE(_field1284);
+ s.syncAsSint16LE(_postFixupFl);
+ s.syncAsSint16LE(_exitCounter);
s.syncAsSint16LE(_directionChangesEnabled);
}
@@ -3556,10 +3575,10 @@ void Scene3500::postInit(SceneObjectList *OwnerList) {
R2_GLOBALS._player._characterScene[R2_QUINN] = 3500;
R2_GLOBALS._player._characterScene[R2_SEEKER] = 3500;
R2_GLOBALS._player._characterScene[R2_MIRANDA] = 3500;
- _field1284 = 0;
- _field1282 = false;
+ _exitCounter = 0;
+ _postFixupFl = false;
_nextMove = 0;
- _field1272 = true;
+ _updateIdxChangeFl = true;
_speed = 4;
_mazeChangeAmount = 4;
_mazePosition = Common::Point(860, 891);
@@ -3653,7 +3672,7 @@ void Scene3500::postInit(SceneObjectList *OwnerList) {
_mazeUI.load(2);
_mazeUI.setMazePosition(_mazePosition);
- _action1._field24 = false;
+ _action1._turningFl = false;
_mazeUI.draw();
_directionChangesEnabled = true;
@@ -3672,7 +3691,7 @@ void Scene3500::doMovement(int id) {
_speed--;
_throttle.setSpeed(_speed);
}
- if (_action1._field24)
+ if (_action1._turningFl)
_speed = 0;
break;
case 1:
@@ -3681,13 +3700,13 @@ void Scene3500::doMovement(int id) {
++_speed;
_throttle.setSpeed(_speed);
}
- if (_action1._field24)
+ if (_action1._turningFl)
_speed = 0;
break;
case 88:
// Up button has been pressed
// The original was doing a double check on action, only one is here.
- if (!_action || (!_action1._field24)) {
+ if (!_action || (!_action1._turningFl)) {
_action2.handleVertButton(2);
if (_action && ((_action2.getActionIndex() != 0) || (_action2._direction != 2))) {
_action2.signal();
@@ -3698,10 +3717,10 @@ void Scene3500::doMovement(int id) {
break;
case 96:
// Right button has been pressed
- if (!_action || !_action1._field24 || (_action1._direction == 1)) {
- if (_action && (_nextMove == 0) && (_action1._field24)) {
+ if (!_action || !_action1._turningFl || (_action1._direction == 1)) {
+ if (_action && (_nextMove == 0) && (_action1._turningFl)) {
_nextMove = id;
- } else if (_action && (!_action1._field24)) {
+ } else if (_action && (!_action1._turningFl)) {
_action1.handleHorzButton(1);
_action1.signal();
} else if (!_action) {
@@ -3718,7 +3737,7 @@ void Scene3500::doMovement(int id) {
break;
case 104:
// Down button has been pressed
- if (!_action || (!_action1._field24)) {
+ if (!_action || (!_action1._turningFl)) {
_action2.handleVertButton(-1);
if ((_action) && ((_action2.getActionIndex() != 0) || (_action2._direction != -1))) {
_action2.signal();
@@ -3729,10 +3748,10 @@ void Scene3500::doMovement(int id) {
break;
case 112:
// Left button has been pressed
- if (!_action || !_action1._field24 || (_action1._direction == 1)) {
- if (_action && (_nextMove == 0) && (_action1._field24)) {
+ if (!_action || !_action1._turningFl || (_action1._direction == 1)) {
+ if (_action && (_nextMove == 0) && (_action1._turningFl)) {
_nextMove = id;
- } else if (_action && (!_action1._field24)) {
+ } else if (_action && (!_action1._turningFl)) {
_action1.handleHorzButton(-1);
_action1.signal();
} else if (!_action) {
@@ -3750,7 +3769,7 @@ void Scene3500::doMovement(int id) {
default:
_speed = id;
_throttle.setSpeed(id);
- if (_action1._field24) {
+ if (_action1._turningFl) {
_speed = 0;
}
break;
@@ -3857,12 +3876,12 @@ void Scene3500::dispatch() {
Rect tmpRect;
Scene::dispatch();
- if (((_shuttle._frame % 2) == 0) && (!_action1._field24)) {
+ if (((_shuttle._frame % 2) == 0) && (!_action1._turningFl)) {
_shuttle.setFrame(_shuttle.changeFrame());
_mazeDirection = _shuttle._frame;
}
- if ((_nextMove != 0) && (!_action1._field24)) {
+ if ((_nextMove != 0) && (!_action1._turningFl)) {
int move = _nextMove;
_nextMove = 0;
doMovement(move);
@@ -3871,20 +3890,20 @@ void Scene3500::dispatch() {
if (!_rotation)
return;
- int newMazeX = 0;
- int newMazeY = 0;
- int mazePosX = 0;
- int mazePosY = 0;
+ int16 newMazeX = 0;
+ int16 newMazeY = 0;
+ int16 mazePosX = 0;
+ int16 mazePosY = 0;
int deltaX = 0;
int deltaY = 0;
int tmpCellId = 0;
int cellId = 0;
- if ((_mazeChangeAmount == 0) && !_field1282) {
- if (_field1284 == 2)
+ if ((_mazeChangeAmount == 0) && !_postFixupFl) {
+ if (_exitCounter == 2)
R2_GLOBALS._sceneManager.changeScene(1000);
} else {
- _field1282 = false;
+ _postFixupFl = false;
tmpRect.set(160, 89, 299, 182);
newMazeX = _mazePosition.x;
@@ -3904,8 +3923,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46;
@@ -3917,8 +3936,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 11) && (cellId != tmpCellId)) {
newMazeY = mazePosY + 3;
@@ -3926,8 +3945,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46;
@@ -3935,23 +3954,23 @@ void Scene3500::dispatch() {
cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46));
if ( (((cellId == 23) || (cellId == 24) || (cellId == 4)) && (newMazeY <= mazePosY) && (_mazePosition.y>= mazePosY))
- || (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount > 3) && (_action1._field24 != 0)) ) {
+ || (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount > 3) && (_action1._turningFl != 0)) ) {
newMazeY = mazePosY;
if ((cellId != 25) && (cellId != 26) && (cellId != 5) && (cellId != 14) && (cellId == 15))
R2_GLOBALS._sound2.play(339);
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 11) && (mazePosY + 3 >= newMazeY) && (_mazePosition.y >= mazePosY + 3)) {
R2_GLOBALS._sound2.play(339);
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if (((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)) && (deltaX != 0) && (deltaX <= 3)) {
newMazeX = mazePosX;
@@ -3970,8 +3989,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70;
@@ -3983,8 +4002,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 6) && (cellId != tmpCellId)) {
newMazeX = mazePosX - 5;
@@ -3992,23 +4011,23 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70;
deltaX = abs(newMazeX - mazePosX);
cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46));
if ( (((cellId == 26) || (cellId == 24) || (cellId == 15)) && (newMazeX >= mazePosX) && (_mazePosition.x <= mazePosX))
- || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ) {
+ || (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._turningFl != 0)) ) {
newMazeX = mazePosX;
if ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4))
R2_GLOBALS._sound2.play(339);
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 6) && (mazePosX - 5 <= newMazeX) && (_mazePosition.x <= mazePosX - 5)) {
newMazeX = mazePosX - 5;
@@ -4016,8 +4035,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if (((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)) && (deltaY != 0) && (deltaY <= 3)) {
newMazeY = mazePosY;
@@ -4036,8 +4055,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46;
@@ -4049,8 +4068,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 16) && (cellId != tmpCellId)) {
newMazeY = mazePosY - 3;
@@ -4058,8 +4077,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 31) && (cellId != tmpCellId)) {
newMazeY = mazePosY + 4;
@@ -4067,15 +4086,15 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosY = _mazeUI.cellFromY(newMazeY + 46) - 46;
deltaY = abs(newMazeY - mazePosY);
cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46));
if ( (((cellId == 25) || (cellId == 26) || (cellId == 5)) && (newMazeY >= mazePosY) && (_mazePosition.y <= mazePosY))
- || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount <= 3) && (_action1._field24 != 0)) ){
+ || (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (_mazeChangeAmount >= deltaY) && (_mazeChangeAmount <= 3) && (_action1._turningFl != 0)) ){
newMazeY = mazePosY;
if ((cellId != 23) && (cellId != 24) && (cellId != 4) && (cellId != 14) && (cellId != 15))
@@ -4083,8 +4102,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 16) && (mazePosY - 3 <= newMazeY) && (_mazePosition.y <= mazePosY - 3)) {
newMazeY = mazePosY - 3;
@@ -4092,19 +4111,19 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 31) && (mazePosY + 4 <= newMazeY) && (_mazePosition.y <= mazePosY + 4)) {
newMazeY = mazePosY + 4;
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
if ((newMazeX == 660) && (_mazeChangeAmount + 306 <= newMazeY) && (newMazeY <= 307))
- ++_field1284;
+ ++_exitCounter;
else
R2_GLOBALS._sound2.play(339);
} else if (((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)) && (deltaX != 0) && (deltaX <= 3)) {
@@ -4124,8 +4143,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70;
@@ -4137,8 +4156,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 1) && (cellId != tmpCellId)) {
newMazeX = mazePosX + 5;
@@ -4146,23 +4165,23 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else {
mazePosX = _mazeUI.cellFromX(newMazeX + 70) - 70;
deltaX = abs(mazePosX - newMazeX);
cellId = _mazeUI.getCellFromMapXY(Common::Point(newMazeX + 70, newMazeY + 46));
if ( (((cellId == 25) || (cellId == 23) || (cellId == 14)) && (newMazeX <= mazePosX) && (_mazePosition.x >= mazePosX))
- || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._field24)) ) {
+ || (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (_mazeChangeAmount >= deltaX) && (_mazeChangeAmount <= 3) && (_action1._turningFl)) ) {
newMazeX = mazePosX;
if ((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4))
R2_GLOBALS._sound2.play(339);
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if ((cellId == 1) && (newMazeX >= mazePosX + 5) && (_mazePosition.x >= mazePosX + 5)) {
newMazeX = mazePosX + 5;
@@ -4170,8 +4189,8 @@ void Scene3500::dispatch() {
_rotation->_idxChange = 0;
_speed = 0;
_mazeChangeAmount = 0;
- _field1272 = false;
- if (!_action1._field24)
+ _updateIdxChangeFl = false;
+ if (!_action1._turningFl)
_tunnelVertCircle.hide();
} else if (((cellId == 26) || (cellId == 24) || (cellId == 15) || (cellId == 5) || (cellId == 4)) && (deltaY != 0) && (deltaY <= 3)) {
newMazeY = mazePosY;
@@ -4186,11 +4205,11 @@ void Scene3500::dispatch() {
break;
}
- if (_field1284 < 2) {
+ if (_exitCounter < 2) {
_mazePosition.x = newMazeX;
_mazePosition.y = newMazeY;
if (_mazeUI.setMazePosition2(_mazePosition) != 0) {
- _field1272 = false;
+ _updateIdxChangeFl = false;
_mazeChangeAmount = 0;
_speed = 0;
_rotation->setDelay(0);
@@ -4198,16 +4217,16 @@ void Scene3500::dispatch() {
}
_mazeUI.draw();
- if (_field1284 != 0)
- ++_field1284;
+ if (_exitCounter != 0)
+ ++_exitCounter;
}
}
- if (!_field1272) {
+ if (!_updateIdxChangeFl) {
if (_mazeChangeAmount != _speed) {
if (_mazeChangeAmount >= _speed) {
if (_mazeChangeAmount == 1) {
- if (_action1._field24) {
+ if (_action1._turningFl) {
if ( ((_mazeDirection == 1) && (deltaX == 0) && (deltaY != 0) && (deltaY <= 3) && ((cellId == 25) || (cellId == 26) || (cellId == 5) || (cellId == 14) || (cellId == 15)))
|| ((_mazeDirection == 3) && (deltaY == 0) && (deltaX != 0) && (deltaX <= 3) && ((cellId == 25) || (cellId == 23) || (cellId == 14) || (cellId == 5) || (cellId == 4)))
|| ((_mazeDirection == 5) && (deltaX == 0) && (deltaY != 0) && (deltaY <= 3) && ((cellId == 23) || (cellId == 24) || (cellId == 4) || (cellId == 14) || (cellId == 15)))
@@ -4221,12 +4240,12 @@ void Scene3500::dispatch() {
_mazeChangeAmount--;
} else
++_mazeChangeAmount;
- _field1272 = true;
+ _updateIdxChangeFl = true;
}
_verticalSpeedDisplay.setFrame2(_mazeChangeAmount + 1);
}
- if (_field1272) {
+ if (_updateIdxChangeFl) {
if (_mazeChangeAmount == 0)
_rotation->_idxChange = 0;
else if (_mazeChangeAmount > 8)
@@ -4234,11 +4253,11 @@ void Scene3500::dispatch() {
else
_rotation->_idxChange = 1;
- _field1272 = false;
+ _updateIdxChangeFl = false;
}
if (_mazeChangeAmount != 0) {
- R2_GLOBALS._player._uiEnabled = false;
+ R2_GLOBALS._player._uiEnabled = false;
if (_mazeChangeAmount != _speed)
_aSound1.play(276);
} else {
@@ -4266,14 +4285,14 @@ void Scene3600::synchronize(Serializer &s) {
}
Scene3600::Action3600::Action3600() {
- _field1E = false;
+ _part2Fl = false;
_fadePct = 0;
}
void Scene3600::Action3600::synchronize(Serializer &s) {
Action::synchronize(s);
- s.syncAsSint16LE(_field1E);
+ s.syncAsSint16LE(_part2Fl);
s.syncAsSint16LE(_fadePct);
}
@@ -4286,8 +4305,8 @@ void Scene3600::Action3600::signal() {
setDelay(60);
break;
case 1:
- if (!_field1E) {
- _field1E = true;
+ if (!_part2Fl) {
+ _part2Fl = true;
scene->_steppingDisk.setAction(NULL);
R2_GLOBALS._sound2.play(330, NULL, 0);
R2_GLOBALS._sound2.fade(127, 5, 10, false, NULL);
@@ -4328,7 +4347,7 @@ void Scene3600::Action2::signal() {
scene->_protector.setup(3127, 2, 1);
scene->_protector.animate(ANIM_MODE_1, NULL);
NpcMover *mover = new NpcMover();
- scene->_protector.addMover(mover, &scene->_protector._field8A, scene);
+ scene->_protector.addMover(mover, &scene->_protector._actorDestPos, scene);
}
break;
default:
@@ -4341,7 +4360,7 @@ void Scene3600::Action2::signal() {
bool Scene3600::LightShaft::startAction(CursorType action, Event &event) {
Scene3600 *scene = (Scene3600 *)R2_GLOBALS._sceneManager._scene;
- if ((action != CURSOR_USE) || !scene->_action1._field1E)
+ if ((action != CURSOR_USE) || !scene->_action1._part2Fl)
return SceneItem::startAction(action, event);
R2_GLOBALS._walkRegions.enableRegion(2);
@@ -4547,7 +4566,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) {
if (!R2_GLOBALS.getFlag(71)) {
_protector.postInit();
_protector._state = 0;
- _protector._field8A = Common::Point(226, 152);
+ _protector._actorDestPos = Common::Point(226, 152);
_protector._moveDiff = Common::Point(3, 2);
_protector.setPosition(Common::Point(284, 152));
_protector.setup(3127, 2, 1);
@@ -4562,7 +4581,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) {
_consoleLights.setup(3601, 5, 1);
_consoleLights.animate(ANIM_MODE_2, NULL);
- _action1._field1E = true;
+ _action1._part2Fl = true;
_action1._fadePct = 0;
_action1.setActionIndex(1);
@@ -4597,7 +4616,7 @@ void Scene3600::postInit(SceneObjectList *OwnerList) {
_steppingDisk.fixPriority(149);
_steppingDisk.changeZoom(-1);
- _action1._field1E = false;
+ _action1._part2Fl = false;
_action1._fadePct = 90;
_sceneMode = 3600;
@@ -4623,7 +4642,7 @@ void Scene3600::remove() {
void Scene3600::signal() {
switch (_sceneMode) {
case 3320:
- // Removed (useless ?) call to sub_1D227
+ // Move to the console
R2_GLOBALS._walkRegions.disableRegion(14);
R2_GLOBALS._scrollFollower = &_seeker;
_tealSpeaker._object1.hide();
@@ -4639,7 +4658,7 @@ void Scene3600::signal() {
&_miranda, &_webbster, &_teal, NULL);
break;
case 3321:
- // Removed (useless ?) call to sub_1D227
+ // Teal activates console
R2_GLOBALS._scrollFollower = &R2_GLOBALS._player;
_tealSpeaker.stopSpeaking();
_teal.show();
@@ -4650,7 +4669,7 @@ void Scene3600::signal() {
&_quinn, &_seeker, &_miranda, &_webbster, NULL);
break;
case 3322:
- // Removed (useless ?) call to sub_1D227
+ // Teal walks toward the teleport pod, the goule protector appears
_quinnSpeaker.stopSpeaking();
_quinnSpeaker._displayMode = 1;
_tealSpeaker.stopSpeaking();
@@ -4660,10 +4679,11 @@ void Scene3600::signal() {
setAction(&_sequenceManager1, this, _sceneMode, &_teal, &_protector, &_steppingDisk, NULL);
break;
case 3323:
+ // Goule protector eats Teal guts then moves
+
if (!_tealDead)
_tealDead = true;
else {
- // Removed (useless ?) call to sub_1D227
_protectorSpeaker.stopSpeaking();
_protector.show();
_protector.setup(3258, 6, 1);
@@ -4702,6 +4722,7 @@ void Scene3600::signal() {
_sceneMode = 3623;
break;
case 3450:
+ // Speech of Teal and Quinn
R2_GLOBALS._sound1.stop();
_protector3400.hide();
_door3400.hide();
@@ -4724,7 +4745,7 @@ void Scene3600::signal() {
_protector.postInit();
_protector._state = 0;
- _protector._field8A = Common::Point(226, 152);
+ _protector._actorDestPos = Common::Point(226, 152);
_protector._moveDiff = Common::Point(5, 3);
_protector.setup(3403, 7, 1);
_protector.setPosition(Common::Point(405, 155));
@@ -4766,6 +4787,7 @@ void Scene3600::signal() {
R2_GLOBALS._sound2.play(329);
break;
case 3600:
+ // First speech by Teal
_sceneMode = 3320;
_stripManager.start(3320, this);
break;
@@ -4774,6 +4796,7 @@ void Scene3600::signal() {
case 3602:
// No break on purpose
case 3603:
+ // Teal speech near the console
R2_GLOBALS._walkRegions.disableRegion(2);
R2_GLOBALS._walkRegions.disableRegion(7);
_tealSpeaker._displayMode = 1;
@@ -4781,6 +4804,7 @@ void Scene3600::signal() {
_stripManager.start(3321, this);
break;
case 3604:
+ // Goule Protector forces the door
R2_GLOBALS._sound2.fadeOut2(NULL);
R2_GLOBALS._sound1.stop();
R2_GLOBALS._walkRegions.enableRegion(2);
@@ -4818,6 +4842,7 @@ void Scene3600::signal() {
setAction(&_sequenceManager1, this, 3450, &_protector3400, &_door3400, NULL);
break;
case 3605:
+ // Goule protector jumps on Teal
_protector.setup(3258, 4, 1);
_protector.setAction(&_sequenceManager1, this, 3606, &_teal, &_protector,
&_steppingDisk, NULL);
@@ -4829,7 +4854,7 @@ void Scene3600::signal() {
// No break on purpose
case 3623:
if ((_protector._position.x == 226) && (_protector._position.y == 152)
- && _action1._field1E && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) {
+ && _action1._part2Fl && (_protector._visage == 3127) && (!R2_GLOBALS.getFlag(71))) {
R2_GLOBALS._sound2.stop();
R2_GLOBALS._sound2.play(331);
R2_GLOBALS.setFlag(71);
@@ -4877,7 +4902,7 @@ void Scene3600::process(Event &event) {
}
void Scene3600::dispatch() {
- if ((R2_GLOBALS._player.getRegionIndex() == 200) && _action1._field1E && !_lightEntered) {
+ if ((R2_GLOBALS._player.getRegionIndex() == 200) && _action1._part2Fl && !_lightEntered) {
R2_GLOBALS._sound2.fadeOut2(NULL);
if (_protector._mover)
_protector.addMover(NULL);
@@ -4918,7 +4943,7 @@ void Scene3600::dispatch() {
_webbster.setAction(&_sequenceManager1, this, 3613, &_webbster, NULL);
}
- if ((_protector.getRegionIndex() == 200) && _action1._field1E && !_ghoulTeleported) {
+ if ((_protector.getRegionIndex() == 200) && _action1._part2Fl && !_ghoulTeleported) {
R2_GLOBALS._sound2.fadeOut2(NULL);
_sceneMode = 3620;
_ghoulTeleported = true;
@@ -4947,6 +4972,7 @@ void Scene3600::dispatch() {
void Scene3700::postInit(SceneObjectList *OwnerList) {
loadScene(3700);
R2_GLOBALS._uiElements._active = false;
+ R2_GLOBALS._uiElements._visible = false;
SceneExt::postInit();
R2_GLOBALS._interfaceY = SCREEN_HEIGHT;
@@ -4993,7 +5019,6 @@ void Scene3700::signal() {
case 3328:
// No break on purpose
case 3329:
- // Removed (useless ?) call to sub_1D227
_sceneMode = 3701;
setAction(&_sequenceManager, this, 3701, &_seeker, &_miranda, &_webbster, NULL);
break;
diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h
index b282900c3a..e6f74d6e53 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes3.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes3.h
@@ -550,7 +550,7 @@ public:
SceneActor _teal;
SceneActor _door;
SceneActor _manholeCover;
- SceneActor _actor8;
+ SceneActor _sapphire;
SequenceManager _sequenceManager;
bool _soundFaded;
@@ -565,9 +565,8 @@ class Scene3500 : public SceneExt {
class Action1: public Action {
public:
int _direction;
- bool _field20;
- int _field22;
- bool _field24;
+ bool _headingRightFl;
+ bool _turningFl;
Action1();
virtual void synchronize(Serializer &s);
@@ -619,8 +618,8 @@ class Scene3500 : public SceneExt {
class MazeUI3500 : public MazeUI {
public:
- int cellFromX(int arg1);
- int cellFromY(int arg1);
+ int16 cellFromX(int arg1);
+ int16 cellFromY(int arg1);
int getCellFromMapXY(Common::Point pt);
bool setMazePosition2(Common::Point &p);
};
@@ -653,12 +652,12 @@ public:
PaletteRotation *_rotation;
int _mazeChangeAmount;
int _speed;
- bool _field1272;
+ bool _updateIdxChangeFl;
int _mazeDirection;
int _nextMove;
Common::Point _mazePosition;
- bool _field1282;
- int _field1284;
+ bool _postFixupFl;
+ int _exitCounter;
bool _directionChangesEnabled;
Scene3500();
@@ -675,7 +674,7 @@ public:
class Scene3600 : public SceneExt {
class Action3600: public ActionExt {
public:
- bool _field1E;
+ bool _part2Fl;
int _fadePct;
Action3600();
diff --git a/engines/tsage/ringworld2/ringworld2_speakers.cpp b/engines/tsage/ringworld2/ringworld2_speakers.cpp
index 675511ac10..494a31a829 100644
--- a/engines/tsage/ringworld2/ringworld2_speakers.cpp
+++ b/engines/tsage/ringworld2/ringworld2_speakers.cpp
@@ -335,7 +335,8 @@ void SpeakerCaptain3210::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -393,18 +394,21 @@ void SpeakerChief1100::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4080, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4080, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 100:
_numFrames = 0;
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setStrip(_object1._strip - 1);
_object1.setFrame(_object1.getFrameCount());
_object1.animate(ANIM_MODE_6, this);
@@ -448,7 +452,8 @@ void SpeakerGuard2800::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setZoom(75);
_object1.setup(4060, 3, 1);
_object1.animate(ANIM_MODE_5, this);
@@ -488,7 +493,8 @@ void SpeakerJocko3200::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -511,7 +517,8 @@ void SpeakerJocko3220::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -534,7 +541,8 @@ void SpeakerJocko3230::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -579,13 +587,13 @@ void SpeakerMiranda300::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
} else if (v == 100) {
_numFrames = 0;
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
_object1.setStrip(_object1._strip - 1);
_object1.setFrame(_object1.getFrameCount());
_object1.animate(ANIM_MODE_6, this);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
if (v == 4) {
_object1.setup(304, 5, 1);
@@ -613,7 +621,8 @@ void SpeakerMiranda1625::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1627, 3, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -634,7 +643,8 @@ void SpeakerMiranda3255::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(3257, 5, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -680,7 +690,8 @@ void SpeakerMiranda3375::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4051, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -729,7 +740,8 @@ void SpeakerMiranda3385::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4051, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -779,7 +791,8 @@ void SpeakerMiranda3395::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4051, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -818,12 +831,14 @@ void SpeakerMiranda3400::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4051, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4050, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -864,12 +879,14 @@ void SpeakerMiranda3600::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4051, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4050, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -904,7 +921,8 @@ void SpeakerMiranda3700::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
scene->_quinn.setup(10, 6, 1);
scene->_seeker.setup(20, 5, 1);
_object2->setup(30, 1, 1);
@@ -913,13 +931,15 @@ void SpeakerMiranda3700::animateSpeaker() {
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
scene->_miranda.setup(30, 8, 1);
_object1.setup(4052, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
scene->_seeker.setup(20, 1, 1);
scene->_miranda.setup(30, 1, 1);
_object1.setup(4051, 7, 1);
@@ -964,7 +984,8 @@ void SpeakerNej2700::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 2701:
_object1.setup(4022, 3, 1);
@@ -999,7 +1020,8 @@ void SpeakerNej2750::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 2705:
_object1.setup(4022, 7, 1);
@@ -1031,7 +1053,8 @@ void SpeakerNej2800::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4023, 3, 1);
if (_object2->_visage == 2801)
_object1.setPosition(Common::Point(R2_GLOBALS._player._position.x - 12, R2_GLOBALS._player._position.y));
@@ -1069,7 +1092,8 @@ void SpeakerPharisha2435::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4098, 5, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -1108,7 +1132,8 @@ void SpeakerPrivate3210::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -1157,7 +1182,8 @@ void SpeakerProtector3600::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
if (scene->_sceneMode != 3324) {
_object1.setup(4125, 3, 1);
_object1.animate(ANIM_MODE_5, this);
@@ -1212,13 +1238,13 @@ void SpeakerQuinn300::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
} else if (v == 100) {
_numFrames = 0;
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
_object1.setStrip(_object1._strip - 1);
_object1.setFrame(_object1.getFrameCount());
_object1.animate(ANIM_MODE_6, this);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
switch (_object2->_visage) {
case 10:
@@ -1264,7 +1290,7 @@ void SpeakerQuinn500::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
switch (_object2->_visage) {
case 10:
@@ -1312,17 +1338,20 @@ void SpeakerQuinn1100::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1108, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1109, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1109, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -1352,7 +1381,8 @@ void SpeakerQuinn2435::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object2->setStrip(7);
_object1.setup(2020, 5, 1);
_object1.animate(ANIM_MODE_5, this);
@@ -1379,7 +1409,8 @@ void SpeakerQuinn2450::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
if (R2_GLOBALS.getFlag(61))
_object1.setup(2020, 3, 1);
else
@@ -1404,7 +1435,8 @@ void SpeakerQuinn2700::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 19:
_object1.setup(4022, 5, 1);
@@ -1435,7 +1467,8 @@ void SpeakerQuinn2750::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 19:
_object1.setup(4022, 5, 1);
@@ -1466,7 +1499,8 @@ void SpeakerQuinn2800::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 16:
_object1.setZoom(75);
@@ -1506,7 +1540,8 @@ void SpeakerQuinn3255::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(3257, 3, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -1547,13 +1582,13 @@ void SpeakerQuinn3375::animateSpeaker() {
_object2->addMover(NULL);
}
-
switch (v) {
case 0:
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4010, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -1598,13 +1633,13 @@ void SpeakerQuinn3385::animateSpeaker() {
_object2->addMover(NULL);
}
-
switch (v) {
case 0:
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
_object1.setup(4010, 3, 1);
else
@@ -1653,13 +1688,13 @@ void SpeakerQuinn3395::animateSpeaker() {
_object2->addMover(NULL);
}
-
switch (v) {
case 0:
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
if (R2_GLOBALS._player._characterIndex == R2_SEEKER)
_object1.setup(4010, 3, 1);
else
@@ -1702,17 +1737,20 @@ void SpeakerQuinn3400::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4010, 5, 1);
_object1.animate(ANIM_MODE_5, NULL);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4010, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4012, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -1750,17 +1788,20 @@ void SpeakerQuinn3600::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4021, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4010, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4012, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -1813,7 +1854,8 @@ void SpeakerQuinn3700::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
R2_GLOBALS._sound2.stop();
scene->_quinn.setup(10, 4, 1);
scene->_miranda.setup(30, 7, 1);
@@ -1821,14 +1863,16 @@ void SpeakerQuinn3700::animateSpeaker() {
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
scene->_seeker.setup(20, 1, 1);
scene->_miranda.setup(30, 1, 1);
_object1.setup(3702, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
scene->_quinn.setup(10, 2, 1);
scene->_miranda.setup(30, 1, 1);
_object1.setup(4011, 1, 1);
@@ -1881,7 +1925,8 @@ void SpeakerRalf3245::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 3100:
_object1.setup(4105, (_object2->_strip * 2) - 1, 1);
@@ -1933,7 +1978,8 @@ void SpeakerRocko3200::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -1956,7 +2002,8 @@ void SpeakerRocko3220::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -1979,7 +2026,8 @@ void SpeakerRocko3230::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4111, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2025,13 +2073,14 @@ void SpeakerSeeker300::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
} else if (v == 100) {
_numFrames = 0;
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
_object1.setStrip(_object1._strip - 1);
_object1.setFrame(_object1.getFrameCount());
_object1.animate(ANIM_MODE_6, this);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(306, v * 2 - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2063,7 +2112,7 @@ void SpeakerSeeker500::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
if (v == 1)
_object1.setup(4041, 3, 1);
@@ -2103,28 +2152,33 @@ void SpeakerSeeker1100::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1108, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1108, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
_object1.setPosition(Common::Point(197, 134));
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1108, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 4:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1109, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 5:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1109, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2185,7 +2239,8 @@ void SpeakerSeeker2435::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object2->setStrip(7);
_object1.setup(4099, 1, 1);
_object1.animate(ANIM_MODE_5, this);
@@ -2212,7 +2267,8 @@ void SpeakerSeeker2450::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4099, 3, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2251,13 +2307,13 @@ void SpeakerSeeker3375::animateSpeaker() {
_object2->addMover(NULL);
}
-
switch (v) {
case 0:
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2306,7 +2362,8 @@ void SpeakerSeeker3385::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2349,13 +2406,13 @@ void SpeakerSeeker3395::animateSpeaker() {
_object2->addMover(NULL);
}
-
switch (v) {
case 0:
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2394,27 +2451,32 @@ void SpeakerSeeker3400::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4030, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 4:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 5:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4033, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2456,12 +2518,14 @@ void SpeakerSeeker3600::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4031, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4030, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2509,7 +2573,8 @@ void SpeakerSeeker3700::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
R2_GLOBALS._sound2.stop();
scene->_quinn.setup(10, 8, 1);
scene->_seeker.setup(20, 7, 1);
@@ -2518,7 +2583,8 @@ void SpeakerSeeker3700::animateSpeaker() {
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
scene->_quinn.setup(10, 2, 1);
scene->_seeker.setup(20, 1, 1);
scene->_miranda.setup(30, 1, 1);
@@ -2572,7 +2638,8 @@ void SpeakerSocko3200::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4060, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2612,7 +2679,8 @@ void SpeakerSoldier300::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(303, 3, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2658,12 +2726,14 @@ void SpeakerTeal180::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(75, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(77, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2691,7 +2761,8 @@ void SpeakerTeal300::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(303, 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2715,7 +2786,8 @@ void SpeakerTeal1625::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(1627, 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2738,7 +2810,8 @@ void SpeakerTeal3240::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4070, (_object2->_strip * 2) - 1, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -2776,22 +2849,26 @@ void SpeakerTeal3400::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 4:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2832,22 +2909,26 @@ void SpeakerTeal3600::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 1, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 4:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4107, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2890,7 +2971,8 @@ void SpeakerTomko3245::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
switch (_object2->_visage) {
case 3100:
_object1.setup(4105, (_object2->_strip * 2) - 1, 1);
@@ -2946,17 +3028,20 @@ void SpeakerWebbster180::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(75, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(76, 4, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(76, 6, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -2983,7 +3068,8 @@ void SpeakerWebbster3240::animateSpeaker() {
if (v == 0) {
_object1.animate(ANIM_MODE_2, NULL);
} else {
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 5, 1);
_object1.animate(ANIM_MODE_5, this);
}
@@ -3023,7 +3109,8 @@ void SpeakerWebbster3375::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -3067,7 +3154,8 @@ void SpeakerWebbster3385::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -3111,7 +3199,8 @@ void SpeakerWebbster3395::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -3146,17 +3235,20 @@ void SpeakerWebbster3400::animateSpeaker() {
_object1.animate(ANIM_MODE_2, NULL);
break;
case 1:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 5, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 2:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 7, 1);
_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- ((SceneItem *)_action)->_sceneRegionId = 0;
+ ((StripManager *)_action)->_useless = 0;
+
_object1.setup(4110, 3, 1);
_object1.animate(ANIM_MODE_5, this);
break;
@@ -3210,6 +3302,5 @@ void SpeakerDutyOfficer180::animateSpeaker() {
}
}
-
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index 0d0457981f..42fd4f3282 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -33,7 +33,7 @@ namespace TsAGE {
typedef void (*SaveNotifierFn)(bool postFlag);
-#define TSAGE_SAVEGAME_VERSION 11
+#define TSAGE_SAVEGAME_VERSION 15
class SavedObject;
diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp
index 1726d6ad20..b41e8175c6 100644
--- a/engines/tsage/scenes.cpp
+++ b/engines/tsage/scenes.cpp
@@ -275,10 +275,7 @@ Scene::Scene() : _sceneBounds(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
_oldSceneBounds = Rect(4000, 4000, 4100, 4100);
Common::fill(&_zoomPercents[0], &_zoomPercents[256], 0);
- _field12 = 0;
_screenNumber = 0;
- _fieldA = 0;
- _fieldE = 0;
}
Scene::~Scene() {
@@ -288,15 +285,23 @@ void Scene::synchronize(Serializer &s) {
if (s.getVersion() >= 2)
StripCallback::synchronize(s);
- s.syncAsSint32LE(_field12);
+ if (s.getVersion() < 14) {
+ int useless = 0;
+ s.syncAsSint32LE(useless);
+ }
+
s.syncAsSint32LE(_screenNumber);
s.syncAsSint32LE(_activeScreenNumber);
s.syncAsSint32LE(_sceneMode);
_backgroundBounds.synchronize(s);
_sceneBounds.synchronize(s);
_oldSceneBounds.synchronize(s);
- s.syncAsSint16LE(_fieldA);
- s.syncAsSint16LE(_fieldE);
+
+ if (s.getVersion() < 14) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ s.syncAsSint16LE(useless);
+ }
for (int i = 0; i < 256; ++i)
s.syncAsUint16LE(_enabledSections[i]);
@@ -309,7 +314,6 @@ void Scene::synchronize(Serializer &s) {
void Scene::postInit(SceneObjectList *OwnerList) {
_action = NULL;
- _field12 = 0;
_sceneMode = 0;
}
diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h
index d5ac88c692..4d36192cec 100644
--- a/engines/tsage/scenes.h
+++ b/engines/tsage/scenes.h
@@ -35,7 +35,6 @@ class Scene : public StripCallback {
private:
void drawBackgroundObjects();
public:
- int _field12;
int _screenNumber;
int _activeScreenNumber;
int _sceneMode;
@@ -49,9 +48,6 @@ public:
int _zoomPercents[256];
ScenePriorities _priorities;
SceneObjectList _bgSceneObjects;
-
- int _fieldA;
- int _fieldE;
public:
Scene();
virtual ~Scene();
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index e2fe21c6d7..6633d15c26 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -2734,8 +2734,6 @@ AdlibSoundDriver::AdlibSoundDriver(): SoundDriver() {
_masterVolume = 0;
_groupData._groupMask = 9;
- _groupData._v1 = 0x46;
- _groupData._v2 = 0;
_groupData._pData = &adlib_group_data[0];
_mixer = g_vm->_mixer;
@@ -3053,8 +3051,6 @@ SoundBlasterDriver::SoundBlasterDriver(): SoundDriver() {
_masterVolume = 0;
_groupData._groupMask = 1;
- _groupData._v1 = 0x3E;
- _groupData._v2 = 0;
static byte const group_data[] = { 3, 1, 1, 0, 0xff };
_groupData._pData = group_data;
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h
index 3f039ff9e9..fefe8ad101 100644
--- a/engines/tsage/sound.h
+++ b/engines/tsage/sound.h
@@ -63,8 +63,6 @@ public:
struct GroupData {
uint32 _groupMask;
- byte _v1;
- byte _v2;
const byte *_pData;
};
diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp
index 2749f2ac90..fb08195180 100644
--- a/engines/tsage/staticres.cpp
+++ b/engines/tsage/staticres.cpp
@@ -213,6 +213,14 @@ char const *const ACCESS_CODE_REQUIRED = "access code required";
char const *const INVALID_ACCESS_CODE = "invalid access code";
char const *const FOREIGN_OBJECT_EXTRACTED = "foreign object extracted";
+// Scene 1330/7 Options dialog messages
+char const *const AUTO_PLAY_ON = "Auto-Play is On";
+char const *const AUTO_PLAY_OFF = "Auto-Play is Off";
+char const *const START_NEW_CARD_GAME = "Start a new game";
+char const *const QUIT_CARD_GAME = "Quit Outpost Alpha";
+char const *const CONTINUE_CARD_GAME = "Continue Outpost Alpha";
+
+//
char const *const HELP_MSG = "\x1\rRETURN TO\r RINGWORLD\x14";
char const *const CHAR_TITLE = "\x01Select Character:";
char const *const CHAR_QUINN_MSG = " Quinn ";
@@ -245,6 +253,8 @@ char const *const USE_INTERCEPTOR = "Do you want to use your interceptor card?";
char const *const USE_DOUBLE_AGENT = "Do you want to use your double agent?";
char const *const NEED_INSTRUCTIONS = "Do you want instructions?";
char const *const WRONG_ANSWER_MSG = "Wrong respond value sent.";
+char const *const BUY_FULL_GAME_MSG = "To order the complete game, RETURN TO RINGWORLD, call 1-800-482-3766!";
+
const byte scene1550JunkLocationsDefault[] = {
20, 7, 41, 6,
3, 6, 42, 11,
diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h
index 587463a918..334a240f28 100644
--- a/engines/tsage/staticres.h
+++ b/engines/tsage/staticres.h
@@ -165,6 +165,13 @@ extern char const *const ACCESS_CODE_REQUIRED;
extern char const *const INVALID_ACCESS_CODE;
extern char const *const FOREIGN_OBJECT_EXTRACTED;
+// Scene 1330/7 Options dialog messages
+extern char const *const AUTO_PLAY_ON;
+extern char const *const AUTO_PLAY_OFF;
+extern char const *const START_NEW_CARD_GAME;
+extern char const *const QUIT_CARD_GAME;
+extern char const *const CONTINUE_CARD_GAME;
+
// Dialog messages
extern char const *const HELP_MSG;
extern char const *const CHAR_TITLE;
@@ -199,6 +206,7 @@ extern char const *const USE_DOUBLE_AGENT;
extern char const *const NEED_INSTRUCTIONS;
extern char const *const WRONG_ANSWER_MSG;
+extern char const *const BUY_FULL_GAME_MSG;
// Scene 1550 arrays of constants
extern const byte scene1550JunkLocationsDefault[];
extern const byte scene1550AreaMap[];
diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp
index 37e96c75e0..36708e373e 100644
--- a/engines/tsage/tsage.cpp
+++ b/engines/tsage/tsage.cpp
@@ -39,10 +39,12 @@ TSageEngine::TSageEngine(OSystem *system, const tSageGameDescription *gameDesc)
g_vm = this;
DebugMan.addDebugChannel(kRingDebugScripts, "scripts", "Scripts debugging");
_debugger = nullptr;
- if (g_vm->getFeatures() & GF_DEMO)
- _debugger = new DemoDebugger();
- else if (g_vm->getGameID() == GType_Ringworld)
- _debugger = new RingworldDebugger();
+ if (g_vm->getGameID() == GType_Ringworld) {
+ if (g_vm->getFeatures() & GF_DEMO)
+ _debugger = new DemoDebugger();
+ else
+ _debugger = new RingworldDebugger();
+ }
else if (g_vm->getGameID() == GType_BlueForce)
_debugger = new BlueForceDebugger();
else if (g_vm->getGameID() == GType_Ringworld2)
@@ -76,16 +78,16 @@ void TSageEngine::initialize() {
// Set up the resource manager
g_resourceManager = new ResourceManager();
- if (g_vm->getFeatures() & GF_DEMO) {
- // Add the single library file associated with the demo
- g_resourceManager->addLib(getPrimaryFilename());
- g_globals = new Globals();
-
- } else if (g_vm->getGameID() == GType_Ringworld) {
- g_resourceManager->addLib("RING.RLB");
- g_resourceManager->addLib("TSAGE.RLB");
- g_globals = new Globals();
-
+ if (g_vm->getGameID() == GType_Ringworld) {
+ if (g_vm->getFeatures() & GF_DEMO) {
+ // Add the single library file associated with the demo
+ g_resourceManager->addLib(getPrimaryFilename());
+ g_globals = new Globals();
+ } else {
+ g_resourceManager->addLib("RING.RLB");
+ g_resourceManager->addLib("TSAGE.RLB");
+ g_globals = new Globals();
+ }
} else if (g_vm->getGameID() == GType_BlueForce) {
g_resourceManager->addLib("BLUE.RLB");
if (g_vm->getFeatures() & GF_FLOPPY) {
@@ -177,8 +179,4 @@ void TSageEngine::syncSoundSettings() {
g_globals->_soundManager.syncSounds();
}
-bool TSageEngine::shouldQuit() {
- return getEventManager()->shouldQuit() || getEventManager()->shouldRTL();
-}
-
} // End of namespace TsAGE
diff --git a/engines/tsage/tsage.h b/engines/tsage/tsage.h
index 41179c4915..e69fe0612a 100644
--- a/engines/tsage/tsage.h
+++ b/engines/tsage/tsage.h
@@ -27,6 +27,7 @@
#include "common/rect.h"
#include "audio/mixer.h"
#include "common/file.h"
+#include "gui/debugger.h"
#include "tsage/core.h"
#include "tsage/resources.h"
@@ -76,12 +77,12 @@ public:
MemoryManager _memoryManager;
Debugger *_debugger;
+ GUI::Debugger *getDebugger() { return _debugger; }
const char *getGameId() const;
uint32 getGameID() const;
uint32 getFeatures() const;
Common::String getPrimaryFilename() const;
- bool shouldQuit();
virtual Common::Error init();
virtual Common::Error run();
diff --git a/engines/tsage/user_interface.cpp b/engines/tsage/user_interface.cpp
index ae34ac0574..ae5c6c8cee 100644
--- a/engines/tsage/user_interface.cpp
+++ b/engines/tsage/user_interface.cpp
@@ -38,13 +38,15 @@ void StripProxy::process(Event &event) {
void UIElement::synchronize(Serializer &s) {
BackgroundSceneObject::synchronize(s);
- s.syncAsSint16LE(_field88);
+ if (s.getVersion() < 15) {
+ int useless = 0;
+ s.syncAsSint16LE(useless);
+ }
s.syncAsSint16LE(_enabled);
s.syncAsSint16LE(_frameNum);
}
void UIElement::setup(int visage, int stripNum, int frameNum, int posX, int posY, int priority) {
- _field88 = 0;
_frameNum = frameNum;
_enabled = true;
diff --git a/engines/tsage/user_interface.h b/engines/tsage/user_interface.h
index 60cefc0751..bc2398bf05 100644
--- a/engines/tsage/user_interface.h
+++ b/engines/tsage/user_interface.h
@@ -37,7 +37,6 @@ public:
class UIElement: public BackgroundSceneObject {
public:
- int _field88;
bool _enabled;
int _frameNum;
diff --git a/engines/tucker/configure.engine b/engines/tucker/configure.engine
new file mode 100644
index 0000000000..06676cf0a4
--- /dev/null
+++ b/engines/tucker/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 tucker "Bud Tucker in Double Trouble" yes
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index ae4c891c03..e39a15f469 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -178,10 +178,10 @@ bool BaseFileManager::initPaths() {
bool BaseFileManager::registerPackages(const Common::FSList &fslist) {
for (Common::FSList::const_iterator it = fslist.begin(); it != fslist.end(); ++it) {
- debugC(kWintermuteDebugFileAccess, "Adding %s", (*it).getName().c_str());
- if ((*it).getName().contains(".dcp")) {
- if (registerPackage((*it))) {
- addPath(PATH_PACKAGE, (*it));
+ debugC(kWintermuteDebugFileAccess, "Adding %s", it->getName().c_str());
+ if (it->getName().contains(".dcp")) {
+ if (registerPackage(*it)) {
+ addPath(PATH_PACKAGE, *it);
}
}
}
@@ -198,56 +198,71 @@ bool BaseFileManager::registerPackages() {
// Register without using SearchMan, as otherwise the FSNode-based lookup in openPackage will fail
// and that has to be like that to support the detection-scheme.
Common::FSList files;
- for (Common::FSList::iterator it = _packagePaths.begin(); it != _packagePaths.end(); ++it) {
- debugC(kWintermuteDebugFileAccess, "Should register folder: %s %s", (*it).getPath().c_str(), (*it).getName().c_str());
- if (!(*it).getChildren(files, Common::FSNode::kListFilesOnly)) {
- warning("getChildren() failed for path: %s", (*it).getDisplayName().c_str());
+ for (Common::FSList::const_iterator it = _packagePaths.begin(); it != _packagePaths.end(); ++it) {
+ debugC(kWintermuteDebugFileAccess, "Should register folder: %s %s", it->getPath().c_str(), it->getName().c_str());
+ if (!it->getChildren(files, Common::FSNode::kListFilesOnly)) {
+ warning("getChildren() failed for path: %s", it->getDisplayName().c_str());
}
- for (Common::FSList::iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
- if (!fileIt->getName().hasSuffix(".dcp")) {
+ for (Common::FSList::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
+ // To prevent any case sensitivity issues we make the filename
+ // all lowercase here. This makes the code slightly prettier
+ // than the equivalent of using equalsIgnoreCase.
+ Common::String fileName = fileIt->getName();
+ fileName.toLowercase();
+
+ if (!fileName.hasSuffix(".dcp")) {
continue;
}
// HACK: for Reversion1, avoid loading xlanguage_pt.dcp from the main folder:
if (_language != Common::PT_BRA && targetName.hasPrefix("reversion1")) {
- if (fileIt->getName() == "xlanguage_pt.dcp") {
+ if (fileName == "xlanguage_pt.dcp") {
continue;
}
}
+
+ // Again, make the parent's name all lowercase to avoid any case
+ // issues.
+ Common::String parentName = fileIt->getParent().getName();
+ parentName.toLowercase();
+
// Avoid registering all the language files
// TODO: Select based on the gameDesc.
- if (_language != Common::UNK_LANG && (fileIt->getParent().getName() == "language" || fileIt->getParent().getName() == "languages")) {
- Common::String parentName = fileIt->getParent().getName();
- Common::String dcpName = fileIt->getName();
+ if (_language != Common::UNK_LANG && (parentName == "language" || parentName == "languages")) {
// English
- if (_language == Common::EN_ANY && (fileIt->getName() != "english.dcp" && fileIt->getName() != "xlanguage_en.dcp")) {
+ if (_language == Common::EN_ANY && (fileName != "english.dcp" && fileName != "xlanguage_en.dcp")) {
continue;
// Chinese
- } else if (_language == Common::ZH_CNA && (fileIt->getName() != "chinese.dcp" && fileIt->getName() != "xlanguage_nz.dcp")) {
+ } else if (_language == Common::ZH_CNA && (fileName != "chinese.dcp" && fileName != "xlanguage_nz.dcp")) {
continue;
// Czech
- } else if (_language == Common::CZ_CZE && (fileIt->getName() != "czech.dcp" && fileIt->getName() != "xlanguage_cz.dcp")) {
+ } else if (_language == Common::CZ_CZE && (fileName != "czech.dcp" && fileName != "xlanguage_cz.dcp")) {
continue;
// French
- } else if (_language == Common::FR_FRA && (fileIt->getName() != "french.dcp" && fileIt->getName() != "xlanguage_fr.dcp")) {
+ } else if (_language == Common::FR_FRA && (fileName != "french.dcp" && fileName != "xlanguage_fr.dcp")) {
continue;
// German
- } else if (_language == Common::DE_DEU && (fileIt->getName() != "german.dcp" && fileIt->getName() != "xlanguage_de.dcp")) {
+ } else if (_language == Common::DE_DEU && (fileName != "german.dcp" && fileName != "xlanguage_de.dcp")) {
continue;
// Italian
- } else if (_language == Common::IT_ITA && (fileIt->getName() != "italian.dcp" && fileIt->getName() != "xlanguage_it.dcp")) {
+ } else if (_language == Common::IT_ITA && (fileName != "italian.dcp" && fileName != "xlanguage_it.dcp")) {
+ continue;
+ // Latvian
+ } else if (_language == Common::LV_LAT && (fileName != "latvian.dcp" && fileName != "xlanguage_lv.dcp")) {
+ // TODO: 'latvian.dcp' is just guesswork. Is there any
+ // game using Latvian and using this filename?
continue;
// Polish
- } else if (_language == Common::PL_POL && (fileIt->getName() != "polish.dcp" && fileIt->getName() != "xlanguage_po.dcp")) {
+ } else if (_language == Common::PL_POL && (fileName != "polish.dcp" && fileName != "xlanguage_pl.dcp")) {
continue;
// Portuguese
- } else if (_language == Common::PT_BRA && (fileIt->getName() != "portuguese.dcp" && fileIt->getName() != "xlanguage_pt.dcp")) {
+ } else if (_language == Common::PT_BRA && (fileName != "portuguese.dcp" && fileName != "xlanguage_pt.dcp")) {
continue;
// Russian
- } else if (_language == Common::RU_RUS && (fileIt->getName() != "russian.dcp" && fileIt->getName() != "xlanguage_ru.dcp")) {
+ } else if (_language == Common::RU_RUS && (fileName != "russian.dcp" && fileName != "xlanguage_ru.dcp")) {
continue;
}
}
- debugC(kWintermuteDebugFileAccess, "Registering %s %s", (*fileIt).getPath().c_str(), (*fileIt).getName().c_str());
+ debugC(kWintermuteDebugFileAccess, "Registering %s %s", fileIt->getPath().c_str(), fileIt->getName().c_str());
registerPackage((*fileIt));
}
}
@@ -281,8 +296,6 @@ Common::SeekableReadStream *BaseFileManager::openPkgFile(const Common::String &f
Common::String upcName = filename;
upcName.toUppercase();
Common::SeekableReadStream *file = nullptr;
- char fileName[MAX_PATH_LENGTH];
- Common::strlcpy(fileName, upcName.c_str(), MAX_PATH_LENGTH);
// correct slashes
for (uint32 i = 0; i < upcName.size(); i++) {
diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h
index 742d6f548d..29d312fe97 100644
--- a/engines/wintermute/base/base_game.h
+++ b/engines/wintermute/base/base_game.h
@@ -251,6 +251,8 @@ public:
void addMem(int32 bytes);
bool _touchInterface;
bool _constrainedMemory;
+
+ bool stopVideo();
protected:
BaseFont *_systemFont;
BaseFont *_videoFont;
@@ -319,7 +321,6 @@ private:
BaseGameMusic *_musicSystem;
bool isVideoPlaying();
- bool stopVideo();
BaseArray<BaseQuickMsg *> _quickMessages;
BaseArray<UIWindow *> _windows;
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index d6f09141c9..b879e789e3 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -121,7 +121,7 @@ int BaseFontTT::getTextWidth(const byte *text, int maxLength) {
}
if (maxLength >= 0 && textStr.size() > (uint32)maxLength) {
- textStr = Common::String(textStr.c_str(), (uint32)maxLength);
+ textStr = WideString(textStr.c_str(), (uint32)maxLength);
}
//text = text.substr(0, MaxLength); // TODO: Remove
@@ -155,19 +155,19 @@ void BaseFontTT::drawText(const byte *text, int x, int y, int width, TTextAlign
return;
}
- WideString textStr = (const char *)text;
+ WideString textStr;
// TODO: Why do we still insist on Widestrings everywhere?
- /* if (_gameRef->_textEncoding == TEXT_UTF8) text = StringUtil::Utf8ToWide((char *)Text);
- else text = StringUtil::AnsiToWide((char *)Text);*/
// HACK: J.U.L.I.A. uses CP1252, we need to fix that,
// And we still don't have any UTF8-support.
- if (_gameRef->_textEncoding != TEXT_UTF8) {
+ if (_gameRef->_textEncoding == TEXT_UTF8) {
+ textStr = StringUtil::utf8ToWide((const char *)text);
+ } else {
textStr = StringUtil::ansiToWide((const char *)text);
}
if (maxLength >= 0 && textStr.size() > (uint32)maxLength) {
- textStr = Common::String(textStr.c_str(), (uint32)maxLength);
+ textStr = WideString(textStr.c_str(), (uint32)maxLength);
}
//text = text.substr(0, MaxLength); // TODO: Remove
@@ -248,7 +248,7 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width,
//TextLineList lines;
// TODO: Use WideString-conversion here.
//WrapText(text, width, maxHeight, lines);
- Common::Array<Common::String> lines;
+ Common::Array<WideString> lines;
_font->wordWrapText(text, width, lines);
while (maxHeight > 0 && lines.size() * _lineHeight > maxHeight) {
@@ -267,7 +267,8 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width,
alignment = Graphics::kTextAlignRight;
}
- debugC(kWintermuteDebugFont, "%s %d %d %d %d", text.c_str(), RGBCOLGetR(_layers[0]->_color), RGBCOLGetG(_layers[0]->_color), RGBCOLGetB(_layers[0]->_color), RGBCOLGetA(_layers[0]->_color));
+ // TODO: This debug call does not work with WideString because text.c_str() returns an uint32 array.
+ //debugC(kWintermuteDebugFont, "%s %d %d %d %d", text.c_str(), RGBCOLGetR(_layers[0]->_color), RGBCOLGetG(_layers[0]->_color), RGBCOLGetB(_layers[0]->_color), RGBCOLGetA(_layers[0]->_color));
// void drawString(Surface *dst, const Common::String &str, int x, int y, int w, uint32 color, TextAlign align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true) const;
Graphics::Surface *surface = new Graphics::Surface();
if (_deletableFont) { // We actually have a TTF
@@ -276,7 +277,7 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width,
surface->create((uint16)width, (uint16)(_lineHeight * lines.size()), Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0));
}
uint32 useColor = 0xffffffff;
- Common::Array<Common::String>::iterator it;
+ Common::Array<WideString>::iterator it;
int heightOffset = 0;
for (it = lines.begin(); it != lines.end(); ++it) {
_font->drawString(surface, *it, 0, heightOffset, width, useColor, alignment);
@@ -647,9 +648,9 @@ void BaseFontTT::measureText(const WideString &text, int maxWidth, int maxHeight
//TextLineList lines;
if (maxWidth >= 0) {
- Common::Array<Common::String> lines;
+ Common::Array<WideString> lines;
_font->wordWrapText(text, maxWidth, lines);
- Common::Array<Common::String>::iterator it;
+ Common::Array<WideString>::iterator it;
textWidth = 0;
for (it = lines.begin(); it != lines.end(); ++it) {
textWidth = MAX(textWidth, _font->getStringWidth(*it));
diff --git a/engines/wintermute/base/font/base_font_truetype.h b/engines/wintermute/base/font/base_font_truetype.h
index 7a96cdf1b7..edb41a155f 100644
--- a/engines/wintermute/base/font/base_font_truetype.h
+++ b/engines/wintermute/base/font/base_font_truetype.h
@@ -56,9 +56,8 @@ private:
bool _marked;
uint32 _lastUsed;
- BaseCachedTTFontText() {
+ BaseCachedTTFontText() : _text() {
//_text = L"";
- _text = "";
_width = _maxHeight = _maxLength = -1;
_align = TAL_LEFT;
_surface = nullptr;
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index ff63789d18..35918b8e90 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -399,10 +399,23 @@ void BaseRenderOSystem::drawTickets() {
return;
}
- // Apply the clear-color to the dirty rect.
- _renderSurface->fillRect(*_dirtyRect, _clearColor);
+ it = _renderQueue.begin();
_lastFrameIter = _renderQueue.end();
- for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
+ // A special case: If the screen has one giant OPAQUE rect to be drawn, then we skip filling
+ // the background colour. Typical use-case: Fullscreen FMVs.
+ // Caveat: The FPS-counter will invalidate this.
+ if (it != _lastFrameIter && _renderQueue.front() == _renderQueue.back() && (*it)->_transform._alphaDisable == true) {
+ // If our single opaque rect fills the dirty rect, we can skip filling.
+ if (*_dirtyRect != (*it)->_dstRect) {
+ // Apply the clear-color to the dirty rect.
+ _renderSurface->fillRect(*_dirtyRect, _clearColor);
+ }
+ // Otherwise Do NOT fill.
+ } else {
+ // Apply the clear-color to the dirty rect.
+ _renderSurface->fillRect(*_dirtyRect, _clearColor);
+ }
+ for (; it != _renderQueue.end(); ++it) {
RenderTicket *ticket = *it;
if (ticket->_dstRect.intersects(*_dirtyRect)) {
// dstClip is the area we want redrawn.
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
index 9ec8573a87..73797f20f3 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
@@ -447,8 +447,14 @@ bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, Rect32 *newRect,
bool BaseSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAlpha) {
_loaded = true;
- _surface->free();
- _surface->copyFrom(surface);
+ if (surface.format == _surface->format && surface.w == _surface->w && surface.h == _surface->h) {
+ const byte *src = (const byte*) surface.getBasePtr(0, 0);
+ byte *dst = (byte*) _surface->getBasePtr(0, 0);
+ memcpy(dst, src, surface.pitch * surface.h);
+ } else {
+ _surface->free();
+ _surface->copyFrom(surface);
+ }
if (hasAlpha) {
_alphaType = TransparentSurface::ALPHA_FULL;
} else {
diff --git a/engines/wintermute/base/saveload.cpp b/engines/wintermute/base/saveload.cpp
index 8d37909bb4..402041cda4 100644
--- a/engines/wintermute/base/saveload.cpp
+++ b/engines/wintermute/base/saveload.cpp
@@ -48,6 +48,7 @@ bool SaveLoad::loadGame(const Common::String &filename, BaseGame *gameRef) {
bool ret;
+ gameRef->stopVideo();
gameRef->_renderer->initSaveLoad(false);
gameRef->_loadInProgress = true;
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp
index b6d284442d..65bec03bc1 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_string.cpp
@@ -298,21 +298,13 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
uint32 start = 0;
for(uint32 i = 0; i < str.size() + 1; i++) {
- char ch = str.c_str()[i];
- if(ch=='\0' || delims.contains(ch))
- {
- char *part = new char[i - start + 1];
- if(i != start) {
- Common::strlcpy(part, str.c_str() + start, i - start + 1);
- part[i - start] = '\0';
+ uint32 ch = str[i];
+ if (ch =='\0' || delims.contains(ch)) {
+ if (i != start) {
+ parts.push_back(WideString(str.c_str() + start, i - start + 1));
} else {
- part[0] = '\0';
+ parts.push_back(WideString());
}
- val = new ScValue(_gameRef, part);
- array->push(val);
- delete[] part;
- delete val;
- val = nullptr;
start = i + 1;
}
}
diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp
index 7666a441a3..85ba52e334 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.cpp
+++ b/engines/wintermute/base/sound/base_sound_buffer.cpp
@@ -58,6 +58,7 @@ BaseSoundBuffer::BaseSoundBuffer(BaseGame *inGame) : BaseClass(inGame) {
_file = nullptr;
_privateVolume = 255;
_volume = 255;
+ _pan = 0;
_looping = false;
_loopStart = 0;
@@ -143,9 +144,9 @@ bool BaseSoundBuffer::play(bool looping, uint32 startSample) {
_handle = new Audio::SoundHandle;
if (_looping) {
Audio::AudioStream *loopStream = new Audio::LoopingAudioStream(_stream, 0, DisposeAfterUse::NO);
- g_system->getMixer()->playStream(_type, _handle, loopStream, -1, _volume, 0, DisposeAfterUse::YES);
+ g_system->getMixer()->playStream(_type, _handle, loopStream, -1, _volume, _pan, DisposeAfterUse::YES);
} else {
- g_system->getMixer()->playStream(_type, _handle, _stream, -1, _volume, 0, DisposeAfterUse::NO);
+ g_system->getMixer()->playStream(_type, _handle, _stream, -1, _volume, _pan, DisposeAfterUse::NO);
}
}
@@ -268,8 +269,11 @@ bool BaseSoundBuffer::setLoopStart(uint32 pos) {
//////////////////////////////////////////////////////////////////////////
bool BaseSoundBuffer::setPan(float pan) {
+ pan = MAX(pan, -1.0f);
+ pan = MIN(pan, 1.0f);
+ _pan = (int8)(pan * 127);
if (_handle) {
- g_system->getMixer()->setChannelBalance(*_handle, (int8)(pan * 127));
+ g_system->getMixer()->setChannelBalance(*_handle, _pan);
}
return STATUS_OK;
}
diff --git a/engines/wintermute/base/sound/base_sound_buffer.h b/engines/wintermute/base/sound/base_sound_buffer.h
index 53b86f64c6..c52b34fb23 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.h
+++ b/engines/wintermute/base/sound/base_sound_buffer.h
@@ -93,6 +93,7 @@ private:
bool _streamed;
Common::SeekableReadStream *_file;
int32 _volume;
+ int8 _pan;
};
} // End of namespace Wintermute
diff --git a/engines/wintermute/configure.engine b/engines/wintermute/configure.engine
new file mode 100644
index 0000000000..bdaf49de3f
--- /dev/null
+++ b/engines/wintermute/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 wintermute "Wintermute" yes "" "" "jpeg png zlib vorbis 16bit"
diff --git a/engines/wintermute/dctypes.h b/engines/wintermute/dctypes.h
index b40322147f..4371ee4889 100644
--- a/engines/wintermute/dctypes.h
+++ b/engines/wintermute/dctypes.h
@@ -31,6 +31,7 @@
#include "common/str.h"
+#include "common/ustr.h"
#include "common/list.h"
#include "common/array.h"
@@ -41,7 +42,7 @@ namespace Wintermute {
//typedef std::wstring WideString;
typedef Common::String AnsiString;
typedef Common::String Utf8String;
-typedef Common::String WideString; // NB: Not actually true I presume.
+typedef Common::U32String WideString;
typedef Common::List<WideString> WideStringList;
typedef Common::List<AnsiString> AnsiStringList;
diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h
index 46e05f2768..e7f2ed90a9 100644
--- a/engines/wintermute/detection_tables.h
+++ b/engines/wintermute/detection_tables.h
@@ -27,8 +27,10 @@ namespace Wintermute {
static const PlainGameDescriptor wintermuteGames[] = {
{"5ld", "Five Lethal Demons"},
{"5ma", "Five Magical Amulets"},
- {"bthreshold", "Beyond the Threshold"},
{"actualdest", "Actual Destination"},
+ {"bickadoodle", "Bickadoodle"},
+ {"bookofgron", "Book of Gron Part One"},
+ {"bthreshold", "Beyond the Threshold"},
{"carolreed4", "Carol Reed 4 - East Side Story"},
{"carolreed5", "Carol Reed 5 - The Colour of Murder"},
{"carolreed6", "Carol Reed 6 - Black Circle"},
@@ -41,18 +43,23 @@ static const PlainGameDescriptor wintermuteGames[] = {
{"dirtysplit", "Dirty Split"},
{"dreamscape", "Dreamscape"},
{"escapemansion", "Escape from the Mansion"},
+ {"framed", "Framed"},
{"ghostsheet", "Ghost in the Sheet"},
{"hamlet", "Hamlet or the last game without MMORPS features, shaders and product placement"},
{"helga", "Helga Deep In Trouble"},
{"jamesperis", "James Peris: No License Nor Control"},
+ {"kulivocko", "Kulivocko"},
+ {"lonelyrobot", "Project Lonely Robot"},
{"looky", "Looky"},
{"julia", "J.U.L.I.A."},
{"mirage", "Mirage"},
{"paintaria", "Paintaria"},
{"pigeons", "Pigeons in the Park"},
+ {"projectdoom", "Project: Doom"},
{"reversion1", "Reversion: The Escape"},
{"reversion2", "Reversion: The Meeting"},
{"rosemary", "Rosemary"},
+ {"securanote", "Securanote"},
{"shaban", "Shaban"},
{"shinestar", "The Shine of a Star"},
{"spaceinvaders", "Space Invaders"},
@@ -62,6 +69,7 @@ static const PlainGameDescriptor wintermuteGames[] = {
{"tradestory", "The Trader of Stories"},
{"twc", "the white chamber"},
{"wintermute", "Wintermute engine game"},
+ {"wtetris", "Wilma Tetris"},
{0, 0}
};
@@ -106,6 +114,26 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Bickadoodle
+ {
+ "bickadoodle",
+ "",
+ AD_ENTRY1s("data.dcp", "84db4d1594cac95e25614985775d10a8", 35303844),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Book of Gron Part One
+ {
+ "bookofgron",
+ "",
+ AD_ENTRY1s("data.dcp", "e61b2ebee044a82fa0f8ca0fce2c8946", 83129531),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Carol Reed 4 - East Side Story (Demo)
{
"carolreed4",
@@ -267,6 +295,19 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Dirty Split (Czech)
+ {
+ "dirtysplit",
+ "",
+ {
+ {"czech.dcp", 0, "08a71446467cf8f9444cfea446b46ad6", 127697934},
+ {"data.dcp", 0, "8b4b81b718bf65f30a67fc0b1e329eb5", 88577623},
+ },
+ Common::CZ_CZE,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Dirty Split (English)
{
"dirtysplit",
@@ -277,6 +318,20 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Dirty Split (French)
+ {
+ "dirtysplit",
+ "",
+ {
+ {"french.dcp", 0, "a0508dedebd0fe478d0158fa4c2a1136", 125534323},
+ {"data.dcp", 0, "e6d70c7f5d181b761cfcf974adf9186a", 88577623},
+ AD_LISTEND
+ },
+ Common::FR_FRA,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Dirty Split (German)
{
"dirtysplit",
@@ -287,6 +342,32 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Dirty Split (Italian)
+ {
+ "dirtysplit",
+ "",
+ {
+ {"italian.dcp", 0, "8108807fbd8af70be1ec452d0fd1131b", 125513726},
+ {"data.dcp", 0, "35a150e22af274185883fdbb142c6fb1", 88577623},
+ },
+ Common::IT_ITA,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Dirty Split (Spanish)
+ {
+ "dirtysplit",
+ "",
+ {
+ {"spanish.dcp", 0, "b3982c0a5e85b42e1e38240fef004aa4", 164428596},
+ {"data.dcp", 0, "63766d6c68b9f00b632ea1736fc8a95c", 88577621},
+ },
+ Common::ES_ESP,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Des Reves Elastiques Avec Mille Insectes Nommes Georges
{
"dreaming",
@@ -327,6 +408,26 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Escape from the Mansion
+ {
+ "escapemansion",
+ "1.3",
+ AD_ENTRY1s("data.dcp", "1e5d231b56c8a228cd15cb690f50253e", 29261972),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Framed
+ {
+ "framed",
+ "",
+ AD_ENTRY1s("data.dcp", "e7259fb36f2c6f9f28242291e0c3de98", 34690568),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Ghosts in the Sheet
{
"ghostsheet",
@@ -348,6 +449,20 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Helga Deep In Trouble (English)
+ {
+ "helga",
+ "",
+ {
+ {"english.dcp", 0, "bfa136b21bdbc7d8691c0770a6d40bc3", 135931},
+ {"data.dcp", 0, "25cb955a60b58326f2eeda1ce288fb37", 183251259},
+ AD_LISTEND
+ },
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Helga Deep In Trouble (Demo) (English)
{
"helga",
@@ -437,6 +552,27 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_DEMO,
GUIO0()
},
+ // Kulivocko (Czech)
+ {
+ "kulivocko",
+ "",
+ AD_ENTRY1s("data.dcp", "44306dc470e9b27474043932eccee02f", 155106392),
+ Common::CZ_CZE,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Kulivocko (Czech) (Demo)
+ {
+ "kulivocko",
+ "Demo",
+ AD_ENTRY1s("data.dcp", "63b164bdfadecbb0deb5da691afb8154", 48362234),
+ Common::CZ_CZE,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE |
+ ADGF_DEMO,
+ GUIO0()
+ },
// Looky Demo (English)
{
"looky",
@@ -511,6 +647,27 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Project: Doom
+ {
+ "projectdoom",
+ "",
+ AD_ENTRY1s("data.dcp", "d5894b65a40706845434b99870bcab92", 99223761),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Project Lonely Robot
+ {
+ "lonelyrobot",
+ "beta",
+ AD_ENTRY1s("data.dcp", "a0cf7ad5bab957416dcda454e9f28ef0", 3420120),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE |
+ ADGF_DEMO,
+ GUIO0()
+ },
// Reversion: The Escape Version 1.0
{
"reversion1",
@@ -689,6 +846,118 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Reversion: The Escape Version 1.3.2369 (Chinese)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_nz.dcp", 0, "7146dfa43ffdf0886e034fffe2c8a0c0", 13722261},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::ZH_CNA,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (English)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_en.dcp", 0, "64b6fa7eedc09c231f6ce046e77fee05", 11339619},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (French)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_fr.dcp", 0, "d561d562224afea809153a1fd9fdb0c0", 11963210},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::FR_FRA,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (German)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_de.dcp", 0, "4e3f614c36bd6bae74b8cc83e663a8f0", 14040310},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::DE_DEU,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (Italian)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_it.dcp", 0, "10d09b7fe61946f09dd91d5e8d090f94", 11913752},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::IT_ITA,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (Latvian)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_lv.dcp", 0, "704359ab5040b0dab6545064d7aa6eb9", 11414925},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::LV_LAT,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (Polish)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_pl.dcp", 0, "c4ad33f57e1e998169552d521c1d6638", 11532215},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::PL_POL,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
+ // Reversion: The Escape Version 1.3.2369 (Portuguese)
+ {
+ "reversion1",
+ "Version 1.3.2369",
+ {
+ {"xlanguage_pt.dcp", 0, "886886b6b14aadac844078de856799a6", 10620797},
+ {"data.dcp", 0, "aecb5deeea7b0baa871fbd0cef35a648", 254219204},
+ AD_LISTEND
+ },
+ Common::PT_BRA,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Reversion: The Meeting (Chinese)
{
"reversion2",
@@ -737,6 +1006,16 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Securanote
+ {
+ "securanote",
+ "",
+ AD_ENTRY1s("data.dcp", "5213d3e59b9e95b7fbd5c56f7de5341a", 2625554),
+ Common::EN_ANY,
+ Common::kPlatformIOS,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
// Shaban
{
"shaban",
@@ -819,6 +1098,16 @@ static const ADGameDescription gameDescriptions[] = {
ADGF_UNSTABLE,
GUIO0()
},
+ // Wilma Tetris
+ {
+ "wtetris",
+ "",
+ AD_ENTRY1s("data.dcp", "946e3a0496e6c12fb344c9ed861ff015", 2780093),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_UNSTABLE,
+ GUIO0()
+ },
AD_TABLE_END_MARKER
};
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp
index 053acf29e9..79722439bd 100644
--- a/engines/wintermute/graphics/transparent_surface.cpp
+++ b/engines/wintermute/graphics/transparent_surface.cpp
@@ -519,9 +519,9 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
byte *ino= (byte *)img->getBasePtr(xp, yp);
byte *outo = (byte *)target.getBasePtr(posX, posY);
- if (color == 0xFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_OPAQUE) {
+ if (color == 0xFFFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_OPAQUE) {
doBlitOpaqueFast(ino, outo, img->w, img->h, target.pitch, inStep, inoStep);
- } else if (color == 0xFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_BINARY) {
+ } else if (color == 0xFFFFFFFF && blendMode == BLEND_NORMAL && _alphaMode == ALPHA_BINARY) {
doBlitBinaryFast(ino, outo, img->w, img->h, target.pitch, inStep, inoStep);
} else {
if (blendMode == BLEND_ADDITIVE) {
diff --git a/engines/wintermute/utils/string_util.cpp b/engines/wintermute/utils/string_util.cpp
index d5d6c7f702..702dd04c27 100644
--- a/engines/wintermute/utils/string_util.cpp
+++ b/engines/wintermute/utils/string_util.cpp
@@ -48,201 +48,96 @@ bool StringUtil::compareNoCase(const AnsiString &str1, const AnsiString &str2) {
return (str1lc == str2lc);
}*/
-Common::String StringUtil::substituteUtf8Characters(Common::String &str) {
- uint strSize = str.size();
- Common::String punctuation("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");
-
- if (isAscii(str))
- return str;
-
- for (uint32 i = 0; i < strSize; i++) {
- if (!Common::isAlnum(str[i]) && str[i] != ' ' && !punctuation.contains(str[i])) {
- // Replace some UTF-8 characters with (almost) equivalent ANSII ones
- if ((byte)str[i] == 0xc2 && i + 1 < str.size() && (byte)str[i + 1] == 0xa9) {
- // UTF-8 copyright character, substitute with 'c'
- str.deleteChar(i);
- str.setChar('c', i);
- strSize--;
- }
- }
- }
-
- return str;
-}
-
-bool StringUtil::isAscii(const Common::String &str) {
- Common::String punctuation("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");
-
- for (uint32 i = 0; i < str.size(); i++) {
- if (!Common::isAlnum(str[i]) && str[i] != ' ' && !punctuation.contains(str[i]))
- return false;
- }
-
- return true;
-}
-
//////////////////////////////////////////////////////////////////////////
WideString StringUtil::utf8ToWide(const Utf8String &Utf8Str) {
- // WORKAROUND: Since wide strings aren't supported yet, we make this function
- // work at least with ASCII strings. This should cover all English versions.
- Common::String asciiString = Utf8Str;
- asciiString = substituteUtf8Characters(asciiString);
- if (isAscii(asciiString)) {
- // No special (UTF-8) characters found, just return the string
- return asciiString;
- } else {
- warning("String contains special (UTF-8) characters: '%s'", Utf8Str.c_str());
- }
-
- error("StringUtil::Utf8ToWide - WideString not supported yet for UTF-8 characters");
-
- /* size_t WideSize = Utf8Str.size();
-
- if (sizeof(wchar_t) == 2) {
- wchar_t *WideStringNative = new wchar_t[WideSize + 1];
-
- const UTF8 *SourceStart = reinterpret_cast<const UTF8 *>(Utf8Str.c_str());
- const UTF8 *SourceEnd = SourceStart + WideSize;
+ size_t wideSize = Utf8Str.size();
- UTF16 *TargetStart = reinterpret_cast<UTF16 *>(WideStringNative);
- UTF16 *TargetEnd = TargetStart + WideSize + 1;
+ uint32 *wideStringNative = new uint32[wideSize + 1];
- ConversionResult res = ConvertUTF8toUTF16(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion);
- if (res != conversionOK) {
- delete[] WideStringNative;
- return L"";
- }
- *TargetStart = 0;
- WideString ResultString(WideStringNative);
- delete[] WideStringNative;
+ const UTF8 *sourceStart = reinterpret_cast<const UTF8 *>(Utf8Str.c_str());
+ const UTF8 *sourceEnd = sourceStart + wideSize;
- return ResultString;
- } else if (sizeof(wchar_t) == 4) {
- wchar_t *WideStringNative = new wchar_t[WideSize + 1];
+ UTF32 *targetStart = reinterpret_cast<UTF32 *>(wideStringNative);
+ UTF32 *targetEnd = targetStart + wideSize;
- const UTF8 *SourceStart = reinterpret_cast<const UTF8 *>(Utf8Str.c_str());
- const UTF8 *SourceEnd = SourceStart + WideSize;
-
- UTF32 *TargetStart = reinterpret_cast<UTF32 *>(WideStringNative);
- UTF32 *TargetEnd = TargetStart + WideSize;
-
- ConversionResult res = ConvertUTF8toUTF32(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion);
- if (res != conversionOK) {
- delete[] WideStringNative;
- return L"";
- }
- *TargetStart = 0;
- WideString ResultString(WideStringNative);
- delete[] WideStringNative;
-
- return ResultString;
- } else {
- return L"";
- }*/
- return "";
+ ConversionResult res = ConvertUTF8toUTF32(&sourceStart, sourceEnd, &targetStart, targetEnd, strictConversion);
+ if (res != conversionOK) {
+ delete[] wideStringNative;
+ return WideString();
+ }
+ *targetStart = 0;
+ WideString resultString(wideStringNative);
+ delete[] wideStringNative;
+ return resultString;
}
//////////////////////////////////////////////////////////////////////////
Utf8String StringUtil::wideToUtf8(const WideString &WideStr) {
- // WORKAROUND: Since UTF-8 strings aren't supported yet, we make this function
- // work at least with ASCII strings. This should cover all English versions.
- Common::String asciiString = WideStr;
- asciiString = substituteUtf8Characters(asciiString);
- if (isAscii(asciiString)) {
- // No special (UTF-8) characters found, just return the string
- return asciiString;
- } else {
- warning("String contains special (UTF-8) characters: '%s'", WideStr.c_str());
- }
+ size_t wideSize = WideStr.size();
- error("StringUtil::wideToUtf8 - WideString not supported yet for UTF-8 characters");
-
- /* size_t WideSize = WideStr.length();
+ size_t utf8Size = 4 * wideSize + 1;
+ char *utf8StringNative = new char[utf8Size];
- if (sizeof(wchar_t) == 2) {
- size_t utf8Size = 3 * WideSize + 1;
- char *utf8StringNative = new char[Utf8Size];
+ const UTF32 *sourceStart = reinterpret_cast<const UTF32 *>(WideStr.c_str());
+ const UTF32 *sourceEnd = sourceStart + wideSize;
- const UTF16 *SourceStart = reinterpret_cast<const UTF16 *>(WideStr.c_str());
- const UTF16 *SourceEnd = SourceStart + WideSize;
+ UTF8 *targetStart = reinterpret_cast<UTF8 *>(utf8StringNative);
+ UTF8 *targetEnd = targetStart + utf8Size;
- UTF8 *TargetStart = reinterpret_cast<UTF8 *>(Utf8StringNative);
- UTF8 *TargetEnd = TargetStart + Utf8Size;
-
- ConversionResult res = ConvertUTF16toUTF8(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion);
- if (res != conversionOK) {
- delete[] Utf8StringNative;
- return (Utf8String)"";
- }
- *TargetStart = 0;
- Utf8String ResultString(Utf8StringNative);
- delete[] Utf8StringNative;
- return ResultString;
- } else if (sizeof(wchar_t) == 4) {
- size_t utf8Size = 4 * WideSize + 1;
- char *utf8StringNative = new char[Utf8Size];
-
- const UTF32 *SourceStart = reinterpret_cast<const UTF32 *>(WideStr.c_str());
- const UTF32 *SourceEnd = SourceStart + WideSize;
-
- UTF8 *TargetStart = reinterpret_cast<UTF8 *>(Utf8StringNative);
- UTF8 *TargetEnd = TargetStart + Utf8Size;
-
- ConversionResult res = ConvertUTF32toUTF8(&SourceStart, SourceEnd, &TargetStart, TargetEnd, strictConversion);
- if (res != conversionOK) {
- delete[] Utf8StringNative;
- return (Utf8String)"";
- }
- *TargetStart = 0;
- Utf8String ResultString(Utf8StringNative);
- delete[] Utf8StringNative;
- return ResultString;
- } else {
- return (Utf8String)"";
- }*/
- return "";
+ ConversionResult res = ConvertUTF32toUTF8(&sourceStart, sourceEnd, &targetStart, targetEnd, strictConversion);
+ if (res != conversionOK) {
+ delete[] utf8StringNative;
+ return Utf8String();
+ }
+ *targetStart = 0;
+ Utf8String resultString(utf8StringNative);
+ delete[] utf8StringNative;
+ return resultString;
}
//////////////////////////////////////////////////////////////////////////
WideString StringUtil::ansiToWide(const AnsiString &str) {
- // TODO: This function gets called a lot, so warnings like these drown out the usefull information
- Common::String converted = "";
- uint32 index = 0;
- while (index != str.size()) {
- byte c = str[index];
- if (c == 146) {
- converted += (char)39; // Replace right-quote with apostrophe
- } else if (c == 133) {
- converted += Common::String("..."); // Replace ...-symbol with ...
+ WideString result;
+ for (AnsiString::const_iterator i = str.begin(), end = str.end(); i != end; ++i) {
+ const byte c = *i;
+ if (c < 0x80 || c >= 0xA0) {
+ result += c;
} else {
- converted += c;
+ uint32 utf32 = _ansiToUTF32[c - 0x80];
+ if (utf32) {
+ result += utf32;
+ } else {
+ // It's an invalid CP1252 character...
+ }
}
- index++;
}
- // using default os locale!
-
- /* setlocale(LC_CTYPE, "");
- size_t wideSize = mbstowcs(NULL, str.c_str(), 0) + 1;
- wchar_t *wstr = new wchar_t[WideSize];
- mbstowcs(wstr, str.c_str(), WideSize);
- WideString ResultString(wstr);
- delete[] wstr;
- return ResultString;*/
- return WideString(converted);
+ return result;
}
//////////////////////////////////////////////////////////////////////////
AnsiString StringUtil::wideToAnsi(const WideString &wstr) {
- // using default os locale!
- // TODO: This function gets called a lot, so warnings like these drown out the usefull information
- /* setlocale(LC_CTYPE, "");
- size_t wideSize = wcstombs(NULL, wstr.c_str(), 0) + 1;
- char *str = new char[WideSize];
- wcstombs(str, wstr.c_str(), WideSize);
- AnsiString ResultString(str);
- delete[] str;
- return ResultString;*/
- return AnsiString(wstr);
+ AnsiString result;
+ for (WideString::const_iterator i = wstr.begin(), end = wstr.end(); i != end; ++i) {
+ const uint32 c = *i;
+ if (c < 0x80 || (c >= 0xA0 && c <= 0xFF)) {
+ result += c;
+ } else {
+ uint32 ansi = 0xFFFFFFFF;
+ for (uint j = 0; j < ARRAYSIZE(_ansiToUTF32); ++j) {
+ if (_ansiToUTF32[j] == c) {
+ ansi = j + 0x80;
+ break;
+ }
+ }
+
+ if (ansi != 0xFFFFFFFF) {
+ result += ansi;
+ } else {
+ // There's no valid CP1252 code for this character...
+ }
+ }
+ }
+ return result;
}
//////////////////////////////////////////////////////////////////////////
@@ -256,12 +151,7 @@ bool StringUtil::isUtf8BOM(const byte *buffer, uint32 bufferSize) {
//////////////////////////////////////////////////////////////////////////
int StringUtil::indexOf(const WideString &str, const WideString &toFind, size_t startFrom) {
- const char *index = strstr(str.c_str(), toFind.c_str());
- if (index == nullptr) {
- return -1;
- } else {
- return index - str.c_str();
- }
+ return str.find(toFind, startFrom);
}
Common::String StringUtil::encodeSetting(const Common::String &str) {
@@ -282,5 +172,10 @@ AnsiString StringUtil::toString(int val) {
return Common::String::format("%d", val);
}
+// Mapping of CP1252 characters 0x80...0x9F into UTF-32
+uint32 StringUtil::_ansiToUTF32[32] = {
+ 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000,
+ 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178
+};
} // End of namespace Wintermute
diff --git a/engines/wintermute/utils/string_util.h b/engines/wintermute/utils/string_util.h
index 05931beb79..14c40fcb2b 100644
--- a/engines/wintermute/utils/string_util.h
+++ b/engines/wintermute/utils/string_util.h
@@ -37,8 +37,6 @@ class StringUtil {
public:
static bool compareNoCase(const AnsiString &str1, const AnsiString &str2);
//static bool compareNoCase(const WideString &str1, const WideString &str2);
- static bool isAscii(const Common::String &str);
- static Common::String substituteUtf8Characters(Common::String &str);
static WideString utf8ToWide(const Utf8String &Utf8Str);
static Utf8String wideToUtf8(const WideString &WideStr);
static WideString ansiToWide(const AnsiString &str);
@@ -51,6 +49,9 @@ public:
static Common::String decodeSetting(const Common::String &str);
static AnsiString toString(int val);
+
+private:
+ static uint32 _ansiToUTF32[32];
};
} // End of namespace Wintermute
diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp
index 44eecf93a8..aedc9bf025 100644
--- a/engines/wintermute/video/video_theora_player.cpp
+++ b/engines/wintermute/video/video_theora_player.cpp
@@ -305,8 +305,15 @@ bool VideoTheoraPlayer::update() {
if (!_theoraDecoder->endOfVideo() && _theoraDecoder->getTimeToNextFrame() == 0) {
const Graphics::Surface *decodedFrame = _theoraDecoder->decodeNextFrame();
if (decodedFrame) {
- _surface.free();
- _surface.copyFrom(*decodedFrame);
+ if (decodedFrame->format == _surface.format && decodedFrame->w == _surface.w && decodedFrame->h == _surface.h) {
+ const byte *src = (const byte*) decodedFrame->getBasePtr(0, 0);
+ byte *dst = (byte*) _surface.getBasePtr(0, 0);
+ memcpy(dst, src, _surface.pitch * _surface.h);
+ } else {
+ _surface.free();
+ _surface.copyFrom(*decodedFrame);
+ }
+
if (_texture) {
writeVideo();
}
diff --git a/engines/zvision/configure.engine b/engines/zvision/configure.engine
new file mode 100644
index 0000000000..02e31943af
--- /dev/null
+++ b/engines/zvision/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 zvision "ZVision" no "" "" "freetype2 16bit"
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 1c525c1fc1..7c130fc87f 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -24,6 +24,7 @@
#ifndef ZVISION_ZVISION_H
#define ZVISION_ZVISION_H
+#include "zvision/core/console.h"
#include "zvision/detection.h"
#include "zvision/utility/clock.h"
@@ -44,7 +45,6 @@ class VideoDecoder;
namespace ZVision {
struct ZVisionGameDescription;
-class Console;
class ScriptManager;
class RenderManager;
class CursorManager;
@@ -117,6 +117,7 @@ public:
StringManager *getStringManager() const { return _stringManager; }
Common::RandomSource *getRandomSource() const { return _rnd; }
ZVisionGameId getGameId() const { return _gameDescription->gameId; }
+ GUI::Debugger *getDebugger() { return _console; }
/**
* Play a video until it is finished. This is a blocking call. It will call