aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/access/martian/martian_game.cpp12
-rw-r--r--engines/access/martian/martian_game.h4
-rw-r--r--engines/access/martian/martian_resources.cpp6
-rw-r--r--engines/access/martian/martian_resources.h4
-rw-r--r--engines/access/martian/martian_room.cpp4
-rw-r--r--engines/access/martian/martian_room.h4
-rw-r--r--engines/access/martian/martian_scripts.cpp16
-rw-r--r--engines/access/martian/martian_scripts.h4
-rw-r--r--engines/adl/display.h2
-rw-r--r--engines/agi/opcodes.h2
-rw-r--r--engines/avalanche/highscore.cpp46
-rw-r--r--engines/avalanche/highscore.h46
-rw-r--r--engines/avalanche/mainmenu.cpp46
-rw-r--r--engines/avalanche/mainmenu.h46
-rw-r--r--engines/bbvs/bbvs.cpp4
-rw-r--r--engines/bbvs/bbvs.h4
-rw-r--r--engines/bbvs/detection.cpp4
-rw-r--r--engines/bbvs/dialogs.cpp4
-rw-r--r--engines/bbvs/dialogs.h4
-rw-r--r--engines/bbvs/gamemodule.cpp4
-rw-r--r--engines/bbvs/gamemodule.h4
-rw-r--r--engines/bbvs/graphics.cpp4
-rw-r--r--engines/bbvs/graphics.h4
-rw-r--r--engines/bbvs/logic.cpp4
-rw-r--r--engines/bbvs/minigames/bbairguitar.cpp4
-rw-r--r--engines/bbvs/minigames/bbairguitar.h4
-rw-r--r--engines/bbvs/minigames/bbairguitar_anims.cpp4
-rw-r--r--engines/bbvs/minigames/bbant.cpp4
-rw-r--r--engines/bbvs/minigames/bbant.h4
-rw-r--r--engines/bbvs/minigames/bbant_anims.cpp4
-rw-r--r--engines/bbvs/minigames/bbloogie.cpp4
-rw-r--r--engines/bbvs/minigames/bbloogie.h4
-rw-r--r--engines/bbvs/minigames/bbloogie_anims.cpp4
-rw-r--r--engines/bbvs/minigames/bbtennis.cpp4
-rw-r--r--engines/bbvs/minigames/bbtennis.h4
-rw-r--r--engines/bbvs/minigames/bbtennis_anims.cpp4
-rw-r--r--engines/bbvs/minigames/minigame.cpp4
-rw-r--r--engines/bbvs/minigames/minigame.h4
-rw-r--r--engines/bbvs/saveload.cpp5
-rw-r--r--engines/bbvs/scene.cpp4
-rw-r--r--engines/bbvs/sound.cpp4
-rw-r--r--engines/bbvs/sound.h4
-rw-r--r--engines/bbvs/spritemodule.cpp4
-rw-r--r--engines/bbvs/spritemodule.h4
-rw-r--r--engines/bbvs/videoplayer.cpp4
-rw-r--r--engines/bbvs/walk.cpp4
-rw-r--r--engines/cge2/detection.cpp42
-rw-r--r--engines/director/archive.cpp4
-rw-r--r--engines/director/detection.cpp4
-rw-r--r--engines/director/detection_tables.h4
-rw-r--r--engines/director/director.cpp5
-rw-r--r--engines/director/director.h5
-rw-r--r--engines/director/frame.cpp4
-rw-r--r--engines/director/frame.h4
-rw-r--r--engines/director/lingo/lingo-code.cpp33
-rw-r--r--engines/director/lingo/lingo-the.cpp4
-rw-r--r--engines/director/lingo/lingo.cpp9
-rw-r--r--engines/director/lingo/lingo.h2
-rw-r--r--engines/director/movie.cpp15
-rw-r--r--engines/director/movie.h15
-rw-r--r--engines/director/resource.cpp4
-rw-r--r--engines/director/resource.h4
-rw-r--r--engines/director/score.cpp26
-rw-r--r--engines/director/score.h4
-rw-r--r--engines/director/sound.cpp40
-rw-r--r--engines/director/sound.h40
-rw-r--r--engines/director/sprite.cpp4
-rw-r--r--engines/director/sprite.h4
-rw-r--r--engines/fullpipe/gameloader.cpp74
-rw-r--r--engines/fullpipe/gameloader.h1
-rw-r--r--engines/fullpipe/gfx.cpp14
-rw-r--r--engines/fullpipe/objects.h2
-rw-r--r--engines/gnap/detection.cpp8
-rw-r--r--engines/gnap/scenes/arcade.cpp4
-rw-r--r--engines/gnap/scenes/arcade.h4
-rw-r--r--engines/gnap/scenes/group0.cpp6
-rw-r--r--engines/gnap/scenes/group0.h4
-rw-r--r--engines/gnap/scenes/group1.cpp4
-rw-r--r--engines/gnap/scenes/group1.h4
-rw-r--r--engines/gnap/scenes/group2.cpp4
-rw-r--r--engines/gnap/scenes/group2.h4
-rw-r--r--engines/gnap/scenes/group3.cpp4
-rw-r--r--engines/gnap/scenes/group3.h4
-rw-r--r--engines/gnap/scenes/group4.cpp4
-rw-r--r--engines/gnap/scenes/group4.h4
-rw-r--r--engines/gnap/scenes/group5.cpp4
-rw-r--r--engines/gnap/scenes/group5.h4
-rw-r--r--engines/gnap/scenes/groupcs.cpp4
-rw-r--r--engines/gnap/scenes/groupcs.h4
-rw-r--r--engines/gnap/scenes/intro.cpp4
-rw-r--r--engines/gnap/scenes/intro.h4
-rw-r--r--engines/gnap/scenes/scenecore.cpp6
-rw-r--r--engines/gnap/scenes/scenecore.h4
-rw-r--r--engines/gob/mult_v1.cpp4
-rw-r--r--engines/macventure/configure.engine3
-rw-r--r--engines/macventure/container.cpp195
-rw-r--r--engines/macventure/container.h89
-rw-r--r--engines/macventure/controls.cpp85
-rw-r--r--engines/macventure/controls.h114
-rw-r--r--engines/macventure/cursor.cpp136
-rw-r--r--engines/macventure/datafiles.cpp96
-rw-r--r--engines/macventure/debug.h38
-rw-r--r--engines/macventure/detection.cpp179
-rw-r--r--engines/macventure/dialog.cpp261
-rw-r--r--engines/macventure/dialog.h131
-rw-r--r--engines/macventure/gui.cpp1468
-rw-r--r--engines/macventure/gui.h377
-rw-r--r--engines/macventure/hufflists.h65
-rw-r--r--engines/macventure/image.cpp561
-rw-r--r--engines/macventure/image.h116
-rw-r--r--engines/macventure/macventure.cpp1193
-rw-r--r--engines/macventure/macventure.h377
-rw-r--r--engines/macventure/module.mk31
-rw-r--r--engines/macventure/prebuilt_dialogs.cpp84
-rw-r--r--engines/macventure/prebuilt_dialogs.h95
-rw-r--r--engines/macventure/saveload.cpp205
-rw-r--r--engines/macventure/script.cpp1259
-rw-r--r--engines/macventure/script.h293
-rw-r--r--engines/macventure/sound.cpp290
-rw-r--r--engines/macventure/sound.h103
-rw-r--r--engines/macventure/stringtable.h117
-rw-r--r--engines/macventure/text.cpp209
-rw-r--r--engines/macventure/text.h72
-rw-r--r--engines/macventure/windows.cpp69
-rw-r--r--engines/macventure/windows.h107
-rw-r--r--engines/macventure/world.cpp380
-rw-r--r--engines/macventure/world.h147
-rw-r--r--engines/mads/dragonsphere/dragonsphere_scenes1.cpp4
-rw-r--r--engines/mads/dragonsphere/dragonsphere_scenes1.h4
-rw-r--r--engines/mads/dragonsphere/globals_dragonsphere.cpp4
-rw-r--r--engines/mads/dragonsphere/globals_dragonsphere.h4
-rw-r--r--engines/mads/menu_views.cpp42
-rw-r--r--engines/mads/phantom/globals_phantom.cpp4
-rw-r--r--engines/mads/phantom/globals_phantom.h4
-rw-r--r--engines/mads/phantom/phantom_scenes1.cpp4
-rw-r--r--engines/mads/phantom/phantom_scenes1.h4
-rw-r--r--engines/mads/phantom/phantom_scenes2.cpp4
-rw-r--r--engines/mads/phantom/phantom_scenes2.h4
-rw-r--r--engines/mads/phantom/phantom_scenes3.cpp4
-rw-r--r--engines/mads/phantom/phantom_scenes3.h4
-rw-r--r--engines/mads/phantom/phantom_scenes4.cpp4
-rw-r--r--engines/mads/phantom/phantom_scenes4.h4
-rw-r--r--engines/mads/phantom/phantom_scenes5.cpp4
-rw-r--r--engines/mads/phantom/phantom_scenes5.h4
-rw-r--r--engines/mads/scene_data.cpp4
-rw-r--r--engines/mads/scene_data.h4
-rw-r--r--engines/pegasus/ai/ai_action.cpp4
-rw-r--r--engines/pegasus/ai/ai_action.h4
-rw-r--r--engines/pegasus/ai/ai_area.cpp4
-rw-r--r--engines/pegasus/ai/ai_area.h4
-rw-r--r--engines/pegasus/ai/ai_condition.cpp4
-rw-r--r--engines/pegasus/ai/ai_condition.h4
-rw-r--r--engines/pegasus/ai/ai_rule.cpp4
-rw-r--r--engines/pegasus/ai/ai_rule.h4
-rw-r--r--engines/pegasus/compass.cpp4
-rw-r--r--engines/pegasus/compass.h4
-rw-r--r--engines/pegasus/console.cpp4
-rw-r--r--engines/pegasus/console.h4
-rw-r--r--engines/pegasus/constants.h4
-rw-r--r--engines/pegasus/cursor.cpp4
-rw-r--r--engines/pegasus/cursor.h4
-rw-r--r--engines/pegasus/detection.cpp5
-rw-r--r--engines/pegasus/elements.cpp4
-rw-r--r--engines/pegasus/elements.h4
-rw-r--r--engines/pegasus/energymonitor.cpp4
-rw-r--r--engines/pegasus/energymonitor.h4
-rw-r--r--engines/pegasus/fader.cpp4
-rw-r--r--engines/pegasus/fader.h4
-rw-r--r--engines/pegasus/gamestate.cpp4
-rw-r--r--engines/pegasus/gamestate.h4
-rw-r--r--engines/pegasus/graphics.cpp4
-rw-r--r--engines/pegasus/graphics.h4
-rw-r--r--engines/pegasus/hotspot.cpp4
-rw-r--r--engines/pegasus/hotspot.h4
-rw-r--r--engines/pegasus/input.cpp4
-rw-r--r--engines/pegasus/input.h4
-rw-r--r--engines/pegasus/interaction.cpp5
-rw-r--r--engines/pegasus/interaction.h4
-rw-r--r--engines/pegasus/interface.cpp4
-rw-r--r--engines/pegasus/interface.h4
-rw-r--r--engines/pegasus/items/autodragger.cpp4
-rw-r--r--engines/pegasus/items/autodragger.h5
-rw-r--r--engines/pegasus/items/biochips/aichip.cpp4
-rw-r--r--engines/pegasus/items/biochips/aichip.h4
-rw-r--r--engines/pegasus/items/biochips/biochipitem.cpp4
-rw-r--r--engines/pegasus/items/biochips/biochipitem.h4
-rw-r--r--engines/pegasus/items/biochips/mapchip.cpp4
-rw-r--r--engines/pegasus/items/biochips/mapchip.h4
-rw-r--r--engines/pegasus/items/biochips/mapimage.cpp4
-rw-r--r--engines/pegasus/items/biochips/mapimage.h4
-rw-r--r--engines/pegasus/items/biochips/opticalchip.cpp4
-rw-r--r--engines/pegasus/items/biochips/opticalchip.h4
-rw-r--r--engines/pegasus/items/biochips/pegasuschip.cpp4
-rw-r--r--engines/pegasus/items/biochips/pegasuschip.h4
-rw-r--r--engines/pegasus/items/biochips/retscanchip.cpp4
-rw-r--r--engines/pegasus/items/biochips/retscanchip.h4
-rw-r--r--engines/pegasus/items/biochips/shieldchip.cpp4
-rw-r--r--engines/pegasus/items/biochips/shieldchip.h4
-rw-r--r--engines/pegasus/items/inventory.cpp4
-rw-r--r--engines/pegasus/items/inventory.h4
-rw-r--r--engines/pegasus/items/inventory/airmask.cpp4
-rw-r--r--engines/pegasus/items/inventory/airmask.h4
-rw-r--r--engines/pegasus/items/inventory/gascanister.cpp4
-rw-r--r--engines/pegasus/items/inventory/gascanister.h4
-rw-r--r--engines/pegasus/items/inventory/inventoryitem.cpp4
-rw-r--r--engines/pegasus/items/inventory/inventoryitem.h4
-rw-r--r--engines/pegasus/items/inventory/keycard.cpp4
-rw-r--r--engines/pegasus/items/inventory/keycard.h4
-rw-r--r--engines/pegasus/items/inventorypicture.cpp4
-rw-r--r--engines/pegasus/items/inventorypicture.h4
-rw-r--r--engines/pegasus/items/item.cpp4
-rw-r--r--engines/pegasus/items/item.h4
-rw-r--r--engines/pegasus/items/itemdragger.cpp4
-rw-r--r--engines/pegasus/items/itemdragger.h4
-rw-r--r--engines/pegasus/items/itemlist.cpp4
-rw-r--r--engines/pegasus/items/itemlist.h4
-rw-r--r--engines/pegasus/menu.cpp4
-rw-r--r--engines/pegasus/menu.h4
-rw-r--r--engines/pegasus/movie.cpp4
-rw-r--r--engines/pegasus/movie.h4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoria.cpp4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoria.h4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp6
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoria4dsystem.h4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoriabomb.h4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoriamessages.h4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp4
-rw-r--r--engines/pegasus/neighborhood/caldoria/caldoriamirror.h4
-rw-r--r--engines/pegasus/neighborhood/door.cpp4
-rw-r--r--engines/pegasus/neighborhood/door.h5
-rw-r--r--engines/pegasus/neighborhood/exit.cpp4
-rw-r--r--engines/pegasus/neighborhood/exit.h4
-rw-r--r--engines/pegasus/neighborhood/extra.cpp4
-rw-r--r--engines/pegasus/neighborhood/extra.h4
-rw-r--r--engines/pegasus/neighborhood/hotspotinfo.cpp4
-rw-r--r--engines/pegasus/neighborhood/hotspotinfo.h4
-rw-r--r--engines/pegasus/neighborhood/mars/constants.h4
-rw-r--r--engines/pegasus/neighborhood/mars/energybeam.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/energybeam.h4
-rw-r--r--engines/pegasus/neighborhood/mars/gravitoncannon.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/gravitoncannon.h4
-rw-r--r--engines/pegasus/neighborhood/mars/hermite.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/hermite.h4
-rw-r--r--engines/pegasus/neighborhood/mars/mars.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/mars.h4
-rw-r--r--engines/pegasus/neighborhood/mars/planetmover.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/planetmover.h4
-rw-r--r--engines/pegasus/neighborhood/mars/reactor.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/reactor.h4
-rw-r--r--engines/pegasus/neighborhood/mars/robotship.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/robotship.h4
-rw-r--r--engines/pegasus/neighborhood/mars/shuttleenergymeter.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/shuttleenergymeter.h4
-rw-r--r--engines/pegasus/neighborhood/mars/shuttlehud.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/shuttlehud.h4
-rw-r--r--engines/pegasus/neighborhood/mars/shuttleweapon.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/shuttleweapon.h4
-rw-r--r--engines/pegasus/neighborhood/mars/spacechase3d.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/spacechase3d.h4
-rw-r--r--engines/pegasus/neighborhood/mars/spacejunk.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/spacejunk.h4
-rw-r--r--engines/pegasus/neighborhood/mars/tractorbeam.cpp4
-rw-r--r--engines/pegasus/neighborhood/mars/tractorbeam.h4
-rw-r--r--engines/pegasus/neighborhood/neighborhood.cpp4
-rw-r--r--engines/pegasus/neighborhood/neighborhood.h4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/ecrmonitor.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/ecrmonitor.h4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/fillingstation.h4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/noradalpha.h4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/panorama.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/panorama.h4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/panoramascroll.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/alpha/panoramascroll.h4
-rw-r--r--engines/pegasus/neighborhood/norad/constants.h4
-rw-r--r--engines/pegasus/neighborhood/norad/delta/globegame.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/delta/globegame.h4
-rw-r--r--engines/pegasus/neighborhood/norad/delta/noraddelta.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/delta/noraddelta.h4
-rw-r--r--engines/pegasus/neighborhood/norad/norad.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/norad.h4
-rw-r--r--engines/pegasus/neighborhood/norad/noradelevator.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/noradelevator.h4
-rw-r--r--engines/pegasus/neighborhood/norad/pressuredoor.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/pressuredoor.h4
-rw-r--r--engines/pegasus/neighborhood/norad/pressuretracker.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/pressuretracker.h4
-rw-r--r--engines/pegasus/neighborhood/norad/subcontrolroom.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/subcontrolroom.h4
-rw-r--r--engines/pegasus/neighborhood/norad/subplatform.cpp4
-rw-r--r--engines/pegasus/neighborhood/norad/subplatform.h4
-rw-r--r--engines/pegasus/neighborhood/prehistoric/prehistoric.cpp4
-rw-r--r--engines/pegasus/neighborhood/prehistoric/prehistoric.h4
-rw-r--r--engines/pegasus/neighborhood/spot.cpp4
-rw-r--r--engines/pegasus/neighborhood/spot.h4
-rw-r--r--engines/pegasus/neighborhood/tsa/fulltsa.cpp4
-rw-r--r--engines/pegasus/neighborhood/tsa/fulltsa.h4
-rw-r--r--engines/pegasus/neighborhood/tsa/tinytsa.cpp4
-rw-r--r--engines/pegasus/neighborhood/tsa/tinytsa.h4
-rw-r--r--engines/pegasus/neighborhood/turn.cpp4
-rw-r--r--engines/pegasus/neighborhood/turn.h4
-rw-r--r--engines/pegasus/neighborhood/view.cpp4
-rw-r--r--engines/pegasus/neighborhood/view.h4
-rw-r--r--engines/pegasus/neighborhood/wsc/moleculebin.cpp4
-rw-r--r--engines/pegasus/neighborhood/wsc/moleculebin.h4
-rw-r--r--engines/pegasus/neighborhood/wsc/wsc.cpp6
-rw-r--r--engines/pegasus/neighborhood/wsc/wsc.h4
-rw-r--r--engines/pegasus/neighborhood/zoom.cpp4
-rw-r--r--engines/pegasus/neighborhood/zoom.h4
-rw-r--r--engines/pegasus/notification.cpp4
-rw-r--r--engines/pegasus/notification.h4
-rw-r--r--engines/pegasus/pegasus.cpp4
-rw-r--r--engines/pegasus/pegasus.h4
-rw-r--r--engines/pegasus/scoring.h4
-rw-r--r--engines/pegasus/sound.cpp4
-rw-r--r--engines/pegasus/sound.h4
-rw-r--r--engines/pegasus/surface.cpp4
-rw-r--r--engines/pegasus/surface.h4
-rw-r--r--engines/pegasus/timers.cpp4
-rw-r--r--engines/pegasus/timers.h4
-rw-r--r--engines/pegasus/transition.cpp4
-rw-r--r--engines/pegasus/transition.h4
-rw-r--r--engines/pegasus/types.h4
-rw-r--r--engines/pegasus/util.cpp4
-rw-r--r--engines/pegasus/util.h4
-rw-r--r--engines/prince/animation.cpp4
-rw-r--r--engines/prince/animation.h4
-rw-r--r--engines/prince/archive.cpp4
-rw-r--r--engines/prince/archive.h4
-rw-r--r--engines/prince/common.h4
-rw-r--r--engines/prince/cursor.cpp4
-rw-r--r--engines/prince/cursor.h4
-rw-r--r--engines/prince/curve_values.h4
-rw-r--r--engines/prince/debugger.cpp4
-rw-r--r--engines/prince/debugger.h4
-rw-r--r--engines/prince/decompress.cpp4
-rw-r--r--engines/prince/decompress.h4
-rw-r--r--engines/prince/detection.cpp4
-rw-r--r--engines/prince/detection.h32
-rw-r--r--engines/prince/flags.cpp4
-rw-r--r--engines/prince/flags.h4
-rw-r--r--engines/prince/font.cpp4
-rw-r--r--engines/prince/graphics.cpp4
-rw-r--r--engines/prince/graphics.h4
-rw-r--r--engines/prince/hero.cpp4
-rw-r--r--engines/prince/hero.h4
-rw-r--r--engines/prince/hero_set.h4
-rw-r--r--engines/prince/mhwanh.cpp4
-rw-r--r--engines/prince/mhwanh.h4
-rw-r--r--engines/prince/mob.cpp4
-rw-r--r--engines/prince/mob.h4
-rw-r--r--engines/prince/musNum.h4
-rw-r--r--engines/prince/object.cpp4
-rw-r--r--engines/prince/object.h4
-rw-r--r--engines/prince/option_text.h4
-rw-r--r--engines/prince/prince.cpp81
-rw-r--r--engines/prince/prince.h8
-rw-r--r--engines/prince/pscr.cpp4
-rw-r--r--engines/prince/pscr.h4
-rw-r--r--engines/prince/resource.h4
-rw-r--r--engines/prince/saveload.cpp4
-rw-r--r--engines/prince/script.cpp4
-rw-r--r--engines/prince/script.h4
-rw-r--r--engines/prince/sound.cpp4
-rw-r--r--engines/prince/sound.h4
-rw-r--r--engines/prince/variatxt.cpp4
-rw-r--r--engines/prince/variatxt.h4
-rw-r--r--engines/prince/videoplayer.cpp4
-rw-r--r--engines/scumm/cdda.h4
-rw-r--r--engines/scumm/he/intern_he.h5
-rw-r--r--engines/scumm/he/script_v72he.cpp2
-rw-r--r--engines/scumm/object.cpp10
-rw-r--r--engines/scumm/players/player_pce.cpp1
-rw-r--r--engines/scumm/script_v6.cpp11
-rw-r--r--engines/scumm/scumm.cpp24
-rw-r--r--engines/sherlock/journal.cpp5
-rw-r--r--engines/sherlock/tattoo/tattoo_journal.h40
-rw-r--r--engines/sherlock/tattoo/widget_inventory.cpp4
-rw-r--r--engines/sword2/animation.h4
-rw-r--r--engines/sword2/header.cpp4
-rw-r--r--engines/sword25/math/polygon.cpp2
-rw-r--r--engines/sword25/math/vertex.h1
-rw-r--r--engines/testbed/cloud.cpp42
-rw-r--r--engines/testbed/cloud.h2
-rw-r--r--engines/testbed/graphics.cpp24
-rw-r--r--engines/testbed/graphics.h1
-rw-r--r--engines/testbed/misc.cpp2
-rw-r--r--engines/testbed/webserver.cpp42
-rw-r--r--engines/titanic/carry/arm.cpp2
-rw-r--r--engines/titanic/carry/brain.cpp2
-rw-r--r--engines/titanic/carry/bridge_piece.cpp2
-rw-r--r--engines/titanic/carry/carry_parrot.cpp27
-rw-r--r--engines/titanic/carry/carry_parrot.h8
-rw-r--r--engines/titanic/carry/plug_in.cpp4
-rw-r--r--engines/titanic/carry/plug_in.h2
-rw-r--r--engines/titanic/configure.engine2
-rw-r--r--engines/titanic/core/game_object.cpp8
-rw-r--r--engines/titanic/core/game_object.h20
-rw-r--r--engines/titanic/core/room_item.cpp4
-rw-r--r--engines/titanic/core/view_item.cpp12
-rw-r--r--engines/titanic/detection.cpp3
-rw-r--r--engines/titanic/events.cpp5
-rw-r--r--engines/titanic/game/computer.cpp16
-rw-r--r--engines/titanic/game/computer_screen.cpp4
-rw-r--r--engines/titanic/game/fan_noises.cpp20
-rw-r--r--engines/titanic/game/fan_noises.h2
-rw-r--r--engines/titanic/game/television.cpp4
-rw-r--r--engines/titanic/game/transport/exit_pellerator.cpp40
-rw-r--r--engines/titanic/game/transport/exit_pellerator.h40
-rw-r--r--engines/titanic/game/transport/lift.h40
-rw-r--r--engines/titanic/game/transport/pellerator.cpp40
-rw-r--r--engines/titanic/game/transport/pellerator.h40
-rw-r--r--engines/titanic/gfx/music_slider_speed.h40
-rw-r--r--engines/titanic/gfx/music_switch_reverse.h40
-rw-r--r--engines/titanic/gfx/st_button.cpp2
-rw-r--r--engines/titanic/main_game_window.h1
-rw-r--r--engines/titanic/messages/messages.h6
-rw-r--r--engines/titanic/npcs/deskbot.cpp2
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp26
-rw-r--r--engines/titanic/npcs/true_talk_npc.h4
-rw-r--r--engines/titanic/pet_control/pet_inventory.cpp8
-rw-r--r--engines/titanic/pet_control/pet_inventory.h3
-rw-r--r--engines/titanic/pet_control/pet_inventory_glyphs.cpp18
-rw-r--r--engines/titanic/pet_control/pet_inventory_glyphs.h6
-rw-r--r--engines/titanic/pet_control/pet_text.cpp32
-rw-r--r--engines/titanic/pet_control/pet_text.h17
-rw-r--r--engines/titanic/sound/auto_sound_player.cpp8
-rw-r--r--engines/titanic/sound/auto_sound_player.h2
-rw-r--r--engines/titanic/sound/auto_sound_player_adsr.cpp8
-rw-r--r--engines/titanic/sound/gondolier_song.cpp44
-rw-r--r--engines/titanic/sound/proximity.cpp13
-rw-r--r--engines/titanic/sound/proximity.h13
-rw-r--r--engines/titanic/sound/qmixer.cpp2
-rw-r--r--engines/titanic/sound/sound.cpp21
-rw-r--r--engines/titanic/sound/sound.h13
-rw-r--r--engines/titanic/sound/sound_manager.cpp6
-rw-r--r--engines/titanic/sound/water_lapping_sounds.cpp42
-rw-r--r--engines/titanic/sound/wave_file.cpp5
-rw-r--r--engines/titanic/sound/wave_file.h5
-rw-r--r--engines/titanic/support/files_manager.cpp2
-rw-r--r--engines/titanic/support/files_manager.h6
-rw-r--r--engines/titanic/true_talk/bellbot_script.cpp11
-rw-r--r--engines/titanic/true_talk/bellbot_script.h5
-rw-r--r--engines/titanic/true_talk/dialogue_file.cpp2
-rw-r--r--engines/titanic/true_talk/script_handler.cpp26
-rw-r--r--engines/titanic/true_talk/script_handler.h2
-rw-r--r--engines/titanic/true_talk/title_engine.cpp5
-rw-r--r--engines/titanic/true_talk/title_engine.h3
-rw-r--r--engines/titanic/true_talk/true_talk_manager.cpp22
-rw-r--r--engines/titanic/true_talk/true_talk_manager.h7
-rw-r--r--engines/titanic/true_talk/tt_npc_script.cpp11
-rw-r--r--engines/titanic/true_talk/tt_room_script.cpp2
-rw-r--r--engines/titanic/true_talk/tt_script_base.cpp44
-rw-r--r--engines/titanic/true_talk/tt_script_base.h19
-rw-r--r--engines/titanic/true_talk/tt_sentence.cpp2
-rw-r--r--engines/titanic/true_talk/tt_talker.cpp8
-rw-r--r--engines/titanic/true_talk/tt_talker.h8
-rw-r--r--engines/titanic/true_talk/tt_vocab.cpp4
-rw-r--r--engines/titanic/true_talk/tt_vocab.h2
-rw-r--r--engines/wage/combat.cpp4
-rw-r--r--engines/wage/design.cpp4
-rw-r--r--engines/wage/design.h4
-rw-r--r--engines/wage/detection.cpp4
-rw-r--r--engines/wage/detection_tables.h4
-rw-r--r--engines/wage/dialog.cpp4
-rw-r--r--engines/wage/dialog.h4
-rw-r--r--engines/wage/entities.cpp4
-rw-r--r--engines/wage/entities.h4
-rw-r--r--engines/wage/gui-console.cpp4
-rw-r--r--engines/wage/gui.cpp4
-rw-r--r--engines/wage/gui.h8
-rw-r--r--engines/wage/randomhat.cpp4
-rw-r--r--engines/wage/randomhat.h4
-rw-r--r--engines/wage/script.cpp4
-rw-r--r--engines/wage/script.h4
-rw-r--r--engines/wage/sound.cpp4
-rw-r--r--engines/wage/sound.h4
-rw-r--r--engines/wage/util.cpp4
-rw-r--r--engines/wage/wage.cpp4
-rw-r--r--engines/wage/wage.h4
-rw-r--r--engines/wage/world.cpp4
-rw-r--r--engines/wage/world.h4
-rw-r--r--engines/wintermute/debugger/debugger_controller.cpp4
-rw-r--r--engines/wintermute/debugger/debugger_controller.h4
-rw-r--r--engines/wintermute/video/subtitle_card.cpp4
-rw-r--r--engines/wintermute/video/subtitle_card.h4
-rw-r--r--engines/wintermute/video/video_subtitler.cpp4
-rw-r--r--engines/wintermute/video/video_subtitler.h4
-rw-r--r--engines/zvision/core/console.cpp40
-rw-r--r--engines/zvision/core/events.cpp4
-rw-r--r--engines/zvision/file/search_manager.cpp40
-rw-r--r--engines/zvision/file/search_manager.h4
-rw-r--r--engines/zvision/graphics/cursors/cursor.cpp40
-rw-r--r--engines/zvision/graphics/cursors/cursor_manager.cpp40
-rw-r--r--engines/zvision/graphics/cursors/cursor_manager.h4
-rw-r--r--engines/zvision/graphics/effects/fog.cpp4
-rw-r--r--engines/zvision/graphics/effects/fog.h4
-rw-r--r--engines/zvision/graphics/effects/light.cpp4
-rw-r--r--engines/zvision/graphics/effects/light.h4
-rw-r--r--engines/zvision/graphics/effects/wave.cpp4
-rw-r--r--engines/zvision/graphics/effects/wave.h4
-rw-r--r--engines/zvision/graphics/graphics_effect.h4
-rw-r--r--engines/zvision/graphics/render_manager.cpp40
-rw-r--r--engines/zvision/graphics/render_manager.h4
-rw-r--r--engines/zvision/scripting/actions.cpp4
-rw-r--r--engines/zvision/scripting/control.h4
-rw-r--r--engines/zvision/scripting/controls/fist_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/hotmov_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/input_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/lever_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/paint_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/paint_control.h4
-rw-r--r--engines/zvision/scripting/controls/safe_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/save_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/slot_control.cpp4
-rw-r--r--engines/zvision/scripting/controls/slot_control.h4
-rw-r--r--engines/zvision/scripting/effects/animation_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/animation_effect.h4
-rw-r--r--engines/zvision/scripting/effects/distort_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/distort_effect.h4
-rw-r--r--engines/zvision/scripting/effects/music_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/music_effect.h4
-rw-r--r--engines/zvision/scripting/effects/region_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/region_effect.h4
-rw-r--r--engines/zvision/scripting/effects/syncsound_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/syncsound_effect.h4
-rw-r--r--engines/zvision/scripting/effects/timer_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/timer_effect.h4
-rw-r--r--engines/zvision/scripting/effects/ttytext_effect.cpp4
-rw-r--r--engines/zvision/scripting/effects/ttytext_effect.h4
-rw-r--r--engines/zvision/scripting/inventory.cpp40
-rw-r--r--engines/zvision/scripting/menu.cpp4
-rw-r--r--engines/zvision/scripting/puzzle.h4
-rw-r--r--engines/zvision/scripting/scr_file_handling.cpp4
-rw-r--r--engines/zvision/scripting/script_manager.cpp42
-rw-r--r--engines/zvision/scripting/script_manager.h4
-rw-r--r--engines/zvision/scripting/scripting_effect.h4
-rw-r--r--engines/zvision/sound/midi.cpp4
-rw-r--r--engines/zvision/sound/zork_raw.cpp4
-rw-r--r--engines/zvision/sound/zork_raw.h4
-rw-r--r--engines/zvision/text/subtitles.cpp4
-rw-r--r--engines/zvision/text/text.cpp16
-rw-r--r--engines/zvision/text/text.h4
-rw-r--r--engines/zvision/text/truetype_font.cpp6
-rw-r--r--engines/zvision/video/rlf_decoder.cpp40
-rw-r--r--engines/zvision/video/video.cpp4
-rw-r--r--engines/zvision/video/zork_avi_decoder.h4
-rw-r--r--engines/zvision/zvision.cpp4
-rw-r--r--engines/zvision/zvision.h4
552 files changed, 10975 insertions, 1758 deletions
diff --git a/engines/access/martian/martian_game.cpp b/engines/access/martian/martian_game.cpp
index 00ee6c9776..5382cd9880 100644
--- a/engines/access/martian/martian_game.cpp
+++ b/engines/access/martian/martian_game.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -107,7 +107,7 @@ void MartianEngine::displayNote(const Common::String &msg) {
_screen->_maxChars = 40;
_screen->_printOrg = _screen->_printStart = Common::Point(59, 124);
-
+
setNoteParams();
Common::String lines = msg;
@@ -158,7 +158,7 @@ void MartianEngine::doSpecial5(int param1) {
msg += c;
displayNote(msg);
-
+
_midi->stopSong();
_midi->freeMusic();
@@ -348,10 +348,10 @@ void MartianEngine::dead(int deathId) {
_screen->_maxChars = 50;
_screen->_printOrg = Common::Point(24, 18);
_screen->_printStart = Common::Point(24, 18);
-
+
// Display death message
showDeathText(_deaths[deathId]._msg);
-
+
_screen->forceFadeOut();
_room->clearRoom();
freeChar();
diff --git a/engines/access/martian/martian_game.h b/engines/access/martian/martian_game.h
index 9ef6c05c29..41a918ff81 100644
--- a/engines/access/martian/martian_game.h
+++ b/engines/access/martian/martian_game.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/access/martian/martian_resources.cpp b/engines/access/martian/martian_resources.cpp
index 070fa0f7e3..2b0479a005 100644
--- a/engines/access/martian/martian_resources.cpp
+++ b/engines/access/martian/martian_resources.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -58,7 +58,7 @@ const byte ICON_PALETTE[] = {
0x00, 0x0A, 0x1A, 0x00, 0x0D, 0x1F,
0x00, 0x11, 0x28, 0x00, 0x15, 0x30,
0x00, 0x19, 0x39, 0x00, 0x1B, 0x3F,
- 0x00, 0x2D, 0x3A
+ 0x00, 0x2D, 0x3A
};
const int RMOUSE[10][2] = {
diff --git a/engines/access/martian/martian_resources.h b/engines/access/martian/martian_resources.h
index 46cf6a71c1..76765aad5a 100644
--- a/engines/access/martian/martian_resources.h
+++ b/engines/access/martian/martian_resources.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/access/martian/martian_room.cpp b/engines/access/martian/martian_room.cpp
index 0b8b4a842a..80632a03a2 100644
--- a/engines/access/martian/martian_room.cpp
+++ b/engines/access/martian/martian_room.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/access/martian/martian_room.h b/engines/access/martian/martian_room.h
index 11501b6e57..7066a688de 100644
--- a/engines/access/martian/martian_room.h
+++ b/engines/access/martian/martian_room.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/access/martian/martian_scripts.cpp b/engines/access/martian/martian_scripts.cpp
index a9b5de5597..5966bc9af1 100644
--- a/engines/access/martian/martian_scripts.cpp
+++ b/engines/access/martian/martian_scripts.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -50,7 +50,7 @@ void MartianScripts::cmdSpecial0() {
_vm->_files->loadScreen("HOUSE.SC");
_vm->_video->setVideo(_vm->_screen, Common::Point(46, 30), "HVID.VID", 20);
-
+
do {
_vm->_video->playVideo();
if (_vm->_video->_videoFrame == 4) {
@@ -77,7 +77,7 @@ void MartianScripts::cmdSpecial0() {
void MartianScripts::cmdSpecial1(int param1) {
_vm->_events->hideCursor();
-
+
if (param1 != -1) {
_vm->_files->loadScreen(49, param1);
_vm->_buffer2.copyBuffer(_vm->_screen);
@@ -185,7 +185,7 @@ void MartianScripts::cmdSpecial7() {
_vm->_scripts->_sequence = 0;
_vm->_sound->playSound(0);
-
+
do {
charLoop();
} while (_vm->_flags[134] != 1);
@@ -229,7 +229,7 @@ void MartianScripts::cmdSpecial7() {
_vm->_events->hideCursor();
_vm->_video->setVideo(_vm->_screen, Common::Point(120, 16), FileIdent(40, 5), 10);
-
+
while (!_vm->shouldQuit() && !_vm->_video->_videoEnd) {
_vm->_video->playVideo();
_vm->_events->pollEventsAndWait();
@@ -246,7 +246,7 @@ void MartianScripts::cmdSpecial7() {
_vm->_screen->forceFadeOut();
_vm->_files->loadScreen(40, 7);
_vm->_destIn = _vm->_screen;
-
+
_vm->_screen->plotImage(_game->_spec7Objects, 8, Common::Point(104, 176));
_vm->_screen->plotImage(_game->_spec7Objects, 7, Common::Point(102, 160));
_vm->_events->showCursor();
@@ -273,7 +273,7 @@ void MartianScripts::cmdSpecial7() {
_vm->_events->_vbCount = 80;
while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0)
_vm->_events->pollEventsAndWait();
-
+
_vm->_sound->playSound(2);
do {
_vm->_events->pollEvents();
diff --git a/engines/access/martian/martian_scripts.h b/engines/access/martian/martian_scripts.h
index 9c2141276e..190b3c1816 100644
--- a/engines/access/martian/martian_scripts.h
+++ b/engines/access/martian/martian_scripts.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/adl/display.h b/engines/adl/display.h
index e761e63f2e..311a05893c 100644
--- a/engines/adl/display.h
+++ b/engines/adl/display.h
@@ -23,7 +23,7 @@
#ifndef ADL_DISPLAY_H
#define ADL_DISPLAY_H
-#include <common/types.h>
+#include "common/types.h"
namespace Common {
class ReadStream;
diff --git a/engines/agi/opcodes.h b/engines/agi/opcodes.h
index aac2756f86..d9644bdcda 100644
--- a/engines/agi/opcodes.h
+++ b/engines/agi/opcodes.h
@@ -23,8 +23,6 @@
#ifndef AGI_OPCODES_H
#define AGI_OPCODES_H
-#include <string.h>
-
namespace Agi {
struct AgiInstruction {
diff --git a/engines/avalanche/highscore.cpp b/engines/avalanche/highscore.cpp
index b977e2f33c..17f8b4f00c 100644
--- a/engines/avalanche/highscore.cpp
+++ b/engines/avalanche/highscore.cpp
@@ -1,29 +1,29 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
/*
-* 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.
-*/
+ * 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/highscore.h"
diff --git a/engines/avalanche/highscore.h b/engines/avalanche/highscore.h
index de7ec36ed5..0d8b9520e6 100644
--- a/engines/avalanche/highscore.h
+++ b/engines/avalanche/highscore.h
@@ -1,29 +1,29 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
/*
-* 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.
-*/
+ * 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_HIGHSCORE_H
#define AVALANCHE_HIGHSCORE_H
diff --git a/engines/avalanche/mainmenu.cpp b/engines/avalanche/mainmenu.cpp
index ff24b37e0d..fe7b835056 100644
--- a/engines/avalanche/mainmenu.cpp
+++ b/engines/avalanche/mainmenu.cpp
@@ -1,29 +1,29 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
/*
-* 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.
-*/
+ * 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/mainmenu.h"
diff --git a/engines/avalanche/mainmenu.h b/engines/avalanche/mainmenu.h
index e973e0ccf3..5e72e4ad84 100644
--- a/engines/avalanche/mainmenu.h
+++ b/engines/avalanche/mainmenu.h
@@ -1,29 +1,29 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
/*
-* 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.
-*/
+ * 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_MAINMENU_H
#define AVALANCHE_MAINMENU_H
diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index e7b20512a2..e4dcb1a84b 100644
--- a/engines/bbvs/bbvs.cpp
+++ b/engines/bbvs/bbvs.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h
index 8d9550d423..9fb6b9cac3 100644
--- a/engines/bbvs/bbvs.h
+++ b/engines/bbvs/bbvs.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index fa735c9ec3..1b2c644dda 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/dialogs.cpp b/engines/bbvs/dialogs.cpp
index 64fa86e1ee..a0aa23733b 100644
--- a/engines/bbvs/dialogs.cpp
+++ b/engines/bbvs/dialogs.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/dialogs.h b/engines/bbvs/dialogs.h
index af1f70e9a7..f95fc13ae5 100644
--- a/engines/bbvs/dialogs.h
+++ b/engines/bbvs/dialogs.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/gamemodule.cpp b/engines/bbvs/gamemodule.cpp
index 80f0e81450..b9dd2a0581 100644
--- a/engines/bbvs/gamemodule.cpp
+++ b/engines/bbvs/gamemodule.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/gamemodule.h b/engines/bbvs/gamemodule.h
index b31b95dcee..2c25e1b71f 100644
--- a/engines/bbvs/gamemodule.h
+++ b/engines/bbvs/gamemodule.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/graphics.cpp b/engines/bbvs/graphics.cpp
index e60bf0b8eb..daa13e471b 100644
--- a/engines/bbvs/graphics.cpp
+++ b/engines/bbvs/graphics.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/graphics.h b/engines/bbvs/graphics.h
index acb8eb953a..892dae58d7 100644
--- a/engines/bbvs/graphics.h
+++ b/engines/bbvs/graphics.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/logic.cpp b/engines/bbvs/logic.cpp
index 06792e2df1..2f9925f7a0 100644
--- a/engines/bbvs/logic.cpp
+++ b/engines/bbvs/logic.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbairguitar.cpp b/engines/bbvs/minigames/bbairguitar.cpp
index f826667134..8a18f86489 100644
--- a/engines/bbvs/minigames/bbairguitar.cpp
+++ b/engines/bbvs/minigames/bbairguitar.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbairguitar.h b/engines/bbvs/minigames/bbairguitar.h
index b8b92ef433..dddc1d03ad 100644
--- a/engines/bbvs/minigames/bbairguitar.h
+++ b/engines/bbvs/minigames/bbairguitar.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbairguitar_anims.cpp b/engines/bbvs/minigames/bbairguitar_anims.cpp
index 4f87eb5c78..c34e0e6126 100644
--- a/engines/bbvs/minigames/bbairguitar_anims.cpp
+++ b/engines/bbvs/minigames/bbairguitar_anims.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbant.cpp b/engines/bbvs/minigames/bbant.cpp
index 3678934345..3c13ee5426 100644
--- a/engines/bbvs/minigames/bbant.cpp
+++ b/engines/bbvs/minigames/bbant.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbant.h b/engines/bbvs/minigames/bbant.h
index 88b4af9c71..663762964c 100644
--- a/engines/bbvs/minigames/bbant.h
+++ b/engines/bbvs/minigames/bbant.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbant_anims.cpp b/engines/bbvs/minigames/bbant_anims.cpp
index c9223adca1..09a52c76fe 100644
--- a/engines/bbvs/minigames/bbant_anims.cpp
+++ b/engines/bbvs/minigames/bbant_anims.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbloogie.cpp b/engines/bbvs/minigames/bbloogie.cpp
index 68a3147f9a..b5dd3070a1 100644
--- a/engines/bbvs/minigames/bbloogie.cpp
+++ b/engines/bbvs/minigames/bbloogie.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbloogie.h b/engines/bbvs/minigames/bbloogie.h
index 04ead51a1e..a68dfa8eba 100644
--- a/engines/bbvs/minigames/bbloogie.h
+++ b/engines/bbvs/minigames/bbloogie.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbloogie_anims.cpp b/engines/bbvs/minigames/bbloogie_anims.cpp
index a82be8a279..175d02d2ff 100644
--- a/engines/bbvs/minigames/bbloogie_anims.cpp
+++ b/engines/bbvs/minigames/bbloogie_anims.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbtennis.cpp b/engines/bbvs/minigames/bbtennis.cpp
index 6c7d8cbf31..17959cc31e 100644
--- a/engines/bbvs/minigames/bbtennis.cpp
+++ b/engines/bbvs/minigames/bbtennis.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbtennis.h b/engines/bbvs/minigames/bbtennis.h
index 7eac904c4d..bedad28529 100644
--- a/engines/bbvs/minigames/bbtennis.h
+++ b/engines/bbvs/minigames/bbtennis.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/bbtennis_anims.cpp b/engines/bbvs/minigames/bbtennis_anims.cpp
index 7441c66749..c77aaadf00 100644
--- a/engines/bbvs/minigames/bbtennis_anims.cpp
+++ b/engines/bbvs/minigames/bbtennis_anims.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/minigame.cpp b/engines/bbvs/minigames/minigame.cpp
index 58d98a9df8..50311f025e 100644
--- a/engines/bbvs/minigames/minigame.cpp
+++ b/engines/bbvs/minigames/minigame.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/minigames/minigame.h b/engines/bbvs/minigames/minigame.h
index 1c24110519..eac95352b6 100644
--- a/engines/bbvs/minigames/minigame.h
+++ b/engines/bbvs/minigames/minigame.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/saveload.cpp b/engines/bbvs/saveload.cpp
index 79afd112be..74c255c860 100644
--- a/engines/bbvs/saveload.cpp
+++ b/engines/bbvs/saveload.cpp
@@ -8,17 +8,16 @@
* 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 "bbvs/bbvs.h"
diff --git a/engines/bbvs/scene.cpp b/engines/bbvs/scene.cpp
index a89c88fd82..5d22ba0cc5 100644
--- a/engines/bbvs/scene.cpp
+++ b/engines/bbvs/scene.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/sound.cpp b/engines/bbvs/sound.cpp
index 587868f26d..a470623b7f 100644
--- a/engines/bbvs/sound.cpp
+++ b/engines/bbvs/sound.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/sound.h b/engines/bbvs/sound.h
index a21d97b7ed..9bae87ffd5 100644
--- a/engines/bbvs/sound.h
+++ b/engines/bbvs/sound.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/spritemodule.cpp b/engines/bbvs/spritemodule.cpp
index 74c71e5aeb..c88f905c25 100644
--- a/engines/bbvs/spritemodule.cpp
+++ b/engines/bbvs/spritemodule.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/spritemodule.h b/engines/bbvs/spritemodule.h
index c287815dec..8233f79713 100644
--- a/engines/bbvs/spritemodule.h
+++ b/engines/bbvs/spritemodule.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index 9bef02a3cc..2ab5c1556b 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp
index e97182ff5d..f3207be1a8 100644
--- a/engines/bbvs/walk.cpp
+++ b/engines/bbvs/walk.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
index 3701baa40f..5a4f286d5b 100644
--- a/engines/cge2/detection.cpp
+++ b/engines/cge2/detection.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
/*
* This code is based on original Sfinx source code
@@ -80,7 +80,7 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::EN_ANY, Common::kPlatformDOS, ADGF_NO_FLAGS, GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
},
-
+
{
"sfinx", "Freeware v1.1",
{
diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 5b22b45734..1af63a81b7 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/detection.cpp b/engines/director/detection.cpp
index 1f2e970539..68f2c89326 100644
--- a/engines/director/detection.cpp
+++ b/engines/director/detection.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/detection_tables.h b/engines/director/detection_tables.h
index e03b831fa3..4b3cfd559c 100644
--- a/engines/director/detection_tables.h
+++ b/engines/director/detection_tables.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index d921e11d59..a80ca1c933 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -72,6 +72,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
SearchMan.addSubDirectoryMatching(gameDataDir, "install");
_colorDepth = 8; // FIXME. Check if it is 8-bit
+ _keyCode = 0;
}
DirectorEngine::~DirectorEngine() {
diff --git a/engines/director/director.h b/engines/director/director.h
index d319f476df..eabb93f694 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -8,12 +8,12 @@
* 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.
@@ -98,6 +98,7 @@ public:
public:
int _colorDepth;
+ int _keyCode;
protected:
virtual Common::Error run();
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 342e524805..d6f63a8584 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/frame.h b/engines/director/frame.h
index 8c6f82f493..68eb1e33bb 100644
--- a/engines/director/frame.h
+++ b/engines/director/frame.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index d7b91d2839..66f16536f8 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -216,6 +216,15 @@ void Lingo::c_varpush() {
char *name = (char *)&(*g_lingo->_currentScript)[g_lingo->_pc];
Datum d;
+ g_lingo->_pc += g_lingo->calcStringAlignment(name);
+
+ if (g_lingo->_handlers.contains(name)) {
+ d.type = HANDLER;
+ d.u.s = new Common::String(name);
+ g_lingo->push(d);
+ return;
+ }
+
d.u.sym = g_lingo->lookupVar(name);
if (d.u.sym->type == CASTREF) {
d.type = INT;
@@ -228,8 +237,6 @@ void Lingo::c_varpush() {
d.type = VAR;
}
- g_lingo->_pc += g_lingo->calcStringAlignment(name);
-
g_lingo->push(d);
}
@@ -298,6 +305,12 @@ void Lingo::c_eval() {
Datum d;
d = g_lingo->pop();
+ if (d.type == HANDLER) {
+ g_lingo->call(*d.u.s, 0);
+ delete d.u.s;
+ return;
+ }
+
if (d.type != VAR) { // It could be cast ref
g_lingo->push(d);
return;
@@ -756,13 +769,21 @@ void Lingo::c_whencode() {
Datum d;
int start = g_lingo->_pc;
int end = READ_UINT32(&(*g_lingo->_currentScript)[start]);
- Common::String eventname((char *)&(*g_lingo->_currentScript)[start]);
+ Common::String eventname((char *)&(*g_lingo->_currentScript)[start + 1]);
+
+ start += g_lingo->calcStringAlignment(eventname.c_str()) + 1;
- start += g_lingo->calcStringAlignment(eventname.c_str());
+ debugC(3, kDebugLingoExec, "c_whencode([%5d][%5d], %s)", start, end, eventname.c_str());
g_lingo->define(eventname, start, 0, NULL, end);
- debugC(3, kDebugLingoExec, "c_whencode([%5d][%5d], %s)", start, end, eventname.c_str());
+ if (debugChannelSet(3, kDebugLingoExec)) {
+ int pc = start;
+ while (pc <= end) {
+ Common::String instr = g_lingo->decodeInstruction(pc, &pc);
+ debugC(3, kDebugLingoExec, "[%5d] %s", pc, instr.c_str());
+ }
+ }
g_lingo->_pc = end;
}
@@ -833,7 +854,7 @@ void Lingo::c_call() {
g_lingo->call(name, nargs);
}
-void Lingo::call(Common::String &name, int nargs) {
+void Lingo::call(Common::String name, int nargs) {
bool drop = false;
Symbol *sym;
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 7fb055174d..9751d06900 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -365,6 +365,10 @@ Datum Lingo::getTheEntity(int entity, Datum &id, int field) {
d.type = FLOAT;
d.u.f = sqrt(id.u.f);
break;
+ case kTheKeyCode:
+ d.type = INT;
+ d.u.i = _vm->_keyCode;
+ break;
case kTheColorQD:
d.type = INT;
d.u.i = 1;
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index dbc022798d..30714deec1 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -273,10 +273,15 @@ void Lingo::processEvent(LEvent event, int entityId) {
ScriptType st = event2script(event);
- if (st != kNoneScript)
+ if (st != kNoneScript) {
executeScript(st, entityId + 1);
- else
+ } else if (_handlers.contains(_eventHandlerTypes[event])) {
+ call(_eventHandlerTypes[event], 0);
+ pop();
+ } else {
+ warning("---- Handler %s is not set", _eventHandlerTypes[event]);
debugC(8, kDebugLingoExec, "STUB: processEvent(%s) for %d", _eventHandlerTypes[event], entityId);
+ }
}
int Lingo::alignTypes(Datum &d1, Datum &d2) {
diff --git a/engines/director/lingo/lingo.h b/engines/director/lingo/lingo.h
index 464e4eeaa1..05c73f9886 100644
--- a/engines/director/lingo/lingo.h
+++ b/engines/director/lingo/lingo.h
@@ -275,7 +275,7 @@ public:
static void c_le();
static void c_call();
- void call(Common::String &name, int nargs);
+ void call(Common::String name, int nargs);
static void c_procret();
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index fef2b57ff3..f952346d16 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -4,6 +4,21 @@
* 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.
+ *
+ *
* Additional copyright for this file:
* Copyright (C) 1995-1997 Presto Studios, Inc.
*
diff --git a/engines/director/movie.h b/engines/director/movie.h
index 84bc116134..888262a2d1 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -4,6 +4,21 @@
* 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.
+ *
+ *
* Additional copyright for this file:
* Copyright (C) 1995-1997 Presto Studios, Inc.
*
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp
index 7bb73289dd..8efec141d1 100644
--- a/engines/director/resource.cpp
+++ b/engines/director/resource.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/resource.h b/engines/director/resource.h
index 8e2ceaeaa5..1265908cba 100644
--- a/engines/director/resource.h
+++ b/engines/director/resource.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2d3ae798bd..3e6ac7c81f 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -839,6 +839,28 @@ void Score::processEvents() {
_lingo->processEvent(kEventMouseUp, _frames[_currentFrame]->getSpriteIDFromPos(pos));
}
+
+ if (event.type == Common::EVENT_KEYDOWN) {
+ _vm->_keyCode = event.kbd.keycode;
+ switch (_vm->_keyCode) {
+ case Common::KEYCODE_LEFT:
+ _vm->_keyCode = 123;
+ break;
+ case Common::KEYCODE_RIGHT:
+ _vm->_keyCode = 124;
+ break;
+ case Common::KEYCODE_DOWN:
+ _vm->_keyCode = 125;
+ break;
+ case Common::KEYCODE_UP:
+ _vm->_keyCode = 126;
+ break;
+ default:
+ warning("Keycode: %d", _vm->_keyCode);
+ }
+
+ _lingo->processEvent(kEventKeyDown, 0);
+ }
}
g_system->updateScreen();
diff --git a/engines/director/score.h b/engines/director/score.h
index 9d929adc6a..ad07b6defc 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index af6e0d2e1c..af08094821 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "audio/decoders/wave.h"
#include "common/file.h"
diff --git a/engines/director/sound.h b/engines/director/sound.h
index 850842be21..0472da0ef7 100644
--- a/engines/director/sound.h
+++ b/engines/director/sound.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "audio/audiostream.h"
#include "audio/mixer.h"
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index 77d53ae1da..24db236563 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/director/sprite.h b/engines/director/sprite.h
index c66c66d6e4..e879f83599 100644
--- a/engines/director/sprite.h
+++ b/engines/director/sprite.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 270e69aa42..d03ac0f405 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -504,7 +504,79 @@ void GameLoader::applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAni
}
void GameLoader::saveScenePicAniInfos(int sceneId) {
- warning("STUB: GameLoader::saveScenePicAniInfos(%d)", sceneId);
+ SceneTag *st;
+
+ int idx = getSceneTagBySceneId(sceneId, &st);
+
+ if (idx < 0)
+ return;
+
+ if (!_sc2array[idx]._isLoaded)
+ return;
+
+ if (!st->_scene)
+ return;
+
+ int picAniInfosCount;
+
+ PicAniInfo **pic = savePicAniInfos(st->_scene, 0, 128, &picAniInfosCount);
+
+ if (_sc2array[idx]._picAniInfos)
+ free(_sc2array[idx]._picAniInfos);
+
+ _sc2array[idx]._picAniInfos = pic;
+ _sc2array[idx]._picAniInfosCount = picAniInfosCount;
+}
+
+PicAniInfo **GameLoader::savePicAniInfos(Scene *sc, int flag1, int flag2, int *picAniInfoCount) {
+ PicAniInfo **res;
+
+ *picAniInfoCount = 0;
+ if (!sc)
+ return NULL;
+
+ if (!sc->_picObjList.size())
+ return NULL;
+
+ int numInfos = sc->_staticANIObjectList1.size() + sc->_picObjList.size() - 1;
+ if (numInfos < 1)
+ return NULL;
+
+ res = (PicAniInfo **)malloc(sizeof(PicAniInfo *) * numInfos);
+
+ int idx = 0;
+
+ for (uint i = 0; i < sc->_picObjList.size(); i++) {
+ PictureObject *obj = sc->_picObjList[i];
+
+ if (obj && ((obj->_flags & flag1) == flag1) && ((obj->_field_8 & flag2) == flag2)) {
+ res[idx] = new PicAniInfo();
+ obj->getPicAniInfo(res[idx]);
+ idx++;
+ }
+ }
+
+ for (uint i = 0; i < sc->_staticANIObjectList1.size(); i++) {
+ StaticANIObject *obj = sc->_staticANIObjectList1[i];
+
+ if (obj && ((obj->_flags & flag1) == flag1) && ((obj->_field_8 & flag2) == flag2)) {
+ res[idx] = new PicAniInfo();
+ obj->getPicAniInfo(res[idx]);
+ res[idx]->type &= 0xFFFF;
+ idx++;
+ }
+ }
+
+ *picAniInfoCount = idx;
+
+ debugC(4, kDebugBehavior | kDebugAnimation, "savePicAniInfos: Stored %d infos", idx);
+
+ if (!idx) {
+ free(res);
+ return NULL;
+ }
+
+ return res;
}
void GameLoader::updateSystems(int counterdiff) {
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index 772cc51130..682d1aad89 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -96,6 +96,7 @@ class GameLoader : public CObject {
int getSceneTagBySceneId(int sceneId, SceneTag **st);
void applyPicAniInfos(Scene *sc, PicAniInfo **picAniInfo, int picAniInfoCount);
void saveScenePicAniInfos(int sceneId);
+ PicAniInfo **savePicAniInfos(Scene *sc, int flag1, int flag2, int *picAniInfoCount);
void readSavegame(const char *fname);
void writeSavegame(Scene *sc, const char *fname);
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index eba5d442d5..59c2e41fce 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -398,18 +398,23 @@ bool GameObject::setPicAniInfo(PicAniInfo *picAniInfo) {
return false;
}
- if (picAniInfo->type & 3) {
+ if (picAniInfo->type & 2) {
setOXY(picAniInfo->ox, picAniInfo->oy);
_priority = picAniInfo->priority;
_okeyCode = picAniInfo->field_8;
setFlags(picAniInfo->flags);
_field_8 = picAniInfo->field_24;
+
+ return true;
}
if (picAniInfo->type & 1) {
StaticANIObject *ani = (StaticANIObject *)this;
ani->_messageQueueId = (picAniInfo->type >> 16) & 0xffff;
+ ani->_okeyCode = picAniInfo->field_8;
+ ani->setFlags(picAniInfo->flags);
+ ani->_field_8 = picAniInfo->field_24;
if (picAniInfo->staticsId) {
ani->_statics = ani->getStaticsById(picAniInfo->staticsId);
@@ -425,10 +430,15 @@ bool GameObject::setPicAniInfo(PicAniInfo *picAniInfo) {
ani->_movement = 0;
}
+ ani->setOXY(picAniInfo->ox, picAniInfo->oy);
+ ani->_priority = picAniInfo->priority;
+
ani->setSomeDynamicPhaseIndex(picAniInfo->someDynamicPhaseIndex);
+
+ return true;
}
- return true;
+ return false;
}
Picture::Picture() {
diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h
index f9a641d562..c9da43986c 100644
--- a/engines/fullpipe/objects.h
+++ b/engines/fullpipe/objects.h
@@ -44,7 +44,7 @@ class GameProject : public CObject {
};
struct PicAniInfo {
- int32 type;
+ uint32 type;
int16 objectId;
int16 field_6;
int32 field_8;
diff --git a/engines/gnap/detection.cpp b/engines/gnap/detection.cpp
index d92a037232..7deb670970 100644
--- a/engines/gnap/detection.cpp
+++ b/engines/gnap/detection.cpp
@@ -53,6 +53,14 @@ static const ADGameDescription gameDescriptions[] = {
},
Common::RU_RUS, Common::kPlatformWindows, ADGF_TESTING, GUIO0()
},
+ {
+ "gnap", "Fargus",
+ {
+ {"stock_n.dat", 0, "46819043d019a2f36b727cc2bdd6980f", 12847726},
+ AD_LISTEND
+ },
+ Common::RU_RUS, Common::kPlatformWindows, ADGF_TESTING, GUIO0()
+ },
AD_TABLE_END_MARKER
};
diff --git a/engines/gnap/scenes/arcade.cpp b/engines/gnap/scenes/arcade.cpp
index db4999cb43..2f1377dc2b 100644
--- a/engines/gnap/scenes/arcade.cpp
+++ b/engines/gnap/scenes/arcade.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/arcade.h b/engines/gnap/scenes/arcade.h
index ab519ee00b..9c8ddd9913 100644
--- a/engines/gnap/scenes/arcade.h
+++ b/engines/gnap/scenes/arcade.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group0.cpp b/engines/gnap/scenes/group0.cpp
index e76fd9bbd2..7967df0e6f 100644
--- a/engines/gnap/scenes/group0.cpp
+++ b/engines/gnap/scenes/group0.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -506,7 +506,7 @@ void Scene02::run() {
if (gnap._actionStatus < 0) {
if (_vm->_grabCursorSpriteIndex == kItemTwig) {
gnap._idleFacing = kDirUpRight;
- Common::Point destPos = _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot] + Common::Point(0, 1);
+ Common::Point destPos = _vm->_hotspotsWalkPos[_vm->_sceneClickedHotspot] + Common::Point(0, 1);
gnap.walkTo(destPos, 0, gnap.getSequenceId(kGSIdle, Common::Point(0, 0)) | 0x10000, 1);
gnap._actionStatus = kAS02UseTwigWithChicken;
} else if (_vm->_grabCursorSpriteIndex >= 0) {
diff --git a/engines/gnap/scenes/group0.h b/engines/gnap/scenes/group0.h
index e06380926d..2fbcb59ea2 100644
--- a/engines/gnap/scenes/group0.h
+++ b/engines/gnap/scenes/group0.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group1.cpp b/engines/gnap/scenes/group1.cpp
index e50e8cc959..9585d37c84 100644
--- a/engines/gnap/scenes/group1.cpp
+++ b/engines/gnap/scenes/group1.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group1.h b/engines/gnap/scenes/group1.h
index 30771d017a..7fe5520c54 100644
--- a/engines/gnap/scenes/group1.h
+++ b/engines/gnap/scenes/group1.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group2.cpp b/engines/gnap/scenes/group2.cpp
index 1db3144c2d..d68725cce9 100644
--- a/engines/gnap/scenes/group2.cpp
+++ b/engines/gnap/scenes/group2.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group2.h b/engines/gnap/scenes/group2.h
index 8f56594f16..35da362fcb 100644
--- a/engines/gnap/scenes/group2.h
+++ b/engines/gnap/scenes/group2.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group3.cpp b/engines/gnap/scenes/group3.cpp
index 98a4f6c454..4f2282d731 100644
--- a/engines/gnap/scenes/group3.cpp
+++ b/engines/gnap/scenes/group3.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group3.h b/engines/gnap/scenes/group3.h
index 6fbbdd79aa..e07d7a27cd 100644
--- a/engines/gnap/scenes/group3.h
+++ b/engines/gnap/scenes/group3.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group4.cpp b/engines/gnap/scenes/group4.cpp
index 814588d9ba..e272eb9734 100644
--- a/engines/gnap/scenes/group4.cpp
+++ b/engines/gnap/scenes/group4.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group4.h b/engines/gnap/scenes/group4.h
index afcd62e9e7..70efbaa01c 100644
--- a/engines/gnap/scenes/group4.h
+++ b/engines/gnap/scenes/group4.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group5.cpp b/engines/gnap/scenes/group5.cpp
index 46f4c51e5d..85cf3d1834 100644
--- a/engines/gnap/scenes/group5.cpp
+++ b/engines/gnap/scenes/group5.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/group5.h b/engines/gnap/scenes/group5.h
index dd238ec65c..0b36d71cc8 100644
--- a/engines/gnap/scenes/group5.h
+++ b/engines/gnap/scenes/group5.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/groupcs.cpp b/engines/gnap/scenes/groupcs.cpp
index c096eae27c..62308cbb10 100644
--- a/engines/gnap/scenes/groupcs.cpp
+++ b/engines/gnap/scenes/groupcs.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/groupcs.h b/engines/gnap/scenes/groupcs.h
index 58033564ce..4bffbcc4f2 100644
--- a/engines/gnap/scenes/groupcs.h
+++ b/engines/gnap/scenes/groupcs.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/intro.cpp b/engines/gnap/scenes/intro.cpp
index 5bb2239bab..973ff73d07 100644
--- a/engines/gnap/scenes/intro.cpp
+++ b/engines/gnap/scenes/intro.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/intro.h b/engines/gnap/scenes/intro.h
index 15aedfc4fc..af917fdc47 100644
--- a/engines/gnap/scenes/intro.h
+++ b/engines/gnap/scenes/intro.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gnap/scenes/scenecore.cpp b/engines/gnap/scenes/scenecore.cpp
index fb6f91c954..8d59aa4b15 100644
--- a/engines/gnap/scenes/scenecore.cpp
+++ b/engines/gnap/scenes/scenecore.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -653,7 +653,7 @@ bool Scene::clearKeyStatus() {
CutScene::CutScene(GnapEngine *vm) : Scene(vm) {
_itemsCount = -1;
-
+
for (int i = 0; i < 16; i++) {
_resourceIdArr[i] = -1;
_sequenceCountArr[i] = -1;
diff --git a/engines/gnap/scenes/scenecore.h b/engines/gnap/scenes/scenecore.h
index c54b5a7bc5..d4a6aa36de 100644
--- a/engines/gnap/scenes/scenecore.h
+++ b/engines/gnap/scenes/scenecore.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/gob/mult_v1.cpp b/engines/gob/mult_v1.cpp
index 230d0d2b4c..d1a417b520 100644
--- a/engines/gob/mult_v1.cpp
+++ b/engines/gob/mult_v1.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/macventure/configure.engine b/engines/macventure/configure.engine
new file mode 100644
index 0000000000..dc7cf7912c
--- /dev/null
+++ b/engines/macventure/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 macventure "MacVenture" no
diff --git a/engines/macventure/container.cpp b/engines/macventure/container.cpp
new file mode 100644
index 0000000000..dbbc7ebaa2
--- /dev/null
+++ b/engines/macventure/container.cpp
@@ -0,0 +1,195 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/container.h"
+
+namespace MacVenture {
+
+Container::Container(Common::String filename) {
+ _filename = filename;
+
+ if (!_file.open(_filename)) {
+ error("CONTAINER: Could not open %s", _filename.c_str());
+ }
+
+ _res = _file.readStream(_file.size());
+ _header = _res->readUint32BE();
+ _simplified = false;
+
+ for (uint i = 0; i < 16; ++i) {
+ _huff.push_back(0);
+ }
+
+ for (uint i = 0; i < 16; ++i) {
+ _lens.push_back(0);
+ }
+
+ if (!(_header & 0x80000000)) {
+ // Is simplified container
+ _simplified = true;
+ int dataLen = _res->size() - sizeof(_header);
+ _lenObjs = _header;
+ _numObjs = dataLen / _lenObjs;
+ } else {
+ _header &= 0x7fffffff;
+ _res->seek(_header, SEEK_SET);
+ _numObjs = _res->readUint16BE();
+
+ for (uint i = 0; i < 15; ++i) {
+ _huff[i] = _res->readUint16BE();
+ }
+
+ for (uint i = 0; i < 16; ++i) {
+ _lens[i] = _res->readByte();
+ }
+
+ // Read groups
+ uint numGroups = _numObjs / 64;
+ if ((_numObjs % 64) > 0) {
+ numGroups++;
+ }
+
+ for (uint i = 0; i < numGroups; ++i) {
+ ItemGroup group;
+
+ // Place myself in the correct position to read group
+ _res->seek(_header + (i * 6) + 0x30, SEEK_SET);
+ byte b1, b2, b3;
+ b1 = _res->readByte();
+ b2 = _res->readByte();
+ b3 = _res->readByte();
+ group.bitOffset = (b1 << 16) + (b2 << 8) + (b3 << 0);
+
+ b1 = _res->readByte();
+ b2 = _res->readByte();
+ b3 = _res->readByte();
+ group.offset = (b1 << 16) + (b2 << 8) + (b3 << 0);
+
+ // Place the bit reader in the correct position
+ // group.bitOffset indicates the offset from the start of the subHeader
+ _res->seek(_header + (group.bitOffset >> 3), SEEK_SET);
+ uint32 bits = group.bitOffset & 7;
+
+ for (uint j = 0; j < 64; ++j) {
+ uint32 length = 0;
+ uint32 mask = 0;
+ mask = _res->readUint32BE();
+ mask >>= (16 - bits);
+ mask &= 0xFFFF;
+ debugC(4, kMVDebugContainer, "Load mask of object &%d:%d is %x", i, j, mask);
+ _res->seek(-4, SEEK_CUR);
+ // Look in the Huffman table
+ int x = 0;
+ for (x = 0; x < 16; x++) {
+ if (_huff[x] > mask) {
+ break;
+ }
+ }
+
+ // I will opt to copy the code from webventure,
+ // But according to the docs, this call should suffice:
+ // length = bitStream.getBits(_lens[x]);
+ // The problem is that _lens[] usually contains values larger
+ // Than 32, so we have to read them with the method below
+
+ //This code below, taken from the implementation, seems to give the same results.
+
+ uint32 bitSize = _lens[x];
+ bits += bitSize & 0xF;
+ if (bits & 0x10) {
+ bits &= 0xF;
+ _res->seek(2, SEEK_CUR);
+ }
+ bitSize >>= 4;
+ if (bitSize) {
+ length = _res->readUint32BE();
+ _res->seek(-4, SEEK_CUR);
+ bitSize--;
+ if (bitSize == 0) {
+ length = 0;
+ } else {
+ length >>= (32 - bitSize) - bits;
+ }
+ length &= (1 << bitSize) - 1;
+ length |= 1 << bitSize;
+ bits += bitSize;
+ if (bits & 0x10) {
+ bits &= 0xF;
+ _res->seek(2, SEEK_CUR);
+ }
+ }
+ group.lengths[j] = length;
+ debugC(4, kMVDebugContainer, "Load legth of object %d:%d is %d", i, j, length);
+ }
+ _groups.push_back(group);
+ }
+ }
+}
+
+Container::~Container() {
+
+ if (_file.isOpen())
+ _file.close();
+
+ if (_res)
+ delete _res;
+}
+
+uint32 Container::getItemByteSize(uint32 id) {
+ if (_simplified) {
+ return _lenObjs;
+ } else {
+ uint32 groupID = (id >> 6);
+ uint32 objectIndex = id & 0x3f; // Index within the group
+ return _groups[groupID].lengths[objectIndex];
+ }
+}
+
+Common::SeekableReadStream *Container::getItem(uint32 id) {
+ if (_simplified) {
+ _res->seek((id * _lenObjs) + sizeof(_header), SEEK_SET);
+ } else {
+ uint32 groupID = (id >> 6);
+ uint32 objectIndex = id & 0x3f; // Index within the group
+
+ uint32 offset = 0;
+ for (uint i = 0; i < objectIndex; i++) {
+ offset += _groups[groupID].lengths[i];
+ }
+ _res->seek(_groups[groupID].offset + offset + sizeof(_header), SEEK_SET);
+ }
+
+ // HACK Should Limit the size of the stream returned
+ Common::SeekableReadStream *res = _res->readStream(_res->size() - _res->pos() + 1);
+ return res;
+}
+
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/container.h b/engines/macventure/container.h
new file mode 100644
index 0000000000..ba1370d108
--- /dev/null
+++ b/engines/macventure/container.h
@@ -0,0 +1,89 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_CONTAINER_H
+#define MACVENTURE_CONTAINER_H
+
+#include "macventure/macventure.h"
+
+#include "common/file.h"
+#include "common/fs.h"
+#include "common/bitstream.h"
+
+namespace MacVenture {
+
+struct ItemGroup {
+ uint32 bitOffset; //It's really uint24
+ uint32 offset; //It's really uint24
+ uint32 lengths[64];
+};
+
+typedef uint32 ContainerHeader;
+
+class Container {
+
+public:
+ Container(Common::String filename);
+ ~Container();
+
+public:
+ /**
+ * Must be called before retrieving an object.
+ */
+ uint32 getItemByteSize(uint32 id);
+
+ /**
+ * getItemByteSize should be called before this one
+ */
+ Common::SeekableReadStream *getItem(uint32 id);
+
+protected:
+
+ bool _simplified;
+
+ uint _lenObjs; // In the case of simple container, lenght of an object
+ uint _numObjs;
+
+ ContainerHeader _header;
+
+ Common::Array<uint16> _huff; // huffman masks
+ Common::Array<uint8> _lens; // huffman lengths
+ Common::Array<ItemGroup> _groups;
+
+ Common::String _filename;
+ Common::File _file;
+ Common::SeekableReadStream *_res;
+
+};
+
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/controls.cpp b/engines/macventure/controls.cpp
new file mode 100644
index 0000000000..1db02999a5
--- /dev/null
+++ b/engines/macventure/controls.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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/gui.h"
+
+namespace MacVenture {
+CommandButton::CommandButton() {
+ _gui = NULL;
+}
+
+CommandButton::CommandButton(ControlData data, Gui *g) {
+ _data = data;
+ _gui = g;
+ _selected = false;
+}
+
+void CommandButton::draw(Graphics::ManagedSurface &surface) const {
+
+ uint colorFill = _selected ? kColorBlack : kColorWhite;
+ uint colorText = _selected ? kColorWhite : kColorBlack;
+
+ surface.fillRect(_data.bounds, colorFill);
+ surface.frameRect(_data.bounds, kColorBlack);
+
+ if (_data.titleLength > 0) {
+ const Graphics::Font &font = _gui->getCurrentFont();
+ Common::String title(_data.title);
+ font.drawString(
+ &surface,
+ title,
+ _data.bounds.left,
+ _data.bounds.top,
+ _data.bounds.right - _data.bounds.left,
+ colorText,
+ Graphics::kTextAlignCenter);
+ }
+}
+
+bool CommandButton::isInsideBounds(const Common::Point point) const {
+ return _data.bounds.contains(point);
+}
+
+const ControlData &CommandButton::getData() const {
+ return _data;
+}
+
+void CommandButton::select() {
+ _selected = true;
+}
+
+void CommandButton::unselect() {
+ _selected = false;
+}
+
+bool CommandButton::isSelected() {
+ return _selected;
+}
+}
diff --git a/engines/macventure/controls.h b/engines/macventure/controls.h
new file mode 100644
index 0000000000..8b76e8d929
--- /dev/null
+++ b/engines/macventure/controls.h
@@ -0,0 +1,114 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_CONTROLS_H
+#define MACVENTURE_CONTROLS_H
+
+namespace MacVenture {
+
+class Gui;
+
+enum ControlType { // HACK, should correspond exactly with the types of controls (sliders etc)
+ kControlExitBox = 0,
+ kControlExamine = 1,
+ kControlOpen = 2,
+ kControlClose = 3,
+ kControlSpeak = 4,
+ kControlOperate = 5,
+ kControlGo = 6,
+ kControlHit = 7,
+ kControlConsume = 8,
+ kControlClickToContinue = 9
+};
+
+enum ControlAction {
+ kNoCommand = 0,
+ kStartOrResume = 1,
+ kClose = 2,
+ kTick = 3,
+ kActivateObject = 4,
+ kMoveObject = 5,
+ kConsume = 6,
+ kExamine = 7,
+ kGo = 8,
+ kHit = 9,
+ kOpen = 10,
+ kOperate = 11,
+ kSpeak = 12,
+ kBabble = 13,
+ kTargetName = 14,
+ kDebugObject = 15,
+ kClickToContinue = 16
+};
+
+struct ControlData {
+ Common::Rect bounds;
+ uint16 scrollValue;
+ uint8 visible;
+ uint16 scrollMax;
+ uint16 scrollMin;
+ uint16 cdef;
+ ControlAction refcon;
+ ControlType type;
+ uint8 titleLength;
+ Common::String title;
+ uint16 border;
+};
+
+class CommandButton {
+
+enum {
+ kCommandsLeftPadding = 0,
+ kCommandsTopPadding = 0
+};
+
+public:
+
+ CommandButton();
+
+ CommandButton(ControlData data, Gui *g);
+ ~CommandButton() {}
+
+ void draw(Graphics::ManagedSurface &surface) const;
+ bool isInsideBounds(const Common::Point point) const;
+ const ControlData &getData() const;
+ void select();
+ void unselect();
+ bool isSelected();
+
+private:
+ bool _selected;
+ ControlData _data;
+ Gui *_gui;
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/cursor.cpp b/engines/macventure/cursor.cpp
new file mode 100644
index 0000000000..94b69e9b11
--- /dev/null
+++ b/engines/macventure/cursor.cpp
@@ -0,0 +1,136 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/gui.h"
+
+namespace MacVenture {
+
+static void cursorTimerHandler(void *refCon);
+
+static const ClickState _transitionTable[kCursorStateCount][kCursorInputCount] = {
+ /* Button down, Button Up, Tick */
+ /* Idle */ {kCursorSCStart, kCursorIdle, kCursorIdle },
+ /* SC Start */ {kCursorSCStart, kCursorDCStart, kCursorSCDrag},
+ /* SC Do */ {kCursorSCDrag, kCursorIdle, kCursorSCDrag},
+ /* DC Start */ {kCursorDCDo, kCursorDCStart, kCursorSCSink},
+ /* DC Do */ {kCursorDCDo, kCursorIdle, kCursorDCDo },
+ /* SC Sink */ {kCursorIdle, kCursorIdle, kCursorIdle }
+};
+
+Cursor::Cursor(Gui *gui) {
+ _gui = gui;
+ _state = kCursorIdle;
+}
+Cursor::~Cursor() {}
+
+void Cursor::tick() {
+ changeState(kTickCol);
+}
+
+bool Cursor::processEvent(const Common::Event &event) {
+ if (event.type == Common::EVENT_MOUSEMOVE) {
+ _pos = event.mouse;
+ return true;
+ }
+ if (event.type == Common::EVENT_LBUTTONDOWN) {
+ changeState(kButtonDownCol);
+ return true;
+ }
+ if (event.type == Common::EVENT_LBUTTONUP) {
+ changeState(kButtonUpCol);
+ return true;
+ }
+
+ return false;
+}
+
+Common::Point Cursor::getPos() {
+ return _pos;
+}
+
+bool Cursor::canSelectDraggable() {
+ return _state == kCursorSCDrag;
+}
+
+void Cursor::changeState(CursorInput input) {
+ debugC(3, kMVDebugGUI, "Change cursor state: [%d] -> [%d]", _state, _transitionTable[_state][input]);
+ if (_state != _transitionTable[_state][input]) {
+ executeStateOut();
+ _state = _transitionTable[_state][input];
+ executeStateIn();
+ }
+}
+
+void Cursor::executeStateIn() {
+ switch (_state) {
+ case kCursorSCStart:
+ g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 300000, this, "macVentureCursor");
+ _gui->selectForDrag(_pos);
+ break;
+ case kCursorDCStart:
+ g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 300000, this, "macVentureCursor");
+ break;
+ case kCursorSCSink:
+ _gui->handleSingleClick();
+ changeState(kTickCol);
+ break;
+ default:
+ break;
+ }
+}
+
+void Cursor::executeStateOut() {
+ switch (_state) {
+ case kCursorIdle:
+ break;
+ case kCursorSCStart:
+ g_system->getTimerManager()->removeTimerProc(&cursorTimerHandler);
+ break;
+ case kCursorSCDrag:
+ _gui->handleSingleClick();
+ break;
+ case kCursorDCStart:
+ g_system->getTimerManager()->removeTimerProc(&cursorTimerHandler);
+ break;
+ case kCursorDCDo:
+ _gui->handleDoubleClick();
+ break;
+ default:
+ break;
+ }
+}
+
+static void cursorTimerHandler(void *refCon) {
+ Cursor *cursor = (Cursor *)refCon;
+ cursor->tick();
+}
+
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/datafiles.cpp b/engines/macventure/datafiles.cpp
new file mode 100644
index 0000000000..ec5febd37a
--- /dev/null
+++ b/engines/macventure/datafiles.cpp
@@ -0,0 +1,96 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_DATAFILES_H
+#define MACVENTURE_DATAFILES_H
+
+#include "macventure/macventure.h"
+#include "macventure/windows.h"
+
+#include "common/unzip.h"
+
+namespace MacVenture {
+
+#define MACVENTURE_DATA_BUNDLE Common::String("macventure.dat")
+
+struct BorderName {
+ MVWindowType type;
+ const char *name;
+};
+
+static const BorderName g_borderNames[] = {
+ {kDocument, "Document"},
+ {kDBox, "DBox"},
+ {kPlainDBox, "PlainDBox"},
+ {kAltBox, "AltBox"},
+ {kNoGrowDoc, "NoGrowDoc"},
+ {kMovableDBox, "MovableDBox"},
+ {kZoomDoc, "ZoomDoc"},
+ {kZoomNoGrow, "ZoomNoGrow"},
+ {kInvWindow, "InvWindow"},
+ {kRDoc16, "RDoc16"},
+ {kRDoc4, "RDoc4"},
+ {kRDoc6, "RDoc6"},
+ {kRDoc10, "RDoc10"},
+ {kNoType, "No type"}
+};
+
+Common::String windowTypeName(MVWindowType windowType) {
+ int i = 0;
+ while (g_borderNames[i].type != kNoType) {
+ i++;
+ if (g_borderNames[i].type == windowType) {
+ return g_borderNames[i].name;
+ }
+ }
+ return "";
+}
+
+void MacVentureEngine::loadDataBundle() {
+ _dataBundle = Common::makeZipArchive(MACVENTURE_DATA_BUNDLE);
+ if (!_dataBundle) {
+ error("ENGINE: Couldn't load data bundle '%s'.", MACVENTURE_DATA_BUNDLE.c_str());
+ }
+}
+
+Common::SeekableReadStream *MacVentureEngine::getBorderFile(MVWindowType windowType, bool isActive) {
+ Common::String filename = windowTypeName(windowType);
+ filename += (isActive ? "_act.bmp" : "_inac.bmp");
+ if (!_dataBundle->hasFile(filename)) {
+ warning("Missing border file '%s' in data bundle", filename.c_str());
+ return NULL;
+ }
+
+ return _dataBundle->createReadStreamForMember(filename);
+}
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/debug.h b/engines/macventure/debug.h
new file mode 100644
index 0000000000..8a2ee2eed3
--- /dev/null
+++ b/engines/macventure/debug.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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 MACVENTURE_DEBUG_H
+#define MACVENTURE_DEBUG_H
+
+namespace MacVenture {
+enum MacVentureDebugChannel {
+ kMVDebugMain = 1 << 0,
+ kMVDebugGUI = 1 << 1,
+ kMVDebugImage = 1 << 2,
+ kMVDebugText = 1 << 3,
+ kMVDebugScript = 1 << 4,
+ kMVDebugSound = 1 << 5,
+ kMVDebugContainer = 1 << 6
+};
+} // End namespace MacVenture
+
+#endif
diff --git a/engines/macventure/detection.cpp b/engines/macventure/detection.cpp
new file mode 100644
index 0000000000..ba583ef743
--- /dev/null
+++ b/engines/macventure/detection.cpp
@@ -0,0 +1,179 @@
+/* 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 "base/plugins.h"
+
+#include "engines/advancedDetector.h"
+#include "common/system.h"
+
+#include "macventure/macventure.h"
+
+namespace MacVenture {
+
+#define ADGF_DEFAULT (ADGF_DROPLANGUAGE|ADGF_DROPPLATFORM|ADGF_MACRESFORK)
+
+#define BASEGAME(n, v, f, md5, s) {n, v, AD_ENTRY1s(f, md5, s), Common::EN_ANY, Common::kPlatformMacintosh, ADGF_DEFAULT, GUIO0()}
+
+static const ADGameDescription gameDescriptions[] = {
+ BASEGAME("shadowgate", "Zojoi Rerelease", "Shadowgate.bin", "ebbfbcbf93938bd2900cb0c0213b19ad", 68974), // Zojoi Rerelease
+ BASEGAME("deja_vu", "Zojoi Rerelease", "Deja Vu.bin", "5e9f5a8e3c8eb29ed02b34ae5937354f", 69034), // Zojoi Rerelease
+ BASEGAME("deja_vu2", "Zojoi Rerelease", "Lost in Las Vegas.bin", "8f8e1d8d41f577ee0fbc03847969af0d", 66520), // Zojoi Rerelease
+ AD_TABLE_END_MARKER
+};
+
+const char *MacVentureEngine::getGameFileName() const {
+ return _gameDescription->filesDescriptions[0].fileName;
+}
+} // End of namespace MacVenture
+
+static const PlainGameDescriptor macventureGames[] = {
+ { "shadowgate", "Shadowgate" },
+ { "deja_vu", "Deja Vu"},
+ { "deja_vu2", "Deja Vu II"},
+ { 0, 0 }
+};
+
+namespace MacVenture {
+
+SaveStateDescriptor loadMetaData(Common::SeekableReadStream *s, int slot);
+
+class MacVentureMetaEngine : public AdvancedMetaEngine {
+public:
+ MacVentureMetaEngine() : AdvancedMetaEngine(MacVenture::gameDescriptions, sizeof(ADGameDescription), macventureGames) {
+ _guiOptions = GUIO0();
+ _md5Bytes = 5000000; // TODO: Upper limit, adjust it once all games are added
+ }
+
+ virtual const char *getName() const override {
+ return "MacVenture";
+ }
+ virtual const char *getOriginalCopyright() const override {
+ return "(C) ICOM Simulations";
+ }
+
+ virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
+ virtual SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const;
+ virtual void removeSaveState(const char *target, int slot) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+};
+
+bool MacVentureMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsLoadingDuringStartup) ||
+ (f == kSupportsDeleteSave) ||
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportThumbnail) ||
+ (f == kSavesSupportCreationDate) ||
+ (f == kSavesSupportPlayTime);
+}
+
+bool MacVentureEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL) ||
+ (f == kSupportsLoadingDuringRuntime) ||
+ (f == kSupportsSavingDuringRuntime);
+}
+
+SaveStateList MacVentureMetaEngine::listSaves(const char *target) const {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ Common::StringArray filenames;
+ Common::String pattern = target;
+ pattern += ".###";
+
+ filenames = saveFileMan->listSavefiles(pattern);
+
+ SaveStateList saveList;
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ int slotNum = atoi(file->c_str() + file->size() - 3);
+ SaveStateDescriptor desc;
+ // Do not allow save slot 0 (used for auto-saving) to be deleted or
+ // overwritten.
+ desc.setDeletableFlag(slotNum != 0);
+ desc.setWriteProtectedFlag(slotNum == 0);
+
+ if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) {
+ Common::InSaveFile *in = saveFileMan->openForLoading(*file);
+ if (in) {
+ desc = loadMetaData(in, slotNum);
+ if (desc.getSaveSlot() != slotNum) {
+ // invalid
+ delete in;
+ continue;
+ }
+ saveList.push_back(desc);
+ delete in;
+ }
+ }
+ }
+
+ // Sort saves based on slot number.
+ Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator());
+ return saveList;
+}
+
+int MacVentureMetaEngine::getMaximumSaveSlot() const { return 999; }
+
+bool MacVentureMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *game) const {
+ if (game) {
+ *engine = new MacVenture::MacVentureEngine(syst, game);
+ }
+ return game != 0;
+}
+
+void MacVentureMetaEngine::removeSaveState(const char *target, int slot) const {
+ g_system->getSavefileManager()->removeSavefile(Common::String::format("%s.%03d", target, slot));
+}
+
+
+SaveStateDescriptor MacVentureMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ SaveStateDescriptor desc;
+ Common::String saveFileName;
+ Common::String pattern = target;
+ pattern += ".###";
+ Common::StringArray filenames = saveFileMan->listSavefiles(pattern);
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ int slotNum = atoi(file->c_str() + file->size() - 3);
+ if (slotNum == slot) {
+ saveFileName = *file;
+ }
+ }
+
+ Common::InSaveFile *in = saveFileMan->openForLoading(saveFileName);
+ if (in) {
+ desc = loadMetaData(in, slot);
+ delete in;
+ return desc;
+ }
+ return SaveStateDescriptor(-1, "");
+}
+
+} // End of namespace MacVenture
+
+#if PLUGIN_ENABLED_DYNAMIC(MACVENTURE)
+ REGISTER_PLUGIN_DYNAMIC(MACVENTURE, PLUGIN_TYPE_ENGINE, MacVenture::MacVentureMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(MACVENTURE, PLUGIN_TYPE_ENGINE, MacVenture::MacVentureMetaEngine);
+#endif
diff --git a/engines/macventure/dialog.cpp b/engines/macventure/dialog.cpp
new file mode 100644
index 0000000000..fe21d44c7a
--- /dev/null
+++ b/engines/macventure/dialog.cpp
@@ -0,0 +1,261 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "common/system.h"
+
+#include "macventure/dialog.h"
+namespace MacVenture {
+
+
+Dialog::Dialog(Gui *gui, Common::Point pos, uint width, uint height) :
+ _gui(gui), _bounds(Common::Rect(pos.x, pos.y, pos.x + width, pos.y + height)) {}
+
+Dialog::Dialog(Gui *gui, PrebuiltDialogs prebuilt) {
+ _gui = gui;
+ const PrebuiltDialog &dialog = g_prebuiltDialogs[prebuilt];
+ calculateBoundsFromPrebuilt(dialog.bounds);
+ for (int i = 0; dialog.elements[i].type != kDEEnd; i++) {
+ addPrebuiltElement(dialog.elements[i]);
+ }
+}
+
+Dialog::~Dialog() {
+ for (Common::Array<DialogElement*>::iterator it = _elements.begin(); it != _elements.end(); it++) {
+ delete *it;
+ }
+}
+
+void Dialog::handleDialogAction(DialogElement *trigger, DialogAction action) {
+ switch(action) {
+ case kDACloseDialog:
+ _gui->closeDialog();
+ break;
+ case kDASubmit:
+ _gui->setTextInput(_userInput);
+ _gui->closeDialog();
+ break;
+ case kDASaveAs:
+ _gui->saveGame();
+ _gui->closeDialog();
+ break;
+ case kDALoadGame:
+ _gui->loadGame();
+ _gui->closeDialog();
+ break;
+ case kDANewGame:
+ _gui->newGame();
+ _gui->closeDialog();
+ break;
+ case kDAQuit:
+ _gui->quitGame();
+ _gui->closeDialog();
+ break;
+ default:
+ break;
+ }
+}
+
+const Graphics::Font &Dialog::getFont() {
+ return _gui->getCurrentFont();
+}
+
+bool Dialog::processEvent(Common::Event event) {
+ for (Common::Array<DialogElement*>::iterator it = _elements.begin(); it != _elements.end(); it++) {
+ if ((*it)->processEvent(this, event)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void Dialog::addButton(Common::String title, MacVenture::DialogAction action, Common::Point position, uint width, uint height) {
+ _elements.push_back(new DialogButton(this, title, action, position, width, height));
+}
+
+void Dialog::addText(Common::String content, Common::Point position) {
+ _elements.push_back(new DialogPlainText(this, content, position));
+}
+
+void Dialog::addTextInput(Common::Point position, int width, int height) {
+ _elements.push_back(new DialogTextInput(this, position, width, height));
+}
+
+void Dialog::draw() {
+ Graphics::ManagedSurface compose;
+ // Compose the surface
+ compose.create(_bounds.width(), _bounds.height());
+ Common::Rect base(0, 0, _bounds.width(), _bounds.height());
+ compose.fillRect(base, kColorWhite);
+ compose.frameRect(base, kColorBlack);
+ for (Common::Array<DialogElement*>::iterator it = _elements.begin(); it != _elements.end(); it++) {
+ (*it)->draw(this, compose);
+ }
+
+ g_system->copyRectToScreen(compose.getPixels(), compose.pitch,
+ _bounds.left, _bounds.top, _bounds.width(), _bounds.height());
+ }
+
+void Dialog::localize(Common::Point &point) {
+ point.x -= _bounds.left;
+ point.y -= _bounds.top;
+}
+
+void Dialog::setUserInput(Common::String content) {
+ _userInput = content;
+}
+
+void Dialog::addPrebuiltElement(const MacVenture::PrebuiltDialogElement &element) {
+ Common::Point position(element.left, element.top);
+ switch(element.type) {
+ case kDEButton:
+ addButton(element.title, element.action, position, element.width, element.height);
+ break;
+ case kDEPlainText:
+ addText(element.title, position);
+ break;
+ case kDETextInput:
+ addTextInput(position, element.width, element.height);
+ break;
+ default:
+ break;
+ }
+}
+
+// Dialog Element
+
+DialogElement::DialogElement(Dialog *dialog, Common::String title, DialogAction action, Common::Point position, uint width, uint height) :
+ _text(title), _action(action) {
+ if (width == 0) {
+ width = dialog->getFont().getStringWidth(title);
+ }
+ if (height == 0) {
+ height = dialog->getFont().getFontHeight();
+ }
+ _bounds = Common::Rect(position.x, position.y, position.x + width, position.y + height);
+}
+
+bool DialogElement::processEvent(MacVenture::Dialog *dialog, Common::Event event) {
+ return doProcessEvent(dialog, event);
+}
+
+void DialogElement::draw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target) {
+ doDraw(dialog, target);
+}
+
+const Common::String &DialogElement::getText() {
+ return doGetText();
+}
+
+const Common::String &DialogElement::doGetText() {
+ return _text;
+}
+
+// CONCRETE DIALOG ELEMENTS
+
+DialogButton::DialogButton(Dialog *dialog, Common::String title, DialogAction action, Common::Point position, uint width, uint height):
+ DialogElement(dialog, title, action, position, width, height) {}
+
+bool DialogButton::doProcessEvent(MacVenture::Dialog *dialog, Common::Event event) {
+ Common::Point mouse = event.mouse;
+ if (event.type == Common::EVENT_LBUTTONDOWN) {
+ dialog->localize(mouse);
+ if (_bounds.contains(mouse)) {
+ debugC(2, kMVDebugGUI, "Click! Button: %s", _text.c_str());
+ dialog->handleDialogAction(this, _action);
+ return true;
+ }
+ }
+ return false;
+}
+
+void DialogButton::doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target) {
+ target.fillRect(_bounds, kColorWhite);
+ target.frameRect(_bounds, kColorBlack);
+ // Draw title
+ dialog->getFont().drawString(
+ &target, _text, _bounds.left, _bounds.top, _bounds.width(), kColorBlack, Graphics::kTextAlignCenter);
+}
+
+DialogPlainText::DialogPlainText(Dialog *dialog, Common::String content, Common::Point position) :
+ DialogElement(dialog, content, kDANone, position, 0, 0) { }
+
+DialogPlainText::~DialogPlainText() {}
+
+bool DialogPlainText::doProcessEvent(MacVenture::Dialog *dialog, Common::Event event) {
+ return false;
+}
+
+void DialogPlainText::doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target) {
+ // Draw contents
+ dialog->getFont().drawString(
+ &target, _text, _bounds.left, _bounds.top, _bounds.width(), kColorBlack, Graphics::kTextAlignCenter);
+
+}
+
+DialogTextInput::DialogTextInput(Dialog *dialog, Common::Point position, uint width, uint height) :
+ DialogElement(dialog, "", kDANone, position, width, height) {}
+DialogTextInput::~DialogTextInput() {}
+
+bool DialogTextInput::doProcessEvent(Dialog *dialog, Common::Event event) {
+ if (event.type == Common::EVENT_KEYDOWN) {
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_BACKSPACE:
+ if (!_text.empty()) {
+ _text.deleteLastChar();
+ dialog->setUserInput(_text);
+ return true;
+ }
+ break;
+ default:
+ if (event.kbd.ascii >= 0x20 && event.kbd.ascii <= 0x7f) {
+ _text += (char)event.kbd.ascii;
+ dialog->setUserInput(_text);
+ return true;
+ }
+ break;
+ }
+ }
+ return false;
+}
+
+void DialogTextInput::doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target) {
+ target.fillRect(_bounds, kColorWhite);
+ target.frameRect(_bounds, kColorBlack);
+ dialog->getFont().drawString(&target, _text, _bounds.left, _bounds.top, _bounds.width(), kColorBlack);
+}
+
+void Dialog::calculateBoundsFromPrebuilt(const PrebuiltDialogBounds &bounds) {
+ _bounds = Common::Rect(
+ bounds.left,
+ bounds.top,
+ bounds.right,
+ bounds.bottom);
+}
+} // End of namespace MacVenture
diff --git a/engines/macventure/dialog.h b/engines/macventure/dialog.h
new file mode 100644
index 0000000000..36f7a32269
--- /dev/null
+++ b/engines/macventure/dialog.h
@@ -0,0 +1,131 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_DIALOG_H
+#define MACVENTURE_DIALOG_H
+
+#include "graphics/macgui/macwindowmanager.h"
+
+#include "macventure/macventure.h"
+#include "macventure/prebuilt_dialogs.h"
+
+namespace MacVenture {
+
+using namespace Graphics::MacGUIConstants;
+class Gui;
+class DialogElement;
+
+class Dialog {
+public:
+ Dialog(Gui *gui, Common::Point pos, uint width, uint height);
+ Dialog(Gui *gui, PrebuiltDialogs prebuilt);
+
+ ~Dialog();
+
+ bool processEvent(Common::Event event);
+ void draw();
+ void localize(Common::Point &point);
+ void handleDialogAction(DialogElement *trigger, DialogAction action);
+
+ const Graphics::Font &getFont();
+
+ void addButton(Common::String title, DialogAction action, Common::Point position, uint width = 0, uint height = 0);
+ void addText(Common::String content, Common::Point position);
+ void addTextInput(Common::Point position, int width, int height);
+
+ void setUserInput(Common::String content);
+
+private:
+ void addPrebuiltElement(const PrebuiltDialogElement &element);
+
+ void calculateBoundsFromPrebuilt(const PrebuiltDialogBounds &bounds);
+
+private:
+ Gui *_gui;
+
+ Common::String _userInput;
+ Common::Array<DialogElement*> _elements;
+ Common::Rect _bounds;
+};
+
+class DialogElement {
+public:
+ DialogElement(Dialog *dialog, Common::String title, DialogAction action, Common::Point position, uint width = 0, uint height = 0);
+ virtual ~DialogElement() {}
+
+ bool processEvent(Dialog *dialog, Common::Event event);
+ void draw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target);
+ const Common::String &getText();
+
+private:
+ virtual bool doProcessEvent(Dialog *dialog, Common::Event event) = 0;
+ virtual void doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target) = 0;
+ virtual const Common::String &doGetText();
+
+protected:
+ Common::String _text;
+ Common::Rect _bounds;
+ DialogAction _action;
+};
+
+// Dialog elements
+class DialogButton : public DialogElement {
+public:
+ DialogButton(Dialog *dialog, Common::String title, DialogAction action, Common::Point position, uint width = 0, uint height = 0);
+ ~DialogButton() {}
+
+private:
+ bool doProcessEvent(Dialog *dialog, Common::Event event);
+ void doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target);
+};
+
+class DialogPlainText : public DialogElement {
+public:
+ DialogPlainText(Dialog *dialog, Common::String content, Common::Point position);
+ ~DialogPlainText();
+
+private:
+ bool doProcessEvent(Dialog *dialog, Common::Event event);
+ void doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target);
+};
+
+class DialogTextInput : public DialogElement {
+public:
+ DialogTextInput(Dialog *dialog, Common::Point position, uint width, uint height);
+ ~DialogTextInput();
+
+private:
+ bool doProcessEvent(Dialog *dialog, Common::Event event);
+ void doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target);
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
new file mode 100644
index 0000000000..7cfc211b41
--- /dev/null
+++ b/engines/macventure/gui.cpp
@@ -0,0 +1,1468 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "common/file.h"
+#include "common/system.h"
+#include "common/debug-channels.h"
+#include "common/debug.h"
+#include "image/bmp.h"
+
+#include "macventure/gui.h"
+#include "macventure/dialog.h"
+
+namespace MacVenture {
+
+enum {
+ kCursorWidth = 2,
+ kCursorHeight = 2
+};
+
+enum {
+ kExitButtonWidth = 10,
+ kExitButtonHeight = 10
+};
+
+enum {
+ kMenuHighLevel = -1,
+ kMenuAbout = 0,
+ kMenuFile = 1,
+ kMenuEdit = 2,
+ kMenuSpecial = 3
+};
+
+enum {
+ kCommandNum = 8
+};
+
+enum {
+ kDragThreshold = 5
+};
+
+const bool kLoadStaticMenus = true;
+
+static const Graphics::MenuData menuSubItems[] = {
+ { kMenuHighLevel, "File", 0, 0, false },
+ { kMenuHighLevel, "Edit", 0, 0, false },
+ { kMenuHighLevel, "Special", 0, 0, false },
+ { kMenuHighLevel, "Font", 0, 0, false },
+ { kMenuHighLevel, "FontSize", 0, 0, false },
+
+ //{ kMenuAbout, "About", kMenuActionAbout, 0, true},
+
+ { kMenuFile, "New", kMenuActionNew, 0, true },
+ { kMenuFile, NULL, 0, 0, false },
+ { kMenuFile, "Open...", kMenuActionOpen, 0, true },
+ { kMenuFile, "Save", kMenuActionSave, 0, true },
+ { kMenuFile, "Save as...", kMenuActionSaveAs, 0, true },
+ { kMenuFile, NULL, 0, 0, false },
+ { kMenuFile, "Quit", kMenuActionQuit, 0, true },
+
+ { kMenuEdit, "Undo", kMenuActionUndo, 'Z', false },
+ { kMenuEdit, NULL, 0, 0, false },
+ { kMenuEdit, "Cut", kMenuActionCut, 'K', false },
+ { kMenuEdit, "Copy", kMenuActionCopy, 'C', false },
+ { kMenuEdit, "Paste", kMenuActionPaste, 'V', false },
+ { kMenuEdit, "Clear", kMenuActionClear, 'B', false },
+
+ { kMenuSpecial, "Clean Up", kMenuActionCleanUp, 0, false },
+ { kMenuSpecial, "Mess Up", kMenuActionMessUp, 0, false },
+
+ { 0, NULL, 0, 0, false }
+};
+
+
+bool commandsWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+bool mainGameWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+bool outConsoleWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+bool selfWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+bool exitsWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+bool diplomaWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+bool inventoryWindowCallback(Graphics::WindowClick, Common::Event &event, void *gui);
+
+void menuCommandsCallback(int action, Common::String &text, void *data);
+
+Gui::Gui(MacVentureEngine *engine, Common::MacResManager *resman) {
+ _engine = engine;
+ _resourceManager = resman;
+ _windowData = NULL;
+ _controlData = NULL;
+ _draggedObj.id = 0;
+ _draggedObj.pos = Common::Point(0, 0);
+ _dialog = NULL;
+
+ _cursor = new Cursor(this);
+
+ _consoleText = new ConsoleText(this);
+ _graphics = NULL;
+
+ initGUI();
+}
+
+Gui::~Gui() {
+
+ if (_windowData)
+ delete _windowData;
+
+ if (_controlData)
+ delete _controlData;
+
+ if (_exitsData)
+ delete _exitsData;
+
+ if (_cursor)
+ delete _cursor;
+
+ if (_consoleText)
+ delete _consoleText;
+
+ if (_dialog)
+ delete _dialog;
+
+ clearAssets();
+
+ if (_graphics)
+ delete _graphics;
+}
+
+void Gui::initGUI() {
+ _screen.create(kScreenWidth, kScreenHeight, Graphics::PixelFormat::createFormatCLUT8());
+ _wm.setScreen(&_screen);
+
+ // Menu
+ _menu = _wm.addMenu();
+ if (!loadMenus())
+ error("GUI: Could not load menus");
+ _menu->setCommandsCallback(menuCommandsCallback, this);
+ _menu->calcDimensions();
+
+ loadGraphics();
+
+ if (!loadWindows())
+ error("GUI: Could not load windows");
+
+ initWindows();
+
+ assignObjReferences();
+
+ if (!loadControls())
+ error("GUI: Could not load controls");
+
+ draw();
+
+}
+
+void Gui::reloadInternals() {
+ clearAssets();
+ loadGraphics();
+}
+
+void Gui::draw() {
+ // Will be performance-improved after the milestone
+ _wm.setFullRefresh(true);
+
+ drawWindows();
+
+ _wm.draw();
+
+ drawDraggedObject();
+ drawDialog();
+ // TODO: When window titles with custom borders are in MacGui, this should be used.
+ //drawWindowTitle(kMainGameWindow, _mainGameWindow->getSurface());
+}
+
+void Gui::drawMenu() {
+ _menu->draw(&_screen);
+}
+
+void Gui::drawTitle() {
+ warning("drawTitle hasn't been tested yet");
+}
+
+void Gui::clearControls() {
+ if (!_controlData)
+ return;
+
+ Common::Array<CommandButton>::iterator it = _controlData->begin();
+ for (; it != _controlData->end(); ++it) {
+ it->unselect();
+ }
+}
+
+void Gui::initWindows() {
+ // Game Controls Window
+ _controlsWindow = _wm.addWindow(false, false, false);
+ _controlsWindow->setDimensions(getWindowData(kCommandsWindow).bounds);
+ _controlsWindow->setActive(false);
+ _controlsWindow->setCallback(commandsWindowCallback, this);
+ loadBorders(_controlsWindow, findWindowData(kCommandsWindow).type);
+
+ // Main Game Window
+ _mainGameWindow = _wm.addWindow(false, false, false);
+ _mainGameWindow->setDimensions(getWindowData(kMainGameWindow).bounds);
+ _mainGameWindow->setActive(false);
+ _mainGameWindow->setCallback(mainGameWindowCallback, this);
+ loadBorders(_mainGameWindow, findWindowData(kMainGameWindow).type);
+
+ // In-game Output Console
+ _outConsoleWindow = _wm.addWindow(true, true, false);
+ // HACK We have to hand-create the dimensions, otherwise they don't fit
+ const WindowData &wd = getWindowData(kOutConsoleWindow);
+ Common::Rect dimensions = wd.bounds;
+ dimensions.setWidth(dimensions.width() - borderBounds(wd.type).rightOffset);
+ _outConsoleWindow->setDimensions(dimensions);
+ _outConsoleWindow->setActive(false);
+ _outConsoleWindow->setCallback(outConsoleWindowCallback, this);
+ loadBorders(_outConsoleWindow, findWindowData(kOutConsoleWindow).type);
+
+ // Self Window
+ _selfWindow = _wm.addWindow(false, true, false);
+ _selfWindow->setDimensions(getWindowData(kSelfWindow).bounds);
+ _selfWindow->setActive(false);
+ _selfWindow->setCallback(selfWindowCallback, this);
+ loadBorders(_selfWindow, findWindowData(kSelfWindow).type);
+
+ // Exits Window
+ _exitsWindow = _wm.addWindow(false, false, false);
+ _exitsWindow->setDimensions(getWindowData(kExitsWindow).bounds);
+ _exitsWindow->setActive(false);
+ _exitsWindow->setCallback(exitsWindowCallback, this);
+
+ // TODO: In the original, the background is actually a clickable
+ // object that can be used to refer to the room itself. In that case,
+ // the background should be kPatternDarkGray.
+ _exitsWindow->setBackgroundPattern(kPatternLightGray);
+ loadBorders(_exitsWindow, findWindowData(kExitsWindow).type);
+}
+
+const WindowData &Gui::getWindowData(WindowReference reference) {
+ return findWindowData(reference);
+}
+
+const Graphics::Font &Gui::getCurrentFont() {
+ return *_wm.getFont("Chicago-12", Graphics::FontManager::kBigGUIFont);
+}
+
+void Gui::bringToFront(WindowReference winID) {
+ findWindow(winID)->setActive(true);
+}
+
+void Gui::setWindowTitle(WindowReference winID, Common::String string) {
+ findWindowData(winID).title = string;
+ findWindowData(winID).titleLength = string.size();
+}
+
+void Gui::updateWindowInfo(WindowReference ref, ObjID objID, const Common::Array<ObjID> &children) {
+ if (ref == kNoWindow) {
+ return;
+ }
+ WindowData &data = findWindowData(ref);
+ data.children.clear();
+ data.objRef = objID;
+ uint32 originx = 0x7fff;
+ uint32 originy = 0x7fff;
+ for (uint i = 0; i < children.size(); i++) {
+ if (children[i] != 1) {
+ ObjID child = children[i];
+ if (ref != kMainGameWindow) {
+ Common::Point childPos = _engine->getObjPosition(child);
+ originx = originx > (uint)childPos.x ? (uint)childPos.x : originx;
+ originy = originy > (uint)childPos.y ? (uint)childPos.y : originy;
+ }
+ data.children.push_back(DrawableObject(child, kBlitBIC));
+ }
+ }
+ if (originx != 0x7fff) {
+ data.bounds.left = originx;
+ }
+ if (originy != 0x7fff) {
+ data.bounds.top = originy;
+ }
+ if (ref != kMainGameWindow) {
+ data.updateScroll = true;
+ }
+}
+
+void Gui::addChild(WindowReference target, ObjID child) {
+ findWindowData(target).children.push_back(DrawableObject(child, kBlitBIC));
+}
+
+void Gui::removeChild(WindowReference target, ObjID child) {
+ WindowData &data = findWindowData(target);
+ uint index = 0;
+ for (;index < data.children.size(); index++) {
+ if (data.children[index].obj == child) {
+ break;
+ }
+ }
+
+ if (index < data.children.size())
+ data.children.remove_at(index);
+}
+
+void Gui::assignObjReferences() {
+ findWindowData(kSelfWindow).objRef = 0;
+}
+
+WindowReference Gui::createInventoryWindow(ObjID objRef) {
+ Graphics::MacWindow *newWindow = _wm.addWindow(true, true, true);
+ WindowData newData;
+ GlobalSettings settings = _engine->getGlobalSettings();
+ newData.refcon = (WindowReference)ABS(_inventoryWindows.size() + kInventoryStart); // This is a HACK
+
+ if (_windowData->back().refcon < 0x80) { // There is already another inventory window
+ newData.bounds = _windowData->back().bounds; // Inventory windows are always last
+ newData.bounds.translate(newData.bounds.left + settings._invOffsetX, newData.bounds.top + settings._invOffsetY);
+ } else {
+ BorderBounds bbs = borderBounds(kInvWindow);
+ newData.bounds = Common::Rect(
+ settings._invLeft - bbs.leftOffset,
+ settings._invTop - bbs.topOffset,
+ settings._invLeft + settings._invWidth,
+ settings._invTop + settings._invHeight);
+ }
+ newData.type = kInvWindow;
+ newData.hasCloseBox = true;
+ newData.visible = true;
+ newData.objRef = objRef;
+ _windowData->push_back(newData);
+
+ newWindow->setDimensions(newData.bounds);
+ newWindow->setCallback(inventoryWindowCallback, this);
+ newWindow->setCloseable(true);
+ loadBorders(newWindow, newData.type);
+ _inventoryWindows.push_back(newWindow);
+
+ debugC(1, kMVDebugGUI, "Create new inventory window. Reference: %d", newData.refcon);
+ return newData.refcon;
+}
+
+void Gui::loadBorders(Graphics::MacWindow *target, MVWindowType type) {
+ loadBorder(target, type, false);
+ loadBorder(target, type, true);
+}
+
+void Gui::loadBorder(Graphics::MacWindow *target, MVWindowType type, bool active) {
+
+ Common::SeekableReadStream *stream = _engine->getBorderFile(type, active);
+
+ if (stream) {
+ BorderBounds bbs = borderBounds(type);
+ target->loadBorder(*stream, active, bbs.leftOffset, bbs.rightOffset, bbs.topOffset, bbs.bottomOffset);
+
+ delete stream;
+ }
+}
+
+void Gui::loadGraphics() {
+ if (_graphics)
+ delete _graphics;
+ _graphics = new Container(_engine->getFilePath(kGraphicPathID));
+}
+
+void Gui::clearAssets() {
+ Common::HashMap<ObjID, ImageAsset*>::const_iterator it = _assets.begin();
+ for (; it != _assets.end(); it++) {
+ delete it->_value;
+ }
+ _assets.clear();
+}
+
+bool Gui::loadMenus() {
+
+ if (kLoadStaticMenus) {
+ // We assume that, if there are static menus, we don't need dynamic ones
+ _menu->addStaticMenus(menuSubItems);
+ return true;
+ }
+
+ Common::MacResIDArray resArray;
+ Common::SeekableReadStream *res;
+ Common::MacResIDArray::const_iterator iter;
+
+ if ((resArray = _resourceManager->getResIDArray(MKTAG('M', 'E', 'N', 'U'))).size() == 0)
+ return false;
+
+ _menu->addMenuSubItem(0, "Abb", kMenuActionAbout, 0, 'A', true);
+
+ int i = 1;
+ for (iter = resArray.begin(); iter != resArray.end(); ++iter) {
+ res = _resourceManager->getResource(MKTAG('M', 'E', 'N', 'U'), *iter);
+ uint16 key;
+ uint16 style;
+ uint8 titleLength;
+ char *title;
+
+ /* Skip menuID, width, height, resourceID, placeholder */
+ for (int skip = 0; skip < 5; skip++) {
+ res->readUint16BE();
+ }
+ titleLength = res->readByte();
+ title = new char[titleLength + 1];
+ res->read(title, titleLength);
+ title[titleLength] = '\0';
+
+ if (titleLength > 1) {
+ _menu->addMenuItem(title);
+
+ // Read submenu items
+ while ((titleLength = res->readByte())) {
+ title = new char[titleLength + 1];
+ res->read(title, titleLength);
+ title[titleLength] = '\0';
+ // Skip icon
+ res->readUint16BE();
+ // Read key
+ key = res->readUint16BE();
+ // Skip mark
+ res->readUint16BE();
+ // Read style
+ style = res->readUint16BE();
+ _menu->addMenuSubItem(i, title, 0, style, key, false);
+ }
+ }
+
+ i++;
+ delete res;
+ }
+
+ return true;
+}
+
+bool Gui::loadWindows() {
+ Common::MacResIDArray resArray;
+ Common::SeekableReadStream *res;
+ Common::MacResIDArray::const_iterator iter;
+
+ _windowData = new Common::List<WindowData>();
+
+ if ((resArray = _resourceManager->getResIDArray(MKTAG('W', 'I', 'N', 'D'))).size() == 0)
+ return false;
+
+ uint32 id = kCommandsWindow;
+ for (iter = resArray.begin(); iter != resArray.end(); ++iter) {
+ res = _resourceManager->getResource(MKTAG('W', 'I', 'N', 'D'), *iter);
+ WindowData data;
+ uint16 top, left, bottom, right;
+ top = res->readUint16BE();
+ left = res->readUint16BE();
+ bottom = res->readUint16BE();
+ right = res->readUint16BE();
+ data.type = (MVWindowType)res->readUint16BE();
+ BorderBounds bbs = borderBounds(data.type);
+ data.bounds = Common::Rect(
+ left - bbs.leftOffset,
+ top - bbs.topOffset,
+ right + bbs.rightOffset,
+ bottom + bbs.bottomOffset);
+
+ data.visible = res->readUint16BE();
+ data.hasCloseBox = res->readUint16BE();
+ data.refcon = (WindowReference)id; id++;
+ res->readUint32BE(); // Skip the true id. For some reason it's reading 0
+ data.titleLength = res->readByte();
+ if (data.titleLength) {
+ char *newTitle = new char[data.titleLength + 1];
+ res->read(newTitle, data.titleLength);
+ newTitle[data.titleLength] = '\0';
+ data.title = Common::String(newTitle);
+ delete[] newTitle;
+ }
+ data.scrollPos = Common::Point(0, 0);
+
+ debugC(1, kMVDebugGUI, "Window loaded: %s", data.title.c_str());
+
+ _windowData->push_back(data);
+
+ delete res;
+ }
+
+ return true;
+}
+
+bool Gui::loadControls() {
+ Common::MacResIDArray resArray;
+ Common::SeekableReadStream *res;
+ Common::MacResIDArray::const_iterator iter;
+
+ _controlData = new Common::Array<CommandButton>();
+ _exitsData = new Common::Array<CommandButton>();
+
+ if ((resArray = _resourceManager->getResIDArray(MKTAG('C', 'N', 'T', 'L'))).size() == 0)
+ return false;
+
+ uint32 id = kControlExitBox;
+ for (iter = resArray.begin(); iter != resArray.end(); ++iter) {
+ res = _resourceManager->getResource(MKTAG('C', 'N', 'T', 'L'), *iter);
+ ControlData data;
+ uint16 top, left, bottom, right;
+ top = res->readUint16BE();
+ left = res->readUint16BE();
+ bottom = res->readUint16BE();
+ right = res->readUint16BE();
+ data.scrollValue = res->readUint16BE();
+ data.visible = res->readByte();
+ res->readByte(); // Unused
+ data.scrollMax = res->readUint16BE();
+ data.scrollMin = res->readUint16BE();
+ data.cdef = res->readUint16BE();
+ data.refcon = (ControlAction)res->readUint32BE();
+ data.type = (ControlType)id; id++;
+ data.titleLength = res->readByte();
+ if (data.titleLength) {
+ char *title = new char[data.titleLength + 1];
+ res->read(title, data.titleLength);
+ title[data.titleLength] = '\0';
+ data.title = Common::String(title);
+ delete[] title;
+ }
+ if (data.type != kControlExitBox) {
+ BorderBounds bbs = borderBounds(getWindowData(kCommandsWindow).type);
+ // We just want to move the button, not change it's size
+ data.bounds = Common::Rect(left + bbs.leftOffset, top + bbs.topOffset, right + bbs.leftOffset, bottom + bbs.topOffset);
+ } else {
+ data.bounds = Common::Rect(left, top, right, bottom);
+ }
+
+
+ _controlData->push_back(CommandButton(data, this));
+
+ delete res;
+ }
+
+ return true;
+}
+
+void Gui::drawWindows() {
+
+ drawCommandsWindow();
+ drawMainGameWindow();
+ drawSelfWindow();
+ drawInventories();
+ drawExitsWindow();
+ drawConsoleWindow();
+
+}
+
+void Gui::drawCommandsWindow() {
+ if (_engine->needsClickToContinue()) {
+ Graphics::ManagedSurface *srf = _controlsWindow->getSurface();
+ WindowData data = getWindowData(kCommandsWindow);
+ srf->fillRect(Common::Rect(0, 0, srf->w, srf->h), kColorWhite);
+ getCurrentFont().drawString(
+ srf,
+ _engine->getCommandsPausedString(),
+ 0,
+ (srf->h / 2) - getCurrentFont().getFontHeight(),
+ data.bounds.right - data.bounds.left,
+ kColorBlack,
+ Graphics::kTextAlignCenter);
+ } else {
+ Common::Array<CommandButton>::const_iterator it = _controlData->begin();
+ for (; it != _controlData->end(); ++it) {
+ CommandButton button = *it;
+ if (button.getData().type != kControlExitBox)
+ button.draw(*_controlsWindow->getSurface());
+ }
+ }
+}
+
+void Gui::drawMainGameWindow() {
+ const WindowData &data = getWindowData(kMainGameWindow);
+ BorderBounds border = borderBounds(data.type);
+ ObjID objRef = data.objRef;
+
+ _mainGameWindow->setDirty(true);
+
+ if (data.objRef > 0 && data.objRef < 2000) {
+ ensureAssetLoaded(objRef);
+
+ _assets[objRef]->blitInto(
+ _mainGameWindow->getSurface(),
+ border.leftOffset,
+ border.topOffset,
+ kBlitDirect);
+ }
+
+ drawObjectsInWindow(data, _mainGameWindow->getSurface());
+
+ if (DebugMan.isDebugChannelEnabled(kMVDebugGUI)) {
+ Graphics::MacWindow *win = findWindow(data.refcon);
+ Common::Rect innerDims = win->getInnerDimensions();
+ int x = win->getDimensions().left;
+ int y = win->getDimensions().top;
+ innerDims.translate(-x, -y);
+ win->getSurface()->frameRect(innerDims, kColorGreen);
+ }
+
+ findWindow(kMainGameWindow)->setDirty(true);
+}
+
+void Gui::drawSelfWindow() {
+ drawObjectsInWindow(getWindowData(kSelfWindow), _selfWindow->getSurface());
+ if (_engine->isObjSelected(1)) {
+ invertWindowColors(kSelfWindow);
+ }
+ findWindow(kSelfWindow)->setDirty(true);
+}
+
+void Gui::drawInventories() {
+
+ Graphics::ManagedSurface *srf;
+ for (uint i = 0; i < _inventoryWindows.size(); i++) {
+ const WindowData &data = getWindowData((WindowReference)(kInventoryStart + i));
+ Graphics::MacWindow *win = findWindow(data.refcon);
+ srf = win->getSurface();
+ srf->clear(kColorGreen);
+ srf->fillRect(srf->getBounds(), kColorWhite);
+ drawObjectsInWindow(data, srf);
+
+ if (DebugMan.isDebugChannelEnabled(kMVDebugGUI)) {
+ Common::Rect innerDims = win->getInnerDimensions();
+ int x = win->getDimensions().left;
+ int y = win->getDimensions().top;
+ innerDims.translate(-x, -y);
+ srf->frameRect(innerDims, kColorGreen);
+ }
+
+ findWindow(data.refcon)->setDirty(true);
+ }
+
+}
+
+void Gui::drawExitsWindow() {
+
+ Graphics::ManagedSurface *srf = _exitsWindow->getSurface();
+
+ Common::Array<CommandButton>::const_iterator it = _exitsData->begin();
+ for (; it != _exitsData->end(); ++it) {
+ CommandButton button = *it;
+ button.draw(*srf);
+ }
+
+ findWindow(kExitsWindow)->setDirty(true);
+}
+
+void Gui::drawConsoleWindow() {
+
+ Graphics::ManagedSurface *srf = _outConsoleWindow->getSurface();
+ BorderBounds bounds = borderBounds(getWindowData(kOutConsoleWindow).type);
+ _consoleText->renderInto(srf, bounds, kConsoleLeftOffset);
+}
+
+void Gui::drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSurface *surface) {
+ BorderBounds border = borderBounds(targetData.type);
+ Common::Point pos;
+ ObjID child;
+ BlitMode mode;
+
+ if (targetData.children.size() == 0) {
+ return;
+ }
+
+ Graphics::ManagedSurface composeSurface;
+ createInnerSurface(&composeSurface, surface, border);
+ assert(composeSurface.w <= surface->w &&
+ composeSurface.h <= surface->h);
+ composeSurface.clear(kColorGreen);
+
+ for (uint i = 0; i < targetData.children.size(); i++) {
+ child = targetData.children[i].obj;
+ mode = (BlitMode)targetData.children[i].mode;
+ pos = _engine->getObjPosition(child);
+ pos -= targetData.scrollPos;
+ ensureAssetLoaded(child);
+
+ _assets[child]->blitInto(
+ &composeSurface,
+ pos.x,
+ pos.y,
+ mode);
+
+ if (_engine->isObjVisible(child)) {
+ if (_engine->isObjSelected(child) ||
+ child == _draggedObj.id) {
+
+ _assets[child]->blitInto(
+ &composeSurface, pos.x, pos.y, kBlitOR);
+ }
+ }
+
+ if (DebugMan.isDebugChannelEnabled(kMVDebugGUI)) {
+ Common::Rect testBounds = _engine->getObjBounds(child);
+ testBounds.translate(-targetData.scrollPos.x, -targetData.scrollPos.y);
+ surface->frameRect(testBounds, kColorGreen);
+ }
+ }
+ Common::Point composePosition = Common::Point(border.leftOffset, border.topOffset);
+ surface->transBlitFrom(composeSurface, composePosition, kColorGreen);
+}
+
+void Gui::drawWindowTitle(WindowReference target, Graphics::ManagedSurface *surface) {
+ // TODO: Implement when MacGui supports titles in windows with custom borders.
+}
+
+void Gui::drawDraggedObject() {
+ if (_draggedObj.id != 0 &&
+ _engine->isObjVisible(_draggedObj.id)) {
+ ensureAssetLoaded(_draggedObj.id);
+ ImageAsset *asset = _assets[_draggedObj.id];
+
+ // In case of overflow from the right/top
+ uint w = asset->getWidth() + MIN((int16)0, _draggedObj.pos.x);
+ uint h = asset->getHeight() + MIN((int16)0, _draggedObj.pos.y);
+
+ // In case of overflow from the bottom/left
+ if (_draggedObj.pos.x > 0 && _draggedObj.pos.x + w > kScreenWidth) {
+ w = kScreenWidth - _draggedObj.pos.x;
+ }
+ if (_draggedObj.pos.y > 0 && _draggedObj.pos.y + h > kScreenHeight) {
+ h = kScreenHeight - _draggedObj.pos.y;
+ }
+
+ Common::Point target = _draggedObj.pos;
+ if (target.x < 0) {
+ target.x = 0;
+ }
+ if (target.y < 0) {
+ target.y = 0;
+ }
+
+ _draggedSurface.create(w, h, _screen.format);
+ _draggedSurface.blitFrom(
+ _screen,
+ Common::Rect(
+ target.x,
+ target.y,
+ target.x + _draggedSurface.w,
+ target.y + _draggedSurface.h),
+ Common::Point(0, 0));
+ asset->blitInto(&_draggedSurface, MIN((int16)0, _draggedObj.pos.x), MIN((int16)0, _draggedObj.pos.y), kBlitBIC);
+
+ g_system->copyRectToScreen(
+ _draggedSurface.getBasePtr(0, 0),
+ _draggedSurface.pitch,
+ target.x,
+ target.y,
+ _draggedSurface.w,
+ _draggedSurface.h
+ );
+ }
+}
+
+void Gui::drawDialog() {
+ if (_dialog) {
+ _dialog->draw();
+ }
+}
+
+void Gui::updateWindow(WindowReference winID, bool containerOpen) {
+ if (winID == kNoWindow) {
+ return;
+ }
+ if (winID == kSelfWindow || containerOpen) {
+ WindowData &data = findWindowData(winID);
+ if (winID == kCommandsWindow) {
+ Common::Array<CommandButton>::iterator it = _controlData->begin();
+ for (; it != _controlData->end(); ++it) {
+ it->unselect();
+ }
+ }
+ Common::Array<DrawableObject> &children = data.children;
+ for (uint i = 0; i < children.size(); i++) {
+ uint flag = 0;
+ ObjID child = children[i].obj;
+ BlitMode mode = kBlitDirect;
+ bool off = !_engine->isObjVisible(child);
+ if (flag || !off || !_engine->isObjClickable(child)) {
+ mode = kBlitBIC;
+ if (off || flag) {
+ mode = kBlitXOR;
+ } else if (!off && _engine->isObjSelected(child)) {
+ mode = kBlitOR;
+ }
+ children[i] = DrawableObject(child, mode);
+ } else {
+ children[i] = DrawableObject(child, kBlitXOR);
+ }
+ }
+ if (winID == kMainGameWindow) {
+ drawMainGameWindow();
+ } else {
+ Graphics::MacWindow *winRef = findWindow(winID);
+ winRef->getSurface()->fillRect(data.bounds, kColorGray);
+ }
+ if (data.type == kZoomDoc && data.updateScroll) {
+ warning("Unimplemented: update scroll");
+ }
+ }
+}
+
+void Gui::clearExits() {
+ _exitsData->clear();
+}
+
+void Gui::unselectExits() {
+ Common::Array<CommandButton>::const_iterator it = _exitsData->begin();
+ for (; it != _exitsData->end(); ++it) {
+ CommandButton button = *it;
+ button.unselect();
+ }
+}
+
+void Gui::updateExit(ObjID obj) {
+ if (!_engine->isObjExit(obj)) {
+ return;
+ }
+ BorderBounds border = borderBounds(getWindowData(kExitsWindow).type);
+
+ int ctl = -1;
+ int i = 0;
+ Common::Array<CommandButton>::const_iterator it = _exitsData->begin();
+ for (;it != _exitsData->end(); it++) {
+ if (it->getData().refcon == obj)
+ ctl = i;
+ else
+ i++;
+ }
+
+ if (ctl != -1)
+ _exitsData->remove_at(ctl);
+
+ if (!_engine->isHiddenExit(obj) &&
+ _engine->getParent(obj) == _engine->getParent(1)) {
+ ControlData data;
+ data.titleLength = 0;
+ data.refcon = (ControlAction)obj; // Objects can be exits (actions)
+ Common::Point pos = _engine->getObjExitPosition(obj);
+ pos.x += border.leftOffset;
+ pos.y += border.topOffset;
+ data.bounds = Common::Rect(pos.x, pos.y, pos.x + kExitButtonWidth, pos.y + kExitButtonHeight);
+ data.visible = true;
+
+ _exitsData->push_back(CommandButton(data, this));
+ }
+}
+
+void Gui::printText(const Common::String &text) {
+ debugC(1, kMVDebugGUI, "Print Text: %s", text.c_str());
+ _consoleText->printLine(text, _outConsoleWindow->getDimensions().width());
+}
+
+void Gui::showPrebuiltDialog(PrebuiltDialogs type) {
+ closeDialog();
+ _dialog = new Dialog(this, type);
+}
+
+bool Gui::isDialogOpen() {
+ return _dialog != NULL;
+}
+
+void Gui::setTextInput(Common::String str) {
+ _engine->setTextInput(str);
+}
+
+
+void Gui::closeDialog() {
+ delete _dialog;
+ _dialog = NULL;
+}
+
+void Gui::getTextFromUser() {
+ if (_dialog) {
+ delete _dialog;
+ }
+ showPrebuiltDialog(kSpeakDialog);
+}
+
+void Gui::loadGame() {
+ _engine->scummVMSaveLoadDialog(false);
+}
+
+void Gui::saveGame() {
+ _engine->scummVMSaveLoadDialog(true);
+}
+
+void Gui::newGame() {
+ _engine->newGame();
+}
+
+void Gui::quitGame() {
+ _engine->requestQuit();
+}
+
+void Gui::createInnerSurface(Graphics::ManagedSurface *innerSurface, Graphics::ManagedSurface *outerSurface, const BorderBounds &borders) {
+ innerSurface->create(
+ outerSurface->w - borders.leftOffset - borders.rightOffset,
+ outerSurface->h - borders.topOffset - borders.bottomOffset,
+ outerSurface->format);
+}
+
+void Gui::moveDraggedObject(Common::Point target) {
+ ensureAssetLoaded(_draggedObj.id);
+ _draggedObj.pos = target + _draggedObj.mouseOffset;
+
+ // TODO FInd more elegant way of making pow2
+ _draggedObj.hasMoved = (_draggedObj.startPos.sqrDist(_draggedObj.pos) >= (kDragThreshold * kDragThreshold));
+
+ debugC(4, kMVDebugGUI, "Dragged obj position: (%d, %d), mouse offset: (%d, %d), hasMoved: %d, dist: %d, threshold: %d",
+ _draggedObj.pos.x, _draggedObj.pos.y,
+ _draggedObj.mouseOffset.x, _draggedObj.mouseOffset.y,
+ _draggedObj.hasMoved,
+ _draggedObj.startPos.sqrDist(_draggedObj.pos),
+ kDragThreshold * kDragThreshold
+ );
+
+}
+
+WindowReference Gui::findWindowAtPoint(Common::Point point) {
+ Common::List<WindowData>::iterator it;
+ Graphics::MacWindow *win;
+ for (it = _windowData->begin(); it != _windowData->end(); it++) {
+ win = findWindow(it->refcon);
+ if (win && it->refcon != kDiplomaWindow) { //HACK, diploma should be cosnidered
+ if (win->getDimensions().contains(point)) {
+ return it->refcon;
+ }
+ }
+ }
+ return kNoWindow;
+}
+
+Common::Point Gui::getGlobalScrolledSurfacePosition(WindowReference reference) {
+ const WindowData &data = getWindowData(reference);
+ BorderBounds border = borderBounds(data.type);
+ Graphics::MacWindow *win = findWindow(reference);
+ if (!win) {
+ return Common::Point(0, 0);
+ }
+ return Common::Point(
+ win->getDimensions().left + border.leftOffset - data.scrollPos.x,
+ win->getDimensions().top + border.topOffset - data.scrollPos.y);
+}
+
+WindowData &Gui::findWindowData(WindowReference reference) {
+ assert(_windowData);
+
+ Common::List<WindowData>::iterator iter = _windowData->begin();
+ while (iter->refcon != reference && iter != _windowData->end()) {
+ iter++;
+ }
+
+ if (iter->refcon == reference)
+ return *iter;
+
+ error("GUI: Could not locate the desired window data");
+}
+
+Graphics::MacWindow *Gui::findWindow(WindowReference reference) {
+ if (reference < 0x80 && reference >= kInventoryStart) { // It's an inventory window
+ return _inventoryWindows[reference - kInventoryStart];
+ }
+ switch (reference) {
+ case MacVenture::kNoWindow:
+ return NULL;
+ case MacVenture::kCommandsWindow:
+ return _controlsWindow;
+ case MacVenture::kMainGameWindow:
+ return _mainGameWindow;
+ case MacVenture::kOutConsoleWindow:
+ return _outConsoleWindow;
+ case MacVenture::kSelfWindow:
+ return _selfWindow;
+ case MacVenture::kExitsWindow:
+ return _exitsWindow;
+ case MacVenture::kDiplomaWindow:
+ return _diplomaWindow;
+ default:
+ return NULL;
+ }
+ return NULL;
+}
+
+void Gui::ensureInventoryOpen(WindowReference reference, ObjID id) {
+ assert(reference < 0x80 && reference >= kInventoryStart);
+ if (reference - kInventoryStart == (int)_inventoryWindows.size()) {
+ createInventoryWindow(id);
+ }
+}
+
+WindowReference Gui::getObjWindow(ObjID objID) {
+ switch (objID) {
+ case 0xfffc: return kExitsWindow;
+ case 0xfffd: return kSelfWindow;
+ case 0xfffe: return kOutConsoleWindow;
+ case 0xffff: return kCommandsWindow;
+ }
+
+ return findObjWindow(objID);
+}
+
+WindowReference Gui::findObjWindow(ObjID objID) {
+ // This is a bit of a HACK, we take advantage of the consecutive nature of references
+ for (uint i = kCommandsWindow; i <= kDiplomaWindow; i++) {
+ const WindowData &data = getWindowData((WindowReference)i);
+ if (data.objRef == objID) {
+ return data.refcon;
+ }
+ }
+
+ for (uint i = kInventoryStart; i < _inventoryWindows.size() + kInventoryStart; i++) {
+ const WindowData &data = getWindowData((WindowReference)i);
+ if (data.objRef == objID) {
+ return data.refcon;
+ }
+ }
+
+ return kNoWindow;
+}
+
+void Gui::checkSelect(const WindowData &data, Common::Point pos, const Common::Rect &clickRect, WindowReference ref) {
+ ObjID child = 0;
+ for (Common::Array<DrawableObject>::const_iterator it = data.children.begin(); it != data.children.end(); it++) {
+ if (canBeSelected((*it).obj, clickRect, ref)) {
+ child = (*it).obj;
+ }
+ }
+ if (child != 0) {
+ selectDraggable(child, ref, pos);
+ bringToFront(ref);
+ }
+}
+
+bool Gui::canBeSelected(ObjID obj, const Common::Rect &clickRect, WindowReference ref) {
+ return (_engine->isObjClickable(obj) &&
+ isRectInsideObject(clickRect, obj));
+}
+
+bool Gui::isRectInsideObject(Common::Rect target, ObjID obj) {
+ ensureAssetLoaded(obj);
+ Common::Rect bounds = _engine->getObjBounds(obj);
+ Common::Rect intersection = bounds.findIntersectingRect(target);
+ // We translate it to the image's coord system
+ intersection = Common::Rect(
+ intersection.left - bounds.left,
+ intersection.top - bounds.top,
+ intersection.left - bounds.left + intersection.width(),
+ intersection.top - bounds.top + intersection.height());
+
+ return _assets[obj]->isRectInside(intersection);
+}
+
+void Gui::selectDraggable(ObjID child, WindowReference origin, Common::Point click) {
+ if (_engine->isObjClickable(child) && _draggedObj.id == 0) {
+ _draggedObj.hasMoved = false;
+ _draggedObj.id = child;
+ _draggedObj.startWin = origin;
+ Common::Point localizedClick = click - getGlobalScrolledSurfacePosition(origin);
+ _draggedObj.mouseOffset = _engine->getObjPosition(child) - localizedClick;
+ _draggedObj.pos = click + _draggedObj.mouseOffset;
+ _draggedObj.startPos = _draggedObj.pos;
+ }
+}
+
+void Gui::handleDragRelease(bool shiftPressed, bool isDoubleClick) {
+ if (_draggedObj.id != 0) {
+ WindowReference destinationWindow = findWindowAtPoint(_draggedObj.pos);
+ if (destinationWindow == kNoWindow) {
+ return;
+ }
+ if (_draggedObj.hasMoved) {
+ const WindowData &destinationWindowData = getWindowData(destinationWindow);
+ ObjID destObject = destinationWindowData.objRef;
+ Common::Point dropPosition = _draggedObj.pos - _draggedObj.startPos;
+ dropPosition = localizeTravelledDistance(dropPosition, _draggedObj.startWin, destinationWindow);
+ debugC(3, kMVDebugGUI, "Drop the object %d at obj %d, pos (%d, %d)", _draggedObj.id, destObject, dropPosition.x, dropPosition.y);
+
+ _engine->handleObjectDrop(_draggedObj.id, dropPosition, destObject);
+ }
+ _engine->handleObjectSelect(_draggedObj.id, destinationWindow, shiftPressed, isDoubleClick);
+ _draggedObj.id = 0;
+ _draggedObj.hasMoved = false;
+ }
+}
+
+Common::Rect Gui::calculateClickRect(Common::Point clickPos, Common::Rect windowBounds) {
+ int left = clickPos.x - windowBounds.left;
+ int top = clickPos.y - windowBounds.top;
+ return Common::Rect(left - kCursorWidth, top - kCursorHeight, left + kCursorWidth, top + kCursorHeight);
+}
+
+Common::Point Gui::localizeTravelledDistance(Common::Point point, WindowReference origin, WindowReference target) {
+ if (origin != target) {
+ // ori.local to global
+ point += getGlobalScrolledSurfacePosition(origin);
+ if (findWindow(target)) {
+ // dest.globalToLocal
+ point -= getGlobalScrolledSurfacePosition(target);
+ }
+ }
+ return point;
+}
+
+void Gui::removeInventoryWindow(WindowReference ref) {
+ _inventoryWindows.remove_at(ref - kInventoryStart);
+ bool found = false;
+ Common::List<WindowData>::iterator it;
+ for (it = _windowData->begin(); it != _windowData->end() && !found; it++) {
+ if (it->refcon == ref) {
+ _windowData->erase(it);
+ found = true;
+ }
+ }
+}
+
+
+/* HANDLERS */
+void Gui::handleMenuAction(MenuAction action) {
+ switch (action) {
+ case MacVenture::kMenuActionAbout:
+ warning("Unimplemented MacVenture Menu Action: About");
+ break;
+ case MacVenture::kMenuActionNew:
+ _engine->newGame();
+ break;
+ case MacVenture::kMenuActionOpen:
+ loadGame();
+ break;
+ case MacVenture::kMenuActionSave:
+ saveGame();
+ break;
+ case MacVenture::kMenuActionSaveAs:
+ saveGame();
+ break;
+ case MacVenture::kMenuActionQuit:
+ _engine->requestQuit();
+ break;
+ case MacVenture::kMenuActionUndo:
+ warning("Unimplemented MacVenture Menu Action: Undo");
+ break;
+ case MacVenture::kMenuActionCut:
+ warning("Unimplemented MacVenture Menu Action: Cut");
+ break;
+ case MacVenture::kMenuActionCopy:
+ warning("Unimplemented MacVenture Menu Action: Copy");
+ break;
+ case MacVenture::kMenuActionPaste:
+ warning("Unimplemented MacVenture Menu Action: Paste");
+ break;
+ case MacVenture::kMenuActionClear:
+ warning("Unimplemented MacVenture Menu Action: Clear");
+ break;
+ case MacVenture::kMenuActionCleanUp:
+ warning("Unimplemented MacVenture Menu Action: Clean Up");
+ break;
+ case MacVenture::kMenuActionMessUp:
+ warning("Unimplemented MacVenture Menu Action: Mess Up");
+ break;
+ case MacVenture::kMenuActionCommand:
+ warning("Unimplemented MacVenture Menu Action: GENERIC");
+ break;
+ default:
+ break;
+ }
+}
+
+/* CALLBACKS */
+
+bool commandsWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+ return g->processCommandEvents(click, event);
+}
+
+bool mainGameWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+ return g->processMainGameEvents(click, event);
+}
+
+bool outConsoleWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+ return g->processOutConsoleEvents(click, event);
+}
+
+bool selfWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+
+ return g->processSelfEvents(click, event);
+}
+
+bool exitsWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+
+ return g->processExitsEvents(click, event);
+}
+
+bool diplomaWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+
+ return g->processDiplomaEvents(click, event);
+}
+
+bool inventoryWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui) {
+ Gui *g = (Gui*)gui;
+
+ return g->processInventoryEvents(click, event);
+}
+
+void menuCommandsCallback(int action, Common::String &text, void *data) {
+ Gui *g = (Gui *)data;
+
+ g->handleMenuAction((MenuAction)action);
+}
+
+
+void Gui::invertWindowColors(WindowReference winID) {
+ Graphics::ManagedSurface *srf = findWindow(winID)->getSurface();
+ for (uint y = 0; y < srf->h; y++) {
+ for (uint x = 0; x < srf->w; x++) {
+ byte p = *(byte *)srf->getBasePtr(x, y);
+ *(byte *)srf->getBasePtr(x, y) =
+ (p == kColorWhite) ? kColorBlack : kColorGray;
+ }
+ }
+}
+
+bool Gui::tryCloseWindow(WindowReference winID) {
+ WindowData data = findWindowData(winID);
+ Graphics::MacWindow *win = findWindow(winID);
+ _wm.removeWindow(win);
+ if (winID < 0x80) {
+ removeInventoryWindow(winID);
+ }
+ return true;
+}
+
+Common::Point Gui::getObjMeasures(ObjID obj) {
+ ensureAssetLoaded(obj);
+ int w = _assets[obj]->getWidth();
+ int h = _assets[obj]->getHeight();
+ return Common::Point(w, h);
+}
+
+bool Gui::processEvent(Common::Event &event) {
+ bool processed = false;
+
+ processed |= _cursor->processEvent(event);
+
+ if (_dialog && _dialog->processEvent(event)) {
+ return true;
+ }
+
+ if (event.type == Common::EVENT_MOUSEMOVE) {
+ if (_draggedObj.id != 0) {
+ moveDraggedObject(event.mouse);
+ }
+ processed = true;
+ }
+
+ processed |= _wm.processEvent(event);
+ return (processed);
+}
+
+bool Gui::processCommandEvents(WindowClick click, Common::Event &event) {
+ if (event.type == Common::EVENT_LBUTTONUP) {
+ if (_engine->needsClickToContinue()) {
+ _engine->selectControl(kClickToContinue);
+ return true;
+ }
+
+ Common::Point position(
+ event.mouse.x - _controlsWindow->getDimensions().left,
+ event.mouse.y - _controlsWindow->getDimensions().top);
+
+ CommandButton data;
+ if (!_controlData)
+ return false;
+
+ Common::Array<CommandButton>::iterator it = _controlData->begin();
+ for (; it != _controlData->end(); ++it) {
+ if (it->isInsideBounds(position)) {
+ it->select();
+ data = *it;
+ } else {
+ it->unselect();
+ }
+ }
+
+ _engine->selectControl(data.getData().refcon);
+ _engine->refreshReady();
+ _engine->preparedToRun();
+ }
+ return false;
+}
+
+bool MacVenture::Gui::processMainGameEvents(WindowClick click, Common::Event &event) {
+ if (_engine->needsClickToContinue())
+ return true;
+
+ return false;
+}
+
+bool MacVenture::Gui::processOutConsoleEvents(WindowClick click, Common::Event &event) {
+ if (_engine->needsClickToContinue())
+ return true;
+
+ if (click == kBorderScrollUp && event.type == Common::EVENT_LBUTTONDOWN) {
+ _consoleText->scrollUp();
+ return true;
+ }
+ if (click == kBorderScrollDown && event.type == Common::EVENT_LBUTTONDOWN) {
+ _consoleText->scrollDown();
+ return true;
+ }
+
+ return getWindowData(kOutConsoleWindow).visible;
+}
+
+bool MacVenture::Gui::processSelfEvents(WindowClick click, Common::Event &event) {
+ if (_engine->needsClickToContinue())
+ return true;
+
+ if (event.type == Common::EVENT_LBUTTONUP) {
+ _engine->handleObjectSelect(1, kSelfWindow, false, false);
+ }
+ return true;
+}
+
+bool MacVenture::Gui::processExitsEvents(WindowClick click, Common::Event &event) {
+ if (event.type == Common::EVENT_LBUTTONUP) {
+ if (_engine->needsClickToContinue()) {
+ return true;
+ }
+
+ Common::Point position(
+ event.mouse.x - _exitsWindow->getDimensions().left,
+ event.mouse.y - _exitsWindow->getDimensions().top);
+
+ CommandButton button;
+ if (!_exitsData)
+ return false;
+
+ Common::Array<CommandButton>::iterator it = _exitsData->begin();
+ for (; it != _exitsData->end(); ++it) {
+ if (it->isInsideBounds(position)) {
+ it->select();
+ button = *it;
+ _engine->handleObjectSelect(button.getData().refcon, kExitsWindow, false, false);
+ return true;
+ } else {
+ it->unselect();
+ }
+ }
+
+ }
+ return getWindowData(kExitsWindow).visible;
+}
+
+bool MacVenture::Gui::processDiplomaEvents(WindowClick click, Common::Event &event) {
+ if (_engine->needsClickToContinue())
+ return true;
+
+ return getWindowData(kDiplomaWindow).visible;
+}
+
+bool Gui::processInventoryEvents(WindowClick click, Common::Event &event) {
+ if (event.type == Common::EVENT_LBUTTONDOWN && click == kBorderCloseButton) {
+ WindowReference ref = findWindowAtPoint(event.mouse);
+ if (ref == kNoWindow) {
+ return false;
+ }
+
+ if (click == kBorderCloseButton) {
+ removeInventoryWindow(ref);
+ return true;
+ }
+ }
+
+ if (_engine->needsClickToContinue())
+ return true;
+
+ if (event.type == Common::EVENT_LBUTTONDOWN) {
+ // Find the appropriate window
+ WindowReference ref = findWindowAtPoint(event.mouse);
+ if (ref == kNoWindow) {
+ return false;
+ }
+
+ WindowData &data = findWindowData((WindowReference) ref);
+
+ if (click == kBorderScrollUp) {
+ data.scrollPos.y = MAX(0, data.scrollPos.y - kScrollAmount);
+ }
+ if (click == kBorderScrollDown) {
+ data.scrollPos.y += kScrollAmount;
+ }
+ if (click == kBorderScrollLeft) {
+ data.scrollPos.x = MAX(0, data.scrollPos.x - kScrollAmount);
+ }
+ if (click == kBorderScrollRight) {
+ data.scrollPos.x += kScrollAmount;
+ }
+ }
+ return true;
+}
+
+void Gui::selectForDrag(Common::Point cursorPosition) {
+ WindowReference ref = findWindowAtPoint(cursorPosition);
+ if (ref == kNoWindow) {
+ return;
+ }
+
+ Graphics::MacWindow *win = findWindow(ref);
+ WindowData &data = findWindowData((WindowReference) ref);
+
+ Common::Rect clickRect = calculateClickRect(cursorPosition + data.scrollPos, win->getDimensions());
+ checkSelect(data, cursorPosition, clickRect, (WindowReference)ref);
+}
+
+void Gui::handleSingleClick() {
+ debugC(2, kMVDebugGUI, "Registered Single Click");
+ // HACK THERE HAS TO BE A MORE ELEGANT WAY
+ if (_dialog) {
+ return;
+ }
+ handleDragRelease(false, false);
+}
+
+void Gui::handleDoubleClick() {
+ debugC(2, kMVDebugGUI, "Registered Double Click");
+ if (_dialog) {
+ return;
+ }
+ handleDragRelease(false, true);
+}
+
+void Gui::ensureAssetLoaded(ObjID obj) {
+ if (!_assets.contains(obj)) {
+ _assets[obj] = new ImageAsset(obj, _graphics);
+ }
+}
+
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h
new file mode 100644
index 0000000000..b57e00fa1b
--- /dev/null
+++ b/engines/macventure/gui.h
@@ -0,0 +1,377 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_GUI_H
+#define MACVENTURE_GUI_H
+
+#include "graphics/macgui/macwindowmanager.h"
+#include "graphics/macgui/macwindow.h"
+#include "graphics/macgui/macmenu.h"
+
+#include "graphics/font.h"
+
+#include "common/timer.h"
+
+#include "macventure/macventure.h"
+#include "macventure/container.h"
+#include "macventure/image.h"
+#include "macventure/prebuilt_dialogs.h"
+#include "macventure/dialog.h"
+#include "macventure/controls.h"
+#include "macventure/windows.h"
+
+namespace MacVenture {
+
+using namespace Graphics::MacGUIConstants;
+using namespace Graphics::MacWindowConstants;
+class MacVentureEngine;
+typedef uint32 ObjID;
+
+class Cursor;
+class ConsoleText;
+class CommandButton;
+class ImageAsset;
+class Dialog;
+
+BorderBounds borderBounds(MVWindowType type);
+
+enum MenuAction {
+ kMenuActionAbout,
+ kMenuActionNew,
+ kMenuActionOpen,
+ kMenuActionSave,
+ kMenuActionSaveAs,
+ kMenuActionQuit,
+ kMenuActionUndo,
+ kMenuActionCut,
+ kMenuActionCopy,
+ kMenuActionPaste,
+ kMenuActionClear,
+ kMenuActionCleanUp,
+ kMenuActionMessUp,
+
+ kMenuActionCommand
+};
+
+struct DraggedObj {
+ ObjID id;
+ Common::Point pos;
+ Common::Point mouseOffset;
+ Common::Point startPos;
+ WindowReference startWin;
+ bool hasMoved;
+};
+
+class Gui {
+
+public:
+ Gui(MacVentureEngine *engine, Common::MacResManager *resman);
+ ~Gui();
+
+ void reloadInternals();
+
+ void draw();
+ void drawMenu();
+ void drawTitle();
+
+ void clearControls();
+ bool processEvent(Common::Event &event);
+ void handleMenuAction(MenuAction action);
+ void updateWindow(WindowReference winID, bool containerOpen);
+ void invertWindowColors(WindowReference winID);
+
+ WindowReference createInventoryWindow(ObjID objRef);
+ bool tryCloseWindow(WindowReference winID);
+
+ Common::Point getObjMeasures(ObjID obj);
+
+ WindowReference getObjWindow(ObjID objID);
+ WindowReference findObjWindow(ObjID objID);
+
+ // Event processors
+ bool processCommandEvents(WindowClick click, Common::Event &event);
+ bool processMainGameEvents(WindowClick click, Common::Event &event);
+ bool processOutConsoleEvents(WindowClick click, Common::Event &event);
+ bool processSelfEvents(WindowClick click, Common::Event &event);
+ bool processExitsEvents(WindowClick click, Common::Event &event);
+ bool processDiplomaEvents(WindowClick click, Common::Event &event);
+ bool processInventoryEvents(WindowClick click, Common::Event &event);
+
+ const WindowData& getWindowData(WindowReference reference);
+
+ const Graphics::Font& getCurrentFont();
+
+ // Clicks
+ void selectForDrag(Common::Point cursorPosition);
+ void handleSingleClick();
+ void handleDoubleClick();
+
+ // Modifiers
+ void bringToFront(WindowReference window);
+ void setWindowTitle(WindowReference winID, Common::String string);
+ void updateWindowInfo(WindowReference ref, ObjID objID, const Common::Array<ObjID> &children);
+ void ensureInventoryOpen(WindowReference reference, ObjID id);
+
+ void addChild(WindowReference target, ObjID child);
+ void removeChild(WindowReference target, ObjID child);
+
+ void clearExits();
+ void unselectExits();
+ void updateExit(ObjID id);
+
+ void printText(const Common::String &text);
+
+ //Dialog interactions
+ void showPrebuiltDialog(PrebuiltDialogs type);
+ bool isDialogOpen();
+
+ void getTextFromUser();
+ void setTextInput(Common::String str);
+ void closeDialog();
+
+ void loadGame();
+ void saveGame();
+ void newGame();
+ void quitGame();
+
+ void createInnerSurface(Graphics::ManagedSurface *innerSurface, Graphics::ManagedSurface *outerSurface, const BorderBounds &borders);
+
+
+private: // Attributes
+
+ MacVentureEngine *_engine;
+ Common::MacResManager *_resourceManager;
+
+ Graphics::ManagedSurface _screen;
+ Graphics::MacWindowManager _wm;
+
+ Common::List<WindowData> *_windowData;
+ Common::Array<CommandButton> *_controlData;
+ Common::Array<CommandButton> *_exitsData;
+
+ Graphics::MacWindow *_controlsWindow;
+ Graphics::MacWindow *_mainGameWindow;
+ Graphics::MacWindow *_outConsoleWindow;
+ Graphics::MacWindow *_selfWindow;
+ Graphics::MacWindow *_exitsWindow;
+ Graphics::MacWindow *_diplomaWindow;
+ Common::Array<Graphics::MacWindow*> _inventoryWindows;
+ Graphics::Menu *_menu;
+ Dialog *_dialog;
+
+ Container *_graphics;
+ Common::HashMap<ObjID, ImageAsset*> _assets;
+
+ Graphics::ManagedSurface _draggedSurface;
+ DraggedObj _draggedObj;
+
+ Cursor *_cursor;
+
+ ConsoleText *_consoleText;
+
+private: // Methods
+
+ // Initializers
+ void initGUI();
+ void initWindows();
+ void assignObjReferences(); // Mainly guesswork
+
+ // Loaders
+ bool loadMenus();
+ bool loadWindows();
+ bool loadControls();
+ void loadBorders(Graphics::MacWindow *target, MVWindowType type);
+ void loadBorder(Graphics::MacWindow *target, MVWindowType type, bool active);
+ void loadGraphics();
+ void clearAssets();
+
+ // Drawers
+ void drawWindows();
+ void drawCommandsWindow();
+ void drawMainGameWindow();
+ void drawSelfWindow();
+ void drawInventories();
+ void drawExitsWindow();
+ void drawConsoleWindow();
+
+ void drawDraggedObject();
+ void drawObjectsInWindow(const WindowData &targetData, Graphics::ManagedSurface *surface);
+ void drawWindowTitle(WindowReference target, Graphics::ManagedSurface *surface);
+ void drawDialog();
+
+ void moveDraggedObject(Common::Point target);
+
+ // Finders
+ WindowReference findWindowAtPoint(Common::Point point);
+ Common::Point getGlobalScrolledSurfacePosition(WindowReference reference);
+ WindowData& findWindowData(WindowReference reference);
+ Graphics::MacWindow *findWindow(WindowReference reference);
+
+ // Utils
+ void checkSelect(const WindowData &data, Common::Point pos, const Common::Rect &clickRect, WindowReference ref);
+ bool canBeSelected(ObjID obj, const Common::Rect &clickRect, WindowReference ref);
+ bool isRectInsideObject(Common::Rect target, ObjID obj);
+ void selectDraggable(ObjID child, WindowReference origin, Common::Point startPos);
+ void handleDragRelease(bool shiftPressed, bool isDoubleClick);
+ Common::Rect calculateClickRect(Common::Point clickPos, Common::Rect windowBounds);
+ Common::Point localizeTravelledDistance(Common::Point point, WindowReference origin, WindowReference target);
+ void removeInventoryWindow(WindowReference ref);
+
+ void ensureAssetLoaded(ObjID obj);
+
+};
+
+enum ClickState {
+ kCursorIdle = 0,
+ kCursorSCStart = 1,
+ kCursorSCDrag = 2,
+ kCursorDCStart = 3,
+ kCursorDCDo = 4,
+ kCursorSCSink = 5,
+ kCursorStateCount
+};
+
+enum CursorInput { // Columns for the FSM transition table
+ kButtonDownCol = 0,
+ kButtonUpCol = 1,
+ kTickCol = 2,
+ kCursorInputCount
+};
+
+class Cursor {
+
+public:
+ Cursor(Gui *gui);
+ ~Cursor();
+
+ void tick();
+ bool processEvent(const Common::Event &event);
+ Common::Point getPos();
+ bool canSelectDraggable();
+
+private:
+
+ void changeState(CursorInput input);
+ void executeStateIn();
+ void executeStateOut();
+
+
+private:
+ Gui *_gui;
+
+ Common::Point _pos;
+ ClickState _state;
+};
+
+
+
+enum {
+ kConsoleLeftOffset = 2
+};
+
+class ConsoleText {
+
+public:
+
+ ConsoleText(Gui *gui) {
+ _gui = gui;
+ _lines.push_back("");
+ updateScroll();
+ }
+
+ ~ConsoleText() {
+
+ }
+
+ void printLine(const Common::String &str, int maxW) {
+ Common::StringArray wrappedLines;
+ int textW = maxW;
+ const Graphics::Font *font = &_gui->getCurrentFont();
+
+ font->wordWrapText(str, textW, wrappedLines);
+
+ if (wrappedLines.empty()) // Sometimes we have empty lines
+ _lines.push_back("");
+
+ for (Common::StringArray::const_iterator j = wrappedLines.begin(); j != wrappedLines.end(); ++j) {
+ _lines.push_back(*j);
+ }
+
+ updateScroll();
+ }
+
+ void renderInto(Graphics::ManagedSurface *target, const BorderBounds borders, int textOffset) {
+ target->fillRect(target->getBounds(), kColorWhite);
+
+ Graphics::ManagedSurface *composeSurface = new Graphics::ManagedSurface();
+ _gui->createInnerSurface(composeSurface, target, borders);
+ composeSurface->clear(kColorGreen);
+
+ const Graphics::Font *font = &_gui->getCurrentFont();
+ uint y = target->h - font->getFontHeight();
+ for (uint i = _scrollPos; i != 0; i--) {
+ font->drawString(target, _lines[i], textOffset, y, font->getStringWidth(_lines[i]), kColorBlack);
+ y -= font->getFontHeight();
+ }
+
+ Common::Point composePosition = Common::Point(borders.leftOffset, borders.topOffset);
+ target->transBlitFrom(*composeSurface, composePosition, kColorGreen);
+ delete composeSurface;
+ }
+
+ void updateScroll() {
+ _scrollPos = _lines.size() - 1;
+ }
+
+ void scrollDown() {
+ if (_scrollPos < (int)(_lines.size() - 1)) {
+ _scrollPos++;
+ }
+ }
+
+ void scrollUp() {
+ if (_scrollPos > 0) {
+ _scrollPos--;
+ }
+ }
+
+
+private:
+
+ Gui *_gui;
+
+ Common::StringArray _lines;
+ int _scrollPos;
+
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/hufflists.h b/engines/macventure/hufflists.h
new file mode 100644
index 0000000000..d7346d6719
--- /dev/null
+++ b/engines/macventure/hufflists.h
@@ -0,0 +1,65 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_HUFFLIST_H
+#define MACVENTURE_HUFFLIST_H
+
+namespace MacVenture {
+
+// The engine uses a <= comparison instead of ==, so I can't use Common::Huffman
+class HuffmanLists {
+public:
+ HuffmanLists() {
+ _numEntries = 0;
+ }
+ HuffmanLists(uint32 num, uint32 *lens, uint32 *masks, uint32 *symbols) {
+ _numEntries = num;
+ _lens = Common::Array<uint32>(lens, num);
+ _masks = Common::Array<uint32>(masks, num);
+ _symbols = Common::Array<uint32>(symbols, num);
+ }
+ ~HuffmanLists() {}
+
+
+ uint32 getNumEntries() const { return _numEntries; }
+ uint32 getLength(uint32 index) const { return _lens[index]; }
+ uint32 getMask(uint32 index) const { return _masks[index]; }
+ uint32 getSymbol(uint32 index) const { return _symbols[index]; }
+
+private:
+ uint32 _numEntries;
+ Common::Array<uint32> _lens;
+ Common::Array<uint32> _masks;
+ Common::Array<uint32> _symbols;
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/image.cpp b/engines/macventure/image.cpp
new file mode 100644
index 0000000000..7fccaa81b4
--- /dev/null
+++ b/engines/macventure/image.cpp
@@ -0,0 +1,561 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/image.h"
+
+namespace MacVenture {
+
+static const PPICHuff PPIC1Huff = {
+ // Masks
+ { 0x0000,0x2000,0x4000,0x5000,0x6000,0x7000,0x8000,0x9000,0xa000,
+ 0xb000,0xc000,0xd000,0xd800,0xe000,0xe800,0xf000,0xf800 },
+ // Lens
+ { 3,3,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5 },
+ // Symbols
+ { 0x00,0x0f,0x03,0x05,0x06,0x07,0x08,0x09,0x0a,0x0c,0xff,0x01,
+ 0x02,0x04,0x0b,0x0d,0xe }
+};
+
+static const PPICHuff PPIC2Huff = {
+ // Masks
+ { 0x0000,0x4000,0x8000,0xc000,0xc800,0xd000,0xd800,0xe000,0xe800,
+ 0xf000,0xf400,0xf600,0xf800,0xfa00,0xfc00,0xfe00,0xff00 },
+ // Lens
+ { 2,2,2,5,5,5,5,5,5,6,7,7,7,7,7,8,8 },
+ // Symbols
+ { 0xff,0x00,0x0f,0x01,0x03,0x07,0x0e,0x0c,0x08,0x06,0x02,0x04,
+ 0x09,0x0d,0x0b,0x0a,0x05 }
+};
+
+// Used to load the huffman table in PPIC3 decoding
+static const byte loadBits[] = {
+ 0x08, 0x0f, 0x02, 0xff, 0x00,
+ 0x04, 0xff, 0x01,
+ 0x07, 0x09, 0x08, 0xff, 0x03,
+ 0x04, 0xff, 0x04,
+ 0x0a, 0x07, 0x0a, 0x0b, 0x06, 0xff, 0x05,
+ 0x06, 0x06, 0x0b, 0xff, 0x07,
+ 0x03, 0xff, 0x09,
+ 0x04, 0x03, 0x0e, 0xff, 0x0c,
+ 0x02, 0xff, 0x0d,
+ 0x01, 0xff, 0x0f,
+ 0xff
+};
+
+ImageAsset::ImageAsset(ObjID original, Container *container) {
+ _id = (original * 2);
+ _mask = (original * 2) + 1;
+
+ uint imgRowBytes = 0;
+ uint imgBitWidth = 0;
+ uint imgBitHeight = 0;
+ uint maskRowBytes = 0;
+ uint maskBitWidth = 0;
+ uint maskBitHeight = 0;
+
+ _container = container;
+ decodePPIC(_id, _imgData, imgBitHeight, imgBitWidth, imgRowBytes);
+ _imgRowBytes = imgRowBytes;
+ _imgBitWidth = imgBitWidth;
+ _imgBitHeight = imgBitHeight;
+
+ if (_container->getItemByteSize(_mask)) {
+ decodePPIC(_mask, _maskData, maskBitHeight, maskBitWidth, maskRowBytes);
+ }
+ _maskRowBytes = maskRowBytes;
+ _maskBitWidth = maskBitWidth;
+ _maskBitHeight = maskBitHeight;
+}
+
+ImageAsset::~ImageAsset() {
+ debugC(3, kMVDebugImage, "~ImageAsset(%d)", _id / 2);
+}
+
+void ImageAsset::decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight, uint &bitWidth, uint &rowBytes) {
+ ObjID realID = id;
+ uint32 size = _container->getItemByteSize(id);
+ if (size < 2) {
+ rowBytes = 0;
+ bitHeight = 0;
+ bitWidth = 0;
+ return;
+ }
+ if (size == 2) {
+ Common::SeekableReadStream *newItemStream = _container->getItem(id);
+ realID = newItemStream->readUint16BE();
+ delete newItemStream;
+ }
+ Common::SeekableReadStream *baseStream = _container->getItem(realID);
+ Common::BitStream32BEMSB stream(baseStream);
+
+ uint8 mode = stream.getBits(3);
+ int w, h;
+ if (stream.getBit()) {
+ h = stream.getBits(10);
+ } else {
+ h = stream.getBits(6);
+ }
+
+ if (stream.getBit()) {
+ w = stream.getBits(10);
+ } else {
+ w = stream.getBits(6);
+ }
+
+ rowBytes = ((w + 0xF) >> 3) & 0xFFFE;
+ bitWidth = w;
+ bitHeight = h;
+
+ for (uint i = 0; i < rowBytes * h; i++) {
+ data.push_back(0);
+ }
+
+ switch (mode) {
+ case MacVenture::kPPIC0:
+ decodePPIC0(stream, data, bitHeight, bitWidth, rowBytes);
+ break;
+ case MacVenture::kPPIC1:
+ decodePPIC1(stream, data, bitHeight, bitWidth, rowBytes);
+ break;
+ case MacVenture::kPPIC2:
+ decodePPIC2(stream, data, bitHeight, bitWidth, rowBytes);
+ break;
+ case MacVenture::kPPIC3:
+ decodePPIC3(stream, data, bitHeight, bitWidth, rowBytes);
+ break;
+ }
+
+ delete baseStream;
+}
+
+void ImageAsset::decodePPIC0(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ uint words = bitWidth >> 4;
+ uint bytes = bitWidth & 0xF;
+ uint v = 0;
+ uint p = 0;
+ for (uint y = 0; y < bitHeight; y++) {
+ for (uint x = 0; x < words; x++) {
+ v = stream.peekBits(32);
+ stream.skip(16);
+ v >>= 16 - (stream.pos() % 8);
+ data[p] = (v >> 8) & 0xff; p++;
+ data[p] = v & 0xff; p++;
+ }
+ if (bytes) {
+ v = stream.getBits(bytes);
+ v <<= 16 - bytes;
+ data[p] = (v >> 8) & 0xff; p++;
+ data[p] = v & 0xff; p++;
+ }
+ }
+
+}
+
+void ImageAsset::decodePPIC1(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ decodeHuffGraphic(PPIC1Huff, stream, data, bitHeight, bitWidth, rowBytes);
+}
+
+void ImageAsset::decodePPIC2(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ decodeHuffGraphic(PPIC2Huff, stream, data, bitHeight, bitWidth, rowBytes);
+}
+
+void ImageAsset::decodePPIC3(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ // We need to load the huffman from the PPIC itself
+ PPICHuff huff;
+ uint16 v, bits;
+ uint16 load = 0;
+ while ((bits = loadBits[load++]) != 0xFF) {
+ v = stream.getBits(bits);
+ while ((bits = loadBits[load++]) != 0xFF) {
+ huff.symbols[loadBits[load++]] = v % bits;
+ v = (bits != 0) ? (v / bits) : 0;
+ }
+ huff.symbols[loadBits[load++]] = v;
+ }
+ huff.symbols[0x10] = 0;
+ for (uint i = 0x10; i > 0; i--) {
+ for (uint j = i; j <= 0x10; j++) {
+ if (huff.symbols[j] >= huff.symbols[i - 1]) {
+ huff.symbols[j]++;
+ }
+ }
+ }
+
+ for (int i = 0x10; i >= 0; i--) {
+ if (huff.symbols[i] == 0x10) {
+ huff.symbols[i] = 0xff;
+ break;
+ }
+ }
+
+ bits = stream.getBits(2) + 1;
+ uint16 mask = 0;
+ for (uint i = 0; i < 0xf; i++) {
+ if (i) {
+ while (!stream.getBit()) {
+ bits++;
+ }
+ }
+ huff.lens[i] = bits;
+ huff.masks[i] = mask;
+ mask += 1 << (16 - bits);
+ }
+ huff.masks[0xf] = mask;
+ while (mask&(1 << (16 - bits))) {
+ bits++;
+ }
+ huff.masks[0x10] = mask | (1 << (16 - bits));
+ huff.lens[0xf] = bits;
+ huff.lens[0x10] = bits;
+
+ decodeHuffGraphic(huff, stream, data, bitHeight, bitWidth, rowBytes);
+}
+
+void ImageAsset::decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ byte flags = 0;
+ _walkRepeat = 0;
+ _walkLast = 0;
+ if (bitWidth & 3) {
+ flags = stream.getBits(5);
+ } else {
+ flags = stream.getBits(4) << 1;
+ }
+
+ byte odd = 0;
+ byte blank = bitWidth & 0xf;
+ if (blank) {
+ blank >>= 2;
+ odd = blank & 1;
+ blank = 2 - (blank >> 1);
+ }
+
+ uint16 pos = 0;
+ for (uint y = 0; y < bitHeight; y++) {
+ uint16 x = 0;
+ for (; x < bitWidth >> 3; x++) {
+ byte hi = walkHuff(huff, stream) << 4;
+ data[pos++] = walkHuff(huff, stream) | hi;
+ }
+ if (odd) {
+ data[pos] = walkHuff(huff, stream) << 4;
+ }
+ pos += blank;
+ }
+
+ uint16 edge = bitWidth & 3;
+ if (edge) {
+ pos = rowBytes - blank;
+ uint16 bits = 0;
+ uint16 val = 0;
+ uint16 v;
+ for (uint y = 0; y < bitHeight; y++) {
+ if (flags & 1) {
+ if (bits < edge) {
+ v = walkHuff(huff, stream) << 4;
+ val |= v >> bits;
+ bits += 4;
+ }
+ bits -= edge;
+ v = val;
+ val <<= edge;
+ val &= 0xFF;
+ } else {
+ v = stream.getBits(edge);
+ v <<= 8 - edge;
+ }
+ if (odd)
+ v >>= 4;
+
+ data[pos] |= v & 0xff;
+ pos += rowBytes;
+ }
+ }
+ if (flags & 8) {
+ pos = 0;
+ for (uint y = 0; y < bitHeight; y++) {
+ uint16 v = 0;
+ if (flags & 2) {
+ for (uint x = 0; x < rowBytes; x++) {
+ data[pos] ^= v;
+ v = data[pos];
+ pos++;
+ }
+ } else {
+ for (uint x = 0; x < rowBytes; x++) {
+ uint16 val = data[pos] ^ v;
+ val ^= (val >> 4) & 0xf;
+ data[pos] = val;
+ pos++;
+ v = (val << 4) & 0xff;
+ }
+ }
+ }
+ }
+ if (flags & 4) {
+ uint16 delta = rowBytes * 4;
+ if (flags & 2) {
+ delta *= 2;
+ }
+ pos = 0;
+ uint q = delta;
+ for (uint i = 0; i < bitHeight * rowBytes - delta; i++) {
+ data[q] ^= data[pos];
+ q++;
+ pos++;
+ }
+ }
+}
+
+byte ImageAsset::walkHuff(const PPICHuff &huff, Common::BitStream &stream) {
+ if (_walkRepeat) {
+ _walkRepeat--;
+ _walkLast = ((_walkLast << 8) & 0xFF00) | (_walkLast >> 8);
+ return _walkLast & 0xFF;
+ }
+ uint16 dw = stream.peekBits(16);
+ uint16 i = 0;
+ for (;i < 16; i++) {
+ if (huff.masks[i + 1] > dw) {
+ break;
+ }
+ }
+ stream.skip(huff.lens[i]);
+ uint8 val = huff.symbols[i];
+ if (val == 0xFF) {
+ if (!stream.getBit()) {
+ _walkLast &= 0xFF;
+ _walkLast |= _walkLast << 8;
+ }
+ _walkRepeat = stream.getBits(3);
+ if (_walkRepeat < 3) {
+ _walkRepeat <<= 4;
+ _walkRepeat |= stream.getBits(4);
+ if (_walkRepeat < 8) {
+ _walkRepeat <<= 8;
+ _walkRepeat |= stream.getBits(8);
+ }
+ }
+ _walkRepeat -= 2;
+ _walkLast = ((_walkLast << 8) & 0xFF00) | (_walkLast >> 8);
+ return _walkLast & 0xFF;
+ } else {
+ _walkLast <<= 8;
+ _walkLast |= val;
+ _walkLast &= 0xFFFF;
+ }
+ return val;
+}
+
+void ImageAsset::blitInto(Graphics::ManagedSurface *target, int x, int y, BlitMode mode) {
+ if (mode == kBlitDirect) {
+ blitDirect(target, x, y, _imgData, _imgBitHeight, _imgBitWidth, _imgRowBytes);
+ } else if (mode < kBlitXOR) {
+ if (_container->getItemByteSize(_mask)) { // Has mask
+ switch (mode) {
+ case MacVenture::kBlitBIC:
+ blitBIC(target, x, y, _maskData, _maskBitHeight, _maskBitWidth, _maskRowBytes);
+ break;
+ case MacVenture::kBlitOR:
+ blitOR(target, x, y, _maskData, _maskBitHeight, _maskBitWidth, _maskRowBytes);
+ break;
+ default:
+ break;
+ }
+ } else if (_container->getItemByteSize(_id)) {
+ switch (mode) {
+ case MacVenture::kBlitBIC:
+ target->fillRect(Common::Rect(x, y, x + _imgBitWidth, y + _imgBitHeight), kColorWhite);
+ break;
+ case MacVenture::kBlitOR:
+ target->fillRect(Common::Rect(x, y, x + _imgBitWidth, y + _imgBitHeight), kColorBlack);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (_container->getItemByteSize(_id) && mode > 0) {
+ blitXOR(target, x, y, _imgData, _imgBitHeight, _imgBitWidth, _imgRowBytes);
+ }
+ }
+}
+
+bool ImageAsset::isPointInside(Common::Point point) {
+ if (point.x >= _maskBitWidth || point.y >= _maskBitHeight) {
+ return false;
+ }
+ if (_maskData.empty()) {
+ return false;
+ }
+ // We see if the point lands on the mask.
+ uint pix = _maskData[(point.y * _maskRowBytes) + (point.x >> 3)] & (1 << (7 - (point.x & 7)));
+ return pix != 0;
+}
+
+bool ImageAsset::isRectInside(Common::Rect rect) {
+ if (_maskData.empty()) {
+ return (rect.width() > 0 && rect.height() > 0);
+ }
+
+ for (int y = rect.top; y < rect.top + rect.height(); y++) {
+ uint bmpofs = y * _maskRowBytes;
+ byte pix;
+ for (int x = rect.left; x < rect.left + rect.width(); x++) {
+ pix = _maskData[bmpofs + (x >> 3)] & (1 << (7 - (x & 7)));
+ if (pix) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+int ImageAsset::getWidth() {
+ if (_imgData.size() == 0) {
+ return 0;
+ }
+ return MAX(0, (int)_imgBitWidth);
+}
+
+int ImageAsset::getHeight() {
+ if (_imgData.size() == 0) {
+ return 0;
+ }
+ return MAX(0, (int)_imgBitHeight);
+}
+
+void ImageAsset::blitDirect(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ uint sx, sy, w, h;
+ calculateSectionToDraw(target, ox, oy, bitWidth, bitHeight, sx, sy, w, h);
+
+ for (uint y = 0; y < h; y++) {
+ uint bmpofs = (y + sy) * rowBytes;
+ byte pix = 0;
+ for (uint x = 0; x < w; x++) {
+ assert(ox + x <= target->w);
+ assert(oy + y <= target->h);
+ pix = data[bmpofs + ((x + sx) >> 3)] & (1 << (7 - ((x + sx) & 7)));
+ pix = pix ? kColorBlack : kColorWhite;
+ *((byte *)target->getBasePtr(ox + x, oy + y)) = pix;
+ }
+ }
+}
+
+void ImageAsset::blitBIC(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ uint sx, sy, w, h;
+ calculateSectionToDraw(target, ox, oy, bitWidth, bitHeight, sx, sy, w, h);
+
+ for (uint y = 0; y < h; y++) {
+ uint bmpofs = (y + sy) * rowBytes;
+ byte pix = 0;
+ for (uint x = 0; x < w; x++) {
+ assert(ox + x <= target->w);
+ assert(oy + y <= target->h);
+ pix = data[bmpofs + ((x + sx) >> 3)] & (1 << (7 - ((x + sx) & 7)));
+ if (pix) {
+ *((byte *)target->getBasePtr(ox + x, oy + y)) = kColorWhite;
+ }
+ }
+ }
+}
+
+void ImageAsset::blitOR(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ uint sx, sy, w, h;
+ calculateSectionToDraw(target, ox, oy, bitWidth, bitHeight, sx, sy, w, h);
+
+ for (uint y = 0; y < h; y++) {
+ uint bmpofs = (y + sy) * rowBytes;
+ byte pix = 0;
+ for (uint x = 0; x < w; x++) {
+ assert(ox + x <= target->w);
+ assert(oy + y <= target->h);
+ pix = data[bmpofs + ((x + sx) >> 3)] & (1 << (7 - ((x + sx) & 7)));
+ if (pix) {
+ *((byte *)target->getBasePtr(ox + x, oy + y)) = kColorBlack;
+ }
+ }
+ }
+}
+
+void ImageAsset::blitXOR(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes) {
+ uint sx, sy, w, h;
+ calculateSectionToDraw(target, ox, oy, bitWidth, bitHeight, sx, sy, w, h);
+
+ for (uint y = 0; y < h; y++) {
+ uint bmpofs = (y + sy) * rowBytes;
+ byte pix = 0;
+ for (uint x = 0; x < w; x++) {
+ pix = data[bmpofs + ((x + sx) >> 3)] & (1 << (7 - ((x + sx) & 7)));
+ if (pix) { // We need to xor
+ assert(ox + x <= target->w);
+ assert(oy + y <= target->h);
+ byte p = *((byte *)target->getBasePtr(ox + x, oy + y));
+ *((byte *)target->getBasePtr(ox + x, oy + y)) =
+ (p == kColorWhite) ? kColorBlack : kColorWhite;
+ }
+ }
+ }
+}
+
+void ImageAsset::calculateSectionToDraw(Graphics::ManagedSurface *target, int &ox, int &oy, uint bitWidth, uint bitHeight, uint &sx, uint &sy, uint &w, uint &h) {
+
+ calculateSectionInDirection(target->w, bitWidth, ox, sx, w);
+ calculateSectionInDirection(target->h, bitHeight, oy, sy, h);
+
+ assert(w <= target->w);
+ assert((int)w >= 0);
+ assert(w <= bitWidth);
+ assert(h <= target->h);
+ assert((int)h >= 0);
+ assert(h <= bitHeight);
+}
+
+void ImageAsset::calculateSectionInDirection(uint targetWhole, uint originWhole, int &originPosition, uint &startPosition, uint &blittedWhole) {
+ startPosition = 0;
+ blittedWhole = originWhole;
+ if (originPosition < 0) {
+ if (ABS(originPosition) > (int)blittedWhole) {
+ blittedWhole = 0;
+ } else {
+ blittedWhole -= -originPosition;
+ }
+ startPosition = -originPosition;
+ originPosition = 0;
+ }
+ if (originPosition + blittedWhole > targetWhole) {
+ if (originPosition > (int)targetWhole) {
+ blittedWhole = 0;
+ } else {
+ blittedWhole = targetWhole - originPosition;
+ }
+ }
+}
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/image.h b/engines/macventure/image.h
new file mode 100644
index 0000000000..87c5cec2db
--- /dev/null
+++ b/engines/macventure/image.h
@@ -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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_IMAGE_H
+#define MACVENTURE_IMAGE_H
+
+#include "macventure/macventure.h"
+#include "macventure/container.h"
+
+namespace MacVenture {
+
+typedef uint32 ObjID;
+class Container;
+
+
+enum BlitMode {
+ kBlitDirect = 0,
+ kBlitBIC = 1,
+ kBlitOR = 2,
+ kBlitXOR = 3
+};
+
+enum GraphicsEncoding {
+ kPPIC0 = 0,
+ kPPIC1 = 1,
+ kPPIC2 = 2,
+ kPPIC3 = 3
+};
+
+struct PPICHuff {
+ uint16 masks[17];
+ uint16 lens[17];
+ uint8 symbols[17];
+};
+
+class ImageAsset {
+public:
+ ImageAsset(ObjID original, Container *container);
+ ~ImageAsset();
+
+ void blitInto(Graphics::ManagedSurface *target, int x, int y, BlitMode mode);
+
+ bool isPointInside(Common::Point point);
+ bool isRectInside(Common::Rect rect);
+
+ int getWidth();
+ int getHeight();
+
+private:
+ void decodePPIC(ObjID id, Common::Array<byte> &data, uint &bitHeight, uint &bitWidth, uint &rowBytes);
+
+ void decodePPIC0(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ void decodePPIC1(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ void decodePPIC2(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ void decodePPIC3(Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+
+ void decodeHuffGraphic(const PPICHuff &huff, Common::BitStream &stream, Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ byte walkHuff(const PPICHuff &huff, Common::BitStream &stream);
+
+ void blitDirect(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ void blitBIC(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ void blitOR(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+ void blitXOR(Graphics::ManagedSurface *target, int ox, int oy, const Common::Array<byte> &data, uint bitHeight, uint bitWidth, uint rowBytes);
+
+ void calculateSectionToDraw(Graphics::ManagedSurface *target, int &ox, int &oy, uint bitWidth, uint bitHeight, uint &sx, uint &sy, uint &w, uint &h);
+ void calculateSectionInDirection(uint targetWhole, uint originWhole, int &originPosition, uint &startPosition, uint &blittedWhole);
+
+private:
+ ObjID _id;
+ ObjID _mask;
+ Container *_container;
+
+ uint16 _walkRepeat;
+ uint16 _walkLast;
+
+ Common::Array<byte> _imgData;
+ uint16 _imgRowBytes;
+ uint16 _imgBitWidth;
+ uint16 _imgBitHeight;
+
+ Common::Array<byte> _maskData;
+ uint16 _maskRowBytes;
+ uint16 _maskBitWidth;
+ uint16 _maskBitHeight;
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/macventure.cpp b/engines/macventure/macventure.cpp
new file mode 100644
index 0000000000..483281f583
--- /dev/null
+++ b/engines/macventure/macventure.cpp
@@ -0,0 +1,1193 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "common/system.h"
+#include "common/debug-channels.h"
+#include "common/debug.h"
+#include "common/error.h"
+#include "common/config-manager.h"
+#include "engines/util.h"
+
+#include "macventure/macventure.h"
+
+// To move
+#include "common/file.h"
+
+namespace MacVenture {
+
+// HACK, see below
+void toASCII(Common::String &str) {
+ debugC(3, kMVDebugMain, "toASCII: %s", str.c_str());
+ Common::String::iterator it = str.begin();
+ for (; it != str.end(); it++) {
+ if (*it == '\216') {
+ str.replace(it, it + 1, "e");
+ }
+ if (*it == '\210') {
+ str.replace(it, it + 1, "a");
+ }
+ }
+}
+
+enum {
+ kMaxMenuTitleLength = 30
+};
+
+MacVentureEngine::MacVentureEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst) {
+ _gameDescription = gameDesc;
+ _rnd = new Common::RandomSource("macventure");
+
+ initDebugChannels();
+
+ _debugger = NULL;
+ _resourceManager = NULL;
+ _globalSettings = NULL;
+ _gui = NULL;
+ _world = NULL;
+ _scriptEngine = NULL;
+ _filenames = NULL;
+
+ _decodingDirectArticles = NULL;
+ _decodingNamingArticles = NULL;
+ _decodingIndirectArticles = NULL;
+ _textHuffman = NULL;
+
+ _soundManager = NULL;
+
+ _dataBundle = NULL;
+
+ debug("MacVenture::MacVentureEngine()");
+}
+
+MacVentureEngine::~MacVentureEngine() {
+ debug("MacVenture::~MacVentureEngine()");
+
+ DebugMan.clearAllDebugChannels();
+
+ if (_rnd)
+ delete _rnd;
+
+ if (_debugger)
+ delete _debugger;
+
+ if (_resourceManager)
+ delete _resourceManager;
+
+ if (_globalSettings)
+ delete _globalSettings;
+
+ if (_gui)
+ delete _gui;
+
+ if (_world)
+ delete _world;
+
+ if (_scriptEngine)
+ delete _scriptEngine;
+
+ if (_filenames)
+ delete _filenames;
+
+ if (_decodingDirectArticles)
+ delete _decodingDirectArticles;
+
+ if (_decodingNamingArticles)
+ delete _decodingNamingArticles;
+
+ if (_decodingIndirectArticles)
+ delete _decodingIndirectArticles;
+
+ if (_textHuffman)
+ delete _textHuffman;
+
+ if (_soundManager)
+ delete _soundManager;
+
+ if (_dataBundle)
+ delete _dataBundle;
+}
+
+void MacVentureEngine::initDebugChannels() {
+ DebugMan.addDebugChannel(kMVDebugMain, "main", "Engine state");
+ DebugMan.addDebugChannel(kMVDebugGUI, "gui", "Gui");
+ DebugMan.addDebugChannel(kMVDebugText, "text", "Text decoders and printers");
+ DebugMan.addDebugChannel(kMVDebugImage, "image", "Image decoders and renderers");
+ DebugMan.addDebugChannel(kMVDebugScript, "script", "Script engine");
+ DebugMan.addDebugChannel(kMVDebugSound, "sound", "Sound decoders");
+ DebugMan.addDebugChannel(kMVDebugContainer, "container", "Containers");
+}
+
+Common::Error MacVentureEngine::run() {
+ debug("MacVenture::MacVentureEngine::init()");
+ initGraphics(kScreenWidth, kScreenHeight, true);
+
+ _debugger = new Console(this);
+
+ // Additional setup.
+ debug("MacVentureEngine::init");
+
+ _resourceManager = new Common::MacResManager();
+ if (!_resourceManager->open(getGameFileName()))
+ error("ENGINE: Could not open %s as a resource fork", getGameFileName());
+
+ // Engine-wide loading
+ if (!loadGlobalSettings())
+ error("ENGINE: Could not load the engine settings");
+
+ _oldTextEncoding = !loadTextHuffman();
+
+ _filenames = new StringTable(this, _resourceManager, kFilenamesStringTableID);
+ _decodingDirectArticles = new StringTable(this, _resourceManager, kCommonArticlesStringTableID);
+ _decodingNamingArticles = new StringTable(this, _resourceManager, kNamingArticlesStringTableID);
+ _decodingIndirectArticles = new StringTable(this, _resourceManager, kIndirectArticlesStringTableID);
+
+ loadDataBundle();
+
+ // Big class instantiation
+ _gui = new Gui(this, _resourceManager);
+ _world = new World(this, _resourceManager);
+ _scriptEngine = new ScriptEngine(this, _world);
+
+ _soundManager = new SoundManager(this, _mixer);
+
+ setInitialFlags();
+
+ int directSaveSlotLoading = ConfMan.getInt("save_slot");
+ if (directSaveSlotLoading >= 0) {
+ if (loadGameState(directSaveSlotLoading).getCode() != Common::kNoError) {
+ error("ENGINE: Could not load game from slot '%d'", directSaveSlotLoading);
+ }
+ } else {
+ setNewGameState();
+ }
+ selectControl(kStartOrResume);
+
+ _gui->addChild(kSelfWindow, 1);
+ _gui->updateWindow(kSelfWindow, false);
+
+ while (_gameState != kGameStateQuitting) {
+ processEvents();
+
+ if (_gameState != kGameStateQuitting && !_gui->isDialogOpen()) {
+
+ if (_prepared) {
+ _prepared = false;
+
+ if (!_halted)
+ updateState(false);
+
+ if (_cmdReady || _halted) {
+ _halted = false;
+ if (runScriptEngine()) {
+ _halted = true;
+ _paused = true;
+ } else {
+ _paused = false;
+ updateState(true);
+ updateControls();
+ updateExits();
+ }
+ }
+
+ if (_gameState == kGameStateWinnig || _gameState == kGameStateLosing) {
+ endGame();
+ }
+ }
+ }
+ refreshScreen();
+ }
+
+ return Common::kNoError;
+}
+
+void MacVentureEngine::refreshScreen() {
+ _gui->draw();
+ g_system->updateScreen();
+ g_system->delayMillis(50);
+}
+
+void MacVentureEngine::newGame() {
+ _world->startNewGame();
+ reset();
+ setInitialFlags();
+ setNewGameState();
+}
+
+void MacVentureEngine::setInitialFlags() {
+ _paused = false;
+ _halted = false;
+ _cmdReady = false;
+ _haltedAtEnd = false;
+ _haltedInSelection = false;
+ _clickToContinue = true;
+ _gameState = kGameStateInit;
+ _destObject = 0;
+ _prepared = true;
+}
+
+void MacVentureEngine::setNewGameState() {
+ _cmdReady = true;
+ ObjID playerParent = _world->getObjAttr(1, kAttrParentObject);
+ _currentSelection.push_back(playerParent);// Push the parent of the player
+ _world->setObjAttr(playerParent, kAttrContainerOpen, 1);
+}
+
+void MacVentureEngine::reset() {
+ resetInternals();
+ resetGui();
+}
+
+void MacVentureEngine::resetInternals() {
+ _scriptEngine->reset();
+ _currentSelection.clear();
+ _objQueue.clear();
+ _textQueue.clear();
+}
+
+void MacVentureEngine::resetGui() {
+ _gui->reloadInternals();
+ _gui->updateWindowInfo(kMainGameWindow, getParent(1), _world->getChildren(getParent(1), true));
+ // HACK! should update all inventories
+ _gui->ensureInventoryOpen(kInventoryStart, 1);
+ _gui->updateWindowInfo(kInventoryStart, 1, _world->getChildren(1, true));
+ updateControls();
+ updateExits();
+ refreshScreen();
+}
+
+void MacVentureEngine::requestQuit() {
+ // TODO: Display save game dialog and such
+ _gameState = kGameStateQuitting;
+}
+
+void MacVentureEngine::requestUnpause() {
+ _paused = false;
+ _gameState = kGameStatePlaying;
+}
+
+void MacVentureEngine::selectControl(ControlAction id) {
+ debugC(2, kMVDebugMain, "Select control %x", id);
+ if (id == kClickToContinue) {
+ _clickToContinue = false;
+ _paused = true;
+ return;
+ }
+
+ _selectedControl = id;
+ refreshReady();
+}
+
+void MacVentureEngine::refreshReady() {
+ switch (getInvolvedObjects()) {
+ case 0: // No selected object
+ _cmdReady = true;
+ break;
+ case 1: // We have some selected object
+ _cmdReady = _currentSelection.size() != 0;
+ break;
+ case 2:
+ if (_destObject > 0) // We have a destination seleted
+ _cmdReady = true;
+ break;
+ }
+}
+
+void MacVentureEngine::preparedToRun() {
+ _prepared = true;
+}
+
+void MacVentureEngine::gameChanged() {
+ _gameChanged = true;
+}
+
+void MacVentureEngine::winGame() {
+ _gui->showPrebuiltDialog(kWinGameDialog);
+ _gameState = kGameStateWinnig;
+}
+
+void MacVentureEngine::loseGame() {
+ _gui->showPrebuiltDialog(kLoseGameDialog);
+ _paused = true;
+ //_gameState = kGameStateLosing;
+}
+
+void MacVentureEngine::clickToContinue() {
+ _clickToContinue = true;
+}
+
+void MacVentureEngine::enqueueObject(ObjectQueueID type, ObjID objID, ObjID target) {
+ QueuedObject obj;
+ obj.id = type;
+
+ if (type == kUpdateObject && isObjEnqueued(objID)) {
+ return;
+ }
+
+ if (type == kUpdateWindow) {
+ obj.target = target;
+ }
+
+ if (type != kHightlightExits) {
+ obj.object = objID;
+ obj.parent = _world->getObjAttr(objID, kAttrParentObject);
+ obj.x = _world->getObjAttr(objID, kAttrPosX);
+ obj.y = _world->getObjAttr(objID, kAttrPosY);
+ obj.exitx = _world->getObjAttr(objID, kAttrExitX);
+ obj.exity = _world->getObjAttr(objID, kAttrExitY);
+ obj.hidden = _world->getObjAttr(objID, kAttrHiddenExit);
+ obj.offscreen = _world->getObjAttr(objID, kAttrInvisible);
+ obj.invisible = _world->getObjAttr(objID, kAttrUnclickable);
+ }
+ _objQueue.push_back(obj);
+}
+
+void MacVentureEngine::enqueueText(TextQueueID type, ObjID target, ObjID source, ObjID text) {
+ QueuedText newText;
+ newText.id = type;
+ newText.destination = target;
+ newText.source = source;
+ newText.asset = text;
+ _textQueue.push_back(newText);
+}
+
+void MacVentureEngine::enqueueSound(SoundQueueID type, ObjID target) {
+ QueuedSound newSound;
+ newSound.id = type;
+ newSound.reference = target;
+ _soundQueue.push_back(newSound);
+}
+
+void MacVentureEngine::handleObjectSelect(ObjID objID, WindowReference win, bool shiftPressed, bool isDoubleClick) {
+ if (win == kExitsWindow) {
+ win = kMainGameWindow;
+ }
+
+ const WindowData &windata = _gui->getWindowData(win);
+
+ if (shiftPressed) {
+ // TODO: Implement shift functionality.
+ } else {
+ if (_selectedControl && _currentSelection.size() > 0 && getInvolvedObjects() > 1) {
+ if (objID == 0) {
+ selectPrimaryObject(windata.objRef);
+ } else {
+ selectPrimaryObject(objID);
+ }
+ preparedToRun();
+ } else {
+ if (objID == 0) {
+ unselectAll();
+ objID = win;
+ }
+ if (objID > 0) {
+ int currentObjectIndex = findObjectInArray(objID, _currentSelection);
+
+ if (currentObjectIndex >= 0)
+ unselectAll();
+
+ if (isDoubleClick) {
+ selectObject(objID);
+ _destObject = objID;
+ setDeltaPoint(Common::Point(0, 0));
+ if (!_cmdReady) {
+ selectControl(kActivateObject);
+ _cmdReady = true;
+ }
+ } else {
+ selectObject(objID);
+ if (getInvolvedObjects() == 1)
+ _cmdReady = true;
+ }
+ preparedToRun();
+ }
+ }
+ }
+}
+
+void MacVentureEngine::handleObjectDrop(ObjID objID, Common::Point delta, ObjID newParent) {
+ _destObject = newParent;
+ setDeltaPoint(delta);
+ selectControl(kMoveObject);
+ refreshReady();
+ preparedToRun();
+}
+
+void MacVentureEngine::setDeltaPoint(Common::Point newPos) {
+ debugC(4, kMVDebugMain, "Update delta: Old(%d, %d), New(%d, %d)",
+ _deltaPoint.x, _deltaPoint.y,
+ newPos.x, newPos.y);
+ _deltaPoint = newPos;
+}
+
+void MacVentureEngine::focusObjWin(ObjID objID) {
+ _gui->bringToFront(getObjWindow(objID));
+}
+
+void MacVentureEngine::updateWindow(WindowReference winID) {
+ _gui->updateWindow(winID, true);
+}
+
+bool MacVentureEngine::showTextEntry(ObjID text, ObjID srcObj, ObjID destObj) {
+ debugC(3, kMVDebugMain, "Showing speech dialog, asset %d from %d to %d", text, srcObj, destObj);
+ _gui->getTextFromUser();
+
+ _prepared = false;
+ warning("Show text entry: not fully tested");
+ return true;
+}
+
+void MacVentureEngine::setTextInput(Common::String content) {
+ _prepared = true;
+ _userInput = content;
+ _clickToContinue = false;
+}
+
+Common::String MacVentureEngine::getUserInput() {
+ return _userInput;
+}
+
+
+Common::String MacVentureEngine::getStartGameFileName() {
+ Common::SeekableReadStream *res;
+ res = _resourceManager->getResource(MKTAG('S', 'T', 'R', ' '), kStartGameFilenameID);
+ if (!res)
+ return "";
+
+ byte length = res->readByte();
+ char *fileName = new char[length + 1];
+ res->read(fileName, length);
+ fileName[length] = '\0';
+ Common::String result = Common::String(fileName, length);
+ // HACK, see definition of toASCII
+ toASCII(result);
+
+ delete[] fileName;
+ delete res;
+
+ return result;
+}
+
+const GlobalSettings& MacVentureEngine::getGlobalSettings() const {
+ return *_globalSettings;
+}
+
+// Private engine methods
+void MacVentureEngine::processEvents() {
+ Common::Event event;
+
+ while (_eventMan->pollEvent(event)) {
+ if (_gui->processEvent(event))
+ continue;
+
+ switch (event.type) {
+ case Common::EVENT_QUIT:
+ _gameState = kGameStateQuitting;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+bool MacVenture::MacVentureEngine::runScriptEngine() {
+ debugC(3, kMVDebugMain, "Running script engine");
+ if (_haltedAtEnd) {
+ _haltedAtEnd = false;
+ if (_scriptEngine->resume(false)) {
+ _haltedAtEnd = true;
+ return true;
+ }
+ return false;
+ }
+
+ if (_haltedInSelection) {
+ _haltedInSelection = false;
+ if (_scriptEngine->resume(false)) {
+ _haltedInSelection = true;
+ return true;
+ }
+ updateState(true);
+ }
+
+ while (!_currentSelection.empty()) {
+ ObjID obj = _currentSelection.front();
+ _currentSelection.remove_at(0);
+ if (isGameRunning() && _world->isObjActive(obj)) {
+ if (_scriptEngine->runControl(_selectedControl, obj, _destObject, _deltaPoint)) {
+ _haltedInSelection = true;
+ return true;
+ }
+ updateState(true);
+ }
+ }
+ if (_selectedControl == 1) {
+ _gameChanged = false;
+ } else if (isGameRunning()) {
+ if (_scriptEngine->runControl(kTick, _selectedControl, _destObject, _deltaPoint)) {
+ _haltedAtEnd = true;
+ return true;
+ }
+ }
+ return false;
+}
+
+void MacVentureEngine::endGame() {
+ requestQuit();
+}
+
+void MacVentureEngine::updateState(bool pause) {
+ _prepared = false;
+ runObjQueue();
+ printTexts();
+ playSounds(pause);
+}
+
+void MacVentureEngine::revert() {
+ _gui->invertWindowColors(kMainGameWindow);
+ preparedToRun();
+}
+
+void MacVentureEngine::runObjQueue() {
+ while (!_objQueue.empty()) {
+ uint32 biggest = 0;
+ uint32 index = 0;
+ uint32 temp;
+ for (uint i = 0; i < _objQueue.size(); i++) {
+ temp = _objQueue[i].id;
+ if (temp > biggest) {
+ biggest = temp;
+ index = i;
+ }
+ }
+ QueuedObject obj = _objQueue[index];
+ _objQueue.remove_at(index);
+ switch (obj.id) {
+ case 0x2:
+ focusObjectWindow(obj.object);
+ break;
+ case 0x3:
+ openObject(obj.object);
+ break;
+ case 0x4:
+ closeObject(obj.object);
+ break;
+ case 0x7:
+ checkObject(obj);
+ break;
+ case 0x8:
+ reflectSwap(obj.object, obj.target);
+ break;
+ case 0xc:
+ _world->setObjAttr(_gui->getWindowData(kMainGameWindow).refcon, kAttrContainerOpen, 0);
+ _world->setObjAttr(_world->getObjAttr(1, kAttrParentObject), kAttrContainerOpen, 1);
+ break;
+ case 0xd:
+ toggleExits();
+ break;
+ case 0xe:
+ zoomObject(obj.object);
+ break;
+ }
+ }
+}
+
+void MacVentureEngine::printTexts() {
+ for (uint i = 0; i < _textQueue.size(); i++) {
+ QueuedText text = _textQueue.front();
+ _textQueue.remove_at(0);
+ switch (text.id) {
+ case kTextNumber:
+ _gui->printText(Common::String(text.asset));
+ gameChanged();
+ break;
+ case kTextNewLine:
+ _gui->printText(Common::String(""));
+ gameChanged();
+ break;
+ case kTextPlain:
+ _gui->printText(_world->getText(text.asset, text.source, text.destination));
+ gameChanged();
+ break;
+ }
+ }
+}
+
+void MacVentureEngine::playSounds(bool pause) {
+ int delay = 0;
+ while (!_soundQueue.empty()) {
+ QueuedSound item = _soundQueue.front();
+ _soundQueue.remove_at(0);
+ switch (item.id) {
+ case kSoundPlay:
+ _soundManager->playSound(item.reference);
+ break;
+ case kSoundPlayAndWait:
+ delay = _soundManager->playSound(item.reference);
+ break;
+ case kSoundWait:
+ // Empty in the original.
+ break;
+ }
+ }
+ if (pause && delay > 0) {
+ warning("Sound pausing not yet tested. Pausing for %d", delay);
+ g_system->delayMillis(delay);
+ preparedToRun();
+ }
+}
+
+void MacVentureEngine::updateControls() {
+ selectControl(kNoCommand);
+ _gui->clearControls();
+ toggleExits();
+ resetVars();
+}
+
+void MacVentureEngine::resetVars() {
+ selectControl(kNoCommand);
+ _currentSelection.clear();
+ _destObject = 0;
+ setDeltaPoint(Common::Point(0, 0));
+ _cmdReady = false;
+}
+
+void MacVentureEngine::unselectAll() {
+ while (!_currentSelection.empty()) {
+ unselectObject(_currentSelection.front());
+ }
+}
+
+void MacVentureEngine::selectObject(ObjID objID) {
+ if (!_currentSelection.empty()) {
+ if (findParentWindow(objID) != findParentWindow(_currentSelection[0])) {
+ // TODO: Needs further testing, but it doesn't seem necessary.
+ //unselectAll();
+ }
+ }
+ if (findObjectInArray(objID, _currentSelection) == -1) {
+ _currentSelection.push_back(objID);
+ highlightExit(objID);
+ }
+}
+
+void MacVentureEngine::unselectObject(ObjID objID) {
+ int idxCur = findObjectInArray(objID, _currentSelection);
+ if (idxCur != -1) {
+ _currentSelection.remove_at(idxCur);
+ highlightExit(objID);
+ }
+}
+
+
+void MacVentureEngine::updateExits() {
+ _gui->clearExits();
+ _gui->unselectExits();
+
+ Common::Array<ObjID> exits = _world->getChildren(_world->getObjAttr(1, kAttrParentObject), true);
+ for (uint i = 0; i < exits.size(); i++)
+ _gui->updateExit(exits[i]);
+
+}
+
+int MacVentureEngine::findObjectInArray(ObjID objID, const Common::Array<ObjID> &list) {
+ // Find the object in the current selection
+ bool found = false;
+ uint i = 0;
+ while (i < list.size() && !found) {
+ if (list[i] == objID) {
+ found = true;
+ } else {
+ i++;
+ }
+ }
+ // HACK, should use iterator
+ return found ? i : -1;
+}
+
+uint MacVentureEngine::getPrefixNdx(ObjID obj) {
+ return _world->getObjAttr(obj, kAttrPrefixes);
+}
+
+Common::String MacVentureEngine::getPrefixString(uint flag, ObjID obj) {
+ uint ndx = getPrefixNdx(obj);
+ ndx = ((ndx) >> flag) & 3;
+ return _decodingNamingArticles->getString(ndx);
+}
+
+Common::String MacVentureEngine::getNoun(ObjID ndx) {
+ return _decodingIndirectArticles->getString(ndx);
+}
+
+void MacVentureEngine::highlightExit(ObjID objID) {
+ // TODO: It seems unnecessary since the GUI checks whether an object
+ // is selected, which includes exits.
+ warning("STUB: highlightExit");
+}
+
+void MacVentureEngine::selectPrimaryObject(ObjID objID) {
+ if (objID == _destObject) {
+ return;
+ }
+ int idx;
+ debugC(4, kMVDebugMain, "Select primary object (%d)", objID);
+ if (_destObject > 0 &&
+ (idx = findObjectInArray(_destObject, _currentSelection)) != -1) {
+ unselectAll();
+ }
+ _destObject = objID;
+ if (findObjectInArray(_destObject, _currentSelection) == -1) {
+ selectObject(_destObject);
+ }
+
+ _cmdReady = true;
+}
+
+void MacVentureEngine::focusObjectWindow(ObjID objID) {
+ if (objID) {
+ WindowReference win = getObjWindow(objID);
+ if (win)
+ _gui->bringToFront(win);
+ }
+}
+
+void MacVentureEngine::openObject(ObjID objID) {
+ debugC(3, kMVDebugMain, "Open Object[%d] parent[%d] x[%d] y[%d]",
+ objID,
+ _world->getObjAttr(objID, kAttrParentObject),
+ _world->getObjAttr(objID, kAttrPosX),
+ _world->getObjAttr(objID, kAttrPosY));
+
+ if (getObjWindow(objID)) {
+ return;
+ }
+ if (objID == _world->getObjAttr(1, kAttrParentObject)) {
+ _gui->updateWindowInfo(kMainGameWindow, objID, _world->getChildren(objID, true));
+ _gui->updateWindow(kMainGameWindow, _world->getObjAttr(objID, kAttrContainerOpen));
+ updateExits();
+ _gui->setWindowTitle(kMainGameWindow, _world->getText(objID, objID, objID)); // it ignores source and target in the original
+ } else { // Open inventory window
+ Common::Point p(_world->getObjAttr(objID, kAttrPosX), _world->getObjAttr(objID, kAttrPosY));
+ WindowReference invID = _gui->createInventoryWindow(objID);
+ _gui->setWindowTitle(invID, _world->getText(objID, objID, objID));
+ _gui->updateWindowInfo(invID, objID, _world->getChildren(objID, true));
+ _gui->updateWindow(invID, _world->getObjAttr(objID, kAttrContainerOpen));
+ }
+}
+
+void MacVentureEngine::closeObject(ObjID objID) {
+ warning("closeObject: not fully implemented");
+ _gui->tryCloseWindow(getObjWindow(objID));
+ return;
+}
+
+void MacVentureEngine::checkObject(QueuedObject old) {
+ bool hasChanged = false;
+ debugC(3, kMVDebugMain, "Check Object[%d] parent[%d] x[%d] y[%d]",
+ old.object,
+ old.parent,
+ old.x,
+ old.y);
+ ObjID id = old.object;
+ if (id == 1) {
+ if (old.parent != _world->getObjAttr(id, kAttrParentObject)) {
+ enqueueObject(kSetToPlayerParent, id);
+ }
+ if (old.offscreen != _world->getObjAttr(id, kAttrInvisible) ||
+ old.invisible != _world->getObjAttr(id, kAttrUnclickable)) {
+ updateWindow(findParentWindow(id));
+ }
+ } else if (old.parent != _world->getObjAttr(id, kAttrParentObject) ||
+ old.x != _world->getObjAttr(id, kAttrPosX) ||
+ old.y != _world->getObjAttr(id, kAttrPosY)) {
+ WindowReference oldWin = getObjWindow(old.parent);
+ if (oldWin) {
+ _gui->removeChild(oldWin, id);
+ hasChanged = true;
+ }
+
+ WindowReference newWin = findParentWindow(id);
+ if (newWin) {
+ _gui->addChild(newWin, id);
+ hasChanged = true;
+ }
+ } else if (old.offscreen != _world->getObjAttr(id, kAttrInvisible) ||
+ old.invisible != _world->getObjAttr(id, kAttrUnclickable)) {
+ updateWindow(findParentWindow(id));
+ }
+
+ if (_world->getObjAttr(id, kAttrIsExit)) {
+ if (hasChanged ||
+ old.hidden != _world->getObjAttr(id, kAttrHiddenExit) ||
+ old.exitx != _world->getObjAttr(id, kAttrExitX) ||
+ old.exity != _world->getObjAttr(id, kAttrExitY))
+ _gui->updateExit(id);
+ }
+ WindowReference win = getObjWindow(id);
+ ObjID cur = id;
+ ObjID root = _world->getObjAttr(1, kAttrParentObject);
+ while (cur != root) {
+ if (cur == 0 || !_world->getObjAttr(cur, kAttrContainerOpen)) {
+ break;
+ }
+ cur = _world->getObjAttr(cur, kAttrParentObject);
+ }
+ if (cur == root) {
+ if (win) {
+ return;
+ }
+ enqueueObject(kOpenWindow, id); //open
+ } else {
+ if (!win) {
+ return;
+ }
+ enqueueObject(kCloseWindow, id); //close
+ }
+
+ // Update children
+ Common::Array<ObjID> children = _world->getChildren(id, true);
+ for (uint i = 0; i < children.size(); i++) {
+ enqueueObject(kUpdateObject, children[i]);
+ }
+}
+
+void MacVentureEngine::reflectSwap(ObjID fromID, ObjID toID) {
+ WindowReference from = getObjWindow(fromID);
+ WindowReference to = getObjWindow(toID);
+ WindowReference tmp = to;
+ debugC(3, kMVDebugMain, "Swap Object[%d] to Object[%d], from win[%d] to win[%d] ",
+ fromID, toID, from, to);
+
+ if (!to) {
+ tmp = from;
+ }
+ if (tmp) {
+ Common::String newTitle = _world->getText(toID, 0, 0); // Ignores src and targ in the original
+ _gui->setWindowTitle(tmp, newTitle);
+ _gui->updateWindowInfo(tmp, toID, _world->getChildren(toID, true));
+ updateWindow(tmp);
+ }
+}
+
+void MacVentureEngine::toggleExits() {
+ Common::Array<ObjID> exits = _currentSelection;
+ while (!exits.empty()) {
+ ObjID obj = exits.front();
+ exits.remove_at(0);
+ highlightExit(obj);
+ updateWindow(findParentWindow(obj));
+ }
+}
+
+void MacVentureEngine::zoomObject(ObjID objID) {
+ warning("zoomObject: unimplemented");
+}
+
+bool MacVentureEngine::isObjEnqueued(ObjID objID) {
+ Common::Array<QueuedObject>::const_iterator it;
+ for (it = _objQueue.begin(); it != _objQueue.end(); it++) {
+ if ((*it).object == objID) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool MacVentureEngine::isGameRunning() {
+ return (_gameState == kGameStateInit || _gameState == kGameStatePlaying);
+}
+
+ControlAction MacVenture::MacVentureEngine::referenceToAction(ControlType id) {
+ switch (id) {
+ case MacVenture::kControlExitBox:
+ return kActivateObject;//?? Like this in the original
+ case MacVenture::kControlExamine:
+ return kExamine;
+ case MacVenture::kControlOpen:
+ return kOpen;
+ case MacVenture::kControlClose:
+ return kClose;
+ case MacVenture::kControlSpeak:
+ return kSpeak;
+ case MacVenture::kControlOperate:
+ return kOperate;
+ case MacVenture::kControlGo:
+ return kGo;
+ case MacVenture::kControlHit:
+ return kHit;
+ case MacVenture::kControlConsume:
+ return kConsume;
+ default:
+ return kNoCommand;
+ }
+}
+
+// Data retrieval
+
+bool MacVentureEngine::isPaused() {
+ return _paused;
+}
+
+bool MacVentureEngine::needsClickToContinue() {
+ return _clickToContinue;
+}
+
+Common::String MacVentureEngine::getCommandsPausedString() const {
+ return Common::String("Click to continue");
+}
+
+Common::String MacVentureEngine::getFilePath(FilePathID id) const {
+ if (id <= 3) { // We don't want a file in the subdirectory
+ return _filenames->getString(id);
+ } else { // We want a game file
+ return _filenames->getString(3) + "/" + _filenames->getString(id);
+ }
+}
+
+bool MacVentureEngine::isOldText() const {
+ return _oldTextEncoding;
+}
+
+const HuffmanLists *MacVentureEngine::getDecodingHuffman() const {
+ return _textHuffman;
+}
+
+uint32 MacVentureEngine::randBetween(uint32 min, uint32 max) {
+ return _rnd->getRandomNumber(max - min) + min;
+}
+
+uint32 MacVentureEngine::getInvolvedObjects() {
+ // If there is no valid control selected, we return a number too big
+ // to be useful. There is no control that uses that many objects.
+ return (_selectedControl ? getGlobalSettings()._cmdArgCnts[_selectedControl - 1] : 3000);
+}
+
+Common::Point MacVentureEngine::getObjPosition(ObjID objID) {
+ return Common::Point(_world->getObjAttr(objID, kAttrPosX), _world->getObjAttr(objID, kAttrPosY));
+}
+
+bool MacVentureEngine::isObjVisible(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrInvisible) == 0;
+}
+
+bool MacVentureEngine::isObjClickable(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrUnclickable) == 0;
+}
+
+bool MacVentureEngine::isObjSelected(ObjID objID) {
+ int idx = findObjectInArray(objID, _currentSelection);
+ return idx != -1;
+}
+
+bool MacVentureEngine::isObjExit(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrIsExit);
+}
+
+bool MacVentureEngine::isHiddenExit(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrHiddenExit);
+}
+
+Common::Point MacVentureEngine::getObjExitPosition(ObjID objID) {
+ uint x = _world->getObjAttr(objID, kAttrExitX);
+ uint y = _world->getObjAttr(objID, kAttrExitY);
+ return Common::Point(x, y);
+}
+
+ObjID MacVentureEngine::getParent(ObjID objID) {
+ return _world->getObjAttr(objID, kAttrParentObject);
+}
+
+Common::Rect MacVentureEngine::getObjBounds(ObjID objID) {
+ Common::Point pos = getObjPosition(objID);
+
+ WindowReference win = findParentWindow(objID);
+ if (win != kNoWindow) { // If it's not in a window YET, we don't really care about the border
+ BorderBounds bounds = borderBounds(_gui->getWindowData(win).type); // HACK
+ pos.x += bounds.leftOffset;
+ pos.y += bounds.topOffset;
+ }
+ Common::Point measures = _gui->getObjMeasures(objID);
+ uint w = measures.x;
+ uint h = measures.y;
+ return Common::Rect(pos.x, pos.y, pos.x + w, pos.y + h);
+}
+
+uint MacVentureEngine::getOverlapPercent(ObjID one, ObjID other) {
+ // If it's not the same parent, there's 0 overlap
+ if (_world->getObjAttr(one, kAttrParentObject) !=
+ _world->getObjAttr(other, kAttrParentObject))
+ return 0;
+
+ Common::Rect oneBounds = getObjBounds(one);
+ Common::Rect otherBounds = getObjBounds(other);
+ if (otherBounds.intersects(oneBounds) ||
+ oneBounds.intersects(otherBounds)) {
+ uint areaOne = oneBounds.width() * oneBounds.height();
+ uint areaOther = otherBounds.width() * otherBounds.height();
+ return (areaOne != 0) ? (areaOther * 100 / areaOne) : 0;
+ }
+ return 0;
+}
+
+WindowReference MacVentureEngine::getObjWindow(ObjID objID) {
+ return _gui->getObjWindow(objID);
+}
+
+WindowReference MacVentureEngine::findParentWindow(ObjID objID) {
+ if (objID == 1) {
+ return kSelfWindow;
+ }
+ ObjID parent = _world->getObjAttr(objID, kAttrParentObject);
+ if (parent == 0) {
+ return kNoWindow;
+ }
+ return getObjWindow(parent);
+}
+
+Common::Point MacVentureEngine::getDeltaPoint() {
+ return _deltaPoint;
+}
+
+ObjID MacVentureEngine::getDestObject() {
+ return _destObject;
+}
+
+ControlAction MacVentureEngine::getSelectedControl() {
+ return _selectedControl;
+}
+
+// Data loading
+
+bool MacVentureEngine::loadGlobalSettings() {
+ Common::MacResIDArray resArray;
+
+ if ((resArray = _resourceManager->getResIDArray(MKTAG('G', 'N', 'R', 'L'))).size() == 0)
+ return false;
+
+ Common::SeekableReadStream *res;
+ res = _resourceManager->getResource(MKTAG('G', 'N', 'R', 'L'), kGlobalSettingsID);
+ if (res) {
+ _globalSettings = new GlobalSettings();
+ _globalSettings->loadSettings(res);
+ delete res;
+ return true;
+ }
+ return false;
+}
+
+bool MacVentureEngine::loadTextHuffman() {
+ Common::MacResIDArray resArray;
+ Common::SeekableReadStream *res;
+
+ if ((resArray = _resourceManager->getResIDArray(MKTAG('G', 'N', 'R', 'L'))).size() == 0)
+ return false;
+
+ res = _resourceManager->getResource(MKTAG('G', 'N', 'R', 'L'), kTextHuffmanTableID);
+ if (res) {
+ uint32 numEntries = res->readUint16BE();
+ res->readUint16BE(); // Skip
+
+ uint32 *masks = new uint32[numEntries];
+ for (uint i = 0; i < numEntries - 1; i++) {
+ // For some reason there are one lass mask than entries
+ masks[i] = res->readUint16BE();
+ }
+
+ uint32 *lengths = new uint32[numEntries];
+ for (uint i = 0; i < numEntries; i++) {
+ lengths[i] = res->readByte();
+ }
+
+ uint32 *values = new uint32[numEntries];
+ for (uint i = 0; i < numEntries; i++) {
+ values[i] = res->readByte();
+ }
+
+ _textHuffman = new HuffmanLists(numEntries, lengths, masks, values);
+ debugC(4, kMVDebugMain, "Text is huffman-encoded");
+
+ delete res;
+ delete[] masks;
+ delete[] lengths;
+ delete[] values;
+ return true;
+ }
+ return false;
+}
+
+// Global Settings
+GlobalSettings::GlobalSettings() {
+}
+
+GlobalSettings::~GlobalSettings() {
+
+}
+
+void GlobalSettings::loadSettings(Common::SeekableReadStream *dataStream) {
+ _numObjects = dataStream->readUint16BE();
+ _numGlobals = dataStream->readUint16BE();
+ _numCommands = dataStream->readUint16BE();
+ _numAttributes = dataStream->readUint16BE();
+ _numGroups = dataStream->readUint16BE();
+ dataStream->readUint16BE(); // unknown
+ _invTop = dataStream->readUint16BE();
+ _invLeft = dataStream->readUint16BE();
+ _invWidth = dataStream->readUint16BE();
+ _invHeight = dataStream->readUint16BE();
+ _invOffsetY = dataStream->readUint16BE();
+ _invOffsetX = dataStream->readSint16BE();
+ _defaultFont = dataStream->readUint16BE();
+ _defaultSize = dataStream->readUint16BE();
+
+ uint8 *attrIndices = new uint8[_numAttributes];
+ dataStream->read(attrIndices, _numAttributes);
+ _attrIndices = Common::Array<uint8>(attrIndices, _numAttributes);
+ delete[] attrIndices;
+
+ for (int i = 0; i < _numAttributes; i++) {
+ _attrMasks.push_back(dataStream->readUint16BE());
+ }
+
+ uint8 *attrShifts = new uint8[_numAttributes];
+ dataStream->read(attrShifts, _numAttributes);
+ _attrShifts = Common::Array<uint8>(attrShifts, _numAttributes);
+ delete[] attrShifts;
+
+ uint8 *cmdArgCnts = new uint8[_numCommands];
+ dataStream->read(cmdArgCnts, _numCommands);
+ _cmdArgCnts = Common::Array<uint8>(cmdArgCnts, _numCommands);
+ delete[] cmdArgCnts;
+
+ uint8 *commands = new uint8[_numCommands];
+ dataStream->read(commands, _numCommands);
+ _commands = Common::Array<uint8>(commands, _numCommands);
+ delete[] commands;
+}
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/macventure.h b/engines/macventure/macventure.h
new file mode 100644
index 0000000000..3f2c181b14
--- /dev/null
+++ b/engines/macventure/macventure.h
@@ -0,0 +1,377 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_MACVENTURE_H
+#define MACVENTURE_MACVENTURE_H
+
+#include "engines/engine.h"
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/debug.h"
+#include "common/random.h"
+#include "common/macresman.h"
+#include "common/huffman.h"
+#include "common/savefile.h"
+
+#include "gui/debugger.h"
+
+#include "macventure/debug.h"
+#include "macventure/gui.h"
+#include "macventure/world.h"
+#include "macventure/hufflists.h"
+#include "macventure/stringtable.h"
+#include "macventure/script.h"
+#include "macventure/controls.h"
+#include "macventure/windows.h"
+#include "macventure/sound.h"
+
+struct ADGameDescription;
+
+namespace MacVenture {
+
+class SaveFileManager;
+
+class Console;
+class World;
+class ScriptEngine;
+
+class SoundManager;
+
+typedef uint32 ObjID;
+
+// HACK, until I find a way to translate correctly
+extern void toASCII(Common::String &str);
+
+enum {
+ kScreenWidth = 512,
+ kScreenHeight = 342
+};
+
+enum {
+ kGlobalSettingsID = 0x80,
+ kDiplomaGeometryID = 0x81,
+ kTextHuffmanTableID = 0x83
+};
+
+enum {
+ kSaveGameStrID = 0x82,
+ kDiplomaFilenameID = 0x83,
+ kClickToContinueTextID = 0x84,
+ kStartGameFilenameID = 0x85
+};
+
+enum FilePathID {
+ kMCVID = 1,
+ kTitlePathID = 2,
+ kSubdirPathID = 3,
+ kObjectPathID = 4,
+ kFilterPathID = 5,
+ kTextPathID = 6,
+ kGraphicPathID = 7,
+ kSoundPathID = 8
+};
+
+
+class GlobalSettings {
+public:
+ GlobalSettings();
+ ~GlobalSettings();
+
+ void loadSettings(Common::SeekableReadStream *dataStream);
+
+// HACK MAybe this should be private, but the class is only here to handle
+// memory allocation/deallocation
+public:
+ uint16 _numObjects; // number of game objects defined
+ uint16 _numGlobals; // number of globals defined
+ uint16 _numCommands; // number of commands defined
+ uint16 _numAttributes; // number of attributes
+ uint16 _numGroups; // number of object groups
+ uint16 _invTop; // inventory window bounds
+ uint16 _invLeft;
+ uint16 _invHeight;
+ uint16 _invWidth;
+ uint16 _invOffsetY; // positioning offset for
+ uint16 _invOffsetX; // new inventory windows
+ uint16 _defaultFont; // default font
+ uint16 _defaultSize; // default font size
+ Common::Array<uint8> _attrIndices; // attribute indices into attribute table
+ Common::Array<uint16> _attrMasks; // attribute masks
+ Common::Array<uint8> _attrShifts; // attribute bit shifts
+ Common::Array<uint8> _cmdArgCnts; // command argument counts
+ Common::Array<uint8> _commands; // command buttons
+};
+
+enum GameState {
+ kGameStateInit,
+ kGameStatePlaying,
+ kGameStateWinnig,
+ kGameStateLosing,
+ kGameStateQuitting
+};
+
+enum ObjectQueueID {
+ kFocusWindow = 2,
+ kOpenWindow = 3,
+ kCloseWindow = 4,
+ kUpdateObject = 7,
+ kUpdateWindow = 8,
+ kSetToPlayerParent = 12,
+ kHightlightExits = 13,
+ kAnimateBack = 14
+};
+
+struct QueuedObject {
+ ObjectQueueID id;
+ ObjID object;
+ ObjID parent;
+ uint x;
+ uint y;
+ uint exitx;
+ uint exity;
+ bool hidden;
+ bool offscreen;
+ bool invisible;
+ ObjID target; // For swapping
+};
+
+enum TextQueueID {
+ kTextNumber = 1,
+ kTextNewLine = 2,
+ kTextPlain = 3
+};
+
+struct QueuedText {
+ TextQueueID id;
+ ObjID source;
+ ObjID destination;
+ ObjID asset;
+};
+
+enum SoundQueueID {
+ kSoundPlay = 1,
+ kSoundPlayAndWait = 2,
+ kSoundWait = 3
+};
+
+struct QueuedSound {
+ SoundQueueID id;
+ ObjID reference;
+};
+
+class MacVentureEngine : public Engine {
+
+public:
+ MacVentureEngine(OSystem *syst, const ADGameDescription *gameDesc);
+ ~MacVentureEngine();
+
+ virtual bool hasFeature(EngineFeature f) const;
+
+ virtual Common::Error run();
+
+ bool scummVMSaveLoadDialog(bool isSave);
+ bool canLoadGameStateCurrently();
+ bool canSaveGameStateCurrently();
+ virtual Common::Error loadGameState(int slot);
+ virtual Common::Error saveGameState(int slot, const Common::String &desc);
+ void newGame();
+ void setInitialFlags();
+ void setNewGameState();
+
+ void initDebugChannels();
+ void reset();
+ void resetInternals();
+ void resetGui();
+ void refreshScreen();
+
+ // datafiles.cpp
+ void loadDataBundle();
+ Common::SeekableReadStream *getBorderFile(MVWindowType windowType, bool isActive);
+
+ void requestQuit();
+ void requestUnpause();
+ void selectControl(ControlAction action);
+ void refreshReady();
+ void preparedToRun();
+ void gameChanged();
+ void winGame();
+ void loseGame();
+ void clickToContinue();
+
+ void updateState(bool pause);
+ void revert();
+
+ void enqueueObject(ObjectQueueID type, ObjID objID, ObjID target = 0);
+ void enqueueText(TextQueueID type, ObjID target, ObjID source, ObjID text);
+ void enqueueSound(SoundQueueID type, ObjID target);
+
+ void runObjQueue();
+ void printTexts();
+ void playSounds(bool pause);
+
+ void handleObjectSelect(ObjID objID, WindowReference win, bool shiftPressed, bool isDoubleClick);
+ void handleObjectDrop(ObjID objID, Common::Point delta, ObjID newParent);
+ void setDeltaPoint(Common::Point newPos);
+ void focusObjWin(ObjID objID);
+ void updateWindow(WindowReference winID);
+
+ bool showTextEntry(ObjID text, ObjID srcObj, ObjID destObj);
+ void setTextInput(Common::String content);
+ Common::String getUserInput();
+
+ // Data retrieval
+ Common::String getStartGameFileName();
+ bool isPaused();
+ bool needsClickToContinue();
+ Common::String getCommandsPausedString() const;
+ const GlobalSettings &getGlobalSettings() const;
+ Common::String getFilePath(FilePathID id) const;
+ bool isOldText() const;
+ const HuffmanLists *getDecodingHuffman() const;
+ uint32 randBetween(uint32 min, uint32 max);
+ uint32 getInvolvedObjects();
+ int findObjectInArray(ObjID objID, const Common::Array<ObjID> &list);
+ uint getPrefixNdx(ObjID obj);
+ Common::String getPrefixString(uint flag, ObjID obj);
+ Common::String getNoun(ObjID ndx);
+
+ // Attributes consult
+ Common::Point getObjPosition(ObjID objID);
+ bool isObjVisible(ObjID objID);
+ bool isObjClickable(ObjID objID);
+ bool isObjSelected(ObjID objID);
+ bool isObjExit(ObjID objID);
+ bool isHiddenExit(ObjID objID);
+ Common::Point getObjExitPosition(ObjID objID);
+ ObjID getParent(ObjID objID);
+
+ // Utils
+ ControlAction referenceToAction(ControlType id);
+
+ // Encapsulation HACK
+ Common::Rect getObjBounds(ObjID objID);
+ uint getOverlapPercent(ObjID one, ObjID other);
+
+ WindowReference getObjWindow(ObjID objID);
+ WindowReference findParentWindow(ObjID objID);
+
+ Common::Point getDeltaPoint();
+ ObjID getDestObject();
+ ControlAction getSelectedControl();
+
+private:
+ void processEvents();
+
+ bool runScriptEngine();
+ void endGame();
+ void updateControls();
+ void resetVars();
+
+ void unselectAll();
+ void selectObject(ObjID objID);
+ void unselectObject(ObjID objID);
+ void highlightExit(ObjID objID);
+ void selectPrimaryObject(ObjID objID);
+ void updateExits();
+
+ // Object queue methods
+ void focusObjectWindow(ObjID objID);
+ void openObject(ObjID objID);
+ void closeObject(ObjID objID);
+ void checkObject(QueuedObject objID);
+ void reflectSwap(ObjID fromID, ObjID toID);
+ void toggleExits();
+ void zoomObject(ObjID objID);
+
+ bool isObjEnqueued(ObjID obj);
+
+ bool isGameRunning();
+
+ // Data loading
+ bool loadGlobalSettings();
+ bool loadTextHuffman();
+
+ const char *getGameFileName() const;
+
+private: // Attributes
+
+ const ADGameDescription *_gameDescription;
+ Common::RandomSource *_rnd;
+
+ Common::MacResManager *_resourceManager;
+
+ Console *_debugger;
+ Gui *_gui;
+ World *_world;
+ ScriptEngine *_scriptEngine;
+
+ // String tables
+ StringTable *_filenames;
+ StringTable *_decodingDirectArticles;
+ StringTable *_decodingNamingArticles;
+ StringTable *_decodingIndirectArticles;
+
+ SoundManager *_soundManager;
+
+ Common::Archive *_dataBundle;
+
+ // Engine state
+ GameState _gameState;
+ GlobalSettings *_globalSettings;
+ HuffmanLists *_textHuffman;
+ bool _oldTextEncoding;
+ bool _paused, _halted, _cmdReady, _prepared;
+ bool _haltedAtEnd, _haltedInSelection;
+ bool _gameChanged;
+ bool _clickToContinue;
+
+ Common::Array<QueuedObject> _objQueue;
+ Common::Array<QueuedObject> _inQueue;
+ Common::Array<QueuedSound> _soundQueue;
+ Common::Array<QueuedText> _textQueue;
+
+ // Selections
+ ObjID _destObject;
+ ControlAction _selectedControl;
+ Common::Array<ObjID> _currentSelection;
+ Common::Point _deltaPoint;
+ Common::String _userInput;
+
+};
+
+
+class Console : public GUI::Debugger {
+public:
+ Console(MacVentureEngine *vm) {}
+ virtual ~Console(void) {}
+};
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/module.mk b/engines/macventure/module.mk
new file mode 100644
index 0000000000..227eb41e28
--- /dev/null
+++ b/engines/macventure/module.mk
@@ -0,0 +1,31 @@
+MODULE := engines/macventure
+
+MODULE_OBJS := \
+ container.o \
+ controls.o \
+ cursor.o \
+ datafiles.o \
+ detection.o \
+ dialog.o \
+ gui.o \
+ image.o \
+ macventure.o \
+ prebuilt_dialogs.o \
+ saveload.o \
+ script.o \
+ sound.o \
+ text.o \
+ windows.o \
+ world.o
+
+
+MODULE_DIRS += \
+ engines/macventure
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_MACVENTURE), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/engines/macventure/prebuilt_dialogs.cpp b/engines/macventure/prebuilt_dialogs.cpp
new file mode 100644
index 0000000000..26d4d0deb4
--- /dev/null
+++ b/engines/macventure/prebuilt_dialogs.cpp
@@ -0,0 +1,84 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/prebuilt_dialogs.h"
+
+namespace MacVenture {
+
+const PrebuiltDialog g_prebuiltDialogs[kPrebuiltDialogCount] = {
+
+ {/* kSaveAsDialog */
+ {0, 146, 456, 254},
+ {
+ {kDEButton, "YES", kDASaveAs, 24, 68, 120, 22},
+ {kDEButton, "NO", kDACloseDialog, 168, 68, 120, 22},
+ {kDEButton, "CANCEL", kDACloseDialog, 312, 68, 120, 22},
+ {kDEPlainText, "Save As...", kDANone, 100, 10, 340, 38},
+ {kDETextInput, "", kDANone, 100, 30, 340, 20},
+ {kDEEnd, "", kDANone, 0, 0, 0, 0}
+ }
+ },
+
+ { /* kSpeakDialog */
+ {20, 92, 400, 200},
+ {
+ {kDEButton, "OK", kDASubmit, 10, 70, 50, 20},
+ {kDEButton, "CANCEL", kDACloseDialog, 96, 70, 50, 20},
+ {kDEPlainText, "What would you like to say?", kDANone, 10, 10, 400, 20},
+ {kDETextInput, "", kDANone, 10, 25, 350, 40},
+ {kDEEnd, "", kDANone, 0, 0, 0, 0}
+ }
+ },
+
+ { /* kWinGameDialog */
+ {20, 100, 320, 200},
+ {
+ {kDEPlainText, "You Won!", kDANone, 20, 16, 280, 20},
+ {kDEPlainText, "What do you want to do?", kDANone, 20, 30, 280, 20},
+ {kDEButton, "New Game", kDANewGame, 20, 60, 70, 20},
+ {kDEButton, "Load", kDALoadGame, 110, 60, 70, 20},
+ {kDEButton, "Quit", kDAQuit, 200, 60, 70, 20},
+ {kDEEnd, "", kDANone, 0, 0, 0, 0}
+ }
+ },
+
+ { /* kLoseGameDialog */
+ {20, 100, 320, 200},
+ {
+ {kDEPlainText, "You Died", kDANone, 20, 16, 280, 20},
+ {kDEPlainText, "What do you want to do?", kDANone, 20, 30, 280, 20},
+ {kDEButton, "New Game", kDANewGame, 20, 60, 70, 20},
+ {kDEButton, "Load", kDALoadGame, 110, 60, 70, 20},
+ {kDEButton, "Quit", kDAQuit, 200, 60, 70, 20},
+ {kDEEnd, "", kDANone, 0, 0, 0, 0}
+ }
+ }
+};
+} // End of namespace MacVenture
diff --git a/engines/macventure/prebuilt_dialogs.h b/engines/macventure/prebuilt_dialogs.h
new file mode 100644
index 0000000000..6f2f021a59
--- /dev/null
+++ b/engines/macventure/prebuilt_dialogs.h
@@ -0,0 +1,95 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_PREBUIT_DIALOGS_H
+#define MACVENTURE_PREBUIT_DIALOGS_H
+
+#include "common/rect.h"
+
+namespace MacVenture {
+
+enum DialogAction {
+ kDANone,
+ kDACloseDialog,
+ kDASubmit,
+ kDASaveAs,
+ kDALoadGame,
+ kDAQuit,
+ kDANewGame
+};
+
+enum PrebuiltDialogs {
+ kSaveAsDialog = 0, //TODO: Currently unused, we are using ScummVM dialogs instead.
+ kSpeakDialog = 1,
+ kWinGameDialog = 2,
+ kLoseGameDialog = 3,
+ kPrebuiltDialogCount
+};
+
+enum PrebuiltElementType {
+ kDEPlainText,
+ kDEButton,
+ kDETextInput,
+ kDEEnd
+};
+
+struct PrebuiltDialogBounds {
+ uint left;
+ uint top;
+ uint right;
+ uint bottom;
+};
+
+struct PrebuiltDialogElement {
+ PrebuiltElementType type;
+ const char *title;
+ DialogAction action;
+ uint left;
+ uint top;
+ uint width;
+ uint height;
+};
+
+// Prebuilt dialogs
+enum {
+ // HACK
+ kMaxPrebuiltDialogElements = 10
+};
+
+struct PrebuiltDialog {
+ PrebuiltDialogBounds bounds;
+ PrebuiltDialogElement elements[kMaxPrebuiltDialogElements];
+};
+
+extern const PrebuiltDialog g_prebuiltDialogs[];
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/saveload.cpp b/engines/macventure/saveload.cpp
new file mode 100644
index 0000000000..89a6301318
--- /dev/null
+++ b/engines/macventure/saveload.cpp
@@ -0,0 +1,205 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/macventure.h"
+
+#include "common/error.h"
+#include "common/savefile.h"
+#include "engines/savestate.h"
+#include "gui/saveload.h"
+#include "graphics/thumbnail.h"
+
+namespace MacVenture {
+
+#define MACVENTURE_SAVE_HEADER MKTAG('M', 'V', 'S', 'S') // (M)ac(V)enture (S)cummVM (S)ave (0x4d565353, uint32)
+#define MACVENTURE_SAVE_VERSION 1 //1 BYTE
+#define MACVENTURE_DESC_LENGTH 4 //4 BYTE for the metadata length
+
+SaveStateDescriptor loadMetaData(Common::SeekableReadStream *s, int slot) {
+ // Metadata is stored at the end of the file
+ // |THUMBNAIL |
+ // | |
+ // |DESCSIZE| DESCRIPTION |
+ // |HEADER |VERSION|DESCLEN|
+ s->seek(-(5 + MACVENTURE_DESC_LENGTH), SEEK_END);
+ uint32 sig = s->readUint32BE();
+ byte version = s->readByte();
+
+ SaveStateDescriptor desc(-1, ""); // init to an invalid save slot
+
+ if (sig != MACVENTURE_SAVE_HEADER || version > MACVENTURE_SAVE_VERSION)
+ return desc;
+
+ // Save is valid, set its slot number
+ desc.setSaveSlot(slot);
+
+ // Depends on MACVENTURE_DESC_LENGTH
+ uint32 metaSize = s->readUint32BE();
+ s->seek(-(5 + MACVENTURE_DESC_LENGTH + metaSize), SEEK_END);
+
+ // Load the thumbnail
+ Graphics::Surface *thumb = Graphics::loadThumbnail(*s);
+ desc.setThumbnail(thumb);
+
+ // Load the description
+ Common::String name;
+ uint32 descSize = s->readUint32BE();
+ for (uint32 i = 0; i < descSize; ++i) {
+ name += s->readByte();
+ }
+ desc.setDescription(name);
+
+ // Load date
+ uint32 saveDate = s->readUint32LE();
+ int day = (saveDate >> 24) & 0xFF;
+ int month = (saveDate >> 16) & 0xFF;
+ int year = saveDate & 0xFFFF;
+ desc.setSaveDate(year, month, day);
+
+ uint16 saveTime = s->readUint16LE();
+ int hour = (saveTime >> 8) & 0xFF;
+ int minutes = saveTime & 0xFF;
+ desc.setSaveTime(hour, minutes);
+
+ // Load playtime
+ uint32 playTime = s->readUint32LE();
+ desc.setPlayTime(playTime * 1000);
+
+ return desc;
+}
+
+uint saveCurrentDate(Common::OutSaveFile *file) {
+ TimeDate curTime;
+ g_system->getTimeAndDate(curTime);
+
+ uint32 saveDate = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+ uint16 saveTime = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
+
+ file->writeUint32LE(saveDate);
+ file->writeUint16LE(saveTime);
+
+ // Return the number of bytes occupied
+ return 6;
+}
+
+uint savePlayTime(Common::OutSaveFile *file) {
+ uint32 playTime = g_engine->getTotalPlayTime() / 1000;
+ file->writeUint32LE(playTime);
+ // Return the number of bytes occupied
+ return 4;
+}
+
+void writeMetaData(Common::OutSaveFile *file, Common::String desc) {
+
+ // Write thumbnail
+ uint thumbSize = file->pos();
+ Graphics::saveThumbnail(*file);
+ thumbSize = file->pos() - thumbSize;
+
+ // Write description
+ file->writeUint32BE(desc.size());
+ file->writeString(desc);
+
+ uint dateSize = saveCurrentDate(file);
+ uint playTimeSize = savePlayTime(file);
+
+ file->writeUint32BE(MACVENTURE_SAVE_HEADER);
+ file->writeByte(MACVENTURE_SAVE_VERSION);
+ file->writeUint32BE(4 + desc.size() + dateSize + playTimeSize + thumbSize);
+}
+
+Common::Error MacVentureEngine::loadGameState(int slot) {
+ Common::String saveFileName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
+ Common::InSaveFile *file;
+ if(!(file = getSaveFileManager()->openForLoading(saveFileName))) {
+ error("ENGINE: Missing savegame file %s", saveFileName.c_str());
+ }
+ _world->loadGameFrom(file);
+ reset();
+ return Common::kNoError;
+}
+
+Common::Error MacVentureEngine::saveGameState(int slot, const Common::String &desc) {
+ Common::String saveFileName = Common::String::format("%s.%03d", _targetName.c_str(), slot);
+ Common::SaveFileManager *manager = getSaveFileManager();
+ // HACK Get a real name!
+ Common::OutSaveFile *file = manager->openForSaving(saveFileName);
+ _world->saveGameInto(file);
+ writeMetaData(file, desc);
+
+ file->finalize();
+ if (file->err()) {
+ warning("Could not save '%s' correctly.", saveFileName.c_str());
+ }
+ delete file;
+ return Common::kNoError;
+}
+
+bool MacVentureEngine::scummVMSaveLoadDialog(bool isSave) {
+ if (!isSave) {
+ // do loading
+ GUI::SaveLoadChooser dialog = GUI::SaveLoadChooser(Common::String("Load game:"), Common::String("Load"), false);
+ int slot = dialog.runModalWithCurrentTarget();
+
+ if (slot < 0)
+ return true;
+
+ return loadGameState(slot).getCode() == Common::kNoError;
+ }
+
+ // do saving
+ GUI::SaveLoadChooser dialog = GUI::SaveLoadChooser(Common::String("Save game:"), Common::String("Save"), true);
+ int slot = dialog.runModalWithCurrentTarget();
+ Common::String desc = dialog.getResultString();
+
+ if (desc.empty()) {
+ // create our own description for the saved game, the user didnt enter it
+ desc = dialog.createDefaultSaveDescription(slot);
+ }
+
+ /*
+ if (desc.size() > (1 << MACVENTURE_DESC_LENGTH * 8) - 1)
+ desc = Common::String(desc.c_str(), (1 << MACVENTURE_DESC_LENGTH * 8) - 1);
+ */
+ if (slot < 0)
+ return true;
+
+ return saveGameState(slot, desc).getCode() == Common::kNoError;
+}
+
+bool MacVentureEngine::canLoadGameStateCurrently() {
+ return true;
+}
+
+bool MacVentureEngine::canSaveGameStateCurrently() {
+ return true;
+}
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/script.cpp b/engines/macventure/script.cpp
new file mode 100644
index 0000000000..87ba7178bc
--- /dev/null
+++ b/engines/macventure/script.cpp
@@ -0,0 +1,1259 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "common/system.h"
+
+#include "macventure/macventure.h"
+#include "macventure/script.h"
+#include "macventure/world.h"
+#include "macventure/container.h"
+
+namespace MacVenture {
+
+ScriptEngine::ScriptEngine(MacVentureEngine *engine, World *world) {
+ _engine = engine;
+ _world = world;
+ _scripts = new Container(_engine->getFilePath(kFilterPathID));
+}
+
+ScriptEngine::~ScriptEngine() {
+ if (_scripts)
+ delete _scripts;
+}
+
+bool ScriptEngine::runControl(ControlAction action, ObjID source, ObjID destination, Common::Point delta) {
+ EngineFrame frame;
+ frame.action = action;
+ frame.src = source;
+ frame.dest = destination;
+ frame.x = delta.x;
+ frame.y = delta.y;
+ frame.haltedInSaves = false;
+ frame.haltedInFirst = false;
+ frame.haltedInFamily = false;
+ _frames.push_back(frame);
+ debugC(3, kMVDebugScript, "Stored frame %d, action: %d src: %d dest: %d point: (%d, %d)",
+ _frames.size() - 1, frame.action, frame.src, frame.dest, frame.x, frame.y);
+
+ return resume(true);
+}
+
+bool ScriptEngine::resume(bool execAll) {
+ debugC(3, kMVDebugScript, "Resume Script");
+ while (_frames.size()) {
+ bool fail = execFrame(execAll);
+ if (fail) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void ScriptEngine::reset() {
+ _frames.clear();
+}
+
+bool ScriptEngine::execFrame(bool execAll) {
+ bool doFirst = execAll;
+ bool doFamily = false;
+ bool fail;
+
+ EngineFrame *frame = &_frames.front();
+
+ // Do first dispatch script (script 0)
+ if (frame->haltedInFirst || doFirst) { // We were stuck or it's the first time
+ frame->haltedInFirst = false;
+ if (doFirst) {
+ fail = loadScript(frame, 0);
+ } else {
+ fail = resumeFunc(frame);
+ }
+ if (fail) {
+ frame->haltedInFirst = true;
+ _engine->preparedToRun();
+ return true;
+ }
+ doFamily = true;
+ frame->familyIdx = 0;
+ }
+
+ // Do scripts in the family of player (ObjID 1)
+ if (frame->haltedInFamily || doFamily) { // We have to do the family or we were stuck here
+ frame->haltedInFamily = false;
+ Common::Array<ObjID> family = _world->getFamily(_world->getObjAttr(1, kAttrParentObject), false);
+ for (uint32 i = frame->familyIdx; i < family.size(); i++) {
+ if (doFamily) {
+ fail = loadScript(frame, family[i]);
+ } else {
+ fail = resumeFunc(frame);
+ }
+ if (fail) { // We are stuck, so we don't shift the frame
+ frame->haltedInFamily = true;
+ frame->familyIdx = i;
+ _engine->preparedToRun();
+ return true;
+ }
+ doFamily = true;
+ }
+ }
+
+ // Halted in saves
+ if (frame->haltedInSaves) {
+ frame->haltedInSaves = false;
+ if (resumeFunc(frame)) {
+ frame->haltedInSaves = true;
+ _engine->preparedToRun();
+ return true;
+ }
+ }
+
+ int highest = 0;
+ uint localHigh = 0;
+ do { // Saved function calls
+ highest = 0;
+ for (uint i = 0; i < frame->saves.size(); i++) {
+ if (highest < frame->saves[i].rank) {
+ highest = frame->saves[i].rank;
+ localHigh = i;
+ }
+ }
+ if (highest) {
+ frame->saves[localHigh].rank = 0;
+ if (loadScript(frame, frame->saves[localHigh].func)) {
+ frame->haltedInSaves = true;
+ _engine->preparedToRun();
+ return true;
+ }
+ }
+ } while (highest);
+
+ _frames.pop_front();
+ return false;
+}
+
+bool ScriptEngine::loadScript(EngineFrame *frame, uint32 scriptID) {
+ if (_scripts->getItemByteSize(scriptID) > 0) {
+ debugC(2, kMVDebugScript, "Loading function %d", scriptID);
+ // Insert the new script at the front
+ frame->scripts.push_front(ScriptAsset(scriptID, _scripts));
+ return runFunc(frame);
+ }
+ return false;
+}
+
+bool ScriptEngine::resumeFunc(EngineFrame *frame) {
+ bool fail = runFunc(frame);
+ if (fail) {
+ return fail;
+ }
+ frame->scripts.pop_front();
+ if (frame->scripts.size())
+ return resumeFunc(frame);
+ return false;
+}
+
+bool ScriptEngine::runFunc(EngineFrame *frame) {
+ ScriptAsset &script = frame->scripts.front();
+ EngineState *state = &frame->state;
+ byte op;
+ while (script.hasNext()) {
+ op = script.fetch();
+ debugC(4, kMVDebugScript, "Running operation %d", op);
+ if (!(op & 0x80)) {
+ state->push(op);
+ } else {
+ switch (op) {
+ case 0x80: //get attribute
+ op80GATT(state, frame);
+ break;
+ case 0x81: //set attribute
+ op81SATT(state, frame);
+ break;
+ case 0x82: //sum children attribute
+ op82SUCH(state, frame);
+ break;
+ case 0x83: //push selected control
+ op83PUCT(state, frame);
+ break;
+ case 0x84: //push selected object
+ op84PUOB(state, frame);
+ break;
+ case 0x85: //push target
+ op85PUTA(state, frame);
+ break;
+ case 0x86: //push deltax
+ op86PUDX(state, frame);
+ break;
+ case 0x87: //push deltay
+ op87PUDY(state, frame);
+ break;
+ case 0x88: //push immediate.b
+ op88PUIB(state, frame, &script);
+ break;
+ case 0x89: //push immediate
+ op89PUI(state, frame, &script);
+ break;
+ case 0x8a: //get global
+ op8aGGLO(state, frame);
+ break;
+ case 0x8b: //set global
+ op8bSGLO(state, frame);
+ break;
+ case 0x8c: //random
+ op8cRAND(state, frame);
+ break;
+ case 0x8d: //copy
+ op8dCOPY(state, frame);
+ break;
+ case 0x8e: //copyn
+ op8eCOPYN(state, frame);
+ break;
+ case 0x8f: //swap
+ op8fSWAP(state, frame);
+ break;
+ case 0x90: //swapn
+ op90SWAPN(state, frame);
+ break;
+ case 0x91: //pop
+ op91POP(state, frame);
+ break;
+ case 0x92: //copy+1
+ op92COPYP(state, frame);
+ break;
+ case 0x93: //copy+n
+ op93COPYPN(state, frame);
+ break;
+ case 0x94: //shuffle
+ op94SHUFF(state, frame);
+ break;
+ case 0x95: //sort
+ op95SORT(state, frame);
+ break;
+ case 0x96: //clear stack
+ op96CLEAR(state, frame);
+ break;
+ case 0x97: //get stack size
+ op97SIZE(state, frame);
+ break;
+ case 0x98: //add
+ op98ADD(state, frame);
+ break;
+ case 0x99: //subtract
+ op99SUB(state, frame);
+ break;
+ case 0x9a: //multiply
+ op9aMUL(state, frame);
+ break;
+ case 0x9b: //divide
+ op9bDIV(state, frame);
+ break;
+ case 0x9c: //mod
+ op9cMOD(state, frame);
+ break;
+ case 0x9d: //divmod
+ op9dDMOD(state, frame);
+ break;
+ case 0x9e: //abs
+ op9eABS(state, frame);
+ break;
+ case 0x9f: //neg
+ op9fNEG(state, frame);
+ break;
+ case 0xa0: //and
+ opa0AND(state, frame);
+ break;
+ case 0xa1: //or
+ opa1OR(state, frame);
+ break;
+ case 0xa2: //xor
+ opa2XOR(state, frame);
+ break;
+ case 0xa3: //not
+ opa3NOT(state, frame);
+ break;
+ case 0xa4: //logical and
+ opa4LAND(state, frame);
+ break;
+ case 0xa5: //logical or
+ opa5LOR(state, frame);
+ break;
+ case 0xa6: //logical xor
+ opa6LXOR(state, frame);
+ break;
+ case 0xa7: //logical not
+ opa7LNOT(state, frame);
+ break;
+ case 0xa8: //gt? unsigned
+ opa8GTU(state, frame);
+ break;
+ case 0xa9: //lt? unsigned
+ opa9LTU(state, frame);
+ break;
+ case 0xaa: //gt? signed
+ opaaGTS(state, frame);
+ break;
+ case 0xab: //lt? signed
+ opabLTS(state, frame);
+ break;
+ case 0xac: //eq?
+ opacEQ(state, frame);
+ break;
+ case 0xad: //eq string?
+ opadEQS(state, frame);
+ break;
+ case 0xae: //contains
+ opaeCONT(state, frame);
+ break;
+ case 0xaf: //contains word
+ opafCONTW(state, frame);
+ break;
+ case 0xb0: //bra
+ opb0BRA(state, frame, &script);
+ break;
+ case 0xb1: //bra.b
+ opb1BRAB(state, frame, &script);
+ break;
+ case 0xb2: //beq
+ opb2BEQ(state, frame, &script);
+ break;
+ case 0xb3: //beq.b
+ opb3BEQB(state, frame, &script);
+ break;
+ case 0xb4: //bne
+ opb4BNE(state, frame, &script);
+ break;
+ case 0xb5: //bne.b
+ opb5BNEB(state, frame, &script);
+ break;
+ case 0xb6: //call later
+ opb6CLAT(state, frame);
+ break;
+ case 0xb7: //cancel call
+ opb7CCA(state, frame);
+ break;
+ case 0xb8: //cancel low priority
+ opb8CLOW(state, frame);
+ break;
+ case 0xb9: //cancel high priority
+ opb9CHI(state, frame);
+ break;
+ case 0xba: //cancel priority range
+ opbaCRAN(state, frame);
+ break;
+ case 0xbb: //fork
+ if (opbbFORK(state, frame))
+ return true;
+ break;
+ case 0xbc: //call
+ if (opbcCALL(state, frame, script))
+ return true;
+ break;
+ case 0xbd: //focus object
+ opbdFOOB(state, frame);
+ break;
+ case 0xbe: //swap objects
+ opbeSWOB(state, frame);
+ break;
+ case 0xbf: //snap object
+ opbfSNOB(state, frame);
+ break;
+ case 0xc0: //toggle exits
+ opc0TEXI(state, frame);
+ break;
+ case 0xc1: //print text
+ opc1PTXT(state, frame);
+ break;
+ case 0xc2: //print newline
+ opc2PNEW(state, frame);
+ break;
+ case 0xc3: //print text+nl
+ opc3PTNE(state, frame);
+ break;
+ case 0xc4: //print nl+text+nl
+ opc4PNTN(state, frame);
+ break;
+ case 0xc5: //print number
+ opc5PNUM(state, frame);
+ break;
+ case 0xc6: //push 2
+ opc6P2(state, frame);
+ break;
+ case 0xc7: //play sound in background
+ opc7PLBG(state, frame);
+ break;
+ case 0xc8: //play sound and wait
+ opc8PLAW(state, frame);
+ break;
+ case 0xc9: //wait for sound to finish?
+ opc9WAIT(state, frame);
+ break;
+ case 0xca: //get current time
+ opcaTIME(state, frame);
+ break;
+ case 0xcb: //get current day
+ opcbDAY(state, frame);
+ break;
+ case 0xcc: //get children
+ opccCHLD(state, frame);
+ break;
+ case 0xcd: //get num children
+ opcdNCHLD(state, frame);
+ break;
+ case 0xce: //get engine version
+ opceVERS(state, frame);
+ break;
+ case 0xcf: //push scenario number
+ opcfPSCE(state, frame);
+ break;
+ case 0xd0: //push 1
+ opd0P1(state, frame);
+ break;
+ case 0xd1: //get object dimensions
+ opd1GOBD(state, frame);
+ break;
+ case 0xd2: //get overlap percent
+ opd2GOVP(state, frame);
+ break;
+ case 0xd3: //capture children
+ opd3CAPC(state, frame);
+ break;
+ case 0xd4: //release children
+ opd4RELC(state, frame);
+ break;
+ case 0xd5: //show speech dialog
+ opd5DLOG(state, frame);
+ return true;
+ case 0xd6: //activate command
+ opd6ACMD(state, frame);
+ break;
+ case 0xd7: //lose game
+ opd7LOSE(state, frame);
+ break;
+ case 0xd8: //win game
+ opd8WIN(state, frame);
+ break;
+ case 0xd9: //sleep
+ opd9SLEEP(state, frame);
+ return true;
+ case 0xda: //click to continue
+ opdaCLICK(state, frame);
+ return true;
+ case 0xdb: //run queue
+ opdbROBQ(state, frame);
+ break;
+ case 0xdc: //run sound queue
+ opdcRSQ(state, frame);
+ break;
+ case 0xdd: //run text queue
+ opddRTQ(state, frame);
+ break;
+ case 0xde: //update screen
+ opdeUPSC(state, frame);
+ break;
+ case 0xdf: //flash main window
+ opdfFMAI(state, frame);
+ return true;
+ case 0xe0: //cache graphic and object
+ ope0CHGR(state, frame);
+ break;
+ case 0xe1: //cache sound
+ ope1CHSO(state, frame);
+ break;
+ case 0xe2: //muldiv
+ ope2MDIV(state, frame);
+ break;
+ case 0xe3: //update object
+ ope3UPOB(state, frame);
+ break;
+ case 0xe4: //currently playing event?
+ ope4PLEV(state, frame);
+ break;
+ case 0xe5: //wait for event to finish
+ ope5WEV(state, frame);
+ break;
+ case 0xe6: //get fibonacci (joke)
+ ope6GFIB(state, frame);
+ break;
+ case 0xe7: //calc fibonacci
+ ope7CFIB(state, frame);
+ break;
+ default:
+ op00NOOP(op);
+ }
+ }
+ }
+ return false;
+}
+
+int16 ScriptEngine::neg16(int16 val) {
+ if (val & 0x8000)
+ val = -((val ^ 0xFFFF) + 1);
+ return val;
+}
+
+int16 ScriptEngine::neg8(int16 val) {
+ if (val & 0x80)
+ val = -((val ^ 0xff) + 1);
+ return val;
+}
+
+int16 ScriptEngine::sumChildrenAttr(int16 obj, int16 attr, bool recursive) {
+ int16 sum = 0;
+ Common::Array<ObjID> children = _world->getChildren(obj, recursive);
+ for (Common::Array<ObjID>::const_iterator it = children.begin(); it != children.end(); it++) {
+ sum += _world->getObjAttr(*it, attr);
+ }
+ return sum;
+}
+
+void ScriptEngine::ensureNonzeroDivisor(int16 divisor, byte opcode) {
+ // TODO Untested, since that occassion rarely comes up.
+ if (divisor == 0) {
+ error("SCRIPT: Attempt to divide by 0 in operation %x", opcode);
+ }
+}
+
+void MacVenture::ScriptEngine::op80GATT(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ int16 attr = state->pop();
+ state->push(_world->getObjAttr(obj, attr));
+}
+
+void ScriptEngine::op81SATT(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ int16 attr = state->pop();
+ int16 val = neg16(state->pop());
+ _world->setObjAttr(obj, attr, val);
+}
+
+void ScriptEngine::op82SUCH(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ int16 attr = state->pop();
+ int16 recursive = neg16(state->pop());
+ state->push(sumChildrenAttr(obj, attr, recursive));
+}
+
+void ScriptEngine::op83PUCT(EngineState *state, EngineFrame *frame) {
+ state->push(frame->action);
+}
+
+void ScriptEngine::op84PUOB(EngineState *state, EngineFrame *frame) {
+ state->push(frame->src);
+}
+
+void ScriptEngine::op85PUTA(EngineState *state, EngineFrame *frame) {
+ state->push(frame->dest);
+}
+
+void ScriptEngine::op86PUDX(EngineState *state, EngineFrame *frame) {
+ state->push(frame->x);
+}
+
+void ScriptEngine::op87PUDY(EngineState *state, EngineFrame *frame) {
+ state->push(frame->y);
+}
+
+void ScriptEngine::op88PUIB(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ state->push(script->fetch());
+}
+
+void ScriptEngine::op89PUI(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val <<= 8;
+ val = val | script->fetch();
+ state->push(val);
+}
+
+void ScriptEngine::op8aGGLO(EngineState *state, EngineFrame *frame) {
+ int16 idx = state->pop();
+ state->push(_world->getGlobal(idx));
+}
+
+void ScriptEngine::op8bSGLO(EngineState *state, EngineFrame *frame) {
+ int16 idx = state->pop();
+ int16 val = neg16(state->pop());
+ _world->setGlobal(idx, val);
+ _engine->gameChanged();
+}
+
+void ScriptEngine::op8cRAND(EngineState *state, EngineFrame *frame) {
+ int16 max = state->pop();
+ state->push(_engine->randBetween(0, max));
+}
+
+void ScriptEngine::op8dCOPY(EngineState *state, EngineFrame *frame) {
+ int16 val = state->pop();
+ state->push(val);
+ state->push(val);
+}
+
+void ScriptEngine::op8eCOPYN(EngineState *state, EngineFrame *frame) {
+ int16 n = state->pop();
+ int16 offs = n - 1;
+ int16 val;
+ while (n) {
+ val = state->peek(offs);
+ state->push(val);
+ n--;
+ }
+}
+
+void ScriptEngine::op8fSWAP(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(b);
+ state->push(a);
+}
+
+void ScriptEngine::op90SWAPN(EngineState *state, EngineFrame *frame) {
+ int16 idx = state->pop();
+ int16 a = state->peek(idx);
+ int16 b = state->peek(0);
+ state->poke(idx, b);
+ state->poke(0, a);
+}
+
+void ScriptEngine::op91POP(EngineState *state, EngineFrame *frame) {
+ state->pop();
+}
+
+void ScriptEngine::op92COPYP(EngineState *state, EngineFrame *frame) {
+ int16 val = state->peek(1);
+ state->push(val);
+}
+
+void ScriptEngine::op93COPYPN(EngineState *state, EngineFrame *frame) {
+ int16 idx = state->pop();
+ int16 val = state->peek(idx);
+ state->push(val);
+}
+
+void ScriptEngine::op94SHUFF(EngineState *state, EngineFrame *frame) {
+ int16 a = state->pop();
+ int16 b = state->pop();
+ int16 c = state->pop();
+ state->push(a);
+ state->push(c);
+ state->push(b);
+}
+
+void ScriptEngine::op95SORT(EngineState *state, EngineFrame *frame) {
+ int16 step = neg16(state->pop());
+ int16 num = neg16(state->pop());
+ step %= num;
+ if (step < 0) {
+ step += num;
+ }
+ int16 end = 0;
+ int16 start = 0;
+ for (int16 i = 1; i < num; i++) {
+ start += step;
+ if (start >= num) {
+ start -= num;
+ }
+ if (start == end) {
+ end++;
+ start = end;
+ } else {
+ int16 a = state->peek(end);
+ int16 b = state->peek(start);
+ state->poke(end, b);
+ state->poke(start, a);
+ }
+ }
+}
+
+void ScriptEngine::op96CLEAR(EngineState *state, EngineFrame *frame) {
+ state->clear();
+}
+
+void ScriptEngine::op97SIZE(EngineState *state, EngineFrame *frame) {
+ state->push(state->size());
+}
+
+void ScriptEngine::op98ADD(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a + b);
+}
+
+void ScriptEngine::op99SUB(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a - b);
+}
+
+void ScriptEngine::op9aMUL(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a * b);
+}
+
+void ScriptEngine::op9bDIV(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ ensureNonzeroDivisor(b, 0x9b);
+ state->push(a / b);
+}
+
+void ScriptEngine::op9cMOD(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a % b);
+}
+
+void ScriptEngine::op9dDMOD(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ ensureNonzeroDivisor(b, 0x9d);
+ state->push(a % b);
+ state->push(a / b);
+}
+
+void ScriptEngine::op9eABS(EngineState *state, EngineFrame *frame) {
+ int16 val = neg16(state->pop());
+ if (val < 0) {
+ val = -val;
+ }
+ state->push(val);
+}
+
+void ScriptEngine::op9fNEG(EngineState *state, EngineFrame *frame) {
+ int16 val = -neg16(state->pop());
+ state->push(val);
+}
+
+void ScriptEngine::opa0AND(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a & b);
+}
+
+void ScriptEngine::opa1OR(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a | b);
+}
+
+void ScriptEngine::opa2XOR(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(a ^ b);
+}
+
+void ScriptEngine::opa3NOT(EngineState *state, EngineFrame *frame) {
+ int16 a = state->pop();
+ state->push(a ^ 0xFFFF);
+}
+
+void ScriptEngine::opa4LAND(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push((a && b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opa5LOR(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push((a || b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opa6LXOR(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push((!a != !b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opa7LNOT(EngineState *state, EngineFrame *frame) {
+ int16 a = state->pop();
+ state->push((a == 0) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opa8GTU(EngineState *state, EngineFrame *frame) {
+ uint16 b = state->pop();
+ uint16 a = state->pop();
+ state->push((a > b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opa9LTU(EngineState *state, EngineFrame *frame) {
+ uint16 b = state->pop();
+ uint16 a = state->pop();
+ state->push((a < b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opaaGTS(EngineState *state, EngineFrame *frame) {
+ // HACK !!! May not need the neg16, since it's already a signed int!!
+ int16 b = neg16(state->pop());
+ int16 a = neg16(state->pop());
+ state->push((a > b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opabLTS(EngineState *state, EngineFrame *frame) {
+ // HACK !!! May not need the neg16, since it's already a signed int!!
+ int16 b = neg16(state->pop());
+ int16 a = neg16(state->pop());
+ state->push((a < b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opacEQ(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push((a == b) ? 0xFFFF : 0);
+}
+
+void ScriptEngine::opadEQS(EngineState *state, EngineFrame *frame) {
+ Common::String b = _world->getText(state->pop(), 0, 0); // HACK, these destinations might be wrong
+ Common::String a = _world->getText(state->pop(), 0, 0);
+ state->push((a == b) ? 1 : 0);
+}
+
+void ScriptEngine::opaeCONT(EngineState *state, EngineFrame *frame) {
+ Common::String needle = _world->getText(state->pop(), 0, 0);
+ Common::String haystack = _world->getText(state->pop(), 0, 0);
+ haystack.toLowercase();
+ state->push(haystack.contains(needle) ? 1 : 0);
+}
+
+void ScriptEngine::opafCONTW(EngineState *state, EngineFrame *frame) {
+ Common::String needle = _world->getText(state->pop(), 0, 0);
+ Common::String haystack = _world->getText(state->pop(), 0, 0);
+ haystack.toLowercase();
+ state->push(haystack.contains(needle) ? 1 : 0);
+}
+
+void ScriptEngine::opb0BRA(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val <<= 8;
+ val = val | script->fetch();
+ val = neg16(val);
+ script->branch(val);
+}
+
+void ScriptEngine::opb1BRAB(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val = neg8(val);
+ script->branch(val);
+}
+
+void ScriptEngine::opb2BEQ(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val <<= 8;
+ val = val | script->fetch();
+ val = neg16(val);
+ int16 b = state->pop();
+ if (b != 0) {
+ script->branch(val);
+ }
+}
+
+void ScriptEngine::opb3BEQB(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val = neg8(val);
+ int16 b = state->pop();
+ if (b != 0) {
+ script->branch(val);
+ }
+}
+
+void ScriptEngine::opb4BNE(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val <<= 8;
+ val = val | script->fetch();
+ val = neg16(val);
+ int16 b = state->pop();
+ if (b == 0) {
+ script->branch(val);
+ }
+}
+
+void ScriptEngine::opb5BNEB(EngineState *state, EngineFrame *frame, ScriptAsset *script) {
+ int16 val = script->fetch();
+ val = neg8(val);
+ int16 b = state->pop();
+ if (b == 0) {
+ script->branch(val);
+ }
+}
+
+void ScriptEngine::opb6CLAT(EngineState *state, EngineFrame *frame) {
+ int16 rank = state->pop();
+ int16 func = state->pop();
+ frame->saves.push_back(FunCall(func, rank));
+}
+
+void ScriptEngine::opb7CCA(EngineState *state, EngineFrame *frame) {
+ int16 func = state->pop();
+ for (uint i = 0; i < frame->saves.size(); i++) {
+ if (frame->saves[i].func == func)
+ frame->saves[i].rank = 0;
+ }
+}
+
+void ScriptEngine::opb8CLOW(EngineState *state, EngineFrame *frame) {
+ int16 hi = state->pop();
+ for (uint i = 0; i < frame->saves.size(); i++)
+ if (frame->saves[i].rank <= hi)
+ frame->saves[i].rank = 0;
+}
+
+void ScriptEngine::opb9CHI(EngineState *state, EngineFrame *frame) {
+ int16 lo = state->pop();
+ for (uint i = 0; i < frame->saves.size(); i++) {
+ if (frame->saves[i].rank >= lo) {
+ frame->saves[i].rank = 0;
+ }
+ }
+}
+
+void ScriptEngine::opbaCRAN(EngineState *state, EngineFrame *frame) {
+ int16 hi = state->pop();
+ int16 lo = state->pop();
+ for (uint i = 0; i < frame->saves.size(); i++) {
+ if (frame->saves[i].rank >= lo &&
+ frame->saves[i].rank <= hi) {
+ frame->saves[i].rank = 0;
+ }
+ }
+}
+
+bool ScriptEngine::opbbFORK(EngineState *state, EngineFrame *frame) {
+ EngineFrame newframe;
+ newframe.action = (ControlAction)state->pop();
+ newframe.src = state->pop();
+ newframe.dest = state->pop();
+ newframe.x = state->pop();
+ newframe.y = state->pop();
+ newframe.haltedInFamily = false;
+ newframe.haltedInFirst = false;
+ newframe.haltedInSaves = false;
+ _frames.push_front(newframe);
+ if (execFrame(true)) {
+ return true;
+ }
+ return false;
+}
+
+bool ScriptEngine::opbcCALL(EngineState *state, EngineFrame *frame, ScriptAsset &script) {
+ int16 id = state->pop();
+ ScriptAsset newfun = ScriptAsset(id, _scripts);
+ ScriptAsset current = script;
+ debugC(2, kMVDebugScript, "Call function: %d", id);
+ if (loadScript(frame, id))
+ return true;
+ frame->scripts.pop_front();
+ script = frame->scripts.front();
+ debugC(2, kMVDebugScript, "Return from fuction %d", id);
+ return false;
+}
+
+void ScriptEngine::opbdFOOB(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ _engine->enqueueObject(kFocusWindow, obj);
+}
+
+void ScriptEngine::opbeSWOB(EngineState *state, EngineFrame *frame) {
+ ObjID from = state->pop();
+ ObjID to = state->pop();
+ _engine->enqueueObject(kUpdateWindow, from, to);
+ _world->setObjAttr(to, kAttrContainerOpen, _world->getObjAttr(from, 6));
+ _world->setObjAttr(from, kAttrContainerOpen, 0);
+ Common::Array<ObjID> children = _world->getChildren(from, true);
+ for (uint i = 0; i < children.size(); i++) {
+ _world->setObjAttr(children[i], 0, to);
+ }
+}
+
+void ScriptEngine::opbfSNOB(EngineState *state, EngineFrame *frame) {
+ _engine->enqueueObject(kAnimateBack, frame->src);
+}
+
+void ScriptEngine::opc0TEXI(EngineState *state, EngineFrame *frame) {
+ _engine->enqueueObject(kHightlightExits, 0);
+}
+
+void ScriptEngine::opc1PTXT(EngineState *state, EngineFrame *frame) {
+ int16 tid = state->pop();
+ _engine->enqueueText(kTextPlain, frame->dest, frame->src, tid);
+}
+
+void ScriptEngine::opc2PNEW(EngineState *state, EngineFrame *frame) {
+ _engine->enqueueText(kTextNewLine, frame->dest, frame->src, 0);
+}
+
+void ScriptEngine::opc3PTNE(EngineState *state, EngineFrame *frame) {
+ int16 tid = state->pop();
+ _engine->enqueueText(kTextPlain, frame->dest, frame->src, tid);
+ _engine->enqueueText(kTextNewLine, frame->dest, frame->src, 0);
+}
+
+void ScriptEngine::opc4PNTN(EngineState *state, EngineFrame *frame) {
+ int16 tid = state->pop();
+ _engine->enqueueText(kTextNewLine, frame->dest, frame->src, 0);
+ _engine->enqueueText(kTextPlain, frame->dest, frame->src, tid);
+ _engine->enqueueText(kTextNewLine, frame->dest, frame->src, 0);
+}
+
+void ScriptEngine::opc5PNUM(EngineState *state, EngineFrame *frame) {
+ int16 tid = state->pop();
+ _engine->enqueueText(kTextNumber, frame->dest, frame->src, tid);
+}
+
+void ScriptEngine::opc6P2(EngineState *state, EngineFrame *frame) {
+ state->push(2);
+}
+
+void ScriptEngine::opc7PLBG(EngineState *state, EngineFrame *frame) {
+ int16 target = state->pop();
+ _engine->enqueueSound(kSoundPlay, target);
+}
+
+void ScriptEngine::opc8PLAW(EngineState *state, EngineFrame *frame) {
+ int16 target = state->pop();
+ _engine->enqueueSound(kSoundPlayAndWait, target);
+}
+
+void ScriptEngine::opc9WAIT(EngineState *state, EngineFrame *frame) {
+ _engine->enqueueSound(kSoundWait, 0);
+}
+
+void ScriptEngine::opcaTIME(EngineState *state, EngineFrame *frame) {
+ for (uint i = 0; i < 3; i++) {// We skip year, month and date
+ state->push(0x00);
+ }
+
+ uint32 totalPlayTime = _engine->getTotalPlayTime() / 1000; // In seconds
+ int16 hours = totalPlayTime / 3600;
+ totalPlayTime %= 3600;
+ state->push(hours);
+ int16 minutes = totalPlayTime / 60;
+ totalPlayTime %= 60;
+ state->push(minutes);
+ state->push(totalPlayTime);
+ debugC(2, kMVDebugScript, "Saved time: h[%d] m[%d] s[%d]", hours, minutes, totalPlayTime);
+}
+
+void ScriptEngine::opcbDAY(EngineState *state, EngineFrame *frame) {
+ // Probaby irrelevant, so we push Day [9]
+ state->push(9);
+}
+
+void ScriptEngine::opccCHLD(EngineState *state, EngineFrame *frame) {
+ bool recursive = state->pop() != 0;
+ int16 obj = state->pop();
+ Common::Array<ObjID> children = _world->getChildren(obj, recursive);
+ for (Common::Array<ObjID>::const_iterator it = children.begin(); it != children.end(); it++) {
+ state->push(*it);
+ }
+ state->push(children.size());
+}
+
+void ScriptEngine::opcdNCHLD(EngineState *state, EngineFrame *frame) {
+ bool recursive = state->pop() != 0;
+ int16 obj = state->pop();
+ Common::Array<ObjID> children = _world->getChildren(obj, recursive);
+ state->push(children.size());
+}
+
+void ScriptEngine::opceVERS(EngineState *state, EngineFrame *frame) {
+ state->push(86); // Engine version is irrelevant. Like this in the original.
+}
+
+void ScriptEngine::opcfPSCE(EngineState *state, EngineFrame *frame) {
+ state->push(0); // Any value greater than 0 indicates "Release".
+}
+
+void ScriptEngine::opd0P1(EngineState *state, EngineFrame *frame) {
+ state->push(1);
+}
+
+void ScriptEngine::opd1GOBD(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ Common::Rect bounds = _engine->getObjBounds(obj);
+ state->push(bounds.width());
+ state->push(bounds.height());
+}
+
+void ScriptEngine::opd2GOVP(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ state->push(_engine->getOverlapPercent(b, a));
+}
+
+void ScriptEngine::opd3CAPC(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ _world->captureChildren(obj);
+}
+
+void ScriptEngine::opd4RELC(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ _world->releaseChildren(obj);
+}
+
+void ScriptEngine::opd5DLOG(EngineState *state, EngineFrame *frame) {
+ int16 txt = state->pop();
+ if (_engine->showTextEntry(txt, frame->src, frame->dest)) {
+ state->push(0xFF);
+ } else {
+ state->push(0x00);
+ }
+}
+
+void ScriptEngine::opd6ACMD(EngineState *state, EngineFrame *frame) {
+ _engine->selectControl((ControlAction)state->pop());
+}
+
+void ScriptEngine::opd7LOSE(EngineState *state, EngineFrame *frame) {
+ _engine->loseGame();
+}
+
+void ScriptEngine::opd8WIN(EngineState *state, EngineFrame *frame) {
+ _engine->winGame();
+}
+
+void ScriptEngine::opd9SLEEP(EngineState *state, EngineFrame *frame) {
+ int16 ticks = state->pop();
+ g_system->delayMillis((ticks / 60) * 1000);
+ _engine->preparedToRun();
+}
+
+void ScriptEngine::opdaCLICK(EngineState *state, EngineFrame *frame) {
+ _engine->updateState(false);
+ _engine->clickToContinue();
+}
+
+void ScriptEngine::opdbROBQ(EngineState *state, EngineFrame *frame) {
+ _engine->runObjQueue();
+}
+
+void ScriptEngine::opdcRSQ(EngineState *state, EngineFrame *frame) {
+ _engine->playSounds(true);
+}
+
+void ScriptEngine::opddRTQ(EngineState *state, EngineFrame *frame) {
+ _engine->printTexts();
+}
+
+void ScriptEngine::opdeUPSC(EngineState *state, EngineFrame *frame) {
+ _engine->updateState(true);
+}
+
+void ScriptEngine::opdfFMAI(EngineState *state, EngineFrame *frame) {
+ int16 ticks = state->pop();
+ g_system->delayMillis((ticks / 60) * 1000);
+ _engine->revert();
+}
+
+void ScriptEngine::ope0CHGR(EngineState *state, EngineFrame *frame) {
+ state->pop();
+}
+
+void ScriptEngine::ope1CHSO(EngineState *state, EngineFrame *frame) {
+ state->pop();
+}
+
+void ScriptEngine::ope2MDIV(EngineState *state, EngineFrame *frame) {
+ int16 b = state->pop();
+ int16 a = state->pop();
+ a *= b;
+ int16 c = state->pop();
+ ensureNonzeroDivisor(c, 0xe2);
+ a /= c;
+ state->push(a);
+}
+
+void ScriptEngine::ope3UPOB(EngineState *state, EngineFrame *frame) {
+ int16 obj = state->pop();
+ _world->updateObj(obj);
+}
+
+void ScriptEngine::ope4PLEV(EngineState *state, EngineFrame *frame) {
+ state->push(0);
+}
+
+void ScriptEngine::ope5WEV(EngineState *state, EngineFrame *frame) {
+ op00NOOP(0xe5);
+}
+
+void ScriptEngine::ope6GFIB(EngineState *state, EngineFrame *frame) {
+ state->push(0);
+ op00NOOP(0xe6);
+}
+
+void ScriptEngine::ope7CFIB(EngineState *state, EngineFrame *frame) {
+ state->pop();
+ op00NOOP(0xe7);
+}
+
+void ScriptEngine::op00NOOP(byte op) {
+ warning("SCRIPT: Opcode not implemented => %x", op);
+}
+
+
+
+ScriptAsset::ScriptAsset(ObjID id, Container *container) {
+ _id = id;
+ _container = container;
+ _ip = 0x0;
+ loadInstructions();
+}
+
+void ScriptAsset::reset() {
+ _ip = 0x0;
+}
+
+uint8 ScriptAsset::fetch() {
+ uint8 ins = _instructions[_ip];
+ _ip++;
+ return ins;
+}
+
+bool ScriptAsset::hasNext() {
+ return _ip < _instructions.size();
+}
+
+void ScriptAsset::branch(int16 amount) {
+ _ip += amount;
+}
+
+ObjID ScriptAsset::getId() {
+ return _id;
+}
+
+void ScriptAsset::loadInstructions() {
+ uint32 amount = _container->getItemByteSize(_id);
+ Common::SeekableReadStream *res = _container->getItem(_id);
+ for (uint i = 0; i < amount; i++) {
+ _instructions.push_back(res->readByte());
+ }
+ delete res;
+ debugC(2, kMVDebugScript, "Load %d instructions for script %d", amount, _id);
+}
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/script.h b/engines/macventure/script.h
new file mode 100644
index 0000000000..1077745770
--- /dev/null
+++ b/engines/macventure/script.h
@@ -0,0 +1,293 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_SCRIPT_H
+#define MACVENTURE_SCRIPT_H
+
+#include "macventure/container.h"
+#include "macventure/world.h"
+#include "macventure/macventure.h"
+#include "macventure/controls.h"
+
+namespace MacVenture {
+
+class Container;
+class World;
+
+typedef uint32 ObjID;
+
+class ScriptAsset {
+public:
+ ScriptAsset(ObjID id, Container *container);
+ ~ScriptAsset() {}
+
+ void reset();
+ uint8 fetch();
+ bool hasNext();
+ void branch(int16 amount);
+
+ ObjID getId();
+
+private:
+
+ void loadInstructions();
+
+private:
+ ObjID _id;
+ Container *_container;
+
+ Common::Array<uint8> _instructions;
+ uint32 _ip; // Instruction pointer
+};
+
+class EngineState {
+public:
+ EngineState() {
+ clear();
+ }
+
+ void push(int16 data) {
+ sp--;
+ stack[sp] = unneg16(data);
+ }
+
+ int16 pop() {
+ int16 v = stack[sp];
+ sp++;
+ return v;
+ }
+
+ int16 peek(int16 off) {
+ return stack[sp + off];
+ }
+
+ void poke(int16 off, int16 val) {
+ stack[sp + off] = unneg16(val);
+ }
+
+ void clear() {
+ sp = 0x80;
+ for (int i = 0; i < sp; i++) {
+ stack[i] = 0;
+ }
+ }
+
+ int16 size() {
+ return 0x80 - sp;
+ }
+
+private:
+ int16 unneg16(int16 data) {
+ if (data < 0)
+ data = ((-data) ^ 0xFFFF) + 1;
+
+ return data;
+ }
+
+private:
+
+ int16 stack[0x80];
+ int16 sp;
+};
+
+struct FunCall {
+ int16 func;
+ int16 rank;
+
+ FunCall(int16 f, int16 r) {
+ func = f;
+ rank = r;
+ }
+};
+
+struct EngineFrame {
+ ControlAction action;
+ ObjID src;
+ ObjID dest;
+ int x;
+ int y;
+ EngineState state;
+ Common::List<ScriptAsset> scripts;
+ Common::Array<FunCall> saves;
+ uint32 familyIdx;
+
+ bool haltedInFirst;
+ bool haltedInFamily;
+ bool haltedInSaves;
+};
+
+class ScriptEngine {
+public:
+ ScriptEngine(MacVentureEngine *engine, World *world);
+ ~ScriptEngine();
+
+public:
+ bool runControl(ControlAction action, ObjID source, ObjID destination, Common::Point delta);
+ bool resume(bool execAll);
+ void reset();
+
+private:
+ bool execFrame(bool execAll);
+ bool loadScript(EngineFrame *frame, uint32 scriptID);
+ bool resumeFunc(EngineFrame *frame);
+ bool runFunc(EngineFrame *frame);
+
+private:
+
+ // Aux
+ int16 neg16(int16 val);
+ int16 neg8(int16 val);
+ int16 sumChildrenAttr(int16 obj, int16 attr, bool recursive);
+ void ensureNonzeroDivisor(int16 divisor, byte opcode);
+
+ // Opcodes
+ void op80GATT(EngineState *state, EngineFrame *frame); //get attribute
+ void op81SATT(EngineState *state, EngineFrame *frame); //set attribute
+ void op82SUCH(EngineState *state, EngineFrame *frame); //sum children attribute
+ void op83PUCT(EngineState *state, EngineFrame *frame); //push selected control
+ void op84PUOB(EngineState *state, EngineFrame *frame); //push selected object
+ void op85PUTA(EngineState *state, EngineFrame *frame); //push target
+ void op86PUDX(EngineState *state, EngineFrame *frame); //push deltax
+ void op87PUDY(EngineState *state, EngineFrame *frame); //push deltay
+ void op88PUIB(EngineState *state, EngineFrame *frame, ScriptAsset *script);//push immediate.b
+ void op89PUI(EngineState *state, EngineFrame *frame, ScriptAsset *script);//push immediate
+ void op8aGGLO(EngineState *state, EngineFrame *frame); //get global
+ void op8bSGLO(EngineState *state, EngineFrame *frame); //set global
+ void op8cRAND(EngineState *state, EngineFrame *frame); //random
+ void op8dCOPY(EngineState *state, EngineFrame *frame); //copy
+ void op8eCOPYN(EngineState *state, EngineFrame *frame); //copyn
+ void op8fSWAP(EngineState *state, EngineFrame *frame); //swap
+
+ void op90SWAPN(EngineState *state, EngineFrame *frame); //swapn
+ void op91POP(EngineState *state, EngineFrame *frame); //pop
+ void op92COPYP(EngineState *state, EngineFrame *frame); //copy+1
+ void op93COPYPN(EngineState *state, EngineFrame *frame);//copy+n
+ void op94SHUFF(EngineState *state, EngineFrame *frame); //shuffle
+ void op95SORT(EngineState *state, EngineFrame *frame); //sort
+ void op96CLEAR(EngineState *state, EngineFrame *frame); //clear stack
+ void op97SIZE(EngineState *state, EngineFrame *frame); //get stack size
+ void op98ADD(EngineState *state, EngineFrame *frame); //add
+ void op99SUB(EngineState *state, EngineFrame *frame); //subtract
+ void op9aMUL(EngineState *state, EngineFrame *frame); //multiply
+ void op9bDIV(EngineState *state, EngineFrame *frame); //divide
+ void op9cMOD(EngineState *state, EngineFrame *frame); //mod
+ void op9dDMOD(EngineState *state, EngineFrame *frame); //divmod
+ void op9eABS(EngineState *state, EngineFrame *frame); //abs
+ void op9fNEG(EngineState *state, EngineFrame *frame); //neg
+
+ void opa0AND(EngineState *state, EngineFrame *frame); //and
+ void opa1OR(EngineState *state, EngineFrame *frame); //or
+ void opa2XOR(EngineState *state, EngineFrame *frame); //xor
+ void opa3NOT(EngineState *state, EngineFrame *frame); //not
+ void opa4LAND(EngineState *state, EngineFrame *frame); //logical and
+ void opa5LOR(EngineState *state, EngineFrame *frame); //logical or
+ void opa6LXOR(EngineState *state, EngineFrame *frame); //logical xor
+ void opa7LNOT(EngineState *state, EngineFrame *frame); //logical not
+ void opa8GTU(EngineState *state, EngineFrame *frame); //gt? unsigned
+ void opa9LTU(EngineState *state, EngineFrame *frame); //lt? unsigned
+ void opaaGTS(EngineState *state, EngineFrame *frame); //gt? signed
+ void opabLTS(EngineState *state, EngineFrame *frame); //lt? signed
+ void opacEQ(EngineState *state, EngineFrame *frame); //eq?
+ void opadEQS(EngineState *state, EngineFrame *frame); //eq string?
+ void opaeCONT(EngineState *state, EngineFrame *frame); //contains
+ void opafCONTW(EngineState *state, EngineFrame *frame); //contains word
+
+ void opb0BRA(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bra
+ void opb1BRAB(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bra.b
+ void opb2BEQ(EngineState *state, EngineFrame *frame, ScriptAsset *script); //beq
+ void opb3BEQB(EngineState *state, EngineFrame *frame, ScriptAsset *script); //beq.b
+ void opb4BNE(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bne
+ void opb5BNEB(EngineState *state, EngineFrame *frame, ScriptAsset *script); //bne.b
+ void opb6CLAT(EngineState *state, EngineFrame *frame); //call later
+ void opb7CCA(EngineState *state, EngineFrame *frame); //cancel call
+ void opb8CLOW(EngineState *state, EngineFrame *frame); //cancel low priority
+ void opb9CHI(EngineState *state, EngineFrame *frame); //cancel high priority
+ void opbaCRAN(EngineState *state, EngineFrame *frame); //cancel priority range
+ bool opbbFORK(EngineState *state, EngineFrame *frame); //fork
+ bool opbcCALL(EngineState *state, EngineFrame *frame, ScriptAsset &script); //call
+ void opbdFOOB(EngineState *state, EngineFrame *frame); //focus object
+ void opbeSWOB(EngineState *state, EngineFrame *frame); //swap objects
+ void opbfSNOB(EngineState *state, EngineFrame *frame); //snap object
+
+ void opc0TEXI(EngineState *state, EngineFrame *frame); //toggle exits
+ void opc1PTXT(EngineState *state, EngineFrame *frame); //print text
+ void opc2PNEW(EngineState *state, EngineFrame *frame); //print newline
+ void opc3PTNE(EngineState *state, EngineFrame *frame); //print text+nl
+ void opc4PNTN(EngineState *state, EngineFrame *frame); //print nl+text+nl
+ void opc5PNUM(EngineState *state, EngineFrame *frame); //print number
+ void opc6P2(EngineState *state, EngineFrame *frame); //push 2
+ void opc7PLBG(EngineState *state, EngineFrame *frame); //play sound in background
+ void opc8PLAW(EngineState *state, EngineFrame *frame); //play sound and wait
+ void opc9WAIT(EngineState *state, EngineFrame *frame); //wait for sound to finish?
+ void opcaTIME(EngineState *state, EngineFrame *frame); //get current time
+ void opcbDAY(EngineState *state, EngineFrame *frame); //get current day
+ void opccCHLD(EngineState *state, EngineFrame *frame); //get children
+ void opcdNCHLD(EngineState *state, EngineFrame *frame); //get num children
+ void opceVERS(EngineState *state, EngineFrame *frame); //get engine version
+ void opcfPSCE(EngineState *state, EngineFrame *frame); //push scenario number
+
+ void opd0P1(EngineState *state, EngineFrame *frame); //push 1
+ void opd1GOBD(EngineState *state, EngineFrame *frame); //get object dimensions
+ void opd2GOVP(EngineState *state, EngineFrame *frame); //get overlap percent
+ void opd3CAPC(EngineState *state, EngineFrame *frame); //capture children
+ void opd4RELC(EngineState *state, EngineFrame *frame); //release children
+ void opd5DLOG(EngineState *state, EngineFrame *frame); //show speech dialog
+ void opd6ACMD(EngineState *state, EngineFrame *frame); //activate command
+ void opd7LOSE(EngineState *state, EngineFrame *frame); //lose game
+ void opd8WIN(EngineState *state, EngineFrame *frame); //win game
+ void opd9SLEEP(EngineState *state, EngineFrame *frame); //sleep
+ void opdaCLICK(EngineState *state, EngineFrame *frame); //click to continue
+ void opdbROBQ(EngineState *state, EngineFrame *frame); //run queue
+ void opdcRSQ(EngineState *state, EngineFrame *frame); //run sound queue
+ void opddRTQ(EngineState *state, EngineFrame *frame); //run text queue
+ void opdeUPSC(EngineState *state, EngineFrame *frame); //update screen
+ void opdfFMAI(EngineState *state, EngineFrame *frame); //flash main window
+
+ void ope0CHGR(EngineState *state, EngineFrame *frame); //cache graphic and object
+ void ope1CHSO(EngineState *state, EngineFrame *frame); //cache sound
+ void ope2MDIV(EngineState *state, EngineFrame *frame); //muldiv
+ void ope3UPOB(EngineState *state, EngineFrame *frame); //update object
+ void ope4PLEV(EngineState *state, EngineFrame *frame); //currently playing event?
+ void ope5WEV(EngineState *state, EngineFrame *frame); //wait for event to finish
+ void ope6GFIB(EngineState *state, EngineFrame *frame); //get fibonacci (joke)
+ void ope7CFIB(EngineState *state, EngineFrame *frame); //calc fibonacci
+
+ void op00NOOP(byte op);
+
+private:
+ MacVentureEngine *_engine;
+ World *_world;
+ Common::List<EngineFrame> _frames;
+ Container *_scripts;
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/sound.cpp b/engines/macventure/sound.cpp
new file mode 100644
index 0000000000..f09612f41a
--- /dev/null
+++ b/engines/macventure/sound.cpp
@@ -0,0 +1,290 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/sound.h"
+
+#include "audio/mixer.h"
+#include "audio/audiostream.h"
+#include "audio/decoders/raw.h"
+
+namespace MacVenture {
+
+// SoundManager
+SoundManager::SoundManager(MacVentureEngine *engine, Audio::Mixer *mixer) {
+ _container = NULL;
+ Common::String filename = engine->getFilePath(kSoundPathID);
+ _container = new Container(filename);
+ _mixer = mixer;
+ debugC(1, kMVDebugSound, "Created sound manager with file %s", filename.c_str());
+}
+
+SoundManager::~SoundManager() {
+ if (_container)
+ delete _container;
+
+ Common::HashMap<ObjID, SoundAsset*>::iterator it;
+ Common::HashMap<ObjID, SoundAsset*>::iterator end = _assets.end();
+ for (it = _assets.begin(); it != end; it++) {
+ delete it->_value;
+ }
+}
+
+uint32 SoundManager::playSound(ObjID sound) {
+ ensureLoaded(sound);
+ _assets[sound]->play(_mixer, &_handle);
+ return _assets[sound]->getPlayLength();
+}
+
+void SoundManager::ensureLoaded(ObjID sound) {
+ if (!_assets.contains(sound))
+ _assets[sound] = new SoundAsset(_container, sound);
+}
+
+SoundAsset::SoundAsset(Container *container, ObjID id) :
+ _container(container), _id(id), _length(0), _frequency(1) {
+ if (_container->getItemByteSize(_id) == 0)
+ warning("Trying to load an empty sound asset (%d).", _id);
+
+ Common::SeekableReadStream *stream = _container->getItem(_id);
+
+ stream->seek(5, SEEK_SET);
+ SoundType type = (SoundType)stream->readByte();
+ debugC(2, kMVDebugSound, "Decoding sound of type %x", type);
+ switch(type) {
+ case kSound10:
+ decode10(stream);
+ break;
+ case kSound12:
+ decode12(stream);
+ break;
+ case kSound18:
+ decode18(stream);
+ break;
+ case kSound1a:
+ decode1a(stream);
+ break;
+ case kSound44:
+ decode44(stream);
+ break;
+ case kSound78:
+ decode78(stream);
+ break;
+ case kSound7e:
+ decode7e(stream);
+ break;
+ default:
+ warning("Unrecognized sound type: %x", type);
+ break;
+ }
+
+ delete stream;
+}
+
+SoundAsset::~SoundAsset() {
+ debugC(3, kMVDebugSound, "~SoundAsset(%d)", _id);
+}
+
+void SoundAsset::play(Audio::Mixer *mixer, Audio::SoundHandle *soundHandle) {
+ if (_data.size() == 0) {
+ return;
+ }
+ Audio::AudioStream *sound = Audio::makeRawStream(&_data.front(), _length, _frequency, Audio::FLAG_UNSIGNED, DisposeAfterUse::NO);
+ mixer->playStream(Audio::Mixer::kPlainSoundType, soundHandle, sound);
+}
+
+uint32 SoundAsset::getPlayLength() {
+ // Transform to milliseconds
+ return _length * 1000 / _frequency;
+}
+
+void SoundAsset::decode10(Common::SeekableReadStream *stream) {
+ warning("Decode sound 0x10 untested");
+ Common::Array<byte> wavtable;
+ stream->seek(0x198, SEEK_SET);
+ for (uint i = 0; i < 16; i++) {
+ wavtable.push_back(stream->readByte());
+ }
+ _length = stream->readUint32BE() * 2;
+ //Unused
+ stream->readUint16BE();
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ byte ch = 0;
+ for (uint i = 0; i < _length; i++) {
+ if (i & 1) {
+ ch >>= 4;
+ } else {
+ ch = stream->readByte();
+ }
+ _data.push_back(wavtable[ch & 0xf]);
+ }
+}
+
+void SoundAsset::decode12(Common::SeekableReadStream *stream) {
+ warning("Decode sound 0x12 untested");
+ stream->seek(0xc, SEEK_SET);
+ uint32 repeat = stream->readUint16BE();
+ stream->seek(0x34, SEEK_SET);
+ uint32 base = stream->readUint16BE() + 0x34;
+ stream->seek(base, SEEK_SET);
+ _length = stream->readUint32BE() - 6;
+ stream->readUint16BE();
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ stream->seek(0xe2, SEEK_SET);
+ // TODO: Possible source of bugs, the original just assigns the seek to the scales
+ uint32 scales = stream->pos() + 0xe2;
+ for (uint i = 0; i < repeat; i++) {
+ stream->seek(scales + i * 2, SEEK_SET);
+ uint32 scale = stream->readUint16BE();
+ stream->seek(base + 0xa, SEEK_SET);
+ for (uint j = 0; j < _length; j++) {
+ byte ch = stream->readByte();
+ if (ch & 0x80) {
+ ch -= 0x80;
+ uint32 env = ch * scale;
+ ch = (env >> 8) & 0xff;
+ if (ch & 0x80) {
+ ch = 0x7f;
+ }
+ ch += 0x80;
+ } else {
+ ch = (ch ^ 0xff) + 1;
+ ch -= 0x80;
+ uint32 env = ch * scale;
+ ch = (env >> 8) & 0xff;
+ if (ch & 0x80) {
+ ch = 0x7f;
+ }
+ ch += 0x80;
+ ch = (ch ^ 0xff) + 1;
+ }
+ _data.push_back(ch);
+ }
+ }
+}
+
+void SoundAsset::decode18(Common::SeekableReadStream *stream) {
+ warning("Decode sound 0x18 untested");
+ Common::Array<byte> wavtable;
+ stream->seek(0x252, SEEK_SET);
+ for (uint i = 0; i < 16; i++) {
+ wavtable.push_back(stream->readByte());
+ }
+ _length = stream->readUint32BE() * 2;
+ //Unused
+ stream->readUint16BE();
+ // TODO: It had `| 0` at the end of this line, possible source of bugs.
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ byte ch = 0;
+ for (uint i = 0; i < _length; i++) {
+ if (i & 1) {
+ ch >>= 4;
+ } else {
+ ch = stream->readByte();
+ }
+ _data.push_back(wavtable[ch & 0xf]);
+ }
+}
+
+void SoundAsset::decode1a(Common::SeekableReadStream *stream) {
+ warning("Decode sound 0x1a untested");
+ Common::Array<byte> wavtable;
+ stream->seek(0x220, SEEK_SET);
+ for (uint i = 0; i < 16; i++) {
+ wavtable.push_back(stream->readByte());
+ }
+ _length = stream->readUint32BE();
+ //Unused
+ stream->readUint16BE();
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ byte ch = 0;
+ for (uint i = 0; i < _length; i++) {
+ if (i & 1) {
+ ch >>= 4;
+ } else {
+ ch = stream->readByte();
+ }
+ _data.push_back(wavtable[ch & 0xf]);
+ }
+}
+
+void SoundAsset::decode44(Common::SeekableReadStream *stream) {
+ stream->seek(0x5e, SEEK_SET);
+ _length = stream->readUint32BE();
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ for (uint i = 0; i < _length; i++) {
+ _data.push_back(stream->readByte());
+ }
+}
+
+void SoundAsset::decode78(Common::SeekableReadStream *stream) {
+ Common::Array<byte> wavtable;
+ stream->seek(0xba, SEEK_SET);
+ for (uint i = 0; i < 16; i++) {
+ wavtable.push_back(stream->readByte());
+ }
+ //Unused
+ stream->readUint32BE();
+ _length = stream->readUint32BE();
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ byte ch = 0;
+ for (uint i = 0; i < _length; i++) {
+ if (i & 1) {
+ ch <<= 4;
+ } else {
+ ch = stream->readByte();
+ }
+ _data.push_back(wavtable[(ch >> 4) & 0xf]);
+ }
+}
+
+void SoundAsset::decode7e(Common::SeekableReadStream *stream) {
+ Common::Array<byte> wavtable;
+ stream->seek(0xc2, SEEK_SET);
+ for (uint i = 0; i < 16; i++) {
+ wavtable.push_back(stream->readByte());
+ }
+ //Unused
+ stream->readUint32BE();
+ _length = stream->readUint32BE();
+ _frequency = (stream->readUint32BE() * 22100 / 0x10000);
+ uint32 last = 0x80;
+ byte ch = 0;
+ for (uint i = 0; i < _length; i++) {
+ if (i & 1) {
+ ch <<= 4;
+ } else {
+ ch = stream->readByte();
+ }
+ last += wavtable[(ch >> 4) & 0xf];
+ _data.push_back(last & 0xff);
+ }
+}
+
+} //End of namespace MacVenture
diff --git a/engines/macventure/sound.h b/engines/macventure/sound.h
new file mode 100644
index 0000000000..3bd25d99e1
--- /dev/null
+++ b/engines/macventure/sound.h
@@ -0,0 +1,103 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_SOUND_H
+#define MACVENTURE_SOUND_H
+
+#include "macventure/macventure.h"
+#include "macventure/container.h"
+
+#include "common/file.h"
+#include "common/hashmap.h"
+
+#include "audio/mixer.h"
+
+namespace MacVenture {
+
+enum SoundType {
+ kSound10 = 0x10,
+ kSound12 = 0x12,
+ kSound18 = 0x18,
+ kSound1a = 0x1a,
+ kSound44 = 0x44,
+ kSound78 = 0x78,
+ kSound7e = 0x7e
+};
+
+class SoundAsset {
+
+public:
+ SoundAsset(Container *container, ObjID id);
+ ~SoundAsset();
+
+ void play(Audio::Mixer *mixer, Audio::SoundHandle *soundHandle);
+ uint32 getPlayLength();
+
+private:
+
+ void decode10(Common::SeekableReadStream *stream);
+ void decode12(Common::SeekableReadStream *stream);
+ void decode18(Common::SeekableReadStream *stream);
+ void decode1a(Common::SeekableReadStream *stream);
+ void decode44(Common::SeekableReadStream *stream);
+ void decode78(Common::SeekableReadStream *stream);
+ void decode7e(Common::SeekableReadStream *stream);
+
+private:
+
+ Container *_container;
+ ObjID _id;
+
+ Common::Array<byte> _data;
+ uint32 _length;
+ uint32 _frequency;
+};
+
+class SoundManager {
+public:
+ SoundManager(MacVentureEngine *engine, Audio::Mixer *mixer);
+ ~SoundManager();
+
+ uint32 playSound(ObjID sound);
+
+private:
+ void ensureLoaded(ObjID sound);
+
+private:
+
+ Container *_container;
+ Common::HashMap<ObjID, SoundAsset*> _assets;
+ Audio::SoundHandle _handle;
+ Audio::Mixer *_mixer;
+
+};
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/stringtable.h b/engines/macventure/stringtable.h
new file mode 100644
index 0000000000..4cd400fbc3
--- /dev/null
+++ b/engines/macventure/stringtable.h
@@ -0,0 +1,117 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_STRINGTABLE_H
+#define MACVENTURE_STRINGTABLE_H
+
+#include "macventure/macventure.h"
+
+#include "common/file.h"
+
+namespace MacVenture {
+
+extern void toASCII(Common::String &str);
+
+enum StringTableID {
+ kErrorStringTableID = 0x80,
+ kFilenamesStringTableID = 0x81,
+ kCommonArticlesStringTableID = 0x82,
+ kNamingArticlesStringTableID = 0x83,
+ kIndirectArticlesStringTableID = 0x84
+};
+
+class StringTable {
+public:
+ StringTable(MacVentureEngine *engine, Common::MacResManager *resMan, StringTableID id) {
+ _engine = engine;
+ _resourceManager = resMan;
+ _id = id;
+
+ if (!loadStrings())
+ error("ENGINE: Could not load string table %x", id);
+ }
+
+ ~StringTable() {
+
+ }
+
+ const Common::Array<Common::String> &getStrings() {
+ return _strings;
+ }
+
+ Common::String getString(uint ndx) {
+ assert(ndx < _strings.size());
+ return _strings[ndx];
+ }
+
+private:
+
+ bool loadStrings() {
+ Common::MacResIDArray resArray;
+ Common::SeekableReadStream *res;
+
+ if ((resArray = _resourceManager->getResIDArray(MKTAG('S', 'T', 'R', '#'))).size() == 0)
+ return false;
+
+ res = _resourceManager->getResource(MKTAG('S', 'T', 'R', '#'), _id);
+
+ _strings.push_back("dummy"); // String tables are 1-indexed
+ uint16 numStrings = res->readUint16BE();
+ uint8 strLength = 0;
+ for (uint i = 0; i < numStrings; ++i) {
+ strLength = res->readByte();
+ char *str = new char[strLength + 1];
+ res->read(str, strLength);
+ str[strLength] = '\0';
+ // HACK until a proper special char implementation is found, this will have to do.
+ Common::String result = Common::String(str);
+ toASCII(result);
+ debugC(4, kMVDebugText, "Loaded string %s", str);
+ _strings.push_back(Common::String(result));
+ delete[] str;
+ }
+
+ delete res;
+ return true;
+ }
+
+private:
+
+ MacVentureEngine *_engine;
+ Common::MacResManager *_resourceManager;
+
+ StringTableID _id;
+
+ Common::Array<Common::String> _strings;
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/text.cpp b/engines/macventure/text.cpp
new file mode 100644
index 0000000000..b4d67a1306
--- /dev/null
+++ b/engines/macventure/text.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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/text.h"
+
+namespace MacVenture {
+TextAsset::TextAsset(MacVentureEngine *engine, ObjID objid, ObjID source, ObjID target, Container *container, bool isOld, const HuffmanLists *huffman) {
+ _id = objid;
+ _sourceObj = source;
+ _targetObj = target;
+ _container = container;
+ _huffman = huffman;
+ _isOld = isOld;
+ _engine = engine;
+
+ if (_isOld) {
+ decodeOld();
+ } else {
+ decodeHuffman();
+ }
+}
+
+void TextAsset::decodeOld() {
+ Common::SeekableReadStream *res = _container->getItem(_id);
+ uint16 strLen = res->readUint16BE();
+ Common::BitStream32BELSB stream(res, true);
+ char *str = new char[strLen + 1];
+ bool lowercase = false;
+ char c;
+ for (uint16 i = 0; i < strLen; i++) {
+ char val = stream.getBits(5);
+ if (val == 0x0) { // Space
+ c = ' ';
+ } else if (val >= 0x1 && val <= 0x1A) {
+ if (lowercase) { // Ascii a-z
+ c = val + 0x60;
+ } else { // Ascii A-Z
+ c = val + 0x40;
+ }
+ lowercase = true;
+ } else if (val == 0x1B) {
+ if (lowercase) {
+ c = '.';
+ } else {
+ c = ',';
+ }
+ lowercase = true;
+ } else if (val == 0x1C) {
+ if (lowercase) {
+ c = '\'';
+ } else {
+ c = '"';
+ }
+ lowercase = true;
+ } else if (val == 0x1D) { // Composite
+ ObjID subval = stream.getBits(16);
+ Common::String child;
+ if (subval & 0x8000) {
+ // Composite object id
+ subval ^= 0xFFFF;
+ child = getNoun(subval);
+ } else {
+ // Just another id
+ // HACK, see below in getNoun()
+ child = *TextAsset(_engine, subval, _sourceObj, _targetObj, _container, _isOld, _huffman).decode();
+ }
+ if (child.size() > 0) {
+ c = '?'; // HACK Will fix later, should append
+ }
+ lowercase = true;
+ } else if (val == 0x1E) {
+ c = stream.getBits(8);
+ lowercase = true;
+ } else if (val == 0x1F) {
+ lowercase = !lowercase;
+ } else {
+ warning("Unrecognized char in old text %d, pos %d", _id, i);
+ }
+ str[i] = c;
+ }
+
+ str[strLen] = '\0';
+ debugC(3, kMVDebugText, "Decoded string [%d] (old encoding): %s", _id, str);
+ _decoded = Common::String(str);
+}
+
+void TextAsset::decodeHuffman() {
+ _decoded = Common::String("");
+ Common::SeekableReadStream *res = _container->getItem(_id);
+ Common::BitStream8MSB stream(res, true);
+ uint16 strLen = 0;
+ if (stream.getBit()) {
+ strLen = stream.getBits(15);
+ } else {
+ strLen = stream.getBits(7);
+ }
+ uint32 mask = 0;
+ uint32 symbol = 0;
+ char c;
+ for (uint16 i = 0; i < strLen; i++) {
+ mask = stream.peekBits(16);
+
+ uint32 entry;
+ // Find the length index
+ for (entry = 0; entry < _huffman->getNumEntries(); entry++) {
+ if (mask < _huffman->getMask(entry)) {
+ break;
+ }
+ }
+
+ stream.skip(_huffman->getLength(entry));
+
+ symbol = _huffman->getSymbol(entry);
+
+ if (symbol == 1) { // 7-bit ascii
+ c = stream.getBits(7);
+ _decoded += c;
+ } else if (symbol == 2) { // Composite
+ if (stream.getBit()) { // TextID
+ ObjID embedId = stream.getBits(15);
+ uint pos = stream.pos(); // HACK, part 1
+ TextAsset embedded(_engine, embedId, _sourceObj, _targetObj, _container, _isOld, _huffman);
+ stream.rewind();// HACK, part 2
+ stream.skip(pos);
+
+ _decoded.replace(_decoded.end(), _decoded.end(), *embedded.decode());
+
+ // Another HACK, to get around that EOS char I insert at the end
+ _decoded.replace(_decoded.end() - 1, _decoded.end(), "");
+ } else { //Composite obj string
+ ObjID embedId = stream.getBits(8);
+ uint pos = stream.pos(); // HACK, part 1
+
+ _decoded.replace(_decoded.end(), _decoded.end(), getNoun(embedId));
+ stream.rewind();// HACK, part 2
+ stream.skip(pos);
+
+ // Another HACK, to get around that EOS char I insert at the end
+ _decoded.replace(_decoded.end() - 1, _decoded.end(), "");
+ }
+ } else { // Plain ascii
+ c = symbol & 0xFF;
+ _decoded.replace(_decoded.end(), _decoded.end(), Common::String(c));
+ }
+ }
+ _decoded += '\0';
+ debugC(3, kMVDebugText, "Decoded string [%d] (new encoding): %s", _id, _decoded.c_str());
+}
+Common::String TextAsset::getNoun(ObjID subval) {
+ ObjID obj;
+ Common::String name;
+ if (subval & 8) {
+ obj = _targetObj;
+ } else {
+ obj = _sourceObj;
+ }
+ if ((subval & 3) == 1) {
+ uint idx = _engine->getPrefixNdx(obj);
+ idx = ((idx >> 4) & 3) + 1;
+ name = _engine->getNoun(idx);
+ } else {
+ // HACK, there should be a pool of assets or something like in the GUI
+ name = *TextAsset(_engine, obj, _sourceObj, _targetObj, _container, _isOld, _huffman).decode();
+ switch (subval & 3) {
+ case 2:
+ name = _engine->getPrefixString(0, obj) + name;
+ break;
+ case 3:
+ name = _engine->getPrefixString(2, obj) + name;
+ break;
+ }
+ }
+ if (name.size() && (subval & 4)) {
+ Common::String tmp = name;
+ name.toUppercase();
+ name.replace(1, name.size() - 1, tmp, 1, tmp.size() - 1);
+ }
+
+ return name;
+}
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/text.h b/engines/macventure/text.h
new file mode 100644
index 0000000000..62c43cd8ef
--- /dev/null
+++ b/engines/macventure/text.h
@@ -0,0 +1,72 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_TEXT_H
+#define MACVENTURE_TEXT_H
+
+#include "macventure/macventure.h"
+#include "macventure/hufflists.h"
+
+namespace MacVenture {
+typedef uint32 ObjID;
+class MacVentureEngine;
+
+class TextAsset {
+public:
+ TextAsset(MacVentureEngine *engine, ObjID objid, ObjID source, ObjID target, Container *container, bool isOld, const HuffmanLists *huffman);
+ ~TextAsset() {}
+
+ const Common::String *decode() {
+ return &_decoded;
+ }
+
+private:
+ void decodeOld();
+ void decodeHuffman();
+
+ Common::String getNoun(ObjID id);
+
+private:
+ MacVentureEngine *_engine;
+
+ Container *_container;
+ ObjID _id;
+ ObjID _targetObj;
+ ObjID _sourceObj;
+ const HuffmanLists *_huffman;
+ bool _isOld;
+
+ Common::String _decoded;
+
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/macventure/windows.cpp b/engines/macventure/windows.cpp
new file mode 100644
index 0000000000..555da5b78d
--- /dev/null
+++ b/engines/macventure/windows.cpp
@@ -0,0 +1,69 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/windows.h"
+
+namespace MacVenture {
+
+BorderBounds borderBounds(MVWindowType type) {
+ switch (type) {
+ case MacVenture::kDocument:
+ break;
+ case MacVenture::kDBox:
+ break;
+ case MacVenture::kPlainDBox:
+ return BorderBounds(3, 3, 3, 3);
+ case MacVenture::kAltBox:
+ return BorderBounds(0, 0, 0, 0); // Hand-tested
+ case MacVenture::kNoGrowDoc:
+ return BorderBounds(1, 20, 1, 1);
+ case MacVenture::kMovableDBox:
+ break;
+ case MacVenture::kZoomDoc:
+ return BorderBounds(1, 20, 17, 1);
+ case MacVenture::kZoomNoGrow:
+ break;
+ case MacVenture::kInvWindow:
+ return BorderBounds(1, 20, 17, 17);
+ case MacVenture::kRDoc16:
+ break;
+ case MacVenture::kRDoc4:
+ return BorderBounds(1, 20, 1, 1);
+ case MacVenture::kRDoc6:
+ break;
+ case MacVenture::kRDoc10:
+ break;
+ default:
+ break;
+ }
+
+ return BorderBounds(0, 0, 0, 0);
+}
+} // End of namespace MacVenture
diff --git a/engines/macventure/windows.h b/engines/macventure/windows.h
new file mode 100644
index 0000000000..b43fcc00ee
--- /dev/null
+++ b/engines/macventure/windows.h
@@ -0,0 +1,107 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_WINDOWS_H
+#define MACVENTURE_WINDOWS_H
+
+#include "common/rect.h"
+#include "common/array.h"
+
+namespace MacVenture {
+// massive HACK
+typedef uint32 ObjID;
+
+enum WindowReference {
+ kNoWindow = 0,
+ kInventoryStart = 1,
+ kCommandsWindow = 0x80,
+ kMainGameWindow = 0x81,
+ kOutConsoleWindow = 0x82,
+ kSelfWindow = 0x83,
+ kExitsWindow = 0x84,
+ kDiplomaWindow = 0x85
+};
+
+enum MVWindowType {
+ kDocument = 0x00,
+ kDBox = 0x01,
+ kPlainDBox = 0x02,
+ kAltBox = 0x03,
+ kNoGrowDoc = 0x04,
+ kMovableDBox = 0x05,
+ kZoomDoc = 0x08,
+ kZoomNoGrow = 0x0c,
+ // WebVenture assigns arbitrary kinds post-loading
+ kInvWindow = 0x0e,
+ kRDoc16 = 0x10,
+ kRDoc4 = 0x12,
+ kRDoc6 = 0x14,
+ kRDoc10 = 0x16,
+ kNoType = 0xFF
+};
+
+struct DrawableObject {
+ ObjID obj;
+ byte mode;
+ DrawableObject(ObjID id, byte md) {
+ obj = id;
+ mode = md;
+ }
+};
+
+enum {
+ kScrollAmount = 10
+};
+
+struct WindowData {
+ Common::Rect bounds;
+ MVWindowType type;
+ ObjID objRef;
+ uint16 visible;
+ uint16 hasCloseBox;
+ WindowReference refcon;
+ uint8 titleLength;
+ Common::String title;
+ Common::Array<DrawableObject> children;
+ bool updateScroll;
+ Common::Point scrollPos;
+};
+
+struct BorderBounds {
+ uint16 leftOffset;
+ uint16 topOffset;
+ uint16 rightOffset;
+ uint16 bottomOffset;
+
+ BorderBounds(uint16 l, uint16 t, uint16 r, uint16 b) :
+ leftOffset(l), topOffset(t), rightOffset(r), bottomOffset(b) {}
+};
+}
+#endif
diff --git a/engines/macventure/world.cpp b/engines/macventure/world.cpp
new file mode 100644
index 0000000000..23483cb642
--- /dev/null
+++ b/engines/macventure/world.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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#include "macventure/world.h"
+#include "macventure/macventure.h"
+
+#include "common/file.h"
+
+namespace MacVenture {
+
+World::World(MacVentureEngine *engine, Common::MacResManager *resMan) {
+ _resourceManager = resMan;
+ _engine = engine;
+ _saveGame = NULL;
+ _gameText = NULL;
+
+ startNewGame();
+
+ _objectConstants = new Container(_engine->getFilePath(kObjectPathID));
+ calculateObjectRelations();
+
+ _gameText = new Container(_engine->getFilePath(kTextPathID));
+}
+
+
+World::~World() {
+
+ if (_saveGame)
+ delete _saveGame;
+
+ if (_objectConstants)
+ delete _objectConstants;
+
+ if (_gameText)
+ delete _gameText;
+}
+
+void World::startNewGame() {
+ if (_saveGame)
+ delete _saveGame;
+
+ if ((_startGameFileName = _engine->getStartGameFileName()) == "")
+ error("WORLD: Could not load initial game configuration");
+
+ Common::File saveGameFile;
+ if (!saveGameFile.open(_startGameFileName))
+ error("WORLD: Could not load initial game configuration");
+
+ debugC(2, kMVDebugMain, "Loading save game state from %s", _startGameFileName.c_str());
+ Common::SeekableReadStream *saveGameRes = saveGameFile.readStream(saveGameFile.size());
+
+ _saveGame = new SaveGame(_engine, saveGameRes);
+
+ calculateObjectRelations();
+
+ delete saveGameRes;
+ saveGameFile.close();
+}
+
+uint32 World::getObjAttr(ObjID objID, uint32 attrID) {
+ uint res;
+ uint32 index = _engine->getGlobalSettings()._attrIndices[attrID];
+ // HACK, but if I try to initialize it in the else clause, it goes out of scope and segfaults
+ Common::SeekableReadStream *objStream = _objectConstants->getItem(objID);
+ if (!(index & 0x80)) { // It's not a constant
+ res = _saveGame->getAttr(objID, index);
+ } else {
+ index &= 0x7F;
+ if (objStream->size() == 0) {
+ return 0;
+ }
+ // Look for the right attribute inside the object
+ objStream->skip(index * 2);
+ res = objStream->readByte() << 8;
+ res |= objStream->readByte();
+ }
+ res &= _engine->getGlobalSettings()._attrMasks[attrID];
+ res >>= _engine->getGlobalSettings()._attrShifts[attrID];
+ if (res & 0x8000)
+ res = -((res ^ 0xffff) + 1);
+ debugC(5, kMVDebugMain, "Attribute %x from object %x is %x", attrID, objID, res);
+ delete objStream;
+ return res;
+}
+
+void World::setObjAttr(ObjID objID, uint32 attrID, Attribute value) {
+ if (attrID == kAttrPosX || attrID == kAttrPosY) {
+ // Round to scale
+ // Intentionally empty, we don't seem to require this functionality
+ }
+
+ if (attrID == kAttrParentObject)
+ setParent(objID, value);
+
+ if (attrID < kAttrOtherDoor)
+ _engine->enqueueObject(kUpdateObject, objID);
+
+ uint32 idx = _engine->getGlobalSettings()._attrIndices[attrID];
+ value <<= _engine->getGlobalSettings()._attrShifts[attrID];
+ value &= _engine->getGlobalSettings()._attrMasks[attrID];
+ Attribute oldVal = _saveGame->getAttr(objID, idx);
+ oldVal &= ~_engine->getGlobalSettings()._attrMasks[attrID];
+ _saveGame->setAttr(idx, objID, (value | oldVal));
+ _engine->gameChanged();
+}
+
+bool MacVenture::World::isObjActive(ObjID obj) {
+ ObjID destObj = _engine->getDestObject();
+ Common::Point p = _engine->getDeltaPoint();
+ ControlAction selectedControl = _engine->getSelectedControl();
+ if (!getAncestor(obj)) {
+ return false; // If our ancestor is the garbage (obj 0), we're inactive
+ }
+ if (_engine->getInvolvedObjects() >= 2 && // If (we need > 1 objs for the command) &&
+ destObj > 0 && // we have a destination object &&
+ !getAncestor(destObj)) { // but that destination object is in the garbage
+ return false;
+ }
+ if (selectedControl != kMoveObject) {
+ return true; // We only need one
+ }
+ // Handle move object
+ if (!isObjDraggable(obj)) {
+ return false; // We can't move it
+ }
+ if (getObjAttr(1, kAttrParentObject) != destObj) {
+ return true; // if the target is not the player's parent, we can go
+ }
+ Common::Rect rect(kScreenWidth, kScreenHeight);
+ rect.top -= getObjAttr(obj, kAttrPosY) + p.y;
+ rect.left -= getObjAttr(obj, kAttrPosX) + p.x;
+ return intersects(obj, rect);
+}
+
+ObjID World::getAncestor(ObjID objID) {
+ ObjID root = getObjAttr(1, kAttrParentObject);
+ while (objID != 0 && objID != 1 && objID != root) {
+ objID = getObjAttr(objID, kAttrParentObject);
+ }
+ return objID;
+}
+
+Common::Array<ObjID> World::getFamily(ObjID objID, bool recursive) {
+ Common::Array<ObjID> res;
+ res.push_back(objID);
+ res.push_back(getChildren(objID, recursive));
+ return res;
+}
+
+Common::Array<ObjID> World::getChildren(ObjID objID, bool recursive) {
+ Common::Array<ObjID> res;
+ ObjID child = _relations[objID * 2];
+ while (child) {
+ res.push_back(child);
+ if (!recursive)
+ res.push_back(getChildren(child, false));
+ child = _relations[child * 2 + 1];
+ }
+ return res;
+}
+
+Attribute World::getGlobal(uint32 attrID) {
+ return _saveGame->getGlobals()[attrID];
+}
+
+void World::setGlobal(uint32 attrID, Attribute value) {
+ _saveGame->setGlobal(attrID, value);
+}
+
+void World::updateObj(ObjID objID) {
+ WindowReference win;
+ if (getObjAttr(1, kAttrParentObject) == objID) {
+ win = kMainGameWindow;
+ } else {
+ win = _engine->getObjWindow(objID);
+ }
+ if (win) {
+ _engine->focusObjWin(objID);
+ _engine->runObjQueue();
+ _engine->updateWindow(win);
+ }
+}
+
+void World::captureChildren(ObjID objID) {
+ warning("Capture children unimplemented!");
+}
+
+void World::releaseChildren(ObjID objID) {
+ warning("Release children unimplemented!");
+}
+
+Common::String World::getText(ObjID objID, ObjID source, ObjID target) {
+ if (objID & 0x8000) {
+ return _engine->getUserInput();
+ }
+ TextAsset text = TextAsset(_engine, objID, source, target, _gameText, _engine->isOldText(), _engine->getDecodingHuffman());
+
+ return *text.decode();
+}
+
+
+bool World::isObjDraggable(ObjID objID) {
+ return (getObjAttr(objID, kAttrInvisible) == 0 &&
+ getObjAttr(objID, kAttrUnclickable) == 0 &&
+ getObjAttr(objID, kAttrUndraggable) == 0);
+}
+
+bool World::intersects(ObjID objID, Common::Rect rect) {
+ return _engine->getObjBounds(objID).intersects(rect);
+}
+
+void World::calculateObjectRelations() {
+ _relations.clear();
+ ObjID val, next;
+ uint32 numObjs = _engine->getGlobalSettings()._numObjects;
+ const AttributeGroup &parents = *_saveGame->getGroup(0);
+ for (uint i = 0; i < numObjs * 2; i++) {
+ _relations.push_back(0);
+ }
+ for (uint i = numObjs - 1; i > 0; i--) {
+ val = parents[i];
+ next = _relations[val * 2];
+ if (next) {
+ _relations[i * 2 + 1] = next;
+ }
+ _relations[val * 2] = i;
+ }
+}
+
+void World::setParent(ObjID child, ObjID newParent) {
+ ObjID old = _saveGame->getAttr(child, kAttrParentObject);
+ if (newParent == child)
+ return;
+
+ ObjID oldNdx = old * 2;
+ old = _relations[oldNdx];
+ while (old != child) {
+ oldNdx = (old * 2) + 1;
+ old = _relations[oldNdx];
+ }
+ _relations[oldNdx] = _relations[(old * 2) + 1];
+ oldNdx = newParent * 2;
+ old = _relations[oldNdx];
+ while (old && old <= child) {
+ oldNdx = (old * 2) + 1;
+ old = _relations[oldNdx];
+ }
+ _relations[child * 2 + 1] = old;
+ _relations[oldNdx] = child;
+}
+
+void World::loadGameFrom(Common::InSaveFile *file) {
+ if (_saveGame) {
+ delete _saveGame;
+ }
+ _saveGame = new SaveGame(_engine, file);
+ calculateObjectRelations();
+}
+
+void World::saveGameInto(Common::OutSaveFile *file) {
+ _saveGame->saveInto(file);
+}
+
+// SaveGame
+SaveGame::SaveGame(MacVentureEngine *engine, Common::SeekableReadStream *res) {
+ _groups = Common::Array<AttributeGroup>();
+ loadGroups(engine, res);
+ _globals = Common::Array<uint16>();
+ loadGlobals(engine, res);
+ _text = Common::String();
+ loadText(engine, res);
+}
+
+SaveGame::~SaveGame() {
+}
+
+
+Attribute SaveGame::getAttr(ObjID objID, uint32 attrID) {
+ return _groups[attrID][objID];
+}
+
+void SaveGame::setAttr(uint32 attrID, ObjID objID, Attribute value) {
+ _groups[attrID][objID] = value;
+}
+
+const Common::Array<AttributeGroup> &MacVenture::SaveGame::getGroups() {
+ return _groups;
+}
+
+const AttributeGroup *SaveGame::getGroup(uint32 groupID) {
+ assert(groupID < _groups.size());
+ return &(_groups[groupID]);
+}
+
+void SaveGame::setGlobal(uint32 attrID, Attribute value) {
+ _globals[attrID] = value;
+}
+
+const Common::Array<uint16> &SaveGame::getGlobals() {
+ return _globals;
+}
+
+const Common::String &SaveGame::getText() {
+ return _text;
+}
+
+void SaveGame::saveInto(Common::OutSaveFile *file) {
+ warning("Saving the game not yet tested!");
+ // Save attibutes
+ Common::Array<AttributeGroup>::const_iterator itg;
+ for (itg = _groups.begin(); itg != _groups.end(); itg++) {
+ Common::Array<Attribute>::const_iterator ita;
+ for (ita = itg->begin(); ita != itg->end(); ita++) {
+ file->writeUint16BE((*ita));
+ }
+ }
+ // Save globals
+ Common::Array<uint16>::const_iterator global;
+ for (global = _globals.begin(); global != _globals.end(); global++) {
+ file->writeUint16BE((*global));
+ }
+ // Save text
+ // TODO: Insert text from GUI console
+ _text = "Hello";
+ file->write(_text.c_str(), _text.size());
+}
+
+void SaveGame::loadGroups(MacVentureEngine *engine, Common::SeekableReadStream *res) {
+ GlobalSettings settings = engine->getGlobalSettings();
+ for (int i = 0; i < settings._numGroups; ++i) {
+ AttributeGroup g;
+ for (int j = 0; j < settings._numObjects; ++j) {
+ g.push_back(res->readUint16BE());
+ }
+
+ _groups.push_back(g);
+ }
+}
+
+void SaveGame::loadGlobals(MacVentureEngine *engine, Common::SeekableReadStream *res) {
+ GlobalSettings settings = engine->getGlobalSettings();
+ for (int i = 0; i < settings._numGlobals; ++i) {
+ _globals.push_back(res->readUint16BE());
+ }
+}
+
+void SaveGame::loadText(MacVentureEngine *engine, Common::SeekableReadStream *res) {
+ // TODO: Load console text. For now, the GUI doesn't even look at this.
+ _text = "Placeholder Console Text";
+}
+
+
+} // End of namespace MacVenture
diff --git a/engines/macventure/world.h b/engines/macventure/world.h
new file mode 100644
index 0000000000..92309104cf
--- /dev/null
+++ b/engines/macventure/world.h
@@ -0,0 +1,147 @@
+/* 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.
+ *
+ */
+
+/*
+ * Based on
+ * WebVenture (c) 2010, Sean Kasun
+ * https://github.com/mrkite/webventure, http://seancode.com/webventure/
+ *
+ * Used with explicit permission from the author
+ */
+
+#ifndef MACVENTURE_WORLD_H
+#define MACVENTURE_WORLD_H
+
+#include "macventure/container.h"
+#include "macventure/text.h"
+
+namespace MacVenture {
+
+typedef uint32 ObjID;
+typedef uint16 Attribute;
+typedef Common::Array<Attribute> AttributeGroup;
+class TextAsset;
+
+enum ObjectAttributeID {
+ kAttrParentObject = 0,
+ kAttrPosX = 1,
+ kAttrPosY = 2,
+ kAttrInvisible = 3,
+ kAttrUnclickable = 4,
+ kAttrUndraggable = 5,
+ kAttrContainerOpen = 6,
+ kAttrPrefixes = 7,
+ kAttrIsExit = 8,
+ kAttrExitX = 9,
+ kAttrExitY = 10,
+ kAttrHiddenExit = 11,
+ kAttrOtherDoor = 12,
+ kAttrIsOpen = 13,
+ kAttrIsLocked = 14,
+ kAttrWeight = 16,
+ kAttrSize = 17,
+ kAttrHasDescription = 19,
+ kAttrIsDoor = 20,
+ kAttrIsContainer = 22,
+ kAttrIsOperable = 23,
+ kAttrIsEnterable = 24,
+ kAttrIsEdible = 25
+};
+
+class SaveGame {
+public:
+ SaveGame(MacVentureEngine *engine, Common::SeekableReadStream *res);
+ ~SaveGame();
+
+ Attribute getAttr(ObjID objID, uint32 attrID);
+ void setAttr(uint32 attrID, ObjID objID, Attribute value);
+
+ void setGlobal(uint32 attrID, Attribute value);
+ const Common::Array<uint16> &getGlobals();
+
+ const Common::Array<AttributeGroup> &getGroups();
+ const AttributeGroup *getGroup(uint32 groupID);
+ const Common::String &getText();
+
+ void saveInto(Common::OutSaveFile *file);
+
+private:
+ void loadGroups(MacVentureEngine *engine, Common::SeekableReadStream *res);
+ void loadGlobals(MacVentureEngine *engine, Common::SeekableReadStream *res);
+ void loadText(MacVentureEngine *engine, Common::SeekableReadStream *res);
+
+private:
+ Common::Array<AttributeGroup> _groups;
+ Common::Array<uint16> _globals;
+ Common::String _text;
+};
+
+class World {
+public:
+ World(MacVentureEngine *engine, Common::MacResManager *resMan);
+ ~World();
+
+ void startNewGame();
+
+ void setObjAttr(ObjID objID, uint32 attrID, Attribute value);
+ void setGlobal(uint32 attrID, Attribute value);
+ void updateObj(ObjID objID);
+ void captureChildren(ObjID objID);
+ void releaseChildren(ObjID objID);
+
+ uint32 getObjAttr(ObjID objID, uint32 attrID);
+ Attribute getGlobal(uint32 attrID);
+ Common::String getText(ObjID objID, ObjID source, ObjID target);
+
+ bool isObjActive(ObjID objID);
+
+ ObjID getAncestor(ObjID objID);
+ Common::Array<ObjID> getFamily(ObjID objID, bool recursive);
+ Common::Array<ObjID> getChildren(ObjID objID, bool recursive);
+
+ void loadGameFrom(Common::InSaveFile *file);
+ void saveGameInto(Common::OutSaveFile *file);
+
+private:
+ bool isObjDraggable(ObjID objID);
+ bool intersects(ObjID objID, Common::Rect rect);
+
+ void calculateObjectRelations();
+ void setParent(ObjID child, ObjID newParent);
+
+private:
+ MacVentureEngine *_engine;
+ Common::MacResManager *_resourceManager;
+
+ Common::String _startGameFileName;
+
+ SaveGame *_saveGame;
+
+ Container *_objectConstants;
+ Container *_gameText;
+
+ Common::Array<ObjID> _relations; // Parent-child relations, stored in Williams Heap format
+};
+
+} // End of namespace MacVenture
+
+#endif
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.cpp b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp
index bb7cafec41..ff85e9b22c 100644
--- a/engines/mads/dragonsphere/dragonsphere_scenes1.cpp
+++ b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.h b/engines/mads/dragonsphere/dragonsphere_scenes1.h
index fe51ed4135..e9f71328aa 100644
--- a/engines/mads/dragonsphere/dragonsphere_scenes1.h
+++ b/engines/mads/dragonsphere/dragonsphere_scenes1.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/dragonsphere/globals_dragonsphere.cpp b/engines/mads/dragonsphere/globals_dragonsphere.cpp
index fa05ed97c2..63319d7223 100644
--- a/engines/mads/dragonsphere/globals_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/globals_dragonsphere.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/dragonsphere/globals_dragonsphere.h b/engines/mads/dragonsphere/globals_dragonsphere.h
index cc0e42eb43..03ab24065e 100644
--- a/engines/mads/dragonsphere/globals_dragonsphere.h
+++ b/engines/mads/dragonsphere/globals_dragonsphere.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp
index 9050ca6081..cb97c32d75 100644
--- a/engines/mads/menu_views.cpp
+++ b/engines/mads/menu_views.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
#include "mads/game.h"
@@ -800,7 +800,7 @@ int AnimationView::getParameter() {
void AnimationView::checkResource(const Common::String &resourceName) {
//bool hasSuffix = false;
-
+
}
int AnimationView::scanResourceIndex(const Common::String &resourceName) {
diff --git a/engines/mads/phantom/globals_phantom.cpp b/engines/mads/phantom/globals_phantom.cpp
index eea84762fe..feb3dfff0c 100644
--- a/engines/mads/phantom/globals_phantom.cpp
+++ b/engines/mads/phantom/globals_phantom.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/globals_phantom.h b/engines/mads/phantom/globals_phantom.h
index f120df3c47..2ce2cd4024 100644
--- a/engines/mads/phantom/globals_phantom.h
+++ b/engines/mads/phantom/globals_phantom.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes1.cpp b/engines/mads/phantom/phantom_scenes1.cpp
index be800cf3b3..91f75558db 100644
--- a/engines/mads/phantom/phantom_scenes1.cpp
+++ b/engines/mads/phantom/phantom_scenes1.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes1.h b/engines/mads/phantom/phantom_scenes1.h
index cadfcefbef..d2c679d4ed 100644
--- a/engines/mads/phantom/phantom_scenes1.h
+++ b/engines/mads/phantom/phantom_scenes1.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes2.cpp b/engines/mads/phantom/phantom_scenes2.cpp
index 8789553962..d2e9ee09c6 100644
--- a/engines/mads/phantom/phantom_scenes2.cpp
+++ b/engines/mads/phantom/phantom_scenes2.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes2.h b/engines/mads/phantom/phantom_scenes2.h
index 7e86e2ce0f..d0b83b6c7a 100644
--- a/engines/mads/phantom/phantom_scenes2.h
+++ b/engines/mads/phantom/phantom_scenes2.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes3.cpp b/engines/mads/phantom/phantom_scenes3.cpp
index 9fd15d3552..9d1348e7d9 100644
--- a/engines/mads/phantom/phantom_scenes3.cpp
+++ b/engines/mads/phantom/phantom_scenes3.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes3.h b/engines/mads/phantom/phantom_scenes3.h
index 9f58ad12bf..87b7681a79 100644
--- a/engines/mads/phantom/phantom_scenes3.h
+++ b/engines/mads/phantom/phantom_scenes3.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes4.cpp b/engines/mads/phantom/phantom_scenes4.cpp
index da6d62e727..ebb3e85e05 100644
--- a/engines/mads/phantom/phantom_scenes4.cpp
+++ b/engines/mads/phantom/phantom_scenes4.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes4.h b/engines/mads/phantom/phantom_scenes4.h
index 5aece98cd6..bea1411600 100644
--- a/engines/mads/phantom/phantom_scenes4.h
+++ b/engines/mads/phantom/phantom_scenes4.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes5.cpp b/engines/mads/phantom/phantom_scenes5.cpp
index 12d064becb..03375c98d3 100644
--- a/engines/mads/phantom/phantom_scenes5.cpp
+++ b/engines/mads/phantom/phantom_scenes5.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/phantom/phantom_scenes5.h b/engines/mads/phantom/phantom_scenes5.h
index 33478304f3..048e9b9aab 100644
--- a/engines/mads/phantom/phantom_scenes5.h
+++ b/engines/mads/phantom/phantom_scenes5.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index 21fd4f9026..d6de28e93d 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/mads/scene_data.h b/engines/mads/scene_data.h
index a28c42c5ab..2b08357d32 100644
--- a/engines/mads/scene_data.h
+++ b/engines/mads/scene_data.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_action.cpp b/engines/pegasus/ai/ai_action.cpp
index 38d639038f..61e2dba3d8 100644
--- a/engines/pegasus/ai/ai_action.cpp
+++ b/engines/pegasus/ai/ai_action.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_action.h b/engines/pegasus/ai/ai_action.h
index 6eac976f9c..3ee336f480 100644
--- a/engines/pegasus/ai/ai_action.h
+++ b/engines/pegasus/ai/ai_action.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_area.cpp b/engines/pegasus/ai/ai_area.cpp
index 9cab568d66..c078d5e80e 100644
--- a/engines/pegasus/ai/ai_area.cpp
+++ b/engines/pegasus/ai/ai_area.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_area.h b/engines/pegasus/ai/ai_area.h
index 806e6ef6bb..0c180b40d8 100644
--- a/engines/pegasus/ai/ai_area.h
+++ b/engines/pegasus/ai/ai_area.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_condition.cpp b/engines/pegasus/ai/ai_condition.cpp
index 9fc9272566..83b6a1567c 100644
--- a/engines/pegasus/ai/ai_condition.cpp
+++ b/engines/pegasus/ai/ai_condition.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_condition.h b/engines/pegasus/ai/ai_condition.h
index ae85168a36..801b71a9fc 100644
--- a/engines/pegasus/ai/ai_condition.h
+++ b/engines/pegasus/ai/ai_condition.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_rule.cpp b/engines/pegasus/ai/ai_rule.cpp
index 3aaa530a4a..8a0e16364e 100644
--- a/engines/pegasus/ai/ai_rule.cpp
+++ b/engines/pegasus/ai/ai_rule.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/ai/ai_rule.h b/engines/pegasus/ai/ai_rule.h
index aa2ca07332..b5a8f4aed6 100644
--- a/engines/pegasus/ai/ai_rule.h
+++ b/engines/pegasus/ai/ai_rule.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/compass.cpp b/engines/pegasus/compass.cpp
index 5de8b91b11..a918fe932d 100644
--- a/engines/pegasus/compass.cpp
+++ b/engines/pegasus/compass.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/compass.h b/engines/pegasus/compass.h
index 67a8e06294..d821839134 100644
--- a/engines/pegasus/compass.h
+++ b/engines/pegasus/compass.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/console.cpp b/engines/pegasus/console.cpp
index e5a0cfec98..817f25ac0b 100644
--- a/engines/pegasus/console.cpp
+++ b/engines/pegasus/console.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/pegasus/console.h b/engines/pegasus/console.h
index f00ee25294..15ba709c0a 100644
--- a/engines/pegasus/console.h
+++ b/engines/pegasus/console.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/pegasus/constants.h b/engines/pegasus/constants.h
index f81d2197ac..f288729849 100644
--- a/engines/pegasus/constants.h
+++ b/engines/pegasus/constants.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/cursor.cpp b/engines/pegasus/cursor.cpp
index 602ae88068..6b7965d679 100644
--- a/engines/pegasus/cursor.cpp
+++ b/engines/pegasus/cursor.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/cursor.h b/engines/pegasus/cursor.h
index ada82e3967..e996a866bc 100644
--- a/engines/pegasus/cursor.h
+++ b/engines/pegasus/cursor.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/detection.cpp b/engines/pegasus/detection.cpp
index 161a133c8b..01a3113f2a 100644
--- a/engines/pegasus/detection.cpp
+++ b/engines/pegasus/detection.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -198,4 +198,3 @@ bool PegasusMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADG
#else
REGISTER_PLUGIN_STATIC(PEGASUS, PLUGIN_TYPE_ENGINE, PegasusMetaEngine);
#endif
-
diff --git a/engines/pegasus/elements.cpp b/engines/pegasus/elements.cpp
index 87fb69a557..9b1e1fe6b8 100644
--- a/engines/pegasus/elements.cpp
+++ b/engines/pegasus/elements.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/elements.h b/engines/pegasus/elements.h
index 140553f675..10037d995c 100644
--- a/engines/pegasus/elements.h
+++ b/engines/pegasus/elements.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/energymonitor.cpp b/engines/pegasus/energymonitor.cpp
index d3cc208e41..c4c27ad6d9 100644
--- a/engines/pegasus/energymonitor.cpp
+++ b/engines/pegasus/energymonitor.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/energymonitor.h b/engines/pegasus/energymonitor.h
index 02377d515a..1a7052b9b9 100644
--- a/engines/pegasus/energymonitor.h
+++ b/engines/pegasus/energymonitor.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/fader.cpp b/engines/pegasus/fader.cpp
index 80ce8ef5dc..5a213a2931 100644
--- a/engines/pegasus/fader.cpp
+++ b/engines/pegasus/fader.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/fader.h b/engines/pegasus/fader.h
index 0a8cd549e6..2b93bdbcdb 100644
--- a/engines/pegasus/fader.h
+++ b/engines/pegasus/fader.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/gamestate.cpp b/engines/pegasus/gamestate.cpp
index 7a4e657e02..dfb4f1cd5b 100644
--- a/engines/pegasus/gamestate.cpp
+++ b/engines/pegasus/gamestate.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/gamestate.h b/engines/pegasus/gamestate.h
index dd47bd6e51..383b062788 100644
--- a/engines/pegasus/gamestate.h
+++ b/engines/pegasus/gamestate.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp
index 5475108abd..634b0eb0cc 100644
--- a/engines/pegasus/graphics.cpp
+++ b/engines/pegasus/graphics.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/graphics.h b/engines/pegasus/graphics.h
index fcdf1c9e78..7b48ea4598 100644
--- a/engines/pegasus/graphics.h
+++ b/engines/pegasus/graphics.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/hotspot.cpp b/engines/pegasus/hotspot.cpp
index d8b07a94f4..2ab204e81c 100644
--- a/engines/pegasus/hotspot.cpp
+++ b/engines/pegasus/hotspot.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/hotspot.h b/engines/pegasus/hotspot.h
index 64d3fb19f9..d4e10d405c 100644
--- a/engines/pegasus/hotspot.h
+++ b/engines/pegasus/hotspot.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/input.cpp b/engines/pegasus/input.cpp
index 73c319bd8b..f4834037d9 100644
--- a/engines/pegasus/input.cpp
+++ b/engines/pegasus/input.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/input.h b/engines/pegasus/input.h
index ac5b149413..4259076932 100644
--- a/engines/pegasus/input.h
+++ b/engines/pegasus/input.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/interaction.cpp b/engines/pegasus/interaction.cpp
index 143bdebaba..452d7cdb0b 100644
--- a/engines/pegasus/interaction.cpp
+++ b/engines/pegasus/interaction.cpp
@@ -11,12 +11,12 @@
* 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.
@@ -35,4 +35,3 @@ GameInteraction::GameInteraction(const InteractionID id, Neighborhood *nextHandl
}
} // End of namespace Pegasus
-
diff --git a/engines/pegasus/interaction.h b/engines/pegasus/interaction.h
index ca168b4cb7..e35b0c1fd4 100644
--- a/engines/pegasus/interaction.h
+++ b/engines/pegasus/interaction.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/interface.cpp b/engines/pegasus/interface.cpp
index f8ae6a0752..54ddffc37c 100644
--- a/engines/pegasus/interface.cpp
+++ b/engines/pegasus/interface.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/interface.h b/engines/pegasus/interface.h
index 5f04f98df0..3025ef1b6c 100644
--- a/engines/pegasus/interface.h
+++ b/engines/pegasus/interface.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/autodragger.cpp b/engines/pegasus/items/autodragger.cpp
index 40bad14a89..5595a0a05e 100644
--- a/engines/pegasus/items/autodragger.cpp
+++ b/engines/pegasus/items/autodragger.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/autodragger.h b/engines/pegasus/items/autodragger.h
index 6783fdf9a3..765082c8ff 100644
--- a/engines/pegasus/items/autodragger.h
+++ b/engines/pegasus/items/autodragger.h
@@ -11,12 +11,12 @@
* 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.
@@ -54,4 +54,3 @@ protected:
} // End of namespace Pegasus
#endif
-
diff --git a/engines/pegasus/items/biochips/aichip.cpp b/engines/pegasus/items/biochips/aichip.cpp
index cbcfc363e8..b07e8694d3 100644
--- a/engines/pegasus/items/biochips/aichip.cpp
+++ b/engines/pegasus/items/biochips/aichip.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/aichip.h b/engines/pegasus/items/biochips/aichip.h
index 7a33953612..30600fc9bc 100644
--- a/engines/pegasus/items/biochips/aichip.h
+++ b/engines/pegasus/items/biochips/aichip.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/biochipitem.cpp b/engines/pegasus/items/biochips/biochipitem.cpp
index 5686948937..6d5d932114 100644
--- a/engines/pegasus/items/biochips/biochipitem.cpp
+++ b/engines/pegasus/items/biochips/biochipitem.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/biochipitem.h b/engines/pegasus/items/biochips/biochipitem.h
index 2039e80c6f..f136283266 100644
--- a/engines/pegasus/items/biochips/biochipitem.h
+++ b/engines/pegasus/items/biochips/biochipitem.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/mapchip.cpp b/engines/pegasus/items/biochips/mapchip.cpp
index 69050d5193..bdcc9f70e8 100644
--- a/engines/pegasus/items/biochips/mapchip.cpp
+++ b/engines/pegasus/items/biochips/mapchip.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/mapchip.h b/engines/pegasus/items/biochips/mapchip.h
index 6690090aa4..47be8e8d54 100644
--- a/engines/pegasus/items/biochips/mapchip.h
+++ b/engines/pegasus/items/biochips/mapchip.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/mapimage.cpp b/engines/pegasus/items/biochips/mapimage.cpp
index 9f4170d063..a801e4a8b2 100644
--- a/engines/pegasus/items/biochips/mapimage.cpp
+++ b/engines/pegasus/items/biochips/mapimage.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/mapimage.h b/engines/pegasus/items/biochips/mapimage.h
index 49ad9945ee..f2ca64e0dc 100644
--- a/engines/pegasus/items/biochips/mapimage.h
+++ b/engines/pegasus/items/biochips/mapimage.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/opticalchip.cpp b/engines/pegasus/items/biochips/opticalchip.cpp
index 7b8858edae..3efe21a7de 100644
--- a/engines/pegasus/items/biochips/opticalchip.cpp
+++ b/engines/pegasus/items/biochips/opticalchip.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/opticalchip.h b/engines/pegasus/items/biochips/opticalchip.h
index 2f66f73d3a..8b01581cb6 100644
--- a/engines/pegasus/items/biochips/opticalchip.h
+++ b/engines/pegasus/items/biochips/opticalchip.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/pegasuschip.cpp b/engines/pegasus/items/biochips/pegasuschip.cpp
index fa551fce30..c74cc346ca 100644
--- a/engines/pegasus/items/biochips/pegasuschip.cpp
+++ b/engines/pegasus/items/biochips/pegasuschip.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/pegasuschip.h b/engines/pegasus/items/biochips/pegasuschip.h
index 7597424821..c4f1e6cd84 100644
--- a/engines/pegasus/items/biochips/pegasuschip.h
+++ b/engines/pegasus/items/biochips/pegasuschip.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/retscanchip.cpp b/engines/pegasus/items/biochips/retscanchip.cpp
index 84b74a63d2..e8a9bce000 100644
--- a/engines/pegasus/items/biochips/retscanchip.cpp
+++ b/engines/pegasus/items/biochips/retscanchip.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/retscanchip.h b/engines/pegasus/items/biochips/retscanchip.h
index 153e6cd071..3fd41d6a22 100644
--- a/engines/pegasus/items/biochips/retscanchip.h
+++ b/engines/pegasus/items/biochips/retscanchip.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/shieldchip.cpp b/engines/pegasus/items/biochips/shieldchip.cpp
index 58cbfcc4ec..a8089a594d 100644
--- a/engines/pegasus/items/biochips/shieldchip.cpp
+++ b/engines/pegasus/items/biochips/shieldchip.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/biochips/shieldchip.h b/engines/pegasus/items/biochips/shieldchip.h
index 69c6369236..63e3339aa9 100644
--- a/engines/pegasus/items/biochips/shieldchip.h
+++ b/engines/pegasus/items/biochips/shieldchip.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory.cpp b/engines/pegasus/items/inventory.cpp
index 57923b105d..896a1c1c9f 100644
--- a/engines/pegasus/items/inventory.cpp
+++ b/engines/pegasus/items/inventory.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory.h b/engines/pegasus/items/inventory.h
index 796ec49556..a7812d4891 100644
--- a/engines/pegasus/items/inventory.h
+++ b/engines/pegasus/items/inventory.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/airmask.cpp b/engines/pegasus/items/inventory/airmask.cpp
index c65dd36102..50fab70032 100644
--- a/engines/pegasus/items/inventory/airmask.cpp
+++ b/engines/pegasus/items/inventory/airmask.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/airmask.h b/engines/pegasus/items/inventory/airmask.h
index 6a2d708a6c..171fe74d31 100644
--- a/engines/pegasus/items/inventory/airmask.h
+++ b/engines/pegasus/items/inventory/airmask.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/gascanister.cpp b/engines/pegasus/items/inventory/gascanister.cpp
index bf63cc6542..8262e1f24c 100644
--- a/engines/pegasus/items/inventory/gascanister.cpp
+++ b/engines/pegasus/items/inventory/gascanister.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/gascanister.h b/engines/pegasus/items/inventory/gascanister.h
index 7d4d8193f5..62056c4273 100644
--- a/engines/pegasus/items/inventory/gascanister.h
+++ b/engines/pegasus/items/inventory/gascanister.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/inventoryitem.cpp b/engines/pegasus/items/inventory/inventoryitem.cpp
index 4399708879..9d65f99e68 100644
--- a/engines/pegasus/items/inventory/inventoryitem.cpp
+++ b/engines/pegasus/items/inventory/inventoryitem.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/inventoryitem.h b/engines/pegasus/items/inventory/inventoryitem.h
index 9d78113014..bc39b97565 100644
--- a/engines/pegasus/items/inventory/inventoryitem.h
+++ b/engines/pegasus/items/inventory/inventoryitem.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/keycard.cpp b/engines/pegasus/items/inventory/keycard.cpp
index c818b6675b..83d56e536a 100644
--- a/engines/pegasus/items/inventory/keycard.cpp
+++ b/engines/pegasus/items/inventory/keycard.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventory/keycard.h b/engines/pegasus/items/inventory/keycard.h
index 846f40e6e5..8f4cd5604e 100644
--- a/engines/pegasus/items/inventory/keycard.h
+++ b/engines/pegasus/items/inventory/keycard.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventorypicture.cpp b/engines/pegasus/items/inventorypicture.cpp
index bfdc382f5d..fb7af0b59d 100644
--- a/engines/pegasus/items/inventorypicture.cpp
+++ b/engines/pegasus/items/inventorypicture.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/inventorypicture.h b/engines/pegasus/items/inventorypicture.h
index 9eba25bc3a..d8ac3fcf82 100644
--- a/engines/pegasus/items/inventorypicture.h
+++ b/engines/pegasus/items/inventorypicture.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/item.cpp b/engines/pegasus/items/item.cpp
index 830d3f2f34..cf05fbb130 100644
--- a/engines/pegasus/items/item.cpp
+++ b/engines/pegasus/items/item.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/item.h b/engines/pegasus/items/item.h
index 26cccf043c..c8b8c51815 100644
--- a/engines/pegasus/items/item.h
+++ b/engines/pegasus/items/item.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/itemdragger.cpp b/engines/pegasus/items/itemdragger.cpp
index 97fc5a97ac..7736906f78 100644
--- a/engines/pegasus/items/itemdragger.cpp
+++ b/engines/pegasus/items/itemdragger.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/itemdragger.h b/engines/pegasus/items/itemdragger.h
index fce953d695..3555e5aeeb 100644
--- a/engines/pegasus/items/itemdragger.h
+++ b/engines/pegasus/items/itemdragger.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/itemlist.cpp b/engines/pegasus/items/itemlist.cpp
index 4b58d9ad78..2e4d859451 100644
--- a/engines/pegasus/items/itemlist.cpp
+++ b/engines/pegasus/items/itemlist.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/items/itemlist.h b/engines/pegasus/items/itemlist.h
index 22bef2c96e..ffad91d461 100644
--- a/engines/pegasus/items/itemlist.h
+++ b/engines/pegasus/items/itemlist.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp
index 3e9bf540fe..ede9873f9a 100644
--- a/engines/pegasus/menu.cpp
+++ b/engines/pegasus/menu.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/menu.h b/engines/pegasus/menu.h
index 288b846093..a8a2f991f3 100644
--- a/engines/pegasus/menu.h
+++ b/engines/pegasus/menu.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/movie.cpp b/engines/pegasus/movie.cpp
index 59814a753d..eaf8e32c05 100644
--- a/engines/pegasus/movie.cpp
+++ b/engines/pegasus/movie.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/movie.h b/engines/pegasus/movie.h
index 9b9cc2bdbe..b5e8a055d5 100644
--- a/engines/pegasus/movie.h
+++ b/engines/pegasus/movie.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.cpp b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
index ed52851338..7cbd32c820 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoria.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoria.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria.h b/engines/pegasus/neighborhood/caldoria/caldoria.h
index 3d6a155170..016f3daad5 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoria.h
+++ b/engines/pegasus/neighborhood/caldoria/caldoria.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp b/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp
index 9a2cf8c4bb..edd8959349 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.cpp
@@ -11,12 +11,12 @@
* 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.
@@ -111,7 +111,7 @@ Caldoria4DSystem::Caldoria4DSystem(Neighborhood *owner) : GameInteraction(kCaldo
_neighborhoodNotification = nullptr;
_loopStart = 0;
_clickedHotspotID = kNoHotSpotID;
-
+
g_AIArea->lockAIOut();
}
diff --git a/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.h b/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.h
index 1c5fa44b90..6030084bfb 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.h
+++ b/engines/pegasus/neighborhood/caldoria/caldoria4dsystem.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp b/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
index c964e3458b..6ea12e4fba 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoriabomb.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriabomb.h b/engines/pegasus/neighborhood/caldoria/caldoriabomb.h
index ba6d1e8998..32e0fc6aae 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriabomb.h
+++ b/engines/pegasus/neighborhood/caldoria/caldoriabomb.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp b/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp
index 54c8b514d1..86c9688dc6 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoriamessages.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamessages.h b/engines/pegasus/neighborhood/caldoria/caldoriamessages.h
index b2fc7c3bf9..1ce9f6f757 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriamessages.h
+++ b/engines/pegasus/neighborhood/caldoria/caldoriamessages.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp b/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp
index e0e9e2f22d..d07e56525d 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp
+++ b/engines/pegasus/neighborhood/caldoria/caldoriamirror.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/caldoria/caldoriamirror.h b/engines/pegasus/neighborhood/caldoria/caldoriamirror.h
index 1ca47ec774..c865acea5e 100644
--- a/engines/pegasus/neighborhood/caldoria/caldoriamirror.h
+++ b/engines/pegasus/neighborhood/caldoria/caldoriamirror.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/door.cpp b/engines/pegasus/neighborhood/door.cpp
index f7ec7559fc..399f2a0bf2 100644
--- a/engines/pegasus/neighborhood/door.cpp
+++ b/engines/pegasus/neighborhood/door.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/door.h b/engines/pegasus/neighborhood/door.h
index 8ea757559a..1e7df29d7b 100644
--- a/engines/pegasus/neighborhood/door.h
+++ b/engines/pegasus/neighborhood/door.h
@@ -11,12 +11,12 @@
* 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.
@@ -87,4 +87,3 @@ private:
} // End of namespace Pegasus
#endif
-
diff --git a/engines/pegasus/neighborhood/exit.cpp b/engines/pegasus/neighborhood/exit.cpp
index f0dfff12d3..597e68fe67 100644
--- a/engines/pegasus/neighborhood/exit.cpp
+++ b/engines/pegasus/neighborhood/exit.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/exit.h b/engines/pegasus/neighborhood/exit.h
index 17150892f9..fb035ccbd4 100644
--- a/engines/pegasus/neighborhood/exit.h
+++ b/engines/pegasus/neighborhood/exit.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/extra.cpp b/engines/pegasus/neighborhood/extra.cpp
index b8c4e5b510..a58f6915ff 100644
--- a/engines/pegasus/neighborhood/extra.cpp
+++ b/engines/pegasus/neighborhood/extra.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/extra.h b/engines/pegasus/neighborhood/extra.h
index 14fcff1009..17419c309b 100644
--- a/engines/pegasus/neighborhood/extra.h
+++ b/engines/pegasus/neighborhood/extra.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/hotspotinfo.cpp b/engines/pegasus/neighborhood/hotspotinfo.cpp
index c7524f3a0f..859edfd650 100644
--- a/engines/pegasus/neighborhood/hotspotinfo.cpp
+++ b/engines/pegasus/neighborhood/hotspotinfo.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/hotspotinfo.h b/engines/pegasus/neighborhood/hotspotinfo.h
index 965f445ba8..c78b833abe 100644
--- a/engines/pegasus/neighborhood/hotspotinfo.h
+++ b/engines/pegasus/neighborhood/hotspotinfo.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/constants.h b/engines/pegasus/neighborhood/mars/constants.h
index 82a7f03b68..0a0ec521c8 100644
--- a/engines/pegasus/neighborhood/mars/constants.h
+++ b/engines/pegasus/neighborhood/mars/constants.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/energybeam.cpp b/engines/pegasus/neighborhood/mars/energybeam.cpp
index 964c8ba381..19512f4429 100644
--- a/engines/pegasus/neighborhood/mars/energybeam.cpp
+++ b/engines/pegasus/neighborhood/mars/energybeam.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/energybeam.h b/engines/pegasus/neighborhood/mars/energybeam.h
index 715ed4b01d..339c8a91e8 100644
--- a/engines/pegasus/neighborhood/mars/energybeam.h
+++ b/engines/pegasus/neighborhood/mars/energybeam.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/gravitoncannon.cpp b/engines/pegasus/neighborhood/mars/gravitoncannon.cpp
index d04b3d08b2..e0d74e9a8b 100644
--- a/engines/pegasus/neighborhood/mars/gravitoncannon.cpp
+++ b/engines/pegasus/neighborhood/mars/gravitoncannon.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/gravitoncannon.h b/engines/pegasus/neighborhood/mars/gravitoncannon.h
index b94fd55e5b..9b61ff0f9b 100644
--- a/engines/pegasus/neighborhood/mars/gravitoncannon.h
+++ b/engines/pegasus/neighborhood/mars/gravitoncannon.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/hermite.cpp b/engines/pegasus/neighborhood/mars/hermite.cpp
index 7f631b369d..e5b4f8e314 100644
--- a/engines/pegasus/neighborhood/mars/hermite.cpp
+++ b/engines/pegasus/neighborhood/mars/hermite.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/hermite.h b/engines/pegasus/neighborhood/mars/hermite.h
index 44cb3a5a11..0117b9c21a 100644
--- a/engines/pegasus/neighborhood/mars/hermite.h
+++ b/engines/pegasus/neighborhood/mars/hermite.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/mars.cpp b/engines/pegasus/neighborhood/mars/mars.cpp
index 0d5edd85ba..432909596e 100644
--- a/engines/pegasus/neighborhood/mars/mars.cpp
+++ b/engines/pegasus/neighborhood/mars/mars.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/mars.h b/engines/pegasus/neighborhood/mars/mars.h
index 0859522890..4f10e19220 100644
--- a/engines/pegasus/neighborhood/mars/mars.h
+++ b/engines/pegasus/neighborhood/mars/mars.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/planetmover.cpp b/engines/pegasus/neighborhood/mars/planetmover.cpp
index a340120c12..fa55e2bc35 100644
--- a/engines/pegasus/neighborhood/mars/planetmover.cpp
+++ b/engines/pegasus/neighborhood/mars/planetmover.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/planetmover.h b/engines/pegasus/neighborhood/mars/planetmover.h
index 2c195387e8..e970856a8e 100644
--- a/engines/pegasus/neighborhood/mars/planetmover.h
+++ b/engines/pegasus/neighborhood/mars/planetmover.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/reactor.cpp b/engines/pegasus/neighborhood/mars/reactor.cpp
index 3a7ef9d7eb..954cbf6136 100644
--- a/engines/pegasus/neighborhood/mars/reactor.cpp
+++ b/engines/pegasus/neighborhood/mars/reactor.cpp
@@ -11,12 +11,12 @@
* 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
* aint32 with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
diff --git a/engines/pegasus/neighborhood/mars/reactor.h b/engines/pegasus/neighborhood/mars/reactor.h
index 86338f8266..1403262654 100644
--- a/engines/pegasus/neighborhood/mars/reactor.h
+++ b/engines/pegasus/neighborhood/mars/reactor.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/robotship.cpp b/engines/pegasus/neighborhood/mars/robotship.cpp
index 1f4bbc1779..3f672c0f0b 100644
--- a/engines/pegasus/neighborhood/mars/robotship.cpp
+++ b/engines/pegasus/neighborhood/mars/robotship.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/robotship.h b/engines/pegasus/neighborhood/mars/robotship.h
index 04be3ea56e..b24ec80e01 100644
--- a/engines/pegasus/neighborhood/mars/robotship.h
+++ b/engines/pegasus/neighborhood/mars/robotship.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/shuttleenergymeter.cpp b/engines/pegasus/neighborhood/mars/shuttleenergymeter.cpp
index cd08dbae6a..37f386c54f 100644
--- a/engines/pegasus/neighborhood/mars/shuttleenergymeter.cpp
+++ b/engines/pegasus/neighborhood/mars/shuttleenergymeter.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/shuttleenergymeter.h b/engines/pegasus/neighborhood/mars/shuttleenergymeter.h
index 51161e094e..e61b17745d 100644
--- a/engines/pegasus/neighborhood/mars/shuttleenergymeter.h
+++ b/engines/pegasus/neighborhood/mars/shuttleenergymeter.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/shuttlehud.cpp b/engines/pegasus/neighborhood/mars/shuttlehud.cpp
index 2d894f7b95..7030f43d04 100644
--- a/engines/pegasus/neighborhood/mars/shuttlehud.cpp
+++ b/engines/pegasus/neighborhood/mars/shuttlehud.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/shuttlehud.h b/engines/pegasus/neighborhood/mars/shuttlehud.h
index f7dbbaeae8..5d088163b4 100644
--- a/engines/pegasus/neighborhood/mars/shuttlehud.h
+++ b/engines/pegasus/neighborhood/mars/shuttlehud.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/shuttleweapon.cpp b/engines/pegasus/neighborhood/mars/shuttleweapon.cpp
index b4c360b280..8027931dfd 100644
--- a/engines/pegasus/neighborhood/mars/shuttleweapon.cpp
+++ b/engines/pegasus/neighborhood/mars/shuttleweapon.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/shuttleweapon.h b/engines/pegasus/neighborhood/mars/shuttleweapon.h
index 38529c8919..a887161cfb 100644
--- a/engines/pegasus/neighborhood/mars/shuttleweapon.h
+++ b/engines/pegasus/neighborhood/mars/shuttleweapon.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/spacechase3d.cpp b/engines/pegasus/neighborhood/mars/spacechase3d.cpp
index 05f8233763..db2422480e 100644
--- a/engines/pegasus/neighborhood/mars/spacechase3d.cpp
+++ b/engines/pegasus/neighborhood/mars/spacechase3d.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/spacechase3d.h b/engines/pegasus/neighborhood/mars/spacechase3d.h
index f6815e69bd..455904f6c5 100644
--- a/engines/pegasus/neighborhood/mars/spacechase3d.h
+++ b/engines/pegasus/neighborhood/mars/spacechase3d.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/spacejunk.cpp b/engines/pegasus/neighborhood/mars/spacejunk.cpp
index 3912e659c2..80914b476c 100644
--- a/engines/pegasus/neighborhood/mars/spacejunk.cpp
+++ b/engines/pegasus/neighborhood/mars/spacejunk.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/spacejunk.h b/engines/pegasus/neighborhood/mars/spacejunk.h
index 2ec9192513..25b101bf77 100644
--- a/engines/pegasus/neighborhood/mars/spacejunk.h
+++ b/engines/pegasus/neighborhood/mars/spacejunk.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/tractorbeam.cpp b/engines/pegasus/neighborhood/mars/tractorbeam.cpp
index d3f9c94328..39c750ad56 100644
--- a/engines/pegasus/neighborhood/mars/tractorbeam.cpp
+++ b/engines/pegasus/neighborhood/mars/tractorbeam.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/mars/tractorbeam.h b/engines/pegasus/neighborhood/mars/tractorbeam.h
index cd87992d11..1d53e5bced 100644
--- a/engines/pegasus/neighborhood/mars/tractorbeam.h
+++ b/engines/pegasus/neighborhood/mars/tractorbeam.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/neighborhood.cpp b/engines/pegasus/neighborhood/neighborhood.cpp
index c9be349694..c593f734e3 100644
--- a/engines/pegasus/neighborhood/neighborhood.cpp
+++ b/engines/pegasus/neighborhood/neighborhood.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/neighborhood.h b/engines/pegasus/neighborhood/neighborhood.h
index f7f2b038c6..5b01147a68 100644
--- a/engines/pegasus/neighborhood/neighborhood.h
+++ b/engines/pegasus/neighborhood/neighborhood.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.cpp b/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.cpp
index 1478a74744..33d61c766e 100644
--- a/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.h b/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.h
index 9e286ed337..9fa9318370 100644
--- a/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.h
+++ b/engines/pegasus/neighborhood/norad/alpha/ecrmonitor.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp b/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp
index e85a3e699f..7866385019 100644
--- a/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/fillingstation.h b/engines/pegasus/neighborhood/norad/alpha/fillingstation.h
index eb2088e373..3db0a17e72 100644
--- a/engines/pegasus/neighborhood/norad/alpha/fillingstation.h
+++ b/engines/pegasus/neighborhood/norad/alpha/fillingstation.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
index 5c2af3eec2..d42d974712 100644
--- a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/noradalpha.h b/engines/pegasus/neighborhood/norad/alpha/noradalpha.h
index 582d6c2bb3..916e2e715a 100644
--- a/engines/pegasus/neighborhood/norad/alpha/noradalpha.h
+++ b/engines/pegasus/neighborhood/norad/alpha/noradalpha.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/panorama.cpp b/engines/pegasus/neighborhood/norad/alpha/panorama.cpp
index 5a717a84e7..4c979e1106 100644
--- a/engines/pegasus/neighborhood/norad/alpha/panorama.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/panorama.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/panorama.h b/engines/pegasus/neighborhood/norad/alpha/panorama.h
index 87c7b3bd4e..bd3f69c883 100644
--- a/engines/pegasus/neighborhood/norad/alpha/panorama.h
+++ b/engines/pegasus/neighborhood/norad/alpha/panorama.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/panoramascroll.cpp b/engines/pegasus/neighborhood/norad/alpha/panoramascroll.cpp
index 7865bbb442..741c7b8dea 100644
--- a/engines/pegasus/neighborhood/norad/alpha/panoramascroll.cpp
+++ b/engines/pegasus/neighborhood/norad/alpha/panoramascroll.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/alpha/panoramascroll.h b/engines/pegasus/neighborhood/norad/alpha/panoramascroll.h
index 6a3e1515e2..2e8432f40a 100644
--- a/engines/pegasus/neighborhood/norad/alpha/panoramascroll.h
+++ b/engines/pegasus/neighborhood/norad/alpha/panoramascroll.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/constants.h b/engines/pegasus/neighborhood/norad/constants.h
index 37c1769309..52e889f2e0 100644
--- a/engines/pegasus/neighborhood/norad/constants.h
+++ b/engines/pegasus/neighborhood/norad/constants.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/delta/globegame.cpp b/engines/pegasus/neighborhood/norad/delta/globegame.cpp
index 434b95c978..15f8c2675d 100644
--- a/engines/pegasus/neighborhood/norad/delta/globegame.cpp
+++ b/engines/pegasus/neighborhood/norad/delta/globegame.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/delta/globegame.h b/engines/pegasus/neighborhood/norad/delta/globegame.h
index 93235a1784..4b1d0a68ee 100644
--- a/engines/pegasus/neighborhood/norad/delta/globegame.h
+++ b/engines/pegasus/neighborhood/norad/delta/globegame.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
index ee047d72b2..3eb51c7af7 100644
--- a/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
+++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/delta/noraddelta.h b/engines/pegasus/neighborhood/norad/delta/noraddelta.h
index 591fd691a2..a8ba300399 100644
--- a/engines/pegasus/neighborhood/norad/delta/noraddelta.h
+++ b/engines/pegasus/neighborhood/norad/delta/noraddelta.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/norad.cpp b/engines/pegasus/neighborhood/norad/norad.cpp
index 53b3ff9add..770d559bf6 100644
--- a/engines/pegasus/neighborhood/norad/norad.cpp
+++ b/engines/pegasus/neighborhood/norad/norad.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/norad.h b/engines/pegasus/neighborhood/norad/norad.h
index 3cd77cc54b..79530811b6 100644
--- a/engines/pegasus/neighborhood/norad/norad.h
+++ b/engines/pegasus/neighborhood/norad/norad.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/noradelevator.cpp b/engines/pegasus/neighborhood/norad/noradelevator.cpp
index 1751f4dcb6..c7e208dc26 100644
--- a/engines/pegasus/neighborhood/norad/noradelevator.cpp
+++ b/engines/pegasus/neighborhood/norad/noradelevator.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/noradelevator.h b/engines/pegasus/neighborhood/norad/noradelevator.h
index 24aa488534..7d11af70c9 100644
--- a/engines/pegasus/neighborhood/norad/noradelevator.h
+++ b/engines/pegasus/neighborhood/norad/noradelevator.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/pressuredoor.cpp b/engines/pegasus/neighborhood/norad/pressuredoor.cpp
index a12e971d10..e41899f222 100644
--- a/engines/pegasus/neighborhood/norad/pressuredoor.cpp
+++ b/engines/pegasus/neighborhood/norad/pressuredoor.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/pressuredoor.h b/engines/pegasus/neighborhood/norad/pressuredoor.h
index b2018bfcf7..c8fd4e3063 100644
--- a/engines/pegasus/neighborhood/norad/pressuredoor.h
+++ b/engines/pegasus/neighborhood/norad/pressuredoor.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/pressuretracker.cpp b/engines/pegasus/neighborhood/norad/pressuretracker.cpp
index 390e3e33b6..17004a4d72 100644
--- a/engines/pegasus/neighborhood/norad/pressuretracker.cpp
+++ b/engines/pegasus/neighborhood/norad/pressuretracker.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/pressuretracker.h b/engines/pegasus/neighborhood/norad/pressuretracker.h
index 6ca7252e22..ecdf4b65bc 100644
--- a/engines/pegasus/neighborhood/norad/pressuretracker.h
+++ b/engines/pegasus/neighborhood/norad/pressuretracker.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/subcontrolroom.cpp b/engines/pegasus/neighborhood/norad/subcontrolroom.cpp
index 1b14c529d8..f832f546ff 100644
--- a/engines/pegasus/neighborhood/norad/subcontrolroom.cpp
+++ b/engines/pegasus/neighborhood/norad/subcontrolroom.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/subcontrolroom.h b/engines/pegasus/neighborhood/norad/subcontrolroom.h
index 6ce599db42..ff25344397 100644
--- a/engines/pegasus/neighborhood/norad/subcontrolroom.h
+++ b/engines/pegasus/neighborhood/norad/subcontrolroom.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/subplatform.cpp b/engines/pegasus/neighborhood/norad/subplatform.cpp
index 97079a9f53..34836e3dbb 100644
--- a/engines/pegasus/neighborhood/norad/subplatform.cpp
+++ b/engines/pegasus/neighborhood/norad/subplatform.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/norad/subplatform.h b/engines/pegasus/neighborhood/norad/subplatform.h
index 82e86ecae2..cfb515a9e2 100644
--- a/engines/pegasus/neighborhood/norad/subplatform.h
+++ b/engines/pegasus/neighborhood/norad/subplatform.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
index 190984f8bc..9f8f69852d 100644
--- a/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
+++ b/engines/pegasus/neighborhood/prehistoric/prehistoric.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/prehistoric/prehistoric.h b/engines/pegasus/neighborhood/prehistoric/prehistoric.h
index 17f9993014..3fd7319f3d 100644
--- a/engines/pegasus/neighborhood/prehistoric/prehistoric.h
+++ b/engines/pegasus/neighborhood/prehistoric/prehistoric.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/spot.cpp b/engines/pegasus/neighborhood/spot.cpp
index f285bf9bc2..a0a755e18f 100644
--- a/engines/pegasus/neighborhood/spot.cpp
+++ b/engines/pegasus/neighborhood/spot.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/spot.h b/engines/pegasus/neighborhood/spot.h
index a985420b7c..9e9ff4cad4 100644
--- a/engines/pegasus/neighborhood/spot.h
+++ b/engines/pegasus/neighborhood/spot.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/tsa/fulltsa.cpp b/engines/pegasus/neighborhood/tsa/fulltsa.cpp
index f7996fabf5..b6b8b13f8a 100644
--- a/engines/pegasus/neighborhood/tsa/fulltsa.cpp
+++ b/engines/pegasus/neighborhood/tsa/fulltsa.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/tsa/fulltsa.h b/engines/pegasus/neighborhood/tsa/fulltsa.h
index a646d57e6c..50ca303e89 100644
--- a/engines/pegasus/neighborhood/tsa/fulltsa.h
+++ b/engines/pegasus/neighborhood/tsa/fulltsa.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/tsa/tinytsa.cpp b/engines/pegasus/neighborhood/tsa/tinytsa.cpp
index 0c29e06f41..33ef10641f 100644
--- a/engines/pegasus/neighborhood/tsa/tinytsa.cpp
+++ b/engines/pegasus/neighborhood/tsa/tinytsa.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/tsa/tinytsa.h b/engines/pegasus/neighborhood/tsa/tinytsa.h
index 2dc234675d..cc1db16466 100644
--- a/engines/pegasus/neighborhood/tsa/tinytsa.h
+++ b/engines/pegasus/neighborhood/tsa/tinytsa.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/turn.cpp b/engines/pegasus/neighborhood/turn.cpp
index 1157796f55..027385d813 100644
--- a/engines/pegasus/neighborhood/turn.cpp
+++ b/engines/pegasus/neighborhood/turn.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/turn.h b/engines/pegasus/neighborhood/turn.h
index 329b03eddb..e59c640258 100644
--- a/engines/pegasus/neighborhood/turn.h
+++ b/engines/pegasus/neighborhood/turn.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/view.cpp b/engines/pegasus/neighborhood/view.cpp
index 4e46f5374e..7ea2bccb26 100644
--- a/engines/pegasus/neighborhood/view.cpp
+++ b/engines/pegasus/neighborhood/view.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/view.h b/engines/pegasus/neighborhood/view.h
index 3397508b61..e6d7ac81fe 100644
--- a/engines/pegasus/neighborhood/view.h
+++ b/engines/pegasus/neighborhood/view.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/wsc/moleculebin.cpp b/engines/pegasus/neighborhood/wsc/moleculebin.cpp
index 210c0ad313..2676982b10 100644
--- a/engines/pegasus/neighborhood/wsc/moleculebin.cpp
+++ b/engines/pegasus/neighborhood/wsc/moleculebin.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/wsc/moleculebin.h b/engines/pegasus/neighborhood/wsc/moleculebin.h
index 3de4b5ed2a..03d3305f2d 100644
--- a/engines/pegasus/neighborhood/wsc/moleculebin.h
+++ b/engines/pegasus/neighborhood/wsc/moleculebin.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/wsc/wsc.cpp b/engines/pegasus/neighborhood/wsc/wsc.cpp
index c907bee289..cef0f37ce4 100644
--- a/engines/pegasus/neighborhood/wsc/wsc.cpp
+++ b/engines/pegasus/neighborhood/wsc/wsc.cpp
@@ -11,12 +11,12 @@
* 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.
@@ -486,7 +486,7 @@ static const CoordType kMoleculesMovieTop = kNavAreaTop + 40;
WSC::WSC(InputHandler *nextHandler, PegasusEngine *owner) : Neighborhood(nextHandler, owner, "WSC", kWSCID),
_moleculesMovie(kNoDisplayElement) {
-
+
_argonSprite = nullptr;
_cachedZoomSpot = nullptr;
_moleculeGameLevel = 0;
diff --git a/engines/pegasus/neighborhood/wsc/wsc.h b/engines/pegasus/neighborhood/wsc/wsc.h
index d9634b3539..76cceee216 100644
--- a/engines/pegasus/neighborhood/wsc/wsc.h
+++ b/engines/pegasus/neighborhood/wsc/wsc.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/zoom.cpp b/engines/pegasus/neighborhood/zoom.cpp
index 478ec6e493..4a7d695b5c 100644
--- a/engines/pegasus/neighborhood/zoom.cpp
+++ b/engines/pegasus/neighborhood/zoom.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/neighborhood/zoom.h b/engines/pegasus/neighborhood/zoom.h
index 8bcf8974f8..3f2598d277 100644
--- a/engines/pegasus/neighborhood/zoom.h
+++ b/engines/pegasus/neighborhood/zoom.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/notification.cpp b/engines/pegasus/notification.cpp
index 2d57fcc5e7..66d6358bd7 100644
--- a/engines/pegasus/notification.cpp
+++ b/engines/pegasus/notification.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/notification.h b/engines/pegasus/notification.h
index 19b69829be..7a58709168 100644
--- a/engines/pegasus/notification.h
+++ b/engines/pegasus/notification.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 4262ad4c12..e34fb7bee0 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h
index 57ae910def..d10f72e2b2 100644
--- a/engines/pegasus/pegasus.h
+++ b/engines/pegasus/pegasus.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/scoring.h b/engines/pegasus/scoring.h
index fbf8641ecb..10dc7a9f47 100644
--- a/engines/pegasus/scoring.h
+++ b/engines/pegasus/scoring.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/sound.cpp b/engines/pegasus/sound.cpp
index ddcb2be010..a86ebef67c 100644
--- a/engines/pegasus/sound.cpp
+++ b/engines/pegasus/sound.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/sound.h b/engines/pegasus/sound.h
index 57cfd52e41..dd8051bbcd 100644
--- a/engines/pegasus/sound.h
+++ b/engines/pegasus/sound.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/surface.cpp b/engines/pegasus/surface.cpp
index cb1e2e7bcc..8ff2a3a9ce 100644
--- a/engines/pegasus/surface.cpp
+++ b/engines/pegasus/surface.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/surface.h b/engines/pegasus/surface.h
index 47e3ef538c..27875315ff 100644
--- a/engines/pegasus/surface.h
+++ b/engines/pegasus/surface.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/timers.cpp b/engines/pegasus/timers.cpp
index 5fb2551e7a..614927b8e1 100644
--- a/engines/pegasus/timers.cpp
+++ b/engines/pegasus/timers.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/timers.h b/engines/pegasus/timers.h
index 944930d21b..972736c79c 100644
--- a/engines/pegasus/timers.h
+++ b/engines/pegasus/timers.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/transition.cpp b/engines/pegasus/transition.cpp
index b736b115ee..b6b13be919 100644
--- a/engines/pegasus/transition.cpp
+++ b/engines/pegasus/transition.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/transition.h b/engines/pegasus/transition.h
index 84241a2bd2..e1f0822f1b 100644
--- a/engines/pegasus/transition.h
+++ b/engines/pegasus/transition.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/types.h b/engines/pegasus/types.h
index 64ab4e5bb2..3ffbf7ac17 100644
--- a/engines/pegasus/types.h
+++ b/engines/pegasus/types.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/util.cpp b/engines/pegasus/util.cpp
index 59df610c33..6bcd9f4aa5 100644
--- a/engines/pegasus/util.cpp
+++ b/engines/pegasus/util.cpp
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/pegasus/util.h b/engines/pegasus/util.h
index 97ba1c20c3..e4d3b8ae45 100644
--- a/engines/pegasus/util.h
+++ b/engines/pegasus/util.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/prince/animation.cpp b/engines/prince/animation.cpp
index aabdd7a623..623a1c9915 100644
--- a/engines/prince/animation.cpp
+++ b/engines/prince/animation.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/animation.h b/engines/prince/animation.h
index 3471ffa158..e3b8677c3c 100644
--- a/engines/prince/animation.h
+++ b/engines/prince/animation.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/archive.cpp b/engines/prince/archive.cpp
index a01f824df8..984c078bfb 100644
--- a/engines/prince/archive.cpp
+++ b/engines/prince/archive.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/archive.h b/engines/prince/archive.h
index a640b77911..4b2ddfa81e 100644
--- a/engines/prince/archive.h
+++ b/engines/prince/archive.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/common.h b/engines/prince/common.h
index c846f9a751..f6b63cfabe 100644
--- a/engines/prince/common.h
+++ b/engines/prince/common.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/cursor.cpp b/engines/prince/cursor.cpp
index ddcabbd28f..ab3a52eaa2 100644
--- a/engines/prince/cursor.cpp
+++ b/engines/prince/cursor.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/cursor.h b/engines/prince/cursor.h
index fb07d01729..7694320fe9 100644
--- a/engines/prince/cursor.h
+++ b/engines/prince/cursor.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/curve_values.h b/engines/prince/curve_values.h
index d72f11fd36..f07f3615a3 100644
--- a/engines/prince/curve_values.h
+++ b/engines/prince/curve_values.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/debugger.cpp b/engines/prince/debugger.cpp
index 661b563944..ef5a7a5cd7 100644
--- a/engines/prince/debugger.cpp
+++ b/engines/prince/debugger.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/debugger.h b/engines/prince/debugger.h
index a4467e63d5..69047c6050 100644
--- a/engines/prince/debugger.h
+++ b/engines/prince/debugger.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/decompress.cpp b/engines/prince/decompress.cpp
index 7fba179541..2b563917f7 100644
--- a/engines/prince/decompress.cpp
+++ b/engines/prince/decompress.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/decompress.h b/engines/prince/decompress.h
index ef495db65e..87c0e1c591 100644
--- a/engines/prince/decompress.h
+++ b/engines/prince/decompress.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/detection.cpp b/engines/prince/detection.cpp
index ad759823d8..a081e683b1 100644
--- a/engines/prince/detection.cpp
+++ b/engines/prince/detection.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/detection.h b/engines/prince/detection.h
index 3076253cf5..b3d6153d38 100644
--- a/engines/prince/detection.h
+++ b/engines/prince/detection.h
@@ -8,12 +8,12 @@
* 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.
@@ -72,11 +72,27 @@ static const PrinceGameDescription gameDescriptions[] = {
{
{
"prince",
+ "Galador",
+ AD_ENTRY1s("talktxt.dat", "02bb2372f19aca3c65896ed81b2cefb3", 125702),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ ADGF_TESTING,
+ GUIO1(GUIO_NONE)
+ },
+ kPrinceDataDE
+ },
+ {
+ {
+ "prince",
"The Prince and the Coward",
- AD_ENTRY1s("databank.ptc", "5fa03833177331214ec1354761b1d2ee", 3565031),
+ {
+ {"databank.ptc", 0, "5fa03833177331214ec1354761b1d2ee", 3565031},
+ {"prince_translation.dat", 0, 0, -1},
+ AD_LISTEND
+ },
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_TESTING,
+ ADGF_TESTING | GF_TRANSLATED,
GUIO1(GUIO_NONE)
},
kPrinceDataDE
@@ -85,10 +101,14 @@ static const PrinceGameDescription gameDescriptions[] = {
{
"prince",
"The Prince and the Coward",
- AD_ENTRY1s("databank.ptc", "48ec9806bda9d152acbea8ce31c93c49", 3435298),
+ {
+ {"databank.ptc", 0, "48ec9806bda9d152acbea8ce31c93c49", 3435298},
+ {"prince_translation.dat", 0, 0, -1},
+ AD_LISTEND
+ },
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_TESTING,
+ ADGF_TESTING | GF_TRANSLATED,
GUIO1(GUIO_NONE)
},
kPrinceDataPL
diff --git a/engines/prince/flags.cpp b/engines/prince/flags.cpp
index f1a05bd4df..7877b276f5 100644
--- a/engines/prince/flags.cpp
+++ b/engines/prince/flags.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/flags.h b/engines/prince/flags.h
index 8337f82a95..23c0998db7 100644
--- a/engines/prince/flags.h
+++ b/engines/prince/flags.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/font.cpp b/engines/prince/font.cpp
index e81a93d1a1..bdc1d17c05 100644
--- a/engines/prince/font.cpp
+++ b/engines/prince/font.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index ea8c52a45b..6be1782f1c 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/graphics.h b/engines/prince/graphics.h
index 1a1737f976..66b83af371 100644
--- a/engines/prince/graphics.h
+++ b/engines/prince/graphics.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp
index b873e83360..037f11e95a 100644
--- a/engines/prince/hero.cpp
+++ b/engines/prince/hero.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/hero.h b/engines/prince/hero.h
index 703ef0650d..3727eb3da5 100644
--- a/engines/prince/hero.h
+++ b/engines/prince/hero.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/hero_set.h b/engines/prince/hero_set.h
index dfe7e50268..fc62cef757 100644
--- a/engines/prince/hero_set.h
+++ b/engines/prince/hero_set.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/mhwanh.cpp b/engines/prince/mhwanh.cpp
index 608ccc23d7..eea0e4f7e2 100644
--- a/engines/prince/mhwanh.cpp
+++ b/engines/prince/mhwanh.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/mhwanh.h b/engines/prince/mhwanh.h
index f8165a7666..6081f73a73 100644
--- a/engines/prince/mhwanh.h
+++ b/engines/prince/mhwanh.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/mob.cpp b/engines/prince/mob.cpp
index de825ef8b2..b170ba324b 100644
--- a/engines/prince/mob.cpp
+++ b/engines/prince/mob.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/mob.h b/engines/prince/mob.h
index 863fd3a319..a488bb5004 100644
--- a/engines/prince/mob.h
+++ b/engines/prince/mob.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/musNum.h b/engines/prince/musNum.h
index c24cba6ad7..8ab7e21b27 100644
--- a/engines/prince/musNum.h
+++ b/engines/prince/musNum.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/object.cpp b/engines/prince/object.cpp
index 2dc5da68e7..e4a3eda689 100644
--- a/engines/prince/object.cpp
+++ b/engines/prince/object.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/object.h b/engines/prince/object.h
index ff22a05805..5f012f16bf 100644
--- a/engines/prince/object.h
+++ b/engines/prince/object.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/option_text.h b/engines/prince/option_text.h
index d4d214c98c..f56dd421ec 100644
--- a/engines/prince/option_text.h
+++ b/engines/prince/option_text.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp
index b1a5438978..903f609d80 100644
--- a/engines/prince/prince.cpp
+++ b/engines/prince/prince.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -219,33 +219,40 @@ void PrinceEngine::init() {
debugEngine("Adding all path: %s", gameDataDir.getPath().c_str());
- PtcArchive *all = new PtcArchive();
- if (!all->open("all/databank.ptc"))
- error("Can't open all/databank.ptc");
+ if (getLanguage() != Common::RU_RUS) {
+ PtcArchive *all = new PtcArchive();
+ if (!all->open("all/databank.ptc"))
+ error("Can't open all/databank.ptc");
+
+ PtcArchive *voices = new PtcArchive();
+ if (!voices->open("voices/databank.ptc"))
+ error("Can't open voices/databank.ptc");
- PtcArchive *voices = new PtcArchive();
- if (!voices->open("voices/databank.ptc"))
- error("Can't open voices/databank.ptc");
+ PtcArchive *sound = new PtcArchive();
+ if (!sound->open("sound/databank.ptc"))
+ error("Can't open sound/databank.ptc");
- PtcArchive *sound = new PtcArchive();
- if (!sound->open("sound/databank.ptc"))
- error("Can't open sound/databank.ptc");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "all");
- PtcArchive *translation = new PtcArchive();
- if (getLanguage() != Common::PL_POL && getLanguage() != Common::DE_DEU) {
- if (!translation->openTranslation("all/prince_translation.dat"))
- error("Can't open prince_translation.dat");
+ // Prefix the archive names, so that "all" doesn't conflict with the
+ // "all" directory, if that happens to be named in all lower case.
+ // It isn't on the CD, but we should try to stay case-insensitive.
+ SearchMan.add("_all", all);
+ SearchMan.add("_voices", voices);
+ SearchMan.add("_sound", sound);
+ } else {
+ SearchMan.addSubDirectoryMatching(gameDataDir, "all");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "voices");
+ SearchMan.addSubDirectoryMatching(gameDataDir, "sound");
}
- SearchMan.addSubDirectoryMatching(gameDataDir, "all");
+ if (getFeatures() & GF_TRANSLATED) {
+ PtcArchive *translation = new PtcArchive();
+ if (getFeatures() & GF_TRANSLATED) {
+ if (!translation->openTranslation("all/prince_translation.dat"))
+ error("Can't open prince_translation.dat");
+ }
- // Prefix the archive names, so that "all" doesn't conflict with the
- // "all" directory, if that happens to be named in all lower case.
- // It isn't on the CD, but we should try to stay case-insensitive.
- SearchMan.add("_all", all);
- SearchMan.add("_voices", voices);
- SearchMan.add("_sound", sound);
- if (getLanguage() != Common::PL_POL && getLanguage() != Common::DE_DEU) {
SearchMan.add("translation", translation);
}
@@ -275,10 +282,10 @@ void PrinceEngine::init() {
_debugger = new Debugger(this, _flags);
_variaTxt = new VariaTxt();
- if (getLanguage() == Common::PL_POL || getLanguage() == Common::DE_DEU) {
- Resource::loadResource(_variaTxt, "variatxt.dat", true);
- } else {
+ if (getFeatures() & GF_TRANSLATED) {
Resource::loadResource(_variaTxt, "variatxt_translate.dat", true);
+ } else {
+ Resource::loadResource(_variaTxt, "variatxt.dat", true);
}
_cursor1 = new Cursor();
@@ -288,10 +295,10 @@ void PrinceEngine::init() {
Resource::loadResource(_cursor3, "mouse2.cur", true);
Common::SeekableReadStream *talkTxtStream;
- if (getLanguage() == Common::PL_POL || getLanguage() == Common::DE_DEU) {
- talkTxtStream = SearchMan.createReadStreamForMember("talktxt.dat");
- } else {
+ if (getFeatures() & GF_TRANSLATED) {
talkTxtStream = SearchMan.createReadStreamForMember("talktxt_translate.dat");
+ } else {
+ talkTxtStream = SearchMan.createReadStreamForMember("talktxt.dat");
}
if (!talkTxtStream) {
error("Can't load talkTxtStream");
@@ -304,10 +311,10 @@ void PrinceEngine::init() {
delete talkTxtStream;
Common::SeekableReadStream *invTxtStream;
- if (getLanguage() == Common::PL_POL || getLanguage() == Common::DE_DEU) {
- invTxtStream = SearchMan.createReadStreamForMember("invtxt.dat");
- } else {
+ if (getFeatures() & GF_TRANSLATED) {
invTxtStream = SearchMan.createReadStreamForMember("invtxt_translate.dat");
+ } else {
+ invTxtStream = SearchMan.createReadStreamForMember("invtxt.dat");
}
if (!invTxtStream) {
error("Can't load invTxtStream");
@@ -384,10 +391,10 @@ void PrinceEngine::init() {
_shadowLine = (byte *)malloc(kShadowLineArraySize);
Common::SeekableReadStream *creditsDataStream;
- if (getLanguage() == Common::PL_POL || getLanguage() == Common::DE_DEU) {
- creditsDataStream = SearchMan.createReadStreamForMember("credits.dat");
- } else {
+ if (getFeatures() & GF_TRANSLATED) {
creditsDataStream = SearchMan.createReadStreamForMember("credits_translate.dat");
+ } else {
+ creditsDataStream = SearchMan.createReadStreamForMember("credits.dat");
}
if (!creditsDataStream) {
error("Can't load creditsDataStream");
@@ -398,7 +405,7 @@ void PrinceEngine::init() {
creditsDataStream->read(_creditsData, _creditsDataSize);
delete creditsDataStream;
- if (getLanguage() != Common::PL_POL && getLanguage() != Common::DE_DEU) {
+ if (getFeatures() & GF_TRANSLATED) {
loadMobTranslationTexts();
}
}
@@ -551,7 +558,7 @@ bool PrinceEngine::loadLocation(uint16 locationNr) {
} else if (getGameType() == kPrinceDataPL) {
Resource::loadResource(_mobList, "mob.lst", false);
}
- if (getLanguage() != Common::PL_POL && getLanguage() != Common::DE_DEU) {
+ if (getFeatures() & GF_TRANSLATED) {
// update Mob texts for translated version
setMobTranslationTexts();
}
diff --git a/engines/prince/prince.h b/engines/prince/prince.h
index 5e07de691f..ee952ec5cc 100644
--- a/engines/prince/prince.h
+++ b/engines/prince/prince.h
@@ -8,12 +8,12 @@
* 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.
@@ -70,6 +70,10 @@ class Animation;
class Room;
class Pscr;
+enum {
+ GF_TRANSLATED = 1 << 0
+};
+
struct Text {
const char *_str;
uint16 _x, _y;
diff --git a/engines/prince/pscr.cpp b/engines/prince/pscr.cpp
index d9d36a3356..4f79704e62 100644
--- a/engines/prince/pscr.cpp
+++ b/engines/prince/pscr.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/pscr.h b/engines/prince/pscr.h
index fdcdb524a9..4067e7d4e1 100644
--- a/engines/prince/pscr.h
+++ b/engines/prince/pscr.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/resource.h b/engines/prince/resource.h
index f42eb87842..96bc2ea26d 100644
--- a/engines/prince/resource.h
+++ b/engines/prince/resource.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/saveload.cpp b/engines/prince/saveload.cpp
index d3360badd1..d0498f13e4 100644
--- a/engines/prince/saveload.cpp
+++ b/engines/prince/saveload.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp
index 89e22b586e..23ef24a268 100644
--- a/engines/prince/script.cpp
+++ b/engines/prince/script.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/script.h b/engines/prince/script.h
index fe79cf5f96..a62e69cda5 100644
--- a/engines/prince/script.h
+++ b/engines/prince/script.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/sound.cpp b/engines/prince/sound.cpp
index 22db9c4998..206b131cd2 100644
--- a/engines/prince/sound.cpp
+++ b/engines/prince/sound.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/sound.h b/engines/prince/sound.h
index 4257a4a37b..21f9e48b37 100644
--- a/engines/prince/sound.h
+++ b/engines/prince/sound.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/variatxt.cpp b/engines/prince/variatxt.cpp
index c38c65ce5d..f7ef0cb4da 100644
--- a/engines/prince/variatxt.cpp
+++ b/engines/prince/variatxt.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/variatxt.h b/engines/prince/variatxt.h
index 04c34bc0ef..f9238bb69a 100644
--- a/engines/prince/variatxt.h
+++ b/engines/prince/variatxt.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/prince/videoplayer.cpp b/engines/prince/videoplayer.cpp
index 0d07dea10a..2fc9003be5 100644
--- a/engines/prince/videoplayer.cpp
+++ b/engines/prince/videoplayer.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/scumm/cdda.h b/engines/scumm/cdda.h
index c1e6e82c9e..6ecbfbb313 100644
--- a/engines/scumm/cdda.h
+++ b/engines/scumm/cdda.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h
index 8d7ed81dd8..bd3cdb2c57 100644
--- a/engines/scumm/he/intern_he.h
+++ b/engines/scumm/he/intern_he.h
@@ -56,9 +56,11 @@ public:
Common::Rect _actorClipOverride; // HE specific
int _heTimers[16];
+ uint32 _pauseStartTime;
int getHETimer(int timer);
void setHETimer(int timer);
+ void pauseHETimers(bool pause);
public:
ScummEngine_v60he(OSystem *syst, const DetectorResult &dr);
@@ -94,6 +96,7 @@ protected:
Common::WriteStream *openSaveFileForAppending(const byte *fileName);
void deleteSaveFile(const byte *fileName);
void renameSaveFile(const byte *from, const byte *to);
+ void pauseEngineIntern(bool pause);
Common::SeekableReadStream *openSaveFileForReading(int slot, bool compat, Common::String &fileName);
Common::WriteStream *openSaveFileForWriting(int slot, bool compat, Common::String &fileName);
@@ -288,7 +291,7 @@ public:
virtual byte *getStringAddress(ResId idx);
virtual int setupStringArray(int size);
- virtual int setupStringArrayFromString(char *cStr);
+ virtual int setupStringArrayFromString(const char *cStr);
virtual void getStringFromArray(int arrayNumber, char *buffer, int maxLength);
protected:
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index c764de7da1..a922af1671 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -230,7 +230,7 @@ int ScummEngine_v72he::setupStringArray(int size) {
return readVar(0);
}
-int ScummEngine_v72he::setupStringArrayFromString(char *cStr) {
+int ScummEngine_v72he::setupStringArrayFromString(const char *cStr) {
// this is PUI_ScummStringArrayFromCString() found in PUSERMAC.cpp
// I can see how its done up there in setupStringArray()
// yet I'd note that 'SCUMMVAR_user_reserved' var was used instead of 0
diff --git a/engines/scumm/object.cpp b/engines/scumm/object.cpp
index da94a34baf..cbc24a8b7e 100644
--- a/engines/scumm/object.cpp
+++ b/engines/scumm/object.cpp
@@ -110,6 +110,16 @@ void ScummEngine::setOwnerOf(int obj, int owner) {
// This causes it to try to remove object 0 from the inventory.
if (_game.id == GID_PASS && obj == 0 && vm.slot[_currentScript].number == 94)
return;
+
+ // WORKAROUND for bug #6802: assert() was triggered in freddi2.
+ // Bug is in room 39. Problem is script 10, in the localvar2==78 case;
+ // this only sets the obj id if var198 is non-zero, but in the asserting
+ // case, it is obj 0. That means two setOwnerOf calls are made with obj 0.
+ // The correct setOwnerOf calls are made afterwards, so just ignoring this
+ // seems to work just fine.
+ if (_game.id == GID_HEGAME && obj == 0 && _currentRoom == 39 && vm.slot[_currentScript].number == 10)
+ return;
+
assert(obj > 0);
if (owner == 0) {
diff --git a/engines/scumm/players/player_pce.cpp b/engines/scumm/players/player_pce.cpp
index 89a3b07798..778c40f46d 100644
--- a/engines/scumm/players/player_pce.cpp
+++ b/engines/scumm/players/player_pce.cpp
@@ -28,7 +28,6 @@
* LFO and noise channel support have been removed (not used by Loom PCE).
*/
-#include <math.h>
#include "scumm/players/player_pce.h"
#include "common/endian.h"
diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index 6c81f17f2f..62c62c0b4a 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -707,6 +707,17 @@ void ScummEngine_v6::o6_ifNot() {
void ScummEngine_v6::o6_jump() {
int offset = fetchScriptWordSigned();
+ // WORKAROUND bug #6097: Pressing escape at the lake side entrance of
+ // the cave while Putt Putt is not on solid ground and still talking
+ // will cause the raft to disappear. This is a script bug in the
+ // original game and affects several versions.
+ if (_game.id == GID_PUTTZOO) {
+ if (_game.heversion == 73 && vm.slot[_currentScript].number == 206 && offset == 176 && !isScriptRunning(202))
+ _scummVars[244] = 35;
+ if (_game.features & GF_HE_985 && vm.slot[_currentScript].number == 2054 && offset == 178 && !isScriptRunning(2050))
+ _scummVars[202] = 35;
+ }
+
// WORKAROUND bug #2826144: Talking to the guard at the bigfoot party, after
// he's let you inside, will cause the game to hang, if you end the conversation.
// This is a script bug, due to a missing jump in one segment of the script.
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 72c6909f8c..107228453e 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -2589,6 +2589,30 @@ void ScummEngine_v60he::setHETimer(int timer) {
_heTimers[timer] = _system->getMillis();
}
+void ScummEngine_v60he::pauseHETimers(bool pause) {
+ // The HE timers rely on system time which of course doesn't pause when
+ // the engine does. By adding the elapsed time we compensate for this.
+ // Fixes bug #6352
+ if (pause) {
+ // Pauses can be layered, we only need the start of the first
+ if (!_pauseStartTime)
+ _pauseStartTime = _system->getMillis();
+ } else {
+ int elapsedTime = _system->getMillis() - _pauseStartTime;
+ for (int i = 0; i < ARRAYSIZE(_heTimers); i++) {
+ if (_heTimers[i] != 0)
+ _heTimers[i] += elapsedTime;
+ }
+ _pauseStartTime = 0;
+ }
+}
+
+void ScummEngine_v60he::pauseEngineIntern(bool pause) {
+ pauseHETimers(pause);
+
+ ScummEngine::pauseEngineIntern(pause);
+}
+
void ScummEngine::pauseGame() {
pauseDialog();
}
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 8763af31dd..7c2d1c263a 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -438,8 +438,9 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
}
}
- // Is it a control character?
- if (isPrintable(c)) {
+ if (c == '\r' || c == '\n') {
+ journalString += '\n';
+ } else if (isPrintable(c)) {
// Nope. Set flag for allowing control codes to insert spaces
ctrlSpace = true;
justChangedSpeaker = false;
diff --git a/engines/sherlock/tattoo/tattoo_journal.h b/engines/sherlock/tattoo/tattoo_journal.h
index 9f0fa1fc9b..282f5b05f1 100644
--- a/engines/sherlock/tattoo/tattoo_journal.h
+++ b/engines/sherlock/tattoo/tattoo_journal.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef SHERLOCK_TATTOO_JOURNAL_H
#define SHERLOCK_TATTOO_JOURNAL_H
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 9f126cf7a7..c0b3180a51 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -377,14 +377,14 @@ void WidgetInventoryVerbs::handleEvents() {
innerBounds.grow(-3);
// Flag is they started pressing outside of the menu
- if (events._firstPress && !_bounds.contains(mousePos))
+ if (events._firstPress && !innerBounds.contains(mousePos))
_outsideMenu = true;
if (events._released || events._rightReleased || ui._keyState.keycode == Common::KEYCODE_ESCAPE) {
ui._scrollHighlight = SH_NONE;
banishWindow();
- if ((_outsideMenu && !innerBounds.contains(mousePos)) || ui._keyState.keycode == Common::KEYCODE_ESCAPE) {
+ if (_outsideMenu || ui._keyState.keycode == Common::KEYCODE_ESCAPE) {
_owner->_invVerbMode = 0;
} else if (innerBounds.contains(mousePos)) {
_outsideMenu = false;
diff --git a/engines/sword2/animation.h b/engines/sword2/animation.h
index 8669bdc8d8..f3bb6e35c9 100644
--- a/engines/sword2/animation.h
+++ b/engines/sword2/animation.h
@@ -11,12 +11,12 @@
* 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.
diff --git a/engines/sword2/header.cpp b/engines/sword2/header.cpp
index 9c50db90d4..10c6c1e7f8 100644
--- a/engines/sword2/header.cpp
+++ b/engines/sword2/header.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp
index 99a0d37ed7..e7f8d04d56 100644
--- a/engines/sword25/math/polygon.cpp
+++ b/engines/sword25/math/polygon.cpp
@@ -29,8 +29,6 @@
*
*/
-#include <math.h>
-
#include "sword25/kernel/outputpersistenceblock.h"
#include "sword25/kernel/inputpersistenceblock.h"
diff --git a/engines/sword25/math/vertex.h b/engines/sword25/math/vertex.h
index 89ad344f6a..574ce39e60 100644
--- a/engines/sword25/math/vertex.h
+++ b/engines/sword25/math/vertex.h
@@ -40,7 +40,6 @@
#define SWORD25_VERTEX_H
// Includes
-#include <math.h>
#include "common/rect.h"
#include "sword25/kernel/common.h"
diff --git a/engines/testbed/cloud.cpp b/engines/testbed/cloud.cpp
index a2d62733be..dfd7434e45 100644
--- a/engines/testbed/cloud.cpp
+++ b/engines/testbed/cloud.cpp
@@ -1,31 +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.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/config-manager.h"
#include "common/stream.h"
#include "common/util.h"
#include "testbed/fs.h"
#include "testbed/cloud.h"
-#include <backends/cloud/cloudmanager.h>
+#include "backends/cloud/cloudmanager.h"
namespace Testbed {
diff --git a/engines/testbed/cloud.h b/engines/testbed/cloud.h
index ed27d7da82..f27b61f39c 100644
--- a/engines/testbed/cloud.h
+++ b/engines/testbed/cloud.h
@@ -24,7 +24,7 @@
#define TESTBED_CLOUD_H
#include "testbed/testsuite.h"
-#include <backends/cloud/storage.h>
+#include "backends/cloud/storage.h"
// This file can be used as template for header files of other newer testsuites.
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index 43580104e7..4943a42284 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -47,6 +47,7 @@ GFXTestSuite::GFXTestSuite() {
// Init Mouse Palette (White-black-yellow)
GFXtests::initMousePalette();
+ GFXtests::initMouseCursor();
// Add tests here
@@ -103,6 +104,29 @@ void GFXtests::initMousePalette() {
CursorMan.replaceCursorPalette(palette, 0, 3);
}
+static const byte MOUSECURSOR_SCI[] = {
+ 1,1,0,0,0,0,0,0,0,0,0,
+ 1,2,1,0,0,0,0,0,0,0,0,
+ 1,2,2,1,0,0,0,0,0,0,0,
+ 1,2,2,2,1,0,0,0,0,0,0,
+ 1,2,2,2,2,1,0,0,0,0,0,
+ 1,2,2,2,2,2,1,0,0,0,0,
+ 1,2,2,2,2,2,2,1,0,0,0,
+ 1,2,2,2,2,2,2,2,1,0,0,
+ 1,2,2,2,2,2,2,2,2,1,0,
+ 1,2,2,2,2,2,2,2,2,2,1,
+ 1,2,2,2,2,2,1,0,0,0,0,
+ 1,2,1,0,1,2,2,1,0,0,0,
+ 1,1,0,0,1,2,2,1,0,0,0,
+ 0,0,0,0,0,1,2,2,1,0,0,
+ 0,0,0,0,0,1,2,2,1,0,0,
+ 0,0,0,0,0,0,1,2,2,1,0
+};
+
+void GFXtests::initMouseCursor() {
+ CursorMan.replaceCursor(MOUSECURSOR_SCI, 11, 16, 0, 0, 0);
+}
+
Common::Rect GFXtests::computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale) {
if (cursorTargetScale == 1 || scalingFactor == 1) {
// Game data and cursor would be scaled equally.
diff --git a/engines/testbed/graphics.h b/engines/testbed/graphics.h
index 139eeb97dd..ebb7b40be8 100644
--- a/engines/testbed/graphics.h
+++ b/engines/testbed/graphics.h
@@ -33,6 +33,7 @@ namespace GFXtests {
void drawEllipse(int x, int y, int a, int b);
void setupMouseLoop(bool disableCursorPalette = false, const char *gfxModeName = "", int cursorTargetScale = 1);
void initMousePalette();
+void initMouseCursor();
Common::Rect computeSize(const Common::Rect &cursorRect, int scalingFactor, int cursorTargetScale);
void HSVtoRGB(int &rComp, int &gComp, int &bComp, int hue, int sat, int val);
Common::Rect drawCursor(bool cursorPaletteDisabled = false, int cursorTargetScale = 1);
diff --git a/engines/testbed/misc.cpp b/engines/testbed/misc.cpp
index 20651e76e6..a463d9e4d0 100644
--- a/engines/testbed/misc.cpp
+++ b/engines/testbed/misc.cpp
@@ -22,7 +22,7 @@
#include "testbed/misc.h"
#include "common/timer.h"
-#include <backends/networking/browser/openurl.h>
+#include "backends/networking/browser/openurl.h"
namespace Testbed {
diff --git a/engines/testbed/webserver.cpp b/engines/testbed/webserver.cpp
index feb2911704..b4c69b278d 100644
--- a/engines/testbed/webserver.cpp
+++ b/engines/testbed/webserver.cpp
@@ -1,29 +1,29 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "testbed/webserver.h"
#include "backends/networking/sdl_net/localwebserver.h"
#include "common/config-manager.h"
-#include <backends/networking/browser/openurl.h>
+#include "backends/networking/browser/openurl.h"
namespace Testbed {
diff --git a/engines/titanic/carry/arm.cpp b/engines/titanic/carry/arm.cpp
index a67937ebdf..cbc14da477 100644
--- a/engines/titanic/carry/arm.cpp
+++ b/engines/titanic/carry/arm.cpp
@@ -161,7 +161,7 @@ bool CArm::MaitreDHappyMsg(CMaitreDHappyMsg *msg) {
CGameObject *petItem;
if (find(getName(), &petItem, FIND_PET)) {
if (!_field158)
- playSound("z#47.wav", 100, 0, 0);
+ playSound("z#47.wav");
if (_string6 == "Key" || _string6 == "AuditoryCentre") {
CGameObject *child = dynamic_cast<CGameObject *>(getFirstChild());
if (child) {
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index 102d8d9049..64b068697b 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -68,7 +68,7 @@ bool CBrain::UseWithOtherMsg(CUseWithOtherMsg *msg) {
petMoveToHiddenRoom();
CAddHeadPieceMsg headpieceMsg(getName());
headpieceMsg.execute(msg->_other);
- playSound("z#116.wav", 100, 0, 0);
+ playSound("z#116.wav");
setPosition(Point(0, 0));
setVisible(false);
_field134 = 1;
diff --git a/engines/titanic/carry/bridge_piece.cpp b/engines/titanic/carry/bridge_piece.cpp
index a2cb23add6..487ea32df6 100644
--- a/engines/titanic/carry/bridge_piece.cpp
+++ b/engines/titanic/carry/bridge_piece.cpp
@@ -60,7 +60,7 @@ bool CBridgePiece::UseWithOtherMsg(CUseWithOtherMsg *msg) {
return true;
} else {
setVisible(false);
- playSound("z#54.wav", 100, 0, 0);
+ playSound("z#54.wav");
setPosition(shipSetting->_pos1);
shipSetting->_itemName = getName();
petMoveToHiddenRoom();
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp
index b0461ded26..57d82af78a 100644
--- a/engines/titanic/carry/carry_parrot.cpp
+++ b/engines/titanic/carry/carry_parrot.cpp
@@ -43,16 +43,15 @@ BEGIN_MESSAGE_MAP(CCarryParrot, CCarry)
END_MESSAGE_MAP()
CCarryParrot::CCarryParrot() : CCarry(), _string6("PerchedParrot"),
- _timerId(0), _field13C(0), _field140(false), _field144(10),
- _field148(25), _field14C(0), _field150(8) {
+ _timerId(0), _freeCounter(0), _feathersFlag(false) {
}
void CCarryParrot::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeQuotedLine(_string6, indent);
file->writeNumberLine(_timerId, indent);
- file->writeNumberLine(_field13C, indent);
- file->writeNumberLine(_field140, indent);
+ file->writeNumberLine(_freeCounter, indent);
+ file->writeNumberLine(_feathersFlag, indent);
CCarry::save(file, indent);
}
@@ -61,8 +60,8 @@ void CCarryParrot::load(SimpleFile *file) {
file->readNumber();
_string6 = file->readString();
_timerId = file->readNumber();
- _field13C = file->readNumber();
- _field140 = file->readNumber();
+ _freeCounter = file->readNumber();
+ _feathersFlag = file->readNumber();
CCarry::load(file);
}
@@ -77,7 +76,7 @@ bool CCarryParrot::PETGainedObjectMsg(CPETGainedObjectMsg *msg) {
bool CCarryParrot::TimerMsg(CTimerMsg *msg) {
if (CParrot::_v4 == 1 || CParrot::_v4 == 4) {
- if (++_field13C >= 30) {
+ if (++_freeCounter >= 30) {
CActMsg actMsg("FreeParrot");
actMsg.execute(this);
}
@@ -125,7 +124,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
setVisible(false);
_fieldE0 = 0;
CParrot::_v4 = 2;
- playSound("z#475.wav", 100, 0, 0);
+ playSound("z#475.wav");
sound8(true);
moveUnder(findRoom());
@@ -140,7 +139,7 @@ bool CCarryParrot::MouseDragEndMsg(CMouseDragEndMsg *msg) {
} else {
setVisible(false);
_fieldE0 = 0;
- playSound("z#475.wav", 100, 0, 0);
+ playSound("z#475.wav");
sound8(true);
moveUnder(findRoom());
}
@@ -160,7 +159,7 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
stopTimer(_timerId);
_timerId = addTimer(1000, 1000);
- _field13C = 0;
+ _freeCounter = 0;
CParrot::_v4 = 1;
msg->_value3 = 1;
@@ -172,7 +171,7 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) {
startTalking(npc, 0x446BF);
_fieldE0 = 0;
- playSound("z#475.wav", 100, 0, 0);
+ playSound("z#475.wav");
moveUnder(findRoom());
msg->_value4 = 1;
@@ -209,16 +208,16 @@ bool CCarryParrot::ActMsg(CActMsg *msg) {
CActMsg actMsg("Shut");
actMsg.execute("ParrotCage");
} else {
- playSound("z#475.wav", 100, 0, 0);
+ playSound("z#475.wav");
- if (!_field140) {
+ if (!_feathersFlag) {
CCarry *feathers = dynamic_cast<CCarry *>(getRoot()->findByName("Feathers"));
if (feathers) {
feathers->setVisible(true);
feathers->petAddToInventory();
}
- _field140 = true;
+ _feathersFlag = true;
}
getPetControl()->removeFromInventory(this);
diff --git a/engines/titanic/carry/carry_parrot.h b/engines/titanic/carry/carry_parrot.h
index 2980f26d8a..c42475e5f0 100644
--- a/engines/titanic/carry/carry_parrot.h
+++ b/engines/titanic/carry/carry_parrot.h
@@ -44,12 +44,8 @@ class CCarryParrot : public CCarry {
private:
CString _string6;
int _timerId;
- int _field13C;
- bool _field140;
- int _field144;
- int _field148;
- int _field14C;
- int _field150;
+ int _freeCounter;
+ bool _feathersFlag;
public:
CLASSDEF;
CCarryParrot();
diff --git a/engines/titanic/carry/plug_in.cpp b/engines/titanic/carry/plug_in.cpp
index 883458c9b1..438b9a5883 100644
--- a/engines/titanic/carry/plug_in.cpp
+++ b/engines/titanic/carry/plug_in.cpp
@@ -28,16 +28,18 @@ BEGIN_MESSAGE_MAP(CPlugIn, CCarry)
ON_MESSAGE(UseWithOtherMsg)
END_MESSAGE_MAP()
-CPlugIn::CPlugIn() : CCarry(), _field12C(0) {
+CPlugIn::CPlugIn() : CCarry(), _unused(0) {
}
void CPlugIn::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
+ file->writeNumberLine(_unused, indent);
CCarry::save(file, indent);
}
void CPlugIn::load(SimpleFile *file) {
file->readNumber();
+ _unused = file->readNumber();
CCarry::load(file);
}
diff --git a/engines/titanic/carry/plug_in.h b/engines/titanic/carry/plug_in.h
index 1358a99e39..5f7d5dd2b0 100644
--- a/engines/titanic/carry/plug_in.h
+++ b/engines/titanic/carry/plug_in.h
@@ -31,7 +31,7 @@ class CPlugIn : public CCarry {
DECLARE_MESSAGE_MAP;
bool UseWithOtherMsg(CUseWithOtherMsg *msg);
private:
- int _field12C;
+ int _unused;
public:
CLASSDEF;
CPlugIn();
diff --git a/engines/titanic/configure.engine b/engines/titanic/configure.engine
index daf4e6b388..1697a779c0 100644
--- a/engines/titanic/configure.engine
+++ b/engines/titanic/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine titanic "Starship Titanic" no "" "" "16bit jpeg highres"
+add_engine titanic "Starship Titanic" no "" "" "16bit jpeg highres mad"
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 7848734792..edfce7f2ee 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -732,10 +732,10 @@ void CGameObject::loadSound(const CString &name) {
}
}
-int CGameObject::playSound(const CString &name, uint volume, int val3, bool repeated) {
+int CGameObject::playSound(const CString &name, uint volume, int balance, bool repeated) {
CProximity prox;
prox._channelVolume = volume;
- prox._fieldC = val3;
+ prox._balance = balance;
prox._repeated = repeated;
return playSound(name, prox);
}
@@ -758,9 +758,9 @@ int CGameObject::playSound(const CString &name, CProximity &prox) {
return 0;
}
-int CGameObject::queueSound(const CString &name, uint priorHandle, uint volume, int val3, bool repeated) {
+int CGameObject::queueSound(const CString &name, uint priorHandle, uint volume, int balance, bool repeated) {
CProximity prox;
- prox._fieldC = val3;
+ prox._balance = balance;
prox._repeated = repeated;
prox._channelVolume = volume;
prox._priorSoundHandle = priorHandle;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index d72fd94ac4..0da3fad605 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -189,24 +189,30 @@ protected:
/**
* Plays a sound
- * @param resName Filename of sound to play
+ * @param name Filename of sound to play
* @param volume Volume level
+ * @param balance Sound balance (not actually used in original)
+ * @param repeated If true, sound will repeat indefinitely
*/
- int playSound(const CString &name, uint volume = 100, int val3 = 0, bool repeated = false);
+ int playSound(const CString &name, uint volume = 100, int balance = 0, bool repeated = false);
/**
* Plays a sound
- * @param resName Filename of sound to play
+ * @param name Filename of sound to play
* @param prox Proximity object with the sound data
*/
int playSound(const CString &name, CProximity &prox);
/**
* Queues a sound to play after a specified one finishes
- * @param resName Filename of sound to play
- * @param volume Volume level
- */
- int queueSound(const CString &name, uint priorHandle, uint volume = 100, int val3 = 0, bool repeated = false);
+ * @param name Filename of sound to play
+ * @param priorHandle Sound to wait until finished before playing
+ * @param volume Volume level
+ * @param balance Sound balance (not actually used by original)
+ * @param repeated If true, sound will repeat indefinitely
+ */
+ int queueSound(const CString &name, uint priorHandle, uint volume = 100,
+ int balance = 0, bool repeated = false);
/**
* Stop a sound
diff --git a/engines/titanic/core/room_item.cpp b/engines/titanic/core/room_item.cpp
index 541a8e1a9e..49b3232ba1 100644
--- a/engines/titanic/core/room_item.cpp
+++ b/engines/titanic/core/room_item.cpp
@@ -36,8 +36,8 @@ void CRoomItem::save(SimpleFile *file, int indent) {
_exitMovieKey.save(file, indent);
file->writeQuotedLine("Room dimensions x 1000", indent);
- file->writeNumberLine(_roomDimensionX * 1000.0, indent + 1);
- file->writeNumberLine(_roomDimensionY * 1000.0, indent + 1);
+ file->writeNumberLine((int)(_roomDimensionX * 1000.0), indent + 1);
+ file->writeNumberLine((int)(_roomDimensionY * 1000.0), indent + 1);
file->writeQuotedLine("Transition Movie", indent);
_transitionMovieKey.save(file, indent);
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index af23fca027..176765b12f 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -115,19 +115,19 @@ void CViewItem::preEnterView(CViewItem *newView) {
// Only do the processing if we've been passed a view, and it's not the same
if (newView && newView != this) {
CPreEnterViewMsg viewMsg(this, newView);
- viewMsg.execute(this, nullptr, MSGFLAG_SCAN);
+ viewMsg.execute(newView, nullptr, MSGFLAG_SCAN);
CNodeItem *oldNode = findNode();
CNodeItem *newNode = newView->findNode();
if (newNode != oldNode) {
CPreEnterNodeMsg nodeMsg(oldNode, newNode);
- nodeMsg.execute(oldNode, nullptr, MSGFLAG_SCAN);
+ nodeMsg.execute(newNode, nullptr, MSGFLAG_SCAN);
CRoomItem *oldRoom = oldNode->findRoom();
CRoomItem *newRoom = newNode->findRoom();
if (newRoom != oldRoom) {
CPreEnterRoomMsg roomMsg(oldRoom, newRoom);
- roomMsg.execute(oldRoom, nullptr, MSGFLAG_SCAN);
+ roomMsg.execute(newRoom, nullptr, MSGFLAG_SCAN);
}
}
}
@@ -137,13 +137,13 @@ void CViewItem::enterView(CViewItem *newView) {
// Only do the processing if we've been passed a view, and it's not the same
if (newView && newView != this) {
CEnterViewMsg viewMsg(this, newView);
- viewMsg.execute(this, nullptr, MSGFLAG_SCAN);
+ viewMsg.execute(newView, nullptr, MSGFLAG_SCAN);
CNodeItem *oldNode = findNode();
CNodeItem *newNode = newView->findNode();
if (newNode != oldNode) {
CEnterNodeMsg nodeMsg(oldNode, newNode);
- nodeMsg.execute(oldNode, nullptr, MSGFLAG_SCAN);
+ nodeMsg.execute(newNode, nullptr, MSGFLAG_SCAN);
CRoomItem *oldRoom = oldNode->findRoom();
CRoomItem *newRoom = newNode->findRoom();
@@ -157,7 +157,7 @@ void CViewItem::enterView(CViewItem *newView) {
if (newRoom != oldRoom) {
CEnterRoomMsg roomMsg(oldRoom, newRoom);
- roomMsg.execute(oldRoom, nullptr, MSGFLAG_SCAN);
+ roomMsg.execute(newRoom, nullptr, MSGFLAG_SCAN);
if (petControl)
petControl->enterRoom(newRoom);
diff --git a/engines/titanic/detection.cpp b/engines/titanic/detection.cpp
index 86d26f2f27..096cd4b618 100644
--- a/engines/titanic/detection.cpp
+++ b/engines/titanic/detection.cpp
@@ -90,7 +90,8 @@ bool TitanicMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave) ||
(f == kSavesSupportMetaInfo) ||
- (f == kSavesSupportThumbnail);
+ (f == kSavesSupportThumbnail) ||
+ (f == kSimpleSavesNames);
}
bool Titanic::TitanicEngine::hasFeature(EngineFeature f) const {
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 318ddf5726..fa057de432 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -125,12 +125,17 @@ void Events::sleep(uint time) {
}
bool Events::waitForPress(uint expiry) {
+ CGameManager *gameManager = g_vm->_window->_gameManager;
uint32 delayEnd = g_system->getMillis() + expiry;
while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
g_system->delayMillis(10);
checkForNextFrameCounter();
+ // Regularly update the sound mixer
+ if (gameManager)
+ gameManager->_sound.updateMixer();
+
Common::Event event;
if (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {
diff --git a/engines/titanic/game/computer.cpp b/engines/titanic/game/computer.cpp
index 90574997b1..3077b46178 100644
--- a/engines/titanic/game/computer.cpp
+++ b/engines/titanic/game/computer.cpp
@@ -46,7 +46,7 @@ void CComputer::load(SimpleFile *file) {
bool CComputer::ActMsg(CActMsg *msg) {
if (_state) {
- playSound("a#35.wav", 100, 0, 0);
+ playSound("a#35.wav");
playMovie(32, 42, 0);
if (msg->_action == "CD1")
@@ -66,11 +66,11 @@ bool CComputer::ActMsg(CActMsg *msg) {
bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (_currentCD == "None") {
if (_state) {
- playSound("a#35.wav", 100, 0, 0);
+ playSound("a#35.wav");
playMovie(11, 21, 0);
_state = 0;
} else {
- playSound("a#34.wav", 100, 0, 0);
+ playSound("a#34.wav");
playMovie(0, 10, 0);
_state = 1;
}
@@ -81,7 +81,7 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
actMsg.execute(_currentCD);
_currentCD = "None";
} else {
- playSound("a#34.wav", 100, 0, 0);
+ playSound("a#34.wav");
playMovie(21, 31, 0);
_state = 1;
}
@@ -92,10 +92,10 @@ bool CComputer::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
bool CComputer::MovieEndMsg(CMovieEndMsg *msg) {
if (msg->_endFrame == 90) {
- playSound("a#32.wav", 100, 0, 0);
- playSound("a#33.wav", 100, 0, 0);
- playSound("a#31.wav", 100, 0, 0);
- playSound("a#0.wav", 100, 0, 0);
+ playSound("a#32.wav");
+ playSound("a#33.wav");
+ playSound("a#31.wav");
+ playSound("a#0.wav");
gotoView("Home.Node 4.E", "_TRACK,3,e-cu,4,E");
}
diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp
index 3e5172219d..9a7ac4b34e 100644
--- a/engines/titanic/game/computer_screen.cpp
+++ b/engines/titanic/game/computer_screen.cpp
@@ -57,7 +57,7 @@ bool CComputerScreen::ActMsg(CActMsg *msg) {
}
bool CComputerScreen::MovieEndMsg(CMovieEndMsg *msg) {
- playSound("z#47.wav", 100, 0, 0);
+ playSound("z#47.wav");
addTimer(0, 3000, 0);
for (int idx = 0; idx < 10; ++idx)
@@ -111,7 +111,7 @@ bool CComputerScreen::TimerMsg(CTimerMsg *msg) {
playSound("a#29.wav");
stopSound(handle);
- playSound("y#662.wav");
+ handle = playSound("y#662.wav");
setSoundVolume(handle, 10, 2);
playClip(392, 450);
startTalking("Doorbot", 0x3611A);
diff --git a/engines/titanic/game/fan_noises.cpp b/engines/titanic/game/fan_noises.cpp
index c6e6d203dd..9144f523f4 100644
--- a/engines/titanic/game/fan_noises.cpp
+++ b/engines/titanic/game/fan_noises.cpp
@@ -34,7 +34,7 @@ BEGIN_MESSAGE_MAP(CFanNoises, CGameObject)
END_MESSAGE_MAP()
CFanNoises::CFanNoises() : CGameObject(), _state(-1),
- _soundHandle(0), _soundPercent(70), _soundV3(-1), _soundSeconds(0),
+ _soundHandle(0), _soundPercent(70), _soundBalance(0), _soundSeconds(0),
_stopSeconds(0), _startFlag(true) {
}
@@ -43,7 +43,7 @@ void CFanNoises::save(SimpleFile *file, int indent) {
file->writeNumberLine(_state, indent);
file->writeNumberLine(_soundHandle, indent);
file->writeNumberLine(_soundPercent, indent);
- file->writeNumberLine(_soundV3, indent);
+ file->writeNumberLine(_soundBalance, indent);
file->writeNumberLine(_soundSeconds, indent);
file->writeNumberLine(_stopSeconds, indent);
file->writeNumberLine(_startFlag, indent);
@@ -56,7 +56,7 @@ void CFanNoises::load(SimpleFile *file) {
_state = file->readNumber();
_soundHandle = file->readNumber();
_soundPercent = file->readNumber();
- _soundV3 = file->readNumber();
+ _soundBalance = file->readNumber();
_soundSeconds = file->readNumber();
_stopSeconds = file->readNumber();
_startFlag = file->readNumber();
@@ -75,12 +75,12 @@ bool CFanNoises::EnterRoomMsg(CEnterRoomMsg *msg) {
switch (_state) {
case 1:
- _soundHandle = playSound("b#60.wav", 0, _soundV3, true);
+ _soundHandle = playSound("b#60.wav", 0, _soundBalance, true);
setSoundVolume(_soundHandle, _soundPercent, _soundSeconds);
_startFlag = true;
break;
case 2:
- _soundHandle = playSound("b#58.wav", 0, _soundV3, true);
+ _soundHandle = playSound("b#58.wav", 0, _soundBalance, true);
setSoundVolume(_soundHandle, _soundPercent, _soundSeconds);
_startFlag = true;
break;
@@ -122,7 +122,7 @@ bool CFanNoises::StatusChangeMsg(CStatusChangeMsg *msg) {
switch (oldState) {
case 1:
case 2:
- playSound("b#59.wav", _soundPercent, _soundV3);
+ playSound("b#59.wav", _soundPercent, _soundBalance);
break;
default:
break;
@@ -140,7 +140,7 @@ bool CFanNoises::StatusChangeMsg(CStatusChangeMsg *msg) {
switch (oldState) {
case 1:
case 2:
- _soundHandle = playSound("b#60.wav", _soundPercent, _soundV3);
+ _soundHandle = playSound("b#60.wav", _soundPercent, _soundBalance);
break;
default:
break;
@@ -156,7 +156,7 @@ bool CFanNoises::StatusChangeMsg(CStatusChangeMsg *msg) {
}
if (oldState == 1) {
- _soundHandle = playSound("b#58.wav", _soundPercent, _soundV3);
+ _soundHandle = playSound("b#58.wav", _soundPercent, _soundBalance);
}
break;
@@ -184,13 +184,13 @@ bool CFanNoises::LoadSuccessMsg(CLoadSuccessMsg *msg) {
switch (_state) {
case 1:
- playSound("b#60.wav", 0, _soundV3, true);
+ playSound("b#60.wav", 0, _soundBalance, true);
setSoundVolume(_soundHandle, _soundPercent, _soundSeconds);
_startFlag = true;
break;
case 2:
- playSound("b#58.wav", 0, _soundV3, true);
+ playSound("b#58.wav", 0, _soundBalance, true);
setSoundVolume(_soundHandle, _soundPercent, _soundSeconds);
_startFlag = true;
break;
diff --git a/engines/titanic/game/fan_noises.h b/engines/titanic/game/fan_noises.h
index 56c80c0764..488d42e79e 100644
--- a/engines/titanic/game/fan_noises.h
+++ b/engines/titanic/game/fan_noises.h
@@ -39,7 +39,7 @@ private:
int _state;
int _soundHandle;
int _soundPercent;
- int _soundV3;
+ int _soundBalance;
int _soundSeconds;
int _stopSeconds;
bool _startFlag;
diff --git a/engines/titanic/game/television.cpp b/engines/titanic/game/television.cpp
index ba30fbe281..780f92b5ad 100644
--- a/engines/titanic/game/television.cpp
+++ b/engines/titanic/game/television.cpp
@@ -237,8 +237,8 @@ bool CTelevision::MovieEndMsg(CMovieEndMsg *msg) {
}
if (_fieldE0 == 3 && compareRoomNameTo("SGTState") && !getPassengerClass()) {
- playSound("z#47.wav", 100, 0, 0);
- _soundHandle = playSound("b#20.wav", 100, 0, 0);
+ playSound("z#47.wav");
+ _soundHandle = playSound("b#20.wav");
CMagazine *magazine = dynamic_cast<CMagazine *>(getRoot()->findByName("Magazine"));
if (magazine) {
diff --git a/engines/titanic/game/transport/exit_pellerator.cpp b/engines/titanic/game/transport/exit_pellerator.cpp
index 400214a140..12ea9c3906 100644
--- a/engines/titanic/game/transport/exit_pellerator.cpp
+++ b/engines/titanic/game/transport/exit_pellerator.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "titanic/game/transport/pellerator.h"
diff --git a/engines/titanic/game/transport/exit_pellerator.h b/engines/titanic/game/transport/exit_pellerator.h
index 53056c7417..794f162b03 100644
--- a/engines/titanic/game/transport/exit_pellerator.h
+++ b/engines/titanic/game/transport/exit_pellerator.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef TITANIC_PELLERATOR_H
#define TITANIC_PELLERATOR_H
diff --git a/engines/titanic/game/transport/lift.h b/engines/titanic/game/transport/lift.h
index c45d2b64d0..c69f7a02e6 100644
--- a/engines/titanic/game/transport/lift.h
+++ b/engines/titanic/game/transport/lift.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef TITANIC_LIFT_H
#define TITANIC_LIFT_H
diff --git a/engines/titanic/game/transport/pellerator.cpp b/engines/titanic/game/transport/pellerator.cpp
index 5bc2423478..e4af40c334 100644
--- a/engines/titanic/game/transport/pellerator.cpp
+++ b/engines/titanic/game/transport/pellerator.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "titanic/game/transport/pellerator.h"
#include "titanic/core/room_item.h"
diff --git a/engines/titanic/game/transport/pellerator.h b/engines/titanic/game/transport/pellerator.h
index c634f435cc..2ba4a1347a 100644
--- a/engines/titanic/game/transport/pellerator.h
+++ b/engines/titanic/game/transport/pellerator.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef TITANIC_PELLERATOR_H
#define TITANIC_PELLERATOR_H
diff --git a/engines/titanic/gfx/music_slider_speed.h b/engines/titanic/gfx/music_slider_speed.h
index 2d54f4487c..ce7b4d3b1c 100644
--- a/engines/titanic/gfx/music_slider_speed.h
+++ b/engines/titanic/gfx/music_slider_speed.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef TITANIC_MUSIC_SLIDER_SPEED_H
#define TITANIC_MUSIC_SLIDER_SPEED_H
diff --git a/engines/titanic/gfx/music_switch_reverse.h b/engines/titanic/gfx/music_switch_reverse.h
index c101f19d25..40e36a8663 100644
--- a/engines/titanic/gfx/music_switch_reverse.h
+++ b/engines/titanic/gfx/music_switch_reverse.h
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#ifndef TITANIC_MUSIC_SWITCH_REVERSE_H
#define TITANIC_MUSIC_SWITCH_REVERSE_H
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 6fc31f4c64..d735796bd6 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -68,7 +68,7 @@ void CSTButton::load(SimpleFile *file) {
bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
playMovie(0);
- playSound(_soundName, 100, 0, 0);
+ playSound(_soundName);
return true;
}
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 530d5796f4..7bd918df04 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -40,7 +40,6 @@ private:
TitanicEngine *_vm;
int _pendingLoadSlot;
uint _specialButtons;
- uint32 _priorFrameTime;
uint32 _priorLeftDownTime;
uint32 _priorMiddleDownTime;
uint32 _priorRightDownTime;
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index b70bc5e16c..4fc4067a1a 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -254,7 +254,7 @@ MESSAGE0(CMusicHasStoppedMsg);
MESSAGE0(CMusicSettingChangedMsg);
MESSAGE2(CNPCPlayAnimationMsg, const char *const *, names, nullptr, int, maxDuration, 0);
MESSAGE1(CNPCPlayIdleAnimationMsg, const char *const *, names, 0);
-MESSAGE3(CNPCPlayTalkingAnimationMsg, int, value1, 0, int, value2, 0, const char *const *, names, nullptr);
+MESSAGE3(CNPCPlayTalkingAnimationMsg, uint, speechDuration, 0, int, value2, 0, const char *const *, names, nullptr);
MESSAGE0(CNPCQueueIdleAnimMsg);
MESSAGE1(CNutPuzzleMsg, CString, value, "");
MESSAGE1(COnSummonBotMsg, int, value, 0);
@@ -327,8 +327,8 @@ MESSAGE1(CTriggerNPCEvent, int, value, 0);
MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
MESSAGE2(CTrueTalkGetStateValueMsg, int, stateNum, 0, int, stateVal, -1000);
-MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, dialogueId, 0);
-MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, soundId, 0, uint, dialogueId, 0, int, value, 0);
+MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, endState, 0, int, dialogueId, 0);
+MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, speechDuration, 0, uint, dialogueId, 0, int, value, 0);
MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
MESSAGE3(CTrueTalkTriggerActionMsg, int, action, 0, int, param1, 0, int, param2, 0);
diff --git a/engines/titanic/npcs/deskbot.cpp b/engines/titanic/npcs/deskbot.cpp
index d11b135983..5b6364f1cb 100644
--- a/engines/titanic/npcs/deskbot.cpp
+++ b/engines/titanic/npcs/deskbot.cpp
@@ -113,7 +113,7 @@ bool CDeskbot::MovieEndMsg(CMovieEndMsg *msg) {
petSetArea(PET_ROOMS);
dec54();
unlockMouse();
- playSound("z#47.wav", 100, 0, 0);
+ playSound("z#47.wav");
_classNum = false;
}
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 97913dffea..c677687b27 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -40,7 +40,7 @@ BEGIN_MESSAGE_MAP(CTrueTalkNPC, CCharacter)
END_MESSAGE_MAP()
CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
- _assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _soundId(0), _fieldF0(0),
+ _assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _speechDuration(0), _startTicks(0),
_fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
}
@@ -50,8 +50,8 @@ void CTrueTalkNPC::save(SimpleFile *file, int indent) {
file->writeQuotedLine(_assetName, indent);
file->writeNumberLine(_fieldE4, indent);
file->writeNumberLine(_npcFlags, indent);
- file->writeNumberLine(_soundId, indent);
- file->writeNumberLine(_fieldF0, indent);
+ file->writeNumberLine(_speechDuration, indent);
+ file->writeNumberLine(_startTicks, indent);
file->writeNumberLine(_fieldF4, indent);
file->writeNumberLine(_fieldF8, indent);
file->writeNumberLine(_speechTimerId, indent);
@@ -67,8 +67,8 @@ void CTrueTalkNPC::load(SimpleFile *file) {
_assetName = file->readString();
_fieldE4 = file->readNumber();
_npcFlags = file->readNumber();
- _soundId = file->readNumber();
- _fieldF0 = file->readNumber();
+ _speechDuration = file->readNumber();
+ _startTicks = file->readNumber();
_fieldF4 = file->readNumber();
_fieldF8 = file->readNumber();
_speechTimerId = file->readNumber();
@@ -102,18 +102,18 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
if (_speechTimerId)
stopTimer(_speechTimerId);
- _soundId = msg->_soundId;
- _fieldF0 = getTicksCount();
+ _speechDuration = msg->_speechDuration;
+ _startTicks = getTicksCount();
if (hasActiveMovie() || (_npcFlags & NPCFLAG_2)) {
_npcFlags &= ~NPCFLAG_2;
stopMovie();
- CNPCPlayTalkingAnimationMsg msg1(_soundId, 0, 0);
+ CNPCPlayTalkingAnimationMsg msg1(_speechDuration, 0, 0);
msg1.execute(this);
if (msg1._names) {
- CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
+ CNPCPlayAnimationMsg msg2(msg1._names, msg1._speechDuration);
msg2.execute(this);
}
}
@@ -125,7 +125,7 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
_npcFlags &= ~NPCFLAG_SPEAKING;
--_field100;
- _soundId = 0;
+ _speechDuration = 0;
if (!(_npcFlags & NPCFLAG_8)) {
CNPCPlayTalkingAnimationMsg msg1(0, 2, 0);
@@ -147,13 +147,13 @@ bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
return false;
}
- int diff = getTicksCount() - _fieldF0;
- int ticks = MAX((int)_soundId - diff, 0);
+ int diff = getTicksCount() - _startTicks;
+ int ticks = MAX((int)_speechDuration - diff, 0);
CNPCPlayTalkingAnimationMsg msg1(ticks, ticks > 1000 ? 2 : 1, 0);
msg1.execute(this);
if (msg1._names) {
- CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
+ CNPCPlayAnimationMsg msg2(msg1._names, ticks);
msg2.execute(this);
}
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 5254eaf9b7..1e06e9c690 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -57,8 +57,8 @@ protected:
CString _assetName;
int _fieldE4;
uint _npcFlags;
- uint _soundId;
- int _fieldF0;
+ uint _speechDuration;
+ uint _startTicks;
int _fieldF4;
int _fieldF8;
int _speechTimerId;
diff --git a/engines/titanic/pet_control/pet_inventory.cpp b/engines/titanic/pet_control/pet_inventory.cpp
index 55176d8b0e..88310459c6 100644
--- a/engines/titanic/pet_control/pet_inventory.cpp
+++ b/engines/titanic/pet_control/pet_inventory.cpp
@@ -28,7 +28,7 @@
namespace Titanic {
CPetInventory::CPetInventory() : CPetSection(),
- _movie(nullptr), _field290(false), _field294(0), _field298(0) {
+ _movie(nullptr), _isLoading(false), _field298(0) {
for (int idx = 0; idx < TOTAL_ITEMS; ++idx) {
_itemBackgrounds[idx] = _itemGlyphs[idx] = nullptr;
}
@@ -109,9 +109,9 @@ void CPetInventory::load(SimpleFile *file, int param) {
void CPetInventory::postLoad() {
reset();
- _field290 = 1;
+ _isLoading = true;
itemsChanged();
- _field290 = 0;
+ _isLoading = false;
}
void CPetInventory::save(SimpleFile *file, int indent) {
@@ -179,7 +179,7 @@ void CPetInventory::itemsChanged() {
while (item) {
CPetInventoryGlyph *glyph = new CPetInventoryGlyph();
glyph->setup(_petControl, &_items);
- glyph->setItem(item, _field290);
+ glyph->setItem(item, _isLoading);
_items.push_back(glyph);
item = _petControl->getNextObject(item);
diff --git a/engines/titanic/pet_control/pet_inventory.h b/engines/titanic/pet_control/pet_inventory.h
index 17649546ce..184bb20385 100644
--- a/engines/titanic/pet_control/pet_inventory.h
+++ b/engines/titanic/pet_control/pet_inventory.h
@@ -40,8 +40,7 @@ private:
CGameObject *_itemBackgrounds[46];
CGameObject *_itemGlyphs[46];
CGameObject *_movie;
- bool _field290;
- int _field294;
+ bool _isLoading;
int _field298;
private:
/**
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.cpp b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
index 783a8a9717..38974547f5 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.cpp
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.cpp
@@ -198,17 +198,17 @@ bool CPetInventoryGlyph::doAction(CGlyphAction *action) {
return true;
}
-void CPetInventoryGlyph::setItem(CGameObject *item, int val) {
+void CPetInventoryGlyph::setItem(CGameObject *item, bool isLoading) {
_item = item;
if (_owner && item) {
- int v1 = populateItem(item, val);
+ int v1 = populateItem(item, isLoading);
_background = dynamic_cast<CPetInventoryGlyphs *>(_owner)->getBackground(v1);
_image = dynamic_cast<CPetInventory *>(getPetSection())->getImage(v1);
}
}
-int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
+int CPetInventoryGlyph::populateItem(CGameObject *item, bool isLoading) {
// Scan the master item names list
CString itemName = item->getName();
int itemIndex = -1;
@@ -221,7 +221,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
switch (ITEM_MODES[itemIndex]) {
case 0:
- switch (subMode(item, val)) {
+ switch (subMode(item, isLoading)) {
case 0:
case 1:
return 0;
@@ -233,7 +233,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
}
case 2:
- switch (subMode(item, val)) {
+ switch (subMode(item, isLoading)) {
case 0:
return 2;
default:
@@ -242,7 +242,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
break;
case 15:
- switch (subMode(item, val)) {
+ switch (subMode(item, isLoading)) {
case 0:
case 1:
return 14;
@@ -260,7 +260,7 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
break;
case 26:
- switch (subMode(item, val)) {
+ switch (subMode(item, isLoading)) {
case 0:
return 26;
case 1:
@@ -281,11 +281,11 @@ int CPetInventoryGlyph::populateItem(CGameObject *item, int val) {
return ITEM_MODES[itemIndex];
}
-int CPetInventoryGlyph::subMode(CGameObject *item, int val) {
+int CPetInventoryGlyph::subMode(CGameObject *item, bool isLoading) {
int frameNum = item->getFrameNumber();
int movieFrame = item->getMovieFrame();
- if (val && frameNum != -1 && frameNum != movieFrame)
+ if (isLoading && frameNum != -1 && frameNum != movieFrame)
item->loadFrame(frameNum);
return frameNum;
diff --git a/engines/titanic/pet_control/pet_inventory_glyphs.h b/engines/titanic/pet_control/pet_inventory_glyphs.h
index 716c9d1ad1..0d167c4c98 100644
--- a/engines/titanic/pet_control/pet_inventory_glyphs.h
+++ b/engines/titanic/pet_control/pet_inventory_glyphs.h
@@ -34,9 +34,9 @@ private:
/**
* Populate the details for an item
*/
- int populateItem(CGameObject *item, int val);
+ int populateItem(CGameObject *item, bool isLoading);
- int subMode(CGameObject *item, int val);
+ int subMode(CGameObject *item, bool isLoading);
/**
* Start any movie for the background
@@ -126,7 +126,7 @@ public:
/**
* Set the inventory item
*/
- void setItem(CGameObject *item, int val);
+ void setItem(CGameObject *item, bool isLoading);
};
class CInventoryGlyphAction : public CGlyphAction {
diff --git a/engines/titanic/pet_control/pet_text.cpp b/engines/titanic/pet_control/pet_text.cpp
index 6813095626..32a6a9af57 100644
--- a/engines/titanic/pet_control/pet_text.cpp
+++ b/engines/titanic/pet_control/pet_text.cpp
@@ -26,11 +26,11 @@ namespace Titanic {
CPetText::CPetText(uint count) :
_stringsMerged(false), _maxCharsPerLine(-1), _lineCount(0),
- _linesStart(-1), _field3C(0), _field40(0), _field44(0),
+ _linesStart(-1), _unused1(0), _unused2(0), _unused3(0),
_backR(0xff), _backG(0xff), _backB(0xff),
_textR(0), _textG(0), _textB(200),
- _fontNumber(0), _field64(0), _field68(0), _field6C(0),
- _hasBorder(true), _scrollTop(0), _textCursor(nullptr), _field7C(0) {
+ _fontNumber(0), _npcFlag(0), _npcId(0), _hasBorder(true),
+ _scrollTop(0), _textCursor(nullptr) {
setupArrays(count);
}
@@ -86,9 +86,9 @@ void CPetText::load(SimpleFile *file, int param) {
uint charsPerLine = file->readNumber();
uint count = file->readNumber();
_bounds = file->readRect();
- _field3C = file->readNumber();
- _field40 = file->readNumber();
- _field44 = file->readNumber();
+ _unused1 = file->readNumber();
+ _unused2 = file->readNumber();
+ _unused3 = file->readNumber();
_backR = file->readNumber();
_backG = file->readNumber();
_backB = file->readNumber();
@@ -118,9 +118,9 @@ void CPetText::save(SimpleFile *file, int indent) {
file->writeNumberLine(numLines, indent);
file->writeRect(_bounds, indent);
- file->writeNumberLine(_field3C, indent);
- file->writeNumberLine(_field40, indent);
- file->writeNumberLine(_field44, indent);
+ file->writeNumberLine(_unused1, indent);
+ file->writeNumberLine(_unused2, indent);
+ file->writeNumberLine(_unused3, indent);
file->writeNumberLine(_backR, indent);
file->writeNumberLine(_backG, indent);
file->writeNumberLine(_backB, indent);
@@ -266,16 +266,16 @@ void CPetText::setMaxCharsPerLine(int maxChars) {
}
void CPetText::updateStr3(int lineNum) {
- if (_field64 > 0 && _field68 > 0) {
+ if (_npcFlag > 0 && _npcId > 0) {
char line[5];
line[0] = line[3] = TEXTCMD_NPC;
- line[1] = _field64;
- line[2] = _field68;
+ line[1] = _npcFlag;
+ line[2] = _npcId;
line[4] = '\0';
_array[lineNum]._string3 = CString(line);
_stringsMerged = false;
- _field64 = _field68 = 0;
+ _npcFlag = _npcId = 0;
}
}
@@ -304,9 +304,9 @@ void CPetText::deleteLastChar() {
}
}
-void CPetText::setNPC(int val1, int npcId) {
- _field64 = val1;
- _field68 = npcId;
+void CPetText::setNPC(int npcFlag, int npcId) {
+ _npcFlag = npcFlag;
+ _npcId = npcId;
}
void CPetText::scrollUp(CScreenManager *screenManager) {
diff --git a/engines/titanic/pet_control/pet_text.h b/engines/titanic/pet_control/pet_text.h
index f5d4235690..ba199a3ae5 100644
--- a/engines/titanic/pet_control/pet_text.h
+++ b/engines/titanic/pet_control/pet_text.h
@@ -44,9 +44,9 @@ private:
int _maxCharsPerLine;
int _lineCount;
int _linesStart;
- int _field3C;
- int _field40;
- int _field44;
+ int _unused1;
+ int _unused2;
+ int _unused3;
int _backR;
int _backG;
int _backB;
@@ -54,13 +54,11 @@ private:
int _textG;
int _textB;
int _fontNumber;
- int _field64;
- int _field68;
- int _field6C;
+ int _npcFlag;
+ int _npcId;
bool _hasBorder;
int _scrollTop;
CTextCursor *_textCursor;
- int _field7C;
private:
void setupArrays(int count);
@@ -167,7 +165,10 @@ public:
*/
void deleteLastChar();
- void setNPC(int val1, int npcId);
+ /**
+ * Sets the current NPC text is being added for
+ */
+ void setNPC(int npcFlag, int npcId);
/**
* Get the index into _lines where on-screen text starts
diff --git a/engines/titanic/sound/auto_sound_player.cpp b/engines/titanic/sound/auto_sound_player.cpp
index 8267d65037..4a3a1fe7f8 100644
--- a/engines/titanic/sound/auto_sound_player.cpp
+++ b/engines/titanic/sound/auto_sound_player.cpp
@@ -33,7 +33,7 @@ BEGIN_MESSAGE_MAP(CAutoSoundPlayer, CGameObject)
END_MESSAGE_MAP()
CAutoSoundPlayer::CAutoSoundPlayer() : CGameObject(),
- _fieldBC(0), _volume(70), _fieldD0(0), _repeated(false), _soundHandle(-1),
+ _fieldBC(0), _volume(70), _balance(0), _repeated(false), _soundHandle(-1),
_stopSeconds(0), _startSeconds(-1), _active(false), _fieldE8(0) {
}
@@ -42,7 +42,7 @@ void CAutoSoundPlayer::save(SimpleFile *file, int indent) {
file->writeNumberLine(_fieldBC, indent);
file->writeQuotedLine(_filename, indent);
file->writeNumberLine(_volume, indent);
- file->writeNumberLine(_fieldD0, indent);
+ file->writeNumberLine(_balance, indent);
file->writeNumberLine(_repeated, indent);
file->writeNumberLine(_soundHandle, indent);
file->writeNumberLine(_stopSeconds, indent);
@@ -58,7 +58,7 @@ void CAutoSoundPlayer::load(SimpleFile *file) {
_fieldBC = file->readNumber();
_filename = file->readString();
_volume = file->readNumber();
- _fieldD0 = file->readNumber();
+ _balance = file->readNumber();
_repeated = file->readNumber();
_soundHandle = file->readNumber();
_stopSeconds = file->readNumber();
@@ -72,7 +72,7 @@ void CAutoSoundPlayer::load(SimpleFile *file) {
bool CAutoSoundPlayer::TurnOn(CTurnOn *msg) {
if (_soundHandle == -1) {
CProximity prox;
- prox._fieldC = _fieldD0;
+ prox._balance = _balance;
prox._repeated = _repeated;
if (_fieldE8)
prox._positioningMode = POSMODE_VECTOR;
diff --git a/engines/titanic/sound/auto_sound_player.h b/engines/titanic/sound/auto_sound_player.h
index c8f1d3480e..9f4d11ee06 100644
--- a/engines/titanic/sound/auto_sound_player.h
+++ b/engines/titanic/sound/auto_sound_player.h
@@ -38,7 +38,7 @@ public:
int _fieldBC;
CString _filename;
int _volume;
- int _fieldD0;
+ int _balance;
bool _repeated;
int _soundHandle;
int _stopSeconds;
diff --git a/engines/titanic/sound/auto_sound_player_adsr.cpp b/engines/titanic/sound/auto_sound_player_adsr.cpp
index f9f045759b..d900ca0792 100644
--- a/engines/titanic/sound/auto_sound_player_adsr.cpp
+++ b/engines/titanic/sound/auto_sound_player_adsr.cpp
@@ -48,12 +48,12 @@ void CAutoSoundPlayerADSR::load(SimpleFile *file) {
bool CAutoSoundPlayerADSR::TurnOn(CTurnOn *msg) {
if (_soundHandle == -1) {
if (!_soundName1.empty()) {
- _soundHandle = playSound(_soundName1, _volume, _fieldD0);
+ _soundHandle = playSound(_soundName1, _volume, _balance);
if (!_soundName2.empty())
- _soundHandle = queueSound(_soundName2, _soundHandle, _volume, _fieldD0);
+ _soundHandle = queueSound(_soundName2, _soundHandle, _volume, _balance);
- _soundHandle = queueSound(_filename, _soundHandle, _volume, _fieldD0);
+ _soundHandle = queueSound(_filename, _soundHandle, _volume, _balance);
_active = true;
}
}
@@ -64,7 +64,7 @@ bool CAutoSoundPlayerADSR::TurnOn(CTurnOn *msg) {
bool CAutoSoundPlayerADSR::TurnOff(CTurnOff *msg) {
if (_soundHandle != -1) {
if (!_soundName3.empty())
- queueSound(_soundName3, _soundHandle, _volume, _fieldD0);
+ queueSound(_soundName3, _soundHandle, _volume, _balance);
if (isSoundActive(_soundHandle))
stopSound(_soundHandle);
diff --git a/engines/titanic/sound/gondolier_song.cpp b/engines/titanic/sound/gondolier_song.cpp
index 5c96718723..541ef7142f 100644
--- a/engines/titanic/sound/gondolier_song.cpp
+++ b/engines/titanic/sound/gondolier_song.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "titanic/sound/gondolier_song.h"
@@ -49,9 +49,9 @@ bool CGondolierSong::TurnOn(CTurnOn *msg) {
int volume = _value * _volume / 100;
if (_startSeconds == -1) {
- _soundHandle = playSound(_filename, volume, _fieldD0, _repeated);
+ _soundHandle = playSound(_filename, volume, _balance, _repeated);
} else {
- _soundHandle = playSound(_filename, 0, _fieldD0, _repeated);
+ _soundHandle = playSound(_filename, 0, _balance, _repeated);
setSoundVolume(_soundHandle, _volume, _startSeconds);
}
diff --git a/engines/titanic/sound/proximity.cpp b/engines/titanic/sound/proximity.cpp
index 9e70722520..ee1cd3e741 100644
--- a/engines/titanic/sound/proximity.cpp
+++ b/engines/titanic/sound/proximity.cpp
@@ -25,13 +25,14 @@
namespace Titanic {
-CProximity::CProximity() : _field4(0), _channelVolume(100), _fieldC(0),
- _priorSoundHandle(-1), _field14(0), _frequencyMultiplier(0.0), _field1C(1.875),
- _repeated(false), _channelMode(10), _positioningMode(POSMODE_NONE), _azimuth(0.0),
- _range(0.5), _elevation(0), _posX(0.0), _posY(0.0), _posZ(0.0),
+CProximity::CProximity() : _channelVolume(100), _balance(0),
+ _priorSoundHandle(-1), _frequencyMultiplier(0.0), _frequencyAdjust(1.875),
+ _repeated(false), _channelMode(10), _positioningMode(POSMODE_NONE),
+ _azimuth(0.0), _range(0.5), _elevation(0),
+ _posX(0.0), _posY(0.0), _posZ(0.0),
_hasVelocity(false), _velocityX(0), _velocityY(0), _velocityZ(0),
- _field54(0), _field58(0), _field5C(0), _freeSoundFlag(false), _endTalkerFn(nullptr),
- _talker(nullptr), _field6C(0), _soundType(Audio::Mixer::kPlainSoundType) {
+ _disposeAfterUse(DisposeAfterUse::NO), _endTalkerFn(nullptr), _talker(nullptr),
+ _soundDuration(0), _soundType(Audio::Mixer::kPlainSoundType) {
}
} // End of namespace Titanic
diff --git a/engines/titanic/sound/proximity.h b/engines/titanic/sound/proximity.h
index 41c2268c2f..2f0745240d 100644
--- a/engines/titanic/sound/proximity.h
+++ b/engines/titanic/sound/proximity.h
@@ -36,13 +36,11 @@ typedef void (*CEndTalkerFn)(TTtalker *talker);
class CProximity {
public:
- int _field4;
int _channelVolume;
- int _fieldC;
+ int _balance;
int _priorSoundHandle;
- int _field14;
double _frequencyMultiplier;
- double _field1C;
+ double _frequencyAdjust;
bool _repeated;
int _channelMode;
PositioningMode _positioningMode;
@@ -56,13 +54,10 @@ public:
double _velocityX;
double _velocityY;
double _velocityZ;
- int _field54;
- int _field58;
- int _field5C;
- bool _freeSoundFlag;
+ DisposeAfterUse::Flag _disposeAfterUse;
CEndTalkerFn _endTalkerFn;
TTtalker *_talker;
- int _field6C;
+ uint _soundDuration;
Audio::Mixer::SoundType _soundType;
public:
CProximity();
diff --git a/engines/titanic/sound/qmixer.cpp b/engines/titanic/sound/qmixer.cpp
index e0e9c60038..c095b84e17 100644
--- a/engines/titanic/sound/qmixer.cpp
+++ b/engines/titanic/sound/qmixer.cpp
@@ -66,7 +66,7 @@ void QMixer::qsWaveMixFlushChannel(int iChannel, uint flags) {
void QMixer::qsWaveMixSetPanRate(int iChannel, uint flags, uint rate) {
ChannelEntry &channel = _channels[iChannel];
channel._panRate = rate;
- channel._volumeChangeEnd = channel._volumeChangeEnd = 0;
+ channel._volumeChangeStart = channel._volumeChangeEnd = 0;
}
void QMixer::qsWaveMixSetVolume(int iChannel, uint flags, uint volume) {
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp
index 6d27d1de49..3288c4f4dd 100644
--- a/engines/titanic/sound/sound.cpp
+++ b/engines/titanic/sound/sound.cpp
@@ -68,15 +68,16 @@ void CSound::setVolume(uint handle, uint volume, uint seconds) {
_soundManager.setVolume(handle, volume, seconds);
}
-void CSound::activateSound(CWaveFile *waveFile, bool freeFlag) {
+void CSound::activateSound(CWaveFile *waveFile, DisposeAfterUse::Flag disposeAfterUse) {
for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ++i) {
CSoundItem *sound = *i;
if (sound->_waveFile == waveFile) {
sound->_active = true;
- sound->_freeFlag = freeFlag;
+ sound->_disposeAfterUse = disposeAfterUse;
- if (!freeFlag && waveFile->size() > 51200)
- sound->_freeFlag = true;
+ // Anything bigger than 50Kb is automatically flagged to be free when finished
+ if (waveFile->size() > (50 * 1024))
+ sound->_disposeAfterUse = DisposeAfterUse::YES;
break;
}
}
@@ -90,8 +91,8 @@ void CSound::checkSounds() {
for (CSoundItemList::iterator i = _sounds.begin(); i != _sounds.end(); ) {
CSoundItem *soundItem = *i;
- if (soundItem->_active && soundItem->_freeFlag) {
- if (_soundManager.isActive(soundItem->_waveFile)) {
+ if (soundItem->_active && soundItem->_disposeAfterUse == DisposeAfterUse::YES) {
+ if (!_soundManager.isActive(soundItem->_waveFile)) {
i = _sounds.erase(i);
delete soundItem;
continue;
@@ -158,11 +159,11 @@ int CSound::playSound(const CString &name, CProximity &prox) {
if (!waveFile)
return -1;
- prox._field6C = waveFile->fn1();
+ prox._soundDuration = waveFile->getDuration();
if (prox._soundType != Audio::Mixer::kPlainSoundType)
waveFile->_soundType = prox._soundType;
- activateSound(waveFile, prox._freeSoundFlag);
+ activateSound(waveFile, prox._disposeAfterUse);
return _soundManager.playSound(*waveFile, prox);
}
@@ -208,8 +209,8 @@ int CSound::playSpeech(CDialogueFile *dialogueFile, int speechId, CProximity &pr
if (!waveFile)
return -1;
- prox._field6C = waveFile->fn1();
- activateSound(waveFile, prox._freeSoundFlag);
+ prox._soundDuration = waveFile->getDuration();
+ activateSound(waveFile, prox._disposeAfterUse);
return _soundManager.playSound(*waveFile, prox);
}
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index de95f9edf1..21f2a93f24 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -41,15 +41,17 @@ public:
CWaveFile *_waveFile;
File *_dialogueFileHandle;
int _speechId;
- bool _freeFlag;
+ DisposeAfterUse::Flag _disposeAfterUse;
bool _active;
public:
CSoundItem() : ListItem(), _waveFile(nullptr), _dialogueFileHandle(nullptr),
- _speechId(0), _freeFlag(false), _active(false) {}
+ _speechId(0), _disposeAfterUse(DisposeAfterUse::NO), _active(false) {}
CSoundItem(const CString &name) : ListItem(), _name(name), _waveFile(nullptr),
- _dialogueFileHandle(nullptr), _speechId(0), _freeFlag(false), _active(false) {}
+ _dialogueFileHandle(nullptr), _disposeAfterUse(DisposeAfterUse::NO),
+ _speechId(0), _active(false) {}
CSoundItem(File *dialogueFile, int speechId) : ListItem(), _waveFile(nullptr),
- _dialogueFileHandle(dialogueFile), _speechId(speechId), _freeFlag(false), _active(false) {}
+ _dialogueFileHandle(dialogueFile), _speechId(speechId), _active(false),
+ _disposeAfterUse(DisposeAfterUse::NO) {}
};
class CSoundItemList : public List<CSoundItem> {
@@ -126,7 +128,8 @@ public:
/**
* Flags a sound about to be played as activated
*/
- void activateSound(CWaveFile *waveFile, bool freeFlag);
+ void activateSound(CWaveFile *waveFile,
+ DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::NO);
/**
* Stops any sounds attached to a given channel
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp
index 81ec5bc475..1fb0c7341c 100644
--- a/engines/titanic/sound/sound_manager.cpp
+++ b/engines/titanic/sound/sound_manager.cpp
@@ -371,7 +371,7 @@ int QSoundManager::playWave(CWaveFile *waveFile, int iChannel, uint flags, CProx
return 0;
prox._channelVolume = CLIP(prox._channelVolume, 0, 100);
- prox._fieldC = CLIP(prox._fieldC, -100, 100);
+ prox._balance = CLIP(prox._balance, -100, 100);
int slotIndex = findFreeSlot();
if (slotIndex == -1)
@@ -399,7 +399,7 @@ int QSoundManager::playWave(CWaveFile *waveFile, int iChannel, uint flags, CProx
break;
}
- if (prox._frequencyMultiplier || prox._field1C != 1.875) {
+ if (prox._frequencyMultiplier || prox._frequencyAdjust != 1.875) {
uint freq = (uint)(waveFile->getFrequency() * prox._frequencyMultiplier);
qsWaveMixSetFrequency(iChannel, 8, freq);
}
@@ -419,7 +419,7 @@ int QSoundManager::playWave(CWaveFile *waveFile, int iChannel, uint flags, CProx
return slot._handle;
} else {
_sounds.flushChannel(waveFile, iChannel);
- if (prox._freeSoundFlag)
+ if (prox._disposeAfterUse == DisposeAfterUse::YES)
delete waveFile;
return 0;
}
diff --git a/engines/titanic/sound/water_lapping_sounds.cpp b/engines/titanic/sound/water_lapping_sounds.cpp
index 7616c4b43b..2dd4d7b7b6 100644
--- a/engines/titanic/sound/water_lapping_sounds.cpp
+++ b/engines/titanic/sound/water_lapping_sounds.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "titanic/sound/water_lapping_sounds.h"
@@ -49,7 +49,7 @@ void CWaterLappingSounds::load(SimpleFile *file) {
_repeated = file->readNumber();
_startSeconds = file->readNumber();
_value = file->readNumber();
-
+
CRoomAutoSoundPlayer::load(file);
}
diff --git a/engines/titanic/sound/wave_file.cpp b/engines/titanic/sound/wave_file.cpp
index 8c00637d73..3f855cd053 100644
--- a/engines/titanic/sound/wave_file.cpp
+++ b/engines/titanic/sound/wave_file.cpp
@@ -43,9 +43,8 @@ CWaveFile::~CWaveFile() {
}
}
-int CWaveFile::fn1() {
- // TODO
- return 0;
+uint CWaveFile::getDuration() const {
+ return _stream ? _stream->getLength().secs() : 0;
}
bool CWaveFile::loadSound(const CString &name) {
diff --git a/engines/titanic/sound/wave_file.h b/engines/titanic/sound/wave_file.h
index aede0c9328..4237f1a203 100644
--- a/engines/titanic/sound/wave_file.h
+++ b/engines/titanic/sound/wave_file.h
@@ -45,7 +45,10 @@ public:
CWaveFile(QSoundManager *owner);
~CWaveFile();
- int fn1();
+ /**
+ * Returns the duration of the wave file in seconds
+ */
+ uint getDuration() const;
/**
* Return the size of the wave file
diff --git a/engines/titanic/support/files_manager.cpp b/engines/titanic/support/files_manager.cpp
index 3ee17e9769..ee3a3e1cde 100644
--- a/engines/titanic/support/files_manager.cpp
+++ b/engines/titanic/support/files_manager.cpp
@@ -28,7 +28,7 @@
namespace Titanic {
CFilesManager::CFilesManager() : _gameManager(nullptr), _assetsPath("Assets"),
- _field0(0), _drive(-1), _field18(0), _field1C(0), _field3C(0) {
+ _drive(-1) {
loadResourceIndex();
}
diff --git a/engines/titanic/support/files_manager.h b/engines/titanic/support/files_manager.h
index c530b05ece..6f56327968 100644
--- a/engines/titanic/support/files_manager.h
+++ b/engines/titanic/support/files_manager.h
@@ -48,13 +48,7 @@ private:
Common::File _datFile;
ResourceHash _resources;
CFilesManagerList _list;
- CString _string1;
- CString _string2;
- int _field0;
int _drive;
- int _field18;
- int _field1C;
- int _field3C;
const CString _assetsPath;
private:
void loadResourceIndex();
diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp
index 7da2ab6201..b773e8af30 100644
--- a/engines/titanic/true_talk/bellbot_script.cpp
+++ b/engines/titanic/true_talk/bellbot_script.cpp
@@ -44,8 +44,7 @@ static const RoomDialogueId ROOM_DIALOGUE_IDS[] = {
BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2) :
TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
- _field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0),
- _room107First(false) {
+ _responseFlag(false), _room107First(false) {
CTrueTalkManager::setFlags(25, 0);
CTrueTalkManager::setFlags(24, 0);
CTrueTalkManager::setFlags(40, 0);
@@ -72,7 +71,7 @@ void BellbotScript::setupSentences() {
for (int idx = 1; idx < 20; ++idx)
_sentences[idx].load(CString::format("Sentences/Bellbot/%d", idx));
- _field2DC = 0;
+ _responseFlag = false;
_field68 = 0;
_entryCount = 0;
}
@@ -370,7 +369,7 @@ ScriptChangedResult BellbotScript::scriptChanged(const TTroomScript *roomScript,
break;
case 157:
- _field2DC = 1;
+ _responseFlag = true;
break;
case 158:
@@ -378,7 +377,7 @@ ScriptChangedResult BellbotScript::scriptChanged(const TTroomScript *roomScript,
break;
case 3:
- if (_field2DC) {
+ if (_responseFlag) {
if (randomResponse0(roomScript, id))
return SCR_2;
} else {
@@ -386,7 +385,7 @@ ScriptChangedResult BellbotScript::scriptChanged(const TTroomScript *roomScript,
applyResponse();
}
- _field2DC = 0;
+ _responseFlag = false;
CTrueTalkManager::_v9 = 0;
// Deliberate fall-through
default:
diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h
index 3080b56902..6f57ee718f 100644
--- a/engines/titanic/true_talk/bellbot_script.h
+++ b/engines/titanic/true_talk/bellbot_script.h
@@ -35,10 +35,7 @@ private:
TTsentenceEntries _sentences[20];
TTcommonPhraseArray _phrases;
int _array[150];
- int _field2D0;
- int _field2D4;
- int _field2D8;
- int _field2DC;
+ bool _responseFlag;
bool _room107First;
private:
/**
diff --git a/engines/titanic/true_talk/dialogue_file.cpp b/engines/titanic/true_talk/dialogue_file.cpp
index 34eb164779..cbd3685315 100644
--- a/engines/titanic/true_talk/dialogue_file.cpp
+++ b/engines/titanic/true_talk/dialogue_file.cpp
@@ -60,7 +60,7 @@ DialogueResource *CDialogueFile::addToCache(int index) {
// Scan cache for a free slot
uint cacheIndex = 0;
- while (cacheIndex < _cache.size() && !_cache[cacheIndex]._active)
+ while (cacheIndex < _cache.size() && _cache[cacheIndex]._active)
++cacheIndex;
if (cacheIndex == _cache.size())
return nullptr;
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 64e789a4b9..2741e6b640 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -33,9 +33,8 @@ namespace Titanic {
CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
_owner(owner), _script(owner->_script), _resources(g_vm->_exeResources),
- _parser(this), _field10(0), _inputCtr(0),
- _concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
- _concept4P(nullptr), _field30(0) {
+ _parser(this), _inputCtr(0), _concept1P(nullptr),
+ _concept2P(nullptr), _concept3P(nullptr), _concept4P(nullptr) {
g_vm->_scriptHandler = this;
g_vm->_script = _script;
g_vm->_exeResources.reset(this, val1, val2);
@@ -60,19 +59,18 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnp
if (result == SCR_1)
result = npcScript->notifyScript(roomScript, dialogueId);
- if (result != SCR_3 && result != SCR_4)
- return result;
+ if (dialogueId == 3 || dialogueId == 4) {
+ delete _concept1P;
+ delete _concept2P;
+ delete _concept3P;
+ delete _concept4P;
+ _concept1P = nullptr;
+ _concept2P = nullptr;
+ _concept3P = nullptr;
+ _concept4P = nullptr;
+ }
++_inputCtr;
- delete _concept1P;
- delete _concept2P;
- delete _concept3P;
- delete _concept4P;
- _concept1P = nullptr;
- _concept2P = nullptr;
- _concept3P = nullptr;
- _concept4P = nullptr;
-
return result;
}
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 193c60f719..01aa2ef1c5 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -39,9 +39,7 @@ class CScriptHandler {
private:
CTitleEngine *_owner;
CExeResources &_resources;
- int _field10;
int _inputCtr;
- int _field30;
private:
void handleWord1(const TTstring *str);
void handleWord2(const TTstring *str);
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 363cc3454c..079067389d 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -40,8 +40,7 @@ void CTitleEngine::setup(int val1, int val2) {
/*------------------------------------------------------------------------*/
-STtitleEngine::STtitleEngine(): CTitleEngine(),
- _responseP(nullptr), _field58(0) {
+STtitleEngine::STtitleEngine(): CTitleEngine(), _responseP(nullptr) {
}
STtitleEngine::~STtitleEngine() {
@@ -49,7 +48,6 @@ STtitleEngine::~STtitleEngine() {
}
void STtitleEngine::reset() {
- _field58 = 0;
_indexes.clear();
}
@@ -58,6 +56,7 @@ void STtitleEngine::setup(int val1, int val2) {
}
int STtitleEngine::setResponse(TTscriptBase *script, TTresponse *response) {
+ _responseP = response;
_indexes.clear();
for (TTresponse *respP = response; respP; respP = respP->getNext()) {
_indexes.push_back(respP->getDialogueId());
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index a980e52215..ca7a5dcd14 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -67,8 +67,7 @@ public:
class STtitleEngine : public CTitleEngine {
private:
Common::SeekableReadStream *_stream;
- TTresponse *_responseP;
- int _field58;
+ const TTresponse *_responseP;
public:
Common::Array<uint> _indexes;
Common::Array<byte> _data;
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 085f0bd310..be9ca667de 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -347,14 +347,14 @@ void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript,
if (dialogueStr.empty())
return;
- int soundId = readDialogSound();
+ uint speechDuration = readDialogueSpeech();
TTtalker *talker = new TTtalker(this, npc);
_talkers.push_back(talker);
bool isParrot = npc->getName().contains("parrot");
triggerNPC(npc);
playSpeech(talker, roomScript, view, isParrot);
- talker->speechStarted(dialogueStr, _titleEngine._indexes[0], soundId);
+ talker->speechStarted(dialogueStr, _titleEngine._indexes[0], speechDuration);
}
#define STRING_BUFFER_SIZE 2048
@@ -400,30 +400,30 @@ CString CTrueTalkManager::readDialogueString() {
return result;
}
-int CTrueTalkManager::readDialogSound() {
- _field18 = 0;
+uint CTrueTalkManager::readDialogueSpeech() {
+ _speechDuration = 0;
for (uint idx = 0; idx < _titleEngine._indexes.size(); ++idx) {
CWaveFile *waveFile = _gameManager->_sound.getTrueTalkSound(
_dialogueFile, _titleEngine._indexes[idx] - _dialogueId);
if (waveFile) {
- _field18 = waveFile->fn1();
+ _speechDuration += waveFile->getDuration();
}
}
- return _field18;
+ return _speechDuration;
}
void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
CTrueTalkSelfQueueAnimSetMsg queueSetMsg;
if (queueSetMsg.execute(npc)) {
- if (_field18 > 300) {
- CTrueTalkQueueUpAnimSetMsg upMsg(_field18);
+ if (_speechDuration > 300) {
+ CTrueTalkQueueUpAnimSetMsg upMsg(_speechDuration);
upMsg.execute(npc);
}
} else {
CTrueTalkGetAnimSetMsg getAnimMsg;
- if (_field18 > 300) {
+ if (_speechDuration > 300) {
do {
getAnimMsg.execute(npc);
if (!getAnimMsg._endFrame)
@@ -435,10 +435,10 @@ void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
uint numFrames = getAnimMsg._endFrame - getAnimMsg._startFrame;
int64 val = (numFrames * 1000) * 0x88888889;
uint diff = (val >> (32 + 5)) - 500;
- _field18 += diff;
+ _speechDuration += diff;
getAnimMsg._index++;
- } while (_field18 > 0);
+ } while (_speechDuration > 0);
}
}
}
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index e891f6112a..3abf4c181c 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -50,7 +50,7 @@ private:
int _currentCharId;
CDialogueFile *_dialogueFile;
int _dialogueId;
- int _field18;
+ uint _speechDuration;
TTtalkerList _talkers;
private:
/**
@@ -96,9 +96,10 @@ private:
CString readDialogueString();
/**
- * Read in the sound from the dialogue file
+ * Read in the speech from the dialogue file
+ * @returns Duration of the speech in seconds
*/
- int readDialogSound();
+ uint readDialogueSpeech();
/**
* Triggers animation for the NPC
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp
index 280894c05a..74e2f4f66b 100644
--- a/engines/titanic/true_talk/tt_npc_script.cpp
+++ b/engines/titanic/true_talk/tt_npc_script.cpp
@@ -332,7 +332,7 @@ int TTnpcScript::handleQuote(const TTroomScript *roomScript, const TTsentence *s
uint TTnpcScript::getRangeValue(uint id) {
TTscriptRange *range = findRange(id);
if (!range)
- return 0;
+ return id;
switch (range->_mode) {
case SF_RANDOM: {
@@ -634,13 +634,12 @@ uint TTnpcScript::getDialogueId(uint tagId) {
}
}
- uint oldTagId = tagId;
tagId = getRangeValue(tagId);
- if (tagId != oldTagId)
+ if (tagId != origId)
tagId = getRangeValue(tagId);
- oldTagId = getDialsBitset();
- uint newId = updateState(origId, tagId, oldTagId);
+ uint dialBits = getDialsBitset();
+ uint newId = updateState(origId, tagId, dialBits);
if (!newId)
return 0;
@@ -654,7 +653,7 @@ uint TTnpcScript::getDialogueId(uint tagId) {
if (tableP->_id == newId)
break;
}
- uint newVal = tableP->_values[oldTagId];
+ uint newVal = tableP->_values[dialBits];
// First slot dialogue Ids
idx = 0;
diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp
index b8fbca7d39..a49a5a5bd1 100644
--- a/engines/titanic/true_talk/tt_room_script.cpp
+++ b/engines/titanic/true_talk/tt_room_script.cpp
@@ -34,7 +34,7 @@ TTroomScriptBase::TTroomScriptBase(int scriptId,
/*------------------------------------------------------------------------*/
TTroomScript::TTroomScript(int scriptId) :
- TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
+ TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0), _field54(0) {
}
bool TTroomScript::proc8() const {
diff --git a/engines/titanic/true_talk/tt_script_base.cpp b/engines/titanic/true_talk/tt_script_base.cpp
index 4109134501..2f58ad1400 100644
--- a/engines/titanic/true_talk/tt_script_base.cpp
+++ b/engines/titanic/true_talk/tt_script_base.cpp
@@ -118,37 +118,41 @@ void TTscriptBase::applyResponse() {
}
void TTscriptBase::deleteResponses() {
- while (_respTailP) {
- _respHeadP = _respTailP;
- _respTailP = _respHeadP->getLink();
- delete _respHeadP;
+ while (_respHeadP) {
+ _respTailP = _respHeadP;
+ _respHeadP = _respTailP->getLink();
+ delete _respTailP;
}
}
-void TTscriptBase::appendResponse(int val1, int *val2, int val3) {
- if (!val2 || val1 <= *val2) {
- if (_respHeadP) {
- _respHeadP = new TTresponse(_respHeadP);
+void TTscriptBase::appendResponse(int index, int *maxP, int id) {
+ if (id && (!maxP || index <= *maxP)) {
+ if (_respTailP) {
+ // Prior fragments already exist, so append to end of chain
+ _respTailP = new TTresponse(_respTailP);
} else {
- _respHeadP = new TTresponse(val3, 3);
- if (_respTailP)
- _respTailP->addLink(_respHeadP);
+ // Currently no tail
+ _respTailP = new TTresponse(id, 3);
+ if (_respHeadP)
+ _respHeadP->addLink(_respTailP);
else
- _respTailP = _respHeadP;
+ _respHeadP = _respTailP;
}
}
}
-void TTscriptBase::appendResponse(int val1, int *val2, const TTstring &str) {
- if (!val2 || val1 <= *val2) {
- if (_respHeadP) {
- _respHeadP = new TTresponse(str);
+void TTscriptBase::appendResponse(int index, int *maxP, const TTstring &str) {
+ if (!maxP || index <= *maxP) {
+ if (_respTailP) {
+ // Prior fragments already exist, so append to end of chain
+ _respTailP = new TTresponse(str);
} else {
- _respHeadP = new TTresponse(str);
- if (_respTailP)
- _respTailP->addLink(_respHeadP);
+ // Currently no tail
+ _respTailP = new TTresponse(str);
+ if (_respHeadP)
+ _respHeadP->addLink(_respTailP);
else
- _respTailP = _respHeadP;
+ _respHeadP = _respTailP;
}
}
}
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index c489dcb0a7..869b0beb64 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -51,8 +51,8 @@ protected:
int _state;
TThist *_hist2P;
int _field3C;
- TTresponse *_respHeadP;
TTresponse *_respTailP;
+ TTresponse *_respHeadP;
TTresponse *_oldResponseP;
int _status;
protected:
@@ -62,14 +62,21 @@ protected:
void deleteResponses();
/**
- * Creates and appends a new response to the script
+ * Creates and appends a new response fragment to the script specified by
+ * the given conversation Id
*/
- void appendResponse(int val1, int *val2, int val3);
+ void appendResponse(int index, int *maxP, int id);
- void appendResponse(int val1, int *val2, const TTstring &str);
+ /**
+ * Creates and appends a new response fragment string to the script
+ */
+ void appendResponse(int index, int *maxP, const TTstring &str);
- void appendResponse2(int val1, int *val2, const TTstring &str) {
- appendResponse(val1, val2, str);
+ /**
+ * Creates and appends a new response fragment string to the script
+ */
+ void appendResponse2(int index, int *maxP, const TTstring &str) {
+ appendResponse(index, maxP, str);
}
/**
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index f187710de7..3fae527770 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -28,7 +28,7 @@
namespace Titanic {
TTsentenceConcept *TTsentenceConcept::addSibling() {
- if (this == nullptr || _nextP != nullptr)
+ if (_nextP != nullptr)
// This should never happen
return nullptr;
diff --git a/engines/titanic/true_talk/tt_talker.cpp b/engines/titanic/true_talk/tt_talker.cpp
index 61443a4835..da7628f483 100644
--- a/engines/titanic/true_talk/tt_talker.cpp
+++ b/engines/titanic/true_talk/tt_talker.cpp
@@ -26,10 +26,10 @@
namespace Titanic {
-void TTtalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId) {
+void TTtalker::speechStarted(const CString &dialogueStr, uint dialogueId, uint speechHandle) {
_dialogueId = dialogueId;
- CTrueTalkNotifySpeechStartedMsg msg(soundId, dialogueId, 0);
+ CTrueTalkNotifySpeechStartedMsg msg(speechHandle, dialogueId, 0);
msg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
}
@@ -40,13 +40,13 @@ TTtalker::~TTtalker() {
petControl->convAddLine(_line);
// Notify the end of the speech
- CTrueTalkNotifySpeechEndedMsg endedMsg(_field24, _dialogueId);
+ CTrueTalkNotifySpeechEndedMsg endedMsg(_talkEndState, _dialogueId);
endedMsg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
}
void TTtalker::endSpeech(int val) {
_done = true;
- _field24 = val;
+ _talkEndState = val;
}
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_talker.h b/engines/titanic/true_talk/tt_talker.h
index 636eb0c022..a83bddd952 100644
--- a/engines/titanic/true_talk/tt_talker.h
+++ b/engines/titanic/true_talk/tt_talker.h
@@ -37,19 +37,19 @@ public:
CTrueTalkNPC *_npc;
CString _line;
int _dialogueId;
- int _field24;
+ int _talkEndState;
int _done;
public:
TTtalker() : _owner(nullptr), _npc(nullptr),
- _dialogueId(0), _field24(0), _done(0) {}
+ _dialogueId(0), _talkEndState(0), _done(0) {}
TTtalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
- _owner(owner), _npc(npc), _dialogueId(0), _field24(0), _done(0) {}
+ _owner(owner), _npc(npc), _dialogueId(0), _talkEndState(0), _done(0) {}
~TTtalker();
/**
* Start a new speech
*/
- void speechStarted(const CString &dialogueStr, uint dialogueId, uint soundId);
+ void speechStarted(const CString &dialogueStr, uint dialogueId, uint speechHandle);
/**
* End the speech
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 1d4d2ebbf2..414bf8561c 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -32,8 +32,8 @@
namespace Titanic {
-TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr), _word(nullptr),
- _fieldC(0), _field10(0), _vocabMode(val) {
+TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr),
+ _word(nullptr), _vocabMode(val) {
load("STVOCAB.TXT");
}
diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h
index fc7ee2e102..614d1bbf02 100644
--- a/engines/titanic/true_talk/tt_vocab.h
+++ b/engines/titanic/true_talk/tt_vocab.h
@@ -34,8 +34,6 @@ private:
TTword *_headP;
TTword *_tailP;
TTword *_word;
- int _fieldC;
- int _field10;
int _vocabMode;
private:
/**
diff --git a/engines/wage/combat.cpp b/engines/wage/combat.cpp
index 4f2956d7d2..e8f0c8dfab 100644
--- a/engines/wage/combat.cpp
+++ b/engines/wage/combat.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
index fd2a67b81e..9bb3693be5 100644
--- a/engines/wage/design.cpp
+++ b/engines/wage/design.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/design.h b/engines/wage/design.h
index 017fdfc14d..7b11f3b2c6 100644
--- a/engines/wage/design.h
+++ b/engines/wage/design.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/detection.cpp b/engines/wage/detection.cpp
index 778cd3c7a7..65c14196eb 100644
--- a/engines/wage/detection.cpp
+++ b/engines/wage/detection.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/detection_tables.h b/engines/wage/detection_tables.h
index 59d93cc12f..836a3f14d2 100644
--- a/engines/wage/detection_tables.h
+++ b/engines/wage/detection_tables.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/dialog.cpp b/engines/wage/dialog.cpp
index 0a326817be..ffb4f9c93d 100644
--- a/engines/wage/dialog.cpp
+++ b/engines/wage/dialog.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/dialog.h b/engines/wage/dialog.h
index ec99fc06b2..423f0110ee 100644
--- a/engines/wage/dialog.h
+++ b/engines/wage/dialog.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp
index 3dcf37033a..5ec54493a7 100644
--- a/engines/wage/entities.cpp
+++ b/engines/wage/entities.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/entities.h b/engines/wage/entities.h
index f327270254..b7cafb2294 100644
--- a/engines/wage/entities.h
+++ b/engines/wage/entities.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/gui-console.cpp b/engines/wage/gui-console.cpp
index 2476a8c7fb..a5e71463f7 100644
--- a/engines/wage/gui-console.cpp
+++ b/engines/wage/gui-console.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index cd259e6ddd..e43406085d 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/gui.h b/engines/wage/gui.h
index 898c7c3162..cf76c64fe9 100644
--- a/engines/wage/gui.h
+++ b/engines/wage/gui.h
@@ -8,12 +8,12 @@
* 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.
@@ -69,7 +69,7 @@
namespace Wage {
using namespace Graphics::MacWindowConstants;
-
+
class Scene;
class WageEngine;
@@ -155,7 +155,7 @@ private:
int calcTextX(int x, int textLine);
int calcTextY(int y);
void updateTextSelection(int x, int y);
-
+
void loadBorders();
void loadBorder(Graphics::MacWindow *target, Common::String filename, bool active);
diff --git a/engines/wage/randomhat.cpp b/engines/wage/randomhat.cpp
index 9371140398..c108e3461d 100644
--- a/engines/wage/randomhat.cpp
+++ b/engines/wage/randomhat.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/randomhat.h b/engines/wage/randomhat.h
index 254cd2ae8d..366afc5588 100644
--- a/engines/wage/randomhat.h
+++ b/engines/wage/randomhat.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp
index 61336dce88..782d9ee3f7 100644
--- a/engines/wage/script.cpp
+++ b/engines/wage/script.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/script.h b/engines/wage/script.h
index de9476228c..2cd4f11f0d 100644
--- a/engines/wage/script.h
+++ b/engines/wage/script.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/sound.cpp b/engines/wage/sound.cpp
index bcb274cab9..8a6d901ce1 100644
--- a/engines/wage/sound.cpp
+++ b/engines/wage/sound.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/sound.h b/engines/wage/sound.h
index eccfe33170..b3e91e18d0 100644
--- a/engines/wage/sound.h
+++ b/engines/wage/sound.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/util.cpp b/engines/wage/util.cpp
index 8c8af6652e..6cab7f8ee6 100644
--- a/engines/wage/util.cpp
+++ b/engines/wage/util.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp
index 6a33efa02a..3419a86fbd 100644
--- a/engines/wage/wage.cpp
+++ b/engines/wage/wage.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/wage.h b/engines/wage/wage.h
index 511a2d9e26..38c5294ca5 100644
--- a/engines/wage/wage.h
+++ b/engines/wage/wage.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index acc2a83d97..3e56c0daa7 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wage/world.h b/engines/wage/world.h
index 5c1aaf319e..b5ad33a8a8 100644
--- a/engines/wage/world.h
+++ b/engines/wage/world.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wintermute/debugger/debugger_controller.cpp b/engines/wintermute/debugger/debugger_controller.cpp
index aef96ed9c9..38f862365d 100644
--- a/engines/wintermute/debugger/debugger_controller.cpp
+++ b/engines/wintermute/debugger/debugger_controller.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wintermute/debugger/debugger_controller.h b/engines/wintermute/debugger/debugger_controller.h
index 345b42f0cb..fd207868dc 100644
--- a/engines/wintermute/debugger/debugger_controller.h
+++ b/engines/wintermute/debugger/debugger_controller.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wintermute/video/subtitle_card.cpp b/engines/wintermute/video/subtitle_card.cpp
index 5d882502fd..4199817f49 100644
--- a/engines/wintermute/video/subtitle_card.cpp
+++ b/engines/wintermute/video/subtitle_card.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wintermute/video/subtitle_card.h b/engines/wintermute/video/subtitle_card.h
index 629df77287..86bafe7751 100644
--- a/engines/wintermute/video/subtitle_card.h
+++ b/engines/wintermute/video/subtitle_card.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wintermute/video/video_subtitler.cpp b/engines/wintermute/video/video_subtitler.cpp
index 95d938574b..5155f4de72 100644
--- a/engines/wintermute/video/video_subtitler.cpp
+++ b/engines/wintermute/video/video_subtitler.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/wintermute/video/video_subtitler.h b/engines/wintermute/video/video_subtitler.h
index 94f22909a1..d2b5492e84 100644
--- a/engines/wintermute/video/video_subtitler.h
+++ b/engines/wintermute/video/video_subtitler.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/core/console.cpp b/engines/zvision/core/console.cpp
index 336541d82a..c711cd2186 100644
--- a/engines/zvision/core/console.cpp
+++ b/engines/zvision/core/console.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/engines/zvision/core/events.cpp b/engines/zvision/core/events.cpp
index 767101b952..f1922c6232 100644
--- a/engines/zvision/core/events.cpp
+++ b/engines/zvision/core/events.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/file/search_manager.cpp b/engines/zvision/file/search_manager.cpp
index 821b85b053..072393945d 100644
--- a/engines/zvision/file/search_manager.cpp
+++ b/engines/zvision/file/search_manager.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/debug.h"
#include "common/fs.h"
diff --git a/engines/zvision/file/search_manager.h b/engines/zvision/file/search_manager.h
index 0d0ab14d31..db9b9434d1 100644
--- a/engines/zvision/file/search_manager.h
+++ b/engines/zvision/file/search_manager.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/cursors/cursor.cpp b/engines/zvision/graphics/cursors/cursor.cpp
index 2c011668ac..7810ad9963 100644
--- a/engines/zvision/graphics/cursors/cursor.cpp
+++ b/engines/zvision/graphics/cursors/cursor.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/engines/zvision/graphics/cursors/cursor_manager.cpp b/engines/zvision/graphics/cursors/cursor_manager.cpp
index eeab18f4ba..6e8293db26 100644
--- a/engines/zvision/graphics/cursors/cursor_manager.cpp
+++ b/engines/zvision/graphics/cursors/cursor_manager.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/engines/zvision/graphics/cursors/cursor_manager.h b/engines/zvision/graphics/cursors/cursor_manager.h
index 35c605baf8..13e72f74ea 100644
--- a/engines/zvision/graphics/cursors/cursor_manager.h
+++ b/engines/zvision/graphics/cursors/cursor_manager.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/effects/fog.cpp b/engines/zvision/graphics/effects/fog.cpp
index 7b65f60f24..773007e8ea 100644
--- a/engines/zvision/graphics/effects/fog.cpp
+++ b/engines/zvision/graphics/effects/fog.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/effects/fog.h b/engines/zvision/graphics/effects/fog.h
index 498347609e..ee7e59f14b 100644
--- a/engines/zvision/graphics/effects/fog.h
+++ b/engines/zvision/graphics/effects/fog.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/effects/light.cpp b/engines/zvision/graphics/effects/light.cpp
index 39341687f8..a204dc04f4 100644
--- a/engines/zvision/graphics/effects/light.cpp
+++ b/engines/zvision/graphics/effects/light.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/effects/light.h b/engines/zvision/graphics/effects/light.h
index cd73a585ec..cbc0ef1fd1 100644
--- a/engines/zvision/graphics/effects/light.h
+++ b/engines/zvision/graphics/effects/light.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/effects/wave.cpp b/engines/zvision/graphics/effects/wave.cpp
index d2887b3112..7e062c81a6 100644
--- a/engines/zvision/graphics/effects/wave.cpp
+++ b/engines/zvision/graphics/effects/wave.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/effects/wave.h b/engines/zvision/graphics/effects/wave.h
index 8e912372d7..45333a03bd 100644
--- a/engines/zvision/graphics/effects/wave.h
+++ b/engines/zvision/graphics/effects/wave.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/graphics_effect.h b/engines/zvision/graphics/graphics_effect.h
index bfa266b11d..c298f91039 100644
--- a/engines/zvision/graphics/graphics_effect.h
+++ b/engines/zvision/graphics/graphics_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp
index f978ef7844..f660e1496a 100644
--- a/engines/zvision/graphics/render_manager.cpp
+++ b/engines/zvision/graphics/render_manager.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/engines/zvision/graphics/render_manager.h b/engines/zvision/graphics/render_manager.h
index 33d8a88e78..ed204a2f1d 100644
--- a/engines/zvision/graphics/render_manager.h
+++ b/engines/zvision/graphics/render_manager.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp
index e1380b0eb2..d77262fde1 100644
--- a/engines/zvision/scripting/actions.cpp
+++ b/engines/zvision/scripting/actions.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/control.h b/engines/zvision/scripting/control.h
index 108b83fd00..eb89f4334c 100644
--- a/engines/zvision/scripting/control.h
+++ b/engines/zvision/scripting/control.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/fist_control.cpp b/engines/zvision/scripting/controls/fist_control.cpp
index f79c82dc79..4399b0e6bd 100644
--- a/engines/zvision/scripting/controls/fist_control.cpp
+++ b/engines/zvision/scripting/controls/fist_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/hotmov_control.cpp b/engines/zvision/scripting/controls/hotmov_control.cpp
index 182447a990..4dd6354a2f 100644
--- a/engines/zvision/scripting/controls/hotmov_control.cpp
+++ b/engines/zvision/scripting/controls/hotmov_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/input_control.cpp b/engines/zvision/scripting/controls/input_control.cpp
index 9525333ef0..80710a2c50 100644
--- a/engines/zvision/scripting/controls/input_control.cpp
+++ b/engines/zvision/scripting/controls/input_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/lever_control.cpp b/engines/zvision/scripting/controls/lever_control.cpp
index 0f105b424c..553b5ec8c2 100644
--- a/engines/zvision/scripting/controls/lever_control.cpp
+++ b/engines/zvision/scripting/controls/lever_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/paint_control.cpp b/engines/zvision/scripting/controls/paint_control.cpp
index 62dde3d170..6b65d7d8e7 100644
--- a/engines/zvision/scripting/controls/paint_control.cpp
+++ b/engines/zvision/scripting/controls/paint_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/paint_control.h b/engines/zvision/scripting/controls/paint_control.h
index 8c01f0e68a..aeb3f99d3d 100644
--- a/engines/zvision/scripting/controls/paint_control.h
+++ b/engines/zvision/scripting/controls/paint_control.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/safe_control.cpp b/engines/zvision/scripting/controls/safe_control.cpp
index 4d2a91a1ad..6a955308fc 100644
--- a/engines/zvision/scripting/controls/safe_control.cpp
+++ b/engines/zvision/scripting/controls/safe_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/save_control.cpp b/engines/zvision/scripting/controls/save_control.cpp
index 2ac77c4776..9ff9e9e23f 100644
--- a/engines/zvision/scripting/controls/save_control.cpp
+++ b/engines/zvision/scripting/controls/save_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/slot_control.cpp b/engines/zvision/scripting/controls/slot_control.cpp
index 42b54a9ab5..d5551adcb3 100644
--- a/engines/zvision/scripting/controls/slot_control.cpp
+++ b/engines/zvision/scripting/controls/slot_control.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/controls/slot_control.h b/engines/zvision/scripting/controls/slot_control.h
index e776d99311..f70db26ae5 100644
--- a/engines/zvision/scripting/controls/slot_control.h
+++ b/engines/zvision/scripting/controls/slot_control.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/animation_effect.cpp b/engines/zvision/scripting/effects/animation_effect.cpp
index 511a0db353..a0f7dac0d1 100644
--- a/engines/zvision/scripting/effects/animation_effect.cpp
+++ b/engines/zvision/scripting/effects/animation_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/animation_effect.h b/engines/zvision/scripting/effects/animation_effect.h
index fd6e24ab8b..4b9a9ada4a 100644
--- a/engines/zvision/scripting/effects/animation_effect.h
+++ b/engines/zvision/scripting/effects/animation_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/distort_effect.cpp b/engines/zvision/scripting/effects/distort_effect.cpp
index 113b5d048d..b398b26c2c 100644
--- a/engines/zvision/scripting/effects/distort_effect.cpp
+++ b/engines/zvision/scripting/effects/distort_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/distort_effect.h b/engines/zvision/scripting/effects/distort_effect.h
index c64f10e6ff..5e7f18bcda 100644
--- a/engines/zvision/scripting/effects/distort_effect.h
+++ b/engines/zvision/scripting/effects/distort_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/music_effect.cpp b/engines/zvision/scripting/effects/music_effect.cpp
index e3fdc96dba..a0d0c317e6 100644
--- a/engines/zvision/scripting/effects/music_effect.cpp
+++ b/engines/zvision/scripting/effects/music_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/music_effect.h b/engines/zvision/scripting/effects/music_effect.h
index 7657be8e09..d814c595bc 100644
--- a/engines/zvision/scripting/effects/music_effect.h
+++ b/engines/zvision/scripting/effects/music_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/region_effect.cpp b/engines/zvision/scripting/effects/region_effect.cpp
index 78061cf4de..2cb5207ffd 100644
--- a/engines/zvision/scripting/effects/region_effect.cpp
+++ b/engines/zvision/scripting/effects/region_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/region_effect.h b/engines/zvision/scripting/effects/region_effect.h
index 4fc16224ff..90f284a175 100644
--- a/engines/zvision/scripting/effects/region_effect.h
+++ b/engines/zvision/scripting/effects/region_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/syncsound_effect.cpp b/engines/zvision/scripting/effects/syncsound_effect.cpp
index 70ba97deb8..a300a2b1f6 100644
--- a/engines/zvision/scripting/effects/syncsound_effect.cpp
+++ b/engines/zvision/scripting/effects/syncsound_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/syncsound_effect.h b/engines/zvision/scripting/effects/syncsound_effect.h
index 0eabff77a3..6fd8e71a95 100644
--- a/engines/zvision/scripting/effects/syncsound_effect.h
+++ b/engines/zvision/scripting/effects/syncsound_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/timer_effect.cpp b/engines/zvision/scripting/effects/timer_effect.cpp
index 778f9dec6c..99c8f035e2 100644
--- a/engines/zvision/scripting/effects/timer_effect.cpp
+++ b/engines/zvision/scripting/effects/timer_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/timer_effect.h b/engines/zvision/scripting/effects/timer_effect.h
index 5e45d54d7d..d3ec4e6e82 100644
--- a/engines/zvision/scripting/effects/timer_effect.h
+++ b/engines/zvision/scripting/effects/timer_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/ttytext_effect.cpp b/engines/zvision/scripting/effects/ttytext_effect.cpp
index 8d340dae39..634838a71d 100644
--- a/engines/zvision/scripting/effects/ttytext_effect.cpp
+++ b/engines/zvision/scripting/effects/ttytext_effect.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/effects/ttytext_effect.h b/engines/zvision/scripting/effects/ttytext_effect.h
index 18cbbbaee3..0928fa28d7 100644
--- a/engines/zvision/scripting/effects/ttytext_effect.h
+++ b/engines/zvision/scripting/effects/ttytext_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/inventory.cpp b/engines/zvision/scripting/inventory.cpp
index 76d43b200b..138b3f6884 100644
--- a/engines/zvision/scripting/inventory.cpp
+++ b/engines/zvision/scripting/inventory.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/engines/zvision/scripting/menu.cpp b/engines/zvision/scripting/menu.cpp
index 064bd1b57d..f149cf39d6 100644
--- a/engines/zvision/scripting/menu.cpp
+++ b/engines/zvision/scripting/menu.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/puzzle.h b/engines/zvision/scripting/puzzle.h
index 7d64357b0a..c8a5c9e0ee 100644
--- a/engines/zvision/scripting/puzzle.h
+++ b/engines/zvision/scripting/puzzle.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/scr_file_handling.cpp b/engines/zvision/scripting/scr_file_handling.cpp
index edc1b8622c..a8344ad5f4 100644
--- a/engines/zvision/scripting/scr_file_handling.cpp
+++ b/engines/zvision/scripting/scr_file_handling.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/script_manager.cpp b/engines/zvision/scripting/script_manager.cpp
index 70eaab2a0a..a0ebbd3e54 100644
--- a/engines/zvision/scripting/script_manager.cpp
+++ b/engines/zvision/scripting/script_manager.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
@@ -579,7 +579,7 @@ void ScriptManager::ChangeLocationReal(bool isLoading) {
_nextLocation.node = _currentLocation.node;
_nextLocation.view = _currentLocation.view;
_nextLocation.offset = _currentLocation.offset;
-
+
return;
} else {
_currentLocation.world = 'g';
diff --git a/engines/zvision/scripting/script_manager.h b/engines/zvision/scripting/script_manager.h
index 7c276bf917..66465d2293 100644
--- a/engines/zvision/scripting/script_manager.h
+++ b/engines/zvision/scripting/script_manager.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/scripting/scripting_effect.h b/engines/zvision/scripting/scripting_effect.h
index 2a2153204f..6097234330 100644
--- a/engines/zvision/scripting/scripting_effect.h
+++ b/engines/zvision/scripting/scripting_effect.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/sound/midi.cpp b/engines/zvision/sound/midi.cpp
index 9366f9e1e4..2b24193994 100644
--- a/engines/zvision/sound/midi.cpp
+++ b/engines/zvision/sound/midi.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/sound/zork_raw.cpp b/engines/zvision/sound/zork_raw.cpp
index 124235e0e0..e9439321f5 100644
--- a/engines/zvision/sound/zork_raw.cpp
+++ b/engines/zvision/sound/zork_raw.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/sound/zork_raw.h b/engines/zvision/sound/zork_raw.h
index 892bad4d5f..dbf576c8ea 100644
--- a/engines/zvision/sound/zork_raw.h
+++ b/engines/zvision/sound/zork_raw.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/text/subtitles.cpp b/engines/zvision/text/subtitles.cpp
index ffc9e2b808..d4a31c04ce 100644
--- a/engines/zvision/text/subtitles.cpp
+++ b/engines/zvision/text/subtitles.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/text/text.cpp b/engines/zvision/text/text.cpp
index 868ee4f1ae..38ae6c57a7 100644
--- a/engines/zvision/text/text.cpp
+++ b/engines/zvision/text/text.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -341,14 +341,14 @@ void TextRenderer::drawTextWithWordWrapping(const Common::String &text, Graphics
while (i < stringlen) {
if (text[i] == '<') {
- // Flush the currentWord to the currentSentence
+ // Flush the currentWord to the currentSentence
currentSentence += currentWord;
sentenceWidth += wordWidth;
// Reset the word variables
currentWord.clear();
wordWidth = 0;
-
+
// Parse the style tag
uint startTextPosition = i;
while (i < stringlen && text[i] != '>') {
@@ -388,13 +388,13 @@ void TextRenderer::drawTextWithWordWrapping(const Common::String &text, Graphics
if (!currentSentence.empty()) {
textSurfaces.push_back(TextSurface(font.renderSolidText(currentSentence, textColor), sentencePixelOffset, currentLineNumber));
}
-
+
// Set line width
lineWidths.push_back(lineWidth + sentenceWidth - (numSpaces * spaceWidth));
currentSentence.clear();
sentenceWidth = 0;
-
+
// Update the offsets
sentencePixelOffset.x = 0u;
sentencePixelOffset.y += lineHeight;
@@ -446,7 +446,7 @@ void TextRenderer::drawTextWithWordWrapping(const Common::String &text, Graphics
// We track the number of spaces so we can disregard their width in lineWidth calculations
++numSpaces;
- } else {
+ } else {
// If the word causes the line to overflow, render the sentence and start a new line
if (lineWidth + sentenceWidth + wordWidth > dest.w) {
// Only render out content
@@ -482,7 +482,7 @@ void TextRenderer::drawTextWithWordWrapping(const Common::String &text, Graphics
if (!currentWord.empty() || !currentSentence.empty()) {
currentSentence += currentWord;
sentenceWidth += wordWidth;
-
+
textSurfaces.push_back(TextSurface(font.renderSolidText(currentSentence, currentState.getTextColor(_engine)), sentencePixelOffset, currentLineNumber));
}
diff --git a/engines/zvision/text/text.h b/engines/zvision/text/text.h
index 5dd872a440..c003bb3c42 100644
--- a/engines/zvision/text/text.h
+++ b/engines/zvision/text/text.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/text/truetype_font.cpp b/engines/zvision/text/truetype_font.cpp
index ccb86d9440..7848de5434 100644
--- a/engines/zvision/text/truetype_font.cpp
+++ b/engines/zvision/text/truetype_font.cpp
@@ -8,12 +8,12 @@
* 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.
@@ -66,7 +66,7 @@ StyledTTFont::~StyledTTFont() {
bool StyledTTFont::loadFont(const Common::String &fontName, int32 point, uint style) {
// Don't re-load the font if we've already loaded it
- // We have to check for empty so we can default to Arial
+ // We have to check for empty so we can default to Arial
if (!fontName.empty() && _fontName.equalsIgnoreCase(fontName) && _lineHeight == point && _style == style) {
return true;
}
diff --git a/engines/zvision/video/rlf_decoder.cpp b/engines/zvision/video/rlf_decoder.cpp
index 3bbf22edff..f2e2892146 100644
--- a/engines/zvision/video/rlf_decoder.cpp
+++ b/engines/zvision/video/rlf_decoder.cpp
@@ -1,24 +1,24 @@
/* ScummVM - Graphic Adventure Engine
-*
-* ScummVM is the legal property of its developers, whose names
-* are too numerous to list here. Please refer to the COPYRIGHT
-* file distributed with this source distribution.
-*
-* This program is free software; you can redistribute it and/or
-* modify it under the terms of the GNU General Public License
-* as published by the Free Software Foundation; either version 2
-* of the License, or (at your option) any later version.
-
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-*/
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
#include "common/scummsys.h"
diff --git a/engines/zvision/video/video.cpp b/engines/zvision/video/video.cpp
index 1cfd0f4197..0c19c92574 100644
--- a/engines/zvision/video/video.cpp
+++ b/engines/zvision/video/video.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/video/zork_avi_decoder.h b/engines/zvision/video/zork_avi_decoder.h
index afcdb05676..8befaf5f5f 100644
--- a/engines/zvision/video/zork_avi_decoder.h
+++ b/engines/zvision/video/zork_avi_decoder.h
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp
index 05db284f62..6a18cf8e1b 100644
--- a/engines/zvision/zvision.cpp
+++ b/engines/zvision/zvision.cpp
@@ -8,12 +8,12 @@
* 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.
diff --git a/engines/zvision/zvision.h b/engines/zvision/zvision.h
index 4c948faaa4..5df8e820c3 100644
--- a/engines/zvision/zvision.h
+++ b/engines/zvision/zvision.h
@@ -8,12 +8,12 @@
* 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.