aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.common3
-rw-r--r--NEWS5
-rw-r--r--README2
-rw-r--r--audio/audiostream.cpp4
-rw-r--r--audio/audiostream.h4
-rw-r--r--audio/decoders/adpcm.cpp5
-rw-r--r--audio/decoders/adpcm.h5
-rw-r--r--audio/decoders/adpcm_intern.h1
-rw-r--r--audio/decoders/aiff.cpp4
-rw-r--r--audio/decoders/aiff.h4
-rw-r--r--audio/decoders/flac.cpp1
-rw-r--r--audio/decoders/flac.h3
-rw-r--r--audio/decoders/iff_sound.cpp1
-rw-r--r--audio/decoders/iff_sound.h2
-rw-r--r--audio/decoders/mac_snd.cpp3
-rw-r--r--audio/decoders/mac_snd.h4
-rw-r--r--audio/decoders/mp3.cpp1
-rw-r--r--audio/decoders/mp3.h3
-rw-r--r--audio/decoders/raw.cpp3
-rw-r--r--audio/decoders/raw.h6
-rw-r--r--audio/decoders/vag.h3
-rw-r--r--audio/decoders/voc.cpp2
-rw-r--r--audio/decoders/voc.h6
-rw-r--r--audio/decoders/vorbis.cpp2
-rw-r--r--audio/decoders/vorbis.h3
-rw-r--r--audio/decoders/wave.cpp3
-rw-r--r--audio/decoders/wave.h4
-rw-r--r--audio/fmopl.cpp1
-rw-r--r--audio/mididrv.cpp4
-rw-r--r--audio/mididrv.h7
-rw-r--r--audio/midiparser.cpp1
-rw-r--r--audio/midiparser.h1
-rw-r--r--audio/midiparser_smf.cpp2
-rw-r--r--audio/midiparser_xmidi.cpp2
-rw-r--r--audio/mixer.cpp1
-rw-r--r--audio/mixer.h9
-rw-r--r--audio/mods/infogrames.cpp1
-rw-r--r--audio/mods/infogrames.h5
-rw-r--r--audio/mods/maxtrax.cpp2
-rw-r--r--audio/mods/module.cpp2
-rw-r--r--audio/mods/module.h6
-rw-r--r--audio/mods/protracker.cpp2
-rw-r--r--audio/mods/protracker.h4
-rw-r--r--audio/mods/rjp1.cpp4
-rw-r--r--audio/mods/rjp1.h4
-rw-r--r--audio/mods/soundfx.cpp3
-rw-r--r--audio/mods/soundfx.h4
-rw-r--r--audio/mods/tfmx.cpp2
-rw-r--r--audio/mpu401.h2
-rw-r--r--audio/musicplugin.h4
-rw-r--r--audio/null.cpp1
-rw-r--r--audio/rate.cpp1
-rw-r--r--audio/rate.h6
-rw-r--r--audio/rate_arm.cpp1
-rw-r--r--audio/softsynth/adlib.cpp5
-rw-r--r--audio/softsynth/eas.cpp3
-rw-r--r--audio/softsynth/fluidsynth.cpp3
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_audio.cpp1
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_euphony.cpp2
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp1
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp2
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h2
-rw-r--r--audio/softsynth/mt32.cpp7
-rw-r--r--audio/softsynth/mt32/part.h1
-rw-r--r--audio/softsynth/mt32/synth.cpp8
-rw-r--r--audio/softsynth/mt32/synth.h1
-rw-r--r--audio/softsynth/opl/dosbox.cpp1
-rw-r--r--audio/softsynth/opl/mame.cpp3
-rw-r--r--audio/softsynth/opl/mame.h1
-rw-r--r--audio/softsynth/pcspk.h1
-rw-r--r--audio/softsynth/sid.cpp29
-rw-r--r--audio/softsynth/sid.h12
-rw-r--r--audio/softsynth/ym2612.cpp4
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.cpp1
-rw-r--r--backends/events/default/default-events.h4
-rw-r--r--backends/events/sdl/sdl-events.cpp3
-rw-r--r--backends/events/webossdl/webossdl-events.cpp1
-rw-r--r--backends/fs/posix/posix-fs-factory.cpp6
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp1
-rw-r--r--backends/graphics/gph/gph-graphics.cpp1
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp1
-rw-r--r--backends/graphics/opengl/gltexture.h3
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp33
-rw-r--r--backends/graphics/opengl/opengl-graphics.h2
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp5
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp15
-rw-r--r--backends/graphics/sdl/sdl-graphics.h1
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp1
-rw-r--r--backends/keymapper/hardware-key.h1
-rw-r--r--backends/keymapper/remap-dialog.cpp1
-rw-r--r--backends/keymapper/remap-dialog.h6
-rw-r--r--backends/midi/alsa.cpp2
-rw-r--r--backends/midi/camd.cpp6
-rw-r--r--backends/midi/coreaudio.cpp2
-rw-r--r--backends/midi/coremidi.cpp2
-rw-r--r--backends/midi/seq.cpp2
-rw-r--r--backends/midi/timidity.cpp4
-rw-r--r--backends/midi/windows.cpp2
-rw-r--r--backends/mixer/sdl/sdl-mixer.cpp2
-rw-r--r--backends/mixer/wincesdl/wincesdl-mixer.cpp1
-rw-r--r--backends/modular-backend.cpp10
-rw-r--r--backends/platform/android/android.cpp1
-rw-r--r--backends/platform/android/android.h1
-rw-r--r--backends/platform/android/asset-archive.cpp1
-rw-r--r--backends/platform/android/gfx.cpp4
-rw-r--r--backends/platform/android/jni.cpp2
-rw-r--r--backends/platform/android/org/inodes/gus/scummvm/ScummVM.java2
-rw-r--r--backends/platform/android/texture.cpp16
-rw-r--r--backends/platform/dc/dc.h1
-rw-r--r--backends/platform/dc/display.cpp2
-rw-r--r--backends/platform/dc/dreamcast.mk4
-rw-r--r--backends/platform/dc/plugins.cpp16
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp6
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h1
-rw-r--r--backends/platform/gph/gph-backend.cpp1
-rw-r--r--backends/platform/iphone/osys_main.h1
-rw-r--r--backends/platform/iphone/osys_video.cpp2
-rw-r--r--backends/platform/n64/osys_n64.h1
-rw-r--r--backends/platform/n64/osys_n64_base.cpp2
-rw-r--r--backends/platform/ps2/Gs2dScreen.cpp4
-rw-r--r--backends/platform/ps2/Gs2dScreen.h2
-rw-r--r--backends/platform/ps2/ps2input.h4
-rw-r--r--backends/platform/ps2/systemps2.cpp2
-rw-r--r--backends/platform/ps2/systemps2.h5
-rw-r--r--backends/platform/psp/README.PSP2
-rw-r--r--backends/platform/psp/cursor.cpp16
-rw-r--r--backends/platform/psp/default_display_client.cpp2
-rw-r--r--backends/platform/psp/mp3.cpp1
-rw-r--r--backends/platform/psp/mp3.h2
-rw-r--r--backends/platform/psp/osys_psp.h1
-rw-r--r--backends/platform/sdl/posix/posix.cpp3
-rw-r--r--backends/platform/sdl/sdl.cpp4
-rw-r--r--backends/platform/sdl/win32/win32.cpp2
-rw-r--r--backends/platform/webos/webos.mk107
-rw-r--r--backends/platform/wii/osystem.cpp1
-rw-r--r--backends/platform/wii/osystem.h1
-rw-r--r--backends/platform/wii/osystem_gfx.cpp4
-rw-r--r--backends/platform/wince/wince-sdl.cpp1
-rw-r--r--backends/plugins/dynamic-plugin.h1
-rw-r--r--backends/plugins/elf/memory-manager.cpp1
-rw-r--r--backends/saves/posix/posix-saves.cpp5
-rw-r--r--backends/saves/savefile.cpp4
-rw-r--r--backends/timer/default/default-timer.h2
-rw-r--r--backends/timer/sdl/sdl-timer.cpp2
-rw-r--r--backends/vkeybd/image-map.cpp2
-rw-r--r--backends/vkeybd/virtual-keyboard-gui.cpp10
-rw-r--r--backends/vkeybd/virtual-keyboard.cpp1
-rw-r--r--base/commandLine.cpp4
-rw-r--r--base/commandLine.h12
-rw-r--r--base/internal_version.h2
-rw-r--r--base/main.cpp6
-rw-r--r--base/plugins.h10
-rw-r--r--common/EventRecorder.cpp1
-rw-r--r--common/archive.cpp2
-rw-r--r--common/archive.h1
-rw-r--r--common/bufferedstream.h1
-rw-r--r--common/config-file.cpp2
-rw-r--r--common/config-file.h6
-rw-r--r--common/config-manager.cpp3
-rw-r--r--common/dcl.cpp4
-rw-r--r--common/debug.cpp2
-rw-r--r--common/error.cpp1
-rw-r--r--common/file.cpp3
-rw-r--r--common/file.h2
-rw-r--r--common/forbidden.h119
-rw-r--r--common/fs.cpp2
-rw-r--r--common/fs.h2
-rw-r--r--common/hashmap.h2
-rw-r--r--common/iff_container.h2
-rw-r--r--common/macresman.cpp2
-rw-r--r--common/macresman.h5
-rw-r--r--common/md5.cpp4
-rw-r--r--common/md5.h2
-rw-r--r--common/memstream.h1
-rw-r--r--common/scummsys.h4
-rw-r--r--common/stream.cpp2
-rw-r--r--common/stream.h4
-rw-r--r--common/substream.h1
-rw-r--r--common/system.cpp1
-rw-r--r--common/system.h26
-rw-r--r--common/textconsole.cpp1
-rw-r--r--common/translation.cpp2
-rw-r--r--common/translation.h4
-rw-r--r--common/unarj.cpp2
-rw-r--r--common/unarj.h3
-rw-r--r--common/unzip.cpp3
-rw-r--r--common/unzip.h3
-rw-r--r--common/util.cpp2
-rw-r--r--common/util.h1
-rw-r--r--common/winexe.h3
-rw-r--r--common/winexe_ne.h5
-rw-r--r--common/winexe_pe.cpp3
-rw-r--r--common/winexe_pe.h5
-rw-r--r--common/xmlparser.cpp8
-rw-r--r--common/xmlparser.h2
-rw-r--r--common/zlib.cpp3
-rwxr-xr-xconfigure21
-rw-r--r--devtools/create_project/create_project.cpp85
-rw-r--r--devtools/create_project/create_project.h28
-rw-r--r--devtools/create_project/msbuild.cpp159
-rw-r--r--devtools/create_project/msbuild.h3
-rw-r--r--devtools/create_project/scripts/postbuild.cmd2
-rw-r--r--devtools/create_project/visualstudio.cpp89
-rw-r--r--devtools/create_project/visualstudio.h4
-rwxr-xr-xdevtools/credits.pl2
-rw-r--r--dists/android/AndroidManifest.xml2
-rw-r--r--dists/android/plugin-manifest.xml2
-rw-r--r--dists/iphone/Info.plist4
-rw-r--r--dists/irix/scummvm.spec2
-rw-r--r--dists/macosx/Info.plist6
-rw-r--r--dists/redhat/scummvm-tools.spec2
-rw-r--r--dists/redhat/scummvm.spec2
-rw-r--r--dists/scummvm.rc8
-rwxr-xr-xdists/slackware/scummvm.SlackBuild2
-rw-r--r--dists/webos/mojo/scummvmrc-default4
-rwxr-xr-xdists/webos/mojo/start10
-rw-r--r--dists/wii/meta.xml2
-rw-r--r--dists/win32/ScummVM.iss82
-rw-r--r--engines/advancedDetector.cpp4
-rw-r--r--engines/advancedDetector.h12
-rw-r--r--engines/agi/agi.cpp1
-rw-r--r--engines/agi/agi.h8
-rw-r--r--engines/agi/detection.cpp4
-rw-r--r--engines/agi/graphics.cpp3
-rw-r--r--engines/agi/loader_v2.cpp2
-rw-r--r--engines/agi/loader_v3.cpp1
-rw-r--r--engines/agi/lzw.cpp2
-rw-r--r--engines/agi/objects.cpp2
-rw-r--r--engines/agi/op_cmd.cpp1
-rw-r--r--engines/agi/picture.cpp2
-rw-r--r--engines/agi/preagi.cpp1
-rw-r--r--engines/agi/preagi_mickey.cpp1
-rw-r--r--engines/agi/preagi_troll.cpp1
-rw-r--r--engines/agi/preagi_winnie.cpp1
-rw-r--r--engines/agi/predictive.cpp1
-rw-r--r--engines/agi/saveload.cpp1
-rw-r--r--engines/agi/sound.cpp2
-rw-r--r--engines/agi/sound_2gs.cpp1
-rw-r--r--engines/agi/sound_midi.cpp1
-rw-r--r--engines/agi/sound_sarien.cpp4
-rw-r--r--engines/agi/wagparser.cpp1
-rw-r--r--engines/agi/words.cpp2
-rw-r--r--engines/agos/agos.cpp22
-rw-r--r--engines/agos/agos.h1
-rw-r--r--engines/agos/animation.cpp2
-rw-r--r--engines/agos/charset-fontdata.cpp1
-rw-r--r--engines/agos/debug.cpp1
-rw-r--r--engines/agos/detection.cpp1
-rw-r--r--engines/agos/draw.cpp1
-rw-r--r--engines/agos/event.cpp1
-rw-r--r--engines/agos/gfx.cpp1
-rw-r--r--engines/agos/icons.cpp4
-rw-r--r--engines/agos/items.cpp1
-rw-r--r--engines/agos/menus.cpp1
-rw-r--r--engines/agos/midi.cpp1
-rw-r--r--engines/agos/midi.h2
-rw-r--r--engines/agos/midiparser_s1d.cpp1
-rw-r--r--engines/agos/res.cpp1
-rw-r--r--engines/agos/res_snd.cpp1
-rw-r--r--engines/agos/rooms.cpp1
-rw-r--r--engines/agos/saveload.cpp1
-rw-r--r--engines/agos/script.cpp1
-rw-r--r--engines/agos/script_pn.cpp2
-rw-r--r--engines/agos/script_s1.cpp2
-rw-r--r--engines/agos/script_s2.cpp2
-rw-r--r--engines/agos/sound.cpp1
-rw-r--r--engines/agos/string.cpp1
-rw-r--r--engines/agos/string_pn.cpp2
-rw-r--r--engines/agos/subroutine.cpp1
-rw-r--r--engines/agos/vga.cpp1
-rw-r--r--engines/agos/vga_e2.cpp1
-rw-r--r--engines/agos/vga_ww.cpp1
-rw-r--r--engines/agos/window.cpp1
-rw-r--r--engines/cine/anim.cpp1
-rw-r--r--engines/cine/bg.cpp1
-rw-r--r--engines/cine/cine.cpp4
-rw-r--r--engines/cine/detection.cpp1
-rw-r--r--engines/cine/gfx.cpp3
-rw-r--r--engines/cine/msg.cpp1
-rw-r--r--engines/cine/pal.cpp3
-rw-r--r--engines/cine/part.cpp1
-rw-r--r--engines/cine/saveload.cpp1
-rw-r--r--engines/cine/script_fw.cpp1
-rw-r--r--engines/cine/script_os.cpp1
-rw-r--r--engines/cine/sound.cpp2
-rw-r--r--engines/cine/sound.h2
-rw-r--r--engines/cine/texte.cpp4
-rw-r--r--engines/cine/various.cpp1
-rw-r--r--engines/cruise/actor.cpp2
-rw-r--r--engines/cruise/background.cpp2
-rw-r--r--engines/cruise/cruise.cpp5
-rw-r--r--engines/cruise/cruise.h1
-rw-r--r--engines/cruise/cruise_main.cpp1
-rw-r--r--engines/cruise/dataLoader.cpp1
-rw-r--r--engines/cruise/detection.cpp1
-rw-r--r--engines/cruise/function.cpp2
-rw-r--r--engines/cruise/gfxModule.cpp2
-rw-r--r--engines/cruise/menu.cpp1
-rw-r--r--engines/cruise/object.cpp2
-rw-r--r--engines/cruise/overlay.cpp1
-rw-r--r--engines/cruise/saveload.cpp1
-rw-r--r--engines/cruise/script.cpp1
-rw-r--r--engines/cruise/sound.cpp2
-rw-r--r--engines/dialogs.cpp12
-rw-r--r--engines/dialogs.h8
-rw-r--r--engines/draci/animation.cpp1
-rw-r--r--engines/draci/game.h2
-rw-r--r--engines/draci/music.cpp1
-rw-r--r--engines/draci/screen.cpp2
-rw-r--r--engines/draci/script.h2
-rw-r--r--engines/draci/sound.cpp1
-rw-r--r--engines/draci/surface.cpp2
-rw-r--r--engines/draci/surface.h1
-rw-r--r--engines/drascula/converse.cpp2
-rw-r--r--engines/drascula/drascula.cpp1
-rw-r--r--engines/drascula/graphics.cpp3
-rw-r--r--engines/drascula/objects.cpp2
-rw-r--r--engines/drascula/palette.cpp2
-rw-r--r--engines/drascula/rooms.cpp1
-rw-r--r--engines/drascula/saveload.cpp2
-rw-r--r--engines/drascula/sound.cpp1
-rw-r--r--engines/engine.cpp13
-rw-r--r--engines/engine.h14
-rw-r--r--engines/game.cpp1
-rw-r--r--engines/game.h2
-rw-r--r--engines/gob/databases.cpp1
-rw-r--r--engines/gob/dataio.h2
-rw-r--r--engines/gob/gob.cpp3
-rw-r--r--engines/gob/gob.h4
-rw-r--r--engines/gob/inter_v1.cpp2
-rw-r--r--engines/gob/inter_v4.cpp2
-rw-r--r--engines/gob/inter_v5.cpp3
-rw-r--r--engines/gob/inter_v6.cpp2
-rw-r--r--engines/gob/resources.h2
-rw-r--r--engines/gob/save/saveload.cpp3
-rw-r--r--engines/gob/sound/adlib.cpp2
-rw-r--r--engines/gob/sound/bgatmosphere.cpp2
-rw-r--r--engines/gob/sound/cdrom.cpp1
-rw-r--r--engines/gob/sound/infogrames.cpp2
-rw-r--r--engines/gob/sound/sounddesc.cpp2
-rw-r--r--engines/gob/sound/soundmixer.cpp2
-rw-r--r--engines/gob/surface.cpp2
-rw-r--r--engines/gob/surface.h2
-rw-r--r--engines/gob/totfile.h2
-rw-r--r--engines/gob/util.cpp2
-rw-r--r--engines/gob/video.cpp1
-rw-r--r--engines/gob/videoplayer.cpp2
-rw-r--r--engines/groovie/cursor.cpp3
-rw-r--r--engines/groovie/cursor.h2
-rw-r--r--engines/groovie/debug.cpp2
-rw-r--r--engines/groovie/font.cpp4
-rw-r--r--engines/groovie/graphics.cpp8
-rw-r--r--engines/groovie/groovie.cpp2
-rw-r--r--engines/groovie/groovie.h2
-rw-r--r--engines/groovie/music.cpp3
-rw-r--r--engines/groovie/player.cpp2
-rw-r--r--engines/groovie/resource.cpp3
-rw-r--r--engines/groovie/resource.h2
-rw-r--r--engines/groovie/roq.cpp17
-rw-r--r--engines/groovie/script.cpp1
-rw-r--r--engines/groovie/vdx.cpp3
-rw-r--r--engines/groovie/vdx.h2
-rw-r--r--engines/hugo/detection.cpp1
-rw-r--r--engines/hugo/dialogs.cpp8
-rw-r--r--engines/hugo/display.cpp3
-rw-r--r--engines/hugo/file.cpp2
-rw-r--r--engines/hugo/file_v1d.cpp2
-rw-r--r--engines/hugo/file_v1w.cpp2
-rw-r--r--engines/hugo/file_v2d.cpp2
-rw-r--r--engines/hugo/file_v3d.cpp2
-rw-r--r--engines/hugo/hugo.cpp3
-rw-r--r--engines/hugo/intro.cpp7
-rw-r--r--engines/hugo/inventory.cpp1
-rw-r--r--engines/hugo/mouse.cpp1
-rw-r--r--engines/hugo/object.cpp3
-rw-r--r--engines/hugo/object_v1d.cpp1
-rw-r--r--engines/hugo/object_v1w.cpp1
-rw-r--r--engines/hugo/object_v2d.cpp1
-rw-r--r--engines/hugo/object_v3d.cpp1
-rw-r--r--engines/hugo/parser.cpp6
-rw-r--r--engines/hugo/parser.h5
-rw-r--r--engines/hugo/parser_v1d.cpp1
-rw-r--r--engines/hugo/parser_v1w.cpp3
-rw-r--r--engines/hugo/parser_v2d.cpp1
-rw-r--r--engines/hugo/parser_v3d.cpp1
-rw-r--r--engines/hugo/route.cpp1
-rw-r--r--engines/hugo/schedule.cpp2
-rw-r--r--engines/hugo/sound.cpp2
-rw-r--r--engines/kyra/animator_hof.cpp2
-rw-r--r--engines/kyra/animator_lok.cpp5
-rw-r--r--engines/kyra/animator_mr.cpp2
-rw-r--r--engines/kyra/animator_tim.cpp5
-rw-r--r--engines/kyra/animator_v2.cpp3
-rw-r--r--engines/kyra/debugger.cpp7
-rw-r--r--engines/kyra/detection.cpp6
-rw-r--r--engines/kyra/gui.cpp2
-rw-r--r--engines/kyra/gui_hof.cpp8
-rw-r--r--engines/kyra/gui_lok.cpp9
-rw-r--r--engines/kyra/gui_lok.h1
-rw-r--r--engines/kyra/gui_lol.cpp4
-rw-r--r--engines/kyra/gui_mr.cpp5
-rw-r--r--engines/kyra/gui_v2.cpp2
-rw-r--r--engines/kyra/items_hof.cpp2
-rw-r--r--engines/kyra/items_lok.cpp8
-rw-r--r--engines/kyra/items_mr.cpp2
-rw-r--r--engines/kyra/kyra_hof.cpp7
-rw-r--r--engines/kyra/kyra_lok.cpp21
-rw-r--r--engines/kyra/kyra_lok.h4
-rw-r--r--engines/kyra/kyra_mr.cpp5
-rw-r--r--engines/kyra/kyra_v1.cpp15
-rw-r--r--engines/kyra/kyra_v1.h7
-rw-r--r--engines/kyra/kyra_v2.cpp7
-rw-r--r--engines/kyra/lol.cpp6
-rw-r--r--engines/kyra/lol.h5
-rw-r--r--engines/kyra/resource.cpp4
-rw-r--r--engines/kyra/saveload.cpp8
-rw-r--r--engines/kyra/saveload_hof.cpp12
-rw-r--r--engines/kyra/saveload_lok.cpp7
-rw-r--r--engines/kyra/saveload_lol.cpp3
-rw-r--r--engines/kyra/scene_hof.cpp4
-rw-r--r--engines/kyra/scene_lok.cpp6
-rw-r--r--engines/kyra/scene_lol.cpp2
-rw-r--r--engines/kyra/scene_mr.cpp3
-rw-r--r--engines/kyra/scene_v1.cpp1
-rw-r--r--engines/kyra/scene_v2.cpp3
-rw-r--r--engines/kyra/screen.cpp8
-rw-r--r--engines/kyra/screen_hof.cpp4
-rw-r--r--engines/kyra/screen_lok.cpp6
-rw-r--r--engines/kyra/screen_lol.cpp5
-rw-r--r--engines/kyra/screen_mr.cpp1
-rw-r--r--engines/kyra/script.cpp10
-rw-r--r--engines/kyra/script_hof.cpp7
-rw-r--r--engines/kyra/script_lok.cpp7
-rw-r--r--engines/kyra/script_lol.cpp3
-rw-r--r--engines/kyra/script_mr.cpp6
-rw-r--r--engines/kyra/script_tim.cpp4
-rw-r--r--engines/kyra/script_tim.h1
-rw-r--r--engines/kyra/script_v1.cpp2
-rw-r--r--engines/kyra/script_v2.cpp2
-rw-r--r--engines/kyra/seqplayer.cpp11
-rw-r--r--engines/kyra/sequences_hof.cpp6
-rw-r--r--engines/kyra/sequences_lok.cpp4
-rw-r--r--engines/kyra/sequences_lol.cpp3
-rw-r--r--engines/kyra/sequences_v2.cpp2
-rw-r--r--engines/kyra/sound.cpp7
-rw-r--r--engines/kyra/sound_adlib.cpp5
-rw-r--r--engines/kyra/sound_amiga.cpp5
-rw-r--r--engines/kyra/sound_lok.cpp4
-rw-r--r--engines/kyra/sound_lol.cpp4
-rw-r--r--engines/kyra/sound_towns.cpp9
-rw-r--r--engines/kyra/sprites.cpp12
-rw-r--r--engines/kyra/staticres.cpp9
-rw-r--r--engines/kyra/text.cpp6
-rw-r--r--engines/kyra/text_hof.cpp4
-rw-r--r--engines/kyra/text_lok.cpp5
-rw-r--r--engines/kyra/text_lol.cpp5
-rw-r--r--engines/kyra/text_lol.h4
-rw-r--r--engines/kyra/text_mr.cpp3
-rw-r--r--engines/kyra/timer.cpp4
-rw-r--r--engines/kyra/timer_lok.cpp4
-rw-r--r--engines/kyra/timer_lol.cpp3
-rw-r--r--engines/kyra/timer_mr.cpp2
-rw-r--r--engines/kyra/vqa.cpp6
-rw-r--r--engines/kyra/wsamovie.cpp11
-rw-r--r--engines/kyra/wsamovie.h4
-rw-r--r--engines/lastexpress/data/animation.cpp5
-rw-r--r--engines/lastexpress/data/archive.h3
-rw-r--r--engines/lastexpress/data/background.cpp1
-rw-r--r--engines/lastexpress/data/font.cpp2
-rw-r--r--engines/lastexpress/data/font.h2
-rw-r--r--engines/lastexpress/data/scene.cpp1
-rw-r--r--engines/lastexpress/data/scene.h6
-rw-r--r--engines/lastexpress/data/sequence.cpp3
-rw-r--r--engines/lastexpress/data/sequence.h2
-rw-r--r--engines/lastexpress/data/snd.cpp3
-rw-r--r--engines/lastexpress/data/snd.h4
-rw-r--r--engines/lastexpress/data/subtitle.cpp2
-rw-r--r--engines/lastexpress/entities/entity.h1
-rw-r--r--engines/lastexpress/game/state.h2
-rw-r--r--engines/lastexpress/graphics.cpp13
-rw-r--r--engines/lastexpress/resource.cpp1
-rw-r--r--engines/lure/disk.h2
-rw-r--r--engines/lure/memory.cpp1
-rw-r--r--engines/lure/res_struct.h2
-rw-r--r--engines/lure/screen.cpp2
-rw-r--r--engines/lure/sound.h1
-rw-r--r--engines/m4/actor.cpp1
-rw-r--r--engines/m4/animation.cpp2
-rw-r--r--engines/m4/compression.cpp1
-rw-r--r--engines/m4/console.cpp2
-rw-r--r--engines/m4/converse.cpp1
-rw-r--r--engines/m4/dialogs.cpp3
-rw-r--r--engines/m4/globals.cpp2
-rw-r--r--engines/m4/graphics.cpp15
-rw-r--r--engines/m4/graphics.h8
-rw-r--r--engines/m4/gui.cpp1
-rw-r--r--engines/m4/m4.cpp7
-rw-r--r--engines/m4/m4_menus.cpp1
-rw-r--r--engines/m4/m4_scene.cpp1
-rw-r--r--engines/m4/m4_views.cpp2
-rw-r--r--engines/m4/mads_anim.cpp2
-rw-r--r--engines/m4/mads_logic.cpp2
-rw-r--r--engines/m4/mads_menus.cpp2
-rw-r--r--engines/m4/mads_scene.cpp1
-rw-r--r--engines/m4/mads_views.cpp1
-rw-r--r--engines/m4/midi.cpp1
-rw-r--r--engines/m4/resource.cpp1
-rw-r--r--engines/m4/script.cpp1
-rw-r--r--engines/m4/sound.cpp1
-rw-r--r--engines/m4/sprite.cpp1
-rw-r--r--engines/m4/woodscript.cpp1
-rw-r--r--engines/made/database.cpp1
-rw-r--r--engines/made/graphics.cpp2
-rw-r--r--engines/made/made.cpp2
-rw-r--r--engines/made/music.cpp2
-rw-r--r--engines/made/pmvplayer.cpp2
-rw-r--r--engines/made/redreader.cpp1
-rw-r--r--engines/made/resource.cpp7
-rw-r--r--engines/made/resource.h1
-rw-r--r--engines/made/screen.cpp8
-rw-r--r--engines/made/script.h1
-rw-r--r--engines/made/scriptfuncs.cpp2
-rw-r--r--engines/made/scriptfuncs.h2
-rw-r--r--engines/metaengine.h4
-rw-r--r--engines/mohawk/bitmap.cpp15
-rw-r--r--engines/mohawk/console.cpp3
-rw-r--r--engines/mohawk/cstime.cpp5
-rw-r--r--engines/mohawk/cstime_cases.cpp2
-rw-r--r--engines/mohawk/cstime_game.cpp2
-rw-r--r--engines/mohawk/cstime_ui.cpp2
-rw-r--r--engines/mohawk/cstime_view.cpp2
-rw-r--r--engines/mohawk/cursors.cpp2
-rw-r--r--engines/mohawk/cursors.h10
-rw-r--r--engines/mohawk/detection.cpp4
-rw-r--r--engines/mohawk/detection_tables.h32
-rw-r--r--engines/mohawk/dialogs.cpp4
-rw-r--r--engines/mohawk/graphics.cpp17
-rw-r--r--engines/mohawk/graphics.h2
-rw-r--r--engines/mohawk/installer_archive.cpp2
-rw-r--r--engines/mohawk/installer_archive.h2
-rw-r--r--engines/mohawk/livingbooks.cpp6
-rw-r--r--engines/mohawk/livingbooks_code.cpp3
-rw-r--r--engines/mohawk/mohawk.cpp10
-rw-r--r--engines/mohawk/mohawk.h2
-rw-r--r--engines/mohawk/myst.cpp2
-rw-r--r--engines/mohawk/myst_areas.cpp4
-rw-r--r--engines/mohawk/myst_scripts.cpp2
-rw-r--r--engines/mohawk/myst_stacks/channelwood.cpp4
-rw-r--r--engines/mohawk/myst_stacks/credits.cpp1
-rw-r--r--engines/mohawk/myst_stacks/dni.cpp2
-rw-r--r--engines/mohawk/myst_stacks/mechanical.cpp3
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp2
-rw-r--r--engines/mohawk/myst_stacks/preview.cpp1
-rw-r--r--engines/mohawk/myst_stacks/selenitic.cpp2
-rw-r--r--engines/mohawk/myst_stacks/slides.cpp1
-rw-r--r--engines/mohawk/myst_stacks/stoneship.cpp4
-rw-r--r--engines/mohawk/myst_state.cpp2
-rw-r--r--engines/mohawk/myst_state.h2
-rw-r--r--engines/mohawk/resource.cpp1
-rw-r--r--engines/mohawk/riven.h1
-rw-r--r--engines/mohawk/riven_external.cpp1
-rw-r--r--engines/mohawk/riven_scripts.cpp1
-rw-r--r--engines/mohawk/riven_scripts.h1
-rw-r--r--engines/mohawk/sound.cpp3
-rw-r--r--engines/mohawk/video.cpp11
-rw-r--r--engines/mohawk/view.cpp2
-rw-r--r--engines/parallaction/balloons.cpp6
-rw-r--r--engines/parallaction/callables_br.cpp2
-rw-r--r--engines/parallaction/detection.cpp1
-rw-r--r--engines/parallaction/dialogue.cpp1
-rw-r--r--engines/parallaction/disk.cpp5
-rw-r--r--engines/parallaction/disk.h10
-rw-r--r--engines/parallaction/disk_br.cpp3
-rw-r--r--engines/parallaction/disk_ns.cpp3
-rw-r--r--engines/parallaction/exec_br.cpp2
-rw-r--r--engines/parallaction/exec_ns.cpp1
-rw-r--r--engines/parallaction/font.cpp1
-rw-r--r--engines/parallaction/gfxbase.cpp1
-rw-r--r--engines/parallaction/graphics.cpp6
-rw-r--r--engines/parallaction/gui.cpp2
-rw-r--r--engines/parallaction/gui_br.cpp3
-rw-r--r--engines/parallaction/gui_ns.cpp5
-rw-r--r--engines/parallaction/input.cpp7
-rw-r--r--engines/parallaction/inventory.cpp4
-rw-r--r--engines/parallaction/objects.cpp2
-rw-r--r--engines/parallaction/parallaction.cpp5
-rw-r--r--engines/parallaction/parallaction.h1
-rw-r--r--engines/parallaction/parallaction_br.cpp1
-rw-r--r--engines/parallaction/parallaction_ns.cpp1
-rw-r--r--engines/parallaction/parser.cpp2
-rw-r--r--engines/parallaction/parser_br.cpp1
-rw-r--r--engines/parallaction/parser_ns.cpp2
-rw-r--r--engines/parallaction/saveload.cpp1
-rw-r--r--engines/parallaction/sound_br.cpp1
-rw-r--r--engines/parallaction/sound_ns.cpp2
-rw-r--r--engines/queen/command.cpp2
-rw-r--r--engines/queen/cutaway.cpp1
-rw-r--r--engines/queen/display.cpp1
-rw-r--r--engines/queen/display.h3
-rw-r--r--engines/queen/graphics.cpp3
-rw-r--r--engines/queen/input.cpp1
-rw-r--r--engines/queen/journal.cpp1
-rw-r--r--engines/queen/logic.cpp3
-rw-r--r--engines/queen/midiadlib.cpp1
-rw-r--r--engines/queen/queen.cpp1
-rw-r--r--engines/queen/queen.h2
-rw-r--r--engines/queen/resource.cpp1
-rw-r--r--engines/queen/sound.cpp1
-rw-r--r--engines/queen/sound.h2
-rw-r--r--engines/queen/talk.cpp3
-rw-r--r--engines/queen/walk.cpp1
-rw-r--r--engines/saga/gfx.cpp3
-rw-r--r--engines/saga/gfx.h1
-rw-r--r--engines/saga/interface.cpp4
-rw-r--r--engines/saga/introproc_saga2.cpp5
-rw-r--r--engines/saga/render.cpp2
-rw-r--r--engines/saga/saga.h1
-rw-r--r--engines/saga/saveload.cpp2
-rw-r--r--engines/saga/shorten.cpp3
-rw-r--r--engines/savestate.cpp1
-rw-r--r--engines/savestate.h2
-rw-r--r--engines/sci/decompressor.cpp3
-rw-r--r--engines/sci/decompressor.h4
-rw-r--r--engines/sci/engine/kfile.cpp1
-rw-r--r--engines/sci/engine/ksound.cpp1
-rw-r--r--engines/sci/engine/kvideo.cpp9
-rw-r--r--engines/sci/engine/object.h1
-rw-r--r--engines/sci/engine/state.h4
-rw-r--r--engines/sci/engine/vm.cpp2
-rw-r--r--engines/sci/graphics/fontsjis.h2
-rw-r--r--engines/sci/graphics/frameout.cpp12
-rw-r--r--engines/sci/graphics/maciconbar.h2
-rw-r--r--engines/sci/graphics/paint.cpp2
-rw-r--r--engines/sci/graphics/paint16.cpp14
-rw-r--r--engines/sci/graphics/paint32.cpp5
-rw-r--r--engines/sci/graphics/palette.cpp2
-rw-r--r--engines/sci/graphics/portrait.cpp4
-rw-r--r--engines/sci/graphics/transitions.cpp3
-rw-r--r--engines/sci/parser/grammar.cpp1
-rw-r--r--engines/sci/resource.cpp5
-rw-r--r--engines/sci/resource_audio.cpp1
-rw-r--r--engines/sci/resource_intern.h2
-rw-r--r--engines/sci/sound/drivers/adlib.cpp2
-rw-r--r--engines/sci/sound/drivers/amigamac.cpp2
-rw-r--r--engines/sci/sound/drivers/cms.cpp2
-rw-r--r--engines/sci/sound/drivers/fb01.cpp1
-rw-r--r--engines/sci/sound/drivers/midi.cpp4
-rw-r--r--engines/sci/sound/drivers/pcjr.cpp3
-rw-r--r--engines/sci/sound/soundcmd.cpp28
-rw-r--r--engines/sci/video/robot_decoder.cpp5
-rw-r--r--engines/sci/video/robot_decoder.h1
-rw-r--r--engines/sci/video/seq_decoder.cpp6
-rw-r--r--engines/sci/video/seq_decoder.h10
-rw-r--r--engines/scumm/charset.cpp47
-rw-r--r--engines/scumm/cursor.cpp2
-rw-r--r--engines/scumm/debugger.cpp1
-rw-r--r--engines/scumm/detection.cpp4
-rw-r--r--engines/scumm/detection_tables.h5
-rw-r--r--engines/scumm/dialogs.h4
-rw-r--r--engines/scumm/file_nes.cpp1
-rw-r--r--engines/scumm/gfx.cpp91
-rw-r--r--engines/scumm/gfx.h4
-rw-r--r--engines/scumm/gfx_towns.cpp2
-rw-r--r--engines/scumm/he/cup_player_he.cpp1
-rw-r--r--engines/scumm/he/logic_he.cpp206
-rw-r--r--engines/scumm/he/logic_he.h32
-rw-r--r--engines/scumm/he/palette_he.cpp1
-rw-r--r--engines/scumm/imuse/imuse_part.cpp2
-rw-r--r--engines/scumm/imuse/sysex_scumm.cpp1
-rw-r--r--engines/scumm/imuse_digi/dimuse.h2
-rw-r--r--engines/scumm/midiparser_ro.cpp1
-rw-r--r--engines/scumm/palette.cpp3
-rw-r--r--engines/scumm/player_mod.h2
-rw-r--r--engines/scumm/player_nes.h2
-rw-r--r--engines/scumm/player_pce.h1
-rw-r--r--engines/scumm/player_sid.cpp2
-rw-r--r--engines/scumm/player_v4a.h1
-rw-r--r--engines/scumm/saveload.h4
-rw-r--r--engines/scumm/scumm.cpp4
-rw-r--r--engines/scumm/scumm.h9
-rw-r--r--engines/scumm/smush/channel.cpp2
-rw-r--r--engines/scumm/smush/channel.h2
-rw-r--r--engines/scumm/smush/codec37.cpp1
-rw-r--r--engines/scumm/smush/codec47.cpp1
-rw-r--r--engines/scumm/smush/saud_channel.cpp1
-rw-r--r--engines/scumm/smush/smush_mixer.h2
-rw-r--r--engines/scumm/smush/smush_player.cpp1
-rw-r--r--engines/scumm/sound.cpp4
-rw-r--r--engines/scumm/util.cpp1
-rw-r--r--engines/sky/autoroute.cpp1
-rw-r--r--engines/sky/compact.cpp3
-rw-r--r--engines/sky/compact.h2
-rw-r--r--engines/sky/control.cpp3
-rw-r--r--engines/sky/control.h2
-rw-r--r--engines/sky/debug.cpp2
-rw-r--r--engines/sky/detection.cpp1
-rw-r--r--engines/sky/disk.cpp4
-rw-r--r--engines/sky/disk.h3
-rw-r--r--engines/sky/intro.cpp1
-rw-r--r--engines/sky/logic.cpp3
-rw-r--r--engines/sky/mouse.cpp1
-rw-r--r--engines/sky/music/adlibchannel.cpp1
-rw-r--r--engines/sky/music/gmchannel.cpp1
-rw-r--r--engines/sky/music/gmmusic.cpp1
-rw-r--r--engines/sky/music/mt32music.cpp1
-rw-r--r--engines/sky/music/musicbase.cpp1
-rw-r--r--engines/sky/screen.cpp3
-rw-r--r--engines/sky/screen.h3
-rw-r--r--engines/sky/sky.cpp1
-rw-r--r--engines/sky/sky.h4
-rw-r--r--engines/sky/sound.cpp2
-rw-r--r--engines/sky/text.cpp2
-rw-r--r--engines/sword1/animation.cpp7
-rw-r--r--engines/sword1/control.cpp2
-rw-r--r--engines/sword1/control.h2
-rw-r--r--engines/sword1/detection.cpp2
-rw-r--r--engines/sword1/eventman.cpp1
-rw-r--r--engines/sword1/logic.cpp3
-rw-r--r--engines/sword1/memman.cpp1
-rw-r--r--engines/sword1/mouse.h1
-rw-r--r--engines/sword1/music.cpp3
-rw-r--r--engines/sword1/objectman.cpp1
-rw-r--r--engines/sword1/resman.cpp9
-rw-r--r--engines/sword1/router.cpp1
-rw-r--r--engines/sword1/screen.cpp3
-rw-r--r--engines/sword1/sound.cpp3
-rw-r--r--engines/sword1/sound.h2
-rw-r--r--engines/sword1/sword1.cpp1
-rw-r--r--engines/sword1/sword1.h4
-rw-r--r--engines/sword1/text.cpp3
-rw-r--r--engines/sword2/animation.cpp2
-rw-r--r--engines/sword2/controls.cpp2
-rw-r--r--engines/sword2/events.cpp1
-rw-r--r--engines/sword2/function.cpp1
-rw-r--r--engines/sword2/interpreter.cpp1
-rw-r--r--engines/sword2/layers.cpp1
-rw-r--r--engines/sword2/logic.cpp1
-rw-r--r--engines/sword2/maketext.cpp1
-rw-r--r--engines/sword2/memory.cpp1
-rw-r--r--engines/sword2/mouse.cpp1
-rw-r--r--engines/sword2/music.cpp1
-rw-r--r--engines/sword2/palette.cpp3
-rw-r--r--engines/sword2/resman.cpp1
-rw-r--r--engines/sword2/resman.h2
-rw-r--r--engines/sword2/router.cpp1
-rw-r--r--engines/sword2/saveload.cpp1
-rw-r--r--engines/sword2/screen.cpp1
-rw-r--r--engines/sword2/sound.cpp1
-rw-r--r--engines/sword2/sound.h1
-rw-r--r--engines/sword2/speech.cpp1
-rw-r--r--engines/sword2/startup.cpp1
-rw-r--r--engines/sword2/sword2.cpp1
-rw-r--r--engines/sword2/sync.cpp1
-rw-r--r--engines/sword25/detection.cpp2
-rw-r--r--engines/sword25/fmv/movieplayer.cpp8
-rw-r--r--engines/sword25/fmv/theora_decoder.cpp3
-rw-r--r--engines/sword25/fmv/theora_decoder.h3
-rw-r--r--engines/sword25/gfx/graphicengine.cpp6
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp9
-rw-r--r--engines/sword25/gfx/screenshot.cpp5
-rw-r--r--engines/sword25/kernel/filesystemutil.cpp3
-rw-r--r--engines/sword25/kernel/inputpersistenceblock.cpp2
-rw-r--r--engines/sword25/kernel/kernel.h1
-rw-r--r--engines/sword25/kernel/objectregistry.h1
-rw-r--r--engines/sword25/kernel/persistenceservice.cpp3
-rw-r--r--engines/sword25/script/luacallback.cpp2
-rw-r--r--engines/sword25/sfx/soundengine.cpp2
-rw-r--r--engines/sword25/sword25.cpp10
-rw-r--r--engines/sword25/sword25.h10
-rw-r--r--engines/teenagent/actor.cpp1
-rw-r--r--engines/teenagent/animation.cpp1
-rw-r--r--engines/teenagent/callbacks.cpp2
-rw-r--r--engines/teenagent/font.cpp4
-rw-r--r--engines/teenagent/font.h1
-rw-r--r--engines/teenagent/inventory.cpp1
-rw-r--r--engines/teenagent/music.cpp2
-rw-r--r--engines/teenagent/resources.cpp1
-rw-r--r--engines/teenagent/scene.cpp5
-rw-r--r--engines/teenagent/scene.h4
-rw-r--r--engines/teenagent/segment.cpp1
-rw-r--r--engines/teenagent/surface.cpp2
-rw-r--r--engines/teenagent/surface.h6
-rw-r--r--engines/teenagent/teenagent.cpp2
-rw-r--r--engines/testbed/detection.cpp2
-rw-r--r--engines/testbed/events.cpp7
-rw-r--r--engines/testbed/graphics.cpp1
-rw-r--r--engines/testbed/sound.cpp2
-rw-r--r--engines/testbed/testbed.cpp7
-rw-r--r--engines/testbed/testbed.h4
-rw-r--r--engines/testbed/testsuite.h5
-rw-r--r--engines/tinsel/actors.cpp1
-rw-r--r--engines/tinsel/adpcm.cpp7
-rw-r--r--engines/tinsel/anim.cpp1
-rw-r--r--engines/tinsel/bg.cpp1
-rw-r--r--engines/tinsel/bmv.cpp2
-rw-r--r--engines/tinsel/dialogs.cpp2
-rw-r--r--engines/tinsel/dialogs.h2
-rw-r--r--engines/tinsel/drives.cpp4
-rw-r--r--engines/tinsel/graphics.cpp2
-rw-r--r--engines/tinsel/handle.cpp1
-rw-r--r--engines/tinsel/mareels.cpp1
-rw-r--r--engines/tinsel/object.cpp2
-rw-r--r--engines/tinsel/palette.cpp2
-rw-r--r--engines/tinsel/pcode.cpp1
-rw-r--r--engines/tinsel/pcode.h2
-rw-r--r--engines/tinsel/pdisplay.cpp2
-rw-r--r--engines/tinsel/polygons.cpp1
-rw-r--r--engines/tinsel/rince.cpp1
-rw-r--r--engines/tinsel/saveload.cpp1
-rw-r--r--engines/tinsel/savescn.cpp2
-rw-r--r--engines/tinsel/scene.cpp1
-rw-r--r--engines/tinsel/sched.cpp1
-rw-r--r--engines/tinsel/scn.cpp3
-rw-r--r--engines/tinsel/sound.cpp2
-rw-r--r--engines/tinsel/strres.cpp1
-rw-r--r--engines/tinsel/sysvar.cpp2
-rw-r--r--engines/tinsel/timers.cpp2
-rw-r--r--engines/tinsel/timers.h2
-rw-r--r--engines/tinsel/tinlib.cpp1
-rw-r--r--engines/tinsel/tinsel.cpp12
-rw-r--r--engines/toon/anim.cpp3
-rw-r--r--engines/toon/audio.cpp2
-rw-r--r--engines/toon/character.cpp3
-rw-r--r--engines/toon/drew.cpp2
-rw-r--r--engines/toon/flux.cpp2
-rw-r--r--engines/toon/font.cpp2
-rw-r--r--engines/toon/hotspot.cpp2
-rw-r--r--engines/toon/movie.cpp11
-rw-r--r--engines/toon/path.cpp8
-rw-r--r--engines/toon/picture.cpp3
-rw-r--r--engines/toon/resource.cpp1
-rw-r--r--engines/toon/script.cpp3
-rw-r--r--engines/toon/script_func.cpp3
-rw-r--r--engines/toon/state.cpp2
-rw-r--r--engines/toon/text.cpp2
-rw-r--r--engines/toon/tools.cpp2
-rw-r--r--engines/toon/toon.cpp3
-rw-r--r--engines/touche/midi.h2
-rw-r--r--engines/touche/resource.cpp1
-rw-r--r--engines/touche/saveload.cpp1
-rw-r--r--engines/touche/touche.cpp9
-rw-r--r--engines/tsage/converse.cpp8
-rw-r--r--engines/tsage/core.cpp22
-rw-r--r--engines/tsage/core.h5
-rw-r--r--engines/tsage/debugger.cpp12
-rw-r--r--engines/tsage/detection.cpp8
-rw-r--r--engines/tsage/dialogs.cpp34
-rw-r--r--engines/tsage/dialogs.h4
-rw-r--r--engines/tsage/events.cpp61
-rw-r--r--engines/tsage/events.h3
-rw-r--r--engines/tsage/globals.cpp20
-rw-r--r--engines/tsage/graphics.cpp7
-rw-r--r--engines/tsage/resources.cpp13
-rw-r--r--engines/tsage/resources.h1
-rw-r--r--engines/tsage/ringworld_logic.cpp90
-rw-r--r--engines/tsage/ringworld_scenes1.cpp71
-rw-r--r--engines/tsage/ringworld_scenes10.cpp98
-rw-r--r--engines/tsage/ringworld_scenes2.cpp41
-rw-r--r--engines/tsage/ringworld_scenes3.cpp259
-rw-r--r--engines/tsage/ringworld_scenes5.cpp149
-rw-r--r--engines/tsage/ringworld_scenes5.h7
-rw-r--r--engines/tsage/ringworld_scenes6.cpp126
-rw-r--r--engines/tsage/ringworld_scenes6.h4
-rw-r--r--engines/tsage/ringworld_scenes8.cpp262
-rw-r--r--engines/tsage/ringworld_scenes8.h3
-rw-r--r--engines/tsage/saveload.cpp1
-rw-r--r--engines/tsage/scenes.cpp9
-rw-r--r--engines/tsage/sound.cpp2
-rw-r--r--engines/tsage/staticres.cpp3
-rw-r--r--engines/tsage/staticres.h4
-rw-r--r--engines/tsage/tsage.cpp6
-rw-r--r--engines/tucker/locations.cpp1
-rw-r--r--engines/tucker/resource.cpp1
-rw-r--r--engines/tucker/saveload.cpp1
-rw-r--r--engines/tucker/sequences.cpp3
-rw-r--r--engines/tucker/tucker.cpp7
-rw-r--r--graphics/VectorRenderer.cpp7
-rw-r--r--graphics/VectorRenderer.h7
-rw-r--r--graphics/VectorRendererSpec.cpp39
-rw-r--r--graphics/conversion.cpp1
-rw-r--r--graphics/conversion.h3
-rw-r--r--graphics/font.cpp10
-rw-r--r--graphics/font.h5
-rw-r--r--graphics/fontman.cpp1
-rw-r--r--graphics/fontman.h3
-rw-r--r--graphics/fonts/scummfont.cpp5
-rw-r--r--graphics/fonts/winfont.cpp11
-rw-r--r--graphics/fonts/winfont.h4
-rw-r--r--graphics/iff.cpp6
-rw-r--r--graphics/iff.h2
-rw-r--r--graphics/imagedec.cpp3
-rw-r--r--graphics/imagedec.h3
-rw-r--r--graphics/jpeg.cpp11
-rw-r--r--graphics/palette.h1
-rw-r--r--graphics/pict.cpp7
-rw-r--r--graphics/pict.h2
-rw-r--r--graphics/png.cpp54
-rw-r--r--graphics/png.h25
-rw-r--r--graphics/scaler/scale2x.cpp1
-rw-r--r--graphics/scaler/scale3x.cpp1
-rw-r--r--graphics/scaler/scalebit.cpp1
-rw-r--r--graphics/scaler/thumbnail_intern.cpp19
-rw-r--r--graphics/sjis.cpp3
-rw-r--r--graphics/surface.cpp59
-rw-r--r--graphics/surface.h21
-rw-r--r--graphics/thumbnail.cpp11
-rw-r--r--graphics/wincursor.cpp5
-rw-r--r--graphics/wincursor.h6
-rw-r--r--gui/ThemeEngine.cpp10
-rw-r--r--gui/ThemeEngine.h16
-rw-r--r--gui/ThemeEval.cpp2
-rw-r--r--gui/ThemeEval.h2
-rw-r--r--gui/ThemeLayout.cpp6
-rw-r--r--gui/ThemeLayout.h5
-rw-r--r--gui/ThemeParser.cpp2
-rw-r--r--gui/Tooltip.cpp1
-rw-r--r--gui/Tooltip.h5
-rw-r--r--gui/about.cpp2
-rw-r--r--gui/about.h3
-rw-r--r--gui/browser.cpp1
-rw-r--r--gui/browser.h2
-rw-r--r--gui/chooser.cpp3
-rw-r--r--gui/chooser.h2
-rw-r--r--gui/console.cpp2
-rw-r--r--gui/debugger.cpp1
-rw-r--r--gui/dialog.cpp5
-rw-r--r--gui/dialog.h6
-rw-r--r--gui/gui-manager.cpp4
-rw-r--r--gui/gui-manager.h7
-rw-r--r--gui/launcher.cpp4
-rw-r--r--gui/launcher.h5
-rw-r--r--gui/massadd.cpp14
-rw-r--r--gui/massadd.h2
-rw-r--r--gui/message.cpp1
-rw-r--r--gui/message.h2
-rw-r--r--gui/object.cpp3
-rw-r--r--gui/object.h4
-rw-r--r--gui/options.cpp5
-rw-r--r--gui/options.h9
-rw-r--r--gui/saveload.h4
-rw-r--r--gui/themebrowser.h2
-rw-r--r--gui/themes/translations.datbin194830 -> 200685 bytes
-rw-r--r--gui/widget.cpp17
-rw-r--r--gui/widget.h5
-rw-r--r--gui/widgets/editable.cpp4
-rw-r--r--gui/widgets/editable.h8
-rw-r--r--gui/widgets/edittext.cpp1
-rw-r--r--gui/widgets/list.cpp1
-rw-r--r--gui/widgets/popup.cpp2
-rw-r--r--gui/widgets/scrollbar.cpp7
-rw-r--r--gui/widgets/tab.cpp1
-rw-r--r--po/es_ES.po311
-rw-r--r--po/fr_FR.po53
-rw-r--r--po/pl_PL.po24
-rw-r--r--po/se_SE.po23
-rw-r--r--ports.mk2
-rw-r--r--video/avi_decoder.cpp7
-rw-r--r--video/avi_decoder.h25
-rw-r--r--video/codecs/cdtoons.cpp6
-rw-r--r--video/codecs/cinepak.cpp8
-rw-r--r--video/codecs/cinepak.h10
-rw-r--r--video/codecs/indeo3.cpp12
-rw-r--r--video/codecs/mjpeg.cpp10
-rw-r--r--video/codecs/mjpeg.h12
-rw-r--r--video/codecs/msrle.cpp3
-rw-r--r--video/codecs/msvideo1.cpp4
-rw-r--r--video/codecs/qdm2.cpp3
-rw-r--r--video/codecs/qdm2.h4
-rw-r--r--video/codecs/qtrle.cpp4
-rw-r--r--video/codecs/rpza.cpp4
-rw-r--r--video/codecs/smc.cpp3
-rw-r--r--video/codecs/truemotion1.cpp4
-rw-r--r--video/coktel_decoder.cpp66
-rw-r--r--video/coktel_decoder.h15
-rw-r--r--video/dxa_decoder.cpp7
-rw-r--r--video/dxa_decoder.h10
-rw-r--r--video/flic_decoder.cpp9
-rw-r--r--video/flic_decoder.h5
-rw-r--r--video/mpeg_player.h2
-rw-r--r--video/qt_decoder.cpp18
-rw-r--r--video/qt_decoder.h20
-rw-r--r--video/smk_decoder.cpp4
-rw-r--r--video/smk_decoder.h9
-rw-r--r--video/video_decoder.cpp3
-rw-r--r--video/video_decoder.h15
985 files changed, 3848 insertions, 2453 deletions
diff --git a/Makefile.common b/Makefile.common
index 6646af8e8d..e96774fe4e 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -154,8 +154,7 @@ endif
# Get the current version information
######################################################################
-# AmigaOS4's grep has a problem with "./" in pathnames, so use cat.
-VERSION = $(shell cat "${srcdir}/base/internal_version.h" | grep SCUMMVM_VERSION | cut -d\" -f2)
+VERSION = $(shell grep SCUMMVM_VERSION "${srcdir}/base/internal_version.h" | cut -d\" -f2)
VER_MAJOR = $(shell echo $(VERSION) | cut -d. -f 1)
VER_MINOR = $(shell echo $(VERSION) | cut -d. -f 2)
VER_PATCH = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c1)
diff --git a/NEWS b/NEWS
index b1f836c4c3..9307206de8 100644
--- a/NEWS
+++ b/NEWS
@@ -9,11 +9,14 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added support for Playtoons: Bambou le Sauveur de la Jungle.
- Added support for Toonstruck.
- Added support for Living Books v1 and v2 games.
- - Added support for Hugo's House of Horrors, Hugo 2: Whodunit?
+ - Added support for Hugo's House of Horrors, Hugo 2: Whodunit?
and Hugo 3: Jungle of Doom.
- Added support for Amiga SCI games (except Conquests of the Longbow).
- Added support for Macintosh SCI1 games.
+ New Ports:
+ - Added WebOS port.
+
General
- Added support for loadable modules on platforms without a dynamic
loader (GSoC Task).
diff --git a/README b/README
index efb9a2a502..5f7c7ed2c6 100644
--- a/README
+++ b/README
@@ -885,11 +885,13 @@ Supported platforms include (but are not limited to):
Maemo (Nokia Internet tablets 770, N800, N810, N900)
Nintendo 64
Nintendo DS
+ Nintendo GameCube
Nintendo Wii
OS/2
PlayStation 2
PlayStation Portable
Symbian
+ WebOS
The Dreamcast port does not support The Curse of Monkey Island, nor The
Dig. The Nintendo DS port does not support Full Throttle, The Dig, or
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index 0c41a38254..776f904e77 100644
--- a/audio/audiostream.cpp
+++ b/audio/audiostream.cpp
@@ -24,14 +24,14 @@
*/
#include "common/debug.h"
-#include "common/endian.h"
#include "common/file.h"
+#include "common/mutex.h"
+#include "common/textconsole.h"
#include "common/queue.h"
#include "common/util.h"
#include "audio/audiostream.h"
#include "audio/decoders/flac.h"
-#include "audio/mixer.h"
#include "audio/decoders/mp3.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/vorbis.h"
diff --git a/audio/audiostream.h b/audio/audiostream.h
index cd6456cc70..22de21cb34 100644
--- a/audio/audiostream.h
+++ b/audio/audiostream.h
@@ -26,16 +26,14 @@
#ifndef SOUND_AUDIOSTREAM_H
#define SOUND_AUDIOSTREAM_H
-#include "common/util.h"
#include "common/scummsys.h"
+#include "common/str.h"
#include "common/types.h"
#include "audio/timestamp.h"
namespace Audio {
-class SeekableAudioStream;
-
/**
* Generic audio input stream. Subclasses of this are used to feed arbitrary
* sampled audio data into ScummVM's audio mixer.
diff --git a/audio/decoders/adpcm.cpp b/audio/decoders/adpcm.cpp
index 3b53ca2fd1..a9284973d5 100644
--- a/audio/decoders/adpcm.cpp
+++ b/audio/decoders/adpcm.cpp
@@ -23,11 +23,12 @@
*
*/
-#include "common/endian.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
+#include "common/util.h"
#include "audio/decoders/adpcm.h"
#include "audio/decoders/adpcm_intern.h"
-#include "audio/audiostream.h"
namespace Audio {
diff --git a/audio/decoders/adpcm.h b/audio/decoders/adpcm.h
index f6b424c463..10344101e2 100644
--- a/audio/decoders/adpcm.h
+++ b/audio/decoders/adpcm.h
@@ -40,12 +40,13 @@
#include "common/scummsys.h"
#include "common/types.h"
-namespace Common { class SeekableReadStream; }
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
-class AudioStream;
class RewindableAudioStream;
// There are several types of ADPCM encoding, only some are supported here
diff --git a/audio/decoders/adpcm_intern.h b/audio/decoders/adpcm_intern.h
index dd8c14be79..f875bd88c7 100644
--- a/audio/decoders/adpcm_intern.h
+++ b/audio/decoders/adpcm_intern.h
@@ -37,6 +37,7 @@
#include "audio/audiostream.h"
#include "common/endian.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Audio {
diff --git a/audio/decoders/aiff.cpp b/audio/decoders/aiff.cpp
index 0f947752f6..957fb13638 100644
--- a/audio/decoders/aiff.cpp
+++ b/audio/decoders/aiff.cpp
@@ -32,12 +32,10 @@
*/
#include "common/endian.h"
-#include "common/util.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "audio/decoders/aiff.h"
-#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "audio/decoders/raw.h"
namespace Audio {
diff --git a/audio/decoders/aiff.h b/audio/decoders/aiff.h
index 06c56ecd38..dddbffb520 100644
--- a/audio/decoders/aiff.h
+++ b/audio/decoders/aiff.h
@@ -37,7 +37,9 @@
#include "common/scummsys.h"
#include "common/types.h"
-namespace Common { class SeekableReadStream; }
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/decoders/flac.cpp b/audio/decoders/flac.cpp
index 76b6d35419..fe15877ac6 100644
--- a/audio/decoders/flac.cpp
+++ b/audio/decoders/flac.cpp
@@ -32,6 +32,7 @@
#include "common/debug.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/audiostream.h"
diff --git a/audio/decoders/flac.h b/audio/decoders/flac.h
index 17f95ec1fb..69222f22a1 100644
--- a/audio/decoders/flac.h
+++ b/audio/decoders/flac.h
@@ -49,12 +49,11 @@
#ifdef USE_FLAC
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Audio {
-class AudioStream;
class SeekableAudioStream;
/**
diff --git a/audio/decoders/iff_sound.cpp b/audio/decoders/iff_sound.cpp
index 2ec189c586..8efe017e75 100644
--- a/audio/decoders/iff_sound.cpp
+++ b/audio/decoders/iff_sound.cpp
@@ -25,7 +25,6 @@
#include "audio/decoders/iff_sound.h"
#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "audio/decoders/raw.h"
#include "common/iff_container.h"
#include "common/func.h"
diff --git a/audio/decoders/iff_sound.h b/audio/decoders/iff_sound.h
index 4e53059380..4d26b32e71 100644
--- a/audio/decoders/iff_sound.h
+++ b/audio/decoders/iff_sound.h
@@ -33,7 +33,7 @@
#define SOUND_IFF_H
namespace Common {
- class ReadStream;
+class ReadStream;
}
namespace Audio {
diff --git a/audio/decoders/mac_snd.cpp b/audio/decoders/mac_snd.cpp
index 7c1a2f75f0..fc69988860 100644
--- a/audio/decoders/mac_snd.cpp
+++ b/audio/decoders/mac_snd.cpp
@@ -30,11 +30,10 @@
* We implement both type 1 and type 2 snd resources, but only those that are sampled
*/
-#include "common/util.h"
+#include "common/textconsole.h"
#include "common/stream.h"
#include "audio/decoders/mac_snd.h"
-#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
namespace Audio {
diff --git a/audio/decoders/mac_snd.h b/audio/decoders/mac_snd.h
index 198a61333e..bf6331a265 100644
--- a/audio/decoders/mac_snd.h
+++ b/audio/decoders/mac_snd.h
@@ -35,7 +35,9 @@
#include "common/scummsys.h"
#include "common/types.h"
-namespace Common { class SeekableReadStream; }
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp
index 53d68fa9db..91bd49873a 100644
--- a/audio/decoders/mp3.cpp
+++ b/audio/decoders/mp3.cpp
@@ -29,6 +29,7 @@
#include "common/debug.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/audiostream.h"
diff --git a/audio/decoders/mp3.h b/audio/decoders/mp3.h
index 72bc6e1b3e..d3a5b70d45 100644
--- a/audio/decoders/mp3.h
+++ b/audio/decoders/mp3.h
@@ -50,12 +50,11 @@
#ifdef USE_MAD
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Audio {
-class AudioStream;
class SeekableAudioStream;
/**
diff --git a/audio/decoders/raw.cpp b/audio/decoders/raw.cpp
index 8b833c7838..cf787f9b12 100644
--- a/audio/decoders/raw.cpp
+++ b/audio/decoders/raw.cpp
@@ -25,9 +25,10 @@
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
+#include "common/util.h"
#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "audio/decoders/raw.h"
namespace Audio {
diff --git a/audio/decoders/raw.h b/audio/decoders/raw.h
index 3e9426012c..23ed02182d 100644
--- a/audio/decoders/raw.h
+++ b/audio/decoders/raw.h
@@ -32,12 +32,12 @@
#include "common/list.h"
-namespace Common { class SeekableReadStream; }
-
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
-class AudioStream;
class SeekableAudioStream;
/**
diff --git a/audio/decoders/vag.h b/audio/decoders/vag.h
index cdf91a8ea1..4adc1d3dde 100644
--- a/audio/decoders/vag.h
+++ b/audio/decoders/vag.h
@@ -35,12 +35,11 @@
#define SOUND_VAG_H
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Audio {
-class AudioStream;
class RewindableAudioStream;
/**
diff --git a/audio/decoders/voc.cpp b/audio/decoders/voc.cpp
index b811a640ec..9c2dc4f337 100644
--- a/audio/decoders/voc.cpp
+++ b/audio/decoders/voc.cpp
@@ -27,9 +27,9 @@
#include "common/endian.h"
#include "common/util.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/voc.h"
diff --git a/audio/decoders/voc.h b/audio/decoders/voc.h
index 82cc261f2c..38250dcf7a 100644
--- a/audio/decoders/voc.h
+++ b/audio/decoders/voc.h
@@ -41,8 +41,10 @@
#include "common/scummsys.h"
#include "common/types.h"
-namespace Common { class ReadStream; }
-namespace Common { class SeekableReadStream; }
+namespace Common {
+class ReadStream;
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/decoders/vorbis.cpp b/audio/decoders/vorbis.cpp
index a9bcb6167f..63f7ba8207 100644
--- a/audio/decoders/vorbis.cpp
+++ b/audio/decoders/vorbis.cpp
@@ -32,8 +32,8 @@
#ifdef USE_VORBIS
-#include "common/debug.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/audiostream.h"
diff --git a/audio/decoders/vorbis.h b/audio/decoders/vorbis.h
index 7cc395cccb..51d0b82d5f 100644
--- a/audio/decoders/vorbis.h
+++ b/audio/decoders/vorbis.h
@@ -49,12 +49,11 @@
#ifdef USE_VORBIS
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Audio {
-class AudioStream;
class SeekableAudioStream;
/**
diff --git a/audio/decoders/wave.cpp b/audio/decoders/wave.cpp
index 1f0ddd8ceb..a64874887a 100644
--- a/audio/decoders/wave.cpp
+++ b/audio/decoders/wave.cpp
@@ -24,11 +24,10 @@
*/
#include "common/debug.h"
-#include "common/util.h"
+#include "common/textconsole.h"
#include "common/stream.h"
#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "audio/decoders/wave.h"
#include "audio/decoders/adpcm.h"
#include "audio/decoders/raw.h"
diff --git a/audio/decoders/wave.h b/audio/decoders/wave.h
index 2bdbe8f0b6..33c3e798a0 100644
--- a/audio/decoders/wave.h
+++ b/audio/decoders/wave.h
@@ -43,7 +43,9 @@
#include "common/scummsys.h"
#include "common/types.h"
-namespace Common { class SeekableReadStream; }
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/fmopl.cpp b/audio/fmopl.cpp
index 1f61e16101..5952a987a7 100644
--- a/audio/fmopl.cpp
+++ b/audio/fmopl.cpp
@@ -28,6 +28,7 @@
#include "audio/softsynth/opl/mame.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "common/translation.h"
namespace OPL {
diff --git a/audio/mididrv.cpp b/audio/mididrv.cpp
index a1487ff69d..6cc3366847 100644
--- a/audio/mididrv.cpp
+++ b/audio/mididrv.cpp
@@ -23,14 +23,14 @@
*
*/
-#include "engines/engine.h"
#include "common/config-manager.h"
+#include "common/error.h"
#include "common/str.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/mididrv.h"
#include "audio/musicplugin.h"
-#include "common/translation.h"
const byte MidiDriver::_mt32ToGm[128] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
diff --git a/audio/mididrv.h b/audio/mididrv.h
index 8d6f942455..c6c5179051 100644
--- a/audio/mididrv.h
+++ b/audio/mididrv.h
@@ -27,15 +27,10 @@
#define SOUND_MIDIDRV_H
#include "common/scummsys.h"
+#include "common/str.h"
#include "common/timer.h"
class MidiChannel;
-class MusicDevice;
-
-namespace Audio {
- class Mixer;
-}
-namespace Common { class String; }
/**
* Music types that music drivers can implement and engines can rely on.
diff --git a/audio/midiparser.cpp b/audio/midiparser.cpp
index a6df6024cd..a1399d0c30 100644
--- a/audio/midiparser.cpp
+++ b/audio/midiparser.cpp
@@ -25,6 +25,7 @@
#include "audio/midiparser.h"
#include "audio/mididrv.h"
+#include "common/textconsole.h"
#include "common/util.h"
//////////////////////////////////////////////////
diff --git a/audio/midiparser.h b/audio/midiparser.h
index eeeee981e4..24f2ba7963 100644
--- a/audio/midiparser.h
+++ b/audio/midiparser.h
@@ -31,7 +31,6 @@
#include "common/scummsys.h"
#include "common/endian.h"
-class MidiParser;
class MidiDriver_BASE;
diff --git a/audio/midiparser_smf.cpp b/audio/midiparser_smf.cpp
index 9e4e8ed293..8ead95de4c 100644
--- a/audio/midiparser_smf.cpp
+++ b/audio/midiparser_smf.cpp
@@ -24,7 +24,7 @@
*/
#include "audio/midiparser.h"
-#include "audio/mididrv.h"
+#include "common/textconsole.h"
#include "common/util.h"
/**
diff --git a/audio/midiparser_xmidi.cpp b/audio/midiparser_xmidi.cpp
index edc7c7a943..1146084cde 100644
--- a/audio/midiparser_xmidi.cpp
+++ b/audio/midiparser_xmidi.cpp
@@ -24,7 +24,7 @@
*/
#include "audio/midiparser.h"
-#include "audio/mididrv.h"
+#include "common/textconsole.h"
#include "common/util.h"
/**
diff --git a/audio/mixer.cpp b/audio/mixer.cpp
index 63f006cbc9..4d23487e71 100644
--- a/audio/mixer.cpp
+++ b/audio/mixer.cpp
@@ -25,6 +25,7 @@
#include "common/util.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/mixer_intern.h"
#include "audio/rate.h"
diff --git a/audio/mixer.h b/audio/mixer.h
index 89b50e550f..5802abdd6b 100644
--- a/audio/mixer.h
+++ b/audio/mixer.h
@@ -27,20 +27,13 @@
#define SOUND_MIXER_H
#include "common/types.h"
-#include "common/mutex.h"
#include "common/noncopyable.h"
-#include "audio/timestamp.h"
-
-class OSystem;
-
-
namespace Audio {
class AudioStream;
class Channel;
-class Mixer;
-class MixerImpl;
+class Timestamp;
/**
* A SoundHandle instances corresponds to a specific sound
diff --git a/audio/mods/infogrames.cpp b/audio/mods/infogrames.cpp
index 27e42c637b..8bfffeacb6 100644
--- a/audio/mods/infogrames.cpp
+++ b/audio/mods/infogrames.cpp
@@ -27,6 +27,7 @@
#include "common/endian.h"
#include "common/file.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
namespace Audio {
diff --git a/audio/mods/infogrames.h b/audio/mods/infogrames.h
index c7abebf24e..9787210e82 100644
--- a/audio/mods/infogrames.h
+++ b/audio/mods/infogrames.h
@@ -33,7 +33,10 @@
#define SOUND_MODS_INFOGRAMES_H
#include "audio/mods/paula.h"
-#include "common/stream.h"
+
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/mods/maxtrax.cpp b/audio/mods/maxtrax.cpp
index a577c72eed..0738966dab 100644
--- a/audio/mods/maxtrax.cpp
+++ b/audio/mods/maxtrax.cpp
@@ -24,10 +24,10 @@
*/
#include "common/scummsys.h"
-#include "common/endian.h"
#include "common/stream.h"
#include "common/util.h"
#include "common/debug.h"
+#include "common/textconsole.h"
#include "audio/mods/maxtrax.h"
diff --git a/audio/mods/module.cpp b/audio/mods/module.cpp
index 3dad3794f9..987b17bc8d 100644
--- a/audio/mods/module.cpp
+++ b/audio/mods/module.cpp
@@ -27,6 +27,8 @@
#include "common/util.h"
#include "common/endian.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
namespace Modules {
diff --git a/audio/mods/module.h b/audio/mods/module.h
index 550b63617e..c9b72bd2d6 100644
--- a/audio/mods/module.h
+++ b/audio/mods/module.h
@@ -26,7 +26,11 @@
#ifndef SOUND_MODS_MODULE_H
#define SOUND_MODS_MODULE_H
-#include "common/stream.h"
+#include "common/scummsys.h"
+
+namespace Common {
+class SeekableReadStream;
+}
namespace Modules {
diff --git a/audio/mods/protracker.cpp b/audio/mods/protracker.cpp
index 6051338900..f781920505 100644
--- a/audio/mods/protracker.cpp
+++ b/audio/mods/protracker.cpp
@@ -29,6 +29,8 @@
#include "audio/audiostream.h"
+#include "common/textconsole.h"
+
namespace Modules {
class ProtrackerStream : public ::Audio::Paula {
diff --git a/audio/mods/protracker.h b/audio/mods/protracker.h
index af722637c7..fa9895b81f 100644
--- a/audio/mods/protracker.h
+++ b/audio/mods/protracker.h
@@ -33,7 +33,9 @@
#ifndef SOUND_MODS_PROTRACKER_H
#define SOUND_MODS_PROTRACKER_H
-#include "common/stream.h"
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/mods/rjp1.cpp b/audio/mods/rjp1.cpp
index 957bbb933a..eaa99e6928 100644
--- a/audio/mods/rjp1.cpp
+++ b/audio/mods/rjp1.cpp
@@ -25,10 +25,12 @@
#include "common/debug.h"
#include "common/endian.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
+#include "common/util.h"
#include "audio/mods/paula.h"
#include "audio/mods/rjp1.h"
-#include "audio/audiostream.h"
namespace Audio {
diff --git a/audio/mods/rjp1.h b/audio/mods/rjp1.h
index e1960921b2..e3cb0b853d 100644
--- a/audio/mods/rjp1.h
+++ b/audio/mods/rjp1.h
@@ -32,7 +32,9 @@
#ifndef SOUND_MODS_RJP1_H
#define SOUND_MODS_RJP1_H
-#include "common/stream.h"
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/mods/soundfx.cpp b/audio/mods/soundfx.cpp
index 06a1e29514..44fdd65986 100644
--- a/audio/mods/soundfx.cpp
+++ b/audio/mods/soundfx.cpp
@@ -24,10 +24,11 @@
*/
#include "common/endian.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
#include "audio/mods/paula.h"
#include "audio/mods/soundfx.h"
-#include "audio/audiostream.h"
namespace Audio {
diff --git a/audio/mods/soundfx.h b/audio/mods/soundfx.h
index 089c19d292..9dd5240160 100644
--- a/audio/mods/soundfx.h
+++ b/audio/mods/soundfx.h
@@ -32,7 +32,9 @@
#ifndef SOUND_MODS_SOUNDFX_H
#define SOUND_MODS_SOUNDFX_H
-#include "common/stream.h"
+namespace Common {
+class SeekableReadStream;
+}
namespace Audio {
diff --git a/audio/mods/tfmx.cpp b/audio/mods/tfmx.cpp
index 8c69a75ebd..f7cfc50c10 100644
--- a/audio/mods/tfmx.cpp
+++ b/audio/mods/tfmx.cpp
@@ -26,8 +26,8 @@
#include "common/scummsys.h"
#include "common/endian.h"
#include "common/stream.h"
-#include "common/util.h"
#include "common/debug.h"
+#include "common/textconsole.h"
#include "audio/mods/tfmx.h"
diff --git a/audio/mpu401.h b/audio/mpu401.h
index 07e2817381..5f1a5108ac 100644
--- a/audio/mpu401.h
+++ b/audio/mpu401.h
@@ -34,8 +34,6 @@
//
////////////////////////////////////////
-class MidiDriver_MPU401;
-
class MidiChannel_MPU401 : public MidiChannel {
private:
diff --git a/audio/musicplugin.h b/audio/musicplugin.h
index da0e0ff816..53a2ae426d 100644
--- a/audio/musicplugin.h
+++ b/audio/musicplugin.h
@@ -29,6 +29,10 @@
#include "audio/mididrv.h"
#include "common/list.h"
+namespace Common {
+class Error;
+}
+
class MusicPluginObject;
/**
diff --git a/audio/null.cpp b/audio/null.cpp
index 152f5da03e..2066a6d048 100644
--- a/audio/null.cpp
+++ b/audio/null.cpp
@@ -22,6 +22,7 @@
* $Id$
*/
+#include "common/error.h"
#include "audio/null.h"
Common::Error NullMusicPlugin::createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle) const {
diff --git a/audio/rate.cpp b/audio/rate.cpp
index 1fcf0ade2e..fd52503b8c 100644
--- a/audio/rate.cpp
+++ b/audio/rate.cpp
@@ -35,6 +35,7 @@
#include "audio/rate.h"
#include "audio/mixer.h"
#include "common/frac.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Audio {
diff --git a/audio/rate.h b/audio/rate.h
index fb231e4c4a..af37994d02 100644
--- a/audio/rate.h
+++ b/audio/rate.h
@@ -27,13 +27,11 @@
#define SOUND_RATE_H
#include "common/scummsys.h"
-#include "engines/engine.h"
-
-class AudioStream;
-
namespace Audio {
+class AudioStream;
+
typedef int16 st_sample_t;
typedef uint16 st_volume_t;
typedef uint32 st_size_t;
diff --git a/audio/rate_arm.cpp b/audio/rate_arm.cpp
index 9c0e849c81..1eb55d0dc3 100644
--- a/audio/rate_arm.cpp
+++ b/audio/rate_arm.cpp
@@ -48,6 +48,7 @@
#include "audio/rate.h"
#include "audio/mixer.h"
#include "common/util.h"
+#include "common/textconsole.h"
//#define DEBUG_RATECONV
diff --git a/audio/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp
index 9e863471f0..0b5215e5d6 100644
--- a/audio/softsynth/adlib.cpp
+++ b/audio/softsynth/adlib.cpp
@@ -24,6 +24,11 @@
#include "audio/softsynth/emumidi.h"
#include "common/debug.h"
+#include "common/error.h"
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/types.h"
#include "common/util.h"
#include "audio/fmopl.h"
#include "audio/musicplugin.h"
diff --git a/audio/softsynth/eas.cpp b/audio/softsynth/eas.cpp
index 0339492f5d..7d17655d20 100644
--- a/audio/softsynth/eas.cpp
+++ b/audio/softsynth/eas.cpp
@@ -30,8 +30,11 @@
#include "common/debug.h"
#include "common/endian.h"
+#include "common/textconsole.h"
+#include "common/error.h"
#include "common/file.h"
#include "common/config-manager.h"
+#include "common/system.h"
#include "audio/audiostream.h"
#include "audio/mpu401.h"
#include "audio/musicplugin.h"
diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index f6f66ce5e8..a4877a4ec1 100644
--- a/audio/softsynth/fluidsynth.cpp
+++ b/audio/softsynth/fluidsynth.cpp
@@ -27,6 +27,9 @@
#ifdef USE_FLUIDSYNTH
#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
#include "audio/softsynth/emumidi.h"
diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
index e019aa2481..7b6658ab3a 100644
--- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -25,6 +25,7 @@
#include "audio/softsynth/fmtowns_pc98/towns_audio.h"
#include "common/endian.h"
+#include "common/util.h"
#include "backends/audiocd/audiocd.h"
diff --git a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
index 0ad96f76f3..cd3a348b85 100644
--- a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
@@ -25,6 +25,8 @@
#include "audio/softsynth/fmtowns_pc98/towns_euphony.h"
#include "common/endian.h"
+#include "common/util.h"
+#include "common/textconsole.h"
TownsEuphonyDriver::TownsEuphonyDriver(Audio::Mixer *mixer) : _activeChannels(0), _sustainChannels(0),
_assignedChannels(0), _paraCount(0), _command(0), _tEnable(0), _tMode(0), _tOrdr(0), _tLevel(0),
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
index 79fd95ea0d..a551276ab1 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
@@ -25,6 +25,7 @@
#include "audio/softsynth/fmtowns_pc98/towns_pc98_driver.h"
#include "common/endian.h"
+#include "common/textconsole.h"
class TownsPC98_MusicChannel {
public:
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
index 67de8fa026..9d3751a0cc 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
@@ -25,6 +25,8 @@
#include "audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h"
#include "common/endian.h"
+#include "common/textconsole.h"
+#include "common/util.h"
class TownsPC98_FmSynthOperator {
public:
diff --git a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h
index 18cca56e29..2b916b2cdc 100644
--- a/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h
+++ b/audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h
@@ -28,7 +28,7 @@
#include "audio/audiostream.h"
#include "audio/mixer.h"
-#include "common/list.h"
+#include "common/mutex.h"
#ifdef __DS__
/* This disables the rhythm channel when emulating the PC-98 type 86 sound card.
diff --git a/audio/softsynth/mt32.cpp b/audio/softsynth/mt32.cpp
index dd2c7e2121..5371be60b3 100644
--- a/audio/softsynth/mt32.cpp
+++ b/audio/softsynth/mt32.cpp
@@ -34,15 +34,20 @@
#include "common/config-manager.h"
#include "common/debug.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/file.h"
#include "common/system.h"
#include "common/util.h"
#include "common/archive.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#include "graphics/fontman.h"
#include "graphics/surface.h"
+#include "graphics/pixelformat.h"
+#include "graphics/palette.h"
+#include "graphics/font.h"
class MidiChannel_MT32 : public MidiChannel_MPU401 {
void effectLevel(byte value) { }
@@ -346,7 +351,7 @@ void MidiDriver_MT32::send(uint32 b) {
void MidiDriver_MT32::setPitchBendRange(byte channel, uint range) {
if (range > 24) {
- printf("setPitchBendRange() called with range > 24: %d", range);
+ warning("setPitchBendRange() called with range > 24: %d", range);
}
byte benderRangeSysex[9];
benderRangeSysex[0] = 0x41; // Roland
diff --git a/audio/softsynth/mt32/part.h b/audio/softsynth/mt32/part.h
index 54c4999653..967298258c 100644
--- a/audio/softsynth/mt32/part.h
+++ b/audio/softsynth/mt32/part.h
@@ -24,7 +24,6 @@
namespace MT32Emu {
-class PartialManager;
class Synth;
class Part {
diff --git a/audio/softsynth/mt32/synth.cpp b/audio/softsynth/mt32/synth.cpp
index 16460795a5..112527cc71 100644
--- a/audio/softsynth/mt32/synth.cpp
+++ b/audio/softsynth/mt32/synth.cpp
@@ -19,14 +19,18 @@
* IN THE SOFTWARE.
*/
+// FIXME: Avoid using printf
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
+// FIXME: Avoid using vprintf
+#define FORBIDDEN_SYMBOL_EXCEPTION_vprintf
+
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "mt32emu.h"
-#include "common/str.h"
-
#if defined(MACOSX) || defined(SOLARIS) || defined(__MINGW32__)
// Older versions of Mac OS X didn't supply a powf function, so using it
// will cause a binary incompatibility when trying to run a binary built
diff --git a/audio/softsynth/mt32/synth.h b/audio/softsynth/mt32/synth.h
index 3fc303d322..edda446287 100644
--- a/audio/softsynth/mt32/synth.h
+++ b/audio/softsynth/mt32/synth.h
@@ -29,7 +29,6 @@ class revmodel;
namespace MT32Emu {
class File;
-class TableInitialiser;
class Partial;
class PartialManager;
class Part;
diff --git a/audio/softsynth/opl/dosbox.cpp b/audio/softsynth/opl/dosbox.cpp
index 29993ce3d8..7a494d70ec 100644
--- a/audio/softsynth/opl/dosbox.cpp
+++ b/audio/softsynth/opl/dosbox.cpp
@@ -36,6 +36,7 @@
#include "common/system.h"
#include "common/scummsys.h"
+#include "common/util.h"
#include <math.h>
#include <string.h>
diff --git a/audio/softsynth/opl/mame.cpp b/audio/softsynth/opl/mame.cpp
index b4bbcb5ab3..5d790f924f 100644
--- a/audio/softsynth/opl/mame.cpp
+++ b/audio/softsynth/opl/mame.cpp
@@ -33,6 +33,9 @@
#include "mame.h"
+#include "common/textconsole.h"
+#include "common/util.h"
+
#if defined (_WIN32_WCE) || defined (__SYMBIAN32__) || defined(__GP32__) || defined(GP2X) || defined (__MAEMO__) || defined(__DS__) || defined (__MINT__) || defined(__N64__)
#include "common/config-manager.h"
#endif
diff --git a/audio/softsynth/opl/mame.h b/audio/softsynth/opl/mame.h
index 58ef5f18dc..4314aa6dba 100644
--- a/audio/softsynth/opl/mame.h
+++ b/audio/softsynth/opl/mame.h
@@ -30,7 +30,6 @@
#define SOUND_SOFTSYNTH_OPL_MAME_H
#include "common/scummsys.h"
-#include "common/util.h"
#include "common/random.h"
#include "audio/fmopl.h"
diff --git a/audio/softsynth/pcspk.h b/audio/softsynth/pcspk.h
index c0d85bbceb..8f01fa852b 100644
--- a/audio/softsynth/pcspk.h
+++ b/audio/softsynth/pcspk.h
@@ -26,7 +26,6 @@
#define SOUND_SOFTSYNTH_PCSPK_H
#include "audio/audiostream.h"
-#include "audio/mixer.h"
#include "common/mutex.h"
namespace Audio {
diff --git a/audio/softsynth/sid.cpp b/audio/softsynth/sid.cpp
index 241766fa0a..40dc50e972 100644
--- a/audio/softsynth/sid.cpp
+++ b/audio/softsynth/sid.cpp
@@ -32,7 +32,6 @@
#include "sid.h"
#include "audio/null.h"
-#include <math.h>
namespace Resid {
@@ -110,7 +109,7 @@ void WaveformGenerator::reset() {
msb_rising = false;
}
-RESID_INLINE void WaveformGenerator::clock(cycle_count delta_t) {
+RESID_INLINE void WaveformGenerator::updateClock(cycle_count delta_t) {
// No operation if test bit is set.
if (test) {
return;
@@ -165,10 +164,10 @@ RESID_INLINE void WaveformGenerator::clock(cycle_count delta_t) {
/**
* Synchronize oscillators.
- * This must be done after all the oscillators have been clock()'ed since the
+ * This must be done after all the oscillators have been updateClock()'ed since the
* oscillators operate in parallel.
* Note that the oscillators must be clocked exactly on the cycle when the
- * MSB is set high for hard sync to operate correctly. See SID::clock().
+ * MSB is set high for hard sync to operate correctly. See SID::updateClock().
*/
RESID_INLINE void WaveformGenerator::synchronize() {
// A special case occurs when a sync source is synced itself on the same
@@ -592,7 +591,7 @@ void Filter::set_Q() {
_1024_div_Q = static_cast<sound_sample>(1024.0/(0.707 + 1.0*res/0x0f));
}
-RESID_INLINE void Filter::clock(cycle_count delta_t,
+RESID_INLINE void Filter::updateClock(cycle_count delta_t,
sound_sample voice1,
sound_sample voice2,
sound_sample voice3)
@@ -888,7 +887,7 @@ reg8 EnvelopeGenerator::readENV() {
return output();
}
-RESID_INLINE void EnvelopeGenerator::clock(cycle_count delta_t) {
+RESID_INLINE void EnvelopeGenerator::updateClock(cycle_count delta_t) {
// Check for ADSR delay bug.
// If the rate counter comparison value is set below the current value of the
// rate counter, the counter will continue counting up until it wraps around
@@ -1027,7 +1026,7 @@ void ExternalFilter::reset() {
Vo = 0;
}
-RESID_INLINE void ExternalFilter::clock(cycle_count delta_t, sound_sample Vi) {
+RESID_INLINE void ExternalFilter::updateClock(cycle_count delta_t, sound_sample Vi) {
// This is handy for testing.
if (!enabled) {
// Remove maximum DC level since there is no filter to do it.
@@ -1317,7 +1316,7 @@ bool SID::set_sampling_parameters(double clock_freq,
return true;
}
-void SID::clock(cycle_count delta_t) {
+void SID::updateClock(cycle_count delta_t) {
int i;
if (delta_t <= 0) {
@@ -1333,7 +1332,7 @@ void SID::clock(cycle_count delta_t) {
// Clock amplitude modulators.
for (i = 0; i < 3; i++) {
- voice[i].envelope.clock(delta_t);
+ voice[i].envelope.updateClock(delta_t);
}
// Clock and synchronize oscillators.
@@ -1373,7 +1372,7 @@ void SID::clock(cycle_count delta_t) {
// Clock oscillators.
for (i = 0; i < 3; i++) {
- voice[i].wave.clock(delta_t_min);
+ voice[i].wave.updateClock(delta_t_min);
}
// Synchronize oscillators.
@@ -1385,11 +1384,11 @@ void SID::clock(cycle_count delta_t) {
}
// Clock filter.
- filter.clock(delta_t,
+ filter.updateClock(delta_t,
voice[0].output(), voice[1].output(), voice[2].output());
// Clock external filter.
- extfilt.clock(delta_t, filter.output());
+ extfilt.updateClock(delta_t, filter.output());
}
@@ -1397,7 +1396,7 @@ void SID::clock(cycle_count delta_t) {
* SID clocking with audio sampling.
* Fixpoint arithmetics is used.
*/
-int SID::clock(cycle_count& delta_t, short* buf, int n, int interleave) {
+int SID::updateClock(cycle_count& delta_t, short* buf, int n, int interleave) {
int s = 0;
for (;;) {
@@ -1409,13 +1408,13 @@ int SID::clock(cycle_count& delta_t, short* buf, int n, int interleave) {
if (s >= n) {
return s;
}
- clock(delta_t_sample);
+ updateClock(delta_t_sample);
delta_t -= delta_t_sample;
sample_offset = (next_sample_offset & FIXP_MASK) - (1 << (FIXP_SHIFT - 1));
buf[s++*interleave] = output();
}
- clock(delta_t);
+ updateClock(delta_t);
sample_offset -= delta_t << FIXP_SHIFT;
delta_t = 0;
return s;
diff --git a/audio/softsynth/sid.h b/audio/softsynth/sid.h
index c78f538441..d6e402dc3b 100644
--- a/audio/softsynth/sid.h
+++ b/audio/softsynth/sid.h
@@ -60,7 +60,7 @@ public:
void set_sync_source(WaveformGenerator*);
- void clock(cycle_count delta_t);
+ void updateClock(cycle_count delta_t);
void synchronize();
void reset();
@@ -133,7 +133,7 @@ public:
void enable_filter(bool enable);
- void clock(cycle_count delta_t,
+ void updateClock(cycle_count delta_t,
sound_sample voice1, sound_sample voice2, sound_sample voice3);
void reset();
@@ -201,7 +201,7 @@ public:
enum State { ATTACK, DECAY_SUSTAIN, RELEASE };
- void clock(cycle_count delta_t);
+ void updateClock(cycle_count delta_t);
void reset();
void writeCONTROL_REG(reg8);
@@ -246,7 +246,7 @@ public:
void enable_filter(bool enable);
void set_sampling_parameter(double pass_freq);
- void clock(cycle_count delta_t, sound_sample Vi);
+ void updateClock(cycle_count delta_t, sound_sample Vi);
void reset();
// Audio output (20 bits).
@@ -312,8 +312,8 @@ public:
double sample_freq, double pass_freq = -1,
double filter_scale = 0.97);
- void clock(cycle_count delta_t);
- int clock(cycle_count& delta_t, short* buf, int n, int interleave = 1);
+ void updateClock(cycle_count delta_t);
+ int updateClock(cycle_count& delta_t, short* buf, int n, int interleave = 1);
void reset();
// Read/write registers.
diff --git a/audio/softsynth/ym2612.cpp b/audio/softsynth/ym2612.cpp
index 6b3c2aab73..162c92f05a 100644
--- a/audio/softsynth/ym2612.cpp
+++ b/audio/softsynth/ym2612.cpp
@@ -27,7 +27,11 @@
#include "audio/softsynth/ym2612.h"
#include "common/util.h"
#include "audio/musicplugin.h"
+#include "common/error.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "common/translation.h"
+#include "common/types.h"
////////////////////////////////////////
//
diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp
index 4136c34403..82c9549a57 100644
--- a/backends/audiocd/sdl/sdl-audiocd.cpp
+++ b/backends/audiocd/sdl/sdl-audiocd.cpp
@@ -27,6 +27,7 @@
#if defined(SDL_BACKEND)
+#include "common/textconsole.h"
#include "backends/audiocd/sdl/sdl-audiocd.h"
SdlAudioCDManager::SdlAudioCDManager()
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h
index 06db1dc027..73dc60695b 100644
--- a/backends/events/default/default-events.h
+++ b/backends/events/default/default-events.h
@@ -31,10 +31,10 @@
namespace Common {
#ifdef ENABLE_KEYMAPPER
- class Keymapper;
+class Keymapper;
#endif
#ifdef ENABLE_VKEYBD
- class VirtualKeyboard;
+class VirtualKeyboard;
#endif
}
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index ce846a0836..6e343b63f5 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -31,6 +31,7 @@
#include "backends/platform/sdl/sdl.h"
#include "backends/graphics/graphics.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
// FIXME move joystick defines out and replace with confile file options
// we should really allow users to map any key to a joystick button
@@ -65,7 +66,7 @@ SdlEventSource::SdlEventSource()
// Enable joystick
if (SDL_NumJoysticks() > 0) {
- printf("Using joystick: %s\n", SDL_JoystickName(0));
+ debug("Using joystick: %s", SDL_JoystickName(0));
_joystick = SDL_JoystickOpen(joystick_num);
}
}
diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp
index fd9628995d..045d077af2 100644
--- a/backends/events/webossdl/webossdl-events.cpp
+++ b/backends/events/webossdl/webossdl-events.cpp
@@ -26,6 +26,7 @@
#ifdef WEBOS
#include "common/scummsys.h"
+#include "common/system.h"
#include "sys/time.h"
#include "time.h"
diff --git a/backends/fs/posix/posix-fs-factory.cpp b/backends/fs/posix/posix-fs-factory.cpp
index df21d41dda..4d23a9e095 100644
--- a/backends/fs/posix/posix-fs-factory.cpp
+++ b/backends/fs/posix/posix-fs-factory.cpp
@@ -23,6 +23,12 @@
*/
#if defined(UNIX)
+
+// Re-enable some forbidden symbols to avoid clashes with stat.h and unistd.h.
+#define FORBIDDEN_SYMBOL_EXCEPTION_chdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_unlink
+
#include "backends/fs/posix/posix-fs-factory.h"
#include "backends/fs/posix/posix-fs.cpp"
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 3c043ca986..b50c3a75be 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -31,6 +31,7 @@
#include "backends/events/dinguxsdl/dinguxsdl-events.h"
#include "graphics/scaler/aspect.h"
#include "common/mutex.h"
+#include "common/textconsole.h"
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{"1x", "Standard", GFX_NORMAL},
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index 4f2185ef4b..6d23777903 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -28,6 +28,7 @@
#include "backends/events/gph/gph-events.h"
#include "graphics/scaler/aspect.h"
#include "common/mutex.h"
+#include "common/textconsole.h"
static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{"1x", "Standard", GFX_NORMAL},
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index c2dcb7f587..ebfd4714d8 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -30,6 +30,7 @@
#include "backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h"
#include "backends/events/linuxmotosdl/linuxmotosdl-events.h"
#include "common/mutex.h"
+#include "common/textconsole.h"
#include "graphics/font.h"
#include "graphics/fontman.h"
#include "graphics/scaler.h"
diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h
index e7951a0c96..238b035425 100644
--- a/backends/graphics/opengl/gltexture.h
+++ b/backends/graphics/opengl/gltexture.h
@@ -42,9 +42,6 @@
#include "graphics/surface.h"
-#include "common/rect.h"
-#include "common/array.h"
-
/**
* OpenGL texture manager class
*/
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 4ac2747d25..b85cac809e 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -32,6 +32,7 @@
#include "common/config-manager.h"
#include "common/file.h"
#include "common/mutex.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#ifdef USE_OSD
#include "common/tokenizer.h"
@@ -355,9 +356,9 @@ void OpenGLGraphicsManager::copyRectToScreen(const byte *buf, int pitch, int x,
// Copy buffer data to game screen internal buffer
const byte *src = buf;
- byte *dst = (byte *)_screenData.pixels + y * _screenData.pitch + x * _screenData.bytesPerPixel;
+ byte *dst = (byte *)_screenData.pixels + y * _screenData.pitch + x * _screenData.format.bytesPerPixel;
for (int i = 0; i < h; i++) {
- memcpy(dst, src, w * _screenData.bytesPerPixel);
+ memcpy(dst, src, w * _screenData.format.bytesPerPixel);
src += pitch;
dst += _screenData.pitch;
}
@@ -466,7 +467,7 @@ void OpenGLGraphicsManager::clearOverlay() {
}
void OpenGLGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
- assert(_overlayData.bytesPerPixel == sizeof(buf[0]));
+ assert(_overlayData.format.bytesPerPixel == sizeof(buf[0]));
const byte *src = (byte *)_overlayData.pixels;
for (int i = 0; i < _overlayData.h; i++) {
// Copy overlay data to buffer
@@ -519,7 +520,7 @@ void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch
const byte *src = (const byte *)buf;
byte *dst = (byte *)_overlayData.pixels + y * _overlayData.pitch;
for (int i = 0; i < h; i++) {
- memcpy(dst + x * _overlayData.bytesPerPixel, src, w * _overlayData.bytesPerPixel);
+ memcpy(dst + x * _overlayData.format.bytesPerPixel, src, w * _overlayData.format.bytesPerPixel);
src += pitch * sizeof(buf[0]);
dst += _overlayData.pitch;
}
@@ -616,8 +617,8 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int
// Allocate space for cursor data
if (_cursorData.w != w || _cursorData.h != h ||
- _cursorData.bytesPerPixel != _cursorFormat.bytesPerPixel)
- _cursorData.create(w, h, _cursorFormat.bytesPerPixel);
+ _cursorData.format.bytesPerPixel != _cursorFormat.bytesPerPixel)
+ _cursorData.create(w, h, _cursorFormat);
// Save cursor data
memcpy(_cursorData.pixels, buf, h * _cursorData.pitch);
@@ -699,13 +700,13 @@ void OpenGLGraphicsManager::refreshGameScreen() {
int w = _screenDirtyRect.width();
int h = _screenDirtyRect.height();
- if (_screenData.bytesPerPixel == 1) {
+ if (_screenData.format.bytesPerPixel == 1) {
// Create a temporary RGB888 surface
byte *surface = new byte[w * h * 3];
// Convert the paletted buffer to RGB888
const byte *src = (byte *)_screenData.pixels + y * _screenData.pitch;
- src += x * _screenData.bytesPerPixel;
+ src += x * _screenData.format.bytesPerPixel;
byte *dst = surface;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
@@ -725,7 +726,7 @@ void OpenGLGraphicsManager::refreshGameScreen() {
} else {
// Update the texture
_gameTexture->updateBuffer((byte *)_screenData.pixels + y * _screenData.pitch +
- x * _screenData.bytesPerPixel, _screenData.pitch, x, y, w, h);
+ x * _screenData.format.bytesPerPixel, _screenData.pitch, x, y, w, h);
}
_screenNeedsRedraw = false;
@@ -741,13 +742,13 @@ void OpenGLGraphicsManager::refreshOverlay() {
int w = _overlayDirtyRect.width();
int h = _overlayDirtyRect.height();
- if (_overlayData.bytesPerPixel == 1) {
+ if (_overlayData.format.bytesPerPixel == 1) {
// Create a temporary RGB888 surface
byte *surface = new byte[w * h * 3];
// Convert the paletted buffer to RGB888
const byte *src = (byte *)_overlayData.pixels + y * _overlayData.pitch;
- src += x * _overlayData.bytesPerPixel;
+ src += x * _overlayData.format.bytesPerPixel;
byte *dst = surface;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
@@ -767,7 +768,7 @@ void OpenGLGraphicsManager::refreshOverlay() {
} else {
// Update the texture
_overlayTexture->updateBuffer((byte *)_overlayData.pixels + y * _overlayData.pitch +
- x * _overlayData.bytesPerPixel, _overlayData.pitch, x, y, w, h);
+ x * _overlayData.format.bytesPerPixel, _overlayData.pitch, x, y, w, h);
}
_overlayNeedsRedraw = false;
@@ -1175,9 +1176,9 @@ void OpenGLGraphicsManager::loadTextures() {
_oldVideoMode.screenHeight != _videoMode.screenHeight)
_screenData.create(_videoMode.screenWidth, _videoMode.screenHeight,
#ifdef USE_RGB_COLOR
- _screenFormat.bytesPerPixel
+ _screenFormat
#else
- 1
+ Graphics::PixelFormat::createFormatCLUT8()
#endif
);
@@ -1185,7 +1186,7 @@ void OpenGLGraphicsManager::loadTextures() {
if (_oldVideoMode.overlayWidth != _videoMode.overlayWidth ||
_oldVideoMode.overlayHeight != _videoMode.overlayHeight)
_overlayData.create(_videoMode.overlayWidth, _videoMode.overlayHeight,
- _overlayFormat.bytesPerPixel);
+ _overlayFormat);
_screenNeedsRedraw = true;
_overlayNeedsRedraw = true;
@@ -1387,7 +1388,7 @@ void OpenGLGraphicsManager::updateOSD() {
const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont);
if (_osdSurface.w != _osdTexture->getWidth() || _osdSurface.h != _osdTexture->getHeight())
- _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), 2);
+ _osdSurface.create(_osdTexture->getWidth(), _osdTexture->getHeight(), _overlayFormat);
else
// Clear everything
memset(_osdSurface.pixels, 0, _osdSurface.h * _osdSurface.pitch);
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 374f1c196e..1725817730 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -28,7 +28,9 @@
#include "backends/graphics/opengl/gltexture.h"
#include "backends/graphics/graphics.h"
+#include "common/array.h"
#include "common/events.h"
+#include "graphics/pixelformat.h"
// Uncomment this to enable the 'on screen display' code.
#define USE_OSD 1
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index b9022af120..fe86dd2098 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -30,6 +30,7 @@
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager()
:
@@ -487,9 +488,9 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
SDL_RWclose(file);
}
if (saveScreenshot(filename))
- printf("Saved '%s'\n", filename);
+ debug("Saved screenshot '%s'", filename);
else
- printf("Could not save screenshot!\n");
+ warning("Could not save screenshot");
return true;
}
}
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 67b979a830..3ae9597f1c 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -32,6 +32,7 @@
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "common/mutex.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#include "common/util.h"
#ifdef USE_RGB_COLOR
@@ -1287,9 +1288,9 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() {
_framebuffer.h = _screen->h;
_framebuffer.pitch = _screen->pitch;
#ifdef USE_RGB_COLOR
- _framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel;
+ _framebuffer.format = _screenFormat;
#else
- _framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
#endif
return &_framebuffer;
@@ -2054,7 +2055,11 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) {
dst.w = _osdSurface->w;
dst.h = _osdSurface->h;
dst.pitch = _osdSurface->pitch;
- dst.bytesPerPixel = _osdSurface->format->BytesPerPixel;
+ dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel,
+ 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss,
+ 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss,
+ _osdSurface->format->Rshift, _osdSurface->format->Gshift,
+ _osdSurface->format->Bshift, _osdSurface->format->Ashift);
// The font we are going to use:
const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont);
@@ -2274,9 +2279,9 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
SDL_RWclose(file);
}
if (saveScreenshot(filename))
- printf("Saved '%s'\n", filename);
+ debug("Saved screenshot '%s'", filename);
else
- printf("Could not save screenshot!\n");
+ warning("Could not save screenshot");
return true;
}
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index f467c38d5f..4895b240b0 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -27,6 +27,7 @@
#define BACKENDS_GRAPHICS_SDL_H
#include "backends/graphics/graphics.h"
+#include "graphics/pixelformat.h"
#include "graphics/scaler.h"
#include "common/events.h"
#include "common/system.h"
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp
index 37c6624560..b15f86e8fe 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.cpp
+++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp
@@ -28,6 +28,7 @@
#ifdef _WIN32_WCE
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#include "common/mutex.h"
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 7c608a53fc..b6d9dbf042 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -31,6 +31,7 @@
#ifdef ENABLE_KEYMAPPER
#include "backends/keymapper/types.h"
+#include "common/textconsole.h"
namespace Common {
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 2f913055fc..8edc26a526 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -26,6 +26,7 @@
#ifdef ENABLE_KEYMAPPER
+#include "common/system.h"
#include "gui/gui-manager.h"
#include "gui/widgets/popup.h"
#include "gui/widgets/scrollbar.h"
diff --git a/backends/keymapper/remap-dialog.h b/backends/keymapper/remap-dialog.h
index 2c0e79a79d..5721d368a4 100644
--- a/backends/keymapper/remap-dialog.h
+++ b/backends/keymapper/remap-dialog.h
@@ -33,8 +33,10 @@
#include "gui/dialog.h"
namespace GUI {
- class PopupWidget;
- class ScrollBarWidget;
+class ButtonWidget;
+class PopUpWidget;
+class ScrollBarWidget;
+class StaticTextWidget;
}
namespace Common {
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 2257f60e27..5110734a18 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.cpp
@@ -30,6 +30,8 @@
#if defined(USE_ALSA)
#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp
index ee3baaadd2..cc791cf7c0 100644
--- a/backends/midi/camd.cpp
+++ b/backends/midi/camd.cpp
@@ -29,6 +29,8 @@
#if defined(__amigaos4__)
+#include "common/textconsole.h"
+#include "common/error.h"
#include "common/endian.h"
#include "common/util.h"
#include "audio/musicplugin.h"
@@ -135,8 +137,8 @@ void MidiDriver_CAMD::sysEx(const byte *msg, uint16 length) {
char *MidiDriver_CAMD::getDevice() {
char *retname = NULL;
- APTR key;
- if (key = _ICamd->LockCAMD(CD_Linkages)) {
+ APTR key = _ICamd->LockCAMD(CD_Linkages);
+ if (key != NULL) {
struct MidiCluster *cluster = _ICamd->NextCluster(NULL);
while (cluster && !retname) {
diff --git a/backends/midi/coreaudio.cpp b/backends/midi/coreaudio.cpp
index 0158cc4a1d..52d32cb5e3 100644
--- a/backends/midi/coreaudio.cpp
+++ b/backends/midi/coreaudio.cpp
@@ -41,6 +41,8 @@
#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
diff --git a/backends/midi/coremidi.cpp b/backends/midi/coremidi.cpp
index 9123c9bc8c..87cd6307ba 100644
--- a/backends/midi/coremidi.cpp
+++ b/backends/midi/coremidi.cpp
@@ -30,6 +30,8 @@
#ifdef MACOSX
#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
diff --git a/backends/midi/seq.cpp b/backends/midi/seq.cpp
index 7cd7f0a38e..b90a9b19e0 100644
--- a/backends/midi/seq.cpp
+++ b/backends/midi/seq.cpp
@@ -35,6 +35,8 @@
#if defined(USE_SEQ_MIDI)
+#include "common/error.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp
index c01b9bbef7..dd76196ae0 100644
--- a/backends/midi/timidity.cpp
+++ b/backends/midi/timidity.cpp
@@ -41,13 +41,13 @@
#if defined(USE_TIMIDITY)
-#include "common/util.h"
#include "common/endian.h"
+#include "common/error.h"
#include "common/str.h"
+#include "common/textconsole.h"
#include "audio/musicplugin.h"
#include "audio/mpu401.h"
-#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index aad7f48d94..292bbea79e 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -38,6 +38,8 @@
#include "audio/mpu401.h"
#include "common/config-manager.h"
#include "common/translation.h"
+#include "common/textconsole.h"
+#include "common/error.h"
#include <mmsystem.h>
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index fa2bf3e232..90629954c5 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -26,8 +26,10 @@
#if defined(SDL_BACKEND)
#include "backends/mixer/sdl/sdl-mixer.h"
+#include "common/debug.h"
#include "common/system.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#ifdef GP2X
#define SAMPLES_PER_SEC 11025
diff --git a/backends/mixer/wincesdl/wincesdl-mixer.cpp b/backends/mixer/wincesdl/wincesdl-mixer.cpp
index a8b03e81c4..17cf0ced49 100644
--- a/backends/mixer/wincesdl/wincesdl-mixer.cpp
+++ b/backends/mixer/wincesdl/wincesdl-mixer.cpp
@@ -32,6 +32,7 @@
#include "backends/platform/wince/wince-sdl.h"
#include "backends/mixer/wincesdl/wincesdl-mixer.h"
#include "common/system.h"
+#include "common/textconsole.h"
#ifdef USE_VORBIS
#ifndef USE_TREMOR
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp
index 19cba89af3..b691250289 100644
--- a/backends/modular-backend.cpp
+++ b/backends/modular-backend.cpp
@@ -26,12 +26,14 @@
#include "backends/modular-backend.h"
#include "backends/fs/fs-factory.h"
-#include "backends/events/default/default-events.h"
-#include "backends/audiocd/default/default-audiocd.h"
-#include "backends/mutex/null/null-mutex.h"
-#include "backends/graphics/null/null-graphics.h"
+#include "backends/audiocd/audiocd.h"
+#include "backends/graphics/graphics.h"
+#include "backends/mutex/mutex.h"
+#include "audio/mixer.h"
+#include "common/events.h"
#include "gui/message.h"
+#include "graphics/pixelformat.h"
ModularBackend::ModularBackend()
:
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index bbfdb06b8d..c7f62f523b 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -32,6 +32,7 @@
#include <unistd.h>
#include "common/util.h"
+#include "common/textconsole.h"
#include "common/rect.h"
#include "common/queue.h"
#include "common/mutex.h"
diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index 6eebdb97d9..109d252a99 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -31,6 +31,7 @@
#include "common/fs.h"
#include "common/archive.h"
#include "audio/mixer_intern.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "backends/base-backend.h"
#include "backends/plugins/posix/posix-provider.h"
diff --git a/backends/platform/android/asset-archive.cpp b/backends/platform/android/asset-archive.cpp
index 8e95029894..7c21b35281 100644
--- a/backends/platform/android/asset-archive.cpp
+++ b/backends/platform/android/asset-archive.cpp
@@ -35,6 +35,7 @@
#include "common/util.h"
#include "common/archive.h"
#include "common/debug.h"
+#include "common/textconsole.h"
#include "backends/platform/android/jni.h"
#include "backends/platform/android/asset-archive.h"
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 86232030ff..fae428d29f 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -628,13 +628,13 @@ void OSystem_Android::grabOverlay(OverlayColor *buf, int pitch) {
GLTHREADCHECK;
const Graphics::Surface *surface = _overlay_texture->surface_const();
- assert(surface->bytesPerPixel == sizeof(buf[0]));
+ assert(surface->format.bytesPerPixel == sizeof(buf[0]));
const byte *src = (const byte *)surface->pixels;
uint h = surface->h;
do {
- memcpy(buf, src, surface->w * surface->bytesPerPixel);
+ memcpy(buf, src, surface->w * surface->format.bytesPerPixel);
src += surface->pitch;
// This 'pitch' is pixels not bytes
buf += pitch;
diff --git a/backends/platform/android/jni.cpp b/backends/platform/android/jni.cpp
index 08a1491998..f23d71b2a4 100644
--- a/backends/platform/android/jni.cpp
+++ b/backends/platform/android/jni.cpp
@@ -28,6 +28,8 @@
#include "base/main.h"
#include "base/version.h"
#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/textconsole.h"
#include "engines/engine.h"
#include "backends/platform/android/android.h"
diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
index 8bf40ac553..c4de6d62f8 100644
--- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
+++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
@@ -35,7 +35,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
private String[] _args;
- final private native void create(AssetManager _asset_manager,
+ final private native void create(AssetManager asset_manager,
EGL10 egl, EGLDisplay egl_display,
AudioTrack audio_track,
int sample_rate, int buffer_size);
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index a6b28ca485..2d73783309 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -147,7 +147,7 @@ void GLESBaseTexture::setLinearFilter(bool value) {
void GLESBaseTexture::allocBuffer(GLuint w, GLuint h) {
_surface.w = w;
_surface.h = h;
- _surface.bytesPerPixel = _pixelFormat.bytesPerPixel;
+ _surface.format = _pixelFormat;
if (w == _texture_width && h == _texture_height)
return;
@@ -241,14 +241,14 @@ void GLESTexture::allocBuffer(GLuint w, GLuint h) {
delete[] _buf;
delete[] _pixels;
- _pixels = new byte[w * h * _surface.bytesPerPixel];
+ _pixels = new byte[w * h * _surface.format.bytesPerPixel];
assert(_pixels);
_surface.pixels = _pixels;
fillBuffer(0);
- _buf = new byte[w * h * _surface.bytesPerPixel];
+ _buf = new byte[w * h * _surface.format.bytesPerPixel];
assert(_buf);
}
@@ -257,10 +257,10 @@ void GLESTexture::updateBuffer(GLuint x, GLuint y, GLuint w, GLuint h,
setDirtyRect(Common::Rect(x, y, x + w, y + h));
const byte *src = (const byte *)buf;
- byte *dst = _pixels + y * _surface.pitch + x * _surface.bytesPerPixel;
+ byte *dst = _pixels + y * _surface.pitch + x * _surface.format.bytesPerPixel;
do {
- memcpy(dst, src, w * _surface.bytesPerPixel);
+ memcpy(dst, src, w * _surface.format.bytesPerPixel);
dst += _surface.pitch;
src += pitch_buf;
} while (--h);
@@ -301,10 +301,10 @@ void GLESTexture::drawTexture(GLshort x, GLshort y, GLshort w, GLshort h) {
_tex = _buf;
byte *src = _pixels + _dirty_rect.top * _surface.pitch +
- _dirty_rect.left * _surface.bytesPerPixel;
+ _dirty_rect.left * _surface.format.bytesPerPixel;
byte *dst = _buf;
- uint16 l = dwidth * _surface.bytesPerPixel;
+ uint16 l = dwidth * _surface.format.bytesPerPixel;
for (uint16 i = 0; i < dheight; ++i) {
memcpy(dst, src, l);
@@ -373,7 +373,7 @@ void GLESFakePaletteTexture::allocBuffer(GLuint w, GLuint h) {
GLESBaseTexture::allocBuffer(w, h);
- _surface.bytesPerPixel = 1;
+ _surface.format = Graphics::PixelFormat::createFormatCLUT8();
_surface.pitch = w;
if (_surface.w == oldw && _surface.h == oldh) {
diff --git a/backends/platform/dc/dc.h b/backends/platform/dc/dc.h
index f0c8c1f96c..060eff2b48 100644
--- a/backends/platform/dc/dc.h
+++ b/backends/platform/dc/dc.h
@@ -26,6 +26,7 @@
#include "backends/base-backend.h"
#include <graphics/surface.h>
#include <graphics/colormasks.h>
+#include <graphics/palette.h>
#include <ronin/soundcommon.h>
#include "backends/timer/default/default-timer.h"
#include "backends/audiocd/default/default-audiocd.h"
diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp
index b297022775..78fa2182dc 100644
--- a/backends/platform/dc/display.cpp
+++ b/backends/platform/dc/display.cpp
@@ -720,7 +720,7 @@ Graphics::Surface *OSystem_Dreamcast::lockScreen()
_framebuffer.w = _screen_w;
_framebuffer.h = _screen_h;
_framebuffer.pitch = SCREEN_W*2;
- _framebuffer.bytesPerPixel = (_screenFormat == 0? 1 : 2);
+ _framebuffer.format = screenFormats[_screenFormat];
return &_framebuffer;
}
diff --git a/backends/platform/dc/dreamcast.mk b/backends/platform/dc/dreamcast.mk
index 8651a2936c..666e03eece 100644
--- a/backends/platform/dc/dreamcast.mk
+++ b/backends/platform/dc/dreamcast.mk
@@ -35,3 +35,7 @@ ip.txt : $(srcdir)/backends/platform/dc/ip.txt.in
ver="V$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)"; fi; \
sed -e 's/[@]VERSION[@]/'"$$ver"/ -e 's/[@]DATE[@]/$(shell date '+%Y%m%d')/' < $< > $@
+
+dcdist : dist
+ mkdir -p dcdist/scummvm
+ cp scummvm.elf SCUMMVM.BIN IP.BIN *.PLG dcdist/scummvm/
diff --git a/backends/platform/dc/plugins.cpp b/backends/platform/dc/plugins.cpp
index be329ab314..44b8960513 100644
--- a/backends/platform/dc/plugins.cpp
+++ b/backends/platform/dc/plugins.cpp
@@ -39,6 +39,7 @@ static void drawPluginProgress(const Common::String &filename)
{
ta_sync();
void *mark = ta_txmark();
+ const char *fn = filename.c_str();
Label lab1, lab2, lab3;
char buf[32];
unsigned memleft = 0x8cf00000-((unsigned)sbrk(0));
@@ -46,20 +47,21 @@ static void drawPluginProgress(const Common::String &filename)
int fcol = (memleft < (1<<20)? 0xffff0000:
(memleft < (4<<20)? 0xffffff00: 0xff00ff00));
snprintf(buf, sizeof(buf), "%dK free memory", memleft>>10);
+ if (fn[0] == '/') fn++;
lab1.create_texture("Loading plugins, please wait...");
- lab2.create_texture(filename.c_str());
+ lab2.create_texture(fn);
lab3.create_texture(buf);
ta_begin_frame();
- draw_solid_quad(80.0, 320.0, 560.0, 350.0,
+ draw_solid_quad(80.0, 270.0, 560.0, 300.0,
0xff808080, 0xff808080, 0xff808080, 0xff808080);
- draw_solid_quad(85.0, 325.0, 555.0, 345.0,
+ draw_solid_quad(85.0, 275.0, 555.0, 295.0,
0xff202020, 0xff202020, 0xff202020, 0xff202020);
- draw_solid_quad(85.0, 325.0, 85.0+470.0*ffree, 345.0,
+ draw_solid_quad(85.0, 275.0, 85.0+470.0*ffree, 295.0,
fcol, fcol, fcol, fcol);
ta_commit_end();
- lab1.draw(100.0, 200.0, 0xffffffff);
- lab2.draw(100.0, 240.0, 0xffffffff);
- lab3.draw(100.0, 280.0, 0xffffffff);
+ lab1.draw(100.0, 150.0, 0xffffffff);
+ lab2.draw(100.0, 190.0, 0xffaaffaa);
+ lab3.draw(100.0, 230.0, 0xffffffff);
ta_commit_frame();
ta_sync();
ta_txrelease(mark);
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index 576b70dd2a..49818a0034 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -243,7 +243,7 @@ void OSystem_DS::setCursorPalette(const byte *colors, uint start, uint num) {
}
bool OSystem_DS::grabRawScreen(Graphics::Surface *surf) {
- surf->create(DS::getGameWidth(), DS::getGameHeight(), 1);
+ surf->create(DS::getGameWidth(), DS::getGameHeight(), Graphics::PixelFormat::createFormatCLUT8());
// Ensure we copy using 16 bit quantities due to limitation of VRAM addressing
@@ -756,7 +756,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() {
_framebuffer.w = DS::getGameWidth();
_framebuffer.h = DS::getGameHeight();
_framebuffer.pitch = DS::getGameWidth();
- _framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
} else {
@@ -781,7 +781,7 @@ Graphics::Surface *OSystem_DS::createTempFrameBuffer() {
_framebuffer.w = width;
_framebuffer.h = height;
_framebuffer.pitch = width;
- _framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
}
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index 5e179d1337..b745b4dc6e 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -36,6 +36,7 @@
#include "audio/mixer_intern.h"
#include "graphics/surface.h"
#include "graphics/colormasks.h"
+#include "graphics/palette.h"
class OSystem_DS : public BaseBackend, public PaletteManager {
protected:
diff --git a/backends/platform/gph/gph-backend.cpp b/backends/platform/gph/gph-backend.cpp
index fddcd03d85..375ee37378 100644
--- a/backends/platform/gph/gph-backend.cpp
+++ b/backends/platform/gph/gph-backend.cpp
@@ -40,6 +40,7 @@
#include "common/debug.h"
#include "common/events.h"
#include "common/file.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/mixer_intern.h"
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index 25c3c40cf9..79f596632f 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -30,6 +30,7 @@
#include "audio/mixer_intern.h"
#include "backends/fs/posix/posix-fs-factory.h"
#include "graphics/colormasks.h"
+#include "graphics/palette.h"
#include <AudioToolbox/AudioQueue.h>
diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp
index c5e7ab8413..a10efeff40 100644
--- a/backends/platform/iphone/osys_video.cpp
+++ b/backends/platform/iphone/osys_video.cpp
@@ -334,7 +334,7 @@ Graphics::Surface *OSystem_IPHONE::lockScreen() {
_framebuffer.w = _screenWidth;
_framebuffer.h = _screenHeight;
_framebuffer.pitch = _screenWidth;
- _framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
return &_framebuffer;
}
diff --git a/backends/platform/n64/osys_n64.h b/backends/platform/n64/osys_n64.h
index 2daa41a9f6..7a84de0449 100644
--- a/backends/platform/n64/osys_n64.h
+++ b/backends/platform/n64/osys_n64.h
@@ -37,6 +37,7 @@
#include "graphics/surface.h"
#include "graphics/colormasks.h"
+#include "graphics/palette.h"
#include "graphics/pixelformat.h"
#include "audio/mixer_intern.h"
diff --git a/backends/platform/n64/osys_n64_base.cpp b/backends/platform/n64/osys_n64_base.cpp
index 54eab0fd52..232037899b 100644
--- a/backends/platform/n64/osys_n64_base.cpp
+++ b/backends/platform/n64/osys_n64_base.cpp
@@ -610,7 +610,7 @@ Graphics::Surface *OSystem_N64::lockScreen() {
_framebuffer.w = _gameWidth;
_framebuffer.h = _gameHeight;
_framebuffer.pitch = _screenWidth;
- _framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
return &_framebuffer;
}
diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp
index a460b919fd..e43ea0f376 100644
--- a/backends/platform/ps2/Gs2dScreen.cpp
+++ b/backends/platform/ps2/Gs2dScreen.cpp
@@ -398,7 +398,7 @@ Graphics::Surface *Gs2dScreen::lockScreen() {
_framebuffer.w = _width;
_framebuffer.h = _height;
_framebuffer.pitch = _width; // -not- _pitch; ! It's EE mem, not Tex
- _framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
return &_framebuffer;
}
@@ -441,7 +441,7 @@ void Gs2dScreen::grabPalette(uint8 *pal, uint8 start, uint16 num) {
void Gs2dScreen::grabScreen(Graphics::Surface *surf) {
assert(surf);
WaitSema(g_DmacSema);
- surf->create(_width, _height, 1);
+ surf->create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());
memcpy(surf->pixels, _screenBuf, _width * _height);
SignalSema(g_DmacSema);
}
diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h
index 358e717cbe..6e842b3f55 100644
--- a/backends/platform/ps2/Gs2dScreen.h
+++ b/backends/platform/ps2/Gs2dScreen.h
@@ -46,7 +46,7 @@ enum GsInterlace {
namespace Graphics {
- struct Surface;
+struct Surface;
}
class Gs2dScreen {
diff --git a/backends/platform/ps2/ps2input.h b/backends/platform/ps2/ps2input.h
index 266f408809..eca5950113 100644
--- a/backends/platform/ps2/ps2input.h
+++ b/backends/platform/ps2/ps2input.h
@@ -32,6 +32,10 @@
class OSystem_PS2;
class Ps2Pad;
+namespace Common {
+struct Event;
+}
+
class Ps2Input {
public:
Ps2Input(OSystem_PS2 *system, bool mouseLoaded, bool kbdLoaded);
diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp
index 77de74eb5b..e95a026d01 100644
--- a/backends/platform/ps2/systemps2.cpp
+++ b/backends/platform/ps2/systemps2.cpp
@@ -727,7 +727,7 @@ void OSystem_PS2::msgPrintf(int millis, const char *format, ...) {
int maxWidth = 0;
Graphics::Surface surf;
- surf.create(300, 200, 1);
+ surf.create(300, 200, Graphics::PixelFormat::createFormatCLUT8());
char *lnSta = resStr;
while (*lnSta && (posY < 180)) {
diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h
index 37575f399f..54e6f05798 100644
--- a/backends/platform/ps2/systemps2.h
+++ b/backends/platform/ps2/systemps2.h
@@ -28,6 +28,7 @@
#include "common/system.h"
#include "backends/base-backend.h"
+#include "graphics/palette.h"
class DefaultTimerManager;
class DefaultSaveFileManager;
@@ -47,11 +48,11 @@ struct Ps2Mutex {
};
namespace Common {
- class TimerManager;
+class TimerManager;
};
namespace Audio {
- class MixerImpl;
+class MixerImpl;
};
class OSystem_PS2 : public BaseBackend, public PaletteManager {
diff --git a/backends/platform/psp/README.PSP b/backends/platform/psp/README.PSP
index b520022033..dcfa30898c 100644
--- a/backends/platform/psp/README.PSP
+++ b/backends/platform/psp/README.PSP
@@ -1,4 +1,4 @@
-ScummVM-PSP 1.3.0git README
+ScummVM-PSP 1.4.0git README
==============================================================================
Installation
diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp
index cf879e095a..420b0398c3 100644
--- a/backends/platform/psp/cursor.cpp
+++ b/backends/platform/psp/cursor.cpp
@@ -327,8 +327,20 @@ inline void Cursor::setRendererModePalettized(bool palettized) {
_renderer.setAlphaReverse(false);
_renderer.setColorTest(false);
} else { // 16 bits, no palette
+ // Color test is an easy way for the hardware to make our keycolor
+ // transparent.
+ _renderer.setColorTest(true);
+
+ // Alpha blending is not strictly required, but makes the cursor look
+ // much better
_renderer.setAlphaBlending(true);
- _renderer.setAlphaReverse(true); // We can't change all alpha values, so just reverse
- _renderer.setColorTest(true); // Color test to make our key color transparent
+
+ // Pixel formats without alpha (5650) are considered to have their alpha set.
+ // Since pixel formats with alpha don't have their alpha bits set, we reverse
+ // the alpha format for them so that 0 alpha is 1.
+ if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650)
+ _renderer.setAlphaReverse(true);
+ else
+ _renderer.setAlphaReverse(false);
}
}
diff --git a/backends/platform/psp/default_display_client.cpp b/backends/platform/psp/default_display_client.cpp
index bb42406c3e..34b1a70711 100644
--- a/backends/platform/psp/default_display_client.cpp
+++ b/backends/platform/psp/default_display_client.cpp
@@ -199,7 +199,7 @@ Graphics::Surface *Screen::lockAndGetForEditing() {
_frameBuffer.w = _buffer.getSourceWidth();
_frameBuffer.h = _buffer.getSourceHeight();
_frameBuffer.pitch = _buffer.getBytesPerPixel() * _buffer.getWidth();
- _frameBuffer.bytesPerPixel = _buffer.getBytesPerPixel();
+ _frameBuffer.format = _pixelFormat;
// We'll set to dirty once we unlock the screen
return &_frameBuffer;
diff --git a/backends/platform/psp/mp3.cpp b/backends/platform/psp/mp3.cpp
index 54476dabfd..0faeacb2f2 100644
--- a/backends/platform/psp/mp3.cpp
+++ b/backends/platform/psp/mp3.cpp
@@ -29,6 +29,7 @@
#include "common/util.h"
#include "common/singleton.h"
#include "common/mutex.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
diff --git a/backends/platform/psp/mp3.h b/backends/platform/psp/mp3.h
index 1d2fe5ec2f..95491d5788 100644
--- a/backends/platform/psp/mp3.h
+++ b/backends/platform/psp/mp3.h
@@ -30,7 +30,7 @@
#include "common/scummsys.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Audio {
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 051449d4a0..1e4aea70d3 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -29,6 +29,7 @@
#include "common/scummsys.h"
#include "graphics/surface.h"
#include "graphics/colormasks.h"
+#include "graphics/palette.h"
#include "audio/mixer_intern.h"
#include "backends/base-backend.h"
#include "backends/fs/psp/psp-fs-factory.h"
diff --git a/backends/platform/sdl/posix/posix.cpp b/backends/platform/sdl/posix/posix.cpp
index 71a88265a0..889bc5cd5e 100644
--- a/backends/platform/sdl/posix/posix.cpp
+++ b/backends/platform/sdl/posix/posix.cpp
@@ -23,6 +23,8 @@
*
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+
#include "common/scummsys.h"
#ifdef UNIX
@@ -34,6 +36,7 @@
#include <errno.h>
#include <sys/stat.h>
+
OSystem_POSIX::OSystem_POSIX(Common::String baseConfigName)
:
_baseConfigName(baseConfigName) {
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 2c0c45907f..bc27f8e954 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -23,6 +23,9 @@
*
*/
+#define FORBIDDEN_SYMBOL_EXCEPTION_time_h
+
+
#ifdef WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
@@ -32,6 +35,7 @@
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
#include "common/EventRecorder.h"
+#include "common/textconsole.h"
#include "backends/saves/default/default-saves.h"
#include "backends/audiocd/sdl/sdl-audiocd.h"
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 9459263ae2..fffc3a2a75 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -27,6 +27,8 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/scummsys.h"
+#include "common/error.h"
+#include "common/textconsole.h"
#ifdef WIN32
diff --git a/backends/platform/webos/webos.mk b/backends/platform/webos/webos.mk
index 22df5622ee..2b145b00c9 100644
--- a/backends/platform/webos/webos.mk
+++ b/backends/platform/webos/webos.mk
@@ -1,15 +1,27 @@
# WebOS specific build targets
# ============================================================================
#
-# Run "make webosrelease" to create a release package to be uploaded to the
-# Palm app catalog.
+# Build instructions:
#
-# Run "make webosbeta" to create a beta package to be uploaded to the Palm
-# Beta app catalog.
+# 1. Install the WebOS SDK and PDK and setup the environment variables
+# WEBOS_SDK and WEBOS_PDK accordingly.
#
-# Before calling these targets the ScummVM source must be configured for a
-# WebOS build. See
-# http://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for details.
+# 2. Cross-compile zlib, flac, mad and tremor and install it into the PDK.
+#
+# 3. Prepare the ScummVM source for a webOS build:
+# $ ./configure --host=webos --enable-plugins --default-dynamic \
+# --enable-release
+#
+# 4. Create the package:
+# $ make package
+#
+# The package is now in the "portdist" folder.
+#
+# See http://wiki.scummvm.org/index.php/Compiling_ScummVM/WebOS for
+# more detailed build instructions.
+#
+#
+# Palm App catalog instructions:
#
# VER_PACKAGE must be set to a number which is higher than the currently
# used package version in the app catalog. So when creating an updated
@@ -25,46 +37,55 @@
# to use a user-specific app name when submitting the created package to the
# Palm app catalog. Use "ScummVM (<username>)" instead of "ScummVM" and
# "ScummVM Beta (<username>)" instead of "ScummVM Beta".
+#
+# The app id is automatically parsed from the installation prefix. So add a
+# configure parameter like this to prepare a build of a package for the Palm
+# App Catalog:
+#
+# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm
+#
+# To build a package for the Palm Beta App Catalog add "-beta" to the prefix:
+#
+# --prefix=/media/cryptofs/apps/usr/palm/applications/com.github.kayahr.scummvm-beta
+# ============================================================================
+
+# Increment this number when the packaging of the app has been changed while
+# ScummVM itself has the same version as before. The number can be reset to
+# 1 when the ScummVM version is increased.
+VER_PACKAGE = 5
PATH_DIST = $(srcdir)/dists/webos
PATH_MOJO = $(PATH_DIST)/mojo
-BASE_APP_ID = org.scummvm
-APP_ID = $(BASE_APP_ID).scummvm
-BETA_APP_ID = $(APP_ID)-beta
+APP_ID = $(shell basename $(prefix))
APP_VERSION = $(shell printf "%d.%d.%02d%02d" $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) $(VER_PACKAGE))
-STAGING_DIR=STAGING/$(APP_ID)
-
-webosprepare: all
- $(QUIET)if [ "$(VER_PACKAGE)" = "" ]; \
- then \
- echo "ERROR: VER_PACKAGE is not set"; \
- echo "Example: export VER_PACKAGE=1"; \
- exit 1; \
- fi
- $(QUIET)$(RM_REC) $(STAGING_DIR)
- $(QUIET)$(MKDIR) $(STAGING_DIR)
- $(QUIET)$(MKDIR) $(STAGING_DIR)/bin
- $(QUIET)$(MKDIR) $(STAGING_DIR)/lib
- $(QUIET)$(MKDIR) $(STAGING_DIR)/share/scummvm
- $(QUIET)$(CP) $(PATH_MOJO)/* $(STAGING_DIR)
- $(QUIET)$(CP) gui/themes/translations.dat $(STAGING_DIR)/share/scummvm
- $(QUIET)$(CP) gui/themes/scummmodern.zip $(STAGING_DIR)/share/scummvm
- $(QUIET)$(CP) scummvm $(STAGING_DIR)/bin
- $(QUIET)$(STRIP) $(STAGING_DIR)/bin/scummvm
- $(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ $(STAGING_DIR)/appinfo.json
+DESTDIR ?= portdist
-webosrelease: webosprepare
- $(QUIET)$(RM) $(APP_ID)_*.ipk
- $(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ $(STAGING_DIR)/appinfo.json
- $(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ $(STAGING_DIR)/appinfo.json
- $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format $(STAGING_DIR)
- $(QUIET)$(RM_REC) STAGING
+install: all
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(prefix)"
+ $(QUIET)$(INSTALL) -m 0644 -t "$(DESTDIR)$(prefix)/" "$(PATH_MOJO)/"*
+ $(QUIET)$(INSTALL) -m 0755 "$(PATH_MOJO)/start" "$(DESTDIR)$(prefix)/"
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(bindir)"
+ $(QUIET)$(INSTALL) -c -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(bindir)/$(EXECUTABLE)"
+ $(QUIET)$(STRIP) "$(DESTDIR)$(bindir)/$(EXECUTABLE)"
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(docdir)"
+ $(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_DOCS) "$(DESTDIR)$(docdir)"
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(datadir)"
+ $(QUIET)$(INSTALL) -c -m 644 $(DIST_FILES_THEMES) $(DIST_FILES_ENGINEDATA) "$(DESTDIR)$(datadir)/"
+ifdef DYNAMIC_MODULES
+ $(QUIET)$(INSTALL) -d "$(DESTDIR)$(libdir)/"
+ $(QUIET)$(INSTALL) -c -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/"
+ $(QUIET)$(STRIP) "$(DESTDIR)$(libdir)/"*
+endif
+ $(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json"
+ $(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json"
+ifneq (,$(findstring -beta,$(APP_ID)))
+ $(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json"
+else
+ $(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json"
+endif
-webosbeta: webosprepare
- $(QUIET)$(RM) $(BETA_APP_ID)_*.ipk
- $(QUIET)sed -i s/'APP_ID'/'$(BETA_APP_ID)'/ $(STAGING_DIR)/appinfo.json
- $(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ $(STAGING_DIR)/appinfo.json
- $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format $(STAGING_DIR)
- $(QUIET)$(RM_REC) STAGING
+uninstall:
+ $(QUIET)$(RM_REC) "$(DESTDIR)$(prefix)"
-.PHONY: webosrelease webosbeta
+package: install
+ $(QUIET)$(WEBOS_SDK)/bin/palm-package --use-v1-format "$(DESTDIR)$(prefix)" -o "$(DESTDIR)"
diff --git a/backends/platform/wii/osystem.cpp b/backends/platform/wii/osystem.cpp
index 2aefe48f0c..54da27126c 100644
--- a/backends/platform/wii/osystem.cpp
+++ b/backends/platform/wii/osystem.cpp
@@ -26,6 +26,7 @@
#include <ogc/lwp_watchdog.h>
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "backends/fs/wii/wii-fs-factory.h"
#include "osystem.h"
diff --git a/backends/platform/wii/osystem.h b/backends/platform/wii/osystem.h
index 3c992b8bdc..d1ea8e07ae 100644
--- a/backends/platform/wii/osystem.h
+++ b/backends/platform/wii/osystem.h
@@ -36,6 +36,7 @@
#include "backends/saves/default/default-saves.h"
#include "backends/timer/default/default-timer.h"
#include "graphics/colormasks.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "audio/mixer_intern.h"
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index cb9a8c72e9..c2be608999 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -537,10 +537,10 @@ Graphics::Surface *OSystem_Wii::lockScreen() {
_surface.h = _gameHeight;
#ifdef USE_RGB_COLOR
_surface.pitch = _gameWidth * _pfGame.bytesPerPixel;
- _surface.bytesPerPixel = _pfGame.bytesPerPixel;
+ _surface.format = _pfGame;
#else
_surface.pitch = _gameWidth;
- _surface.bytesPerPixel = 1;
+ _surface.format = Graphics::PixelFormat::createFormatCLUT8();
#endif
return &_surface;
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index b829686cb0..b54aebe6bd 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -33,6 +33,7 @@
#include "common/debug.h"
#include "common/events.h"
#include "common/util.h"
+#include "common/textconsole.h"
#include "common/timer.h"
#include "common/translation.h"
diff --git a/backends/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h
index 32d411656c..775e887105 100644
--- a/backends/plugins/dynamic-plugin.h
+++ b/backends/plugins/dynamic-plugin.h
@@ -27,6 +27,7 @@
#define BACKENDS_PLUGINS_DYNAMICPLUGIN_H
#include "base/plugins.h"
+#include "common/textconsole.h"
class DynamicPlugin : public Plugin {
diff --git a/backends/plugins/elf/memory-manager.cpp b/backends/plugins/elf/memory-manager.cpp
index b2ac497771..d32ac2da28 100644
--- a/backends/plugins/elf/memory-manager.cpp
+++ b/backends/plugins/elf/memory-manager.cpp
@@ -28,6 +28,7 @@
#if defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER)
#include "backends/plugins/elf/memory-manager.h"
+#include "common/debug.h"
#include "common/util.h"
#include <malloc.h>
diff --git a/backends/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
index 866cd912e5..37db208223 100644
--- a/backends/saves/posix/posix-saves.cpp
+++ b/backends/saves/posix/posix-saves.cpp
@@ -23,6 +23,10 @@
*
*/
+
+// Enable mkdir
+#define FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+
#include "common/scummsys.h"
#if defined(UNIX) && !defined(DISABLE_DEFAULT_SAVEFILEMANAGER)
@@ -31,6 +35,7 @@
#include "common/config-manager.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include <stdio.h>
#include <string.h>
diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp
index 7b7d6b0c0c..9888146049 100644
--- a/backends/saves/savefile.cpp
+++ b/backends/saves/savefile.cpp
@@ -25,9 +25,7 @@
#include "common/util.h"
#include "common/savefile.h"
-
-#include <stdio.h>
-#include <string.h>
+#include "common/str.h"
namespace Common {
diff --git a/backends/timer/default/default-timer.h b/backends/timer/default/default-timer.h
index a4c7385ef9..9a353f58c3 100644
--- a/backends/timer/default/default-timer.h
+++ b/backends/timer/default/default-timer.h
@@ -28,8 +28,6 @@
#include "common/timer.h"
#include "common/mutex.h"
-class OSystem;
-
struct TimerSlot;
class DefaultTimerManager : public Common::TimerManager {
diff --git a/backends/timer/sdl/sdl-timer.cpp b/backends/timer/sdl/sdl-timer.cpp
index 0a4cd428de..647ddba2d3 100644
--- a/backends/timer/sdl/sdl-timer.cpp
+++ b/backends/timer/sdl/sdl-timer.cpp
@@ -30,6 +30,8 @@
#include "backends/timer/sdl/sdl-timer.h"
+#include "common/textconsole.h"
+
static Uint32 timer_handler(Uint32 interval, void *param) {
((DefaultTimerManager *)param)->handler();
return interval;
diff --git a/backends/vkeybd/image-map.cpp b/backends/vkeybd/image-map.cpp
index b0a77b5220..f4b4541d7e 100644
--- a/backends/vkeybd/image-map.cpp
+++ b/backends/vkeybd/image-map.cpp
@@ -27,6 +27,8 @@
#ifdef ENABLE_VKEYBD
+#include "common/textconsole.h"
+
#include "backends/vkeybd/image-map.h"
#include "backends/vkeybd/polygon.h"
diff --git a/backends/vkeybd/virtual-keyboard-gui.cpp b/backends/vkeybd/virtual-keyboard-gui.cpp
index 050ab5c5a2..9ffda6e3a7 100644
--- a/backends/vkeybd/virtual-keyboard-gui.cpp
+++ b/backends/vkeybd/virtual-keyboard-gui.cpp
@@ -36,7 +36,7 @@
namespace Common {
static void blit(Graphics::Surface *surf_dst, Graphics::Surface *surf_src, int16 x, int16 y, OverlayColor transparent) {
- if (surf_dst->bytesPerPixel != sizeof(OverlayColor) || surf_src->bytesPerPixel != sizeof(OverlayColor))
+ if (surf_dst->format.bytesPerPixel != sizeof(OverlayColor) || surf_src->format.bytesPerPixel != sizeof(OverlayColor))
return;
const OverlayColor *src = (const OverlayColor *)surf_src->pixels;
@@ -133,7 +133,7 @@ void VirtualKeyboardGUI::setupDisplayArea(Rect& r, OverlayColor forecolor) {
_dispI = 0;
_dispForeColor = forecolor;
_dispBackColor = _dispForeColor + 0xFF;
- _dispSurface.create(r.width(), _dispFont->getFontHeight(), sizeof(OverlayColor));
+ _dispSurface.create(r.width(), _dispFont->getFontHeight(), _system->getOverlayFormat());
_dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor);
_displayEnabled = true;
}
@@ -163,7 +163,7 @@ void VirtualKeyboardGUI::run() {
_system->showOverlay();
_system->clearOverlay();
}
- _overlayBackup.create(_screenW, _screenH, sizeof(OverlayColor));
+ _overlayBackup.create(_screenW, _screenH, _system->getOverlayFormat());
_system->grabOverlay((OverlayColor*)_overlayBackup.pixels, _overlayBackup.w);
setupCursor();
@@ -265,7 +265,7 @@ void VirtualKeyboardGUI::screenChanged() {
_screenW = newScreenW;
_screenH = newScreenH;
- _overlayBackup.create(_screenW, _screenH, sizeof(OverlayColor));
+ _overlayBackup.create(_screenW, _screenH, _system->getOverlayFormat());
_system->grabOverlay((OverlayColor*)_overlayBackup.pixels, _overlayBackup.w);
if (!_kbd->checkModeResolutions()) {
@@ -358,7 +358,7 @@ void VirtualKeyboardGUI::redraw() {
if (w <= 0 || h <= 0) return;
Graphics::Surface surf;
- surf.create(w, h, sizeof(OverlayColor));
+ surf.create(w, h, _system->getOverlayFormat());
OverlayColor *dst = (OverlayColor *)surf.pixels;
const OverlayColor *src = (OverlayColor *) _overlayBackup.getBasePtr(_dirtyRect.left, _dirtyRect.top);
diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp
index 5add387717..2971c8d528 100644
--- a/backends/vkeybd/virtual-keyboard.cpp
+++ b/backends/vkeybd/virtual-keyboard.cpp
@@ -33,6 +33,7 @@
#include "backends/vkeybd/virtual-keyboard-parser.h"
#include "backends/vkeybd/keycode-descriptions.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "common/unzip.h"
#define KEY_START_CHAR ('[')
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index bb2141b110..05e1d2c131 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -23,6 +23,9 @@
*
*/
+// FIXME: Avoid using printf
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
#include "engines/metaengine.h"
#include "base/commandLine.h"
#include "base/plugins.h"
@@ -30,6 +33,7 @@
#include "common/config-manager.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/fs.h"
#include "gui/ThemeEngine.h"
diff --git a/base/commandLine.h b/base/commandLine.h
index c7e8d8b0d0..6205c914e0 100644
--- a/base/commandLine.h
+++ b/base/commandLine.h
@@ -23,11 +23,15 @@
*
*/
-#ifndef BASE_OPTIONS_H
-#define BASE_OPTIONS_H
+#ifndef COMMON_COMMAND_LINE_H
+#define COMMON_COMMAND_LINE_H
-#include "common/str.h"
-#include "common/config-manager.h"
+#include "common/hash-str.h"
+
+namespace Common {
+class Error;
+class String;
+}
namespace Base {
diff --git a/base/internal_version.h b/base/internal_version.h
index 36cdcdeb39..bb25bce4e4 100644
--- a/base/internal_version.h
+++ b/base/internal_version.h
@@ -16,4 +16,4 @@
#define SCUMMVM_REVISION
#endif
-#define SCUMMVM_VERSION "1.3.0git" SCUMMVM_REVISION
+#define SCUMMVM_VERSION "1.4.0git" SCUMMVM_REVISION
diff --git a/base/main.cpp b/base/main.cpp
index 13359031f6..fc4523b895 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -31,6 +31,9 @@
* of almost all the classes, methods and variables, and how they interact.
*/
+// FIXME: Avoid using printf
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
#include "engines/engine.h"
#include "engines/metaengine.h"
#include "base/commandLine.h"
@@ -43,14 +46,13 @@
#include "common/debug-channels.h" /* for debug manager */
#include "common/events.h"
#include "common/EventRecorder.h"
-#include "common/file.h"
#include "common/fs.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/tokenizer.h"
#include "common/translation.h"
#include "gui/gui-manager.h"
-#include "gui/message.h"
#include "gui/error.h"
#include "audio/mididrv.h"
diff --git a/base/plugins.h b/base/plugins.h
index 976e606a8b..d8f1cb96ee 100644
--- a/base/plugins.h
+++ b/base/plugins.h
@@ -27,16 +27,10 @@
#define BASE_PLUGINS_H
#include "common/array.h"
-#include "common/error.h"
-#include "common/singleton.h"
-#include "common/util.h"
+#include "common/fs.h"
+#include "common/str.h"
#include "backends/plugins/elf/version.h"
-namespace Common {
- class FSList;
- class FSNode;
-}
-
/**
* @page pagePlugins An overview of the ScummVM plugin system
diff --git a/common/EventRecorder.cpp b/common/EventRecorder.cpp
index 1dedbb5059..d2ad4bc475 100644
--- a/common/EventRecorder.cpp
+++ b/common/EventRecorder.cpp
@@ -28,6 +28,7 @@
#include "common/config-manager.h"
#include "common/random.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
DECLARE_SINGLETON(Common::EventRecorder);
diff --git a/common/archive.cpp b/common/archive.cpp
index c65408b56e..c2c9c8e702 100644
--- a/common/archive.cpp
+++ b/common/archive.cpp
@@ -25,8 +25,8 @@
#include "common/archive.h"
#include "common/fs.h"
-#include "common/util.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace Common {
diff --git a/common/archive.h b/common/archive.h
index c12ca79be0..375136fa15 100644
--- a/common/archive.h
+++ b/common/archive.h
@@ -27,7 +27,6 @@
#define COMMON_ARCHIVE_H
#include "common/str.h"
-#include "common/hash-str.h"
#include "common/list.h"
#include "common/ptr.h"
#include "common/singleton.h"
diff --git a/common/bufferedstream.h b/common/bufferedstream.h
index dc074422bb..bb09e77d1d 100644
--- a/common/bufferedstream.h
+++ b/common/bufferedstream.h
@@ -27,6 +27,7 @@
#define COMMON_BUFFEREDSTREAM_H
#include "common/stream.h"
+#include "common/types.h"
namespace Common {
diff --git a/common/config-file.cpp b/common/config-file.cpp
index 878d29301f..cd8f0989fc 100644
--- a/common/config-file.cpp
+++ b/common/config-file.cpp
@@ -27,7 +27,7 @@
#include "common/file.h"
#include "common/savefile.h"
#include "common/system.h"
-#include "common/util.h"
+#include "common/textconsole.h"
#define MAXLINELEN 256
diff --git a/common/config-file.h b/common/config-file.h
index 2f7d9cb650..231162fb3c 100644
--- a/common/config-file.h
+++ b/common/config-file.h
@@ -26,13 +26,15 @@
#ifndef COMMON_CONFIG_FILE_H
#define COMMON_CONFIG_FILE_H
-#include "common/config-manager.h"
+#include "common/hash-str.h"
#include "common/list.h"
#include "common/str.h"
-#include "common/stream.h"
namespace Common {
+class SeekableReadStream;
+class WriteStream;
+
/**
* This class allows reading/writing INI style config files.
* It is used by the ConfigManager for storage, but can also
diff --git a/common/config-manager.cpp b/common/config-manager.cpp
index 77c918dcae..5f5c14f8de 100644
--- a/common/config-manager.cpp
+++ b/common/config-manager.cpp
@@ -24,10 +24,11 @@
*/
#include "common/config-manager.h"
+#include "common/debug.h"
#include "common/file.h"
#include "common/fs.h"
-#include "common/util.h"
#include "common/system.h"
+#include "common/textconsole.h"
DECLARE_SINGLETON(Common::ConfigManager);
diff --git a/common/dcl.cpp b/common/dcl.cpp
index ef45bc92ba..efe1de0415 100644
--- a/common/dcl.cpp
+++ b/common/dcl.cpp
@@ -25,11 +25,9 @@
#include "common/dcl.h"
#include "common/debug.h"
-#include "common/debug-channels.h"
-#include "common/endian.h"
#include "common/memstream.h"
#include "common/stream.h"
-#include "common/util.h"
+#include "common/textconsole.h"
namespace Common {
diff --git a/common/debug.cpp b/common/debug.cpp
index c87d195b76..a8711055fd 100644
--- a/common/debug.cpp
+++ b/common/debug.cpp
@@ -24,8 +24,8 @@
#include "common/debug.h"
#include "common/debug-channels.h"
-#include "common/util.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include <stdarg.h> // For va_list etc.
diff --git a/common/error.cpp b/common/error.cpp
index 8fa58e2259..b07e5ebd74 100644
--- a/common/error.cpp
+++ b/common/error.cpp
@@ -24,7 +24,6 @@
*/
#include "common/error.h"
-#include "common/util.h"
#include "common/translation.h"
diff --git a/common/file.cpp b/common/file.cpp
index dec0f2a953..485255bbdb 100644
--- a/common/file.cpp
+++ b/common/file.cpp
@@ -27,8 +27,7 @@
#include "common/debug.h"
#include "common/file.h"
#include "common/fs.h"
-#include "common/util.h"
-#include "common/system.h"
+#include "common/textconsole.h"
namespace Common {
diff --git a/common/file.h b/common/file.h
index d28cd9c308..c3805baed7 100644
--- a/common/file.h
+++ b/common/file.h
@@ -27,6 +27,7 @@
#define COMMON_FILE_H
#include "common/scummsys.h"
+#include "common/fs.h"
#include "common/noncopyable.h"
#include "common/str.h"
#include "common/stream.h"
@@ -34,7 +35,6 @@
namespace Common {
class Archive;
-class FSNode;
/**
* TODO: vital to document this core class properly!!! For both users and implementors
diff --git a/common/forbidden.h b/common/forbidden.h
index 92e662ccc6..c22c646b79 100644
--- a/common/forbidden.h
+++ b/common/forbidden.h
@@ -41,18 +41,22 @@
#ifndef FORBIDDEN_SYMBOL_ALLOW_ALL
+// Make sure scummsys.h is always included first
+#include "common/scummsys.h"
+
+
/**
* The garbage string to use as replacement for forbidden symbols.
*
* The reason for this particular string is the following:
- * By including a space and "!" we try to ensure a compiler error.
- * By using the words "forbidden symbol" we try to make it a bit
- * clearer what is causing the error.
+ * By including a space and some non-alphanumeric symbols we trigger
+ * a compiler error. By including the words "forbidden symbol" (which
+ * the compiler will hopefully print along with its own error message),
+ * we try to make clear what is causing the error.
*/
-#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN SYMBOL!
+#define FORBIDDEN_SYMBOL_REPLACEMENT FORBIDDEN SYMBOL !%*
-/*
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_printf
#undef printf
#define printf FORBIDDEN_SYMBOL_REPLACEMENT
@@ -62,7 +66,16 @@
#undef fprintf
#define fprintf FORBIDDEN_SYMBOL_REPLACEMENT
#endif
-*/
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_vprintf
+#undef vprintf
+#define vprintf FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_vfprintf
+#undef vfprintf
+#define vfprintf FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
#ifndef FORBIDDEN_SYMBOL_EXCEPTION_FILE
#undef FILE
@@ -131,30 +144,102 @@
#endif
+// Disable various symbols from time.h
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_h
+
/*
-time_t
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time_t
+#undef time_t
+#define time_t FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+*/
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_asctime
+#undef asctime
+#define asctime(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_clock
+#undef clock
+#define clock() FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_ctime
+#undef ctime
+#define ctime(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_difftime
+#undef difftime
+#define difftime(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-time
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_getdate
+#undef getdate
+#define getdate(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-difftime
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_gmtime
+#undef gmtime
+#define gmtime(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-mktime
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_localtime
+#undef localtime
+#define localtime(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-localtime
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_mktime
+#undef mktime
+#define mktime(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-clock
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_time
+#undef time
+#define time(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-gmtime
+#endif // FORBIDDEN_SYMBOL_EXCEPTION_time_h
-system
-remove
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_chdir
+#undef chdir
+#define chdir(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-setlocale
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_mkdir
+#undef mkdir
+#define mkdir(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
-setvbuf
+/*
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setlocale
+#undef setlocale
+#define setlocale(a,b) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
*/
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_setvbuf
+#undef setvbuf
+#define setvbuf(a,b,c,d) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+#ifndef FORBIDDEN_SYMBOL_EXCEPTION_unlink
+#undef unlink
+#define unlink(a) FORBIDDEN_SYMBOL_REPLACEMENT
+#endif
+
+/*
+ * We also would like to disable the following symbols;
+ * however, these are also frequently used in regular code,
+ * e.g. for method names, so we don't override them.
+ * - read
+ * - remove
+ * - write
+ * - ...
+ */
+
+
#endif
diff --git a/common/fs.cpp b/common/fs.cpp
index 87067df2cc..d3cdc0697f 100644
--- a/common/fs.cpp
+++ b/common/fs.cpp
@@ -22,8 +22,8 @@
* $Id$
*/
-#include "common/util.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "backends/fs/abstract-fs.h"
#include "backends/fs/fs-factory.h"
diff --git a/common/fs.h b/common/fs.h
index 6b20a05013..f93c11159e 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -27,6 +27,8 @@
#include "common/array.h"
#include "common/archive.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
#include "common/ptr.h"
#include "common/str.h"
diff --git a/common/hashmap.h b/common/hashmap.h
index 233d7f5b16..907a107163 100644
--- a/common/hashmap.h
+++ b/common/hashmap.h
@@ -47,8 +47,6 @@
#include "common/func.h"
-#include "common/str.h"
-#include "common/util.h"
#ifdef DEBUG_HASH_COLLISIONS
#include "common/debug.h"
diff --git a/common/iff_container.h b/common/iff_container.h
index 01fc8017a9..43a551a239 100644
--- a/common/iff_container.h
+++ b/common/iff_container.h
@@ -29,7 +29,7 @@
#include "common/endian.h"
#include "common/func.h"
#include "common/stream.h"
-#include "common/util.h"
+#include "common/textconsole.h"
namespace Common {
diff --git a/common/macresman.cpp b/common/macresman.cpp
index b06d986ca2..489f8f93ce 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -31,7 +31,7 @@
#include "common/macresman.h"
#include "common/md5.h"
#include "common/substream.h"
-#include "common/memstream.h"
+#include "common/textconsole.h"
#ifdef MACOSX
#include "common/config-manager.h"
diff --git a/common/macresman.h b/common/macresman.h
index 2ad0b608a1..fdb3ce491d 100644
--- a/common/macresman.h
+++ b/common/macresman.h
@@ -33,15 +33,14 @@
*/
#include "common/array.h"
-#include "common/file.h"
+#include "common/fs.h"
+#include "common/str.h"
#ifndef COMMON_MACRESMAN_H
#define COMMON_MACRESMAN_H
namespace Common {
-class FSNode;
-
typedef Array<uint16> MacResIDArray;
typedef Array<uint32> MacResTagArray;
diff --git a/common/md5.cpp b/common/md5.cpp
index e4736e85ca..bea9ca0dc5 100644
--- a/common/md5.cpp
+++ b/common/md5.cpp
@@ -28,10 +28,10 @@
* this program is licensed under the GPL.
*/
-#include "common/file.h"
-#include "common/fs.h"
#include "common/md5.h"
#include "common/endian.h"
+#include "common/str.h"
+#include "common/stream.h"
namespace Common {
diff --git a/common/md5.h b/common/md5.h
index 29f3aeeb4c..e613028a5e 100644
--- a/common/md5.h
+++ b/common/md5.h
@@ -26,11 +26,11 @@
#define COMMON_MD5_H
#include "common/scummsys.h"
-#include "common/str.h"
namespace Common {
class ReadStream;
+class String;
/**
* Compute the MD5 checksum of the content of the given ReadStream.
diff --git a/common/memstream.h b/common/memstream.h
index 13b8e26e8a..ac42e1bad9 100644
--- a/common/memstream.h
+++ b/common/memstream.h
@@ -27,6 +27,7 @@
#define COMMON_MEMSTREAM_H
#include "common/stream.h"
+#include "common/types.h"
namespace Common {
diff --git a/common/scummsys.h b/common/scummsys.h
index 6554c70163..46f900b942 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -367,7 +367,7 @@
#if defined(__GNUC__)
#define NORETURN_POST __attribute__((__noreturn__))
#define PACKED_STRUCT __attribute__((__packed__))
- #define GCC_PRINTF(x,y) __attribute__((__format__(printf, x, y)))
+ #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
#if !defined(FORCEINLINE) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
#define FORCEINLINE inline __attribute__((__always_inline__))
@@ -375,7 +375,7 @@
#elif defined(__INTEL_COMPILER)
#define NORETURN_POST __attribute__((__noreturn__))
#define PACKED_STRUCT __attribute__((__packed__))
- #define GCC_PRINTF(x,y) __attribute__((__format__(printf, x, y)))
+ #define GCC_PRINTF(x,y) __attribute__((__format__(__printf__, x, y)))
#else
#define PACKED_STRUCT
#define GCC_PRINTF(x,y)
diff --git a/common/stream.cpp b/common/stream.cpp
index 1be3fbffea..e870e68b2d 100644
--- a/common/stream.cpp
+++ b/common/stream.cpp
@@ -26,9 +26,7 @@
#include "common/stream.h"
#include "common/memstream.h"
#include "common/substream.h"
-#include "common/bufferedstream.h"
#include "common/str.h"
-#include "common/util.h"
namespace Common {
diff --git a/common/stream.h b/common/stream.h
index 65b4971a72..530b50e431 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -26,12 +26,12 @@
#ifndef COMMON_STREAM_H
#define COMMON_STREAM_H
-#include "common/types.h"
#include "common/endian.h"
+#include "common/scummsys.h"
+#include "common/str.h"
namespace Common {
-class String;
class SeekableReadStream;
/**
diff --git a/common/substream.h b/common/substream.h
index 4d90ec5ced..ecf11c54c9 100644
--- a/common/substream.h
+++ b/common/substream.h
@@ -27,6 +27,7 @@
#define COMMON_SUBSTREAM_H
#include "common/stream.h"
+#include "common/types.h"
namespace Common {
diff --git a/common/system.cpp b/common/system.cpp
index 1ec7c14617..4e902bcb14 100644
--- a/common/system.cpp
+++ b/common/system.cpp
@@ -28,6 +28,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/system.h"
+#include "common/str.h"
#ifdef __PLAYSTATION2__
// for those replaced fopen/fread/etc functions
diff --git a/common/system.h b/common/system.h
index c487e727a8..540ffde5a5 100644
--- a/common/system.h
+++ b/common/system.h
@@ -28,29 +28,27 @@
#include "common/scummsys.h"
#include "common/noncopyable.h"
-#include "common/rect.h"
#include "common/list.h" // For OSystem::getSupportedFormats()
-
-#include "graphics/palette.h" // for PaletteManager
#include "graphics/pixelformat.h"
namespace Audio {
- class Mixer;
+class Mixer;
}
namespace Graphics {
- struct Surface;
+struct Surface;
}
namespace Common {
- struct Event;
- class EventManager;
- class SaveFileManager;
- class SearchSet;
- class TimerManager;
- class SeekableReadStream;
- class WriteStream;
- class HardwareKeySet;
+class EventManager;
+struct Rect;
+class SaveFileManager;
+class SearchSet;
+class String;
+class TimerManager;
+class SeekableReadStream;
+class WriteStream;
+class HardwareKeySet;
}
class AudioCDManager;
@@ -363,7 +361,7 @@ public:
/**
* Determine which graphics mode is currently active.
- * @return the active graphics mode
+ * @return the ID of the active graphics mode
*/
virtual int getGraphicsMode() const = 0;
diff --git a/common/textconsole.cpp b/common/textconsole.cpp
index 9c72699914..8d62cd4cb2 100644
--- a/common/textconsole.cpp
+++ b/common/textconsole.cpp
@@ -24,6 +24,7 @@
#include "common/textconsole.h"
#include "common/system.h"
+#include "common/str.h"
namespace Common {
diff --git a/common/translation.cpp b/common/translation.cpp
index 407da2c883..5494849f4c 100644
--- a/common/translation.cpp
+++ b/common/translation.cpp
@@ -32,11 +32,11 @@
#define TRANSLATIONS_DAT_VER 2
#include "common/translation.h"
-#include "common/archive.h"
#include "common/config-manager.h"
#include "common/file.h"
#include "common/fs.h"
#include "common/system.h"
+#include "common/textconsole.h"
#ifdef USE_TRANSLATION
diff --git a/common/translation.h b/common/translation.h
index 523f2f4de7..f8183b6350 100644
--- a/common/translation.h
+++ b/common/translation.h
@@ -25,6 +25,9 @@
#ifndef COMMON_TRANSLATION_H
#define COMMON_TRANSLATION_H
+#include "common/array.h"
+#include "common/fs.h"
+#include "common/str.h"
#include "common/singleton.h"
#include "common/str-array.h"
@@ -33,7 +36,6 @@
namespace Common {
class File;
-class FSNode;
enum TranslationIDs {
kTranslationAutodetectId = 0,
diff --git a/common/unarj.cpp b/common/unarj.cpp
index 2c4225f393..4bda7ac753 100644
--- a/common/unarj.cpp
+++ b/common/unarj.cpp
@@ -30,12 +30,12 @@
#include "common/scummsys.h"
#include "common/archive.h"
#include "common/debug.h"
-#include "common/util.h"
#include "common/unarj.h"
#include "common/file.h"
#include "common/hash-str.h"
#include "common/memstream.h"
#include "common/bufferedstream.h"
+#include "common/textconsole.h"
namespace Common {
diff --git a/common/unarj.h b/common/unarj.h
index fa7d388542..fe23ba5694 100644
--- a/common/unarj.h
+++ b/common/unarj.h
@@ -32,10 +32,11 @@
#ifndef COMMON_UNARJ_H
#define COMMON_UNARJ_H
+#include "common/str.h"
+
namespace Common {
class Archive;
-class String;
/**
* This factory method creates an Archive instance corresponding to the content
diff --git a/common/unzip.cpp b/common/unzip.cpp
index 7b78da0faf..d56893f3cd 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -68,6 +68,8 @@
PkWare has also a specification at :
ftp://ftp.pkware.com/probdesc.zip */
+// Disable symbol overrides so that we can use zlib.h
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/scummsys.h"
@@ -105,7 +107,6 @@ typedef struct {
#include "common/fs.h"
#include "common/unzip.h"
-#include "common/file.h"
#include "common/memstream.h"
#include "common/hashmap.h"
diff --git a/common/unzip.h b/common/unzip.h
index c460840f12..fe7acdcc54 100644
--- a/common/unzip.h
+++ b/common/unzip.h
@@ -25,12 +25,13 @@
#ifndef COMMON_UNZIP_H
#define COMMON_UNZIP_H
+#include "common/str.h"
+
namespace Common {
class Archive;
class FSNode;
class SeekableReadStream;
-class String;
/**
* This factory method creates an Archive instance corresponding to the content
diff --git a/common/util.cpp b/common/util.cpp
index cba921a142..7ffd5e45b1 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -23,9 +23,9 @@
*/
#include "common/util.h"
-#include "common/system.h"
#include "common/translation.h"
#include "common/config-manager.h"
+#include "common/debug.h"
namespace Common {
diff --git a/common/util.h b/common/util.h
index b3dd6a4f64..4493455a8c 100644
--- a/common/util.h
+++ b/common/util.h
@@ -26,7 +26,6 @@
#define COMMON_UTIL_H
#include "common/scummsys.h"
-#include "common/textconsole.h"
#include "common/str.h"
diff --git a/common/winexe.h b/common/winexe.h
index af0d70c555..ce2f19cb81 100644
--- a/common/winexe.h
+++ b/common/winexe.h
@@ -27,11 +27,10 @@
#define COMMON_WINEXE_H
#include "common/hash-str.h"
+#include "common/str.h"
namespace Common {
-class String;
-
class WinResourceID {
public:
WinResourceID() { _idType = kIDTypeNull; }
diff --git a/common/winexe_ne.h b/common/winexe_ne.h
index c1d04080ba..2988132040 100644
--- a/common/winexe_ne.h
+++ b/common/winexe_ne.h
@@ -26,15 +26,14 @@
#ifndef COMMON_WINEXE_NE_H
#define COMMON_WINEXE_NE_H
-#include "common/array.h"
#include "common/list.h"
+#include "common/str.h"
#include "common/winexe.h"
namespace Common {
-class MemoryReadStream;
+template<class T> class Array;
class SeekableReadStream;
-class String;
/** The default Windows resources. */
enum NEResourceType {
diff --git a/common/winexe_pe.cpp b/common/winexe_pe.cpp
index 99d44cabbd..6bb831b9c6 100644
--- a/common/winexe_pe.cpp
+++ b/common/winexe_pe.cpp
@@ -23,9 +23,10 @@
*
*/
+#include "common/array.h"
#include "common/debug.h"
+#include "common/endian.h"
#include "common/file.h"
-#include "common/memstream.h"
#include "common/str.h"
#include "common/stream.h"
#include "common/winexe_pe.h"
diff --git a/common/winexe_pe.h b/common/winexe_pe.h
index 5298e993ad..60c4adb916 100644
--- a/common/winexe_pe.h
+++ b/common/winexe_pe.h
@@ -26,14 +26,15 @@
#ifndef COMMON_WINEXE_PE_H
#define COMMON_WINEXE_PE_H
-#include "common/array.h"
+#include "common/hash-str.h"
#include "common/hashmap.h"
+#include "common/str.h"
#include "common/winexe.h"
namespace Common {
+template<class T> class Array;
class SeekableReadStream;
-class String;
/** The default Windows PE resources. */
enum PEResourceType {
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp
index b53a9a33c2..e2e1dbdfc7 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -23,8 +23,14 @@
*
*/
+// FIXME: Avoid using fprintf
+#define FORBIDDEN_SYMBOL_EXCEPTION_fprintf
+
+// FIXME: Avoid using vfprintf
+#define FORBIDDEN_SYMBOL_EXCEPTION_vfprintf
+
+
#include "common/xmlparser.h"
-#include "common/util.h"
#include "common/archive.h"
#include "common/fs.h"
#include "common/memstream.h"
diff --git a/common/xmlparser.h b/common/xmlparser.h
index ec8f371681..c456fd0826 100644
--- a/common/xmlparser.h
+++ b/common/xmlparser.h
@@ -29,6 +29,7 @@
#include "common/scummsys.h"
#include "common/types.h"
+#include "common/fs.h"
#include "common/list.h"
#include "common/hashmap.h"
#include "common/hash-str.h"
@@ -37,7 +38,6 @@
namespace Common {
-class FSNode;
class SeekableReadStream;
#define MAX_XML_DEPTH 8
diff --git a/common/zlib.cpp b/common/zlib.cpp
index 98ecc10c1d..96e9f8cb15 100644
--- a/common/zlib.cpp
+++ b/common/zlib.cpp
@@ -23,6 +23,9 @@
*
*/
+// Disable symbol overrides so that we can use zlib.h
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
#include "common/zlib.h"
#include "common/util.h"
#include "common/stream.h"
diff --git a/configure b/configure
index 851ebf83e1..d7b6338c08 100755
--- a/configure
+++ b/configure
@@ -252,12 +252,7 @@ EOF
}
gcc_get_define() {
- # Note: The AmigaOS compiler doesn't like the "-" input file, so a real file
- # is used instead
- rm -f $TMPC
- touch $TMPC
- $CXX -dM -E $TMPC | fgrep "$1" | head -n1 | cut -d ' ' -f 3-
- rm -f $TMPC
+ echo "" | $CXX -dM -E - | fgrep "$1" | head -n1 | cut -d ' ' -f 3-
}
#
@@ -1143,6 +1138,10 @@ webos)
_host_os=webos
_host_cpu=arm
_host_alias=arm-none-linux-gnueabi
+ test "x$prefix" = xNONE && prefix=/media/cryptofs/apps/usr/palm/applications/org.scummvm.scummvm
+ datarootdir='${prefix}/data'
+ datadir='${datarootdir}'
+ docdir='${prefix}/doc'
;;
wii)
_host_os=wii
@@ -1519,8 +1518,7 @@ echo_n "Checking hosttype... "
echo $_host_os
case $_host_os in
amigaos*)
- CXXFLAGS="$CXXFLAGS -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400"
- LDFLAGS="$LDFLAGS -mcrt=newlib -use-dynld -L/sdk/local/newlib/lib"
+ LDFLAGS="$LDFLAGS -use-dynld -L/sdk/local/newlib/lib"
# We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32
# as (unsigned) long, and consequently we'd get a compiler error otherwise.
type_4_byte='long'
@@ -1672,6 +1670,8 @@ case $_host_os in
_unix=yes
;;
webos)
+ CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include -I$WEBOS_PDK/include/SDL -I$WEBOS_PDK/device/usr/include"
+ CXXFLAGS="$CXXFLAGS -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp"
LDFLAGS="$LDFLAGS -L$WEBOS_PDK/device/lib -L$WEBOS_PDK/device/usr/lib"
LDFLAGS="$LDFLAGS -Wl,--allow-shlib-undefined"
LDFLAGS="$LDFLAGS --sysroot=$WEBOS_PDK/arm-gcc/sysroot"
@@ -1969,6 +1969,7 @@ if test -n "$_host"; then
;;
ppc-amigaos)
_endian=big
+ # AmigaOS exec allocates memory always in an aligned way
_need_memalign=yes
;;
ps2)
@@ -2931,6 +2932,9 @@ case $_backend in
# Add ../plugins as a path so plugins can be found when running from a .PND.
DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"../plugins\\\""
;;
+ webos)
+ DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$libdir\\\""
+ ;;
*)
DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$libdir/scummvm\\\""
;;
@@ -3109,7 +3113,6 @@ case $_backend in
DEFINES="$DEFINES -DSDL_BACKEND"
;;
webos)
- INCLUDES="$INCLUDES -I$WEBOS_PDK/include -I$WEBOS_PDK/include/SDL -I$WEBOS_PDK/device/usr/include"
LIBS="$LIBS -lSDL -lpdl"
DEFINES="$DEFINES -DSDL_BACKEND -DWEBOS"
MODULES="$MODULES backends/platform/sdl"
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 3f28790a6e..7d112c7ffe 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -298,20 +298,12 @@ int main(int argc, char *argv[]) {
setup.libraries.push_back(ADDITIONAL_LIBRARY);
#endif
-// Initialize global & project-specific warnings
-#define SET_GLOBAL_WARNINGS(...) \
- { \
- std::string global[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \
- globalWarnings.assign(global, global + (sizeof(global) / sizeof(global[0]))); \
- }
-
-#define SET_WARNINGS(name, ...) \
- { \
- std::string project[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \
- projectWarnings[name].assign(project, project + (sizeof(project) / sizeof(project[0]))); \
- }
-
// List of global warnings and map of project-specific warnings
+ // FIXME: As shown below these two structures have different behavior for
+ // Code::Blocks and MSVC. In Code::Blocks this is used to enable *and*
+ // disable certain warnings (and some other not warning related flags
+ // actually...). While in MSVC this is solely for disabling warnings.
+ // That is really not nice. We should consider a nicer way of doing this.
StringList globalWarnings;
std::map<std::string, StringList> projectWarnings;
@@ -345,9 +337,23 @@ int main(int argc, char *argv[]) {
//
////////////////////////////////////////////////////////////////////////////
- SET_GLOBAL_WARNINGS("-Wall", "-Wno-long-long", "-Wno-multichar", "-Wno-unknown-pragmas", "-Wno-reorder",
- "-Wpointer-arith", "-Wcast-qual", "-Wcast-align", "-Wshadow", "-Wimplicit",
- "-Wnon-virtual-dtor", "-Wwrite-strings", "-fno-rtti", "-fno-exceptions", "-fcheck-new");
+ globalWarnings.push_back("-Wall");
+ globalWarnings.push_back("-Wno-long-long");
+ globalWarnings.push_back("-Wno-multichar");
+ globalWarnings.push_back("-Wno-unknown-pragmas");
+ globalWarnings.push_back("-Wno-reorder");
+ globalWarnings.push_back("-Wpointer-arith");
+ globalWarnings.push_back("-Wcast-qual");
+ globalWarnings.push_back("-Wcast-align");
+ globalWarnings.push_back("-Wshadow");
+ globalWarnings.push_back("-Wimplicit");
+ globalWarnings.push_back("-Wnon-virtual-dtor");
+ globalWarnings.push_back("-Wwrite-strings");
+ // The following are not warnings at all... We should consider adding them to
+ // a different list of parameters.
+ globalWarnings.push_back("-fno-rtti");
+ globalWarnings.push_back("-fno-exceptions");
+ globalWarnings.push_back("-fcheck-new");
provider = new CreateProjectTool::CodeBlocksProvider(globalWarnings, projectWarnings);
@@ -424,12 +430,35 @@ int main(int argc, char *argv[]) {
//
////////////////////////////////////////////////////////////////////////////
- SET_GLOBAL_WARNINGS("4068", "4100", "4103", "4127", "4244", "4250", "4310", "4351", "4512", "4702", "4706", "4800", "4996", "6204", "6211", "6385", "6386");
- SET_WARNINGS("agi", "4510", "4610");
- SET_WARNINGS("agos", "4511");
- SET_WARNINGS("lure", "4189", "4355");
- SET_WARNINGS("kyra", "4355");
- SET_WARNINGS("m4", "4355");
+ globalWarnings.push_back("4068");
+ globalWarnings.push_back("4100");
+ globalWarnings.push_back("4103");
+ globalWarnings.push_back("4127");
+ globalWarnings.push_back("4244");
+ globalWarnings.push_back("4250");
+ globalWarnings.push_back("4310");
+ globalWarnings.push_back("4351");
+ globalWarnings.push_back("4512");
+ globalWarnings.push_back("4702");
+ globalWarnings.push_back("4706");
+ globalWarnings.push_back("4800");
+ globalWarnings.push_back("4996");
+ globalWarnings.push_back("6204");
+ globalWarnings.push_back("6211");
+ globalWarnings.push_back("6385");
+ globalWarnings.push_back("6386");
+
+ projectWarnings["agi"].push_back("4510");
+ projectWarnings["agi"].push_back("4610");
+
+ projectWarnings["agos"].push_back("4511");
+
+ projectWarnings["lure"].push_back("4189");
+ projectWarnings["lure"].push_back("4355");
+
+ projectWarnings["kyra"].push_back("4355");
+
+ projectWarnings["m4"].push_back("4355");
if (msvcVersion == 8 || msvcVersion == 9)
provider = new CreateProjectTool::VisualStudioProvider(globalWarnings, projectWarnings, msvcVersion);
@@ -714,6 +743,7 @@ const Feature s_features[] = {
{ "opengl", "USE_OPENGL", "opengl32", true, "OpenGL support" },
{ "indeo3", "USE_INDEO3", "", true, "Indeo3 codec support"},
{ "translation", "USE_TRANSLATION", "", true, "Translation support" },
+ { "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"},
{ "langdetect", "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there
// is just no current way of properly detecting this...
};
@@ -802,9 +832,10 @@ bool producesObjectFile(const std::string &fileName) {
* Checks whether the give file in the specified directory is present in the given
* file list.
*
- * This function does as special match against the file list. It will not take file
- * extensions into consideration, when the extension of a file in the specified
- * directory is one of "h", "cpp", "c" or "asm".
+ * This function does as special match against the file list. Object files (.o) are
+ * excluded by default and it will not take file extensions into consideration,
+ * when the extension of a file in the specified directory is one of "h", "cpp",
+ * "c" or "asm".
*
* @param dir Parent directory of the file.
* @param fileName File name to match.
@@ -834,7 +865,9 @@ bool isInList(const std::string &dir, const std::string &fileName, const StringL
}
const std::string lastPathComponent = getLastPathComponent(*i);
- if (!producesObjectFile(fileName) && extensionName != "h") {
+ if (extensionName == "o") {
+ return false;
+ } else if (!producesObjectFile(fileName) && extensionName != "h") {
if (fileName == lastPathComponent)
return true;
} else {
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 8968610e99..e4ccd7313a 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -32,34 +32,6 @@
#include <cassert>
-// The PP_NARG macro returns the number of arguments that have been passed to it.
-#define PP_NARG(...) \
- PP_NARG_(__VA_ARGS__,PP_RSEQ_N())
-#define PP_NARG_(...) \
- PP_ARG_N(__VA_ARGS__)
-#define PP_ARG_N( \
- _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \
- _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \
- _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \
- _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \
- _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \
- _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \
- _61,_62,_63,N,...) N
-#define PP_RSEQ_N() \
- 63,62,61,60, \
- 59,58,57,56,55,54,53,52,51,50, \
- 49,48,47,46,45,44,43,42,41,40, \
- 39,38,37,36,35,34,33,32,31,30, \
- 29,28,27,26,25,24,23,22,21,20, \
- 19,18,17,16,15,14,13,12,11,10, \
- 9,8,7,6,5,4,3,2,1,0
-
-#define SET_VALUES(list, ...) \
- { \
- std::string values[PP_NARG(__VA_ARGS__)] = { __VA_ARGS__ }; \
- list.assign(values, values + (sizeof(values) / sizeof(values[0]))); \
- }
-
typedef std::list<std::string> StringList;
/**
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 36ea710c82..4b8276da6f 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -52,22 +52,29 @@ int MSBuildProvider::getVisualStudioVersion() {
return 2010;
}
-#define OUTPUT_CONFIGURATION_MSBUILD(config, platform) \
- (project << "\t\t<ProjectConfiguration Include=\"" << config << "|" << platform << "\">\n" \
- "\t\t\t<Configuration>" << config << "</Configuration>\n" \
- "\t\t\t<Platform>" << platform << "</Platform>\n" \
- "\t\t</ProjectConfiguration>\n")
-
-#define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \
- (project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n" \
- "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \
- "\t</PropertyGroup>\n")
-
-#define OUTPUT_PROPERTIES_MSBUILD(config, properties) \
- (project << "\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"PropertySheets\">\n" \
- "\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n" \
- "\t\t<Import Project=\"" << properties << "\" />\n" \
- "\t</ImportGroup>\n")
+namespace {
+
+inline void outputConfiguration(std::ostream &project, const std::string &config, const std::string &platform) {
+ project << "\t\t<ProjectConfiguration Include=\"" << config << "|" << platform << "\">\n"
+ "\t\t\t<Configuration>" << config << "</Configuration>\n"
+ "\t\t\t<Platform>" << platform << "</Platform>\n"
+ "\t\t</ProjectConfiguration>\n";
+}
+
+inline void outputConfigurationType(std::ostream &project, const std::string &name, const std::string &config) {
+ project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n"
+ "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n"
+ "\t</PropertyGroup>\n";
+}
+
+inline void outputProperties(std::ostream &project, const std::string &config, const std::string &properties) {
+ project << "\t<ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"PropertySheets\">\n"
+ "\t\t<Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n"
+ "\t\t<Import Project=\"" << properties << "\" />\n"
+ "\t</ImportGroup>\n";
+}
+
+} // End of anonymous namespace
void MSBuildProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList) {
@@ -80,12 +87,12 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
"<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
"\t<ItemGroup Label=\"ProjectConfigurations\">\n";
- OUTPUT_CONFIGURATION_MSBUILD("Debug", "Win32");
- OUTPUT_CONFIGURATION_MSBUILD("Debug", "x64");
- OUTPUT_CONFIGURATION_MSBUILD("Analysis", "Win32");
- OUTPUT_CONFIGURATION_MSBUILD("Analysis", "x64");
- OUTPUT_CONFIGURATION_MSBUILD("Release", "Win32");
- OUTPUT_CONFIGURATION_MSBUILD("Release", "x64");
+ outputConfiguration(project, "Debug", "Win32");
+ outputConfiguration(project, "Debug", "x64");
+ outputConfiguration(project, "Analysis", "Win32");
+ outputConfiguration(project, "Analysis", "x64");
+ outputConfiguration(project, "Release", "Win32");
+ outputConfiguration(project, "Release", "x64");
project << "\t</ItemGroup>\n";
@@ -99,23 +106,23 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
// Shared configuration
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n";
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|Win32");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|Win32");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|Win32");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Release|x64");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Analysis|x64");
- OUTPUT_CONFIGURATION_TYPE_MSBUILD("Debug|x64");
+ outputConfigurationType(project, name, "Release|Win32");
+ outputConfigurationType(project, name, "Analysis|Win32");
+ outputConfigurationType(project, name, "Debug|Win32");
+ outputConfigurationType(project, name, "Release|x64");
+ outputConfigurationType(project, name, "Analysis|x64");
+ outputConfigurationType(project, name, "Debug|x64");
project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n"
"\t<ImportGroup Label=\"ExtensionSettings\">\n"
"\t</ImportGroup>\n";
- OUTPUT_PROPERTIES_MSBUILD("Release|Win32", PROJECT_DESCRIPTION "_Release.props");
- OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props");
- OUTPUT_PROPERTIES_MSBUILD("Debug|Win32", PROJECT_DESCRIPTION "_Debug.props");
- OUTPUT_PROPERTIES_MSBUILD("Release|x64", PROJECT_DESCRIPTION "_Release64.props");
- OUTPUT_PROPERTIES_MSBUILD("Analysis|x64", PROJECT_DESCRIPTION "_Analysis64.props");
- OUTPUT_PROPERTIES_MSBUILD("Debug|x64", PROJECT_DESCRIPTION "_Debug64.props");
+ outputProperties(project, "Release|Win32", PROJECT_DESCRIPTION "_Release.props");
+ outputProperties(project, "Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props");
+ outputProperties(project, "Debug|Win32", PROJECT_DESCRIPTION "_Debug.props");
+ outputProperties(project, "Release|x64", PROJECT_DESCRIPTION "_Release64.props");
+ outputProperties(project, "Analysis|x64", PROJECT_DESCRIPTION "_Analysis64.props");
+ outputProperties(project, "Debug|x64", PROJECT_DESCRIPTION "_Debug64.props");
project << "\t<PropertyGroup Label=\"UserMacros\" />\n";
@@ -153,21 +160,6 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
createFiltersFile(setup, name);
}
-#define OUTPUT_FILTER_MSBUILD(files, action) \
- if (!files.empty()) { \
- filters << "\t<ItemGroup>\n"; \
- for (std::list<FileEntry>::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \
- if ((*entry).filter != "") { \
- filters << "\t\t<" action " Include=\"" << (*entry).path << "\">\n" \
- "\t\t\t<Filter>" << (*entry).filter << "</Filter>\n" \
- "\t\t</" action ">\n"; \
- } else { \
- filters << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \
- } \
- } \
- filters << "\t</ItemGroup>\n"; \
- }
-
void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::string &name) {
// No filters => no need to create a filter file
if (_filters.empty())
@@ -199,15 +191,31 @@ void MSBuildProvider::createFiltersFile(const BuildSetup &setup, const std::stri
filters << "\t</ItemGroup>\n";
// Output files
- OUTPUT_FILTER_MSBUILD(_compileFiles, "ClCompile")
- OUTPUT_FILTER_MSBUILD(_includeFiles, "ClInclude")
- OUTPUT_FILTER_MSBUILD(_otherFiles, "None")
- OUTPUT_FILTER_MSBUILD(_resourceFiles, "ResourceCompile")
- OUTPUT_FILTER_MSBUILD(_asmFiles, "CustomBuild")
+ outputFilter(filters, _compileFiles, "ClCompile");
+ outputFilter(filters, _includeFiles, "ClInclude");
+ outputFilter(filters, _otherFiles, "None");
+ outputFilter(filters, _resourceFiles, "ResourceCompile");
+ outputFilter(filters, _asmFiles, "CustomBuild");
filters << "</Project>";
}
+void MSBuildProvider::outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action) {
+ if (!files.empty()) {
+ filters << "\t<ItemGroup>\n";
+ for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) {
+ if ((*entry).filter != "") {
+ filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\">\n"
+ "\t\t\t<Filter>" << (*entry).filter << "</Filter>\n"
+ "\t\t</" << action << ">\n";
+ } else {
+ filters << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n";
+ }
+ }
+ filters << "\t</ItemGroup>\n";
+ }
+}
+
void MSBuildProvider::writeReferences(std::ofstream &output) {
output << "\t<ItemGroup>\n";
@@ -398,19 +406,6 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b
properties.close();
}
-#define OUTPUT_NASM_COMMAND_MSBUILD(config) \
- projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj\" \"%(FullPath)\"</Command>\n" \
- "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << (isDuplicate ? (*entry).prefix : "") << "%(Filename).obj;%(Outputs)</Outputs>\n";
-
-#define OUPUT_FILES_MSBUILD(files, action) \
- if (!files.empty()) { \
- projectFile << "\t<ItemGroup>\n"; \
- for (std::list<FileEntry>::const_iterator entry = files.begin(); entry != files.end(); ++entry) { \
- projectFile << "\t\t<" action " Include=\"" << (*entry).path << "\" />\n"; \
- } \
- projectFile << "\t</ItemGroup>\n"; \
- }
-
bool hasEnding(std::string const &fullString, std::string const &ending) {
if (fullString.length() > ending.length()) {
return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending));
@@ -419,6 +414,14 @@ bool hasEnding(std::string const &fullString, std::string const &ending) {
}
}
+namespace {
+
+inline void outputNasmCommand(std::ostream &projectFile, const std::string &config, const std::string &prefix) {
+ projectFile << "\t\t\t<Command Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">nasm.exe -f win32 -g -o \"$(IntDir)" << prefix << "%(Filename).obj\" \"%(FullPath)\"</Command>\n"
+ "\t\t\t<Outputs Condition=\"'$(Configuration)|$(Platform)'=='" << config << "|Win32'\">$(IntDir)" << prefix << "%(Filename).obj;%(Outputs)</Outputs>\n";
+}
+
+} // End of anonymous namespace
void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream &projectFile, const int, const StringList &duplicate,
const std::string &objPrefix, const std::string &filePrefix) {
@@ -455,9 +458,9 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
}
// Output include, other and resource files
- OUPUT_FILES_MSBUILD(_includeFiles, "ClInclude")
- OUPUT_FILES_MSBUILD(_otherFiles, "None")
- OUPUT_FILES_MSBUILD(_resourceFiles, "ResourceCompile")
+ outputFiles(projectFile, _includeFiles, "ClInclude");
+ outputFiles(projectFile, _otherFiles, "None");
+ outputFiles(projectFile, _resourceFiles, "ResourceCompile");
// Output asm files
if (!_asmFiles.empty()) {
@@ -469,9 +472,9 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
projectFile << "\t\t<CustomBuild Include=\"" << (*entry).path << "\">\n"
"\t\t\t<FileType>Document</FileType>\n";
- OUTPUT_NASM_COMMAND_MSBUILD("Debug")
- OUTPUT_NASM_COMMAND_MSBUILD("Analysis")
- OUTPUT_NASM_COMMAND_MSBUILD("Release")
+ outputNasmCommand(projectFile, "Debug", (isDuplicate ? (*entry).prefix : ""));
+ outputNasmCommand(projectFile, "Analysis", (isDuplicate ? (*entry).prefix : ""));
+ outputNasmCommand(projectFile, "Release", (isDuplicate ? (*entry).prefix : ""));
projectFile << "\t\t</CustomBuild>\n";
}
@@ -479,6 +482,16 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
}
}
+void MSBuildProvider::outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action) {
+ if (!files.empty()) {
+ projectFile << "\t<ItemGroup>\n";
+ for (FileEntries::const_iterator entry = files.begin(), end = files.end(); entry != end; ++entry) {
+ projectFile << "\t\t<" << action << " Include=\"" << (*entry).path << "\" />\n";
+ }
+ projectFile << "\t</ItemGroup>\n";
+ }
+}
+
void MSBuildProvider::computeFileList(const FileNode &dir, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix) {
for (FileNode::NodeList::const_iterator i = dir.children.begin(); i != dir.children.end(); ++i) {
const FileNode *node = *i;
diff --git a/devtools/create_project/msbuild.h b/devtools/create_project/msbuild.h
index cc545e4755..98bb65e19b 100644
--- a/devtools/create_project/msbuild.h
+++ b/devtools/create_project/msbuild.h
@@ -75,6 +75,9 @@ private:
void computeFileList(const FileNode &dir, const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix);
void createFiltersFile(const BuildSetup &setup, const std::string &name);
+
+ void outputFilter(std::ostream &filters, const FileEntries &files, const std::string &action);
+ void outputFiles(std::ostream &projectFile, const FileEntries &files, const std::string &action);
};
} // End of CreateProjectTool namespace
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index a9ffecabcf..da61afcc3c 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -39,6 +39,8 @@ xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1
xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1
xcopy /F /Y "%~4/README-SDL" %~2 > NUL 2>&1
+xcopy /F /Y "%~1/backends/vkeybd/packs/vkeybd_default.zip" %~2 > NUL 2>&1
+
if "%~5"=="0" goto done
echo Running installer script
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index e405e42e54..f0901907e2 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -57,42 +57,6 @@ int VisualStudioProvider::getVisualStudioVersion() {
error("Unsupported version passed to getVisualStudioVersion");
}
-#define OUTPUT_BUILD_EVENTS(isWin32) \
- if (setup.runBuildEvents) { \
- project << "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n" \
- "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n" \
- "\t\t\t/>\n" \
- "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n" \
- "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32, setup.createInstaller) << "\"\n" \
- "\t\t\t/>\n"; \
- }
-
-#define OUTPUT_CONFIGURATION_MAIN(config, platform, props, isWin32) { \
- project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
- "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
- "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n" \
- "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
- "\t\t\t/>\n"; \
- OUTPUT_BUILD_EVENTS(isWin32) \
- project << "\t\t</Configuration>\n"; \
-}
-
-#define OUTPUT_CONFIGURATION_DEBUG(config, platform, props, isWin32) { \
- project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
- "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
- "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << ".exe\"\n" \
- "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
- "\t\t\t/>\n"; \
- OUTPUT_BUILD_EVENTS(isWin32) \
- project << "\t\t</Configuration>\n"; \
-}
-
-#define OUTPUT_CONFIGURATION(config, platform, props) { \
- project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
- "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" \
- "\t\t</Configuration>\n"; \
-}
-
void VisualStudioProvider::createProjectFile(const std::string &name, const std::string &uuid, const BuildSetup &setup, const std::string &moduleDir,
const StringList &includeList, const StringList &excludeList) {
const std::string projectFile = setup.outputDir + '/' + name + getProjectExtension();
@@ -129,17 +93,17 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
libraries += ' ' + *i + ".lib";
// Win32
- OUTPUT_CONFIGURATION_DEBUG("Debug", "Win32", "", true);
- OUTPUT_CONFIGURATION_DEBUG("Analysis", "Win32", "", true);
- OUTPUT_CONFIGURATION_MAIN("Release", "Win32", "", true);
+ outputConfiguration(project, setup, libraries, "Debug", "Win32", "", true);
+ outputConfiguration(project, setup, libraries, "Analysis", "Win32", "", true);
+ outputConfiguration(project, setup, libraries, "Release", "Win32", "", true);
// x64
// For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and
// re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the
// libraries list created for IA-32. If that changes in the future, we need to adjust this part!
- OUTPUT_CONFIGURATION_DEBUG("Debug", "x64", "64", false);
- OUTPUT_CONFIGURATION_DEBUG("Analysis", "x64", "64", false);
- OUTPUT_CONFIGURATION_MAIN("Release", "x64", "64", false);
+ outputConfiguration(project, setup, libraries, "Debug", "x64", "64", false);
+ outputConfiguration(project, setup, libraries, "Analysis", "x64", "64", false);
+ outputConfiguration(project, setup, libraries, "Release", "x64", "64", false);
} else {
std::string warnings = "";
@@ -154,12 +118,12 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
toolConfig += (name == "grim" ? "DisableLanguageExtensions=\"false\" " : "");
// Win32
- OUTPUT_CONFIGURATION("Debug", "Win32", "");
- OUTPUT_CONFIGURATION("Analysis", "Win32", "");
- OUTPUT_CONFIGURATION("Release", "Win32", "");
- OUTPUT_CONFIGURATION("Debug", "x64", "64");
- OUTPUT_CONFIGURATION("Analysis", "x64", "64");
- OUTPUT_CONFIGURATION("Release", "x64", "64");
+ outputConfiguration(project, toolConfig, "Debug", "Win32", "");
+ outputConfiguration(project, toolConfig, "Analysis", "Win32", "");
+ outputConfiguration(project, toolConfig, "Release", "Win32", "");
+ outputConfiguration(project, toolConfig, "Debug", "x64", "64");
+ outputConfiguration(project, toolConfig, "Analysis", "x64", "64");
+ outputConfiguration(project, toolConfig, "Release", "x64", "64");
}
project << "\t</Configurations>\n"
@@ -181,6 +145,33 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
"</VisualStudioProject>\n";
}
+void VisualStudioProvider::outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const std::string &platform, const std::string &props, const bool isWin32) {
+ project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n"
+ "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n"
+ "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n"
+ "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n"
+ "\t\t\t/>\n";
+ outputBuildEvents(project, setup, isWin32);
+ project << "\t\t</Configuration>\n";
+}
+
+void VisualStudioProvider::outputConfiguration(std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props) {
+ project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n"
+ "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n"
+ "\t\t</Configuration>\n";
+}
+
+void VisualStudioProvider::outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32) {
+ if (setup.runBuildEvents) {
+ project << "\t\t\t<Tool\tName=\"VCPreBuildEventTool\"\n"
+ "\t\t\t\tCommandLine=\"" << getPreBuildEvent() << "\"\n"
+ "\t\t\t/>\n"
+ "\t\t\t<Tool\tName=\"VCPostBuildEventTool\"\n"
+ "\t\t\t\tCommandLine=\"" << getPostBuildEvent(isWin32, setup.createInstaller) << "\"\n"
+ "\t\t\t/>\n";
+ }
+}
+
void VisualStudioProvider::writeReferences(std::ofstream &output) {
output << "\tProjectSection(ProjectDependencies) = postProject\n";
@@ -298,7 +289,7 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea
"\t\tRuntimeLibrary=\"1\"\n"
"\t\tEnableFunctionLevelLinking=\"true\"\n"
"\t\tWarnAsError=\"false\"\n"
- "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3"
+ "\t\tDebugInformationFormat=\"" << (isWin32 ? "4" : "3") << "\"\n" // For x64 format "4" (Edit and continue) is not supported, thus we default to "3"
"\t\tAdditionalOption=\"" << (enableAnalysis ? "/analyze" : "") << "\"\n"
"\t/>\n"
"\t<Tool\n"
diff --git a/devtools/create_project/visualstudio.h b/devtools/create_project/visualstudio.h
index a1d5c76b01..0e4b441e63 100644
--- a/devtools/create_project/visualstudio.h
+++ b/devtools/create_project/visualstudio.h
@@ -50,6 +50,10 @@ protected:
const char *getProjectExtension();
const char *getPropertiesExtension();
int getVisualStudioVersion();
+
+ void outputConfiguration(std::ostream &project, const BuildSetup &setup, const std::string &libraries, const std::string &config, const std::string &platform, const std::string &props, const bool isWin32);
+ void outputConfiguration(std::ostream &project, const std::string &toolConfig, const std::string &config, const std::string &platform, const std::string &props);
+ void outputBuildEvents(std::ostream &project, const BuildSetup &setup, const bool isWin32);
};
} // End of CreateProjectTool namespace
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 94f72617af..c45f16eec9 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -960,7 +960,7 @@ begin_credits("Credits");
add_person("Eugene Sandulenko", "sev", "");
end_section();
begin_section("Spanish");
- add_person("Tom&aacute;s Maidagan", "Truido", "");
+ add_person("Tom&aacute;s Maidagan", "", "");
end_section();
begin_section("Swedish");
add_person("Hampus Flink", "", "");
diff --git a/dists/android/AndroidManifest.xml b/dists/android/AndroidManifest.xml
index cae1f369e7..1bc784cc4c 100644
--- a/dists/android/AndroidManifest.xml
+++ b/dists/android/AndroidManifest.xml
@@ -4,7 +4,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.inodes.gus.scummvm"
android:versionCode="@ANDROID_VERSIONCODE@"
- android:versionName="1.3.0git"
+ android:versionName="1.4.0git"
android:installLocation="preferExternal">
<!-- This version works on Android 1.5 (SDK 3) and newer, but we
diff --git a/dists/android/plugin-manifest.xml b/dists/android/plugin-manifest.xml
index 2442d3f32a..3fd9e393d0 100644
--- a/dists/android/plugin-manifest.xml
+++ b/dists/android/plugin-manifest.xml
@@ -3,7 +3,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.inodes.gus.scummvm.plugin.@PLUGIN_NAME@"
android:versionCode="@PLUGIN_VERSION_CODE@"
- android:versionName="1.3.0git"
+ android:versionName="1.4.0git"
android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" />
diff --git a/dists/iphone/Info.plist b/dists/iphone/Info.plist
index f18cc61ede..e57989a7c3 100644
--- a/dists/iphone/Info.plist
+++ b/dists/iphone/Info.plist
@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.3.0git</string>
+ <string>1.4.0git</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.3.0git</string>
+ <string>1.4.0git</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIconFiles</key>
diff --git a/dists/irix/scummvm.spec b/dists/irix/scummvm.spec
index b6b1524a42..141d37070f 100644
--- a/dists/irix/scummvm.spec
+++ b/dists/irix/scummvm.spec
@@ -1,5 +1,5 @@
product scummvm
- id "ScummVM 1.3.0git"
+ id "ScummVM 1.4.0git"
image sw
id "software"
version 18
diff --git a/dists/macosx/Info.plist b/dists/macosx/Info.plist
index 9e19926f3f..20081ccc80 100644
--- a/dists/macosx/Info.plist
+++ b/dists/macosx/Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>scummvm</string>
<key>CFBundleGetInfoString</key>
- <string>1.3.0git, Copyright 2001-2011 The ScummVM team</string>
+ <string>1.4.0git, Copyright 2001-2011 The ScummVM team</string>
<key>CFBundleIconFile</key>
<string>scummvm.icns</string>
<key>CFBundleIdentifier</key>
@@ -21,9 +21,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.3.0git</string>
+ <string>1.4.0git</string>
<key>CFBundleVersion</key>
- <string>1.3.0git</string>
+ <string>1.4.0git</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHumanReadableCopyright</key>
diff --git a/dists/redhat/scummvm-tools.spec b/dists/redhat/scummvm-tools.spec
index b034e4479e..72b1ac701f 100644
--- a/dists/redhat/scummvm-tools.spec
+++ b/dists/redhat/scummvm-tools.spec
@@ -7,7 +7,7 @@
# Prologue information
#------------------------------------------------------------------------------
Name : scummvm-tools
-Version : 1.3.0git
+Version : 1.4.0git
Release : 1
Summary : ScummVM-related tools
Group : Interpreters
diff --git a/dists/redhat/scummvm.spec b/dists/redhat/scummvm.spec
index d0d273fc66..777e0afc8a 100644
--- a/dists/redhat/scummvm.spec
+++ b/dists/redhat/scummvm.spec
@@ -7,7 +7,7 @@
# Prologue information
#------------------------------------------------------------------------------
Name : scummvm
-Version : 1.3.0git
+Version : 1.4.0git
Release : 1
Summary : Graphic adventure game interpreter
Group : Interpreters
diff --git a/dists/scummvm.rc b/dists/scummvm.rc
index 61981b30c5..15dd04c0d9 100644
--- a/dists/scummvm.rc
+++ b/dists/scummvm.rc
@@ -7,8 +7,8 @@ IDI_ICON ICON DISCARDABLE "../../icons/scummvm.ico"
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,3,0,0
- PRODUCTVERSION 1,3,0,0
+ FILEVERSION 1,4,0,0
+ PRODUCTVERSION 1,4,0,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
@@ -25,13 +25,13 @@ BEGIN
BEGIN
VALUE "Comments", "Look! A three headed monkey (TM)! .. Nice use of the TM!\0"
VALUE "FileDescription", "http://www.scummvm.org/\0"
- VALUE "FileVersion", "1.3.0git\0"
+ VALUE "FileVersion", "1.4.0git\0"
VALUE "InternalName", "scummvm\0"
VALUE "LegalCopyright", "Copyright © 2001-2011 The ScummVM Team\0"
VALUE "LegalTrademarks", "'SCUMM', and all SCUMM games are a TM of LucasArts. Simon The Sorcerer is a TM of AdventureSoft. Beneath a Steel Sky and Broken Sword are a TM of Revolution. Flight of the Amazon Queen is a TM of John Passfield and Steve Stamatiadis. \0"
VALUE "OriginalFilename", "scummvm.exe\0"
VALUE "ProductName", "ScummVM\0"
- VALUE "ProductVersion", "1.3.0git\0"
+ VALUE "ProductVersion", "1.4.0git\0"
END
END
diff --git a/dists/slackware/scummvm.SlackBuild b/dists/slackware/scummvm.SlackBuild
index 0e5436b85e..71f4818e7e 100755
--- a/dists/slackware/scummvm.SlackBuild
+++ b/dists/slackware/scummvm.SlackBuild
@@ -9,7 +9,7 @@ if [ "$TMP" = "" ]; then
fi
PKG=$TMP/package-scummvm
-VERSION=1.3.0git
+VERSION=1.4.0git
ARCH=i486
BUILD=1
diff --git a/dists/webos/mojo/scummvmrc-default b/dists/webos/mojo/scummvmrc-default
index d29a0fc6db..aefc5fda98 100644
--- a/dists/webos/mojo/scummvmrc-default
+++ b/dists/webos/mojo/scummvmrc-default
@@ -17,11 +17,7 @@ aspect_ratio=false
speech_mute=false
enable_gs=false
browser_lastpath=/media/internal/ScummVM/Games
-themepath=/media/internal/ScummVM/Themes
savepath=/media/internal/ScummVM/Saves
-extrapath=/media/internal/ScummVM/Extras
-pluginspath=/media/internal/ScummVM/Plugins
-vkeybdpath=/media/cryptofs/apps/usr/palm/applications/org.scummvm.scummvm/share/scummvm
[keymapper]
keymap_global_MEN=FORWARD
diff --git a/dists/webos/mojo/start b/dists/webos/mojo/start
index 3bdb9a59d8..446ce83f1d 100755
--- a/dists/webos/mojo/start
+++ b/dists/webos/mojo/start
@@ -4,14 +4,10 @@
APPDIR=$(readlink -f $(dirname $0))
SCUMMVMDIR=/media/internal/ScummVM
-
# Create the initial ScummVM directory structure
mkdir -p $SCUMMVMDIR/Games
mkdir -p $SCUMMVMDIR/Saves
mkdir -p $SCUMMVMDIR/Screenshots
-mkdir -p $SCUMMVMDIR/Themes
-mkdir -p $SCUMMVMDIR/Extras
-mkdir -p $SCUMMVMDIR/Plugins
# Install default configuration file if not already present
if [ ! -f $SCUMMVMDIR/scummvmrc ]
@@ -19,14 +15,8 @@ then
cp $APPDIR/scummvmrc-default $SCUMMVMDIR/scummvmrc
fi
-# Copy themes to theme directory
-cp -f $APPDIR/share/scummvm/*.zip $SCUMMVMDIR/Themes
-
# Change into the screenshots directory so screenshots are saved there
cd $SCUMMVMDIR/Screenshots
-# Set library path so the app finds its custom shared libraries
-export LD_LIBRARY_PATH=$APPDIR/lib
-
# Run the game
exec $APPDIR/bin/scummvm -c $SCUMMVMDIR/scummvmrc
diff --git a/dists/wii/meta.xml b/dists/wii/meta.xml
index 562d0982f5..68460c4721 100644
--- a/dists/wii/meta.xml
+++ b/dists/wii/meta.xml
@@ -2,7 +2,7 @@
<app version="1">
<name>ScummVM</name>
<coder>The ScummVM Team</coder>
- <version>1.3.0git@REVISION@</version>
+ <version>1.4.0git@REVISION@</version>
<release_date>@TIMESTAMP@</release_date>
<short_description>Point &amp; Click Adventures</short_description>
<long_description>ScummVM is a program which allows you to run certain classic graphical point-and-click adventure games, provided you already have their data files. The clever part about this: ScummVM just replaces the executables shipped with the games, allowing you to play them on systems for which they were never designed!
diff --git a/dists/win32/ScummVM.iss b/dists/win32/ScummVM.iss
new file mode 100644
index 0000000000..00f4868e60
--- /dev/null
+++ b/dists/win32/ScummVM.iss
@@ -0,0 +1,82 @@
+[Setup]
+DefaultDirName={pf}\ScummVM
+AppCopyright=2011
+AppName=ScummVM
+AppVerName=ScummVM Git
+DefaultGroupName=ScummVM
+AllowNoIcons=true
+AlwaysUsePersonalGroup=false
+EnableDirDoesntExistWarning=false
+Compression=lzma
+OutputDir=C:\ScummVM
+OutputBaseFilename=scummvm-win32
+DisableStartupPrompt=true
+AppendDefaultDirName=false
+SolidCompression=true
+DirExistsWarning=no
+SetupIconFile=scummvm.ico
+ShowLanguageDialog=yes
+LanguageDetectionMethod=uilanguage
+
+[Languages]
+Name: en; MessagesFile: compiler:Default.isl
+Name: eu; MessagesFile: compiler:Languages\Basque.isl
+Name: br; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
+Name: ca; MessagesFile: compiler:Languages\Catalan.isl
+Name: cz; MessagesFile: compiler:Languages\Czech.isl
+Name: da; MessagesFile: compiler:Languages\Danish.isl
+Name: nl; MessagesFile: compiler:Languages\Dutch.isl
+Name: fi; MessagesFile: compiler:Languages\Finnish.isl
+Name: fr; MessagesFile: compiler:Languages\French.isl
+Name: de; MessagesFile: compiler:Languages\German.isl
+Name: he; MessagesFile: compiler:Languages\Hebrew.isl
+Name: hu; MessagesFile: compiler:Languages\Hungarian.isl
+Name: it; MessagesFile: compiler:Languages\Italian.isl
+Name: ja; MessagesFile: compiler:Languages\Japanese.isl
+Name: nb; MessagesFile: compiler:Languages\Norwegian.isl
+Name: pl; MessagesFile: compiler:Languages\Polish.isl
+Name: pt; MessagesFile: compiler:Languages\Portuguese.isl
+Name: ru; MessagesFile: compiler:Languages\Russian.isl
+Name: sk; MessagesFile: compiler:Languages\Slovak.isl
+Name: sl; MessagesFile: compiler:Languages\Slovenian.isl
+Name: es; MessagesFile: compiler:Languages\Spanish.isl
+
+[Icons]
+Name: {group}\{cm:UninstallProgram, ScummVM}; Filename: {uninstallexe}
+Name: {group}\ScummVM; Filename: {app}\scummvm.exe; WorkingDir: {app}; Comment: scummvm; Flags: createonlyiffileexists; IconIndex: 0
+Name: {group}\Authors; Filename: {app}\AUTHORS.txt; WorkingDir: {app}; Comment: AUTHORS; Flags: createonlyiffileexists
+Name: {group}\Copying; Filename: {app}\COPYING.txt; WorkingDir: {app}; Comment: COPYING; Flags: createonlyiffileexists
+Name: {group}\Copying.LGPL; Filename: {app}\COPYING.LGPL.txt; WorkingDir: {app}; Comment: COPYING.LGPL; Flags: createonlyiffileexists
+Name: {group}\Copyright; Filename: {app}\COPYRIGHT.txt; WorkingDir: {app}; Comment: COPYRIGHT; Flags: createonlyiffileexists
+Name: {group}\Readme; Filename: {app}\README.txt; WorkingDir: {app}; Comment: README; Flags: createonlyiffileexists
+Name: {group}\News; Filename: {app}\NEWS.txt; WorkingDir: {app}; Comment: NEWS; Flags: createonlyiffileexists
+
+[Run]
+Filename: {app}\scummvm.exe; Flags: nowait skipifdoesntexist postinstall skipifsilent; Description: Launch ScummVM
+
+[UninstallDelete]
+Type: files; Name: {app}\ISTool.url
+
+[Files]
+Source: AUTHORS.txt; DestDir: {app}; Flags: ignoreversion
+Source: COPYING.txt; DestDir: {app}; Flags: ignoreversion
+Source: COPYING.LGPL.txt; DestDir: {app}; Flags: ignoreversion
+Source: COPYRIGHT.txt; DestDir: {app}; Flags: ignoreversion
+Source: NEWS.txt; DestDir: {app}; Flags: ignoreversion
+Source: README.txt; DestDir: {app}; Flags: ignoreversion isreadme
+Source: README-SDL.txt; DestDir: {app}; Flags: ignoreversion
+Source: scummvm.exe; DestDir: {app}; Flags: ignoreversion
+Source: SDL.dll; DestDir: {app}
+Source: scummclassic.zip; DestDir: {app}; Flags: ignoreversion
+Source: scummmodern.zip; DestDir: {app}; Flags: ignoreversion
+Source: drascula.dat; DestDir: {app}; Flags: ignoreversion
+Source: hugo.dat; DestDir: {app}; Flags: ignoreversion
+Source: kyra.dat; DestDir: {app}; Flags: ignoreversion
+Source: lure.dat; DestDir: {app}; Flags: ignoreversion
+Source: m4.dat; DestDir: {app}; Flags: ignoreversion
+Source: pred.dic; DestDir: {app}; Flags: ignoreversion
+Source: queen.tbl; DestDir: {app}; Flags: ignoreversion
+Source: sky.cpt; DestDir: {app}; Flags: ignoreversion
+Source: teenagent.dat; DestDir: {app}; Flags: ignoreversion
+Source: toon.dat; DestDir: {app}; Flags: ignoreversion
+Source: translations.dat; DestDir: {app}; Flags: ignoreversion
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index bf152ce90a..8170452102 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -23,7 +23,8 @@
*
*/
-#include "base/plugins.h"
+// FIXME: Avoid using printf
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
#include "common/debug.h"
#include "common/util.h"
@@ -32,6 +33,7 @@
#include "common/macresman.h"
#include "common/md5.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "engines/advancedDetector.h"
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 515127b23d..757fb12f33 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -25,11 +25,13 @@
#ifndef ENGINES_ADVANCED_DETECTOR_H
#define ENGINES_ADVANCED_DETECTOR_H
-#include "common/fs.h"
-#include "common/error.h"
-
#include "engines/metaengine.h"
+namespace Common {
+class Error;
+class FSList;
+}
+
struct ADGameFileDescription {
const char *fileName;
@@ -62,8 +64,8 @@ struct ADGameDescription {
Common::Platform platform;
/**
- * A bitmask of extra flags. The top 8 bits are reserved for generic flags
- * defined in the ADGameFlags. This leaves 24 flags to be used by client
+ * A bitmask of extra flags. The top 16 bits are reserved for generic flags
+ * defined in the ADGameFlags. This leaves 16 bits to be used by client
* code.
*/
uint32 flags;
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 632587f7f7..a69d19f06c 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -32,6 +32,7 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/random.h"
+#include "common/textconsole.h"
#include "engines/util.h"
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index aca0b32a5c..c71a0ebf64 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -27,9 +27,10 @@
#define AGI_H
#include "common/scummsys.h"
-#include "common/endian.h"
+#include "common/error.h"
#include "common/util.h"
#include "common/file.h"
+#include "common/rect.h"
#include "common/stack.h"
#include "common/system.h"
@@ -45,7 +46,9 @@
#include "agi/sound.h"
-namespace Common { class RandomSource; }
+namespace Common {
+class RandomSource;
+}
/**
* This is the namespace of the AGI engine.
@@ -693,7 +696,6 @@ public:
class GfxMgr;
class SpritesMgr;
class Menu;
-class SearchTree;
// Image stack support
struct ImageStackElement {
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 0a53f0c4f4..fb92344de2 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -23,12 +23,16 @@
*
*/
+// FIXME: Avoid using printf
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
#include "base/plugins.h"
#include "engines/advancedDetector.h"
#include "common/config-manager.h"
#include "common/file.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp
index d0bc83d4c4..f0d38761d0 100644
--- a/engines/agi/graphics.cpp
+++ b/engines/agi/graphics.cpp
@@ -24,9 +24,10 @@
*/
#include "common/file.h"
-
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "agi/agi.h"
#include "agi/graphics.h"
diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp
index 8780e1dab8..0141a61065 100644
--- a/engines/agi/loader_v2.cpp
+++ b/engines/agi/loader_v2.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "agi/agi.h"
namespace Agi {
diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index 18ea4cae7d..025e755c8b 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -28,6 +28,7 @@
#include "common/config-manager.h"
#include "common/fs.h"
+#include "common/textconsole.h"
namespace Agi {
diff --git a/engines/agi/lzw.cpp b/engines/agi/lzw.cpp
index f645cb16d3..495d6458da 100644
--- a/engines/agi/lzw.cpp
+++ b/engines/agi/lzw.cpp
@@ -36,6 +36,8 @@
#include "agi/agi.h"
#include "agi/lzw.h"
+#include "common/textconsole.h"
+
namespace Agi {
diff --git a/engines/agi/objects.cpp b/engines/agi/objects.cpp
index d942a2b538..bea53d7fa4 100644
--- a/engines/agi/objects.cpp
+++ b/engines/agi/objects.cpp
@@ -25,6 +25,8 @@
#include "agi/agi.h"
+#include "common/textconsole.h"
+
namespace Agi {
int AgiEngine::allocObjects(int n) {
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 2ea53e57ad..e1f99456e8 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -32,6 +32,7 @@
#include "agi/menu.h"
#include "common/random.h"
+#include "common/textconsole.h"
namespace Agi {
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index d17fe1d497..8951fc81df 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -26,6 +26,8 @@
#include "agi/agi.h"
#include "agi/graphics.h"
+#include "common/textconsole.h"
+
namespace Agi {
PictureMgr::PictureMgr(AgiBase *agi, GfxMgr *gfx) {
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index 7457a317c2..c51c53e76e 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -26,6 +26,7 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/random.h"
+#include "common/textconsole.h"
#include "audio/mididrv.h"
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 10ca797587..64fc4e9ae5 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -25,6 +25,7 @@
#include "common/events.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp
index 4e87c8063c..76849949c7 100644
--- a/engines/agi/preagi_troll.cpp
+++ b/engines/agi/preagi_troll.cpp
@@ -28,6 +28,7 @@
#include "agi/graphics.h"
#include "common/events.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index e97c144872..c92434c15f 100644
--- a/engines/agi/preagi_winnie.cpp
+++ b/engines/agi/preagi_winnie.cpp
@@ -32,6 +32,7 @@
#include "common/events.h"
#include "common/memstream.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
namespace Agi {
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 0230b9bd74..96ad78ace5 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -28,6 +28,7 @@
#include "agi/keyboard.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#ifdef __DS__
#include "wordcompletion.h"
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index 13e7215180..c8df726fc7 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -31,6 +31,7 @@
#include "common/file.h"
#include "common/config-manager.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index b215822917..b40cef67ef 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -31,6 +31,8 @@
#include "agi/sound_sarien.h"
#include "agi/sound_pcjr.h"
+#include "common/textconsole.h"
+
namespace Agi {
//
diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index 11bf5a9034..f5758ed140 100644
--- a/engines/agi/sound_2gs.cpp
+++ b/engines/agi/sound_2gs.cpp
@@ -28,6 +28,7 @@
#include "common/md5.h"
#include "common/memstream.h"
#include "common/str-array.h"
+#include "common/textconsole.h"
#include "agi/agi.h"
#include "agi/sound_2gs.h"
diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp
index 986715721f..997c1edd6b 100644
--- a/engines/agi/sound_midi.cpp
+++ b/engines/agi/sound_midi.cpp
@@ -49,6 +49,7 @@
#include "common/file.h"
#include "common/memstream.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "agi/agi.h"
diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp
index 4ed7f8d029..6f2f3c5ad3 100644
--- a/engines/agi/sound_sarien.cpp
+++ b/engines/agi/sound_sarien.cpp
@@ -23,11 +23,7 @@
*
*/
-#include "common/md5.h"
-#include "common/config-manager.h"
-#include "common/fs.h"
#include "common/random.h"
-#include "common/str-array.h"
#include "audio/mididrv.h"
diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp
index 22de66712d..fab3b5cf50 100644
--- a/engines/agi/wagparser.cpp
+++ b/engines/agi/wagparser.cpp
@@ -27,6 +27,7 @@
#include "common/util.h"
#include "common/fs.h"
#include "common/debug.h"
+#include "common/textconsole.h"
#include "agi/wagparser.h"
diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp
index c48ed90ad8..d8596dec97 100644
--- a/engines/agi/words.cpp
+++ b/engines/agi/words.cpp
@@ -29,6 +29,8 @@
#include "agi/agi.h"
+#include "common/textconsole.h"
+
namespace Agi {
static uint8 *words; // words in the game
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 498c7e4961..56501b5294 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -25,9 +25,9 @@
#include "common/config-manager.h"
#include "common/EventRecorder.h"
-#include "common/events.h"
#include "common/file.h"
#include "common/fs.h"
+#include "common/textconsole.h"
#include "common/system.h"
#include "engines/util.h"
@@ -35,14 +35,12 @@
#include "agos/debugger.h"
#include "agos/intern.h"
#include "agos/agos.h"
-#include "agos/vga.h"
#include "backends/audiocd/audiocd.h"
#include "graphics/surface.h"
#include "audio/mididrv.h"
-#include "audio/mods/protracker.h"
namespace AGOS {
@@ -568,33 +566,33 @@ Common::Error AGOSEngine::init() {
// allocate buffers
_backGroundBuf = new Graphics::Surface();
- _backGroundBuf->create(_screenWidth, _screenHeight, 1);
+ _backGroundBuf->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
if (getGameType() == GType_FF || getGameType() == GType_PP) {
_backBuf = new Graphics::Surface();
- _backBuf->create(_screenWidth, _screenHeight, 1);
+ _backBuf->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
_scaleBuf = new Graphics::Surface();
- _scaleBuf->create(_screenWidth, _screenHeight, 1);
+ _scaleBuf->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
}
if (getGameType() == GType_SIMON2) {
_window4BackScn = new Graphics::Surface();
- _window4BackScn->create(_screenWidth, _screenHeight, 1);
+ _window4BackScn->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8());
} else if (getGameType() == GType_SIMON1) {
_window4BackScn = new Graphics::Surface();
- _window4BackScn->create(_screenWidth, 134, 1);
+ _window4BackScn->create(_screenWidth, 134, Graphics::PixelFormat::createFormatCLUT8());
} else if (getGameType() == GType_WW || getGameType() == GType_ELVIRA2) {
_window4BackScn = new Graphics::Surface();
- _window4BackScn->create(224, 127, 1);
+ _window4BackScn->create(224, 127, Graphics::PixelFormat::createFormatCLUT8());
} else if (getGameType() == GType_ELVIRA1) {
_window4BackScn = new Graphics::Surface();
if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_DEMO)) {
- _window4BackScn->create(224, 196, 1);
+ _window4BackScn->create(224, 196, Graphics::PixelFormat::createFormatCLUT8());
} else {
- _window4BackScn->create(224, 144, 1);
+ _window4BackScn->create(224, 144, Graphics::PixelFormat::createFormatCLUT8());
}
_window6BackScn = new Graphics::Surface();
- _window6BackScn->create(48, 80, 1);
+ _window6BackScn->create(48, 80, Graphics::PixelFormat::createFormatCLUT8());
}
setupGame();
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 735920e427..aecf2437a7 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -29,6 +29,7 @@
#include "engines/engine.h"
#include "common/array.h"
+#include "common/error.h"
#include "common/keyboard.h"
#include "common/random.h"
#include "common/rect.h"
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index acdc0084c4..ee47f62a58 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -31,8 +31,10 @@
#include "common/events.h"
#include "common/file.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "agos/animation.h"
diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp
index a477b3dedc..a131bb841b 100644
--- a/engines/agos/charset-fontdata.cpp
+++ b/engines/agos/charset-fontdata.cpp
@@ -26,6 +26,7 @@
#include "common/system.h"
+#include "common/textconsole.h"
#include "agos/agos.h"
#include "agos/intern.h"
diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp
index d0dc8cc42e..bb27557a6b 100644
--- a/engines/agos/debug.cpp
+++ b/engines/agos/debug.cpp
@@ -27,6 +27,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "agos/debug.h"
#include "agos/agos.h"
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 646e63dacf..c8c70c0ecc 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -29,6 +29,7 @@
#include "common/config-manager.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "agos/intern.h"
#include "agos/agos.h"
diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp
index 317c68d31a..6b9f65ee2b 100644
--- a/engines/agos/draw.cpp
+++ b/engines/agos/draw.cpp
@@ -28,6 +28,7 @@
#include "common/system.h"
#include "graphics/surface.h"
+#include "graphics/palette.h"
#include "agos/agos.h"
#include "agos/intern.h"
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index fc0b4f96cd..8799dbaa28 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -32,6 +32,7 @@
#include "common/events.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "backends/audiocd/audiocd.h"
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index 710c9ddd7e..4c998dfa5f 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -26,6 +26,7 @@
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index ca603db1fa..39a7705c54 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -25,9 +25,9 @@
-#include "common/system.h"
-
#include "common/file.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 81da5264ba..5d1523bbd5 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -26,6 +26,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "agos/intern.h"
#include "agos/agos.h"
diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp
index 5629a1dca6..2b103a75cb 100644
--- a/engines/agos/menus.cpp
+++ b/engines/agos/menus.cpp
@@ -27,6 +27,7 @@
#include "common/file.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp
index a37c96a787..26e2f2c736 100644
--- a/engines/agos/midi.cpp
+++ b/engines/agos/midi.cpp
@@ -28,6 +28,7 @@
#include "common/config-manager.h"
#include "common/file.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "agos/agos.h"
diff --git a/engines/agos/midi.h b/engines/agos/midi.h
index ad69a3ddde..40f54dbaf0 100644
--- a/engines/agos/midi.h
+++ b/engines/agos/midi.h
@@ -31,7 +31,7 @@
#include "common/mutex.h"
namespace Common {
- class File;
+class File;
}
namespace AGOS {
diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp
index 156dc6ecaa..f96518b5e9 100644
--- a/engines/agos/midiparser_s1d.cpp
+++ b/engines/agos/midiparser_s1d.cpp
@@ -25,6 +25,7 @@
#include "common/debug.h"
#include "common/util.h"
+#include "common/textconsole.h"
#include "audio/mididrv.h"
#include "audio/midiparser.h"
diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp
index b8409669ee..0e818963e2 100644
--- a/engines/agos/res.cpp
+++ b/engines/agos/res.cpp
@@ -28,6 +28,7 @@
#include "common/file.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "agos/agos.h"
diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp
index fe09e746ff..34deff37ab 100644
--- a/engines/agos/res_snd.cpp
+++ b/engines/agos/res_snd.cpp
@@ -26,6 +26,7 @@
#include "common/config-manager.h"
#include "common/file.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "agos/intern.h"
#include "agos/agos.h"
diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp
index a2eff06fcc..0993197594 100644
--- a/engines/agos/rooms.cpp
+++ b/engines/agos/rooms.cpp
@@ -26,6 +26,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "agos/agos.h"
#include "agos/intern.h"
diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp
index eefa2460ec..d6f25814bb 100644
--- a/engines/agos/saveload.cpp
+++ b/engines/agos/saveload.cpp
@@ -26,6 +26,7 @@
#include "common/file.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#include "gui/about.h"
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp
index 90992b52fe..94a3f371cc 100644
--- a/engines/agos/script.cpp
+++ b/engines/agos/script.cpp
@@ -28,6 +28,7 @@
#include "common/system.h"
+#include "common/textconsole.h"
#include "agos/animation.h"
#include "agos/agos.h"
diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp
index 909c051362..b8ba7fb015 100644
--- a/engines/agos/script_pn.cpp
+++ b/engines/agos/script_pn.cpp
@@ -26,6 +26,8 @@
#include "agos/agos.h"
#include "agos/vga.h"
+#include "common/textconsole.h"
+
namespace AGOS {
enum {
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index 05a725cb50..dab0302631 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -26,6 +26,8 @@
#include "common/system.h"
+#include "graphics/palette.h"
+
#include "agos/agos.h"
#ifdef _WIN32_WCE
diff --git a/engines/agos/script_s2.cpp b/engines/agos/script_s2.cpp
index dd525163c7..a0b14525f2 100644
--- a/engines/agos/script_s2.cpp
+++ b/engines/agos/script_s2.cpp
@@ -27,6 +27,8 @@
#include "agos/agos.h"
+#include "common/textconsole.h"
+
namespace AGOS {
#define OPCODE(x) _OPCODE(AGOSEngine_Simon2, x)
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index 35301793bf..25d861acb5 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -25,6 +25,7 @@
#include "common/file.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "agos/agos.h"
diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp
index bda605a84a..1152d6ed04 100644
--- a/engines/agos/string.cpp
+++ b/engines/agos/string.cpp
@@ -26,6 +26,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "gui/about.h"
#include "gui/message.h"
diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp
index a4e40d8306..92d85ab96c 100644
--- a/engines/agos/string_pn.cpp
+++ b/engines/agos/string_pn.cpp
@@ -26,6 +26,8 @@
#include "agos/agos.h"
#include "agos/intern.h"
+#include "common/textconsole.h"
+
namespace AGOS {
uint32 AGOSEngine_PN::ftext(uint32 base, int n) {
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index 733d40e52d..bd07596a46 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -26,6 +26,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "agos/agos.h"
#include "agos/intern.h"
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index 83ee05036c..6c07db13c1 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -31,6 +31,7 @@
#include "agos/vga.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp
index b0431db801..9e163ba91f 100644
--- a/engines/agos/vga_e2.cpp
+++ b/engines/agos/vga_e2.cpp
@@ -32,6 +32,7 @@
#include "common/system.h"
#include "graphics/surface.h"
+#include "graphics/palette.h"
namespace AGOS {
diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp
index 8aecd3448a..08b2cee303 100644
--- a/engines/agos/vga_ww.cpp
+++ b/engines/agos/vga_ww.cpp
@@ -32,6 +32,7 @@
#include "common/system.h"
#include "graphics/surface.h"
+#include "graphics/palette.h"
namespace AGOS {
diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp
index a03c7e178a..08680c9e45 100644
--- a/engines/agos/window.cpp
+++ b/engines/agos/window.cpp
@@ -26,6 +26,7 @@
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 14b8de9e39..6b4b29dcfe 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -29,6 +29,7 @@
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/anim.h"
diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp
index b3171de918..22fd28a99c 100644
--- a/engines/cine/bg.cpp
+++ b/engines/cine/bg.cpp
@@ -26,6 +26,7 @@
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/various.h"
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 54d113d69c..8104ad38cd 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -23,13 +23,9 @@
*
*/
-#include "common/events.h"
#include "common/EventRecorder.h"
-#include "common/file.h"
-#include "common/savefile.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
-#include "common/system.h"
#include "engines/util.h"
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 9dfa2f71ea..058c1a1140 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -27,6 +27,7 @@
#include "engines/advancedDetector.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/various.h"
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 3970d88117..18feacd08b 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -30,8 +30,9 @@
#include "cine/pal.h"
#include "common/endian.h"
-#include "common/system.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
diff --git a/engines/cine/msg.cpp b/engines/cine/msg.cpp
index a01afd147b..3d58d6ddcd 100644
--- a/engines/cine/msg.cpp
+++ b/engines/cine/msg.cpp
@@ -25,6 +25,7 @@
#include "common/debug.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "cine/msg.h"
#include "cine/various.h"
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 3c8ffc295b..0f52600db5 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -27,6 +27,9 @@
#include "cine/various.h"
#include "cine/pal.h"
#include "common/system.h" // For g_system->getPaletteManager()->setPalette
+#include "common/textconsole.h"
+
+#include "graphics/palette.h"
namespace Cine {
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index f5c9402388..17ef01948c 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -25,6 +25,7 @@
#include "common/debug.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/unpack.h"
diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp
index 4911f78da9..1fc2a8b2fd 100644
--- a/engines/cine/saveload.cpp
+++ b/engines/cine/saveload.cpp
@@ -25,6 +25,7 @@
#include "common/debug.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/bg_list.h"
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index ffbee3d389..674bf4dd86 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -28,6 +28,7 @@
*/
#include "common/endian.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/bg_list.h"
diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp
index 9ee3a892a9..aa2c8c33ac 100644
--- a/engines/cine/script_os.cpp
+++ b/engines/cine/script_os.cpp
@@ -28,6 +28,7 @@
*/
#include "common/endian.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/bg_list.h"
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index f0c0668e33..414761159b 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -26,6 +26,8 @@
#include "common/endian.h"
#include "common/file.h"
#include "common/memstream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "cine/cine.h"
#include "cine/sound.h"
diff --git a/engines/cine/sound.h b/engines/cine/sound.h
index e9a797989e..7b506ab5f3 100644
--- a/engines/cine/sound.h
+++ b/engines/cine/sound.h
@@ -30,7 +30,7 @@
#include "audio/mixer.h"
namespace Audio {
- class AudioStream;
+class AudioStream;
}
namespace Cine {
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index 9dbfa315d9..fb6818d690 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -23,8 +23,10 @@
*
*/
-#include "cine/cine.h"
#include "common/file.h"
+#include "common/textconsole.h"
+
+#include "cine/cine.h"
#include "cine/various.h"
namespace Cine {
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 5b8663606e..fdc7a28867 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -26,6 +26,7 @@
#include "common/endian.h"
#include "common/events.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp
index 9cbc3dd9ae..2c83aff743 100644
--- a/engines/cruise/actor.cpp
+++ b/engines/cruise/actor.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "cruise/cruise.h"
#include "cruise/staticres.h"
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index edd52d3b4a..7c63c155d3 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "cruise/cruise_main.h"
namespace Cruise {
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index 2c5659c4d9..9712bd9439 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -23,13 +23,10 @@
*
*/
-#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/file.h"
-#include "common/savefile.h"
-#include "common/config-manager.h"
#include "common/debug-channels.h"
-#include "common/system.h"
+#include "common/textconsole.h"
#include "engines/util.h"
diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h
index ad3bb20ca1..8d03d47327 100644
--- a/engines/cruise/cruise.h
+++ b/engines/cruise/cruise.h
@@ -31,7 +31,6 @@
#include "common/random.h"
#include "engines/engine.h"
-#include "engines/game.h"
#include "cruise/cruise_main.h"
#include "cruise/debugger.h"
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index b1d7a594fe..e2f2d7468e 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -27,6 +27,7 @@
#include "common/endian.h"
#include "common/events.h"
#include "common/system.h" // for g_system->getEventManager()
+#include "common/textconsole.h"
#include "cruise/cruise.h"
#include "cruise/cruise_main.h"
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index b9e4ca8bc9..3ccd1689b8 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -26,6 +26,7 @@
#include "cruise/cruise_main.h"
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
namespace Cruise {
diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp
index 66018fac2e..63d7328e78 100644
--- a/engines/cruise/detection.cpp
+++ b/engines/cruise/detection.cpp
@@ -27,6 +27,7 @@
#include "base/plugins.h"
#include "common/savefile.h"
+#include "common/system.h"
#include "engines/advancedDetector.h"
#include "cruise/cruise.h"
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 0b25ee59c1..75b90f7ec8 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -28,6 +28,8 @@
#include "cruise/cell.h"
#include "cruise/sound.h"
#include "cruise/staticres.h"
+
+#include "common/textconsole.h"
#include "common/util.h"
namespace Cruise {
diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp
index 1b6f3942de..4d48c2c466 100644
--- a/engines/cruise/gfxModule.cpp
+++ b/engines/cruise/gfxModule.cpp
@@ -29,6 +29,8 @@
#include "common/list.h"
#include "common/rect.h"
+#include "graphics/palette.h"
+
#include "cruise/cruise.h"
#include "cruise/cruise_main.h"
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index a722b947ff..36689ca0e3 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -29,6 +29,7 @@
#include "engines/metaengine.h"
#include "gui/saveload.h"
+#include "common/system.h"
#include "common/translation.h"
namespace Cruise {
diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp
index 864491605f..8e2be0cf13 100644
--- a/engines/cruise/object.cpp
+++ b/engines/cruise/object.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "cruise/cruise_main.h"
namespace Cruise {
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 9a77891deb..b7a0293f33 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -24,6 +24,7 @@
*/
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "cruise/cruise.h"
#include "cruise/cruise_main.h"
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index a1a306705e..6e75088d45 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -30,6 +30,7 @@
#include "common/serializer.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/scaler.h"
#include "graphics/thumbnail.h"
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index aae4dba475..d6ff784644 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -26,6 +26,7 @@
#include "cruise/cruise.h"
#include "cruise/cruise_main.h"
#include "common/endian.h"
+#include "common/textconsole.h"
namespace Cruise {
diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp
index 2826a34351..322f808439 100644
--- a/engines/cruise/sound.cpp
+++ b/engines/cruise/sound.cpp
@@ -24,6 +24,8 @@
*/
#include "common/endian.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "cruise/cruise.h"
#include "cruise/cruise_main.h"
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 18c184e568..7e1f29271e 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -25,21 +25,21 @@
#include "base/version.h"
#include "common/config-manager.h"
-#include "common/savefile.h"
-#include "common/system.h"
#include "common/events.h"
+#include "common/str.h"
+#include "common/system.h"
#include "common/translation.h"
-#include "graphics/scaler.h"
-
#include "gui/about.h"
#include "gui/gui-manager.h"
-#include "gui/launcher.h"
-#include "gui/widgets/list.h"
#include "gui/message.h"
#include "gui/options.h"
#include "gui/saveload.h"
+#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
+#include "gui/widget.h"
+
+#include "graphics/font.h"
#include "engines/dialogs.h"
#include "engines/engine.h"
diff --git a/engines/dialogs.h b/engines/dialogs.h
index 6e5338b317..587e91a2bb 100644
--- a/engines/dialogs.h
+++ b/engines/dialogs.h
@@ -25,15 +25,15 @@
#ifndef GLOBAL_DIALOGS_H
#define GLOBAL_DIALOGS_H
-#include "common/str.h"
#include "gui/dialog.h"
class Engine;
namespace GUI {
- class ButtonWidget;
- class GraphicsWidget;
- class SaveLoadChooser;
+class ButtonWidget;
+class CommandSender;
+class GraphicsWidget;
+class SaveLoadChooser;
}
class MainMenuDialog : public GUI::Dialog {
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index bc38e84d72..f2f1727fdd 100644
--- a/engines/draci/animation.cpp
+++ b/engines/draci/animation.cpp
@@ -32,6 +32,7 @@
#include "draci/surface.h"
#include "common/memstream.h"
+#include "common/system.h"
namespace Draci {
diff --git a/engines/draci/game.h b/engines/draci/game.h
index 0ecbcf68f0..0b5b3a03cc 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -31,7 +31,7 @@
#include "draci/walking.h"
namespace Common {
- class Serializer;
+class Serializer;
}
namespace Draci {
diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp
index 750410b329..1d725ebb15 100644
--- a/engines/draci/music.cpp
+++ b/engines/draci/music.cpp
@@ -29,6 +29,7 @@
#include "audio/mididrv.h"
#include "audio/midiparser.h"
#include "common/config-manager.h"
+#include "common/debug.h"
#include "common/file.h"
#include "draci/draci.h"
diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp
index c04f0668bb..ab9c49c63a 100644
--- a/engines/draci/screen.cpp
+++ b/engines/draci/screen.cpp
@@ -26,6 +26,8 @@
#include "common/memstream.h"
#include "common/system.h"
+#include "graphics/palette.h"
+
#include "draci/draci.h"
#include "draci/screen.h"
#include "draci/surface.h"
diff --git a/engines/draci/script.h b/engines/draci/script.h
index e81691204e..a75f6bcbc3 100644
--- a/engines/draci/script.h
+++ b/engines/draci/script.h
@@ -30,7 +30,7 @@
#include "common/stream.h"
namespace Common {
- class ReadStream;
+class ReadStream;
}
namespace Draci {
diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp
index 0df19794f7..ab2479f811 100644
--- a/engines/draci/sound.cpp
+++ b/engines/draci/sound.cpp
@@ -29,6 +29,7 @@
#include "common/file.h"
#include "common/str.h"
#include "common/substream.h"
+#include "common/textconsole.h"
#include "common/memstream.h"
#include "common/unzip.h"
diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp
index 532d87a19f..37a76dbe0e 100644
--- a/engines/draci/surface.cpp
+++ b/engines/draci/surface.cpp
@@ -29,7 +29,7 @@
namespace Draci {
Surface::Surface(int width, int height) {
- this->create(width, height, 1);
+ this->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
this->markClean();
_transparentColor = kDefaultTransparent;
}
diff --git a/engines/draci/surface.h b/engines/draci/surface.h
index b00abcd943..cb15ecebe4 100644
--- a/engines/draci/surface.h
+++ b/engines/draci/surface.h
@@ -27,6 +27,7 @@
#define DRACI_SURFACE_H
#include "common/list.h"
+#include "common/rect.h"
#include "graphics/surface.h"
namespace Draci {
diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp
index d0906fdf55..dcd93d84d7 100644
--- a/engines/drascula/converse.cpp
+++ b/engines/drascula/converse.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "drascula/drascula.h"
namespace Drascula {
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 19395dcd3f..470f28ccff 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -29,6 +29,7 @@
#include "common/file.h"
#include "common/savefile.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "backends/audiocd/audiocd.h"
diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp
index 9c5f3dc12a..4cd91e48a0 100644
--- a/engines/drascula/graphics.cpp
+++ b/engines/drascula/graphics.cpp
@@ -25,8 +25,9 @@
#include "drascula/drascula.h"
#include "graphics/surface.h"
-#include "common/stream.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
namespace Drascula {
diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp
index 6b507abc65..630eb08d3c 100644
--- a/engines/drascula/objects.cpp
+++ b/engines/drascula/objects.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "drascula/drascula.h"
namespace Drascula {
diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp
index b521c0313b..a75e72e249 100644
--- a/engines/drascula/palette.cpp
+++ b/engines/drascula/palette.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "graphics/palette.h"
+
#include "drascula/drascula.h"
namespace Drascula {
diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp
index d6774cbc65..35d4eedb5d 100644
--- a/engines/drascula/rooms.cpp
+++ b/engines/drascula/rooms.cpp
@@ -24,6 +24,7 @@
*/
#include "common/array.h"
+#include "common/textconsole.h"
#include "drascula/drascula.h"
diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp
index db67409890..eacbe6756d 100644
--- a/engines/drascula/saveload.cpp
+++ b/engines/drascula/saveload.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "drascula/drascula.h"
namespace Drascula {
diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp
index 48e7492b11..5cb1c4486a 100644
--- a/engines/drascula/sound.cpp
+++ b/engines/drascula/sound.cpp
@@ -29,6 +29,7 @@
#include "audio/decoders/voc.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "backends/audiocd/audiocd.h"
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 71f9b68f44..217740d9d5 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -32,25 +32,26 @@
#include "engines/engine.h"
#include "engines/dialogs.h"
-#include "engines/metaengine.h"
-#include "engines/util.h"
#include "common/config-manager.h"
-#include "common/debug.h"
#include "common/events.h"
#include "common/file.h"
-#include "common/timer.h"
-#include "common/savefile.h"
#include "common/system.h"
#include "common/str.h"
+#include "common/error.h"
+#include "common/list.h"
+#include "common/list_intern.h"
+#include "common/scummsys.h"
+#include "common/textconsole.h"
#include "gui/debugger.h"
+#include "gui/dialog.h"
#include "gui/message.h"
-#include "gui/gui-manager.h"
#include "audio/mixer.h"
#include "graphics/cursorman.h"
+#include "graphics/pixelformat.h"
#ifdef _WIN32_WCE
extern bool isSmartphone();
diff --git a/engines/engine.h b/engines/engine.h
index 168a1dc2a0..b7afc0f09d 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -26,22 +26,22 @@
#define ENGINES_ENGINE_H
#include "common/scummsys.h"
-#include "common/error.h"
#include "common/str.h"
class OSystem;
namespace Audio {
- class Mixer;
+class Mixer;
}
namespace Common {
- class EventManager;
- class SaveFileManager;
- class TimerManager;
+class Error;
+class EventManager;
+class SaveFileManager;
+class TimerManager;
}
namespace GUI {
- class Debugger;
- class Dialog;
+class Debugger;
+class Dialog;
}
/**
diff --git a/engines/game.cpp b/engines/game.cpp
index dea6d37485..a27080cbf8 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -24,7 +24,6 @@
*/
#include "engines/game.h"
-#include "base/plugins.h"
const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list) {
diff --git a/engines/game.h b/engines/game.h
index 3e5d7f262c..c9a3b25853 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -28,6 +28,8 @@
#include "common/array.h"
#include "common/hash-str.h"
+#include "common/str.h"
+#include "common/util.h"
/**
* A simple structure used to map gameids (like "monkey", "sword1", ...) to
diff --git a/engines/gob/databases.cpp b/engines/gob/databases.cpp
index 66a711e46e..94f641db4e 100644
--- a/engines/gob/databases.cpp
+++ b/engines/gob/databases.cpp
@@ -24,6 +24,7 @@
*/
#include "common/file.h"
+#include "common/textconsole.h"
#include "gob/databases.h"
diff --git a/engines/gob/dataio.h b/engines/gob/dataio.h
index 6e12d15af8..f2b39aed09 100644
--- a/engines/gob/dataio.h
+++ b/engines/gob/dataio.h
@@ -33,7 +33,7 @@
#include "common/file.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Gob {
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp
index 12914163c2..3d697d3693 100644
--- a/engines/gob/gob.cpp
+++ b/engines/gob/gob.cpp
@@ -24,14 +24,11 @@
*/
#include "common/debug-channels.h"
-#include "common/endian.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
#include "backends/audiocd/audiocd.h"
#include "base/plugins.h"
#include "common/config-manager.h"
-#include "common/md5.h"
#include "audio/mididrv.h"
#include "gui/gui-manager.h"
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index 9bdbed45cf..4a928747b0 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -30,12 +30,14 @@
#include "common/system.h"
#include "common/savefile.h"
+#include "graphics/pixelformat.h"
+
#include "engines/engine.h"
#include "gob/console.h"
namespace GUI {
- class StaticTextWidget;
+class StaticTextWidget;
}
/**
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 262fdc8045..8f1ff4c73f 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -23,9 +23,7 @@
*
*/
-#include "common/endian.h"
#include "common/str.h"
-#include "common/file.h"
#include "gob/gob.h"
#include "gob/inter.h"
diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp
index 778387e52d..1da92b3766 100644
--- a/engines/gob/inter_v4.cpp
+++ b/engines/gob/inter_v4.cpp
@@ -23,9 +23,7 @@
*
*/
-#include "common/endian.h"
#include "common/str.h"
-#include "common/file.h"
#include "gob/gob.h"
#include "gob/inter.h"
diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp
index 85b213ae66..f5e87bb936 100644
--- a/engines/gob/inter_v5.cpp
+++ b/engines/gob/inter_v5.cpp
@@ -23,9 +23,6 @@
*
*/
-#include "common/endian.h"
-#include "common/file.h"
-
#include "gui/message.h"
#include "gob/gob.h"
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index 06a06f4fb6..53ebfe7513 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -23,9 +23,7 @@
*
*/
-#include "common/endian.h"
#include "common/str.h"
-#include "common/file.h"
#include "graphics/dither.h"
#include "gob/gob.h"
diff --git a/engines/gob/resources.h b/engines/gob/resources.h
index 9921dc6e76..dec64f6b7c 100644
--- a/engines/gob/resources.h
+++ b/engines/gob/resources.h
@@ -29,7 +29,7 @@
#include "common/str.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Gob {
diff --git a/engines/gob/save/saveload.cpp b/engines/gob/save/saveload.cpp
index 3508e58f16..e490509914 100644
--- a/engines/gob/save/saveload.cpp
+++ b/engines/gob/save/saveload.cpp
@@ -23,9 +23,6 @@
*
*/
-#include "common/endian.h"
-#include "common/savefile.h"
-
#include "gob/gob.h"
#include "gob/save/saveload.h"
#include "gob/global.h"
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index f070bf14fa..4244df68e5 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -23,8 +23,10 @@
*
*/
+#include "common/debug.h"
#include "common/file.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "gob/gob.h"
#include "gob/sound/adlib.h"
diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp
index 8850a727d3..b351d92275 100644
--- a/engines/gob/sound/bgatmosphere.cpp
+++ b/engines/gob/sound/bgatmosphere.cpp
@@ -23,8 +23,6 @@
*
*/
-#include "common/system.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
#include "gob/sound/bgatmosphere.h"
diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp
index 4f3d783046..217aa9c18e 100644
--- a/engines/gob/sound/cdrom.cpp
+++ b/engines/gob/sound/cdrom.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
#include "common/str.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "backends/audiocd/audiocd.h"
diff --git a/engines/gob/sound/infogrames.cpp b/engines/gob/sound/infogrames.cpp
index 6377b4e798..9fb7410740 100644
--- a/engines/gob/sound/infogrames.cpp
+++ b/engines/gob/sound/infogrames.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "gob/sound/infogrames.h"
namespace Gob {
diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp
index d33ea89147..cc1c6b1f6b 100644
--- a/engines/gob/sound/sounddesc.cpp
+++ b/engines/gob/sound/sounddesc.cpp
@@ -25,6 +25,8 @@
#include "common/util.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
+
#include "audio/mixer.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/wave.h"
diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp
index b6082c577c..3b6b2e5d52 100644
--- a/engines/gob/sound/soundmixer.cpp
+++ b/engines/gob/sound/soundmixer.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/util.h"
+
#include "gob/sound/soundmixer.h"
#include "gob/sound/sounddesc.h"
diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp
index c3e8cd9ff5..7bd8aae597 100644
--- a/engines/gob/surface.cpp
+++ b/engines/gob/surface.cpp
@@ -31,6 +31,8 @@
#include "common/frac.h"
#include "graphics/primitives.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
namespace Gob {
diff --git a/engines/gob/surface.h b/engines/gob/surface.h
index 3dea18e36e..b84927af70 100644
--- a/engines/gob/surface.h
+++ b/engines/gob/surface.h
@@ -34,7 +34,7 @@
#include "graphics/iff.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Gob {
diff --git a/engines/gob/totfile.h b/engines/gob/totfile.h
index 211232f870..ce467425e2 100644
--- a/engines/gob/totfile.h
+++ b/engines/gob/totfile.h
@@ -29,7 +29,7 @@
#include "common/str.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Gob {
diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp
index 4d51b3d61f..787f85175a 100644
--- a/engines/gob/util.cpp
+++ b/engines/gob/util.cpp
@@ -36,6 +36,8 @@
#include "common/events.h"
+#include "graphics/palette.h"
+
namespace Gob {
Util::Util(GobEngine *vm) : _vm(vm) {
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp
index 444ff8ed9e..1d74a07bfc 100644
--- a/engines/gob/video.cpp
+++ b/engines/gob/video.cpp
@@ -29,6 +29,7 @@
#include "graphics/cursorman.h"
#include "graphics/fontman.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "gob/gob.h"
diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp
index 8222c99ef3..de149c9787 100644
--- a/engines/gob/videoplayer.cpp
+++ b/engines/gob/videoplayer.cpp
@@ -720,7 +720,7 @@ bool VideoPlayer::copyFrame(int slot, Surface &dest,
if (!surface)
return false;
- Surface src(surface->w, surface->h, surface->bytesPerPixel, (byte *)surface->pixels);
+ Surface src(surface->w, surface->h, surface->format.bytesPerPixel, (byte *)surface->pixels);
dest.blit(src, left, top, left + width - 1, top + height - 1, x, y, transp);
return true;
diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp
index db4134ccb0..8b62b829e1 100644
--- a/engines/groovie/cursor.cpp
+++ b/engines/groovie/cursor.cpp
@@ -26,8 +26,11 @@
#include "groovie/cursor.h"
#include "groovie/groovie.h"
+#include "common/debug.h"
#include "common/archive.h"
+#include "common/file.h"
#include "common/macresman.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
namespace Groovie {
diff --git a/engines/groovie/cursor.h b/engines/groovie/cursor.h
index 7a1f3ccc0e..e40dc0c486 100644
--- a/engines/groovie/cursor.h
+++ b/engines/groovie/cursor.h
@@ -30,7 +30,7 @@
#include "common/system.h"
namespace Common {
- class MacResManager;
+class MacResManager;
}
namespace Groovie {
diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp
index bd4b671e11..0b70e4f83a 100644
--- a/engines/groovie/debug.cpp
+++ b/engines/groovie/debug.cpp
@@ -31,6 +31,8 @@
#include "common/debug-channels.h"
#include "common/system.h"
+#include "graphics/palette.h"
+
namespace Groovie {
Debugger::Debugger(GroovieEngine *vm) :
diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp
index 92ebcce298..13d0df0005 100644
--- a/engines/groovie/font.cpp
+++ b/engines/groovie/font.cpp
@@ -23,6 +23,10 @@
*
*/
+#include "common/array.h"
+#include "common/textconsole.h"
+#include "graphics/surface.h"
+
#include "groovie/font.h"
namespace Groovie {
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index 3ceeeb6018..71ee231b80 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -25,15 +25,19 @@
#include "groovie/graphics.h"
#include "groovie/groovie.h"
+
+#include "common/rect.h"
#include "common/system.h"
+#include "graphics/palette.h"
+
namespace Groovie {
GraphicsMan::GraphicsMan(GroovieEngine *vm) :
_vm(vm), _changed(false), _fading(0) {
// Create the game surfaces
- _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
- _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
+ _foreground.create(640, 320, _vm->_pixelFormat);
+ _background.create(640, 320, _vm->_pixelFormat);
}
GraphicsMan::~GraphicsMan() {
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 67c8f3dbc7..795cd6feb9 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -35,7 +35,9 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/events.h"
+#include "common/file.h"
#include "common/macresman.h"
+#include "common/textconsole.h"
#include "backends/audiocd/audiocd.h"
#include "engines/util.h"
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index f8fad8d91f..9335ffb7e4 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -33,7 +33,7 @@
#include "graphics/pixelformat.h"
namespace Common {
- class MacResManager;
+class MacResManager;
}
/**
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index 45f9800211..b7078f4c9e 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -29,8 +29,11 @@
#include "backends/audiocd/audiocd.h"
#include "common/config-manager.h"
+#include "common/debug.h"
+#include "common/file.h"
#include "common/macresman.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "audio/midiparser.h"
namespace Groovie {
diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp
index 8badd90012..3fee87d7bb 100644
--- a/engines/groovie/player.cpp
+++ b/engines/groovie/player.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "groovie/player.h"
#include "groovie/groovie.h"
diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp
index 9c4e6fb2fa..7670ab4315 100644
--- a/engines/groovie/resource.cpp
+++ b/engines/groovie/resource.cpp
@@ -24,8 +24,11 @@
*/
#include "common/archive.h"
+#include "common/debug.h"
+#include "common/file.h"
#include "common/macresman.h"
#include "common/substream.h"
+#include "common/textconsole.h"
#include "groovie/resource.h"
#include "groovie/groovie.h"
diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h
index 37fa50f2ea..9c306beecb 100644
--- a/engines/groovie/resource.h
+++ b/engines/groovie/resource.h
@@ -27,7 +27,7 @@
#define GROOVIE_RESOURCE_H
namespace Common {
- class MacResManager;
+class MacResManager;
}
namespace Groovie {
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 4d7157c797..be9c4f6921 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -30,7 +30,11 @@
#include "groovie/graphics.h"
#include "groovie/groovie.h"
+#include "common/debug.h"
+#include "common/textconsole.h"
+
#include "graphics/jpeg.h"
+#include "graphics/palette.h"
#ifdef USE_RGB_COLOR
// Required for the YUV to RGB conversion
@@ -175,7 +179,7 @@ void ROQPlayer::buildShowBuf() {
// Skip to the next pixel
out += _vm->_pixelFormat.bytesPerPixel;
if (!(x % _scaleX))
- in += _currBuf->bytesPerPixel;
+ in += _currBuf->format.bytesPerPixel;
}
#ifdef DITHER
_dither->nextLine();
@@ -328,8 +332,13 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
_prevBuf->free();
// Allocate new buffers
- _currBuf->create(width, height, 3);
- _prevBuf->create(width, height, 3);
+ // These buffers use YUV data, since we can not describe it with a
+ // PixelFormat struct we just add some dummy PixelFormat with the
+ // correct bytes per pixel value. Since the surfaces are only used
+ // internally and no code assuming RGB data is present is used on
+ // them it should be just fine.
+ _currBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0));
+ _prevBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0));
// Clear the buffers with black YUV values
byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0);
@@ -697,7 +706,7 @@ void ROQPlayer::copy(byte size, int destx, int desty, int offx, int offy) {
for (int i = 0; i < size; i++) {
// Copy the current line
- memcpy(dst, src, size * _currBuf->bytesPerPixel);
+ memcpy(dst, src, size * _currBuf->format.bytesPerPixel);
// Move to the beginning of the next line
dst += _currBuf->pitch;
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 8c7d3b0824..fabb70cca0 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -37,6 +37,7 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/EventRecorder.h"
+#include "common/file.h"
#include "common/macresman.h"
#include "gui/message.h"
diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp
index 6643177328..432b17802c 100644
--- a/engines/groovie/vdx.cpp
+++ b/engines/groovie/vdx.cpp
@@ -28,9 +28,12 @@
#include "groovie/groovie.h"
#include "groovie/lzss.h"
+#include "common/debug.h"
#include "common/debug-channels.h"
+#include "common/textconsole.h"
#include "audio/mixer.h"
#include "audio/decoders/raw.h"
+#include "graphics/palette.h"
#define TILE_SIZE 4 // Size of each tile on the image: only ever seen 4 so far
#define VDX_IDENT 0x9267 // 37479
diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h
index 38dd030bcb..31c7606cb7 100644
--- a/engines/groovie/vdx.h
+++ b/engines/groovie/vdx.h
@@ -29,7 +29,7 @@
#include "groovie/player.h"
namespace Common {
- class ReadStream;
+class ReadStream;
}
namespace Groovie {
diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp
index e862e339ce..95302c9235 100644
--- a/engines/hugo/detection.cpp
+++ b/engines/hugo/detection.cpp
@@ -26,6 +26,7 @@
#include "engines/advancedDetector.h"
#include "common/system.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp
index 50fcfa27db..f0dc84eae8 100644
--- a/engines/hugo/dialogs.cpp
+++ b/engines/hugo/dialogs.cpp
@@ -133,7 +133,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
Common::SeekableSubReadStream stream(&in, filPos, filPos + bmpSize);
arrayBmp[i * 2] = Graphics::ImageDecoder::loadFile(stream, g_system->getOverlayFormat());
arrayBmp[i * 2 + 1] = new Graphics::Surface();
- arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, arrayBmp[i * 2]->bytesPerPixel);
+ arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat());
byte *src = (byte *)arrayBmp[i * 2]->pixels;
byte *dst = (byte *)arrayBmp[i * 2 + 1]->pixels;
@@ -141,12 +141,12 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) {
src = (byte *)arrayBmp[i * 2]->getBasePtr(0, j);
dst = (byte *)arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2);
for (int k = arrayBmp[i * 2]->w; k > 0; k--) {
- for (int m = arrayBmp[i * 2]->bytesPerPixel; m > 0; m--) {
+ for (int m = arrayBmp[i * 2]->format.bytesPerPixel; m > 0; m--) {
*dst++ = *src++;
}
- src -= arrayBmp[i * 2]->bytesPerPixel;
+ src -= arrayBmp[i * 2]->format.bytesPerPixel;
- for (int m = arrayBmp[i * 2]->bytesPerPixel; m > 0; m--) {
+ for (int m = arrayBmp[i * 2]->format.bytesPerPixel; m > 0; m--) {
*dst++ = *src++;
}
}
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 41e69401d0..af4d094ceb 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -32,8 +32,11 @@
// Display.c - DIB related code for HUGOWIN
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "hugo/hugo.h"
#include "hugo/display.h"
diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp
index 3a79ba1e7d..ba4e420111 100644
--- a/engines/hugo/file.cpp
+++ b/engines/hugo/file.cpp
@@ -30,8 +30,10 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "common/config-manager.h"
#include "graphics/thumbnail.h"
#include "gui/saveload.h"
diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp
index 48f274e88a..021969f306 100644
--- a/engines/hugo/file_v1d.cpp
+++ b/engines/hugo/file_v1d.cpp
@@ -30,7 +30,9 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/file.h"
diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp
index dbb093752a..4f327b3095 100644
--- a/engines/hugo/file_v1w.cpp
+++ b/engines/hugo/file_v1w.cpp
@@ -30,7 +30,9 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/file.h"
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index d385157a11..0ad89e987e 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -30,7 +30,9 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/file.h"
diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp
index 2f3e5af3f0..6370fffa4d 100644
--- a/engines/hugo/file_v3d.cpp
+++ b/engines/hugo/file_v3d.cpp
@@ -30,7 +30,9 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/file.h"
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 7a42ca2ebe..a872a97bae 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -25,13 +25,14 @@
#include "common/system.h"
#include "common/random.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/debug-channels.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
-#include "hugo/game.h"
#include "hugo/file.h"
#include "hugo/schedule.h"
#include "hugo/display.h"
diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp
index 63e81924c4..c31d76abd0 100644
--- a/engines/hugo/intro.cpp
+++ b/engines/hugo/intro.cpp
@@ -31,6 +31,7 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/intro.h"
@@ -93,7 +94,7 @@ void intro_v1d::introInit() {
surf.h = 200;
surf.pixels = _vm->_screen->getFrontBuffer();
surf.pitch = 320;
- surf.bytesPerPixel = 1;
+ surf.format = Graphics::PixelFormat::createFormatCLUT8();
_vm->_screen->displayList(kDisplayInit);
}
@@ -247,7 +248,7 @@ void intro_v2d::introInit() {
surf.h = 200;
surf.pixels = _vm->_screen->getFrontBuffer();
surf.pitch = 320;
- surf.bytesPerPixel = 1;
+ surf.format = Graphics::PixelFormat::createFormatCLUT8();
char buffer[128];
@@ -293,7 +294,7 @@ void intro_v3d::introInit() {
surf.h = 200;
surf.pixels = _vm->_screen->getFrontBuffer();
surf.pitch = 320;
- surf.bytesPerPixel = 1;
+ surf.format = Graphics::PixelFormat::createFormatCLUT8();
char buffer[128];
if (_vm->_boot.registered)
diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp
index ab58e386ba..45893f6965 100644
--- a/engines/hugo/inventory.cpp
+++ b/engines/hugo/inventory.cpp
@@ -30,6 +30,7 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
#include "hugo/hugo.h"
diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp
index e8926b17c4..c02908e579 100644
--- a/engines/hugo/mouse.cpp
+++ b/engines/hugo/mouse.cpp
@@ -32,6 +32,7 @@
// mouse.cpp : Handle all mouse activity
+#include "common/debug.h"
#include "common/system.h"
#include "hugo/hugo.h"
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index 0a52a0f62d..acf9f6e50c 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -30,8 +30,7 @@
*
*/
-#include "common/system.h"
-#include "common/random.h"
+#include "common/debug.h"
#include "hugo/hugo.h"
#include "hugo/game.h"
diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp
index a8edb45746..95bedf4fa2 100644
--- a/engines/hugo/object_v1d.cpp
+++ b/engines/hugo/object_v1d.cpp
@@ -30,6 +30,7 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
#include "common/random.h"
diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp
index f3ba793a3b..54becd8234 100644
--- a/engines/hugo/object_v1w.cpp
+++ b/engines/hugo/object_v1w.cpp
@@ -30,6 +30,7 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
#include "common/random.h"
diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp
index b3c49262ad..7c47bf4f92 100644
--- a/engines/hugo/object_v2d.cpp
+++ b/engines/hugo/object_v2d.cpp
@@ -30,6 +30,7 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
#include "common/random.h"
diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp
index 2c6fc5d99d..3ff6c56ad3 100644
--- a/engines/hugo/object_v3d.cpp
+++ b/engines/hugo/object_v3d.cpp
@@ -30,6 +30,7 @@
*
*/
+#include "common/debug.h"
#include "common/system.h"
#include "common/random.h"
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 19cd4a333c..29a1d5efa3 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -30,12 +30,8 @@
*
*/
-#include "common/system.h"
#include "common/events.h"
-
-#include "common/random.h"
-#include "common/EventRecorder.h"
-#include "common/debug-channels.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/display.h"
diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h
index dd9244ba93..b00b8d5c43 100644
--- a/engines/hugo/parser.h
+++ b/engines/hugo/parser.h
@@ -32,6 +32,11 @@
#ifndef HUGO_PARSER_H
#define HUGO_PARSER_H
+
+namespace Common {
+struct Event;
+}
+
namespace Hugo {
enum seqTextParser {
diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp
index de18427d93..b2e515fd42 100644
--- a/engines/hugo/parser_v1d.cpp
+++ b/engines/hugo/parser_v1d.cpp
@@ -32,6 +32,7 @@
// parser.c - handles all keyboard/command input
+#include "common/debug.h"
#include "common/system.h"
#include "hugo/hugo.h"
diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp
index 305fb995e1..a39063357b 100644
--- a/engines/hugo/parser_v1w.cpp
+++ b/engines/hugo/parser_v1w.cpp
@@ -32,8 +32,7 @@
// parser.c - handles all keyboard/command input
-#include "common/system.h"
-#include "common/events.h"
+#include "common/debug.h"
#include "hugo/hugo.h"
#include "hugo/parser.h"
diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp
index 19570eb44c..6233f11c29 100644
--- a/engines/hugo/parser_v2d.cpp
+++ b/engines/hugo/parser_v2d.cpp
@@ -32,6 +32,7 @@
// parser.c - handles all keyboard/command input
+#include "common/debug.h"
#include "common/system.h"
#include "hugo/hugo.h"
diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp
index e5575ab8b7..8c4946c534 100644
--- a/engines/hugo/parser_v3d.cpp
+++ b/engines/hugo/parser_v3d.cpp
@@ -32,6 +32,7 @@
// parser.c - handles all keyboard/command input
+#include "common/debug.h"
#include "common/system.h"
#include "hugo/hugo.h"
diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp
index 76ec583857..68b659cd3f 100644
--- a/engines/hugo/route.cpp
+++ b/engines/hugo/route.cpp
@@ -32,6 +32,7 @@
// Find shortest route from hero to destination
+#include "common/debug.h"
#include "common/system.h"
#include "hugo/hugo.h"
diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp
index 9782dbc0bd..0e91124a7e 100644
--- a/engines/hugo/schedule.cpp
+++ b/engines/hugo/schedule.cpp
@@ -32,7 +32,9 @@
// This module contains all the scheduling and timing stuff
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "hugo/hugo.h"
#include "hugo/schedule.h"
diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp
index 24359a2c54..d657eb96a6 100644
--- a/engines/hugo/sound.cpp
+++ b/engines/hugo/sound.cpp
@@ -32,7 +32,9 @@
// sound.c - sound effects and music support
+#include "common/debug.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/config-manager.h"
#include "audio/decoders/raw.h"
diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp
index e1471239da..a563bc2b4f 100644
--- a/engines/kyra/animator_hof.cpp
+++ b/engines/kyra/animator_hof.cpp
@@ -26,7 +26,7 @@
#include "kyra/kyra_hof.h"
#include "kyra/wsamovie.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp
index b906d3a724..452d5e8062 100644
--- a/engines/kyra/animator_lok.cpp
+++ b/engines/kyra/animator_lok.cpp
@@ -23,16 +23,13 @@
*
*/
-#include "common/endian.h"
-
#include "kyra/kyra_lok.h"
#include "kyra/screen.h"
#include "kyra/animator_lok.h"
#include "kyra/sprites.h"
-#include "common/system.h"
-
namespace Kyra {
+
Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_screen = vm->screen();
diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp
index e6daba7aeb..47c0e3b03a 100644
--- a/engines/kyra/animator_mr.cpp
+++ b/engines/kyra/animator_mr.cpp
@@ -27,6 +27,8 @@
#include "kyra/resource.h"
#include "kyra/wsamovie.h"
+#include "common/system.h"
+
namespace Kyra {
void KyraEngine_MR::restorePage3() {
diff --git a/engines/kyra/animator_tim.cpp b/engines/kyra/animator_tim.cpp
index 0290b2aa7f..fa42042bef 100644
--- a/engines/kyra/animator_tim.cpp
+++ b/engines/kyra/animator_tim.cpp
@@ -23,9 +23,6 @@
*
*/
-#include "common/endian.h"
-#include "common/system.h"
-
#include "kyra/script_tim.h"
#include "kyra/wsamovie.h"
#include "kyra/screen_lol.h"
@@ -36,6 +33,8 @@
#include "kyra/screen_v2.h"
#endif
+#include "common/system.h"
+
namespace Kyra {
#ifdef ENABLE_LOL
diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp
index b06dffd36f..07ff4456e5 100644
--- a/engines/kyra/animator_v2.cpp
+++ b/engines/kyra/animator_v2.cpp
@@ -25,9 +25,6 @@
#include "kyra/kyra_v2.h"
#include "kyra/screen_v2.h"
-#include "kyra/wsamovie.h"
-
-#include "common/endian.h"
namespace Kyra {
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index 301271ad3c..066648b96f 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -23,18 +23,15 @@
*
*/
-
-#include "common/config-manager.h"
-#include "common/system.h"
#include "kyra/debugger.h"
#include "kyra/kyra_lok.h"
-#include "kyra/kyra_v2.h"
#include "kyra/kyra_hof.h"
-#include "kyra/screen.h"
#include "kyra/timer.h"
#include "kyra/resource.h"
#include "kyra/lol.h"
+#include "common/system.h"
+
namespace Kyra {
Debugger::Debugger(KyraEngine_v1 *vm)
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 6c111a6601..87cda9f3b6 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -22,17 +22,17 @@
* $Id$
*/
-#include "kyra/kyra_v1.h"
#include "kyra/kyra_lok.h"
#include "kyra/lol.h"
#include "kyra/kyra_hof.h"
#include "kyra/kyra_mr.h"
-
#include "common/config-manager.h"
-#include "engines/advancedDetector.h"
+#include "common/system.h"
#include "common/savefile.h"
+#include "engines/advancedDetector.h"
+
#include "base/plugins.h"
struct KYRAGameDescription {
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index ff7bf233d2..849b65a24b 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -25,11 +25,11 @@
#include "kyra/gui.h"
-#include "kyra/screen.h"
#include "kyra/text.h"
#include "kyra/wsamovie.h"
#include "common/savefile.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp
index 56971e563c..26e0d8f18a 100644
--- a/engines/kyra/gui_hof.cpp
+++ b/engines/kyra/gui_hof.cpp
@@ -23,15 +23,13 @@
*
*/
-#include "kyra/kyra_v1.h"
+#include "kyra/gui_hof.h"
#include "kyra/kyra_hof.h"
-#include "kyra/screen.h"
-#include "kyra/wsamovie.h"
#include "kyra/timer.h"
-#include "kyra/sound.h"
#include "kyra/resource.h"
+#include "kyra/sound.h"
-#include "common/savefile.h"
+#include "common/system.h"
#include "graphics/scaler.h"
diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp
index 3560478a1b..c31cbe3db2 100644
--- a/engines/kyra/gui_lok.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -23,18 +23,13 @@
*
*/
+#include "kyra/gui_lok.h"
#include "kyra/kyra_lok.h"
-#include "kyra/screen.h"
-#include "kyra/script.h"
-#include "kyra/text.h"
#include "kyra/animator_lok.h"
-#include "kyra/sound.h"
-#include "kyra/gui_lok.h"
+#include "kyra/text.h"
#include "kyra/timer.h"
#include "kyra/util.h"
-#include "kyra/item.h"
-#include "common/config-manager.h"
#include "common/savefile.h"
#include "common/system.h"
diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h
index e846933741..084a798de4 100644
--- a/engines/kyra/gui_lok.h
+++ b/engines/kyra/gui_lok.h
@@ -27,6 +27,7 @@
#define KYRA_GUI_LOK_H
#include "kyra/gui.h"
+#include "kyra/screen_lok.h"
namespace Kyra {
diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp
index 07fbf1664d..2625347d50 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -25,13 +25,15 @@
#ifdef ENABLE_LOL
+#include "kyra/gui_lol.h"
#include "kyra/lol.h"
#include "kyra/screen_lol.h"
-#include "kyra/gui_lol.h"
#include "kyra/resource.h"
#include "kyra/util.h"
+#include "kyra/sound.h"
#include "common/savefile.h"
+#include "common/system.h"
#include "common/config-manager.h"
#include "graphics/scaler.h"
diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp
index 6bdecfc3b8..6eca24fd46 100644
--- a/engines/kyra/gui_mr.cpp
+++ b/engines/kyra/gui_mr.cpp
@@ -26,12 +26,11 @@
#include "kyra/gui_mr.h"
#include "kyra/kyra_mr.h"
#include "kyra/text_mr.h"
-#include "kyra/wsamovie.h"
#include "kyra/resource.h"
-#include "kyra/sound.h"
#include "kyra/timer.h"
+#include "kyra/sound.h"
-#include "common/savefile.h"
+#include "common/system.h"
#include "graphics/scaler.h"
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp
index 2247a0ca2e..01922de7cf 100644
--- a/engines/kyra/gui_v2.cpp
+++ b/engines/kyra/gui_v2.cpp
@@ -24,12 +24,12 @@
*/
#include "kyra/gui_v2.h"
-#include "kyra/kyra_v2.h"
#include "kyra/screen_v2.h"
#include "kyra/text.h"
#include "kyra/util.h"
#include "common/savefile.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp
index 6a78a77c23..d460698272 100644
--- a/engines/kyra/items_hof.cpp
+++ b/engines/kyra/items_hof.cpp
@@ -25,6 +25,8 @@
#include "kyra/kyra_hof.h"
+#include "common/system.h"
+
namespace Kyra {
int KyraEngine_HoF::checkItemCollision(int x, int y) {
diff --git a/engines/kyra/items_lok.cpp b/engines/kyra/items_lok.cpp
index 322314e3ad..ed1299d239 100644
--- a/engines/kyra/items_lok.cpp
+++ b/engines/kyra/items_lok.cpp
@@ -24,17 +24,9 @@
*/
#include "kyra/kyra_lok.h"
-#include "kyra/seqplayer.h"
-#include "kyra/screen.h"
-#include "kyra/resource.h"
-#include "kyra/sound.h"
-#include "kyra/sprites.h"
-#include "kyra/wsamovie.h"
#include "kyra/animator_lok.h"
-#include "kyra/text.h"
#include "common/system.h"
-#include "common/savefile.h"
namespace Kyra {
diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp
index 2bc268ace3..5659876307 100644
--- a/engines/kyra/items_mr.cpp
+++ b/engines/kyra/items_mr.cpp
@@ -26,6 +26,8 @@
#include "kyra/kyra_mr.h"
#include "kyra/timer.h"
+#include "common/system.h"
+
namespace Kyra {
void KyraEngine_MR::removeTrashItems() {
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp
index c73792ef8e..de6aa55b08 100644
--- a/engines/kyra/kyra_hof.cpp
+++ b/engines/kyra/kyra_hof.cpp
@@ -23,18 +23,13 @@
*
*/
-#include "kyra/kyra_v1.h"
#include "kyra/kyra_hof.h"
-#include "kyra/screen.h"
#include "kyra/resource.h"
-#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
-#include "kyra/script.h"
-#include "kyra/script_tim.h"
#include "kyra/text_hof.h"
#include "kyra/timer.h"
#include "kyra/debugger.h"
#include "kyra/util.h"
+#include "kyra/sound.h"
#include "common/system.h"
#include "common/config-manager.h"
diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp
index d7ec6ada71..a04c28cad8 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -24,26 +24,19 @@
*/
#include "kyra/kyra_lok.h"
-
-#include "common/file.h"
-#include "common/system.h"
-#include "common/savefile.h"
-#include "common/config-manager.h"
-#include "common/debug-channels.h"
-
-#include "gui/message.h"
-
#include "kyra/resource.h"
-#include "kyra/screen.h"
-#include "kyra/script.h"
#include "kyra/seqplayer.h"
-#include "kyra/sound.h"
#include "kyra/sprites.h"
-#include "kyra/wsamovie.h"
#include "kyra/animator_lok.h"
-#include "kyra/text.h"
#include "kyra/debugger.h"
#include "kyra/timer.h"
+#include "kyra/sound.h"
+
+#include "common/system.h"
+#include "common/config-manager.h"
+#include "common/debug-channels.h"
+
+#include "gui/message.h"
namespace Kyra {
diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h
index d1ff24ad85..cfa231e2d0 100644
--- a/engines/kyra/kyra_lok.h
+++ b/engines/kyra/kyra_lok.h
@@ -32,6 +32,10 @@
#include "kyra/gui_lok.h"
#include "kyra/item.h"
+namespace Graphics {
+struct Surface;
+}
+
namespace Kyra {
class Movie;
diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp
index 65e78448a5..570ebe0bab 100644
--- a/engines/kyra/kyra_mr.cpp
+++ b/engines/kyra/kyra_mr.cpp
@@ -23,18 +23,15 @@
*
*/
-#include "kyra/kyra_v1.h"
#include "kyra/kyra_mr.h"
-#include "kyra/screen_mr.h"
#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
#include "kyra/text_mr.h"
#include "kyra/vqa.h"
-#include "kyra/gui.h"
#include "kyra/timer.h"
#include "kyra/debugger.h"
#include "kyra/gui_mr.h"
#include "kyra/resource.h"
+#include "kyra/sound.h"
#include "common/system.h"
#include "common/config-manager.h"
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 3a5d21196b..fb56e4a62a 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -23,22 +23,17 @@
*
*/
-#include "common/config-manager.h"
-#include "common/debug-channels.h"
-#include "common/EventRecorder.h"
-
-#include "audio/mididrv.h"
-#include "audio/mixer.h"
-
#include "kyra/kyra_v1.h"
#include "kyra/sound_intern.h"
#include "kyra/resource.h"
-#include "kyra/screen.h"
-#include "kyra/text.h"
#include "kyra/timer.h"
-#include "kyra/script.h"
#include "kyra/debugger.h"
+#include "common/error.h"
+#include "common/config-manager.h"
+#include "common/debug-channels.h"
+#include "common/EventRecorder.h"
+
namespace Kyra {
KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags)
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 801d31d676..08dc831dd9 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -29,10 +29,10 @@
#include "engines/engine.h"
#include "common/array.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/random.h"
#include "common/hashmap.h"
-#include "common/system.h"
#include "audio/mixer.h"
@@ -44,6 +44,10 @@ class SeekableReadStream;
class WriteStream;
} // End of namespace Common
+namespace Graphics {
+struct Surface;
+}
+
class KyraMetaEngine;
/**
@@ -166,7 +170,6 @@ enum MusicDataID {
class Screen;
class Resource;
class Sound;
-class Movie;
class TextDisplayer;
class StaticResource;
class TimerManager;
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 804097c81d..16b5ffa4e8 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -23,11 +23,12 @@
*
*/
-#include "common/config-manager.h"
-
#include "kyra/kyra_v2.h"
#include "kyra/screen_v2.h"
-#include "kyra/debugger.h"
+
+#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 78c9ed260d..ce73bffc89 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -28,17 +28,15 @@
#include "kyra/lol.h"
#include "kyra/screen_lol.h"
#include "kyra/resource.h"
-
-#include "kyra/sound.h"
#include "kyra/timer.h"
#include "kyra/util.h"
#include "kyra/debugger.h"
+#include "kyra/sound.h"
-#include "audio/decoders/voc.h"
#include "audio/audiostream.h"
#include "common/config-manager.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index d24f3b427f..a3170c2193 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -31,12 +31,15 @@
#include "kyra/kyra_v1.h"
#include "kyra/script_tim.h"
#include "kyra/script.h"
-#include "kyra/sound.h"
#include "kyra/gui_lol.h"
#include "kyra/text_lol.h"
#include "common/list.h"
+namespace Audio {
+class SeekableAudioStream;
+} // End of namespace Audio
+
namespace Kyra {
class Screen_LoL;
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 63b8072654..22786c1c7e 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -27,11 +27,7 @@
#include "kyra/resource_intern.h"
#include "common/config-manager.h"
-#include "common/endian.h"
-#include "common/file.h"
#include "common/fs.h"
-#include "common/func.h"
-#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp
index d14001aea6..81b3ec15ae 100644
--- a/engines/kyra/saveload.cpp
+++ b/engines/kyra/saveload.cpp
@@ -23,15 +23,15 @@
*
*/
-#include "common/endian.h"
+#include "kyra/kyra_v1.h"
+#include "kyra/util.h"
+
#include "common/savefile.h"
#include "common/system.h"
+
#include "graphics/thumbnail.h"
#include "graphics/surface.h"
-#include "kyra/kyra_v1.h"
-#include "kyra/util.h"
-
#define CURRENT_SAVE_VERSION 16
#define GF_FLOPPY (1 << 0)
diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp
index 7a487dcf7b..1fd6c0f3c8 100644
--- a/engines/kyra/saveload_hof.cpp
+++ b/engines/kyra/saveload_hof.cpp
@@ -23,17 +23,15 @@
*
*/
-#include "common/endian.h"
-#include "common/savefile.h"
-#include "common/substream.h"
-#include "common/system.h"
-
-#include "kyra/kyra_v2.h"
+#include "kyra/kyra_hof.h"
#include "kyra/screen_v2.h"
-#include "kyra/resource.h"
#include "kyra/sound.h"
#include "kyra/timer.h"
+#include "common/savefile.h"
+#include "common/substream.h"
+#include "common/system.h"
+
namespace Kyra {
Common::Error KyraEngine_HoF::saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumb) {
diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp
index 012ff138b5..5af4f1d8ca 100644
--- a/engines/kyra/saveload_lok.cpp
+++ b/engines/kyra/saveload_lok.cpp
@@ -23,17 +23,14 @@
*
*/
-#include "common/endian.h"
-#include "common/savefile.h"
-#include "common/system.h"
-
#include "kyra/kyra_lok.h"
#include "kyra/animator_lok.h"
-#include "kyra/screen.h"
#include "kyra/resource.h"
#include "kyra/sound.h"
#include "kyra/timer.h"
+#include "common/savefile.h"
+
namespace Kyra {
Common::Error KyraEngine_LoK::loadGameState(int slot) {
diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp
index b6c0693a16..c5240e2624 100644
--- a/engines/kyra/saveload_lol.cpp
+++ b/engines/kyra/saveload_lol.cpp
@@ -27,12 +27,9 @@
#include "kyra/lol.h"
#include "kyra/screen_lol.h"
-#include "kyra/resource.h"
-#include "common/endian.h"
#include "common/savefile.h"
#include "common/substream.h"
-#include "common/system.h"
#include "graphics/scaler.h"
diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp
index 79827361a3..b44c88a0b4 100644
--- a/engines/kyra/scene_hof.cpp
+++ b/engines/kyra/scene_hof.cpp
@@ -24,12 +24,10 @@
*/
#include "kyra/kyra_hof.h"
-#include "kyra/screen_v2.h"
#include "kyra/sound.h"
-#include "kyra/wsamovie.h"
#include "kyra/resource.h"
-#include "common/func.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/scene_lok.cpp b/engines/kyra/scene_lok.cpp
index 3abfe03fff..6200e2ab1e 100644
--- a/engines/kyra/scene_lok.cpp
+++ b/engines/kyra/scene_lok.cpp
@@ -24,19 +24,13 @@
*/
#include "kyra/kyra_lok.h"
-#include "kyra/seqplayer.h"
-#include "kyra/screen.h"
#include "kyra/resource.h"
#include "kyra/sound.h"
#include "kyra/sprites.h"
-#include "kyra/wsamovie.h"
#include "kyra/animator_lok.h"
-#include "kyra/text.h"
-#include "kyra/script.h"
#include "kyra/timer.h"
#include "common/system.h"
-#include "common/savefile.h"
namespace Kyra {
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index e070b91a44..ab9f89456b 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -29,9 +29,9 @@
#include "kyra/screen_lol.h"
#include "kyra/resource.h"
#include "kyra/timer.h"
-#include "kyra/sound.h"
#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp
index acb0710616..4eac4889b6 100644
--- a/engines/kyra/scene_mr.cpp
+++ b/engines/kyra/scene_mr.cpp
@@ -25,10 +25,11 @@
#include "kyra/kyra_mr.h"
#include "kyra/screen_mr.h"
-#include "kyra/wsamovie.h"
#include "kyra/sound.h"
#include "kyra/resource.h"
+#include "common/system.h"
+
namespace Kyra {
void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2, int unk3) {
diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp
index 848735b4a5..bc88377892 100644
--- a/engines/kyra/scene_v1.cpp
+++ b/engines/kyra/scene_v1.cpp
@@ -24,7 +24,6 @@
*/
#include "kyra/kyra_v1.h"
-#include "kyra/screen.h"
namespace Kyra {
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp
index fdfbceb521..897f2e937f 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -24,7 +24,8 @@
*/
#include "kyra/kyra_v2.h"
-#include "kyra/screen.h"
+
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 58d8e7f3d4..20a1022b26 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "kyra/screen.h"
+#include "kyra/kyra_v1.h"
+#include "kyra/resource.h"
#include "common/endian.h"
#include "common/memstream.h"
@@ -31,12 +34,9 @@
#include "engines/util.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "graphics/sjis.h"
-#include "kyra/screen.h"
-#include "kyra/kyra_v1.h"
-#include "kyra/resource.h"
-
namespace Kyra {
Screen::Screen(KyraEngine_v1 *vm, OSystem *system)
diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp
index a180c28442..f0af53f024 100644
--- a/engines/kyra/screen_hof.cpp
+++ b/engines/kyra/screen_hof.cpp
@@ -23,10 +23,8 @@
*
*/
-#include "common/endian.h"
-
-#include "kyra/kyra_hof.h"
#include "kyra/screen_hof.h"
+#include "kyra/kyra_hof.h"
namespace Kyra {
diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp
index 227349754f..2431cde20b 100644
--- a/engines/kyra/screen_lok.cpp
+++ b/engines/kyra/screen_lok.cpp
@@ -23,10 +23,12 @@
*
*/
-#include "kyra/kyra_lok.h"
#include "kyra/screen_lok.h"
+#include "kyra/kyra_lok.h"
+
+#include "common/system.h"
-#include "graphics/cursorman.h"
+#include "graphics/palette.h"
namespace Kyra {
diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp
index ff35facbb5..20756e1fae 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -27,7 +27,10 @@
#include "kyra/screen_lol.h"
#include "kyra/lol.h"
-#include "kyra/resource.h"
+
+#include "common/system.h"
+
+#include "graphics/palette.h"
namespace Kyra {
diff --git a/engines/kyra/screen_mr.cpp b/engines/kyra/screen_mr.cpp
index 33bfc517f7..4ae52b924d 100644
--- a/engines/kyra/screen_mr.cpp
+++ b/engines/kyra/screen_mr.cpp
@@ -24,7 +24,6 @@
*/
#include "kyra/screen_mr.h"
-
#include "kyra/kyra_mr.h"
namespace Kyra {
diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp
index 956bf39b5a..21dfe0bd31 100644
--- a/engines/kyra/script.cpp
+++ b/engines/kyra/script.cpp
@@ -23,15 +23,11 @@
*
*/
-
-#include "common/endian.h"
-#include "common/stream.h"
-#include "common/util.h"
-#include "common/system.h"
-
+#include "kyra/script.h"
#include "kyra/kyra_v1.h"
#include "kyra/resource.h"
-#include "kyra/script.h"
+
+#include "common/endian.h"
namespace Kyra {
EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm), _scriptData(0), _filename(0) {
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index d57bb7efc5..056319e6d4 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -24,14 +24,11 @@
*/
#include "kyra/kyra_hof.h"
-#include "kyra/text_hof.h"
-#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
#include "kyra/timer.h"
-#include "kyra/script_tim.h"
#include "kyra/resource.h"
+#include "kyra/sound.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index a2bad8035e..30f1138360 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -23,12 +23,7 @@
*
*/
-#include "common/endian.h"
-#include "common/system.h"
-
#include "kyra/kyra_lok.h"
-#include "kyra/script.h"
-#include "kyra/screen.h"
#include "kyra/sprites.h"
#include "kyra/wsamovie.h"
#include "kyra/animator_lok.h"
@@ -36,6 +31,8 @@
#include "kyra/timer.h"
#include "kyra/sound.h"
+#include "common/system.h"
+
namespace Kyra {
int KyraEngine_LoK::o1_magicInMouseItem(EMCState *script) {
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index c9fb8df1fb..3185032218 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -29,8 +29,9 @@
#include "kyra/screen_lol.h"
#include "kyra/timer.h"
#include "kyra/resource.h"
+#include "kyra/sound.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index 18878b6543..b3943e1aef 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -24,14 +24,10 @@
*/
#include "kyra/kyra_mr.h"
-#include "kyra/script.h"
-#include "kyra/screen_mr.h"
#include "kyra/text_mr.h"
-#include "kyra/wsamovie.h"
-#include "kyra/timer.h"
#include "kyra/resource.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp
index 1e978caf15..004ceb97bb 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -24,10 +24,8 @@
*/
#include "kyra/script_tim.h"
-#include "kyra/script.h"
#include "kyra/resource.h"
#include "kyra/sound.h"
-#include "kyra/wsamovie.h"
#ifdef ENABLE_LOL
#include "kyra/lol.h"
@@ -35,7 +33,7 @@
#endif // ENABLE_LOL
#include "common/iff_container.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h
index 91f2e8589e..7cf7d0a7dd 100644
--- a/engines/kyra/script_tim.h
+++ b/engines/kyra/script_tim.h
@@ -36,6 +36,7 @@ namespace Kyra {
class WSAMovie_v2;
class Screen_v2;
+class Movie;
class LoLEngine;
class TimAnimator {
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index 12f26ec5f6..13fdcb7d97 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -26,6 +26,8 @@
#include "kyra/kyra_v1.h"
#include "kyra/screen.h"
+#include "common/system.h"
+
namespace Kyra {
int KyraEngine_v1::o1_queryGameFlag(EMCState *script) {
diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp
index 17e882398e..081f9dd517 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -27,7 +27,7 @@
#include "kyra/screen_v2.h"
#include "kyra/timer.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp
index 5160224591..16e89de146 100644
--- a/engines/kyra/seqplayer.cpp
+++ b/engines/kyra/seqplayer.cpp
@@ -23,18 +23,11 @@
*
*/
-
-#include "common/system.h"
-
-#include "engines/engine.h"
-
+#include "kyra/seqplayer.h"
#include "kyra/resource.h"
-#include "kyra/screen.h"
#include "kyra/sound.h"
-#include "kyra/wsamovie.h"
-#include "kyra/text.h"
-#include "kyra/seqplayer.h"
+#include "common/system.h"
#define SEQOP(n, x) { n, &SeqPlayer::x, #x }
diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp
index c55153b802..b268f13fc1 100644
--- a/engines/kyra/sequences_hof.cpp
+++ b/engines/kyra/sequences_hof.cpp
@@ -23,14 +23,10 @@
*
*/
-#include "kyra/kyra_v1.h"
#include "kyra/kyra_hof.h"
-#include "kyra/screen.h"
-#include "kyra/wsamovie.h"
-#include "kyra/sound.h"
-#include "kyra/text_hof.h"
#include "kyra/timer.h"
#include "kyra/resource.h"
+#include "kyra/sound.h"
#include "common/system.h"
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index 23af24064d..0b39201f85 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -25,14 +25,12 @@
#include "kyra/kyra_lok.h"
#include "kyra/seqplayer.h"
-#include "kyra/screen_lok.h"
#include "kyra/resource.h"
-#include "kyra/sound.h"
#include "kyra/sprites.h"
#include "kyra/wsamovie.h"
#include "kyra/animator_lok.h"
-#include "kyra/text.h"
#include "kyra/timer.h"
+#include "kyra/sound.h"
#include "common/system.h"
#include "common/savefile.h"
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index e8ea7a9dcb..da1245d7e6 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -28,9 +28,12 @@
#include "kyra/lol.h"
#include "kyra/screen_lol.h"
#include "kyra/resource.h"
+#include "kyra/sound.h"
#include "base/version.h"
+#include "common/system.h"
+
namespace Kyra {
#pragma mark - Intro
diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp
index 3824676213..4d9cdf0d5d 100644
--- a/engines/kyra/sequences_v2.cpp
+++ b/engines/kyra/sequences_v2.cpp
@@ -26,6 +26,8 @@
#include "kyra/kyra_v2.h"
#include "kyra/resource.h"
+#include "common/system.h"
+
namespace Kyra {
void KyraEngine_v2::runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp
index 9dd046e50b..1392824235 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -24,19 +24,16 @@
*/
-#include "common/system.h"
-#include "common/config-manager.h"
-
-#include "kyra/resource.h"
#include "kyra/sound.h"
+#include "kyra/resource.h"
#include "audio/mixer.h"
-#include "audio/decoders/voc.h"
#include "audio/audiostream.h"
#include "audio/decoders/flac.h"
#include "audio/decoders/mp3.h"
#include "audio/decoders/raw.h"
+#include "audio/decoders/voc.h"
#include "audio/decoders/vorbis.h"
namespace Kyra {
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index e2654afe12..16f6ca3eaa 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -40,10 +40,11 @@
*/
+#include "kyra/sound_intern.h"
+#include "kyra/resource.h"
+
#include "common/system.h"
#include "common/mutex.h"
-#include "kyra/resource.h"
-#include "kyra/sound_intern.h"
#include "audio/mixer.h"
#include "audio/fmopl.h"
diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp
index c5e9f6171d..fed21eba84 100644
--- a/engines/kyra/sound_amiga.cpp
+++ b/engines/kyra/sound_amiga.cpp
@@ -23,14 +23,11 @@
*
*/
-#include "common/system.h"
-#include "common/mutex.h"
-#include "kyra/resource.h"
#include "kyra/sound_intern.h"
+#include "kyra/resource.h"
#include "audio/mixer.h"
#include "audio/mods/maxtrax.h"
-#include "audio/audiostream.h"
namespace Kyra {
diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp
index 40daa0b5bd..83566372bf 100644
--- a/engines/kyra/sound_lok.cpp
+++ b/engines/kyra/sound_lok.cpp
@@ -23,8 +23,10 @@
*
*/
-#include "kyra/sound.h"
#include "kyra/kyra_lok.h"
+#include "kyra/sound.h"
+
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp
index 87679f5bfb..10d35e03d5 100644
--- a/engines/kyra/sound_lol.cpp
+++ b/engines/kyra/sound_lol.cpp
@@ -25,10 +25,12 @@
#ifdef ENABLE_LOL
-#include "kyra/sound.h"
#include "kyra/lol.h"
+#include "kyra/sound.h"
#include "kyra/resource.h"
+#include "common/system.h"
+
#include "audio/audiostream.h"
namespace Kyra {
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 084bae5aab..6b30824a2f 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -23,20 +23,17 @@
*
*/
+#include "kyra/sound_intern.h"
+#include "kyra/resource.h"
+
#include "common/config-manager.h"
#include "common/system.h"
-#include "kyra/resource.h"
-#include "kyra/sound_intern.h"
-#include "kyra/screen.h"
-
#include "backends/audiocd/audiocd.h"
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
-#include "common/util.h"
-
namespace Kyra {
SoundTowns::SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer)
diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp
index 52689869c6..23775d2946 100644
--- a/engines/kyra/sprites.cpp
+++ b/engines/kyra/sprites.cpp
@@ -23,19 +23,13 @@
*
*/
-
-#include "common/endian.h"
-#include "common/stream.h"
-#include "common/util.h"
-#include "common/system.h"
-#include "common/EventRecorder.h"
-
-#include "kyra/screen.h"
-#include "kyra/kyra_lok.h"
#include "kyra/sprites.h"
#include "kyra/resource.h"
#include "kyra/animator_lok.h"
+#include "common/system.h"
+#include "common/EventRecorder.h"
+
namespace Kyra {
Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) {
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index fe4bd2ad71..f83546e0dd 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -23,23 +23,22 @@
*
*/
-#include "common/endian.h"
-#include "common/md5.h"
-#include "kyra/kyra_v1.h"
+#include "kyra/resource.h"
#include "kyra/kyra_lok.h"
-#include "kyra/kyra_v2.h"
#include "kyra/kyra_hof.h"
#include "kyra/kyra_mr.h"
#include "kyra/screen.h"
#include "kyra/screen_lok.h"
#include "kyra/screen_hof.h"
#include "kyra/screen_mr.h"
-#include "kyra/resource.h"
#include "kyra/gui_lok.h"
#include "kyra/gui_hof.h"
#include "kyra/gui_mr.h"
#include "kyra/sound_intern.h"
+#include "common/endian.h"
+#include "common/md5.h"
+
namespace Kyra {
#define RESFILE_VERSION 73
diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp
index 09f952f67e..e0114cda29 100644
--- a/engines/kyra/text.cpp
+++ b/engines/kyra/text.cpp
@@ -23,12 +23,8 @@
*
*/
-#include "kyra/kyra_v1.h"
-#include "kyra/screen.h"
#include "kyra/text.h"
-
-#include "common/system.h"
-#include "common/endian.h"
+#include "kyra/kyra_v1.h"
namespace Kyra {
diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp
index 4c292b70db..c961d2bf49 100644
--- a/engines/kyra/text_hof.cpp
+++ b/engines/kyra/text_hof.cpp
@@ -24,11 +24,9 @@
*/
#include "kyra/text_hof.h"
-#include "kyra/kyra_hof.h"
-#include "kyra/script_tim.h"
#include "kyra/resource.h"
-#include "common/endian.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp
index 40f2217a2b..cca8e5aaf5 100644
--- a/engines/kyra/text_lok.cpp
+++ b/engines/kyra/text_lok.cpp
@@ -23,13 +23,14 @@
*
*/
-#include "kyra/kyra_lok.h"
-#include "kyra/screen_lok.h"
#include "kyra/text.h"
+#include "kyra/kyra_lok.h"
#include "kyra/animator_lok.h"
#include "kyra/sprites.h"
#include "kyra/timer.h"
+#include "common/system.h"
+
namespace Kyra {
void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const char *chatStr, uint8 charNum, const bool printText) {
diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp
index 9f98586303..c9a77be1b2 100644
--- a/engines/kyra/text_lol.cpp
+++ b/engines/kyra/text_lol.cpp
@@ -25,10 +25,13 @@
#ifdef ENABLE_LOL
+#include "kyra/text_lol.h"
#include "kyra/lol.h"
#include "kyra/screen_lol.h"
#include "kyra/timer.h"
-#include "kyra/util.h"
+#include "kyra/sound.h"
+
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/text_lol.h b/engines/kyra/text_lol.h
index 1e5bc8884e..edac131106 100644
--- a/engines/kyra/text_lol.h
+++ b/engines/kyra/text_lol.h
@@ -28,9 +28,11 @@
#ifndef KYRA_TEXT_LOL_H
#define KYRA_TEXT_LOL_H
+#include "common/scummsys.h"
+
namespace Kyra {
-class Screen_v2;
+class Screen_LoL;
class LoLEngine;
struct EMCState;
diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp
index 001faab016..5679dc1ee6 100644
--- a/engines/kyra/text_mr.cpp
+++ b/engines/kyra/text_mr.cpp
@@ -24,9 +24,10 @@
*/
#include "kyra/text_mr.h"
-#include "kyra/screen_mr.h"
#include "kyra/resource.h"
+#include "common/system.h"
+
namespace Kyra {
TextDisplayer_MR::TextDisplayer_MR(KyraEngine_MR *vm, Screen_MR *screen)
diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp
index 66b78d3c03..475f17cadc 100644
--- a/engines/kyra/timer.cpp
+++ b/engines/kyra/timer.cpp
@@ -23,11 +23,9 @@
*
*/
-#include "kyra/kyra_v1.h"
#include "kyra/timer.h"
-#include "common/func.h"
-#include "common/stream.h"
+#include "common/system.h"
namespace Kyra {
diff --git a/engines/kyra/timer_lok.cpp b/engines/kyra/timer_lok.cpp
index 85b98be724..3a312c22c6 100644
--- a/engines/kyra/timer_lok.cpp
+++ b/engines/kyra/timer_lok.cpp
@@ -23,14 +23,10 @@
*
*/
-#include "kyra/kyra_v1.h"
#include "kyra/kyra_lok.h"
-#include "kyra/screen.h"
#include "kyra/animator_lok.h"
#include "kyra/timer.h"
-#include "common/system.h"
-
namespace Kyra {
#define TimerV1(x) new Common::Functor1Mem<int, void, KyraEngine_LoK>(this, &KyraEngine_LoK::x)
diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp
index 90cfc1af78..a3dab365c7 100644
--- a/engines/kyra/timer_lol.cpp
+++ b/engines/kyra/timer_lol.cpp
@@ -26,9 +26,10 @@
#ifdef ENABLE_LOL
#include "kyra/lol.h"
-#include "kyra/screen_lol.h"
#include "kyra/timer.h"
+#include "common/system.h"
+
namespace Kyra {
#define TimerV2(x) new Common::Functor1Mem<int, void, LoLEngine>(this, &LoLEngine::x)
diff --git a/engines/kyra/timer_mr.cpp b/engines/kyra/timer_mr.cpp
index 0d89decf5a..97ce7c166d 100644
--- a/engines/kyra/timer_mr.cpp
+++ b/engines/kyra/timer_mr.cpp
@@ -26,6 +26,8 @@
#include "kyra/kyra_mr.h"
#include "kyra/timer.h"
+#include "common/system.h"
+
namespace Kyra {
#define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_MR>(this, &KyraEngine_MR::x)
diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp
index b3371793de..28071bc171 100644
--- a/engines/kyra/vqa.cpp
+++ b/engines/kyra/vqa.cpp
@@ -33,16 +33,14 @@
#include "kyra/vqa.h"
+#include "kyra/resource.h"
#include "common/system.h"
+
#include "audio/audiostream.h"
#include "audio/mixer.h"
#include "audio/decoders/raw.h"
-#include "kyra/sound.h"
-#include "kyra/screen.h"
-#include "kyra/resource.h"
-
namespace Kyra {
VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) {
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index c9536484a3..db324d48d4 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -23,18 +23,13 @@
*
*/
-
-#include "common/endian.h"
-#include "common/system.h"
-
-#include "kyra/kyra_v1.h"
-#include "kyra/kyra_v2.h"
-#include "kyra/screen.h"
-#include "kyra/screen_v2.h"
#include "kyra/wsamovie.h"
#include "kyra/resource.h"
+#include "common/endian.h"
+
namespace Kyra {
+
WSAMovie_v1::WSAMovie_v1(KyraEngine_v1 *vm)
: Movie(vm), _frameData(0), _frameOffsTable(0), _offscreenBuffer(0), _deltaBuffer(0) {
}
diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h
index d2c041742a..f755cdd557 100644
--- a/engines/kyra/wsamovie.h
+++ b/engines/kyra/wsamovie.h
@@ -26,10 +26,10 @@
#ifndef KYRA_WSAMOVIE_H
#define KYRA_WSAMOVIE_H
+#include "kyra/kyra_v1.h"
+
namespace Kyra {
-class KyraEngine_v1;
-class Screen_v2;
class Palette;
class Movie {
diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp
index 7288889f09..2bf9bd4999 100644
--- a/engines/lastexpress/data/animation.cpp
+++ b/engines/lastexpress/data/animation.cpp
@@ -35,7 +35,10 @@
#include "common/events.h"
#include "common/rational.h"
+#include "common/rect.h"
#include "common/stream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "engines/engine.h"
@@ -266,7 +269,7 @@ void Animation::play() {
if (_changed) {
// Create a temporary surface to merge the overlay with the background
Graphics::Surface *s = new Graphics::Surface;
- s->create(640, 480, 2);
+ s->create(640, 480, Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
draw(s);
diff --git a/engines/lastexpress/data/archive.h b/engines/lastexpress/data/archive.h
index 3860245bc5..17b1d661fa 100644
--- a/engines/lastexpress/data/archive.h
+++ b/engines/lastexpress/data/archive.h
@@ -39,6 +39,9 @@
*/
#include "common/archive.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
+#include "common/str.h"
namespace LastExpress {
diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp
index 8b0d338f64..e8236bca86 100644
--- a/engines/lastexpress/data/background.cpp
+++ b/engines/lastexpress/data/background.cpp
@@ -31,6 +31,7 @@
#include "lastexpress/debug.h"
+#include "common/rect.h"
#include "common/stream.h"
namespace LastExpress {
diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp
index 99239606ab..d9acbb8382 100644
--- a/engines/lastexpress/data/font.cpp
+++ b/engines/lastexpress/data/font.cpp
@@ -25,8 +25,10 @@
#include "lastexpress/data/font.h"
+#include "common/rect.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace LastExpress {
diff --git a/engines/lastexpress/data/font.h b/engines/lastexpress/data/font.h
index d49db35ba5..7bcf03ed7d 100644
--- a/engines/lastexpress/data/font.h
+++ b/engines/lastexpress/data/font.h
@@ -39,10 +39,12 @@
byte {x} - Unknown data (probably just garbage)
*/
+#include "common/str.h"
#include "graphics/surface.h"
namespace Common {
class SeekableReadStream;
+struct Rect;
}
namespace LastExpress {
diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp
index 5a943982c4..e893d641a5 100644
--- a/engines/lastexpress/data/scene.cpp
+++ b/engines/lastexpress/data/scene.cpp
@@ -31,6 +31,7 @@
#include "lastexpress/lastexpress.h"
#include "lastexpress/resource.h"
+#include "common/textconsole.h"
#include "common/stream.h"
namespace LastExpress {
diff --git a/engines/lastexpress/data/scene.h b/engines/lastexpress/data/scene.h
index 7fc9425f28..9ec1899402 100644
--- a/engines/lastexpress/data/scene.h
+++ b/engines/lastexpress/data/scene.h
@@ -72,9 +72,15 @@
#include "lastexpress/shared.h"
#include "common/array.h"
+#include "common/rect.h"
namespace Common {
class SeekableReadStream;
+class String;
+}
+
+namespace Graphics {
+struct Surface;
}
namespace LastExpress {
diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp
index 2308d70a2b..b986a33d5c 100644
--- a/engines/lastexpress/data/sequence.cpp
+++ b/engines/lastexpress/data/sequence.cpp
@@ -30,6 +30,7 @@
#include "lastexpress/debug.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace LastExpress {
@@ -82,7 +83,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) {
AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f) : _palette(NULL) {
_palSize = 1;
// TODO: use just the needed rectangle
- _image.create(640, 480, 1);
+ _image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8());
//debugC(6, kLastExpressDebugGraphics, " Offsets: data=%d, unknown=%d, palette=%d", f.dataOffset, f.unknown, f.paletteOffset);
//debugC(6, kLastExpressDebugGraphics, " Position: (%d, %d) - (%d, %d)", f.xPos1, f.yPos1, f.xPos2, f.yPos2);
diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h
index 7ad0a57254..cd16f26ab2 100644
--- a/engines/lastexpress/data/sequence.h
+++ b/engines/lastexpress/data/sequence.h
@@ -77,6 +77,8 @@
#include "lastexpress/shared.h"
#include "common/array.h"
+#include "common/rect.h"
+#include "common/str.h"
namespace Common {
class SeekableReadStream;
diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp
index 6389489abb..a50fa7be08 100644
--- a/engines/lastexpress/data/snd.cpp
+++ b/engines/lastexpress/data/snd.cpp
@@ -32,7 +32,10 @@
#include "audio/decoders/adpcm_intern.h"
#include "audio/audiostream.h"
+#include "common/debug.h"
#include "common/memstream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace LastExpress {
diff --git a/engines/lastexpress/data/snd.h b/engines/lastexpress/data/snd.h
index 2d28404f42..61d1c0951a 100644
--- a/engines/lastexpress/data/snd.h
+++ b/engines/lastexpress/data/snd.h
@@ -42,8 +42,8 @@
#include "audio/mixer.h"
namespace Audio {
- class AudioStream;
- class QueuingAudioStream;
+class AudioStream;
+class QueuingAudioStream;
}
namespace Common {
diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp
index 953edd1d1a..2bc5d3c5ad 100644
--- a/engines/lastexpress/data/subtitle.cpp
+++ b/engines/lastexpress/data/subtitle.cpp
@@ -33,7 +33,9 @@
#include "lastexpress/debug.h"
#include "common/debug.h"
+#include "common/rect.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace LastExpress {
diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h
index ccef312cd6..8c6cc2bafc 100644
--- a/engines/lastexpress/entities/entity.h
+++ b/engines/lastexpress/entities/entity.h
@@ -35,6 +35,7 @@
#include "common/array.h"
#include "common/func.h"
#include "common/serializer.h"
+#include "common/textconsole.h"
namespace LastExpress {
diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h
index d97ebc1b55..4196bfe06a 100644
--- a/engines/lastexpress/game/state.h
+++ b/engines/lastexpress/game/state.h
@@ -28,8 +28,10 @@
#include "lastexpress/shared.h"
+#include "common/rect.h"
#include "common/serializer.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace LastExpress {
diff --git a/engines/lastexpress/graphics.cpp b/engines/lastexpress/graphics.cpp
index e5a69d16ea..c45baba808 100644
--- a/engines/lastexpress/graphics.cpp
+++ b/engines/lastexpress/graphics.cpp
@@ -25,20 +25,23 @@
#include "lastexpress/graphics.h"
+#include "common/rect.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace LastExpress {
#define COLOR_KEY 0xFFFF
GraphicsManager::GraphicsManager() : _changed(false) {
- _screen.create(640, 480, 2);
+ const Graphics::PixelFormat format(2, 5, 5, 5, 0, 10, 5, 0, 0);
+ _screen.create(640, 480, format);
// Create the game surfaces
- _backgroundA.create(640, 480, 2);
- _backgroundC.create(640, 480, 2);
- _overlay.create(640, 480, 2);
- _inventory.create(640, 480, 2);
+ _backgroundA.create(640, 480, format);
+ _backgroundC.create(640, 480, format);
+ _overlay.create(640, 480, format);
+ _inventory.create(640, 480, format);
clear(kBackgroundAll);
}
diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp
index 5a77b23602..dff686a503 100644
--- a/engines/lastexpress/resource.cpp
+++ b/engines/lastexpress/resource.cpp
@@ -34,6 +34,7 @@
#include "common/debug.h"
#include "common/file.h"
+#include "common/textconsole.h"
namespace LastExpress {
diff --git a/engines/lure/disk.h b/engines/lure/disk.h
index d2848cc587..79aaf80bbc 100644
--- a/engines/lure/disk.h
+++ b/engines/lure/disk.h
@@ -33,7 +33,7 @@
#include "lure/res_struct.h"
namespace Common {
- class File;
+class File;
}
namespace Lure {
diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp
index f96b5015bc..d3d5067cce 100644
--- a/engines/lure/memory.cpp
+++ b/engines/lure/memory.cpp
@@ -25,6 +25,7 @@
#include "lure/memory.h"
#include "common/file.h"
+#include "common/textconsole.h"
namespace Lure {
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h
index 6e2c11cb24..58ee3f4c02 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -27,9 +27,11 @@
#define LURE_RESSTRUCT_H
#include "lure/luredefs.h"
+#include "common/rect.h"
#include "common/list.h"
#include "common/file.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
namespace Lure {
diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp
index b64ef6393b..e02f492ef2 100644
--- a/engines/lure/screen.cpp
+++ b/engines/lure/screen.cpp
@@ -30,6 +30,8 @@
#include "lure/decode.h"
#include "lure/events.h"
+#include "graphics/palette.h"
+
namespace Lure {
static Screen *int_disk = NULL;
diff --git a/engines/lure/sound.h b/engines/lure/sound.h
index dd5538085c..7a894d814d 100644
--- a/engines/lure/sound.h
+++ b/engines/lure/sound.h
@@ -30,6 +30,7 @@
#include "lure/disk.h"
#include "lure/memory.h"
+#include "common/mutex.h"
#include "common/singleton.h"
#include "common/ptr.h"
#include "audio/mididrv.h"
diff --git a/engines/m4/actor.cpp b/engines/m4/actor.cpp
index ce8574a134..c61c6fe7d8 100644
--- a/engines/m4/actor.cpp
+++ b/engines/m4/actor.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/array.h"
+#include "common/textconsole.h"
#include "m4/actor.h"
#include "m4/m4_views.h"
#include "m4/assets.h"
diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp
index 26de121611..3fe050e604 100644
--- a/engines/m4/animation.cpp
+++ b/engines/m4/animation.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/assets.h"
#include "m4/animation.h"
#include "m4/compression.h"
diff --git a/engines/m4/compression.cpp b/engines/m4/compression.cpp
index 9b1416945c..8fe4fbf1eb 100644
--- a/engines/m4/compression.cpp
+++ b/engines/m4/compression.cpp
@@ -27,6 +27,7 @@
#include "m4/m4.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
namespace M4 {
diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp
index 88b4240901..cbcaa04669 100644
--- a/engines/m4/console.cpp
+++ b/engines/m4/console.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/m4.h"
#include "m4/console.h"
#include "m4/dialogs.h"
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index f67291f0a6..46c4b35b79 100644
--- a/engines/m4/converse.cpp
+++ b/engines/m4/converse.cpp
@@ -26,6 +26,7 @@
#include "common/array.h"
#include "common/hashmap.h"
#include "common/substream.h"
+#include "common/textconsole.h"
#include "m4/converse.h"
#include "m4/resource.h"
diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp
index 7efbc523f8..bc6228658d 100644
--- a/engines/m4/dialogs.cpp
+++ b/engines/m4/dialogs.cpp
@@ -25,6 +25,7 @@
#include "m4/dialogs.h"
#include "common/file.h"
+#include "common/textconsole.h"
namespace M4 {
@@ -444,7 +445,7 @@ void Dialog::draw() {
int dialogY = (_vm->_screen->height() - dlgHeight) / 2;
// Create the surface for the dialog
- create(dlgWidth, dlgHeight, 1);
+ create(dlgWidth, dlgHeight, Graphics::PixelFormat::createFormatCLUT8());
_coords.left = dialogX;
_coords.top = dialogY;
_coords.right = dialogX + dlgWidth + 1;
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index d982ecad0e..3db9934cec 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/m4.h"
#include "m4/globals.h"
#include "m4/graphics.h"
diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp
index a3eca13e1e..689a6ab8b4 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -23,11 +23,12 @@
*
*/
-#include "common/file.h"
-#include "common/endian.h"
#include "common/system.h"
#include "common/util.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
+
+#include "graphics/palette.h"
#include "m4/globals.h"
#include "m4/graphics.h"
@@ -96,7 +97,7 @@ void M4Surface::loadCodesM4(Common::SeekableReadStream *source) {
uint16 widthVal = source->readUint16LE();
uint16 heightVal = source->readUint16LE();
- create(widthVal, heightVal, 1);
+ create(widthVal, heightVal, Graphics::PixelFormat::createFormatCLUT8());
source->read(pixels, widthVal * heightVal);
}
@@ -110,7 +111,7 @@ void M4Surface::loadCodesMads(Common::SeekableReadStream *source) {
uint16 heightVal = 156;
byte *walkMap = new byte[source->size()];
- create(widthVal, heightVal, 1);
+ create(widthVal, heightVal, Graphics::PixelFormat::createFormatCLUT8());
source->read(walkMap, source->size());
byte *ptr = (byte *)getBasePtr(0, 0);
@@ -760,7 +761,7 @@ void M4Surface::rexLoadBackground(Common::SeekableReadStream *source, RGBList **
sourceUnc = packData.getItemStream(1);
assert((int)sourceUnc->size() >= sceneSize);
- create(sceneWidth, sceneHeight, 1);
+ create(sceneWidth, sceneHeight, Graphics::PixelFormat::createFormatCLUT8());
byte *pData = (byte *)pixels;
sourceUnc->read(pData, sceneSize);
@@ -813,7 +814,7 @@ void M4Surface::m4LoadBackground(Common::SeekableReadStream *source) {
assert(width() == (int)widthVal);
//debugCN(kDebugGraphics, "width(): %d, widthVal: %d, height(): %d, heightVal: %d\n", width(), widthVal, height(), heightVal);
- tileBuffer->create(tileWidth, tileHeight, 1);
+ tileBuffer->create(tileWidth, tileHeight, Graphics::PixelFormat::createFormatCLUT8());
for (curTileY = 0; curTileY < tilesY; curTileY++) {
clipY = MIN(heightVal, (1 + curTileY) * tileHeight) - (curTileY * tileHeight);
@@ -854,7 +855,7 @@ void M4Surface::madsLoadInterface(const Common::String &filename) {
// Chunk 1, data
intStream = intFile.getItemStream(1);
- create(320, 44, 1);
+ create(320, 44, Graphics::PixelFormat::createFormatCLUT8());
intStream->read(pixels, 320 * 44);
delete intStream;
diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h
index dbf6fac8c8..96e81f746e 100644
--- a/engines/m4/graphics.h
+++ b/engines/m4/graphics.h
@@ -105,19 +105,19 @@ private:
void m4LoadBackground(Common::SeekableReadStream *source);
public:
M4Surface(bool isScreen = false) {
- create(g_system->getWidth(), isScreen ? g_system->getHeight() : MADS_SURFACE_HEIGHT, 1);
+ create(g_system->getWidth(), isScreen ? g_system->getHeight() : MADS_SURFACE_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_isScreen = isScreen;
_rgbList = NULL;
_ownsData = true;
}
M4Surface(int width_, int height_) {
- create(width_, height_, 1);
+ create(width_, height_, Graphics::PixelFormat::createFormatCLUT8());
_isScreen = false;
_rgbList = NULL;
_ownsData = true;
}
M4Surface(int width_, int height_, byte *srcPixels, int pitch_) {
- bytesPerPixel = 1;
+ format = Graphics::PixelFormat::createFormatCLUT8();
w = width_;
h = height_;
pitch = pitch_;
@@ -157,7 +157,7 @@ public:
inline int width() const { return w; }
inline int height() const { return h; }
inline int getPitch() const { return pitch; }
- void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, 1); }
+ void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, Graphics::PixelFormat::createFormatCLUT8()); }
inline byte *getBasePtr() {
return (byte *)pixels;
}
diff --git a/engines/m4/gui.cpp b/engines/m4/gui.cpp
index 6619b37707..56cf96b589 100644
--- a/engines/m4/gui.cpp
+++ b/engines/m4/gui.cpp
@@ -25,6 +25,7 @@
#include "common/events.h"
#include "common/keyboard.h"
+#include "common/textconsole.h"
#include "m4/globals.h"
#include "m4/events.h"
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index d9a1bf940f..1a484322fd 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -30,7 +30,6 @@
#include "m4/burger_data.h"
#include "m4/m4.h"
#include "m4/resource.h"
-#include "m4/sprite.h"
#include "m4/hotspot.h"
#include "m4/font.h"
#include "m4/rails.h"
@@ -50,17 +49,15 @@
#include "m4/mads_anim.h"
#include "m4/mads_menus.h"
+#include "common/error.h"
#include "common/file.h"
#include "common/fs.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
-#include "common/endian.h"
#include "common/system.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/textconsole.h"
#include "engines/util.h"
-#include "graphics/surface.h"
-#include "audio/mididrv.h"
namespace M4 {
diff --git a/engines/m4/m4_menus.cpp b/engines/m4/m4_menus.cpp
index 118b09f50b..a20bb2660b 100644
--- a/engines/m4/m4_menus.cpp
+++ b/engines/m4/m4_menus.cpp
@@ -24,6 +24,7 @@
*/
#include "common/algorithm.h" // for find()
+#include "common/textconsole.h"
#include "gui/dialog.h"
#include "gui/message.h"
diff --git a/engines/m4/m4_scene.cpp b/engines/m4/m4_scene.cpp
index 0ace40bfc5..a0d8a503ab 100644
--- a/engines/m4/m4_scene.cpp
+++ b/engines/m4/m4_scene.cpp
@@ -24,6 +24,7 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "m4/m4_scene.h"
#include "m4/dialogs.h"
diff --git a/engines/m4/m4_views.cpp b/engines/m4/m4_views.cpp
index f4345787df..83f23edd3d 100644
--- a/engines/m4/m4_views.cpp
+++ b/engines/m4/m4_views.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/m4_views.h"
#include "m4/events.h"
#include "m4/font.h"
diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp
index 571a6fa899..e7ca9cb14d 100644
--- a/engines/m4/mads_anim.cpp
+++ b/engines/m4/mads_anim.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/mads_anim.h"
#include "m4/m4.h"
#include "m4/compression.h"
diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp
index 878e86c573..98a0d06412 100644
--- a/engines/m4/mads_logic.cpp
+++ b/engines/m4/mads_logic.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/m4.h"
#include "m4/dialogs.h"
#include "m4/mads_logic.h"
diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp
index 4ca8154793..437e9d2a6b 100644
--- a/engines/m4/mads_menus.cpp
+++ b/engines/m4/mads_menus.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "m4/mads_menus.h"
#include "m4/m4.h"
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index fd972cc6ea..7b82480ee2 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -24,6 +24,7 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "m4/mads_scene.h"
#include "m4/dialogs.h"
diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp
index b4385dbead..33c679c9bd 100644
--- a/engines/m4/mads_views.cpp
+++ b/engines/m4/mads_views.cpp
@@ -34,6 +34,7 @@
#include "m4/staticres.h"
#include "common/algorithm.h"
+#include "common/textconsole.h"
namespace M4 {
diff --git a/engines/m4/midi.cpp b/engines/m4/midi.cpp
index e49dbfa2e7..24ac60c22e 100644
--- a/engines/m4/midi.cpp
+++ b/engines/m4/midi.cpp
@@ -31,6 +31,7 @@
#include "audio/midiparser.h"
#include "common/config-manager.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
namespace M4 {
diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp
index 192cab0c83..1946797f75 100644
--- a/engines/m4/resource.cpp
+++ b/engines/m4/resource.cpp
@@ -28,6 +28,7 @@
#include "m4/events.h"
#include "common/substream.h"
+#include "common/textconsole.h"
namespace M4 {
diff --git a/engines/m4/script.cpp b/engines/m4/script.cpp
index 42d55c6dc7..cc60ec310d 100644
--- a/engines/m4/script.cpp
+++ b/engines/m4/script.cpp
@@ -24,6 +24,7 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "m4/m4.h"
#include "m4/script.h"
diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp
index 14c60c1c58..fb90cea5cc 100644
--- a/engines/m4/sound.cpp
+++ b/engines/m4/sound.cpp
@@ -28,6 +28,7 @@
#include "m4/compression.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp
index 77528ec8a6..cef9917381 100644
--- a/engines/m4/sprite.cpp
+++ b/engines/m4/sprite.cpp
@@ -24,6 +24,7 @@
*/
#include "common/rect.h"
+#include "common/textconsole.h"
#include "m4/globals.h"
#include "m4/graphics.h"
diff --git a/engines/m4/woodscript.cpp b/engines/m4/woodscript.cpp
index 1b9d9859ef..dc24548f84 100644
--- a/engines/m4/woodscript.cpp
+++ b/engines/m4/woodscript.cpp
@@ -26,6 +26,7 @@
#include "m4/woodscript.h"
#include "common/memstream.h"
+#include "graphics/palette.h"
namespace M4 {
diff --git a/engines/made/database.cpp b/engines/made/database.cpp
index 8d06aa0085..4e7a0467b1 100644
--- a/engines/made/database.cpp
+++ b/engines/made/database.cpp
@@ -27,6 +27,7 @@
#include "common/endian.h"
#include "common/util.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "made/database.h"
diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp
index 7e8330d3f4..388ff60aa8 100644
--- a/engines/made/graphics.cpp
+++ b/engines/made/graphics.cpp
@@ -23,7 +23,9 @@
*
*/
+#include "common/debug.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "made/graphics.h"
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index c81fa3db25..c791b657e7 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -26,8 +26,6 @@
#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/keyboard.h"
-#include "common/file.h"
-#include "common/savefile.h"
#include "common/config-manager.h"
#include "common/stream.h"
diff --git a/engines/made/music.cpp b/engines/made/music.cpp
index 2e06871e13..e5bbbc3b42 100644
--- a/engines/made/music.cpp
+++ b/engines/made/music.cpp
@@ -30,8 +30,6 @@
#include "audio/audiostream.h"
#include "audio/mididrv.h"
#include "audio/midiparser.h"
-#include "common/config-manager.h"
-#include "common/file.h"
#include "made/music.h"
diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp
index e37bd87a7e..5ab24c1984 100644
--- a/engines/made/pmvplayer.cpp
+++ b/engines/made/pmvplayer.cpp
@@ -169,7 +169,7 @@ bool PmvPlayer::play(const char *filename) {
if (!_surface) {
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
}
decompressMovieImage(imageData, *_surface, cmdOffs, pixelOffs, maskOffs, lineSize);
diff --git a/engines/made/redreader.cpp b/engines/made/redreader.cpp
index 3d36b69a28..2fcd7f43da 100644
--- a/engines/made/redreader.cpp
+++ b/engines/made/redreader.cpp
@@ -25,6 +25,7 @@
#include "made/redreader.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
namespace Made {
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index e556e4ab38..403520bec3 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/debug.h"
#include "common/endian.h"
#include "common/memstream.h"
#include "audio/mixer.h"
@@ -95,7 +96,7 @@ void PictureResource::loadRaw(byte *source, int size) {
}
_picture = new Graphics::Surface();
- _picture->create(width, height, 1);
+ _picture->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
decompressImage(source, *_picture, cmdOffs, pixelOffs, maskOffs, lineSize, cmdFlags, pixelFlags, maskFlags);
@@ -171,7 +172,7 @@ void PictureResource::loadChunked(byte *source, int size) {
}
_picture = new Graphics::Surface();
- _picture->create(width, height, 1);
+ _picture->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
decompressImage(source, *_picture, cmdOffs, pixelOffs, maskOffs, lineSize, cmdFlags, pixelFlags, maskFlags);
@@ -227,7 +228,7 @@ void AnimationResource::load(byte *source, int size) {
uint16 lineSize = sourceS->readUint16LE();
Graphics::Surface *frame = new Graphics::Surface();
- frame->create(frameWidth, frameHeight, 1);
+ frame->create(frameWidth, frameHeight, Graphics::PixelFormat::createFormatCLUT8());
decompressImage(source + frameOffs, *frame, cmdOffs, pixelOffs, maskOffs, lineSize, 0, 0, 0, _flags & 1);
diff --git a/engines/made/resource.h b/engines/made/resource.h
index ade6a23029..f1aeb7a87c 100644
--- a/engines/made/resource.h
+++ b/engines/made/resource.h
@@ -30,6 +30,7 @@
#include "common/file.h"
#include "common/stream.h"
#include "common/hashmap.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
#include "audio/audiostream.h"
diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp
index 2649e2bd37..4a73ba8e38 100644
--- a/engines/made/screen.cpp
+++ b/engines/made/screen.cpp
@@ -28,6 +28,8 @@
#include "made/resource.h"
#include "made/database.h"
+#include "graphics/palette.h"
+
namespace Made {
Screen::Screen(MadeEngine *vm) : _vm(vm) {
@@ -36,10 +38,10 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
_newPalette = new byte[768];
_backgroundScreen = new Graphics::Surface();
- _backgroundScreen->create(320, 200, 1);
+ _backgroundScreen->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
_workScreen = new Graphics::Surface();
- _workScreen->create(320, 200, 1);
+ _workScreen->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
_backgroundScreenDrawCtx.clipRect = Common::Rect(320, 200);
_workScreenDrawCtx.clipRect = Common::Rect(320, 200);
@@ -51,7 +53,7 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) {
// Screen mask is only needed in v2 games
if (_vm->getGameID() != GID_RTZ) {
_screenMask = new Graphics::Surface();
- _screenMask->create(320, 200, 1);
+ _screenMask->create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
_maskDrawCtx.clipRect = Common::Rect(320, 200);
_maskDrawCtx.destSurface = _screenMask;
}
diff --git a/engines/made/script.h b/engines/made/script.h
index 16c5ad604f..be719eba5f 100644
--- a/engines/made/script.h
+++ b/engines/made/script.h
@@ -29,6 +29,7 @@
#include "common/util.h"
#include "common/file.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Made {
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index 4f1937c057..c0a723438e 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -23,9 +23,7 @@
*
*/
-#include "common/endian.h"
#include "common/util.h"
-#include "common/events.h"
#include "backends/audiocd/audiocd.h"
#include "graphics/cursorman.h"
diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h
index 3bed27c5c8..b8b2a87d19 100644
--- a/engines/made/scriptfuncs.h
+++ b/engines/made/scriptfuncs.h
@@ -34,7 +34,7 @@
#include "made/resource.h"
namespace Audio {
- class PCSpeaker;
+class PCSpeaker;
}
namespace Made {
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 2afed0703b..ef34506991 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -37,8 +37,8 @@ class Engine;
class OSystem;
namespace Common {
- class FSList;
- class String;
+class FSList;
+class String;
}
/**
diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp
index a6ec2cf85a..02548d58fc 100644
--- a/engines/mohawk/bitmap.cpp
+++ b/engines/mohawk/bitmap.cpp
@@ -31,6 +31,7 @@
#include "common/memstream.h"
#include "common/substream.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
@@ -135,8 +136,12 @@ Common::Array<MohawkSurface *> MohawkBitmap::decodeImages(Common::SeekableReadSt
Graphics::Surface *MohawkBitmap::createSurface(uint16 width, uint16 height) {
Graphics::Surface *surface = new Graphics::Surface();
- byte bytesPerPixel = (getBitsPerPixel() <= 8) ? 1 : g_system->getScreenFormat().bytesPerPixel;
- surface->create(width, height, bytesPerPixel);
+ Graphics::PixelFormat format;
+ if (getBitsPerPixel() <= 8)
+ format = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ format = g_system->getScreenFormat();
+ surface->create(width, height, format);
return surface;
}
@@ -569,7 +574,7 @@ void MohawkBitmap::drawRaw(Graphics::Surface *surface) {
byte b = _data->readByte();
byte g = _data->readByte();
byte r = _data->readByte();
- if (surface->bytesPerPixel == 2)
+ if (surface->format.bytesPerPixel == 2)
*((uint16 *)surface->getBasePtr(x, y)) = pixelFormat.RGBToColor(r, g, b);
else
*((uint32 *)surface->getBasePtr(x, y)) = pixelFormat.RGBToColor(r, g, b);
@@ -856,7 +861,7 @@ MohawkSurface *DOSBitmap::decodeImage(Common::SeekableReadStream *stream) {
}
void DOSBitmap::expandMonochromePlane(Graphics::Surface *surface, Common::SeekableReadStream *rawStream) {
- assert(surface->bytesPerPixel == 1);
+ assert(surface->format.bytesPerPixel == 1);
byte *dst = (byte *)surface->pixels;
@@ -882,7 +887,7 @@ void DOSBitmap::expandMonochromePlane(Graphics::Surface *surface, Common::Seekab
*(dst + j * 4 + dstPixel) = (*(dst + j * 4 + dstPixel) >> 1) | (((temp >> srcBit) & 1) << 3)
void DOSBitmap::expandEGAPlanes(Graphics::Surface *surface, Common::SeekableReadStream *rawStream) {
- assert(surface->bytesPerPixel == 1);
+ assert(surface->format.bytesPerPixel == 1);
// Note that the image is in EGA planar form and not just standard 4bpp
// This seems to contradict the PoP specs which seem to do
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index ee67c9f23c..93cbe87e55 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -29,6 +29,9 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
#ifdef ENABLE_CSTIME
#include "mohawk/cstime.h"
#endif
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp
index 955e0e5af6..46faae08f5 100644
--- a/engines/mohawk/cstime.cpp
+++ b/engines/mohawk/cstime.cpp
@@ -30,15 +30,14 @@
#include "mohawk/cstime_view.h"
#include "mohawk/resource.h"
#include "mohawk/cursors.h"
-#include "mohawk/sound.h"
#include "mohawk/video.h"
#include "common/config-manager.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/fs.h"
-
-#include "engines/util.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/cstime_cases.cpp b/engines/mohawk/cstime_cases.cpp
index 408f1c9d9a..c4801f822c 100644
--- a/engines/mohawk/cstime_cases.cpp
+++ b/engines/mohawk/cstime_cases.cpp
@@ -26,6 +26,8 @@
#include "mohawk/cstime_cases.h"
#include "mohawk/cstime_ui.h"
+#include "common/textconsole.h"
+
namespace Mohawk {
CSTimeCase1::CSTimeCase1(MohawkEngine_CSTime *vm) : CSTimeCase(vm, 1) {
diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp
index 14e5d99e51..66dce1da92 100644
--- a/engines/mohawk/cstime_game.cpp
+++ b/engines/mohawk/cstime_game.cpp
@@ -29,6 +29,8 @@
#include "mohawk/resource.h"
#include "mohawk/sound.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp
index 935b0321da..106f7ea319 100644
--- a/engines/mohawk/cstime_ui.cpp
+++ b/engines/mohawk/cstime_ui.cpp
@@ -29,6 +29,8 @@
#include "mohawk/resource.h"
#include "common/algorithm.h" // find
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/fontman.h"
namespace Mohawk {
diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp
index 115b363b6e..12d641a9ff 100644
--- a/engines/mohawk/cstime_view.cpp
+++ b/engines/mohawk/cstime_view.cpp
@@ -30,6 +30,8 @@
#include "mohawk/cursors.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index b4969f990a..66669e35c9 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -148,7 +148,7 @@ void MystCursorManager::setCursor(uint16 id) {
delete clrcStream;
// Myst ME stores some cursors as 24bpp images instead of 8bpp
- if (surface->bytesPerPixel == 1) {
+ if (surface->format.bytesPerPixel == 1) {
CursorMan.replaceCursor((byte *)surface->pixels, surface->w, surface->h, hotspotX, hotspotY, 0);
CursorMan.replaceCursorPalette(mhkSurface->getPalette(), 0, 256);
} else {
diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h
index f8a9429689..1fb8b35714 100644
--- a/engines/mohawk/cursors.h
+++ b/engines/mohawk/cursors.h
@@ -29,11 +29,11 @@
#include "common/scummsys.h"
namespace Common {
- class MacResManager;
- class NEResources;
- class PEResources;
- class SeekableReadStream;
- class String;
+class MacResManager;
+class NEResources;
+class PEResources;
+class SeekableReadStream;
+class String;
}
#include "mohawk/resource.h"
diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp
index 80f4c0f702..c14d3327d0 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -26,9 +26,9 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
-#include "common/config-manager.h"
-#include "common/file.h"
#include "common/savefile.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "mohawk/livingbooks.h"
diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index fb7203f855..36dbcbde7b 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -793,6 +793,21 @@ static const MohawkGameDescription gameDescriptions[] = {
{
{
+ "seussabc",
+ "Demo",
+ AD_ENTRY1("BookOutline", "17d72660680ae32cd7c560d0cf04d2ef"),
+ Common::EN_ANY,
+ Common::kPlatformMacintosh,
+ ADGF_DEMO,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV2,
+ GF_DEMO,
+ 0
+ },
+
+ {
+ {
"1stdegree",
"",
AD_ENTRY1("AL236_1.MHK", "3ba145492a7b8b4dee0ef4222c5639c3"),
@@ -1023,6 +1038,23 @@ static const MohawkGameDescription gameDescriptions[] = {
0
},
+ // Just Grandma and Me 1.0
+ // From scoriae
+ {
+ {
+ "grandma",
+ "v1.0",
+ AD_ENTRY1("PAGES.512", "e694ac10f957dd2e20611350bf968da3"),
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ Common::GUIO_NONE
+ },
+ GType_LIVINGBOOKSV1,
+ GF_LB_10,
+ "GRANDMA.EXE"
+ },
+
{
{
"grandma",
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index c5a0c7e86d..4c7e52f02f 100644
--- a/engines/mohawk/dialogs.cpp
+++ b/engines/mohawk/dialogs.cpp
@@ -27,7 +27,9 @@
#include "mohawk/dialogs.h"
#include "gui/gui-manager.h"
-#include "common/savefile.h"
+#include "gui/ThemeEngine.h"
+#include "gui/widget.h"
+#include "common/system.h"
#include "common/translation.h"
#ifdef ENABLE_MYST
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp
index 81d2b6f019..a1bcb55f7b 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -28,7 +28,10 @@
#include "mohawk/livingbooks.h"
#include "common/substream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "engines/util.h"
+#include "graphics/palette.h"
#include "graphics/primitives.h"
#include "gui/message.h"
@@ -70,14 +73,14 @@ MohawkSurface::~MohawkSurface() {
void MohawkSurface::convertToTrueColor() {
assert(_surface);
- if (_surface->bytesPerPixel > 1)
+ if (_surface->format.bytesPerPixel > 1)
return;
assert(_palette);
Graphics::PixelFormat pixelFormat = g_system->getScreenFormat();
Graphics::Surface *surface = new Graphics::Surface();
- surface->create(_surface->w, _surface->h, pixelFormat.bytesPerPixel);
+ surface->create(_surface->w, _surface->h, pixelFormat);
for (uint16 i = 0; i < _surface->h; i++) {
for (uint16 j = 0; j < _surface->w; j++) {
@@ -292,7 +295,7 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) {
// Initialize our buffer
_backBuffer = new Graphics::Surface();
- _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat.bytesPerPixel);
+ _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat);
}
MystGraphics::~MystGraphics() {
@@ -486,7 +489,7 @@ void MystGraphics::copyImageSectionToBackBuffer(uint16 image, Common::Rect src,
debug(3, "\theight: %d", height);
for (uint16 i = 0; i < height; i++)
- memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->bytesPerPixel);
+ memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->format.bytesPerPixel);
}
void MystGraphics::copyImageToScreen(uint16 image, Common::Rect dest) {
@@ -646,7 +649,7 @@ RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm
// The actual game graphics only take up the first 392 rows. The inventory
// occupies the rest of the screen and we don't use the buffer to hold that.
_mainScreen = new Graphics::Surface();
- _mainScreen->create(608, 392, _pixelFormat.bytesPerPixel);
+ _mainScreen->create(608, 392, _pixelFormat);
_updatesEnabled = true;
_scheduledTransition = -1; // no transition
@@ -677,7 +680,7 @@ void RivenGraphics::copyImageToScreen(uint16 image, uint32 left, uint32 top, uin
surface->w = 608 - left;
for (uint16 i = 0; i < surface->h; i++)
- memcpy(_mainScreen->getBasePtr(left, i + top), surface->getBasePtr(0, i), surface->w * surface->bytesPerPixel);
+ memcpy(_mainScreen->getBasePtr(left, i + top), surface->getBasePtr(0, i), surface->w * surface->format.bytesPerPixel);
_dirtyScreen = true;
}
@@ -972,7 +975,7 @@ void RivenGraphics::drawImageRect(uint16 id, Common::Rect srcRect, Common::Rect
assert(srcRect.width() == dstRect.width() && srcRect.height() == dstRect.height());
for (uint16 i = 0; i < srcRect.height(); i++)
- memcpy(_mainScreen->getBasePtr(dstRect.left, i + dstRect.top), surface->getBasePtr(srcRect.left, i + srcRect.top), srcRect.width() * surface->bytesPerPixel);
+ memcpy(_mainScreen->getBasePtr(dstRect.left, i + dstRect.top), surface->getBasePtr(srcRect.left, i + srcRect.top), srcRect.width() * surface->format.bytesPerPixel);
_dirtyScreen = true;
}
diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h
index 5cac68c510..c7e9b98d49 100644
--- a/engines/mohawk/graphics.h
+++ b/engines/mohawk/graphics.h
@@ -33,7 +33,7 @@
#include "graphics/pict.h"
namespace Graphics {
- class JPEG;
+class JPEG;
}
namespace Mohawk {
diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp
index 4ea742dff6..5079375896 100644
--- a/engines/mohawk/installer_archive.cpp
+++ b/engines/mohawk/installer_archive.cpp
@@ -27,8 +27,6 @@
#include "common/dcl.h"
#include "common/debug.h"
-#include "common/substream.h"
-#include "common/util.h"
namespace Mohawk {
diff --git a/engines/mohawk/installer_archive.h b/engines/mohawk/installer_archive.h
index 565b363be3..d33fbe5bcd 100644
--- a/engines/mohawk/installer_archive.h
+++ b/engines/mohawk/installer_archive.h
@@ -27,6 +27,8 @@
#include "common/scummsys.h"
#include "common/endian.h"
#include "common/file.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
#include "common/str.h"
#ifndef MOHAWK_INSTALLER_ARCHIVE_H
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 22ea8d07a1..2475965812 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -26,13 +26,17 @@
#include "mohawk/livingbooks.h"
#include "mohawk/resource.h"
#include "mohawk/cursors.h"
-#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/config-manager.h"
+#include "common/error.h"
#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/fs.h"
#include "common/archive.h"
+#include "common/textconsole.h"
+
+#include "graphics/palette.h"
#include "engines/util.h"
diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp
index 84f69af2ac..4237c712d9 100644
--- a/engines/mohawk/livingbooks_code.cpp
+++ b/engines/mohawk/livingbooks_code.cpp
@@ -26,6 +26,9 @@
#include "mohawk/livingbooks.h"
#include "mohawk/resource.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
namespace Mohawk {
bool LBValue::operator==(const LBValue &x) const {
diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp
index 015cbffb26..f63645f1ac 100644
--- a/engines/mohawk/mohawk.cpp
+++ b/engines/mohawk/mohawk.cpp
@@ -24,13 +24,9 @@
*/
#include "common/scummsys.h"
-#include "common/config-manager.h"
-#include "common/file.h"
-#include "common/events.h"
-#include "common/keyboard.h"
-
-#include "base/plugins.h"
-#include "base/version.h"
+#include "common/error.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "mohawk/mohawk.h"
#include "mohawk/cursors.h"
diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h
index 1bad8a08ce..8a853d151e 100644
--- a/engines/mohawk/mohawk.h
+++ b/engines/mohawk/mohawk.h
@@ -34,7 +34,7 @@
class OSystem;
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
/**
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index 1aba820fed..655a38b578 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -25,7 +25,9 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/system.h"
#include "common/translation.h"
+#include "common/textconsole.h"
#include "mohawk/cursors.h"
#include "mohawk/graphics.h"
diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp
index 21f6627f60..dc00bff923 100644
--- a/engines/mohawk/myst_areas.cpp
+++ b/engines/mohawk/myst_areas.cpp
@@ -29,6 +29,10 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+
namespace Mohawk {
MystResource::MystResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) {
diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 17a2c66091..71c408ed37 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -31,6 +31,8 @@
#include "mohawk/sound.h"
#include "mohawk/video.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp
index 26267cfbda..cba2583a50 100644
--- a/engines/mohawk/myst_stacks/channelwood.cpp
+++ b/engines/mohawk/myst_stacks/channelwood.cpp
@@ -32,7 +32,9 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/channelwood.h"
-#include "gui/message.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp
index 61772eda4d..bb8397fd09 100644
--- a/engines/mohawk/myst_stacks/credits.cpp
+++ b/engines/mohawk/myst_stacks/credits.cpp
@@ -30,6 +30,7 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/credits.h"
+#include "common/system.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp
index ffbf9c991f..e2a11eb94f 100644
--- a/engines/mohawk/myst_stacks/dni.cpp
+++ b/engines/mohawk/myst_stacks/dni.cpp
@@ -31,6 +31,8 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/dni.h"
+#include "common/system.h"
+
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index 3dab2f7939..c5c11026f5 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -32,7 +32,8 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/mechanical.h"
-#include "gui/message.h"
+#include "common/events.h"
+#include "common/system.h"
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 5d070322ca..2b8ef94442 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -33,6 +33,8 @@
#include "mohawk/myst_stacks/myst.h"
#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "gui/message.h"
diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp
index dc491c7573..fddf6290fb 100644
--- a/engines/mohawk/myst_stacks/preview.cpp
+++ b/engines/mohawk/myst_stacks/preview.cpp
@@ -30,6 +30,7 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/preview.h"
+#include "common/system.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp
index a84cd0632d..c670cb6a48 100644
--- a/engines/mohawk/myst_stacks/selenitic.cpp
+++ b/engines/mohawk/myst_stacks/selenitic.cpp
@@ -32,6 +32,8 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/selenitic.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp
index e664081c96..4057edd9c9 100644
--- a/engines/mohawk/myst_stacks/slides.cpp
+++ b/engines/mohawk/myst_stacks/slides.cpp
@@ -30,6 +30,7 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/slides.h"
+#include "common/system.h"
#include "gui/message.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp
index b5b403dad8..07701c273e 100644
--- a/engines/mohawk/myst_stacks/stoneship.cpp
+++ b/engines/mohawk/myst_stacks/stoneship.cpp
@@ -32,7 +32,9 @@
#include "mohawk/video.h"
#include "mohawk/myst_stacks/stoneship.h"
-#include "gui/message.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
namespace Mohawk {
namespace MystStacks {
diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp
index 968bb422be..de71dcf382 100644
--- a/engines/mohawk/myst_state.cpp
+++ b/engines/mohawk/myst_state.cpp
@@ -27,7 +27,9 @@
#include "mohawk/myst.h"
#include "mohawk/myst_state.h"
+#include "common/debug.h"
#include "common/serializer.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Mohawk {
diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h
index a543cb1c4f..074c3e5f10 100644
--- a/engines/mohawk/myst_state.h
+++ b/engines/mohawk/myst_state.h
@@ -31,7 +31,7 @@
#include "common/str.h"
namespace Common {
- class Serializer;
+class Serializer;
}
namespace Mohawk {
diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp
index de1513b237..62250b75f2 100644
--- a/engines/mohawk/resource.cpp
+++ b/engines/mohawk/resource.cpp
@@ -28,6 +28,7 @@
#include "common/debug.h"
#include "common/substream.h"
#include "common/util.h"
+#include "common/textconsole.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h
index 88927884a2..3aba5643db 100644
--- a/engines/mohawk/riven.h
+++ b/engines/mohawk/riven.h
@@ -35,6 +35,7 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/random.h"
+#include "common/rect.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp
index 7c453dec48..dc0d66f19b 100644
--- a/engines/mohawk/riven_external.cpp
+++ b/engines/mohawk/riven_external.cpp
@@ -32,6 +32,7 @@
#include "gui/message.h"
#include "common/events.h"
+#include "common/system.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 35f38c4069..b8f86f993a 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -33,6 +33,7 @@
#include "common/memstream.h"
#include "common/stream.h"
+#include "common/system.h"
namespace Mohawk {
diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h
index 46cd965f40..2ac805c366 100644
--- a/engines/mohawk/riven_scripts.h
+++ b/engines/mohawk/riven_scripts.h
@@ -28,6 +28,7 @@
#include "common/str-array.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
class MohawkEngine_Riven;
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 9759f14699..fba87808d2 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -25,7 +25,10 @@
#include "mohawk/sound.h"
+#include "common/debug.h"
+#include "common/system.h"
#include "common/util.h"
+#include "common/textconsole.h"
#include "audio/musicplugin.h"
#include "audio/audiostream.h"
diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp
index f481b5ceb2..8f57d61cc4 100644
--- a/engines/mohawk/video.cpp
+++ b/engines/mohawk/video.cpp
@@ -27,9 +27,16 @@
#include "mohawk/resource.h"
#include "mohawk/video.h"
+#include "common/debug.h"
#include "common/events.h"
+#include "common/textconsole.h"
+#include "common/system.h"
+
+#include "graphics/surface.h"
+
#include "video/qt_decoder.h"
+
namespace Mohawk {
void VideoEntry::clear() {
@@ -219,7 +226,7 @@ bool VideoManager::updateMovies() {
// Convert from 8bpp to the current screen format if necessary
Graphics::PixelFormat pixelFormat = _vm->_system->getScreenFormat();
- if (frame->bytesPerPixel == 1) {
+ if (frame->format.bytesPerPixel == 1) {
if (pixelFormat.bytesPerPixel == 1) {
if (_videoStreams[i]->hasDirtyPalette())
_videoStreams[i]->setSystemPalette();
@@ -228,7 +235,7 @@ bool VideoManager::updateMovies() {
const byte *palette = _videoStreams[i]->getPalette();
assert(palette);
- convertedFrame->create(frame->w, frame->h, pixelFormat.bytesPerPixel);
+ convertedFrame->create(frame->w, frame->h, pixelFormat);
for (uint16 j = 0; j < frame->h; j++) {
for (uint16 k = 0; k < frame->w; k++) {
diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp
index 837d386b58..e5a44122ea 100644
--- a/engines/mohawk/view.cpp
+++ b/engines/mohawk/view.cpp
@@ -28,6 +28,8 @@
#include "mohawk/graphics.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
+#include "graphics/palette.h"
namespace Mohawk {
diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp
index 527f2d2812..2cf6eebf2a 100644
--- a/engines/parallaction/balloons.cpp
+++ b/engines/parallaction/balloons.cpp
@@ -304,7 +304,7 @@ int BalloonManager_ns::createBalloon(int16 w, int16 h, int16 winding, uint16 bor
int16 real_h = (winding == -1) ? h : h + 9;
balloon->surface = new Graphics::Surface;
- balloon->surface->create(w, real_h, 1);
+ balloon->surface->create(w, real_h, Graphics::PixelFormat::createFormatCLUT8());
balloon->surface->fillRect(Common::Rect(w, real_h), BALLOON_TRANSPARENT_COLOR_NS);
Common::Rect r(w, h);
@@ -578,7 +578,7 @@ Graphics::Surface *BalloonManager_br::expandBalloon(Frames *data, int frameNum)
rect.translate(-rect.left, -rect.top);
Graphics::Surface *surf = new Graphics::Surface;
- surf->create(rect.width(), rect.height(), 1);
+ surf->create(rect.width(), rect.height(), Graphics::PixelFormat::createFormatCLUT8());
_vm->_gfx->unpackBlt(rect, data->getData(frameNum), data->getRawSize(frameNum), surf, LAYER_FOREGROUND, 100, BALLOON_TRANSPARENT_COLOR_BR);
@@ -670,7 +670,7 @@ int BalloonManager_br::createBalloon(int16 w, int16 h, uint16 borderThickness) {
Balloon *balloon = &_intBalloons[id];
balloon->surface = new Graphics::Surface;
- balloon->surface->create(w, h, 1);
+ balloon->surface->create(w, h, Graphics::PixelFormat::createFormatCLUT8());
Common::Rect rect(w, h);
balloon->surface->fillRect(rect, 1);
diff --git a/engines/parallaction/callables_br.cpp b/engines/parallaction/callables_br.cpp
index 21703dc1dd..0bc6f6762c 100644
--- a/engines/parallaction/callables_br.cpp
+++ b/engines/parallaction/callables_br.cpp
@@ -25,6 +25,8 @@
#include "parallaction/parallaction.h"
+#include "common/textconsole.h"
+
namespace Parallaction {
void Parallaction_br::_c_null(void*) {
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index f67a77aa21..8e3c2cbeb8 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -28,6 +28,7 @@
#include "common/config-manager.h"
#include "engines/advancedDetector.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index e3d02bac62..944d9f4b55 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -25,6 +25,7 @@
#include "common/events.h"
#include "common/debug-channels.h"
+#include "common/textconsole.h"
#include "parallaction/exec.h"
#include "parallaction/input.h"
#include "parallaction/parallaction.h"
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp
index 6928c1eefc..d996b72e90 100644
--- a/engines/parallaction/disk.cpp
+++ b/engines/parallaction/disk.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "common/iff_container.h"
+#include "common/textconsole.h"
+
#include "parallaction/disk.h"
#include "parallaction/graphics.h"
@@ -36,7 +39,7 @@ void ILBMLoader::setupBuffer(uint32 w, uint32 h) {
_surf = new Graphics::Surface;
assert(_surf);
}
- _surf->create(w, h, 1);
+ _surf->create(w, h, Graphics::PixelFormat::createFormatCLUT8());
_mode = Graphics::ILBMDecoder::ILBM_UNPACK_PLANES;
_intBuffer = (byte*)_surf->pixels;
break;
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 8ff0efd3c6..9af189af68 100644
--- a/engines/parallaction/disk.h
+++ b/engines/parallaction/disk.h
@@ -29,14 +29,20 @@
#define PATH_LEN 200
#include "common/archive.h"
+#include "common/str.h"
-#include "graphics/surface.h"
#include "graphics/iff.h"
namespace Common {
- class FSDirectory;
+class FSDirectory;
+class ReadStream;
+class SeekableReadStream;
+struct IFFChunk;
}
+namespace Graphics {
+struct Surface;
+}
namespace Parallaction {
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index 34b04cd00f..cea4091ee9 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -27,6 +27,7 @@
#include "common/config-manager.h"
#include "common/fs.h"
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
#include "parallaction/parser.h"
@@ -227,7 +228,7 @@ void DosDisk_br::loadBitmap(Common::SeekableReadStream &stream, Graphics::Surfac
stream.skip(768);
}
- surf.create(width, height, 1);
+ surf.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
stream.read(surf.pixels, width * height);
}
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index 133b7bef6c..e695fa8798 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -27,6 +27,7 @@
#include "common/fs.h"
#include "common/memstream.h"
#include "common/substream.h"
+#include "common/textconsole.h"
#include "parallaction/parser.h"
#include "parallaction/parallaction.h"
@@ -473,7 +474,7 @@ void DosDisk_ns::loadBackground(BackgroundInfo& info, const char *filename) {
}
// read bitmap, mask and path data and extract them into the 3 buffers
- info.bg.create(info.width, info.height, 1);
+ info.bg.create(info.width, info.height, Graphics::PixelFormat::createFormatCLUT8());
createMaskAndPathBuffers(info);
unpackBackground(stream, (byte*)info.bg.pixels, info._mask->data, info._path->data);
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 99aa27b30f..c879745f65 100644
--- a/engines/parallaction/exec_br.cpp
+++ b/engines/parallaction/exec_br.cpp
@@ -27,6 +27,8 @@
#include "parallaction/input.h"
#include "parallaction/parallaction.h"
+#include "common/textconsole.h"
+
namespace Parallaction {
#define INST_ON 1
diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp
index c8a5ee1548..ee357576d2 100644
--- a/engines/parallaction/exec_ns.cpp
+++ b/engines/parallaction/exec_ns.cpp
@@ -28,6 +28,7 @@
#include "parallaction/parallaction.h"
#include "parallaction/sound.h"
+#include "common/textconsole.h"
namespace Parallaction {
diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp
index 18f469f0a2..a459e6a600 100644
--- a/engines/parallaction/font.cpp
+++ b/engines/parallaction/font.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index 6c39b2e696..ca99624ecd 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -28,6 +28,7 @@
#include "disk.h"
#include "common/algorithm.h"
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 35441d7e3e..d33e733677 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -26,6 +26,8 @@
#include "common/system.h"
#include "common/file.h"
+#include "common/textconsole.h"
+#include "graphics/palette.h"
#include "graphics/primitives.h"
#include "engines/util.h"
@@ -521,7 +523,7 @@ void Gfx::invertBackground(const Common::Rect& r) {
void setupLabelSurface(Graphics::Surface &surf, uint w, uint h) {
- surf.create(w, h, 1);
+ surf.create(w, h, Graphics::PixelFormat::createFormatCLUT8());
surf.fillRect(Common::Rect(w,h), LABEL_TRANSPARENT_COLOR);
}
@@ -857,7 +859,7 @@ void Gfx::setBackground(uint type, BackgroundInfo *info) {
int height = CLIP(info->height, (int)_vm->_screenHeight, info->height);
if (width != _backBuffer.w || height != _backBuffer.h) {
- _backBuffer.create(width, height, 1);
+ _backBuffer.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
}
}
diff --git a/engines/parallaction/gui.cpp b/engines/parallaction/gui.cpp
index c4a36e5362..db70ebb432 100644
--- a/engines/parallaction/gui.cpp
+++ b/engines/parallaction/gui.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "parallaction/gui.h"
namespace Parallaction {
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index c80a9940a2..41e3082464 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -24,6 +24,7 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "parallaction/gui.h"
#include "parallaction/input.h"
@@ -483,7 +484,7 @@ public:
_y = 90;
Graphics::Surface *surf = new Graphics::Surface;
- surf->create(w, 110, 1);
+ surf->create(w, 110, Graphics::PixelFormat::createFormatCLUT8());
surf->fillRect(Common::Rect(0, 0, w, 110), 12);
surf->fillRect(Common::Rect(10, 10, w-10, 100), 15);
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index 51d3ba5799..6b863cc808 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/hashmap.h"
+#include "common/textconsole.h"
#include "parallaction/gui.h"
#include "parallaction/input.h"
@@ -474,7 +475,7 @@ class SelectCharacterInputState_NS : public MenuInputState {
public:
SelectCharacterInputState_NS(Parallaction_ns *vm, MenuInputHelper *helper) : MenuInputState("selectcharacter", helper), _vm(vm) {
_keys = (_vm->getPlatform() == Common::kPlatformAmiga && (_vm->getFeatures() & GF_LANG_MULT)) ? _amigaKeys : _pcKeys;
- _block.create(BLOCK_WIDTH, BLOCK_HEIGHT, 1);
+ _block.create(BLOCK_WIDTH, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_labels[0] = 0;
_labels[1] = 0;
@@ -625,7 +626,7 @@ public:
_vm->_soundManI->stopMusic();
_vm->showSlide("password");
- _emptySlots.create(BLOCK_WIDTH * 8, BLOCK_HEIGHT, 1);
+ _emptySlots.create(BLOCK_WIDTH * 8, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
Common::Rect rect(SLOT_X, SLOT_Y, SLOT_X + BLOCK_WIDTH * 8, SLOT_Y + BLOCK_HEIGHT);
_vm->_gfx->grabBackground(rect, _emptySlots);
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index e508668d80..3a47b14deb 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -25,6 +25,7 @@
#include "common/events.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
#include "parallaction/exec.h"
@@ -486,7 +487,7 @@ void Input::initCursors() {
_donnaCursor = _vm->_disk->loadPointer("pointer3");
Graphics::Surface *surf = new Graphics::Surface;
- surf->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, 1);
+ surf->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, Graphics::PixelFormat::createFormatCLUT8());
_comboArrow = new SurfaceToFrames(surf);
// TODO: choose the pointer depending on the active character
@@ -495,12 +496,12 @@ void Input::initCursors() {
} else {
// TODO: Where are the Amiga cursors?
Graphics::Surface *surf1 = new Graphics::Surface;
- surf1->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, 1);
+ surf1->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, Graphics::PixelFormat::createFormatCLUT8());
_comboArrow = new SurfaceToFrames(surf1);
// TODO: scale mouse cursor (see staticres.cpp)
Graphics::Surface *surf2 = new Graphics::Surface;
- surf2->create(32, 16, 1);
+ surf2->create(32, 16, Graphics::PixelFormat::createFormatCLUT8());
memcpy(surf2->pixels, _resMouseArrow_BR_Amiga, 32*16);
_mouseArrow = new SurfaceToFrames(surf2);
}
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 5ead55bbef..2412cc6445 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -26,7 +26,7 @@
#include "parallaction/input.h"
#include "parallaction/parallaction.h"
-
+#include "common/textconsole.h"
namespace Parallaction {
@@ -141,7 +141,7 @@ void Parallaction::closeInventory() {
InventoryRenderer::InventoryRenderer(Parallaction *vm, InventoryProperties *props, Inventory *inv) : _vm(vm), _props(props), _inv(inv) {
- _surf.create(_props->_width, _props->_height, 1);
+ _surf.create(_props->_width, _props->_height, Graphics::PixelFormat::createFormatCLUT8());
}
InventoryRenderer::~InventoryRenderer() {
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index c345b92ffb..e1306dc956 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "parallaction/parallaction.h"
#include "parallaction/objects.h"
#include "parallaction/parser.h"
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 3055439e47..516d465671 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -23,13 +23,10 @@
*
*/
-#include "common/config-manager.h"
#include "common/debug-channels.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
-#include "common/file.h"
-#include "common/util.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "parallaction/exec.h"
#include "parallaction/input.h"
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index c5b6b23f55..b0b1145d2e 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -32,6 +32,7 @@
#include "common/func.h"
#include "common/random.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "engines/engine.h"
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 619a4f7559..ca344792cf 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/util.h"
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
#include "parallaction/exec.h"
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index ffac22e118..ffc0412b1d 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
#include "parallaction/exec.h"
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index c964b74512..a7b926e485 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "parallaction/parallaction.h"
#include "parallaction/parser.h"
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 9748be0526..f8818def9a 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/textconsole.h"
#include "parallaction/parallaction.h"
#include "parallaction/parser.h"
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 5053a3d7a5..6c9afe3d85 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "parallaction/parallaction.h"
#include "parallaction/parser.h"
#include "parallaction/sound.h"
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp
index 50a777f7b8..4c77aa3e02 100644
--- a/engines/parallaction/saveload.cpp
+++ b/engines/parallaction/saveload.cpp
@@ -25,6 +25,7 @@
#include "common/savefile.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "gui/dialog.h"
#include "gui/saveload.h"
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index ee53f9641e..abfaa4bf5d 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -24,6 +24,7 @@
*/
#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "audio/mixer.h"
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index ba81314da6..5123695ebc 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -24,8 +24,8 @@
*/
#include "common/file.h"
-
#include "common/stream.h"
+#include "common/textconsole.h"
#include "audio/mixer.h"
#include "audio/midiparser.h"
diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp
index 356856e940..87b24735a8 100644
--- a/engines/queen/command.cpp
+++ b/engines/queen/command.cpp
@@ -24,8 +24,6 @@
*/
-#include "common/events.h"
-#include "common/system.h"
#include "queen/command.h"
#include "queen/display.h"
diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp
index 11a8704d60..6fb48c7fb0 100644
--- a/engines/queen/cutaway.cpp
+++ b/engines/queen/cutaway.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/textconsole.h"
#include "queen/cutaway.h"
diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp
index b130b27a89..c78fd8ebcc 100644
--- a/engines/queen/display.cpp
+++ b/engines/queen/display.cpp
@@ -29,6 +29,7 @@
#include "common/events.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "queen/display.h"
#include "queen/input.h"
diff --git a/engines/queen/display.h b/engines/queen/display.h
index d3391fc4d3..e7a2ecd4a1 100644
--- a/engines/queen/display.h
+++ b/engines/queen/display.h
@@ -32,8 +32,9 @@
#include "queen/defs.h"
class OSystem;
+
namespace Common {
- struct Rect;
+struct Rect;
}
namespace Queen {
diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp
index 17e36b1d90..c86f679765 100644
--- a/engines/queen/graphics.cpp
+++ b/engines/queen/graphics.cpp
@@ -34,6 +34,9 @@
#include "queen/resource.h"
#include "queen/sound.h"
+#include "common/debug.h"
+#include "common/textconsole.h"
+
namespace Queen {
void BobSlot::curPos(int16 xx, int16 yy) {
diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp
index 9518388b26..eac855a0cd 100644
--- a/engines/queen/input.cpp
+++ b/engines/queen/input.cpp
@@ -26,6 +26,7 @@
#include "common/events.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "queen/queen.h"
#include "queen/input.h"
diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp
index aff24be22e..4200168f07 100644
--- a/engines/queen/journal.cpp
+++ b/engines/queen/journal.cpp
@@ -24,6 +24,7 @@
*/
+#include "common/error.h"
#include "common/events.h"
#include "common/system.h"
#include "queen/journal.h"
diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp
index de254300b6..e99a739726 100644
--- a/engines/queen/logic.cpp
+++ b/engines/queen/logic.cpp
@@ -25,8 +25,7 @@
#include "common/config-manager.h"
-#include "common/events.h"
-#include "common/system.h"
+#include "common/textconsole.h"
#include "queen/logic.h"
diff --git a/engines/queen/midiadlib.cpp b/engines/queen/midiadlib.cpp
index b03c90f653..af52f7ed2b 100644
--- a/engines/queen/midiadlib.cpp
+++ b/engines/queen/midiadlib.cpp
@@ -24,6 +24,7 @@
*/
#include "common/endian.h"
+#include "common/textconsole.h"
#include "audio/fmopl.h"
#include "audio/softsynth/emumidi.h"
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index 519f028cda..0dde5c7b42 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -32,6 +32,7 @@
#include "common/system.h"
#include "common/events.h"
#include "common/EventRecorder.h"
+#include "common/textconsole.h"
#include "engines/util.h"
diff --git a/engines/queen/queen.h b/engines/queen/queen.h
index 93d705b182..6098a9f5c2 100644
--- a/engines/queen/queen.h
+++ b/engines/queen/queen.h
@@ -30,7 +30,7 @@
#include "common/random.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
#if defined(_WIN32_WCE) && (_WIN32_WCE <= 300)
diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp
index e8519ee68b..62b13e290c 100644
--- a/engines/queen/resource.cpp
+++ b/engines/queen/resource.cpp
@@ -27,6 +27,7 @@
#include "common/endian.h"
#include "common/config-manager.h"
#include "common/substream.h"
+#include "common/textconsole.h"
#include "queen/resource.h"
namespace Queen {
diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp
index a34af99ec3..afb77f3969 100644
--- a/engines/queen/sound.cpp
+++ b/engines/queen/sound.cpp
@@ -27,6 +27,7 @@
#include "common/config-manager.h"
#include "common/endian.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "queen/sound.h"
#include "queen/input.h"
diff --git a/engines/queen/sound.h b/engines/queen/sound.h
index cee0463ed1..a89e345791 100644
--- a/engines/queen/sound.h
+++ b/engines/queen/sound.h
@@ -32,7 +32,7 @@
#include "queen/defs.h"
namespace Common {
- class File;
+class File;
}
namespace Queen {
diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp
index 106b0d6123..18c712b799 100644
--- a/engines/queen/talk.cpp
+++ b/engines/queen/talk.cpp
@@ -24,9 +24,8 @@
*/
-#include "common/events.h"
-#include "common/system.h"
#include "common/rect.h"
+#include "common/textconsole.h"
#include "queen/talk.h"
diff --git a/engines/queen/walk.cpp b/engines/queen/walk.cpp
index 7765828bd7..a778ea5b05 100644
--- a/engines/queen/walk.cpp
+++ b/engines/queen/walk.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/textconsole.h"
#include "queen/walk.h"
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index 5fc2082178..4930718b67 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -34,6 +34,7 @@
#include "common/system.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "engines/util.h"
namespace Saga {
@@ -46,7 +47,7 @@ Gfx::Gfx(SagaEngine *vm, OSystem *system, int width, int height) : _vm(vm), _sys
debug(5, "Init screen %dx%d", width, height);
// Convert surface data to R surface data
- _backBuffer.create(width, height, 1);
+ _backBuffer.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
// Start with the cursor shown. It will be hidden before the intro, if
// there is an intro. (With boot params, there may not be.)
diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h
index 33fac10c63..56d9104371 100644
--- a/engines/saga/gfx.h
+++ b/engines/saga/gfx.h
@@ -28,6 +28,7 @@
#ifndef SAGA_GFX_H
#define SAGA_GFX_H
+#include "common/rect.h"
#include "graphics/surface.h"
namespace Saga {
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 0f84b09547..c3773b2cb2 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -2798,7 +2798,7 @@ void Interface::keyBoss() {
Rect rect;
ByteArray image;
int imageWidth, imageHeight;
- const byte *pal;
+ //const byte *pal;
PalEntry cPal[PAL_ENTRIES];
_vm->_gfx->showCursor(false);
@@ -2818,7 +2818,7 @@ void Interface::keyBoss() {
rect.setHeight(imageHeight);
_vm->_gfx->getCurrentPal(_mapSavedPal);
- pal = _vm->getImagePal(resourceData);
+ //pal = _vm->getImagePal(resourceData);
cPal[0].red = 0;
cPal[0].green = 0;
diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp
index 5ae80b14c9..7f04474c61 100644
--- a/engines/saga/introproc_saga2.cpp
+++ b/engines/saga/introproc_saga2.cpp
@@ -31,7 +31,10 @@
#include "saga/scene.h"
#include "saga/gfx.h"
-#include "audio/mixer.h"
+#include "common/events.h"
+#include "common/keyboard.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
#include "video/smk_decoder.h"
diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp
index dc9334b037..837a9e5879 100644
--- a/engines/saga/render.cpp
+++ b/engines/saga/render.cpp
@@ -56,7 +56,7 @@ Render::Render(SagaEngine *vm, OSystem *system) {
_vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this);
#endif
- _backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, 1);
+ _backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, Graphics::PixelFormat::createFormatCLUT8());
_flags = 0;
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 52c4b824e7..4df44a2e18 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -31,6 +31,7 @@
#include "common/array.h"
#include "common/random.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "audio/mididrv.h"
#include "saga/gfx.h"
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 6a6992fb5f..27300377e9 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -23,10 +23,8 @@
*
*/
-#include "common/config-manager.h"
#include "common/savefile.h"
#include "common/system.h"
-#include "common/file.h"
#include "graphics/thumbnail.h"
#include "saga/saga.h"
diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp
index 685cb26aa7..8f0baa9d53 100644
--- a/engines/saga/shorten.cpp
+++ b/engines/saga/shorten.cpp
@@ -24,6 +24,7 @@
*/
#include "common/scummsys.h"
+#include "common/textconsole.h"
#include "saga/shorten.h"
@@ -34,10 +35,8 @@
// FIXME: This doesn't work yet correctly
-#include "common/endian.h"
#include "common/util.h"
-#include "audio/mixer.h"
#include "audio/decoders/raw.h"
namespace Saga {
diff --git a/engines/savestate.cpp b/engines/savestate.cpp
index 368f59ef51..bed19ba3e5 100644
--- a/engines/savestate.cpp
+++ b/engines/savestate.cpp
@@ -25,6 +25,7 @@
#include "engines/savestate.h"
#include "graphics/surface.h"
+#include "common/textconsole.h"
void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) {
if (_thumbnail.get() == t)
diff --git a/engines/savestate.h b/engines/savestate.h
index 37f2b9bdd4..9b64a96aee 100644
--- a/engines/savestate.h
+++ b/engines/savestate.h
@@ -32,7 +32,7 @@
namespace Graphics {
- struct Surface;
+struct Surface;
}
/**
diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp
index 73d4ed4198..c122fceeb0 100644
--- a/engines/sci/decompressor.cpp
+++ b/engines/sci/decompressor.cpp
@@ -28,9 +28,8 @@
#include "common/dcl.h"
#include "common/util.h"
#include "common/endian.h"
-#include "common/debug.h"
-#include "common/debug-channels.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "sci/decompressor.h"
#include "sci/sci.h"
diff --git a/engines/sci/decompressor.h b/engines/sci/decompressor.h
index 88e24fcc47..8b6f955ddb 100644
--- a/engines/sci/decompressor.h
+++ b/engines/sci/decompressor.h
@@ -28,7 +28,9 @@
#include "common/scummsys.h"
-namespace Common { class ReadStream; }
+namespace Common {
+class ReadStream;
+}
namespace Sci {
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 82522a6e77..0e2f64257a 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -28,6 +28,7 @@
#include "common/file.h"
#include "common/str.h"
#include "common/savefile.h"
+#include "common/system.h"
#include "common/translation.h"
#include "gui/saveload.h"
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index 911713d0bd..7fb6ac296e 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -32,6 +32,7 @@
#include "sci/sound/soundcmd.h"
#include "audio/mixer.h"
+#include "common/system.h"
namespace Sci {
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index 6a411d8e23..a8d4437148 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -29,7 +29,14 @@
#include "sci/graphics/cursor.h"
#include "sci/graphics/palette.h"
#include "sci/graphics/screen.h"
-#include "graphics/cursorman.h"
+#include "common/events.h"
+#include "common/keyboard.h"
+#include "common/str.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
+#include "video/video_decoder.h"
#include "video/avi_decoder.h"
#include "video/qt_decoder.h"
#include "sci/video/seq_decoder.h"
diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h
index 81d5b2c983..8ae06f2707 100644
--- a/engines/sci/engine/object.h
+++ b/engines/sci/engine/object.h
@@ -28,6 +28,7 @@
#include "common/array.h"
#include "common/serializer.h"
+#include "common/textconsole.h"
#include "sci/sci.h" // for the SCI versions
#include "sci/engine/vm_types.h" // for reg_t
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index d91118ec1e..cd6d56500a 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -32,8 +32,8 @@
#include "common/str-array.h"
namespace Common {
- class SeekableReadStream;
- class WriteStream;
+class SeekableReadStream;
+class WriteStream;
}
#include "sci/sci.h"
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index d209a0ca5b..b441815014 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -25,8 +25,6 @@
#include "common/debug.h"
#include "common/debug-channels.h"
-#include "common/stack.h"
-#include "common/config-manager.h"
#include "sci/sci.h"
#include "sci/console.h"
diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h
index 684e6cac5e..5538b5c2c5 100644
--- a/engines/sci/graphics/fontsjis.h
+++ b/engines/sci/graphics/fontsjis.h
@@ -29,7 +29,7 @@
#include "sci/graphics/helpers.h"
namespace Graphics {
- class FontSJIS;
+class FontSJIS;
}
namespace Sci {
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index dd55b3b060..7fafe843fd 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -23,9 +23,15 @@
*
*/
-#include "common/util.h"
-#include "common/stack.h"
-#include "graphics/primitives.h"
+#include "common/algorithm.h"
+#include "common/events.h"
+#include "common/keyboard.h"
+#include "common/list_intern.h"
+#include "common/str.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "engines/engine.h"
+#include "graphics/surface.h"
#include "sci/sci.h"
#include "sci/engine/kernel.h"
diff --git a/engines/sci/graphics/maciconbar.h b/engines/sci/graphics/maciconbar.h
index 3ac5475147..72609d19ab 100644
--- a/engines/sci/graphics/maciconbar.h
+++ b/engines/sci/graphics/maciconbar.h
@@ -31,7 +31,7 @@
#include "sci/engine/vm.h"
namespace Graphics {
- struct Surface;
+struct Surface;
}
namespace Sci {
diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp
index c347da3c0f..27a0bdfc44 100644
--- a/engines/sci/graphics/paint.cpp
+++ b/engines/sci/graphics/paint.cpp
@@ -23,8 +23,6 @@
*
*/
-#include "common/util.h"
-#include "common/stack.h"
#include "graphics/primitives.h"
#include "sci/sci.h"
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index ff738fc3b9..5172f7cdc0 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -23,11 +23,6 @@
*
*/
-#include "common/util.h"
-#include "common/stack.h"
-#include "common/system.h"
-#include "graphics/primitives.h"
-
#include "sci/sci.h"
#include "sci/engine/features.h"
#include "sci/engine/state.h"
@@ -302,6 +297,11 @@ void GfxPaint16::bitsShow(const Common::Rect &rect) {
return;
_ports->offsetRect(workerRect);
+
+ // We adjust the left/right coordinates to even coordinates
+ workerRect.left &= 0xFFFE; // round down
+ workerRect.right = (workerRect.right + 1) & 0xFFFE; // round up
+
_screen->copyRectToScreen(workerRect);
}
@@ -472,6 +472,7 @@ void GfxPaint16::kernelGraphRedrawBox(Common::Rect rect) {
#define SCI_DISPLAY_RESTOREUNDER 108
#define SCI_DISPLAY_DUMMY1 114 // used in longbow demo/qfg1 ega demo, not supported in sierra sci - no parameters
#define SCI_DISPLAY_DUMMY2 115 // used in longbow demo, not supported in sierra sci - has 1 parameter
+#define SCI_DISPLAY_DUMMY3 117 // used in qfg1 ega demo, not supported in sierra sci - no parameters
#define SCI_DISPLAY_DONTSHOWBITS 121
reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) {
@@ -542,9 +543,10 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) {
break;
// 2 Dummy functions, longbow-demo is using those several times but sierra sci doesn't support them at all
- // The Quest for Glory 1 EGA demo also calls kDisplay(114)
+ // The Quest for Glory 1 EGA demo also calls kDisplay(114) and kDisplay(117)
case SCI_DISPLAY_DUMMY1:
case SCI_DISPLAY_DUMMY2:
+ case SCI_DISPLAY_DUMMY3:
if (!g_sci->isDemo() || (g_sci->getGameId() != GID_LONGBOW && g_sci->getGameId() != GID_QFG1))
error("Unknown kDisplay argument %d", displayArg.offset);
if (displayArg.offset == SCI_DISPLAY_DUMMY2) {
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index 69a278eb8b..f277436631 100644
--- a/engines/sci/graphics/paint32.cpp
+++ b/engines/sci/graphics/paint32.cpp
@@ -23,11 +23,6 @@
*
*/
-#include "common/util.h"
-#include "common/stack.h"
-
-#include "graphics/primitives.h"
-
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/engine/selector.h"
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 0433479a09..42551e9369 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -28,6 +28,8 @@
#include "common/util.h"
#include "common/system.h"
+#include "graphics/palette.h"
+
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/graphics/cache.h"
diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp
index 6e9df2f019..3f9ebaa07a 100644
--- a/engines/sci/graphics/portrait.cpp
+++ b/engines/sci/graphics/portrait.cpp
@@ -24,9 +24,7 @@
*/
#include "common/archive.h"
-#include "common/util.h"
-#include "common/stack.h"
-#include "graphics/primitives.h"
+#include "common/system.h"
#include "sci/sci.h"
#include "sci/event.h"
diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp
index fb124055d6..dde1be13ab 100644
--- a/engines/sci/graphics/transitions.cpp
+++ b/engines/sci/graphics/transitions.cpp
@@ -24,9 +24,8 @@
*/
#include "common/events.h"
-#include "common/util.h"
-#include "common/stack.h"
#include "common/system.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "sci/sci.h"
diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp
index 77db56adba..b330a432e3 100644
--- a/engines/sci/parser/grammar.cpp
+++ b/engines/sci/parser/grammar.cpp
@@ -31,6 +31,7 @@
#include "sci/parser/vocabulary.h"
#include "sci/console.h"
#include "common/array.h"
+#include "common/textconsole.h"
namespace Sci {
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 4caa77b0ae..a48ae0fad7 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -28,6 +28,7 @@
#include "common/file.h"
#include "common/fs.h"
#include "common/macresman.h"
+#include "common/textconsole.h"
#include "sci/resource.h"
#include "sci/resource_intern.h"
@@ -1275,7 +1276,7 @@ ResVersion ResourceManager::detectVolVersion() {
// SCI32 volume format: {bResType wResNumber dwPacked dwUnpacked wCompression} = 13 bytes
// Try to parse volume with SCI0 scheme to see if it make sense
// Checking 1MB of data should be enough to determine the version
- uint16 resId, wCompression;
+ uint16 wCompression;
uint32 dwPacked, dwUnpacked;
ResVersion curVersion = kResVersionSci0Sci1Early;
bool failed = false;
@@ -1285,7 +1286,7 @@ ResVersion ResourceManager::detectVolVersion() {
while (!fileStream->eos() && fileStream->pos() < 0x100000) {
if (curVersion > kResVersionSci0Sci1Early)
fileStream->readByte();
- resId = fileStream->readUint16LE();
+ fileStream->skip(2); // resId
dwPacked = (curVersion < kResVersionSci2) ? fileStream->readUint16LE() : fileStream->readUint32LE();
dwUnpacked = (curVersion < kResVersionSci2) ? fileStream->readUint16LE() : fileStream->readUint32LE();
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 6e74553f56..1e0b9c0ddf 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -27,6 +27,7 @@
#include "common/archive.h"
#include "common/file.h"
+#include "common/textconsole.h"
#include "sci/resource.h"
#include "sci/resource_intern.h"
diff --git a/engines/sci/resource_intern.h b/engines/sci/resource_intern.h
index 98cca6283c..969e250e62 100644
--- a/engines/sci/resource_intern.h
+++ b/engines/sci/resource_intern.h
@@ -29,7 +29,7 @@
#include "sci/resource.h"
namespace Common {
- class MacResManager;
+class MacResManager;
}
namespace Sci {
diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp
index 65a8e2e3da..f00c99d5b5 100644
--- a/engines/sci/sound/drivers/adlib.cpp
+++ b/engines/sci/sound/drivers/adlib.cpp
@@ -26,6 +26,8 @@
#include "sci/sci.h"
#include "common/file.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/fmopl.h"
#include "audio/softsynth/emumidi.h"
diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp
index 030b095cc9..7ee8d21f86 100644
--- a/engines/sci/sound/drivers/amigamac.cpp
+++ b/engines/sci/sound/drivers/amigamac.cpp
@@ -30,6 +30,8 @@
#include "common/file.h"
#include "common/frac.h"
#include "common/memstream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Sci {
diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp
index 051fa7f1fd..47c59a1e3d 100644
--- a/engines/sci/sound/drivers/cms.cpp
+++ b/engines/sci/sound/drivers/cms.cpp
@@ -29,6 +29,8 @@
#include "audio/softsynth/cms.h"
#include "audio/mixer.h"
+#include "common/system.h"
+
#include "sci/resource.h"
namespace Sci {
diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp
index 971c2ff92d..f217738bb2 100644
--- a/engines/sci/sound/drivers/fb01.cpp
+++ b/engines/sci/sound/drivers/fb01.cpp
@@ -30,6 +30,7 @@
#include "common/file.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace Sci {
diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp
index 9eef867aeb..f36aac3a2a 100644
--- a/engines/sci/sound/drivers/midi.cpp
+++ b/engines/sci/sound/drivers/midi.cpp
@@ -745,7 +745,7 @@ uint8 MidiPlayer_Midi::getGmInstrument(const Mt32ToGmMap &Mt32Ins) {
void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) {
// FIXME: Clean this up
int memtimbres, patches;
- uint8 group, number, keyshift, finetune, bender_range;
+ uint8 group, number, keyshift, /*finetune,*/ bender_range;
uint8 *patchpointer;
uint32 pos;
int i;
@@ -784,7 +784,7 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) {
group = *patchpointer;
number = *(patchpointer + 1);
keyshift = *(patchpointer + 2);
- finetune = *(patchpointer + 3);
+ //finetune = *(patchpointer + 3);
bender_range = *(patchpointer + 4);
debugCN(kDebugLevelSound, " [%03d] ", i);
diff --git a/engines/sci/sound/drivers/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp
index 063332577e..4b1efb3c87 100644
--- a/engines/sci/sound/drivers/pcjr.cpp
+++ b/engines/sci/sound/drivers/pcjr.cpp
@@ -27,6 +27,9 @@
#include "audio/softsynth/emumidi.h"
+#include "common/debug.h"
+#include "common/system.h"
+
namespace Sci {
#define VOLUME_SHIFT 3
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 9ad964b67e..a2b09eab4c 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -325,14 +325,6 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) {
return acc;
}
- // If the current volume of the slot is the same as the target volume,
- // return without performing any fading. This fixes the music in room
- // 406 in KQ6 (bug #3267956), where the game scripts ask for the background
- // music to be played, and then faded to volume 127 (but the music is
- // already at volume 127) and subsequently stopped.
- if (argc >= 4 && musicSlot->volume == CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX))
- return acc;
-
switch (argc) {
case 1: // SCI0
// SCI0 fades out all the time and when fadeout is done it will also
@@ -353,7 +345,25 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) {
musicSlot->fadeStep = volume > musicSlot->fadeTo ? -5 : 5;
musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo();
musicSlot->fadeTicker = 0;
- musicSlot->stopAfterFading = (argc == 5) ? (argv[4].toUint16() != 0) : false;
+
+ if (argc == 5) {
+ // TODO: We currently treat this argument as a boolean, but may
+ // have to handle different non-zero values differently. (e.g.,
+ // some KQ6 scripts pass 3 here)
+ musicSlot->stopAfterFading = (argv[4].toUint16() != 0);
+ } else {
+ musicSlot->stopAfterFading = false;
+ }
+
+ // WORKAROUND/HACK: In the labyrinth in KQ6, when falling in the pit and
+ // lighting the lantern, the game scripts perform a fade in of the game
+ // music, but set it to stop after fading. Remove that flag here. This is
+ // marked as both a workaround and a hack because this issue could be a
+ // problem with our fading code and an incorrect handling of that
+ // parameter, or a script bug in that scene. Fixes bug #3267956.
+ if (g_sci->getGameId() == GID_KQ6 && g_sci->getEngineState()->currentRoomNumber() == 406 &&
+ musicSlot->resourceId == 400)
+ musicSlot->stopAfterFading = false;
break;
default:
diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index ecdce3bd6b..debc75dffd 100644
--- a/engines/sci/video/robot_decoder.cpp
+++ b/engines/sci/video/robot_decoder.cpp
@@ -23,11 +23,10 @@
*
*/
-#include "common/debug.h"
-#include "common/endian.h"
#include "common/archive.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "graphics/surface.h"
@@ -126,7 +125,7 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) {
readPaletteChunk(_header.paletteDataSize);
readFrameSizesChunk();
calculateVideoDimensions();
- _surface->create(_width, _height, 1);
+ _surface->create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());
return true;
}
diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h
index 52bf0bad07..aeb638e019 100644
--- a/engines/sci/video/robot_decoder.h
+++ b/engines/sci/video/robot_decoder.h
@@ -32,6 +32,7 @@
#include "common/substream.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
+#include "graphics/pixelformat.h"
#include "video/video_decoder.h"
namespace Sci {
diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp
index 0e69a9a352..7168496893 100644
--- a/engines/sci/video/seq_decoder.cpp
+++ b/engines/sci/video/seq_decoder.cpp
@@ -23,12 +23,10 @@
*
*/
-#include "common/debug.h"
#include "common/endian.h"
-#include "common/archive.h"
#include "common/stream.h"
#include "common/system.h"
-#include "common/util.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
@@ -61,7 +59,7 @@ bool SeqDecoder::loadStream(Common::SeekableReadStream *stream) {
_fileStream = stream;
_surface = new Graphics::Surface();
- _surface->create(SEQ_SCREEN_WIDTH, SEQ_SCREEN_HEIGHT, 1);
+ _surface->create(SEQ_SCREEN_WIDTH, SEQ_SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_frameCount = _fileStream->readUint16LE();
diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h
index 70aaa661ae..70d3985ec5 100644
--- a/engines/sci/video/seq_decoder.h
+++ b/engines/sci/video/seq_decoder.h
@@ -26,8 +26,18 @@
#ifndef SCI_VIDEO_SEQ_DECODER_H
#define SCI_VIDEO_SEQ_DECODER_H
+#include "common/rational.h"
+#include "graphics/pixelformat.h"
#include "video/video_decoder.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Sci {
/**
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 861e448221..9fb76d9d63 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -401,7 +401,7 @@ int CharsetRendererClassic::getCharWidth(uint16 chr) {
spacing++;
}
}
-
+
} else if (chr >= 0x80) {
return _vm->_2byteWidth / 2;
}
@@ -618,11 +618,12 @@ int CharsetRendererV3::getCharWidth(uint16 chr) {
spacing = 4;
} else if (chr & 0x80) {
spacing = _vm->_2byteWidth / 2;
- }
+ }
}
- if (!spacing)
+ if (!spacing) {
spacing = *(_widthTable + chr);
+ }
return spacing;
}
@@ -777,7 +778,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
(ignoreCharsetMask || !vs->hasTwoBuffers)) {
dst = vs->getPixels(_left, drawTop);
if (charPtr)
- drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->bytesPerPixel);
+ drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->format.bytesPerPixel);
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
else if (_vm->_cjkFont)
_vm->_cjkFont->drawChar(vs, chr, _left, drawTop, _color, _shadowColor);
@@ -785,7 +786,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
} else {
dst = (byte *)_vm->_textSurface.getBasePtr(_left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier);
if (charPtr)
- drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.bytesPerPixel, (_vm->_textSurfaceMultiplier == 2 && !is2byte));
+ drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.format.bytesPerPixel, (_vm->_textSurfaceMultiplier == 2 && !is2byte));
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
else if (_vm->_cjkFont)
_vm->_cjkFont->drawChar(_vm->_textSurface, chr, _left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier, _color, _shadowColor);
@@ -834,7 +835,7 @@ void CharsetRendererV3::drawChar(int chr, Graphics::Surface &s, int x, int y) {
height = 8;
}
dst = (byte *)s.pixels + y * s.pitch + x;
- drawBits1(s, dst, charPtr, y, width, height, s.bytesPerPixel);
+ drawBits1(s, dst, charPtr, y, width, height, s.format.bytesPerPixel);
}
void CharsetRenderer::translateColor() {
@@ -857,17 +858,17 @@ void CharsetRenderer::processTownsCharsetColors(uint8 bytesPerPixel) {
if (_vm->_game.platform == Common::kPlatformFMTowns) {
for (int i = 0; i < (1 << bytesPerPixel); i++) {
uint8 c = _vm->_charsetColorMap[i];
-
+
if (c > 16) {
uint8 t = (_vm->_currentPalette[c * 3] < 32) ? 4 : 12;
t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 2 : 10);
t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 1 : 9);
c = t;
}
-
+
if (c == 0)
c = _vm->_townsOverrideShadowColor;
-
+
c = ((c & 0x0f) << 4) | (c & 0x0f);
_vm->_townsCharsetColorMap[i] = c;
}
@@ -920,12 +921,12 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
noSjis = true;
}
}
-
+
if (useTownsFontRomCharacter(chr) && !noSjis) {
charPtr = 0;
_vm->_cjkChar = chr;
enableShadow(true);
-
+
width = getCharWidth(chr);
// For whatever reason MI1 uses a different font width
// for alignment calculation and for drawing when
@@ -947,7 +948,7 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) {
height++;
}
} else
-#endif
+#endif
{
uint32 charOffs = READ_LE_UINT32(_fontPtr + chr * 4 + 4);
assert(charOffs < 0x14000);
@@ -1096,7 +1097,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr,
} else
#endif
if (is2byte) {
- drawBits1(dstSurface, dstPtr, charPtr, drawTop, origWidth, origHeight, dstSurface.bytesPerPixel);
+ drawBits1(dstSurface, dstPtr, charPtr, drawTop, origWidth, origHeight, dstSurface.format.bytesPerPixel);
} else {
drawBitsN(dstSurface, dstPtr, charPtr, *_fontPtr, drawTop, origWidth, origHeight, _vm->_textSurfaceMultiplier == 2);
}
@@ -1173,7 +1174,7 @@ void CharsetRendererClassic::drawChar(int chr, Graphics::Surface &s, int x, int
dst = (byte *)s.pixels + y * s.pitch + x;
if (is2byte) {
- drawBits1(s, dst, charPtr, y, width, height, s.bytesPerPixel);
+ drawBits1(s, dst, charPtr, y, width, height, s.format.bytesPerPixel);
} else {
drawBitsN(s, dst, charPtr, *_fontPtr, y, width, height);
}
@@ -1259,14 +1260,14 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
byte *dst3 = dst2;
byte *dst4 = dst2;
- if (scale2x) {
+ if (scale2x) {
dst3 = dst2 + s.pitch;
dst4 = dst3 + s.pitch;
pitch <<= 1;
}
if (_vm->_game.platform == Common::kPlatformFMTowns && _vm->_game.version == 5)
col = _vm->_townsCharsetColorMap[1];
-#endif
+#endif
for (y = 0; y < height && y + drawTop < s.h; y++) {
for (x = 0; x < width; x++) {
@@ -1287,19 +1288,19 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
if (scale2x) {
dst[2] = dst[3] = dst2[2] = dst2[3] = _shadowColor;
dst3[0] = dst4[0] = dst3[1] = dst4[1] = _shadowColor;
- } else
+ } else
#endif
{
dst[1] = dst2[0] = _shadowColor;
if (_shadowMode != kFMTOWNSShadowMode)
dst2[1] = _shadowColor;
- }
+ }
}
dst[0] = col;
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
if (scale2x)
- dst[1] = dst2[0] = dst2[1] = col;
+ dst[1] = dst2[0] = dst2[1] = col;
#endif
}
}
@@ -1317,7 +1318,7 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con
dst += pitch;
dst2 += pitch;
-#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
+#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
dst3 += pitch;
dst4 += pitch;
#endif
@@ -1519,10 +1520,10 @@ void CharsetRendererNES::printChar(int chr, bool ignoreCharsetMask) {
if (ignoreCharsetMask || !vs->hasTwoBuffers) {
dst = vs->getPixels(_left, drawTop);
- drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->bytesPerPixel);
+ drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->format.bytesPerPixel);
} else {
dst = (byte *)_vm->_textSurface.pixels + _top * _vm->_textSurface.pitch + _left;
- drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.bytesPerPixel);
+ drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.format.bytesPerPixel);
}
if (_str.left > _left)
@@ -1552,7 +1553,7 @@ void CharsetRendererNES::drawChar(int chr, Graphics::Surface &s, int x, int y) {
height = 8;
dst = (byte *)s.pixels + y * s.pitch + x;
- drawBits1(s, dst, charPtr, y, width, height, s.bytesPerPixel);
+ drawBits1(s, dst, charPtr, y, width, height, s.format.bytesPerPixel);
}
void CharsetRendererNES::drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth, bool scalex) {
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp
index bb3c4bcc02..820605924c 100644
--- a/engines/scumm/cursor.cpp
+++ b/engines/scumm/cursor.cpp
@@ -385,7 +385,7 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
s.pitch = s.w;
// s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917
assert(s.w <= 16 && s.h <= 17);
- s.bytesPerPixel = 1;
+ s.format = Graphics::PixelFormat::createFormatCLUT8();
_charset->drawChar(chr, s, 0, 0);
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index 63188c1d7a..4c1942b865 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/file.h"
#include "common/str.h"
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 6db3ea740a..51b46b033c 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -23,6 +23,9 @@
*
*/
+// FIXME: Avoid using printf
+#define FORBIDDEN_SYMBOL_EXCEPTION_printf
+
#include "base/plugins.h"
#include "common/archive.h"
@@ -1131,6 +1134,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co
break;
case 62:
case 61:
+ case 60:
*engine = new ScummEngine_v60he(syst, res);
break;
default:
diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h
index a5542ca868..952abdb39a 100644
--- a/engines/scumm/detection_tables.h
+++ b/engines/scumm/detection_tables.h
@@ -372,7 +372,7 @@ static const GameSettings gameVariantsTable[] = {
{"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
{"baseball2001", 0, 0, GID_BASEBALL2001, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
{"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
- {"SoccerMLS", 0, 0, GID_SOCCER, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
+ {"SoccerMLS", 0, 0, GID_SOCCERMLS, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
{"spyozon", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
{"freddicove", "", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
@@ -386,7 +386,7 @@ static const GameSettings gameVariantsTable[] = {
{"Baseball2003", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
{"basketball", 0, 0, GID_BASKETBALL, 6, 100, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
{"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
- {"Soccer2004", 0, 0, GID_SOCCER, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
+ {"Soccer2004", 0, 0, GID_SOCCER2004, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
// U32 code required, for testing only
{"moonbase", 0, 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI},
@@ -483,6 +483,7 @@ static const GameFilenamePattern gameFilenamesTable[] = {
#ifdef ENABLE_SCUMM_7_8
{ "dig", "dig.la%d", kGenDiskNum, UNK_LANG, UNK, 0 },
+ { "dig", "thedig.la%d", kGenDiskNum, UNK_LANG, UNK, "Demo" }, // Used by an alternate version of the demo
{ "dig", "The Dig Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, 0 },
{ "dig", "The Dig Demo Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, "Demo" },
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index 0e6e18905f..40e549471b 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -33,8 +33,8 @@
#include "scumm/detection.h"
namespace GUI {
- class ListWidget;
- class CommandSender;
+class ListWidget;
+class CommandSender;
}
diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp
index d9d84f04ff..47704d6eaf 100644
--- a/engines/scumm/file_nes.cpp
+++ b/engines/scumm/file_nes.cpp
@@ -28,6 +28,7 @@
#include "common/endian.h"
#include "common/md5.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
namespace Scumm {
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 80c13d30e3..e7abd5610e 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -391,8 +391,11 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int
vs->hasTwoBuffers = twobufs;
vs->xstart = 0;
vs->backBuf = NULL;
- vs->bytesPerPixel = (_game.features & GF_16BIT_COLOR) ? 2 : 1;
- vs->pitch = width * vs->bytesPerPixel;
+ if (_game.features & GF_16BIT_COLOR)
+ vs->format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
+ else
+ vs->format = Graphics::PixelFormat::createFormatCLUT8();
+ vs->pitch = width * vs->format.bytesPerPixel;
if (_game.version >= 7) {
// Increase the pitch by one; needed to accomodate the extra screen
@@ -628,7 +631,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
int m = _textSurfaceMultiplier;
int vsPitch;
int pitch = vs->pitch;
- vsPitch = vs->pitch - width * vs->bytesPerPixel;
+ vsPitch = vs->pitch - width * vs->format.bytesPerPixel;
if (_game.version < 7) {
@@ -673,7 +676,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
} else {
WRITE_UINT16(dstPtr, _16BitPalette[tmp]); dstPtr += 2;
}
- srcPtr += vs->bytesPerPixel;
+ srcPtr += vs->format.bytesPerPixel;
}
srcPtr += vsPitch;
textPtr += _textSurface.pitch - width * m;
@@ -712,7 +715,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
}
#endif
src = _compositeBuf;
- pitch = width * vs->bytesPerPixel;
+ pitch = width * vs->format.bytesPerPixel;
if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) {
ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height);
@@ -1042,17 +1045,17 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
return;
if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
- blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height, vs->bytesPerPixel);
+ blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height, vs->format.bytesPerPixel);
if (vs->number == kMainVirtScreen && _charset->_hasMask) {
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
if (_game.platform == Common::kPlatformFMTowns) {
byte *mask = (byte *)_textSurface.getBasePtr(rect.left * _textSurfaceMultiplier, (rect.top + vs->topline) * _textSurfaceMultiplier);
- fill(mask, _textSurface.pitch, 0, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel);
+ fill(mask, _textSurface.pitch, 0, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
} else
#endif
{
byte *mask = (byte *)_textSurface.getBasePtr(rect.left, rect.top - _screenTop);
- fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel);
+ fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
}
}
} else {
@@ -1060,14 +1063,14 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) {
if (_game.platform == Common::kPlatformFMTowns) {
backColor |= (backColor << 4);
byte *mask = (byte *)_textSurface.getBasePtr(rect.left * _textSurfaceMultiplier, (rect.top + vs->topline) * _textSurfaceMultiplier);
- fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel);
+ fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
}
#endif
if (_game.features & GF_16BIT_COLOR)
- fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->bytesPerPixel);
+ fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->format.bytesPerPixel);
else
- fill(screenBuf, vs->pitch, backColor, width, height, vs->bytesPerPixel);
+ fill(screenBuf, vs->pitch, backColor, width, height, vs->format.bytesPerPixel);
}
}
@@ -1096,7 +1099,7 @@ void ScummEngine::restoreCharsetBg() {
if (vs->number != kMainVirtScreen) {
// Restore from back buffer
const byte *backBuf = vs->getBackPixels(0, 0);
- blit(screenBuf, vs->pitch, backBuf, vs->pitch, vs->w, vs->h, vs->bytesPerPixel);
+ blit(screenBuf, vs->pitch, backBuf, vs->pitch, vs->w, vs->h, vs->format.bytesPerPixel);
}
} else {
// Clear area
@@ -1124,7 +1127,7 @@ void ScummEngine::clearTextSurface() {
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
_game.platform == Common::kPlatformFMTowns ? 0 :
#endif
- CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.bytesPerPixel);
+ CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.format.bytesPerPixel);
}
byte *ScummEngine::getMaskBuffer(int x, int y, int z) {
@@ -1297,56 +1300,56 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
if (vs->number != kMainVirtScreen)
error("can only copy bg to main window");
- blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel);
+ blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->format.bytesPerPixel);
if (_charset->_hasMask) {
byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop) * _textSurfaceMultiplier);
- fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel);
+ fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
}
}
} else if (_game.heversion >= 72) {
// Flags are used for different methods in HE games
uint32 flags = color;
if ((flags & 0x2000) || (flags & 0x4000000)) {
- blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel);
+ blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->format.bytesPerPixel);
} else if ((flags & 0x4000) || (flags & 0x2000000)) {
- blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->bytesPerPixel);
+ blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->format.bytesPerPixel);
} else if ((flags & 0x8000) || (flags & 0x1000000)) {
flags &= (flags & 0x1000000) ? 0xFFFFFF : 0x7FFF;
- fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
- fill(bgbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
+ fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel);
+ fill(bgbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel);
} else {
- fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
+ fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel);
}
} else if (_game.heversion >= 60) {
// Flags are used for different methods in HE games
uint16 flags = color;
if (flags & 0x2000) {
- blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel);
+ blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->format.bytesPerPixel);
} else if (flags & 0x4000) {
- blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->bytesPerPixel);
+ blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->format.bytesPerPixel);
} else if (flags & 0x8000) {
flags &= 0x7FFF;
- fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
- fill(bgbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
+ fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel);
+ fill(bgbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel);
} else {
- fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel);
+ fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel);
}
} else {
if (_game.features & GF_16BIT_COLOR) {
- fill(backbuff, vs->pitch, _16BitPalette[color], width, height, vs->bytesPerPixel);
+ fill(backbuff, vs->pitch, _16BitPalette[color], width, height, vs->format.bytesPerPixel);
} else {
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
if (_game.platform == Common::kPlatformFMTowns) {
color = ((color & 0x0f) << 4) | (color & 0x0f);
byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop + vs->topline) * _textSurfaceMultiplier);
- fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel);
+ fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel);
if (_game.id == GID_MONKEY2 || _game.id == GID_INDY4 || ((_game.id == GID_INDY3 || _game.id == GID_ZAK) && vs->number != kTextVirtScreen) || (_game.id == GID_LOOM && vs->number == kMainVirtScreen))
return;
}
#endif
- fill(backbuff, vs->pitch, color, width, height, vs->bytesPerPixel);
+ fill(backbuff, vs->pitch, color, width, height, vs->format.bytesPerPixel);
}
}
}
@@ -1385,7 +1388,7 @@ void ScummEngine_v5::drawFlashlight() {
_flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY);
if (_flashlight.buffer) {
- fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h, vs->bytesPerPixel);
+ fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h, vs->format.bytesPerPixel);
}
_flashlight.isDrawn = false;
}
@@ -1432,20 +1435,20 @@ void ScummEngine_v5::drawFlashlight() {
_flashlight.buffer = vs->getPixels(_flashlight.x, _flashlight.y);
bgbak = vs->getBackPixels(_flashlight.x, _flashlight.y);
- blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->bytesPerPixel);
+ blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->format.bytesPerPixel);
// Round the corners. To do so, we simply hard-code a set of nicely
// rounded corners.
static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
int minrow = 0;
- int maxcol = (_flashlight.w - 1) * vs->bytesPerPixel;
+ int maxcol = (_flashlight.w - 1) * vs->format.bytesPerPixel;
int maxrow = (_flashlight.h - 1) * vs->pitch;
for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) {
int d = corner_data[i];
for (j = 0; j < d; j++) {
- if (vs->bytesPerPixel == 2) {
+ if (vs->format.bytesPerPixel == 2) {
WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0);
WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0);
WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0);
@@ -1761,7 +1764,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
}
#endif
- _vertStripNextInc = height * vs->pitch - 1 * vs->bytesPerPixel;
+ _vertStripNextInc = height * vs->pitch - 1 * vs->format.bytesPerPixel;
_objectMode = (flag & dbObjectMode) == dbObjectMode;
prepareDrawBitmap(ptr, vs, x, y, width, height, stripnr, numstrip);
@@ -1794,9 +1797,9 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
// In the case of a double buffered virtual screen, we draw to
// the backbuffer, otherwise to the primary surface memory.
if (vs->hasTwoBuffers)
- dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->bytesPerPixel);
+ dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
else
- dstPtr = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->bytesPerPixel);
+ dstPtr = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
transpStrip = drawStrip(dstPtr, vs, x, y, width, height, stripnr, smap_ptr);
@@ -1805,11 +1808,11 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const
transpStrip = true;
if (vs->hasTwoBuffers) {
- byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->bytesPerPixel);
+ byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel);
if (lightsOn)
- copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->bytesPerPixel);
+ copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->format.bytesPerPixel);
else
- clear8Col(frontBuf, vs->pitch, height, vs->bytesPerPixel);
+ clear8Col(frontBuf, vs->pitch, height, vs->format.bytesPerPixel);
}
decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag, tmsk_ptr);
@@ -2045,7 +2048,7 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) {
drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, true);
break;
case 150:
- fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h, vs->bytesPerPixel);
+ fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h, vs->format.bytesPerPixel);
break;
default:
// Alternative russian freddi3 uses badly formatted bitmaps
@@ -2156,7 +2159,7 @@ void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) {
assert(rw <= _screenWidth && rw > 0);
assert(rh <= _screenHeight && rh > 0);
- blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh, vs->bytesPerPixel);
+ blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh, vs->format.bytesPerPixel);
markRectAsDirty(kMainVirtScreen, rect, dirtybit);
}
#endif
@@ -2186,15 +2189,15 @@ void Gdi::resetBackground(int top, int bottom, int strip) {
if (bottom > vs->bdirty[strip])
vs->bdirty[strip] = bottom;
- bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->bytesPerPixel;
- backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->bytesPerPixel;
+ bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel;
+ backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel;
numLinesToProcess = bottom - top;
if (numLinesToProcess) {
if (_vm->isLightOn()) {
- copy8Col(backbuff_ptr, vs->pitch, bgbak_ptr, numLinesToProcess, vs->bytesPerPixel);
+ copy8Col(backbuff_ptr, vs->pitch, bgbak_ptr, numLinesToProcess, vs->format.bytesPerPixel);
} else {
- clear8Col(backbuff_ptr, vs->pitch, numLinesToProcess, vs->bytesPerPixel);
+ clear8Col(backbuff_ptr, vs->pitch, numLinesToProcess, vs->format.bytesPerPixel);
}
}
}
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index c6062ef9be..3f69d75efd 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -158,11 +158,11 @@ struct VirtScreen : Graphics::Surface {
}
byte *getPixels(int x, int y) const {
- return (byte *)pixels + y * pitch + (xstart + x) * bytesPerPixel;
+ return (byte *)pixels + y * pitch + (xstart + x) * format.bytesPerPixel;
}
byte *getBackPixels(int x, int y) const {
- return (byte *)backBuf + y * pitch + (xstart + x) * bytesPerPixel;
+ return (byte *)backBuf + y * pitch + (xstart + x) * format.bytesPerPixel;
}
};
diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp
index abf2da63a6..78c7ef23f1 100644
--- a/engines/scumm/gfx_towns.cpp
+++ b/engines/scumm/gfx_towns.cpp
@@ -48,7 +48,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in
int dp1 = _townsScreen->getLayerPitch(0) - width * _townsScreen->getLayerBpp(0);
int dp2 = _townsScreen->getLayerPitch(1) - width * m * _townsScreen->getLayerBpp(1);
- int sp1 = vs->pitch - (width * vs->bytesPerPixel);
+ int sp1 = vs->pitch - (width * vs->format.bytesPerPixel);
int sp2 = _textSurface.pitch - width * m;
if (vs->number == kMainVirtScreen || _game.id == GID_INDY3 || _game.id == GID_ZAK) {
diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp
index a16af73135..5cd75a5c62 100644
--- a/engines/scumm/he/cup_player_he.cpp
+++ b/engines/scumm/he/cup_player_he.cpp
@@ -30,6 +30,7 @@
#include "audio/audiostream.h"
#include "audio/mixer.h"
#include "audio/decoders/raw.h"
+#include "graphics/palette.h"
#include "scumm/scumm.h"
#include "scumm/util.h"
#include "scumm/he/intern_he.h"
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index 0f2d232179..297c2992db 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -823,12 +823,18 @@ int LogicHEsoccer::versionID() {
}
LogicHEsoccer::LogicHEsoccer(ScummEngine_v90he *vm) : LogicHE(vm) {
- _userData = (byte *)calloc(6921, 1); // Allocate user data
- _userDataD = (double *)_userData;
+ _userDataD = (double *)calloc(1732, sizeof(double));
+ _intArray1 = 0;
+ _intArray2 = 0;
+ _intArraysAllocated = false;
+ _array1013 = 0;
+ _array1013Allocated = false;
}
LogicHEsoccer::~LogicHEsoccer() {
- free(_userData);
+ free(_userDataD);
+ op_1020(); // clear int arrays
+ delete[] _array1013;
}
int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) {
@@ -853,6 +859,8 @@ int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) {
case 1011:
// args[4] is ignored!
+ // soccer passes the argument, but then ends up not using it
+ // Makes sense that they removed it for soccermls
res = op_1011(args[0], args[1], args[2], args[3], args[5]);
break;
@@ -864,10 +872,18 @@ int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) {
res = op_1013(args[0], args[1], args[2]);
break;
+ case 1019:
+ res = op_1019(args);
+ break;
+
case 1020:
res = op_1020();
break;
+ case 1021:
+ res = op_1021(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
+ break;
+
case 8221968:
// Someone had a fun and used his birthday as opcode number
res = getFromArray(args[0], args[1], args[2]);
@@ -882,7 +898,7 @@ int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) {
}
void LogicHEsoccer::beforeBootScript() {
- if (_userData[6869])
+ if (_intArraysAllocated)
op_1020();
_userDataD[530] = 0;
@@ -890,7 +906,7 @@ void LogicHEsoccer::beforeBootScript() {
void LogicHEsoccer::initOnce() {
// The original sets some paths here that we don't need to worry about
- _userData[6881] = 0;
+ _array1013Allocated = false;
_userDataD[530] = 0;
}
@@ -899,6 +915,8 @@ int LogicHEsoccer::startOfFrame() {
int res = (int)_userDataD[530];
// _userDataD[535] is not used!
+ // soccer passes the argument, but then ends up not using it
+ // Makes sense that they removed it for soccermls
if (res)
res = op_1011((int)_userDataD[531], (int)_userDataD[532], (int)_userDataD[533], (int)_userDataD[534], (int)_userDataD[536]);
@@ -968,11 +986,11 @@ int LogicHEsoccer::op_1006(int32 a1, int32 a2, int32 a3, int32 a4) {
}
int LogicHEsoccer::op_1007(int32 *args) {
- // TODO: Used when the HE logo is shown
+ // Used when the HE logo is shown
// This initializes the _userDataD fields that are used in op_1006/op_1011
+ _intArraysAllocated = false;
double v14 = (double)args[0] * 0.01;
- _userData[6873] = 0;
double v13 = (double)args[2] * 0.01;
_userDataD[524] = v14;
double v12 = atan2(v13, v14);
@@ -990,25 +1008,20 @@ int LogicHEsoccer::op_1007(int32 *args) {
_userDataD[523] = _userDataD[527] / _userDataD[519];
_userDataD[518] = v13;
- *((uint32 *)_userData[6857]) = 0;
- memset(_userData + 2737, 0, 4 * 1024);
- for (int i = 0; i < 146; i++)
- _userDataD[538 + i] = 0;
- _userData[2736] = 0;
+ // Clear both byte arrays
+ memset(_byteArray1, 0, 4096);
+ memset(_byteArray2, 0, 585);
- if (*((uint32 *)_userData[6885]) == 0 )
+ if (_array1013Allocated == 0 )
op_1013(4, args[8], args[9]);
return 1;
}
-#if 0
-// TODO: Used by several opcodes
// Returns the square root of the sum of the squares of the arguments
-static inline double fsqrtSquare(double a1, double a2, double a3) {
+static inline double sqrtSquare(double a1, double a2, double a3) {
return sqrt(a1 * a1 + a2 * a2 + a3 * a3);
-}
-#endif
+}
int LogicHEsoccer::op_1008(int32 *args) {
// TODO: Used during a match (kicking?)
@@ -1020,7 +1033,7 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5) {
// This is called on each frame by startOfFrame() if activated by op_1012.
// This seems to do player placement!
- float v28;
+ float v28 = 0.0;
for (int i = 0; i < 18; i++) {
// These seem to be some sort of percent? of angles?
@@ -1060,15 +1073,15 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5) {
putInArray(a5, 0, i, v24 + 11 * v21);
}
- float v7 = atan2(_userDataD[524] - v28, v31);
+ float v7 = atan2(_userDataD[524] - v28, (double)v31);
int v8 = (int)(_userDataD[526] - (_userDataD[521] - v7) * _userDataD[522] + 300.0);
- double v9 = atan2(_userDataD[523], v31);
+ double v9 = atan2(_userDataD[523], (double)v31);
// x/y position?
putInArray(a2, i, 0, (int32)(v29 * v9 + 640.0));
putInArray(a2, i, 1, v8);
- double v10 = atan2(_userDataD[524], v31);
+ double v10 = atan2(_userDataD[524], (double)v31);
int v12 = (int)(_userDataD[526] - (_userDataD[521] - (float)v10) * _userDataD[522] + 300.0);
double v13 = _userDataD[523];
@@ -1078,7 +1091,12 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5) {
putInArray(a2, i + 22, 1, v12);
}
- for (int i = 18; i < 22; i++) {
+ // soccer only uses one array here
+ // soccermls/soccer2004 use four
+ int start = (_vm->_game.id == GID_SOCCER) ? 19 : 18;
+ int end = (_vm->_game.id == GID_SOCCER) ? 19 : 21;
+
+ for (int i = start; i <= end; i++) {
int v14 = getFromArray(a2, i, 0);
int v15 = getFromArray(a2, i, 1);
@@ -1131,10 +1149,6 @@ void LogicHEsoccer::op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4) {
}
}
- int v9 = getFromArray(a1, 20, 0);
- int v10 = getFromArray(a1, 20, 2);
- int v11 = getFromArray(a1, 21, 0);
- int v12 = getFromArray(a1, 21, 2);
int v13 = getFromArray(a1, 18, 0);
int v14 = getFromArray(a1, 18, 2);
int v15 = getFromArray(a1, 19, 0);
@@ -1142,14 +1156,29 @@ void LogicHEsoccer::op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4) {
int v19[15];
int v20[15];
- for (int i = 0; i < 6; i++) {
- v20[i] = distance(v9, v7[i], v10, v8[i]);
- v19[i] = distance(v13, v7[i], v14, v8[i]);
- }
+ if (_vm->_game.id == GID_SOCCER) {
+ // soccer gets to be different
+ for (int i = 0; i < 13; i++)
+ v20[i] = distance(v13, v7[i], v14, v8[i]);
+
+ for (int i = 0; i < 13; i++)
+ v19[i] = distance(v15, v7[i], v16, v8[i]);
+ } else {
+ // soccermls and soccer2004 use two other arrays here
+ int v9 = getFromArray(a1, 20, 0);
+ int v10 = getFromArray(a1, 20, 2);
+ int v11 = getFromArray(a1, 21, 0);
+ int v12 = getFromArray(a1, 21, 2);
+
+ for (int i = 0; i < 6; i++) {
+ v20[i] = distance(v9, v7[i], v10, v8[i]);
+ v19[i] = distance(v13, v7[i], v14, v8[i]);
+ }
- for (int i = 6; i < 13; i++) {
- v20[i] = distance(v11, v7[i], v12, v8[i]);
- v19[i] = distance(v15, v7[i], v16, v8[i]);
+ for (int i = 6; i < 13; i++) {
+ v20[i] = distance(v11, v7[i], v12, v8[i]);
+ v19[i] = distance(v15, v7[i], v16, v8[i]);
+ }
}
for (int i = 0; i < 13; i++) {
@@ -1164,6 +1193,7 @@ void LogicHEsoccer::op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4) {
int LogicHEsoccer::op_1012(int32 *args) {
// Used after op_1019
// This function activates startOfFrame() to call op_1011
+ // (Possibly field parameters?)
_userDataD[530] = (args[0] != 0) ? 1 : 0;
_userDataD[531] = args[1];
@@ -1176,8 +1206,6 @@ int LogicHEsoccer::op_1012(int32 *args) {
return 1;
}
-#if 0
-// TODO: Used by op_1013
// Some strange power operation, ignores negative exponents
static inline double u32Pow(float a1, int a2) {
if (a2 < 0)
@@ -1190,34 +1218,126 @@ static inline double u32Pow(float a1, int a2) {
return v4;
}
-#endif
+
+int LogicHEsoccer::op_sub5(int a1, int a2, int a3) {
+ byte *v9 = _array1013 + 44 * a2;
+
+ *((uint32 *)v9 + 4) = a3;
+ *((uint32 *)v9) = a2;
+
+ if (a1 > 2) {
+ // Casual observation: 585 is also the size of _byteArray2
+ *((uint32 *)v9 + 40) = 8 * a2 - 585;
+ for (int i = 0; i < 8; i++)
+ *((uint32 *)v9 + 4 * i + 8) = 0xffffffff;
+ } else {
+ for (int i = 0; i < 8; i++)
+ *((uint32 *)v9 + 4 * i + 8) = op_sub5(a1 + 1, i + 8 * a2 + 1, a2);
+ }
+
+ return a2;
+}
int LogicHEsoccer::op_1013(int32 a1, int32 a2, int32 a3) {
- // TODO: Called by op_1007
+ // Creates _array1013 for *some* purpose
+ // _array1013Temp is used again op_1014 for some reason...
+ // Seems to be used in op_1015
+
+ int v4 = (int)((1.0 - u32Pow(8.0, 4)) / -7.0);
+
+ _array1013 = new byte[v4 * 44];
+ memset(_array1013, 0, v4 * 44);
+ _array1013Allocated = true;
+ memset(_array1013Temp, 0, 44);
+
+ for (int i = 0; i < 8; i++)
+ _array1013Temp[i + 2] = op_sub5(1, i + 1, 0);
+
+ // Yes, this is not endian-safe, but should not matter since we're
+ // not saving/loading the data anywhere
+ memcpy(_array1013, _array1013Temp, 44);
return 1;
}
-int LogicHEsoccer::op_1014(int32 *args) {
+int LogicHEsoccer::op_1014(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7, int32 a8, int32 a9, int32 a10, int32 a11, int32 a12, int32 a13, int32 a14) {
// TODO: Used many times during a match
+ // And called from op_1008!
return 1;
}
int LogicHEsoccer::op_1019(int32 *args) {
- // TODO: Used at the beginning of a match
+ // Used at the beginning of a match
+ // Initializes some arrays. Player positions?
+
+ // These two arrays are used in op_1014 and op_1015
+ for (int i = 0; i < 4096; i++)
+ _byteArray1[i] = getFromArray(args[1], 0, i);
+
+ for (int i = 0; i < 585; i++)
+ _byteArray2[i] = getFromArray(args[0], 0, i);
+
+ // Deallocate the two integer arrays
+ if (_intArraysAllocated)
+ op_1020();
+
+ // Reallocate them
+ _intArray1 = new uint32[1008];
+ _intArray2 = new uint32[168];
+ _intArraysAllocated = true;
+
+ memset(_intArray1, 0, 4 * 4);
+ memset(_intArray2, 0, 24 * 4);
+
+ // These two arrays are used in op_1015
+ for (int i = 0; i < 42; i++) {
+ for (int j = 0; j < 24; j++)
+ _intArray1[j + 24 * i] = getFromArray(args[3], 0, j + 24 * i);
+
+ for (int j = 0; j < 4; j++)
+ _intArray2[j + 4 * i] = getFromArray(args[2], 0, j + 4 * i);
+ }
return 1;
}
int LogicHEsoccer::op_1020() {
- // TODO: Called by several other opcodes. Possibly "stop play"?
+ // Deallocate integer arrays
+ // The arrays can be allocated in op_1015 or op_1019
+
+ delete[] _intArray1; _intArray1 = 0;
+ delete[] _intArray2; _intArray2 = 0;
+ _intArraysAllocated = false;
return 1;
}
-int LogicHEsoccer::op_1021(int32 *args) {
- // TODO: Used during a match (ball movement?)
+int LogicHEsoccer::op_1021(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7) {
+ // Used during a match (ball movement?)
+ // Also called from op_1008
+
+ int v10;
+ if (a4 && a5)
+ v10 = (int)(((double)a2 - (double)a5 * (double)a1 / (double)a4) * -1.0 * (double)a4 / (double)a5);
+ else
+ v10 = a1;
+
+ int v9;
+ if (a6 && a5)
+ v9 = (int)(((double)a2 - (double)a5 * (double)a3 / (double)a6) * -1.0 * (double)a6 / (double)a5);
+ else
+ v9 = a3;
+
+ // The final argument chooses whether to store the results for op_1008 or
+ // store them in SCUMM variables.
+ if (a7) {
+ _var1021[0] = v10;
+ _var1021[1] = v9;
+ } else {
+ writeScummVar(108, v10);
+ writeScummVar(109, v9);
+ }
return 1;
}
diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h
index c2ea2b8ec6..d097d37e75 100644
--- a/engines/scumm/he/logic_he.h
+++ b/engines/scumm/he/logic_he.h
@@ -111,7 +111,6 @@ private:
class LogicHEsoccer : public LogicHE {
private:
- byte *_userData;
double *_userDataD;
public:
@@ -130,21 +129,38 @@ private:
int op_1002(int32 *args);
int op_1003(int32 *args);
int op_1004(int32 *args);
- // op_1006 can be called from other opcodes!
int op_1006(int32 a1, int32 a2, int32 a3, int32 a4);
int op_1007(int32 *args);
int op_1008(int32 *args);
- // op_1011 can be called from other opcodes!
int op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5);
- void op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4);
int op_1012(int32 *args);
- // op_1013 can be called from other opcodes!
int op_1013(int32 a1, int32 a2, int32 a3);
- int op_1014(int32 *args);
+ int op_1014(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7, int32 a8, int32 a9, int32 a10, int32 a11, int32 a12, int32 a13, int32 a14);
int op_1019(int32 *args);
- // op_1020 can be called from other opcodes!
int op_1020();
- int op_1021(int32 *args);
+ int op_1021(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7);
+
+ // Two integer arrays are used between some functions
+ // Originally, these pointers were in _userData, but we keep them separate
+ // Also, doing it that would break things on non 32-bit systems...
+ bool _intArraysAllocated;
+ uint32 *_intArray1, *_intArray2;
+
+ // op_1007 allocates some arrays
+ // they're then filled by op_1019
+ byte _byteArray1[4096], _byteArray2[585];
+
+ // op_1011 has a subfunction
+ void op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4);
+
+ // op_1013 creates some array, purpose unknown
+ bool _array1013Allocated;
+ byte *_array1013;
+ uint32 _array1013Temp[11];
+ int op_sub5(int a1, int a2, int a3);
+
+ // op_1021 can (optionally) set two variables for use in op_1008
+ uint32 _var1021[2];
};
class LogicHEbaseball2001 : public LogicHE {
diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp
index 7f517c56ed..49e43a040b 100644
--- a/engines/scumm/he/palette_he.cpp
+++ b/engines/scumm/he/palette_he.cpp
@@ -26,6 +26,7 @@
#ifdef ENABLE_HE
#include "common/system.h"
+#include "graphics/palette.h"
#include "scumm/scumm.h"
#include "scumm/he/intern_he.h"
#include "scumm/resource.h"
diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp
index 40889ec24f..487429c294 100644
--- a/engines/scumm/imuse/imuse_part.cpp
+++ b/engines/scumm/imuse/imuse_part.cpp
@@ -25,6 +25,8 @@
+#include "common/debug.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "scumm/imuse/imuse_internal.h"
#include "scumm/saveload.h"
diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp
index c96b2f757b..78028c6056 100644
--- a/engines/scumm/imuse/sysex_scumm.cpp
+++ b/engines/scumm/imuse/sysex_scumm.cpp
@@ -24,6 +24,7 @@
#include "common/endian.h"
+#include "common/textconsole.h"
#include "common/util.h"
/*
diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h
index 236edb5a89..1e96aa8827 100644
--- a/engines/scumm/imuse_digi/dimuse.h
+++ b/engines/scumm/imuse_digi/dimuse.h
@@ -26,6 +26,8 @@
#define SCUMM_IMUSE_DIGI_H
#include "common/scummsys.h"
+#include "common/mutex.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "scumm/imuse_digi/dimuse.h"
diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp
index e737d747ac..be77e4fd66 100644
--- a/engines/scumm/midiparser_ro.cpp
+++ b/engines/scumm/midiparser_ro.cpp
@@ -26,6 +26,7 @@
#include "audio/midiparser.h"
#include "audio/mididrv.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Scumm {
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index e81212fec8..b0786c924d 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -23,8 +23,11 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/util.h"
+#include "graphics/palette.h"
+
#include "scumm/resource.h"
#include "scumm/scumm.h"
#include "scumm/scumm_v6.h"
diff --git a/engines/scumm/player_mod.h b/engines/scumm/player_mod.h
index 67d1bb4cbf..3f97c4cab9 100644
--- a/engines/scumm/player_mod.h
+++ b/engines/scumm/player_mod.h
@@ -31,7 +31,7 @@
#include "audio/mixer.h"
namespace Audio {
- class RateConverter;
+class RateConverter;
}
namespace Scumm {
diff --git a/engines/scumm/player_nes.h b/engines/scumm/player_nes.h
index 5f6e8f2d8d..402eea7bf8 100644
--- a/engines/scumm/player_nes.h
+++ b/engines/scumm/player_nes.h
@@ -35,7 +35,7 @@ namespace Scumm {
class ScummEngine;
namespace APUe {
- class APU;
+class APU;
}
static const int MAXVOLUME = 0x7F;
diff --git a/engines/scumm/player_pce.h b/engines/scumm/player_pce.h
index 3f5033f724..42153e8abc 100644
--- a/engines/scumm/player_pce.h
+++ b/engines/scumm/player_pce.h
@@ -27,6 +27,7 @@
#define SCUMM_PLAYER_PCE_H
#include "common/scummsys.h"
+#include "common/mutex.h"
#include "scumm/music.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp
index 0d5832a5fb..11468f3097 100644
--- a/engines/scumm/player_sid.cpp
+++ b/engines/scumm/player_sid.cpp
@@ -1296,7 +1296,7 @@ int Player_SID::readBuffer(int16 *buffer, const int numSamples) {
_cpuCyclesLeft = timingProps[_videoSystem].cyclesPerFrame;
}
// fetch samples
- int sampleCount = _sid->clock(_cpuCyclesLeft, (short*)buffer, samplesLeft);
+ int sampleCount = _sid->updateClock(_cpuCyclesLeft, (short*)buffer, samplesLeft);
samplesLeft -= sampleCount;
buffer += sampleCount;
}
diff --git a/engines/scumm/player_v4a.h b/engines/scumm/player_v4a.h
index 108dbcf317..458a39b5fe 100644
--- a/engines/scumm/player_v4a.h
+++ b/engines/scumm/player_v4a.h
@@ -27,6 +27,7 @@
#define SCUMM_PLAYER_V4A_H
#include "common/scummsys.h"
+#include "common/util.h"
#include "scumm/music.h"
#include "audio/mixer.h"
#include "audio/mods/tfmx.h"
diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h
index 91e780bcd1..eead241b90 100644
--- a/engines/scumm/saveload.h
+++ b/engines/scumm/saveload.h
@@ -30,8 +30,8 @@
#include <stddef.h> // for ptrdiff_t
namespace Common {
- class SeekableReadStream;
- class WriteStream;
+class SeekableReadStream;
+class WriteStream;
}
namespace Scumm {
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 920887e387..f43aed53f7 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1222,7 +1222,7 @@ void ScummEngine::setupScumm() {
setupCharsetRenderer();
// Create and clear the text surface
- _textSurface.create(_screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, 1);
+ _textSurface.create(_screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, Graphics::PixelFormat::createFormatCLUT8());
clearTextSurface();
// Create the costume renderer
@@ -1648,6 +1648,8 @@ void ScummEngine_v90he::resetScumm() {
break;
case GID_SOCCER:
+ case GID_SOCCERMLS:
+ case GID_SOCCER2004:
_logicHE = new LogicHEsoccer(this);
break;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 266a2c4948..62c6c70e5a 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -35,6 +35,7 @@
#include "common/random.h"
#include "common/rect.h"
#include "common/str.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
#include "graphics/sjis.h"
@@ -56,12 +57,12 @@
#endif
namespace GUI {
- class Dialog;
+class Dialog;
}
using GUI::Dialog;
namespace Common {
- class SeekableReadStream;
- class WriteStream;
+class SeekableReadStream;
+class WriteStream;
}
/**
@@ -253,6 +254,8 @@ enum ScummGameId {
GID_FUNSHOP, // Used for all three funshops
GID_FOOTBALL,
GID_SOCCER,
+ GID_SOCCERMLS,
+ GID_SOCCER2004,
GID_BASEBALL2001,
GID_BASKETBALL,
GID_MOONBASE,
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp
index 4389890994..95b7653262 100644
--- a/engines/scumm/smush/channel.cpp
+++ b/engines/scumm/smush/channel.cpp
@@ -24,6 +24,8 @@
*/
+#include "common/textconsole.h"
+
#include "scumm/smush/channel.h"
namespace Scumm {
diff --git a/engines/scumm/smush/channel.h b/engines/scumm/smush/channel.h
index c35ac0ac00..717a294d96 100644
--- a/engines/scumm/smush/channel.h
+++ b/engines/scumm/smush/channel.h
@@ -29,7 +29,7 @@
#include "common/util.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Scumm {
diff --git a/engines/scumm/smush/codec37.cpp b/engines/scumm/smush/codec37.cpp
index 658d67c1b4..9dbbc6816f 100644
--- a/engines/scumm/smush/codec37.cpp
+++ b/engines/scumm/smush/codec37.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "scumm/bomp.h"
#include "scumm/smush/codec37.h"
diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp
index 3a1639c35f..47286ba4fc 100644
--- a/engines/scumm/smush/codec47.cpp
+++ b/engines/scumm/smush/codec47.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "scumm/bomp.h"
#include "scumm/smush/codec47.h"
diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp
index 04ed955224..f730acf804 100644
--- a/engines/scumm/smush/saud_channel.cpp
+++ b/engines/scumm/smush/saud_channel.cpp
@@ -26,6 +26,7 @@
#include "common/endian.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "scumm/util.h"
#include "scumm/smush/channel.h"
diff --git a/engines/scumm/smush/smush_mixer.h b/engines/scumm/smush/smush_mixer.h
index c7a7354511..3d62fdc722 100644
--- a/engines/scumm/smush/smush_mixer.h
+++ b/engines/scumm/smush/smush_mixer.h
@@ -27,6 +27,8 @@
#define SCUMM_SMUSH_MIXER_H
+#include "audio/mixer.h"
+#include "common/mutex.h"
#include "scumm/sound.h"
namespace Scumm {
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp
index 0e4f588593..2e39558372 100644
--- a/engines/scumm/smush/smush_player.cpp
+++ b/engines/scumm/smush/smush_player.cpp
@@ -31,6 +31,7 @@
#include "common/util.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "scumm/bomp.h"
#include "scumm/file.h"
diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp
index 54f35c1969..a38119584f 100644
--- a/engines/scumm/sound.cpp
+++ b/engines/scumm/sound.cpp
@@ -527,6 +527,10 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle
sprintf(filename, "audio/%s.%d/%d.voc", roomname, offset, b);
_vm->openFile(*_sfxFile, filename);
if (!_sfxFile->isOpen()) {
+ sprintf(filename, "audio/%s_%d/%d.voc", roomname, offset, b);
+ _vm->openFile(*_sfxFile, filename);
+ }
+ if (!_sfxFile->isOpen()) {
sprintf(filename, "%d.%d.voc", offset, b);
_vm->openFile(*_sfxFile, filename);
}
diff --git a/engines/scumm/util.cpp b/engines/scumm/util.cpp
index ccd0230efa..5c3e4c9d0c 100644
--- a/engines/scumm/util.cpp
+++ b/engines/scumm/util.cpp
@@ -25,6 +25,7 @@
#include "scumm/util.h"
#include "common/util.h"
+#include "common/textconsole.h"
namespace Scumm {
diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp
index dae4b94291..d6974837c6 100644
--- a/engines/sky/autoroute.cpp
+++ b/engines/sky/autoroute.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "sky/autoroute.h"
diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp
index 08184adcdb..672fb38ca9 100644
--- a/engines/sky/compact.cpp
+++ b/engines/sky/compact.cpp
@@ -24,9 +24,10 @@
*/
+#include "common/debug.h"
#include "common/endian.h"
-#include "common/util.h"
#include "common/file.h"
+#include "common/textconsole.h"
#include "sky/compact.h"
#include "gui/message.h"
#include <stddef.h> // for ptrdiff_t
diff --git a/engines/sky/compact.h b/engines/sky/compact.h
index cd80d5cfbe..4861273146 100644
--- a/engines/sky/compact.h
+++ b/engines/sky/compact.h
@@ -31,7 +31,7 @@
#include "sky/skydefs.h"
namespace Common {
- class File;
+class File;
}
enum CptIds {
diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp
index 8a5409a488..f31f0f6ba9 100644
--- a/engines/sky/control.cpp
+++ b/engines/sky/control.cpp
@@ -26,11 +26,10 @@
#include "common/endian.h"
#include "common/config-manager.h"
-#include "common/file.h"
#include "common/events.h"
#include "common/system.h"
#include "common/savefile.h"
-#include "common/util.h"
+#include "common/textconsole.h"
#include "gui/message.h"
#include "sky/compact.h"
diff --git a/engines/sky/control.h b/engines/sky/control.h
index a0024ce73b..e4428c1876 100644
--- a/engines/sky/control.h
+++ b/engines/sky/control.h
@@ -33,7 +33,7 @@
class OSystem;
namespace Common {
- class SaveFileManager;
+class SaveFileManager;
}
namespace Sky {
diff --git a/engines/sky/debug.cpp b/engines/sky/debug.cpp
index 2839665ff8..df55966a9a 100644
--- a/engines/sky/debug.cpp
+++ b/engines/sky/debug.cpp
@@ -24,7 +24,7 @@
*/
-#include "common/endian.h"
+#include "common/debug.h"
#include "common/util.h"
#include "sky/debug.h"
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index e72875fa4e..6871fc9604 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -34,6 +34,7 @@
#include "common/file.h"
#include "common/fs.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "engines/metaengine.h"
diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp
index 5ad0c3eb19..3795c4166d 100644
--- a/engines/sky/disk.cpp
+++ b/engines/sky/disk.cpp
@@ -24,12 +24,12 @@
*/
+#include "common/debug.h"
+#include "common/textconsole.h"
#include "common/endian.h"
#include "common/file.h"
-#include "common/util.h"
#include "sky/disk.h"
-#include "sky/rnc_deco.h"
#include "sky/sky.h"
#include "sky/struc.h"
diff --git a/engines/sky/disk.h b/engines/sky/disk.h
index 3338cce385..0cdcbb4d0f 100644
--- a/engines/sky/disk.h
+++ b/engines/sky/disk.h
@@ -28,13 +28,12 @@
#include "common/scummsys.h"
-#include "common/str.h"
#include "sky/rnc_deco.h"
#define MAX_FILES_IN_LIST 60
namespace Common {
- class File;
+class File;
}
namespace Sky {
diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp
index cf1910c5b1..506a6699c1 100644
--- a/engines/sky/intro.cpp
+++ b/engines/sky/intro.cpp
@@ -28,6 +28,7 @@
#include "common/util.h"
#include "common/events.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "sky/disk.h"
#include "sky/intro.h"
diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index b52e908455..f9ebd0fb64 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -25,9 +25,8 @@
#include "common/endian.h"
#include "common/rect.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
-#include "common/system.h"
+#include "common/textconsole.h"
#include "sky/autoroute.h"
#include "sky/compact.h"
diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp
index ca0ebcc19c..611010fa46 100644
--- a/engines/sky/mouse.cpp
+++ b/engines/sky/mouse.cpp
@@ -26,6 +26,7 @@
#include "common/events.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
#include "sky/disk.h"
#include "sky/logic.h"
diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp
index e9c20de8c7..9b3c4338ab 100644
--- a/engines/sky/music/adlibchannel.cpp
+++ b/engines/sky/music/adlibchannel.cpp
@@ -25,6 +25,7 @@
#include "common/endian.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "sky/music/adlibchannel.h"
#include "sky/sky.h"
diff --git a/engines/sky/music/gmchannel.cpp b/engines/sky/music/gmchannel.cpp
index 3852a69068..be0afa8894 100644
--- a/engines/sky/music/gmchannel.cpp
+++ b/engines/sky/music/gmchannel.cpp
@@ -25,6 +25,7 @@
#include "gmchannel.h"
#include "common/util.h"
+#include "common/textconsole.h"
#include "audio/mididrv.h"
namespace Sky {
diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp
index 8818c5b711..6a8529f287 100644
--- a/engines/sky/music/gmmusic.cpp
+++ b/engines/sky/music/gmmusic.cpp
@@ -28,6 +28,7 @@
#include "sky/sky.h"
#include "common/util.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "audio/mididrv.h"
namespace Sky {
diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp
index 51df95e451..4f47e511c7 100644
--- a/engines/sky/music/mt32music.cpp
+++ b/engines/sky/music/mt32music.cpp
@@ -28,6 +28,7 @@
#include "common/util.h"
#include "common/system.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "audio/mididrv.h"
namespace Sky {
diff --git a/engines/sky/music/musicbase.cpp b/engines/sky/music/musicbase.cpp
index e1044a9505..748637f9d0 100644
--- a/engines/sky/music/musicbase.cpp
+++ b/engines/sky/music/musicbase.cpp
@@ -27,6 +27,7 @@
#include "sky/disk.h"
#include "common/util.h"
#include "common/endian.h"
+#include "common/textconsole.h"
namespace Sky {
diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp
index 1b815b9c38..a209571b37 100644
--- a/engines/sky/screen.cpp
+++ b/engines/sky/screen.cpp
@@ -27,6 +27,9 @@
#include "common/endian.h"
#include "common/events.h"
#include "common/system.h"
+#include "common/textconsole.h"
+
+#include "graphics/palette.h"
#include "sky/disk.h"
#include "sky/logic.h"
diff --git a/engines/sky/screen.h b/engines/sky/screen.h
index 2c870ebd89..5e226c49ed 100644
--- a/engines/sky/screen.h
+++ b/engines/sky/screen.h
@@ -31,8 +31,9 @@
#include "sky/skydefs.h"
class OSystem;
+
namespace Common {
- struct Rect;
+struct Rect;
}
namespace Sky {
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index f3556c84b3..f10ec1083a 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -25,6 +25,7 @@
#include "common/config-manager.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "sky/control.h"
#include "sky/debug.h"
diff --git a/engines/sky/sky.h b/engines/sky/sky.h
index 378bba73ee..58ac3ed26e 100644
--- a/engines/sky/sky.h
+++ b/engines/sky/sky.h
@@ -27,7 +27,8 @@
#define SKY_H
-#include "common/events.h"
+#include "common/error.h"
+#include "common/keyboard.h"
#include "engines/engine.h"
/**
@@ -52,7 +53,6 @@ struct SystemVars {
bool paused;
};
-struct Compact;
class Sound;
class Disk;
class Text;
diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp
index 3d247ed334..7191f6cd00 100644
--- a/engines/sky/sound.cpp
+++ b/engines/sky/sound.cpp
@@ -24,7 +24,9 @@
*/
+#include "common/debug.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "sky/disk.h"
#include "sky/logic.h"
diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp
index 548c9cb3c2..2464d93581 100644
--- a/engines/sky/text.cpp
+++ b/engines/sky/text.cpp
@@ -24,7 +24,9 @@
*/
+#include "common/debug.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "sky/disk.h"
#include "sky/logic.h"
diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp
index 60176be1a9..7c17befcff 100644
--- a/engines/sword1/animation.cpp
+++ b/engines/sword1/animation.cpp
@@ -24,15 +24,16 @@
*/
#include "common/file.h"
+#include "common/events.h"
+#include "common/keyboard.h"
+#include "common/textconsole.h"
#include "sword1/sword1.h"
#include "sword1/animation.h"
#include "sword1/text.h"
-#include "audio/decoders/vorbis.h"
-#include "common/config-manager.h"
-#include "common/endian.h"
#include "common/str.h"
#include "common/system.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "gui/message.h"
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index d4f6bfd1fe..d8ddd53e2e 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -29,7 +29,9 @@
#include "common/events.h"
#include "common/system.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
+#include "graphics/palette.h"
#include "graphics/thumbnail.h"
#include "gui/message.h"
diff --git a/engines/sword1/control.h b/engines/sword1/control.h
index 2e5bfc7197..db910f521f 100644
--- a/engines/sword1/control.h
+++ b/engines/sword1/control.h
@@ -33,7 +33,7 @@
class OSystem;
namespace Common {
- class SaveFileManager;
+class SaveFileManager;
}
namespace Sword1 {
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 855c7d1f83..fa8277033c 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -27,8 +27,6 @@
#include "sword1/control.h"
#include "base/plugins.h"
-#include "common/config-manager.h"
-#include "common/file.h"
#include "common/fs.h"
#include "common/savefile.h"
#include "common/system.h"
diff --git a/engines/sword1/eventman.cpp b/engines/sword1/eventman.cpp
index 55a438f506..9200e6a229 100644
--- a/engines/sword1/eventman.cpp
+++ b/engines/sword1/eventman.cpp
@@ -26,6 +26,7 @@
#include "sword1/eventman.h"
#include "sword1/sworddefs.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Sword1 {
diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp
index ef54167d41..3da3c457d0 100644
--- a/engines/sword1/logic.cpp
+++ b/engines/sword1/logic.cpp
@@ -25,9 +25,8 @@
#include "common/endian.h"
#include "common/util.h"
-#include "common/system.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
+#include "common/textconsole.h"
#include "sword1/logic.h"
#include "sword1/text.h"
diff --git a/engines/sword1/memman.cpp b/engines/sword1/memman.cpp
index b08631dfc8..f315895eb0 100644
--- a/engines/sword1/memman.cpp
+++ b/engines/sword1/memman.cpp
@@ -25,6 +25,7 @@
#include "sword1/memman.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Sword1 {
diff --git a/engines/sword1/mouse.h b/engines/sword1/mouse.h
index 1b4ca12183..3a7ea747fb 100644
--- a/engines/sword1/mouse.h
+++ b/engines/sword1/mouse.h
@@ -27,6 +27,7 @@
#define SWORD1_MOUSE_H
#include "common/scummsys.h"
+#include "common/rect.h"
#include "sword1/sworddefs.h"
#include "sword1/object.h"
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp
index 2b81ae1eb4..49f9f7271b 100644
--- a/engines/sword1/music.cpp
+++ b/engines/sword1/music.cpp
@@ -24,10 +24,9 @@
*/
-#include "common/endian.h"
#include "common/file.h"
#include "common/util.h"
-#include "common/system.h"
+#include "common/textconsole.h"
#include "sword1/sword1.h"
#include "sword1/music.h"
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index 9ac2c7a255..dde1498591 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -24,6 +24,7 @@
*/
+#include "common/textconsole.h"
#include "common/util.h"
#include "sword1/objectman.h"
diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 2bad8a79a7..f7b9eb8908 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -24,19 +24,14 @@
*/
-#include "common/config-manager.h"
-#include "common/util.h"
-#include "common/str.h"
-
-#include "engines/engine.h"
+#include "common/debug.h"
+#include "common/textconsole.h"
#include "sword1/memman.h"
#include "sword1/resman.h"
-#include "sword1/sworddefs.h"
#include "sword1/swordres.h"
#include "gui/message.h"
-#include "gui/gui-manager.h"
namespace Sword1 {
void guiFatalError(char *msg) {
diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp
index 9ff5ae0c8e..3694ed2459 100644
--- a/engines/sword1/router.cpp
+++ b/engines/sword1/router.cpp
@@ -24,6 +24,7 @@
*/
#include "common/debug.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "sword1/router.h"
diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp
index 1906fcb7fd..de96f6e7b4 100644
--- a/engines/sword1/screen.cpp
+++ b/engines/sword1/screen.cpp
@@ -25,8 +25,11 @@
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/util.h"
+#include "graphics/palette.h"
+
#include "sword1/screen.h"
#include "sword1/logic.h"
#include "sword1/sworddefs.h"
diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp
index f8219eb21a..c970e72748 100644
--- a/engines/sword1/sound.cpp
+++ b/engines/sword1/sound.cpp
@@ -27,10 +27,9 @@
#include "common/endian.h"
#include "common/util.h"
-#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/memstream.h"
-#include "common/system.h"
+#include "common/textconsole.h"
#include "sword1/sound.h"
#include "sword1/resman.h"
diff --git a/engines/sword1/sound.h b/engines/sword1/sound.h
index ae96132241..b6fcd6706f 100644
--- a/engines/sword1/sound.h
+++ b/engines/sword1/sound.h
@@ -34,7 +34,7 @@
#include "audio/mixer.h"
namespace Audio {
- class Mixer;
+class Mixer;
}
namespace Sword1 {
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 8768e62457..3b3eaaf8b9 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -37,6 +37,7 @@
#include "sword1/control.h"
#include "common/config-manager.h"
+#include "common/textconsole.h"
#include "engines/util.h"
diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h
index 255299d33e..dbb683cd74 100644
--- a/engines/sword1/sword1.h
+++ b/engines/sword1/sword1.h
@@ -27,7 +27,9 @@
#define SWORD1_H
#include "engines/engine.h"
-#include "common/events.h"
+#include "common/error.h"
+#include "common/keyboard.h"
+#include "common/rect.h"
#include "common/util.h"
#include "sword1/sworddefs.h"
#include "sword1/console.h"
diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp
index ef3e07fe74..7c65533067 100644
--- a/engines/sword1/text.cpp
+++ b/engines/sword1/text.cpp
@@ -24,8 +24,7 @@
*/
-#include "common/endian.h"
-#include "common/util.h"
+#include "common/textconsole.h"
#include "sword1/text.h"
#include "sword1/resman.h"
diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp
index 8d1a9836f4..a5a2499b01 100644
--- a/engines/sword2/animation.cpp
+++ b/engines/sword2/animation.cpp
@@ -26,7 +26,9 @@
*/
#include "common/file.h"
+#include "common/mutex.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp
index b488092007..4332f2811c 100644
--- a/engines/sword2/controls.cpp
+++ b/engines/sword2/controls.cpp
@@ -26,9 +26,7 @@
*/
-#include "common/events.h"
#include "common/rect.h"
-#include "common/config-manager.h"
#include "common/system.h"
#include "sword2/sword2.h"
diff --git a/engines/sword2/events.cpp b/engines/sword2/events.cpp
index f0e0e567a4..24101e271c 100644
--- a/engines/sword2/events.cpp
+++ b/engines/sword2/events.cpp
@@ -26,6 +26,7 @@
*/
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp
index a968a5600d..e0990ea120 100644
--- a/engines/sword2/function.cpp
+++ b/engines/sword2/function.cpp
@@ -28,6 +28,7 @@
#include "common/system.h"
#include "common/file.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/interpreter.cpp b/engines/sword2/interpreter.cpp
index e039ae3888..a3804366d4 100644
--- a/engines/sword2/interpreter.cpp
+++ b/engines/sword2/interpreter.cpp
@@ -28,6 +28,7 @@
#include "common/util.h"
#include "common/stack.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/header.h"
diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp
index c5091a248f..47cc3ec232 100644
--- a/engines/sword2/layers.cpp
+++ b/engines/sword2/layers.cpp
@@ -35,6 +35,7 @@
#include "common/rect.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/logic.cpp b/engines/sword2/logic.cpp
index 511561c55a..c27bd76ff4 100644
--- a/engines/sword2/logic.cpp
+++ b/engines/sword2/logic.cpp
@@ -26,6 +26,7 @@
*/
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp
index 648d1d761b..fda30981c8 100644
--- a/engines/sword2/maketext.cpp
+++ b/engines/sword2/maketext.cpp
@@ -45,6 +45,7 @@
#include "common/system.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/memory.cpp b/engines/sword2/memory.cpp
index cd36f9a19b..2b3784164e 100644
--- a/engines/sword2/memory.cpp
+++ b/engines/sword2/memory.cpp
@@ -48,6 +48,7 @@
//
// The number zero is used to represent the NULL pointer.
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/memory.h"
diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp
index b6e9b169c3..3a26ab17b7 100644
--- a/engines/sword2/mouse.cpp
+++ b/engines/sword2/mouse.cpp
@@ -29,6 +29,7 @@
#include "common/system.h"
#include "common/events.h"
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "graphics/cursorman.h"
diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp
index aa91843432..233d9369d2 100644
--- a/engines/sword2/music.cpp
+++ b/engines/sword2/music.cpp
@@ -36,6 +36,7 @@
#include "common/memstream.h"
#include "common/substream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/decoders/mp3.h"
#include "audio/decoders/vorbis.h"
diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp
index f43efcaa7f..a52160db25 100644
--- a/engines/sword2/palette.cpp
+++ b/engines/sword2/palette.cpp
@@ -27,6 +27,9 @@
#include "common/system.h"
+#include "common/textconsole.h"
+
+#include "graphics/palette.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp
index fa9c396ef3..36280cfda2 100644
--- a/engines/sword2/resman.cpp
+++ b/engines/sword2/resman.cpp
@@ -28,6 +28,7 @@
#include "common/file.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/resman.h b/engines/sword2/resman.h
index dcc79927ea..75748e1568 100644
--- a/engines/sword2/resman.h
+++ b/engines/sword2/resman.h
@@ -29,7 +29,7 @@
#define SWORD2_RESMAN_H
namespace Common {
- class File;
+class File;
}
#define MAX_MEM_CACHE (8 * 1024 * 1024) // we keep up to 8 megs of resource data files in memory
diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp
index 8f355151f4..c2b4d2e67f 100644
--- a/engines/sword2/router.cpp
+++ b/engines/sword2/router.cpp
@@ -27,6 +27,7 @@
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/saveload.cpp b/engines/sword2/saveload.cpp
index fab360a8ac..94ef8975b4 100644
--- a/engines/sword2/saveload.cpp
+++ b/engines/sword2/saveload.cpp
@@ -37,6 +37,7 @@
#include "common/memstream.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp
index 74a23c8b2c..a83e581fd4 100644
--- a/engines/sword2/screen.cpp
+++ b/engines/sword2/screen.cpp
@@ -32,6 +32,7 @@
#include "common/system.h"
#include "common/events.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp
index 261c8293bd..3cf8523113 100644
--- a/engines/sword2/sound.cpp
+++ b/engines/sword2/sound.cpp
@@ -39,6 +39,7 @@
#include "common/file.h"
#include "common/memstream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/sound.h b/engines/sword2/sound.h
index 2c4c8364c7..c37e006b76 100644
--- a/engines/sword2/sound.h
+++ b/engines/sword2/sound.h
@@ -39,6 +39,7 @@
#define SWORD2_SOUND_H
#include "common/file.h"
+#include "common/mutex.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
diff --git a/engines/sword2/speech.cpp b/engines/sword2/speech.cpp
index b67f079a83..ec8e198377 100644
--- a/engines/sword2/speech.cpp
+++ b/engines/sword2/speech.cpp
@@ -27,6 +27,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/startup.cpp b/engines/sword2/startup.cpp
index e4572d3c1a..ea1751eb5f 100644
--- a/engines/sword2/startup.cpp
+++ b/engines/sword2/startup.cpp
@@ -27,6 +27,7 @@
#include "common/file.h"
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 7ad021b3a5..58f3547ff7 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -34,6 +34,7 @@
#include "common/EventRecorder.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "engines/metaengine.h"
#include "engines/util.h"
diff --git a/engines/sword2/sync.cpp b/engines/sword2/sync.cpp
index 1adc652b75..ee4c6b2238 100644
--- a/engines/sword2/sync.cpp
+++ b/engines/sword2/sync.cpp
@@ -26,6 +26,7 @@
*/
+#include "common/textconsole.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp
index 3900df2fcf..fe24675f8a 100644
--- a/engines/sword25/detection.cpp
+++ b/engines/sword25/detection.cpp
@@ -24,8 +24,6 @@
*/
#include "base/plugins.h"
-#include "common/savefile.h"
-#include "common/system.h"
#include "engines/advancedDetector.h"
#include "sword25/sword25.h"
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp
index 177bd38303..975f08be22 100644
--- a/engines/sword25/fmv/movieplayer.cpp
+++ b/engines/sword25/fmv/movieplayer.cpp
@@ -32,13 +32,17 @@
*
*/
+#include "common/debug.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/util.h"
+
#include "sword25/sword25.h" // for kDebugScript
#include "sword25/fmv/movieplayer.h"
#include "sword25/gfx/graphicengine.h"
#include "sword25/gfx/panel.h"
#include "sword25/kernel/kernel.h"
#include "sword25/package/packagemanager.h"
-#include "sword25/sfx/soundengine.h"
namespace Sword25 {
@@ -121,7 +125,7 @@ void MoviePlayer::update() {
const Graphics::Surface *s = _decoder.decodeNextFrame();
if (s) {
// Transfer the next frame
- assert(s->bytesPerPixel == 4);
+ assert(s->format.bytesPerPixel == 4);
#ifdef THEORA_INDIRECT_RENDERING
byte *frameData = (byte *)s->getBasePtr(0, 0);
diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp
index e9901c04b0..86236fbd21 100644
--- a/engines/sword25/fmv/theora_decoder.cpp
+++ b/engines/sword25/fmv/theora_decoder.cpp
@@ -41,6 +41,7 @@
#ifdef USE_THEORADEC
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/conversion.h"
#include "audio/decoders/raw.h"
#include "sword25/kernel/common.h"
@@ -289,7 +290,7 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) {
_surface = new Graphics::Surface();
- _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, 4);
+ _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat());
return true;
}
diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h
index a753bc58ac..4ed2af5f98 100644
--- a/engines/sword25/fmv/theora_decoder.h
+++ b/engines/sword25/fmv/theora_decoder.h
@@ -30,9 +30,12 @@
#ifdef USE_THEORADEC
+#include "common/rational.h"
#include "video/video_decoder.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
#include <theora/theoradec.h>
#include <vorbis/codec.h>
diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp
index 502d2d3b2a..8bdf2a4a6e 100644
--- a/engines/sword25/gfx/graphicengine.cpp
+++ b/engines/sword25/gfx/graphicengine.cpp
@@ -112,8 +112,10 @@ bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCoun
_screenRect.right = _width;
_screenRect.bottom = _height;
- _backSurface.create(width, height, 4);
- _frameBuffer.create(width, height, 4);
+ const Graphics::PixelFormat format = g_system->getScreenFormat();
+
+ _backSurface.create(width, height, format);
+ _frameBuffer.create(width, height, format);
// Standardmäßig ist Vsync an.
setVsync(true);
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index b740c0ec68..806d9b27ad 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -187,7 +187,8 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe
// Create an encapsulating surface for the data
Graphics::Surface srcImage;
- srcImage.bytesPerPixel = 4;
+ // TODO: Is the data really in the screen format?
+ srcImage.format = g_system->getScreenFormat();
srcImage.pitch = _width * 4;
srcImage.w = _width;
srcImage.h = _height;
@@ -409,7 +410,7 @@ void RenderedImage::copyDirectly(int posX, int posY) {
*/
Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int xSize, int ySize) {
Graphics::Surface *s = new Graphics::Surface();
- s->create(xSize, ySize, srcImage.bytesPerPixel);
+ s->create(xSize, ySize, srcImage.format);
int *horizUsage = scaleLine(xSize, srcImage.w);
int *vertUsage = scaleLine(ySize, srcImage.h);
@@ -420,8 +421,8 @@ Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int x
byte *destP = (byte *)s->getBasePtr(0, yp);
for (int xp = 0; xp < xSize; ++xp) {
- const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.bytesPerPixel);
- for (int byteCtr = 0; byteCtr < srcImage.bytesPerPixel; ++byteCtr) {
+ const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.format.bytesPerPixel);
+ for (int byteCtr = 0; byteCtr < srcImage.format.bytesPerPixel; ++byteCtr) {
*destP++ = *tempSrcP++;
}
}
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index 35e94976eb..6ea2b574d6 100644
--- a/engines/sword25/gfx/screenshot.cpp
+++ b/engines/sword25/gfx/screenshot.cpp
@@ -36,6 +36,7 @@
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/memstream.h"
+#include "common/textconsole.h"
#include "sword25/gfx/screenshot.h"
#include "sword25/kernel/filesystemutil.h"
#include <png.h>
@@ -127,14 +128,14 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
// generates a pixel of the target image. Finally, the result as a PNG file is stored as a file.
// The source image must be 800x600.
- if (data->w != 800 || data->h != 600 || data->bytesPerPixel != 4) {
+ if (data->w != 800 || data->h != 600 || data->format.bytesPerPixel != 4) {
error("The sreenshot dimensions have to be 800x600 in order to be saved as a thumbnail.");
return false;
}
// Buffer for the output thumbnail
Graphics::Surface thumbnail;
- thumbnail.create(200, 125, 4);
+ thumbnail.create(200, 125, g_system->getScreenFormat());
// Über das Zielbild iterieren und einen Pixel zur Zeit berechnen.
uint x, y;
diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp
index b4d4b25f8d..e5ec6c15db 100644
--- a/engines/sword25/kernel/filesystemutil.cpp
+++ b/engines/sword25/kernel/filesystemutil.cpp
@@ -34,8 +34,7 @@
#include "common/config-manager.h"
#include "common/fs.h"
-#include "common/savefile.h"
-#include "common/system.h"
+#include "common/textconsole.h"
#include "sword25/kernel/filesystemutil.h"
#include "sword25/kernel/persistenceservice.h"
diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp
index f3aebef203..26c924dc82 100644
--- a/engines/sword25/kernel/inputpersistenceblock.cpp
+++ b/engines/sword25/kernel/inputpersistenceblock.cpp
@@ -32,6 +32,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "sword25/kernel/inputpersistenceblock.h"
namespace Sword25 {
diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h
index 9e7ee0fdd9..3abf43d239 100644
--- a/engines/sword25/kernel/kernel.h
+++ b/engines/sword25/kernel/kernel.h
@@ -48,6 +48,7 @@
#include "common/scummsys.h"
#include "common/random.h"
#include "common/stack.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "engines/engine.h"
diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h
index 8d0f4a314b..69d961ae91 100644
--- a/engines/sword25/kernel/objectregistry.h
+++ b/engines/sword25/kernel/objectregistry.h
@@ -37,6 +37,7 @@
#include "common/func.h"
#include "common/hashmap.h"
+#include "common/textconsole.h"
#include "sword25/kernel/common.h"
namespace Sword25 {
diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp
index be66b6abf0..506eef3c57 100644
--- a/engines/sword25/kernel/persistenceservice.cpp
+++ b/engines/sword25/kernel/persistenceservice.cpp
@@ -32,6 +32,9 @@
*
*/
+// Disable symbol overrides so that we can use zlib.h
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
#include "common/fs.h"
#include "common/savefile.h"
#include "sword25/kernel/kernel.h"
diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp
index 137e37bf8d..809676796e 100644
--- a/engines/sword25/script/luacallback.cpp
+++ b/engines/sword25/script/luacallback.cpp
@@ -32,6 +32,8 @@
*
*/
+#include "common/textconsole.h"
+
#include "sword25/script/luacallback.h"
#include "sword25/script/luabindhelper.h"
diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp
index 03cdaf82b7..08f0f5b4ae 100644
--- a/engines/sword25/sfx/soundengine.cpp
+++ b/engines/sword25/sfx/soundengine.cpp
@@ -39,6 +39,8 @@
#include "audio/decoders/vorbis.h"
+#include "common/system.h"
+
namespace Sword25 {
class SoundResource : public Resource {
diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp
index 8740e44e9c..38c1c89109 100644
--- a/engines/sword25/sword25.cpp
+++ b/engines/sword25/sword25.cpp
@@ -34,10 +34,18 @@
#include "common/config-manager.h"
#include "common/debug-channels.h"
+#include "common/algorithm.h"
+#include "common/array.h"
+#include "common/error.h"
+#include "common/fs.h"
+#include "common/singleton.h"
+#include "common/str-array.h"
+#include "common/str.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "engines/util.h"
#include "sword25/sword25.h"
-#include "sword25/kernel/filesystemutil.h"
#include "sword25/kernel/kernel.h"
#include "sword25/kernel/persistenceservice.h"
#include "sword25/package/packagemanager.h"
diff --git a/engines/sword25/sword25.h b/engines/sword25/sword25.h
index 9e9679526b..5bd27b311f 100644
--- a/engines/sword25/sword25.h
+++ b/engines/sword25/sword25.h
@@ -27,12 +27,18 @@
#define SWORD25_H
#include "common/scummsys.h"
-#include "common/str-array.h"
-#include "common/util.h"
#include "engines/engine.h"
#include "sword25/console.h"
+namespace Common {
+class Error;
+}
+
+namespace GUI {
+class Debugger;
+}
+
struct ADGameDescription;
/**
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp
index 1620aa700c..9dd30f43c3 100644
--- a/engines/teenagent/actor.cpp
+++ b/engines/teenagent/actor.cpp
@@ -27,6 +27,7 @@
#include "teenagent/resources.h"
#include "common/random.h"
+#include "common/textconsole.h"
namespace TeenAgent {
diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp
index 56812001e8..623966f265 100644
--- a/engines/teenagent/animation.cpp
+++ b/engines/teenagent/animation.cpp
@@ -24,6 +24,7 @@
#include "teenagent/animation.h"
#include "common/endian.h"
+#include "common/textconsole.h"
namespace TeenAgent {
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index d0662a73d6..f4be917eac 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -27,6 +27,8 @@
#include "teenagent/resources.h"
#include "teenagent/dialog.h"
+#include "common/textconsole.h"
+
namespace TeenAgent {
#define CHECK_FLAG(addr, v) (res->dseg.get_byte(addr) == (v))
diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp
index 7d252f59e8..2d98ae9de7 100644
--- a/engines/teenagent/font.cpp
+++ b/engines/teenagent/font.cpp
@@ -24,8 +24,12 @@
#include "teenagent/font.h"
#include "teenagent/pack.h"
+#include "common/debug.h"
+#include "common/endian.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/ptr.h"
+#include "graphics/surface.h"
namespace TeenAgent {
diff --git a/engines/teenagent/font.h b/engines/teenagent/font.h
index e08a3513af..29a8121435 100644
--- a/engines/teenagent/font.h
+++ b/engines/teenagent/font.h
@@ -25,6 +25,7 @@
#ifndef TEENAGENT_FONT_H
#define TEENAGENT_FONT_H
+#include "common/str.h"
#include "graphics/surface.h"
namespace TeenAgent {
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index bc4ac24da4..4d18d68502 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -24,6 +24,7 @@
#include "common/memstream.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
#include "teenagent/inventory.h"
#include "teenagent/resources.h"
diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp
index 395b2546b9..f0be5165f6 100644
--- a/engines/teenagent/music.cpp
+++ b/engines/teenagent/music.cpp
@@ -25,7 +25,9 @@
#include "teenagent/music.h"
#include "teenagent/resources.h"
+#include "common/debug.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
namespace TeenAgent {
diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp
index 9fe889fa41..69908239ab 100644
--- a/engines/teenagent/resources.cpp
+++ b/engines/teenagent/resources.cpp
@@ -24,6 +24,7 @@
#include "teenagent/resources.h"
#include "teenagent/teenagent.h"
+#include "common/textconsole.h"
#include "common/zlib.h"
namespace TeenAgent {
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index f9756b5b91..ee431b2ab5 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -26,6 +26,9 @@
#include "common/debug.h"
#include "common/algorithm.h"
#include "common/ptr.h"
+#include "common/textconsole.h"
+
+#include "graphics/palette.h"
#include "teenagent/scene.h"
#include "teenagent/resources.h"
@@ -379,7 +382,7 @@ void Scene::init(int id, const Common::Point &pos) {
custom_animation[i].free();
if (background.pixels == NULL)
- background.create(320, 200, 1);
+ background.create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
warp(pos);
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 2dc5bc9c83..28def3a064 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -35,6 +35,10 @@
#include "common/array.h"
#include "common/list.h"
+namespace Common {
+struct Event;
+}
+
namespace TeenAgent {
class TeenAgentEngine;
diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp
index 7ba680907b..829c84765d 100644
--- a/engines/teenagent/segment.cpp
+++ b/engines/teenagent/segment.cpp
@@ -23,6 +23,7 @@
*/
#include "teenagent/segment.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace TeenAgent {
diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp
index 96672ca1b3..545b0f75f0 100644
--- a/engines/teenagent/surface.cpp
+++ b/engines/teenagent/surface.cpp
@@ -61,7 +61,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) {
}
//debug(0, "creating surface %ux%u -> %u,%u", w_, h_, x, y);
- create(w_, h_, 1);
+ create(w_, h_, Graphics::PixelFormat::createFormatCLUT8());
stream->read(pixels, w_ * h_);
}
diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h
index b44fd3c21a..82c13c84bd 100644
--- a/engines/teenagent/surface.h
+++ b/engines/teenagent/surface.h
@@ -25,8 +25,12 @@
#ifndef TEENAGENT_SURFACE_H
#define TEENAGENT_SURFACE_H
+#include "common/rect.h"
#include "graphics/surface.h"
-#include "common/stream.h"
+
+namespace Common {
+ class SeekableReadStream;
+}
namespace TeenAgent {
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index e66de70079..ec1e945f8d 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -27,6 +27,7 @@
#include "common/events.h"
#include "common/savefile.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "backends/audiocd/audiocd.h"
@@ -37,6 +38,7 @@
#include "audio/decoders/raw.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
#include "graphics/thumbnail.h"
#include "teenagent/console.h"
diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp
index 734ed0c22a..b08cca291a 100644
--- a/engines/testbed/detection.cpp
+++ b/engines/testbed/detection.cpp
@@ -23,10 +23,8 @@
*
*/
-#include "common/config-manager.h"
#include "engines/advancedDetector.h"
#include "common/system.h"
-#include "common/fs.h"
#include "base/plugins.h"
diff --git a/engines/testbed/events.cpp b/engines/testbed/events.cpp
index b0a930172d..37b0a7ead4 100644
--- a/engines/testbed/events.cpp
+++ b/engines/testbed/events.cpp
@@ -24,10 +24,17 @@
#include "common/events.h"
#include "common/keyboard.h"
+#include "common/rect.h"
+#include "common/str.h"
+#include "common/system.h"
+#include "common/util.h"
#include "engines/engine.h"
#include "graphics/cursorman.h"
+#include "graphics/font.h"
+#include "graphics/fontman.h"
+#include "graphics/surface.h"
#include "testbed/events.h"
#include "testbed/graphics.h"
diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp
index c0ce3fea32..c8558e30f4 100644
--- a/engines/testbed/graphics.cpp
+++ b/engines/testbed/graphics.cpp
@@ -33,6 +33,7 @@
#include "graphics/cursorman.h"
#include "graphics/fontman.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "graphics/VectorRendererSpec.h"
diff --git a/engines/testbed/sound.cpp b/engines/testbed/sound.cpp
index 76f9e850c0..dca116368e 100644
--- a/engines/testbed/sound.cpp
+++ b/engines/testbed/sound.cpp
@@ -26,6 +26,8 @@
#include "backends/audiocd/audiocd.h"
+#include "common/config-manager.h"
+
#include "testbed/sound.h"
namespace Testbed {
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index 1ceecb8ebf..179be2bb8b 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -24,7 +24,12 @@
#include "common/debug-channels.h"
#include "common/scummsys.h"
-#include "common/system.h"
+#include "common/archive.h"
+#include "common/config-manager.h"
+#include "common/error.h"
+#include "common/fs.h"
+#include "common/rect.h"
+#include "common/str.h"
#include "engines/util.h"
diff --git a/engines/testbed/testbed.h b/engines/testbed/testbed.h
index e0feb52ff5..ca803a4cec 100644
--- a/engines/testbed/testbed.h
+++ b/engines/testbed/testbed.h
@@ -25,9 +25,9 @@
#ifndef TESTBED_H
#define TESTBED_H
-#include "engines/engine.h"
+#include "common/array.h"
-#include "gui/options.h"
+#include "engines/engine.h"
#include "testbed/config.h"
#include "testbed/testsuite.h"
diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h
index a738f40764..94b3d70fd4 100644
--- a/engines/testbed/testsuite.h
+++ b/engines/testbed/testsuite.h
@@ -25,9 +25,12 @@
#ifndef TESTBED_TESTSUITE_H
#define TESTBED_TESTSUITE_H
+#include "common/array.h"
+#include "common/rect.h"
+#include "common/scummsys.h"
#include "common/system.h"
#include "common/str.h"
-#include "common/array.h"
+#include "graphics/font.h"
#include "graphics/fontman.h"
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index 1d25723a35..9ec253e512 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -44,6 +44,7 @@
#include "tinsel/tinsel.h"
#include "tinsel/token.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/adpcm.cpp b/engines/tinsel/adpcm.cpp
index ec51d150dc..530395d754 100644
--- a/engines/tinsel/adpcm.cpp
+++ b/engines/tinsel/adpcm.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "common/stream.h"
+#include "common/util.h"
+
#include "tinsel/adpcm.h"
namespace Tinsel {
@@ -44,14 +47,14 @@ void Tinsel_ADPCMStream::readBufferTinselHeader() {
// Negate
start = ~(start | 0xC0) + 1;
- _status.predictor = 1 << start;
+ _status.predictor = (unsigned long long int)1 << start;
} else {
// Lower 6 bit are positive
// Truncate
start &= 0x1F;
- _status.predictor = ((double) 1.0) / (1 << start);
+ _status.predictor = ((double) 1.0) / ((unsigned long long int)1 << start);
}
_status.K0 = TinselFilterTable[filterVal][0];
diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp
index 37d8de925e..61c8b67624 100644
--- a/engines/tinsel/anim.cpp
+++ b/engines/tinsel/anim.cpp
@@ -31,6 +31,7 @@
#include "tinsel/sched.h"
#include "tinsel/tinsel.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp
index 747fdfe93c..0e67c3a06e 100644
--- a/engines/tinsel/bg.cpp
+++ b/engines/tinsel/bg.cpp
@@ -40,6 +40,7 @@
#include "tinsel/tinlib.h" // For Control()
#include "tinsel/tinsel.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index e3fbad678c..793febdc21 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -44,6 +44,8 @@
#include "audio/decoders/raw.h"
+#include "common/textconsole.h"
+
namespace Tinsel {
//----------------- LOCAL DEFINES ----------------------------
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index ee9c9aed39..281dd2da55 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -62,6 +62,8 @@
#include "tinsel/tinsel.h" // For engine access
#include "tinsel/token.h"
+#include "common/textconsole.h"
+
namespace Tinsel {
//----------------- EXTERNAL GLOBAL DATA --------------------
diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index a256ed73e8..f81a59a0b7 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -32,7 +32,7 @@
#include "tinsel/events.h" // for PLR_EVENT, PLR_EVENT
namespace Common {
- class Serializer;
+class Serializer;
}
namespace Tinsel {
diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp
index ab606f3159..d252e45cf5 100644
--- a/engines/tinsel/drives.cpp
+++ b/engines/tinsel/drives.cpp
@@ -24,9 +24,7 @@
* CD/drive handling functions
*/
-#include "common/config-manager.h"
-#include "common/substream.h"
-#include "gui/message.h"
+#include "common/textconsole.h"
#include "tinsel/drives.h"
#include "tinsel/scene.h"
#include "tinsel/tinsel.h"
diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp
index 0b550f50f3..bdcd3207f9 100644
--- a/engines/tinsel/graphics.cpp
+++ b/engines/tinsel/graphics.cpp
@@ -32,6 +32,8 @@
#include "tinsel/tinsel.h"
#include "tinsel/scn.h"
+#include "common/textconsole.h"
+
namespace Tinsel {
//----------------- LOCAL DEFINES --------------------
diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index f2db42bede..6f5f92c969 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -27,6 +27,7 @@
#define BODGE
#include "common/file.h"
+#include "common/textconsole.h"
#include "tinsel/drives.h"
#include "tinsel/dw.h"
diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp
index cf28749e76..5d9672972a 100644
--- a/engines/tinsel/mareels.cpp
+++ b/engines/tinsel/mareels.cpp
@@ -28,6 +28,7 @@
#include "tinsel/pcode.h" // For D_UP, D_DOWN
#include "tinsel/rince.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp
index 1aac68c7f0..ad02a614a5 100644
--- a/engines/tinsel/object.cpp
+++ b/engines/tinsel/object.cpp
@@ -32,6 +32,8 @@
#include "tinsel/text.h"
#include "tinsel/tinsel.h"
+#include "common/textconsole.h"
+
#define OID_EFFECTS 0x2000 // generic special effects object id
namespace Tinsel {
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index 2d2ebd6f60..0877337603 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -32,6 +32,8 @@
#include "tinsel/tinsel.h"
#include "common/system.h"
+#include "common/textconsole.h"
+#include "graphics/palette.h"
namespace Tinsel {
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index ccd86d7ed7..a1cc02a832 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -36,6 +36,7 @@
#include "tinsel/tinlib.h" // Library routines
#include "tinsel/tinsel.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h
index f3690e9257..f31f2eb5c6 100644
--- a/engines/tinsel/pcode.h
+++ b/engines/tinsel/pcode.h
@@ -31,7 +31,7 @@
#include "tinsel/sched.h" // for PROCESS
namespace Common {
- class Serializer;
+class Serializer;
}
namespace Tinsel {
diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp
index 33eee8bc98..5022f4757a 100644
--- a/engines/tinsel/pdisplay.cpp
+++ b/engines/tinsel/pdisplay.cpp
@@ -44,6 +44,8 @@
#include "tinsel/text.h"
#include "tinsel/tinsel.h"
+#include "common/textconsole.h"
+
namespace Tinsel {
//----------------- EXTERNAL GLOBAL DATA --------------------
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index 0811dae079..f49dddeef4 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -34,6 +34,7 @@
#include "tinsel/tinsel.h"
#include "tinsel/token.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp
index c0878b6849..38ac0a2ce6 100644
--- a/engines/tinsel/rince.cpp
+++ b/engines/tinsel/rince.cpp
@@ -47,6 +47,7 @@
#include "tinsel/tinsel.h"
#include "tinsel/token.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 7a6b5877e8..b6935d41ab 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -36,6 +36,7 @@
#include "common/serializer.h"
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "gui/message.h"
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index ef0f5cdc25..aa359d281f 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -48,6 +48,8 @@
#include "tinsel/tinlib.h"
#include "tinsel/token.h"
+#include "common/textconsole.h"
+
namespace Tinsel {
//----------------- EXTERN FUNCTIONS --------------------
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp
index 80f4c585a7..b82bac32cc 100644
--- a/engines/tinsel/scene.cpp
+++ b/engines/tinsel/scene.cpp
@@ -51,6 +51,7 @@
#include "tinsel/sysvar.h"
#include "tinsel/token.h"
+#include "common/textconsole.h"
namespace Tinsel {
diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp
index 427e28826f..37c04abd22 100644
--- a/engines/tinsel/sched.cpp
+++ b/engines/tinsel/sched.cpp
@@ -30,6 +30,7 @@
#include "tinsel/polygons.h"
#include "tinsel/sched.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Tinsel {
diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp
index 17ae7c8687..20d75b6b93 100644
--- a/engines/tinsel/scn.cpp
+++ b/engines/tinsel/scn.cpp
@@ -24,9 +24,6 @@
* A (some would say very) small collection of utility functions.
*/
-#include "common/endian.h"
-#include "common/util.h"
-
#include "tinsel/dw.h"
#include "tinsel/film.h"
#include "tinsel/handle.h"
diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp
index 304223ed61..ec42ca5da4 100644
--- a/engines/tinsel/sound.cpp
+++ b/engines/tinsel/sound.cpp
@@ -35,9 +35,7 @@
#include "tinsel/sysvar.h"
#include "tinsel/background.h"
-#include "common/config-manager.h"
#include "common/endian.h"
-#include "common/file.h"
#include "common/memstream.h"
#include "common/system.h"
diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp
index aa303a5391..2dc0e833d1 100644
--- a/engines/tinsel/strres.cpp
+++ b/engines/tinsel/strres.cpp
@@ -31,6 +31,7 @@
#include "tinsel/scn.h"
#include "common/file.h"
#include "common/endian.h"
+#include "common/textconsole.h"
#include "gui/message.h"
diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp
index ed4c99a560..ad795fd219 100644
--- a/engines/tinsel/sysvar.cpp
+++ b/engines/tinsel/sysvar.cpp
@@ -31,6 +31,8 @@
#include "tinsel/sysvar.h"
#include "tinsel/tinsel.h"
+#include "common/textconsole.h"
+
namespace Tinsel {
// Return for SYS_Platform
diff --git a/engines/tinsel/timers.cpp b/engines/tinsel/timers.cpp
index 5f15cd9d3b..c1a4cd0ff5 100644
--- a/engines/tinsel/timers.cpp
+++ b/engines/tinsel/timers.cpp
@@ -31,7 +31,7 @@
#include "tinsel/timers.h"
#include "tinsel/dw.h"
#include "common/serializer.h"
-
+#include "common/textconsole.h"
#include "common/system.h"
namespace Tinsel {
diff --git a/engines/tinsel/timers.h b/engines/tinsel/timers.h
index 022604b662..1456d9a1d5 100644
--- a/engines/tinsel/timers.h
+++ b/engines/tinsel/timers.h
@@ -31,7 +31,7 @@
#include "tinsel/dw.h"
namespace Common {
- class Serializer;
+class Serializer;
}
namespace Tinsel {
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 13b08a234c..afd409ce27 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -70,6 +70,7 @@
#include "tinsel/tinsel.h"
#include "tinsel/token.h"
+#include "common/textconsole.h"
namespace Tinsel {
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index d78175d00c..20d4f1d31a 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -29,22 +29,14 @@
#include "common/events.h"
#include "common/EventRecorder.h"
#include "common/keyboard.h"
-#include "common/file.h"
#include "common/fs.h"
-#include "common/savefile.h"
#include "common/config-manager.h"
#include "common/serializer.h"
-#include "common/stream.h"
#include "backends/audiocd/audiocd.h"
#include "engines/util.h"
-#include "graphics/cursorman.h"
-
-#include "base/plugins.h"
-#include "base/version.h"
-
#include "tinsel/actors.h"
#include "tinsel/background.h"
#include "tinsel/bmv.h"
@@ -911,10 +903,10 @@ Common::Error TinselEngine::run() {
#else
initGraphics(640, 432, true);
#endif
- _screenSurface.create(640, 432, 1);
+ _screenSurface.create(640, 432, Graphics::PixelFormat::createFormatCLUT8());
} else {
initGraphics(320, 200, false);
- _screenSurface.create(320, 200, 1);
+ _screenSurface.create(320, 200, Graphics::PixelFormat::createFormatCLUT8());
}
g_eventRec.registerRandomSource(_random, "tinsel");
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 6004aacead..856acbd986 100644
--- a/engines/toon/anim.cpp
+++ b/engines/toon/anim.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "common/debug.h"
+#include "common/rect.h"
+
#include "toon/anim.h"
#include "toon/toon.h"
#include "toon/tools.h"
diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp
index c2e0bf7b20..026450d3c9 100644
--- a/engines/toon/audio.cpp
+++ b/engines/toon/audio.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/audio.h"
#include "common/memstream.h"
#include "common/substream.h"
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp
index e63bc912c4..29a61ffd78 100644
--- a/engines/toon/character.cpp
+++ b/engines/toon/character.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "common/debug.h"
+#include "common/system.h"
+
#include "toon/character.h"
#include "toon/drew.h"
#include "toon/flux.h"
diff --git a/engines/toon/drew.cpp b/engines/toon/drew.cpp
index 4f8152833b..77333c4a9f 100644
--- a/engines/toon/drew.cpp
+++ b/engines/toon/drew.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/drew.h"
namespace Toon {
diff --git a/engines/toon/flux.cpp b/engines/toon/flux.cpp
index 034332af56..833fdbf5ce 100644
--- a/engines/toon/flux.cpp
+++ b/engines/toon/flux.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/flux.h"
namespace Toon {
diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp
index 0e2d58ca83..9367d79036 100644
--- a/engines/toon/font.cpp
+++ b/engines/toon/font.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/font.h"
namespace Toon {
diff --git a/engines/toon/hotspot.cpp b/engines/toon/hotspot.cpp
index 0573e92fef..1c1e23e39e 100644
--- a/engines/toon/hotspot.cpp
+++ b/engines/toon/hotspot.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/hotspot.h"
#include "toon/tools.h"
diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp
index 4305abb62b..64b80c29b3 100644
--- a/engines/toon/movie.cpp
+++ b/engines/toon/movie.cpp
@@ -23,7 +23,16 @@
*
*/
+#include "common/debug.h"
+#include "common/events.h"
+#include "common/keyboard.h"
+#include "common/stream.h"
+#include "common/system.h"
+#include "graphics/surface.h"
+
+#include "toon/audio.h"
#include "toon/movie.h"
+#include "toon/toon.h"
namespace Toon {
@@ -50,7 +59,7 @@ bool ToonstruckSmackerDecoder::loadFile(const Common::String &filename) {
delete _surface;
}
_surface = new Graphics::Surface();
- _surface->create(640, 400, 1);
+ _surface->create(640, 400, Graphics::PixelFormat::createFormatCLUT8());
_header.flags = 4;
}
diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp
index e0cdf87502..26355863f6 100644
--- a/engines/toon/path.cpp
+++ b/engines/toon/path.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/path.h"
namespace Toon {
@@ -407,7 +409,11 @@ void PathFinding::init(Picture *mask) {
_height = mask->getHeight();
_currentMask = mask;
_heap->unload();
- _heap->init(_width * _height);
+ // In order to reduce memory fragmentation on small devices, we use the maximum
+ // possible size here which is TOON_BACKBUFFER_WIDTH. Even though this is
+ // 1280 as opposed to the possible 640, it actually helps memory allocation on
+ // those devices.
+ _heap->init(TOON_BACKBUFFER_WIDTH * _height); // should really be _width
delete[] _gridTemp;
_gridTemp = new int32[_width*_height];
}
diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp
index 1945f0fe45..ce28f9c68b 100644
--- a/engines/toon/picture.cpp
+++ b/engines/toon/picture.cpp
@@ -25,6 +25,9 @@
#include "toon/picture.h"
#include "toon/tools.h"
+
+#include "common/debug.h"
+#include "common/rect.h"
#include "common/stack.h"
namespace Toon {
diff --git a/engines/toon/resource.cpp b/engines/toon/resource.cpp
index b29aa3b72d..f9f65b423b 100644
--- a/engines/toon/resource.cpp
+++ b/engines/toon/resource.cpp
@@ -24,6 +24,7 @@
*/
#include "toon/resource.h"
+#include "common/debug.h"
#include "common/file.h"
#include "common/memstream.h"
#include "common/substream.h"
diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp
index 0242ace7e3..8703666781 100644
--- a/engines/toon/script.cpp
+++ b/engines/toon/script.cpp
@@ -23,10 +23,9 @@
*
*/
+#include "common/debug.h"
#include "common/endian.h"
#include "common/stream.h"
-#include "common/util.h"
-#include "common/system.h"
#include "toon/toon.h"
#include "toon/script.h"
diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp
index b181591bf0..8f75097bd4 100644
--- a/engines/toon/script_func.cpp
+++ b/engines/toon/script_func.cpp
@@ -23,6 +23,9 @@
*
*/
+#include "common/debug.h"
+#include "common/system.h"
+
#include "toon/script_func.h"
#include "toon/script.h"
#include "toon/state.h"
diff --git a/engines/toon/state.cpp b/engines/toon/state.cpp
index 0d6977842d..af37ea9e68 100644
--- a/engines/toon/state.cpp
+++ b/engines/toon/state.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/state.h"
#include "toon/toon.h"
diff --git a/engines/toon/text.cpp b/engines/toon/text.cpp
index f0d17dd34e..94a3ea5aa7 100644
--- a/engines/toon/text.cpp
+++ b/engines/toon/text.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/text.h"
namespace Toon {
diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp
index da6e0f712e..ff72e69543 100644
--- a/engines/toon/tools.cpp
+++ b/engines/toon/tools.cpp
@@ -23,6 +23,8 @@
*
*/
+#include "common/debug.h"
+
#include "toon/tools.h"
#include "toon/toon.h"
diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp
index 5c8ca77b8b..81c4d313e4 100644
--- a/engines/toon/toon.cpp
+++ b/engines/toon/toon.cpp
@@ -33,6 +33,7 @@
#include "common/memstream.h"
#include "engines/util.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "graphics/thumbnail.h"
#include "gui/saveload.h"
@@ -57,7 +58,7 @@ void ToonEngine::init() {
_hotspots = new Hotspots(this);
_mainSurface = new Graphics::Surface();
- _mainSurface->create(TOON_BACKBUFFER_WIDTH, TOON_BACKBUFFER_HEIGHT, 1);
+ _mainSurface->create(TOON_BACKBUFFER_WIDTH, TOON_BACKBUFFER_HEIGHT, Graphics::PixelFormat::createFormatCLUT8());
_finalPalette = new uint8[768];
_backupPalette = new uint8[768];
diff --git a/engines/touche/midi.h b/engines/touche/midi.h
index f0f55e64e6..bde4950b93 100644
--- a/engines/touche/midi.h
+++ b/engines/touche/midi.h
@@ -34,7 +34,7 @@
class MidiParser;
namespace Common {
- class ReadStream;
+class ReadStream;
}
namespace Touche {
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp
index 3c108e2931..93406dcb8b 100644
--- a/engines/touche/resource.cpp
+++ b/engines/touche/resource.cpp
@@ -24,6 +24,7 @@
*/
+#include "common/textconsole.h"
#include "audio/decoders/flac.h"
#include "audio/mixer.h"
diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp
index 73817a5a1a..42b68d015c 100644
--- a/engines/touche/saveload.cpp
+++ b/engines/touche/saveload.cpp
@@ -24,6 +24,7 @@
*/
+#include "common/textconsole.h"
#include "common/savefile.h"
#include "touche/graphics.h"
diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp
index 6b47a7fc4d..15a2b1c53a 100644
--- a/engines/touche/touche.cpp
+++ b/engines/touche/touche.cpp
@@ -28,13 +28,18 @@
#include "common/debug-channels.h"
#include "common/events.h"
#include "common/EventRecorder.h"
-#include "common/file.h"
#include "common/fs.h"
#include "common/system.h"
+#include "common/archive.h"
+#include "common/debug.h"
+#include "common/error.h"
+#include "common/keyboard.h"
+#include "common/textconsole.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
-#include "audio/mididrv.h"
+#include "graphics/palette.h"
+#include "gui/debugger.h"
#include "touche/midi.h"
#include "touche/touche.h"
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp
index 7183266cf4..c4358dc4b2 100644
--- a/engines/tsage/converse.cpp
+++ b/engines/tsage/converse.cpp
@@ -208,7 +208,7 @@ void SequenceManager::signal() {
break;
case 22:
v1 = getNextValue();
- _sceneObject->setPriority2(v1);
+ _sceneObject->fixPriority(v1);
break;
case 23:
v1 = getNextValue();
@@ -296,6 +296,8 @@ void SequenceManager::process(Event &event) {
!event.handled && _globals->_sceneObjects->contains(&_sceneText)) {
// Remove the text item
_sceneText.remove();
+ setDelay(2);
+ event.handled = true;
} else {
Action::process(event);
}
@@ -355,7 +357,7 @@ void SequenceManager::setMessage(int resNum, int lineNum, int color, const Commo
// Set the text message
_sceneText.setup(msg);
_sceneText.setPosition(Common::Point(textRect.left, textRect.top));
- _sceneText.setPriority2(255);
+ _sceneText.fixPriority(255);
_sceneText.show();
// Set the delay based on the number of words
@@ -849,7 +851,7 @@ void Speaker::setText(const Common::String &msg) {
_sceneText._textMode = _textMode;
_sceneText.setup(msg);
_sceneText.setPosition(_textPos);
- _sceneText.setPriority2(256);
+ _sceneText.fixPriority(256);
// Count the number of words (by spaces) in the string
const char *msgP = msg.c_str();
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index e56cadb68a..f03f10ffd2 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "engines/engine.h"
+#include "graphics/palette.h"
#include "tsage/tsage.h"
#include "tsage/core.h"
#include "tsage/dialogs.h"
@@ -556,7 +557,6 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo
} while (routeRegions[++idx] != destRegion);
tempList[idx] = 1;
- idx = 0;
for (int listIndex = 1; listIndex <= endIndex; ++listIndex) {
int var10 = tempList[listIndex];
int var12 = tempList[listIndex + 1];
@@ -1520,7 +1520,7 @@ void SceneItem::display(int resNum, int lineNum, ...) {
_globals->_sceneText.setPosition(pos, 0);
}
- _globals->_sceneText.setPriority2(255);
+ _globals->_sceneText.fixPriority(255);
_globals->_sceneObjects->draw();
}
@@ -1585,7 +1585,7 @@ void NamedHotspot::doAction(int action) {
}
}
-void NamedHotspot::setup(const int ys, const int xe, const int ye, const int xs, const int resnum, const int lookLineNum, const int useLineNum) {
+void NamedHotspot::setup(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum) {
setBounds(ys, xe, ye, xs);
_resnum = resnum;
_lookLineNum = lookLineNum;
@@ -1593,6 +1593,13 @@ void NamedHotspot::setup(const int ys, const int xe, const int ye, const int xs,
_globals->_sceneItems.addItems(this, NULL);
}
+void NamedHotspot::synchronise(Serialiser &s) {
+ SceneHotspot::synchronise(s);
+ s.syncAsSint16LE(_resnum);
+ s.syncAsSint16LE(_lookLineNum);
+ s.syncAsSint16LE(_useLineNum);
+}
+
/*--------------------------------------------------------------------------*/
void SceneObjectWrapper::setSceneObject(SceneObject *so) {
@@ -1794,7 +1801,7 @@ void SceneObject::setPriority(int priority) {
}
}
-void SceneObject::setPriority2(int priority) {
+void SceneObject::fixPriority(int priority) {
if (priority == -1) {
_flags &= ~OBJFLAG_FIXED_PRIORITY;
} else {
@@ -2238,7 +2245,7 @@ void SceneObject::setup(int visage, int stripFrameNum, int frameNum, int posX, i
setStrip(stripFrameNum);
setFrame(frameNum);
setPosition(Common::Point(posX, posY), 0);
- setPriority2(priority);
+ fixPriority(priority);
}
/*--------------------------------------------------------------------------*/
@@ -3309,7 +3316,7 @@ void WalkRegions::loadRevised() {
*/
int WalkRegions::indexOf(const Common::Point &pt, const Common::List<int> *indexList) {
for (uint idx = 0; idx < _regionList.size(); ++idx) {
- if ((!indexList || contains(*indexList, int(idx + 1))) && _regionList[idx].contains(pt))
+ if ((!indexList || !contains(*indexList, int(idx + 1))) && _regionList[idx].contains(pt))
return idx + 1;
}
@@ -3449,8 +3456,7 @@ void SceneHandler::process(Event &event) {
switch (event.kbd.keycode) {
case Common::KEYCODE_F1:
// F1 - Help
- _globals->_events.setCursor(CURSOR_ARROW);
- MessageDialog::show(HELP_MSG, OK_BTN_STRING);
+ MessageDialog::show((_vm->getFeatures() & GF_DEMO) ? DEMO_HELP_MSG : HELP_MSG, OK_BTN_STRING);
break;
case Common::KEYCODE_F2: {
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index e1ff95dcdd..45a39b24bb 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -432,9 +432,10 @@ public:
int _resnum, _lookLineNum, _useLineNum;
NamedHotspot() : SceneHotspot() {}
- void setup(const int ys, const int xe, const int ye, const int xs, const int resnum, const int lookLineNum, const int useLineNum);
+ void setup(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum);
virtual void doAction(int action);
virtual Common::String getClassName() { return "NamedHotspot"; }
+ virtual void synchronise(Serialiser &s);
};
enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MODE_3 = 3,
@@ -529,7 +530,7 @@ public:
void setFrame(int frameNum);
void setFrame2(int frameNum);
void setPriority(int priority);
- void setPriority2(int priority);
+ void fixPriority(int priority);
void setVisage(int visage);
void setObjectWrapper(SceneObjectWrapper *objWrapper);
void addMover(ObjectMover *mover, ...);
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index e8f0215e0e..eecc844292 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -24,8 +24,6 @@
*/
#include "tsage/debugger.h"
-#include "common/config-manager.h"
-#include "common/endian.h"
#include "tsage/globals.h"
#include "tsage/graphics.h"
#include "tsage/ringworld_logic.h"
@@ -94,6 +92,8 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {
Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface();
// Loop through drawing each walk region in a different color to the background surface
+ Common::String regionsDesc;
+
for (uint regionIndex = 0; regionIndex < _globals->_walkRegions._regionList.size(); ++regionIndex, ++color) {
WalkRegion &wr = _globals->_walkRegions._regionList[regionIndex];
@@ -104,6 +104,9 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {
destSurface.hLine(sliceSet.items[idx].xs - _globals->_sceneOffset.x, yp,
sliceSet.items[idx].xe - _globals->_sceneOffset.x, color);
}
+
+ regionsDesc += Common::String::format("Region #%d d bounds=%d,%d,%d,%d\n",
+ regionIndex, wr._bounds.left, wr._bounds.top, wr._bounds.right, wr._bounds.bottom);
}
// Release the surface
@@ -112,6 +115,9 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {
// Mark the scene as requiring a full redraw
_globals->_paneRefreshFlag[0] = 2;
+ DebugPrintf("Total regions = %d\n", _globals->_walkRegions._regionList.size());
+ DebugPrintf("%s\n", regionsDesc.c_str());
+
return false;
}
@@ -385,7 +391,7 @@ bool Debugger::Cmd_MoveObject(int argc, const char **argv) {
* Give a specified item to the player
*/
bool Debugger::Cmd_Item(int argc, const char **argv) {
- RING_INVENTORY._infoDisk._sceneNumber = 1;
+ RING_INVENTORY._stasisBox._sceneNumber = 1;
return true;
}
diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp
index 5d34037b7b..ba7b459304 100644
--- a/engines/tsage/detection.cpp
+++ b/engines/tsage/detection.cpp
@@ -126,16 +126,18 @@ public:
virtual SaveStateList listSaves(const char *target) const {
Common::String pattern = target;
- pattern += ".*";
+ pattern += ".???";
Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern);
+ sort(filenames.begin(), filenames.end());
tSage::tSageSavegameHeader header;
SaveStateList saveList;
for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
- int slot;
const char *ext = strrchr(file->c_str(), '.');
- if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) {
+ int slot = ext ? atoi(ext + 1) : -1;
+
+ if (slot >= 0 && slot < MAX_SAVES) {
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file);
if (in) {
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index ba3a11f619..b5f00bf73c 100644
--- a/engines/tsage/dialogs.cpp
+++ b/engines/tsage/dialogs.cpp
@@ -24,11 +24,13 @@
*/
#include "common/translation.h"
+
+#include "gui/dialog.h"
+#include "gui/widget.h"
+
#include "tsage/tsage.h"
#include "tsage/core.h"
#include "tsage/dialogs.h"
-#include "tsage/graphics.h"
-#include "tsage/core.h"
#include "tsage/staticres.h"
#include "tsage/globals.h"
#include "tsage/ringworld_logic.h"
@@ -71,17 +73,12 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String
int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) {
// Ensure that the cursor is the arrow
- CursorType currentCursor = _globals->_events.getCursor();
- if (currentCursor != CURSOR_ARROW)
- _globals->_events.setCursor(CURSOR_ARROW);
+ _globals->_events.pushCursor(CURSOR_ARROW);
_globals->_events.showCursor();
int result = show2(message, btn1Message, btn2Message);
- // If the cursor was changed, change it back
- if (currentCursor != CURSOR_ARROW)
- _globals->_events.setCursor(currentCursor);
-
+ _globals->_events.popCursor();
return result;
}
@@ -96,7 +93,6 @@ int MessageDialog::show2(const Common::String &message, const Common::String &bt
return result;
}
-
/*--------------------------------------------------------------------------*/
ConfigDialog::ConfigDialog() : GUI::OptionsDialog("", "GlobalConfig") {
@@ -416,10 +412,11 @@ InventoryDialog::InventoryDialog() {
imgHeight = MAX(imgHeight, (int)itemSurface.getBounds().height());
// Add the item to the display list
- _images.push_back(GfxInvImage());
- _images[_images.size() - 1].setDetails(invObject->_displayResNum, invObject->_rlbNum, invObject->_cursorNum);
- _images[_images.size() - 1]._invObject = invObject;
- add(&_images[_images.size() - 1]);
+ GfxInvImage *img = new GfxInvImage();
+ _images.push_back(img);
+ img->setDetails(invObject->_displayResNum, invObject->_rlbNum, invObject->_cursorNum);
+ img->_invObject = invObject;
+ add(img);
}
}
assert(_images.size() > 0);
@@ -441,7 +438,7 @@ InventoryDialog::InventoryDialog() {
cellX = 0;
}
- _images[idx]._bounds.moveTo(pt.x, pt.y);
+ _images[idx]->_bounds.moveTo(pt.x, pt.y);
pt.x += imgWidth + 2;
++cellX;
@@ -459,6 +456,11 @@ InventoryDialog::InventoryDialog() {
setCenter(SCREEN_CENTER_X, SCREEN_CENTER_Y);
}
+InventoryDialog::~InventoryDialog() {
+ for (uint idx = 0; idx < _images.size(); ++idx)
+ delete _images[idx];
+}
+
void InventoryDialog::execute() {
if ((RING_INVENTORY._selectedItem) && RING_INVENTORY._selectedItem->inInventory())
RING_INVENTORY._selectedItem->setCursor();
@@ -491,7 +493,7 @@ void InventoryDialog::execute() {
if (!event.handled && event.eventType == EVENT_KEYPRESS) {
if ((event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_ESCAPE)) {
// Exit the dialog
- hiliteObj = &_btnOk;
+ //hiliteObj = &_btnOk;
break;
}
}
diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h
index d7828526eb..c24fa2dd3b 100644
--- a/engines/tsage/dialogs.h
+++ b/engines/tsage/dialogs.h
@@ -105,11 +105,11 @@ public:
class InventoryDialog : public ModalDialog {
private:
- Common::Array<GfxInvImage> _images;
+ Common::Array<GfxInvImage *> _images;
GfxButton _btnOk, _btnLook;
public:
InventoryDialog();
- virtual ~InventoryDialog() {}
+ virtual ~InventoryDialog();
void execute();
static void show();
diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp
index a92cbb9df9..bcfff9fc1d 100644
--- a/engines/tsage/events.cpp
+++ b/engines/tsage/events.cpp
@@ -38,6 +38,7 @@ namespace tSage {
EventsClass::EventsClass() {
_currentCursor = CURSOR_NONE;
+ hideCursor();
_frameNumber = 0;
_priorFrameTime = 0;
_prevDelayFrame = 0;
@@ -208,6 +209,62 @@ void EventsClass::setCursor(CursorType cursorType) {
DEALLOCATE(cursor);
}
+void EventsClass::pushCursor(CursorType cursorType) {
+ const byte *cursor;
+ bool delFlag = true;
+ uint size;
+
+ switch (cursorType) {
+ case CURSOR_CROSSHAIRS:
+ // Crosshairs cursor
+ cursor = _resourceManager->getSubResource(4, 1, 6, &size);
+ break;
+
+ case CURSOR_LOOK:
+ // Look cursor
+ cursor = _resourceManager->getSubResource(4, 1, 5, &size);
+ break;
+
+ case CURSOR_USE:
+ // Use cursor
+ cursor = _resourceManager->getSubResource(4, 1, 4, &size);
+ break;
+
+ case CURSOR_TALK:
+ // Talk cursor
+ cursor = _resourceManager->getSubResource(4, 1, 3, &size);
+ break;
+
+ case CURSOR_ARROW:
+ // Arrow cursor
+ cursor = CURSOR_ARROW_DATA;
+ delFlag = false;
+ break;
+
+ case CURSOR_WALK:
+ default:
+ // Walk cursor
+ cursor = CURSOR_WALK_DATA;
+ delFlag = false;
+ break;
+ }
+
+ // Decode the cursor
+ GfxSurface s = surfaceFromRes(cursor);
+
+ Graphics::Surface surface = s.lockSurface();
+ const byte *cursorData = (const byte *)surface.getBasePtr(0, 0);
+ CursorMan.pushCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor);
+ s.unlockSurface();
+
+ if (delFlag)
+ DEALLOCATE(cursor);
+}
+
+void EventsClass::popCursor() {
+ CursorMan.popCursor();
+}
+
void EventsClass::setCursor(Graphics::Surface &cursor, int transColor, const Common::Point &hotspot, CursorType cursorId) {
const byte *cursorData = (const byte *)cursor.getBasePtr(0, 0);
CursorMan.replaceCursor(cursorData, cursor.w, cursor.h, hotspot.x, hotspot.y, transColor);
@@ -227,6 +284,10 @@ void EventsClass::hideCursor() {
CursorMan.showMouse(false);
}
+bool EventsClass::isCursorVisible() const {
+ return CursorMan.isVisible();
+}
+
/**
* Delays the game for the specified number of frames, if necessary, from the
* previous time the delay method was called
diff --git a/engines/tsage/events.h b/engines/tsage/events.h
index ef0256e81f..90516b2353 100644
--- a/engines/tsage/events.h
+++ b/engines/tsage/events.h
@@ -82,11 +82,14 @@ public:
CursorType _currentCursor;
void setCursor(CursorType cursorType);
+ void pushCursor(CursorType cursorType);
+ void popCursor();
void setCursor(Graphics::Surface &cursor, int transColor, const Common::Point &hotspot, CursorType cursorId);
void setCursorFromFlag();
CursorType getCursor() const { return _currentCursor; }
void showCursor();
void hideCursor();
+ bool isCursorVisible() const;
bool pollEvent();
void waitForPress(int eventMask = EVENT_BUTTON_DOWN | EVENT_KEYPRESS);
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 00444f3672..3914d77185 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -43,6 +43,7 @@ static SavedObject *classFactoryProc(const Common::String &className) {
if (className == "ObjectMover2") return new ObjectMover2();
if (className == "ObjectMover3") return new ObjectMover3();
if (className == "PlayerMover") return new PlayerMover();
+ if (className == "SceneObjectWrapper") return new SceneObjectWrapper();
return NULL;
}
@@ -54,12 +55,21 @@ Globals::Globals() :
_gfxManagerInstance(_screenSurface) {
reset();
_stripNum = 0;
- _gfxFontNumber = (_vm->getFeatures() & GF_DEMO) ? 0 : 50;
- _gfxColors.background = 53;
- _gfxColors.foreground = 18;
- _fontColors.background = 51;
- _fontColors.foreground = 54;
+ if (_vm->getFeatures() & GF_DEMO) {
+ _gfxFontNumber = 0;
+ _gfxColors.background = 6;
+ _gfxColors.foreground = 0;
+ _fontColors.background = 0;
+ _fontColors.foreground = 0;
+ _dialogCenter.y = 80;
+ } else {
+ _gfxFontNumber = 50;
+ _gfxColors.background = 53;
+ _gfxColors.foreground = 18;
+ _fontColors.background = 51;
+ _fontColors.foreground = 54;
+ }
_screenSurface.setScreenSurface();
_gfxManagers.push_back(&_gfxManagerInstance);
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index f9f9e4b4ca..9d840bf00d 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -29,6 +29,7 @@
#include "tsage/tsage.h"
#include "tsage/core.h"
#include "common/algorithm.h"
+#include "graphics/palette.h"
#include "graphics/surface.h"
#include "tsage/globals.h"
@@ -257,7 +258,7 @@ void GfxSurface::create(int width, int height) {
assert((width >= 0) && (height >= 0));
_screenSurface = false;
_customSurface = new Graphics::Surface();
- _customSurface->create(width, height, 1);
+ _customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_bounds = Rect(0, 0, width, height);
}
@@ -282,7 +283,7 @@ Graphics::Surface GfxSurface::lockSurface() {
result.w = _bounds.width();
result.h = _bounds.height();
result.pitch = src->pitch;
- result.bytesPerPixel = src->bytesPerPixel;
+ result.format = src->format;
result.pixels = src->getBasePtr(_bounds.left, _bounds.top);
return result;
@@ -331,7 +332,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) {
if (_customSurface) {
// Surface owns the internal data, so replicate it so new surface owns it's own
_customSurface = new Graphics::Surface();
- _customSurface->create(s._customSurface->w, s._customSurface->h, 1);
+ _customSurface->create(s._customSurface->w, s._customSurface->h, Graphics::PixelFormat::createFormatCLUT8());
const byte *srcP = (const byte *)s._customSurface->getBasePtr(0, 0);
byte *destP = (byte *)_customSurface->getBasePtr(0, 0);
diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp
index 5320a573b2..a73c23ab7f 100644
--- a/engines/tsage/resources.cpp
+++ b/engines/tsage/resources.cpp
@@ -200,11 +200,11 @@ struct DecodeReference {
*/
byte *TLib::getResource(uint16 id, bool suppressErrors) {
// Scan for an entry for the given Id
- ResourceEntry *re= NULL;
- ResourceList::iterator i;
- for (i = _resources.begin(); i != _resources.end(); ++i) {
- if ((*i).id == id) {
- re = &(*i);
+ ResourceEntry *re = NULL;
+ ResourceList::iterator iter;
+ for (iter = _resources.begin(); iter != _resources.end(); ++iter) {
+ if ((*iter).id == id) {
+ re = &(*iter);
break;
}
}
@@ -239,6 +239,9 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) {
uint16 word_48050 = 0, currentToken = 0, word_48054 =0;
byte byte_49068 = 0, byte_49069 = 0;
DecodeReference table[0x1000];
+ for (int i = 0; i < 0x1000; ++i) {
+ table[i].vByte = table[i].vWord = 0;
+ }
Common::Stack<uint16> tokenList;
for (;;) {
diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h
index b33cc37266..4ae41f6557 100644
--- a/engines/tsage/resources.h
+++ b/engines/tsage/resources.h
@@ -32,6 +32,7 @@
#include "common/list.h"
#include "common/str.h"
#include "common/str-array.h"
+#include "common/textconsole.h"
#include "common/util.h"
#include "graphics/surface.h"
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp
index 0a2220c690..c0cfe3a938 100644
--- a/engines/tsage/ringworld_logic.cpp
+++ b/engines/tsage/ringworld_logic.cpp
@@ -344,7 +344,7 @@ void SpeakerGText::setText(const Common::String &msg) {
_sceneObject.postInit();
_sceneObject.setVisage(9405);
_sceneObject.setStrip2(3);
- _sceneObject.setPriority2(255);
+ _sceneObject.fixPriority(255);
_sceneObject.changeZoom(100);
_sceneObject._frame = 1;
_sceneObject.setPosition(Common::Point(183, 71));
@@ -405,7 +405,7 @@ void SpeakerPOR::setText(const Common::String &msg) {
_object3.setVisage(7223);
_object3.setStrip(3);
_object3.setPosition(Common::Point(119, 107), 0);
- _object3.setPriority2(199);
+ _object3.fixPriority(199);
_object3.setAction(&_action2);
Speaker::setText(msg);
@@ -425,7 +425,7 @@ void SpeakerOR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(9431);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(202, 147), 0);
@@ -434,7 +434,7 @@ void SpeakerOR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(9431);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.setZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(199, 85), 0);
@@ -605,7 +605,7 @@ void SpeakerSKL::setText(const Common::String &msg) {
_object1.setVisage(7013);
_object1.setStrip2(2);
_object1._frame = 1;
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1.setPosition(Common::Point(203, 120));
_object1.animate(ANIM_MODE_7, 0, NULL);
@@ -613,7 +613,7 @@ void SpeakerSKL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(7013);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(197, 80));
@@ -636,7 +636,7 @@ void SpeakerQL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2612);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(128, 146));
@@ -645,7 +645,7 @@ void SpeakerQL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2612);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(122, 84));
@@ -668,7 +668,7 @@ void SpeakerSR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2813);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(224, 198));
@@ -677,7 +677,7 @@ void SpeakerSR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2813);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(203, 96));
@@ -687,7 +687,7 @@ void SpeakerSR::setText(const Common::String &msg) {
_object3.setVisage(2813);
_object3.setStrip(3);
_object3.setPosition(Common::Point(204, 91));
- _object3.setPriority2(199);
+ _object3.fixPriority(199);
_object3._numFrames = 3;
_object3.animate(ANIM_MODE_7, 0, NULL);
@@ -709,7 +709,7 @@ void SpeakerSL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2812);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(95, 198));
@@ -718,7 +718,7 @@ void SpeakerSL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2812);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(116, 96));
@@ -741,7 +741,7 @@ void SpeakerQR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2613);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(191, 146));
@@ -750,7 +750,7 @@ void SpeakerQR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2613);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(197, 84));
@@ -773,7 +773,7 @@ void SpeakerQU::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(7021);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(116, 120), 0);
@@ -782,7 +782,7 @@ void SpeakerQU::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(7021);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(111, 84), 0);
@@ -804,14 +804,14 @@ void SpeakerCR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(9011);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.setPosition(Common::Point(219, 168));
_object1.animate(ANIM_MODE_7, 0, NULL);
_object2.postInit(&_objectList);
_object2.setVisage(9011);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.setPosition(Common::Point(232, 81));
_object2.setAction(&_speakerAction, NULL);
@@ -831,7 +831,7 @@ void SpeakerMR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2713);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(220, 143));
@@ -840,7 +840,7 @@ void SpeakerMR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2713);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2._frame = 1;
_object2.setPosition(Common::Point(215, 99));
_object2.setAction(&_speakerAction, NULL);
@@ -862,7 +862,7 @@ void SpeakerSAL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2853);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(185, 200));
@@ -871,7 +871,7 @@ void SpeakerSAL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2853);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2._frame = 1;
_object2.setPosition(Common::Point(170, 92));
_object2.setAction(&_speakerAction, NULL);
@@ -892,7 +892,7 @@ void SpeakerML::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(2712);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(99, 143));
@@ -901,7 +901,7 @@ void SpeakerML::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(2712);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2._frame = 1;
_object2.setPosition(Common::Point(105, 99));
_object2.setAction(&_speakerAction, NULL);
@@ -922,7 +922,7 @@ void SpeakerCHFL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(4113);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(205, 116));
@@ -931,7 +931,7 @@ void SpeakerCHFL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(4113);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2._frame = 1;
_object2.setPosition(Common::Point(202, 71));
_object2.setAction(&_speakerAction, NULL);
@@ -952,7 +952,7 @@ void SpeakerCHFR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(4112);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(103, 116));
@@ -961,7 +961,7 @@ void SpeakerCHFR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(4112);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2._frame = 1;
_object2.setPosition(Common::Point(106, 71));
_object2.setAction(&_speakerAction, NULL);
@@ -982,7 +982,7 @@ void SpeakerPL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(4062);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(107, 117));
@@ -991,7 +991,7 @@ void SpeakerPL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(4062);
_object2.setStrip2(1);
- _object2.setPriority2(200);
+ _object2.fixPriority(200);
_object2._frame = 1;
_object2.setPosition(Common::Point(105, 62));
_object2.setAction(&_speakerAction, NULL);
@@ -999,7 +999,7 @@ void SpeakerPL::setText(const Common::String &msg) {
_object3.postInit(&_objectList);
_object3.setVisage(4062);
_object3.setStrip2(3);
- _object3.setPriority2(255);
+ _object3.fixPriority(255);
_object3._frame = 1;
_object3.setPosition(Common::Point(105, 59));
_object3.setAction(&_speakerAction2, NULL);
@@ -1025,7 +1025,7 @@ void SpeakerPR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(4063);
_object1.setStrip2(1);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(212, 117));
@@ -1034,7 +1034,7 @@ void SpeakerPR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(4063);
_object2.setStrip2(2);
- _object2.setPriority2(200);
+ _object2.fixPriority(200);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(214, 62));
@@ -1043,7 +1043,7 @@ void SpeakerPR::setText(const Common::String &msg) {
_object3.postInit(&_objectList);
_object3.setVisage(4063);
_object3.setStrip2(3);
- _object3.setPriority2(255);
+ _object3.fixPriority(255);
_object3.changeZoom(100);
_object3._frame = 1;
_object3.setPosition(Common::Point(214, 59));
@@ -1070,7 +1070,7 @@ void SpeakerCDR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(4163);
_object1.setStrip2(1);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(208, 97));
@@ -1079,7 +1079,7 @@ void SpeakerCDR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(4163);
_object2.setStrip2(2);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(200, 57));
@@ -1101,7 +1101,7 @@ void SpeakerCDL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(4162);
_object1.setStrip2(1);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(112, 97));
@@ -1110,7 +1110,7 @@ void SpeakerCDL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(4162);
_object2.setStrip2(2);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(115, 57));
@@ -1132,7 +1132,7 @@ void SpeakerFLL::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(5223);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(216, 129));
@@ -1141,7 +1141,7 @@ void SpeakerFLL::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(5223);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(210, 67));
@@ -1163,7 +1163,7 @@ void SpeakerBatR::setText(const Common::String &msg) {
_object1.postInit(&_objectList);
_object1.setVisage(5361);
_object1.setStrip2(2);
- _object1.setPriority2(255);
+ _object1.fixPriority(255);
_object1.changeZoom(100);
_object1._frame = 1;
_object1.setPosition(Common::Point(137, 122));
@@ -1172,7 +1172,7 @@ void SpeakerBatR::setText(const Common::String &msg) {
_object2.postInit(&_objectList);
_object2.setVisage(5361);
_object2.setStrip2(1);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2.changeZoom(100);
_object2._frame = 1;
_object2.setPosition(Common::Point(137, 104));
@@ -1319,6 +1319,8 @@ void RingworldGame::start() {
// Switch to the title screen
_globals->_sceneManager.setNewScene(1000);
+
+ _globals->_events.showCursor();
}
void RingworldGame::restart() {
@@ -1407,6 +1409,8 @@ void RingworldGame::endGame(int resNum, int lineNum) {
void RingworldDemoGame::start() {
// Start the demo's single scene
_globals->_sceneManager.changeScene(1);
+
+ _globals->_events.setCursor(CURSOR_NONE);
}
void RingworldDemoGame::restart() {
diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp
index fd51670fb8..9811cd52d3 100644
--- a/engines/tsage/ringworld_scenes1.cpp
+++ b/engines/tsage/ringworld_scenes1.cpp
@@ -149,20 +149,20 @@ void Scene10::postInit(SceneObjectList *OwnerList) {
_object1.postInit();
_object1.setVisage(10);
_object1.setPosition(Common::Point(232, 90));
- _object1.setPriority2(1);
+ _object1.fixPriority(1);
_object2.postInit();
_object2.setVisage(10);
_object2.setStrip(4);
_object2.setFrame(1);
_object2.setPosition(Common::Point(204, 59));
- _object2.setPriority2(198);
+ _object2.fixPriority(198);
_object3.postInit();
_object3.setVisage(10);
_object3.setStrip2(5);
_object3.setPosition(Common::Point(180, 87));
- _object3.setPriority2(196);
+ _object3.fixPriority(196);
_object3.setAction(&_action2);
_object4.postInit();
@@ -565,7 +565,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(20);
_globals->_player.setPosition(Common::Point(588, 79));
_globals->_player._moveDiff = Common::Point(5, 5);
- _globals->_player.setPriority2(50);
+ _globals->_player.fixPriority(50);
_globals->_player.animate(ANIM_MODE_1, NULL);
_SceneObjectExt.postInit();
@@ -599,7 +599,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) {
_globals->_player.animate(ANIM_MODE_NONE, NULL);
_globals->_player.setStrip2(1);
_globals->_player.setFrame2(4);
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
_globals->_player.setPosition(Common::Point(425, 233));
setAction(&_action1);
@@ -901,7 +901,7 @@ void Scene30::postInit(SceneObjectList *OwnerList) {
_beam.setVisage(31);
_beam.setStrip(2);
_beam.setPosition(Common::Point(124, 178));
- _beam.setPriority2(188);
+ _beam.fixPriority(188);
// Set up door object
_door.postInit();
@@ -927,7 +927,7 @@ void Scene30::signal() {
_beam.setVisage(31);
_beam.setStrip(2);
_beam.setPosition(Common::Point(124, 178));
- _beam.setPriority2(188);
+ _beam.fixPriority(188);
_globals->_sceneItems.push_front(&_beam);
_globals->_player.enableControl();
} else if (_sceneMode == 32) {
@@ -1090,7 +1090,7 @@ void Scene40::Action2::signal() {
scene->_doorway.postInit();
scene->_doorway.setVisage(16);
scene->_doorway.setStrip2(6);
- scene->_doorway.setPriority2(200);
+ scene->_doorway.fixPriority(200);
scene->_doorway.setPosition(Common::Point(159, 191));
scene->_doorway._moveDiff = Common::Point(40, 40);
scene->_doorway._moveRate = 60;
@@ -1300,11 +1300,11 @@ void Scene40::Action8::signal() {
scene->_doorway.postInit();
scene->_doorway.setVisage(16);
scene->_doorway.setStrip2(6);
- scene->_doorway.setPriority2(200);
+ scene->_doorway.fixPriority(200);
scene->_doorway._moveRate = 60;
if (_globals->_player._position.x >= 145) {
- scene->_doorway.setPriority2(-1);
+ scene->_doorway.fixPriority(-1);
scene->_doorway.setPosition(Common::Point(6, 157));
} else {
scene->_doorway.setPosition(Common::Point(313, 53));
@@ -1492,14 +1492,14 @@ void Scene40::postInit(SceneObjectList *OwnerList) {
_object2.postInit();
_object2.setVisage(41);
_object2.setStrip(6);
- _object2.setPriority2(200);
+ _object2.fixPriority(200);
_object2.setPosition(Common::Point(94, 189));
_object2.setAction(&_action5);
_object3.postInit();
_object3.setVisage(41);
_object3.setStrip(5);
- _object3.setPriority2(205);
+ _object3.fixPriority(205);
_object3.setPosition(Common::Point(110, 186));
_object3._numFrames = 2;
_object3.animate(ANIM_MODE_8, NULL, NULL);
@@ -1512,7 +1512,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) {
_dyingKzin.setVisage(40);
_dyingKzin.setStrip(6);
_dyingKzin.setPosition(Common::Point(-90, 65));
- _dyingKzin.setPriority2(170);
+ _dyingKzin.fixPriority(170);
setAction(&_action1);
} else {
@@ -1525,7 +1525,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) {
_dyingKzin.postInit();
_dyingKzin.setVisage(40);
_dyingKzin.setPosition(Common::Point(205, 183));
- _dyingKzin.setPriority2(170);
+ _dyingKzin.fixPriority(170);
_dyingKzin._frame = 9;
_dyingKzin.setAction(&_action7);
@@ -1792,19 +1792,19 @@ void Scene50::postInit(SceneObjectList *OwnerList) {
_object2.setVisage(2331);
_object2.setStrip(6);
_object2.setPosition(Common::Point(136, 192));
- _object2.setPriority2(200);
+ _object2.fixPriority(200);
_object3.postInit();
_object3.setVisage(2337);
_object3.setStrip(6);
_object3.setPosition(Common::Point(260, 180));
- _object3.setPriority2(200);
+ _object3.fixPriority(200);
_object4.postInit();
_object4.setVisage(2331);
_object4.setStrip(6);
_object4.setPosition(Common::Point(295, 144));
- _object4.setPriority2(178);
+ _object4.fixPriority(178);
_globals->_sceneItems.addItems(&_object2, &_object3, &_object4, NULL);
@@ -2649,7 +2649,7 @@ void Scene90::postInit(SceneObjectList *OwnerList) {
_object3.setVisage(90);
_object3.animate(ANIM_MODE_1, NULL);
_object3.setPosition(Common::Point(196, 181));
- _object3.setPriority2(175);
+ _object3.fixPriority(175);
_globals->_sceneItems.push_back(&_object3);
_globals->_player.disableControl();
@@ -2879,7 +2879,7 @@ void Scene6100::Action3::signal() {
break;
case 1:
_globals->_scenePalette.clearListeners();
- scene->_fadePercent = 0;
+ scene->_fadePercent = 100;
_globals->_scenePalette.refresh();
scene->loadScene(9997);
scene->_object1.hide();
@@ -2890,7 +2890,7 @@ void Scene6100::Action3::signal() {
scene->_sunflower3.hide();
scene->_rocks.hide();
scene->_sceneText.hide();
-
+
_globals->_events.setCursor(CURSOR_WALK);
scene->_stripManager.start(8120, this);
break;
@@ -2995,39 +2995,39 @@ void Scene6100::Action5::dispatch() {
}
scene->_objList[idx]->_flags |= OBJFLAG_PANES;
-/*
+
if ((idx != 3) && (scene->_fadePercent == 100) &&
- (tempSet.sqrt(floatSet) < 150.0)) {
+ (tempSet.sqrt(zeroSet) < 150.0)) {
switch (scene->_hitCount++) {
case 1:
scene->_soundHandler.startSound(233);
- scene->showMessage(0, NULL, 0);
+ scene->showMessage(NULL, 0, NULL);
if (!_globals->getFlag(76))
- scene->_object5.setAction(&scene->_action2);
+ scene->_probe.setAction(&scene->_action2);
+ break;
case 2:
scene->_soundHandler.startSound(234);
- scene->showMessage(0, NULL, 0);
+ scene->showMessage(NULL, 0, NULL);
if (!_globals->getFlag(76))
- scene->_object5.setAction(NULL);
+ scene->_probe.setAction(NULL);
scene->setAction(&scene->_action3);
break;
default:
scene->_soundHandler.startSound(233);
- scene->showMessage(0, NULL, 0);
+ scene->showMessage(NULL, 0, NULL);
if (!_globals->getFlag(76))
- scene->_object5.setAction(&scene->_action1);
+ scene->_probe.setAction(&scene->_action1);
break;
}
_globals->_scenePalette.clearListeners();
scene->_fadePercent = 0;
}
- */
}
}
@@ -3129,6 +3129,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) {
loadScene(6100);
Scene::postInit();
setZoomPercents(62, 2, 200, 425);
+ _globals->_sceneHandler._delayTicks = 8;
_globals->_player.disableControl();
_globals->_events.setCursor(CURSOR_WALK);
@@ -3140,28 +3141,28 @@ void Scene6100::postInit(SceneObjectList *OwnerList) {
_object1._frame = 1;
_object1._strip = 4;
_object1.setPosition(Common::Point(0, 60));
- _object1.setPriority2(1);
+ _object1.fixPriority(1);
_object2.postInit();
_object2.setVisage(6100);
_object2._frame = 1;
_object2._strip = 4;
_object2.setPosition(Common::Point(160, 60));
- _object2.setPriority2(1);
+ _object2.fixPriority(1);
_object3.postInit();
_object3.setVisage(6100);
_object3._frame = 1;
_object3._strip = 4;
_object3.setPosition(Common::Point(320, 60));
- _object3.setPriority2(1);
+ _object3.fixPriority(1);
_rocks.postInit();
_rocks.setVisage(6100);
_rocks._frame = 1;
_rocks._strip = 3;
_rocks.setPosition(Common::Point(320, 0));
- _rocks.setPriority2(2);
+ _rocks.fixPriority(2);
_rocks.changeZoom(-1);
_rocks._floats._float1 = 320.0;
_rocks._floats._float2 = 25000.0;
@@ -3173,7 +3174,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) {
_probe._frame = 1;
_probe._strip = 5;
_probe.setPosition(Common::Point(160, 260));
- _probe.setPriority2(3);
+ _probe.fixPriority(3);
_probe._floats._float1 = 320.0;
_probe._floats._float2 = 0.0;
_probe._floats._float3 = 0.0;
@@ -3198,7 +3199,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) {
_objList[idx]->setPosition(Common::Point(
_globals->_randomSource.getRandomNumber(319), 60));
- _objList[idx]->setPriority2(1);
+ _objList[idx]->fixPriority(1);
_objList[idx]->changeZoom(-1);
}
diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp
index 045ea71586..d16c332a8c 100644
--- a/engines/tsage/ringworld_scenes10.cpp
+++ b/engines/tsage/ringworld_scenes10.cpp
@@ -38,7 +38,8 @@ Scene2::Scene2() : Scene() {
/*--------------------------------------------------------------------------*/
void Object9350::postInit(SceneObjectList *OwnerList) {
- _globals->_sceneManager.postInit(&_globals->_sceneManager._altSceneObjects);
+ //SceneObject::postInit(&_globals->_sceneManager._altSceneObjects);
+ SceneObject::postInit(OwnerList);
}
void Object9350::draw() {
@@ -66,7 +67,7 @@ void Scene9100::SceneHotspot1::doAction(int action) {
_globals->_player.disableControl();
scene->_sceneMode = 9105;
}
- scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, 0);
+ scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, NULL);
} else {
NamedHotspot::doAction(action);
}
@@ -77,16 +78,16 @@ void Scene9100::dispatch() {
if (!_action) {
if (_globals->_player._position.x < 25) {
- if (!_globals->getFlag(11)) {
- scene->_sceneMode = 9106;
- } else {
- scene->_sceneMode = 9108;
+ _globals->_player.disableControl();
+ if (!_globals->getFlag(23) || _globals->getFlag(11))
+ _sceneMode = 9106;
+ else {
+ _sceneMode = 9108;
_globals->setFlag(11);
}
- } else {
- scene->_sceneMode = 9106;
+
+ scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, NULL);
}
- scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, 0);
} else {
Scene::dispatch();
}
@@ -102,7 +103,7 @@ void Scene9100::signal() {
_globals->_sceneManager.changeScene(9150);
break;
case 9105:
- _sceneHotspot1.remove();
+ _sceneHotspot3.remove();
// No break on purpose
case 9103:
case 9104:
@@ -115,17 +116,15 @@ void Scene9100::signal() {
}
void Scene9100::postInit(SceneObjectList *OwnerList) {
- Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene;
-
Scene::postInit();
setZoomPercents(0, 100, 200, 100);
_object1.postInit();
_object1.setVisage(9100);
_object1._strip = 1;
_object1._numFrames = 6;
- _object1.setPosition(Common::Point(297, 132), 0);
+ _object1.setPosition(Common::Point(279, 132), 0);
_object1.animate(ANIM_MODE_2, 0);
- _object1.setPriority2(10);
+ _object1.fixPriority(10);
_globals->_player.postInit();
@@ -146,7 +145,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) {
_object6.setVisage(9111);
_object6.setStrip(6);
_object6.setFrame(1);
- _object6.setPosition(Common::Point(138, 166), 0);
+ _object6.setPosition(Common::Point(138, 166));
_sceneHotspot3.setup(145, 125, 166, 156, 9100, 40, 43);
}
_sceneHotspot1.setup(140, 176, 185, 215, 9100, 36, 37);
@@ -163,17 +162,17 @@ void Scene9100::postInit(SceneObjectList *OwnerList) {
_sceneMode = 9107;
else
_sceneMode = 9109;
- setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object5, 0);
+ setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object5, NULL);
} else {
_sceneMode = 9103;
_globals->_player.disableControl();
- setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, 0);
+ setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL);
_globals->setFlag(20);
}
} else {
_sceneMode = 9102;
_globals->_player.disableControl();
- setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, 0);
+ setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL);
}
}
@@ -224,7 +223,7 @@ void Scene9150::dispatch() {
if ((_sceneState != 0) && (_sceneBounds.left == 0)) {
_object3._timer = 0;
_sceneState = 0;
- _sceneHotspot3.setAction(&_sequenceManager2, 0, 9154, &_object3, 0);
+ _object3.setAction(&_sequenceManager2, NULL, 9154, &_object3, NULL);
_sceneHotspot10.remove();
}
@@ -308,16 +307,16 @@ void Scene9200::SceneHotspot1::doAction(int action) {
_globals->_player.disableControl();
if (_globals->getFlag(93)) {
scene->_sceneState = 9214;
- setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0);
} else {
_globals->setFlag(93);
scene->_sceneState = 9213;
- setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, 0);
}
} else if (action <= 100) {
_globals->_player.disableControl();
scene->_sceneState = 9214;
- setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0);
} else {
NamedHotspot::doAction(action);
}
@@ -405,7 +404,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) {
_object1._strip = 3;
_object1.animate(ANIM_MODE_2, 0);
_object1.setPosition(Common::Point(132, 114), 0);
- _object1.setPriority2(140);
+ _object1.fixPriority(140);
_soundHandler.startSound(297);
_stripManager.addSpeaker(&_speakerQText);
_stripManager.addSpeaker(&_speakerGR);
@@ -589,7 +588,7 @@ void Scene9350::postInit(SceneObjectList *OwnerList) {
setZoomPercents(95, 80, 200, 100);
_globals->_player.postInit();
- _object1.setup(9350, 1, 3, 139, 97, 0);
+ _object1.setup(9351, 1, 3, 139, 97, 0);
_sceneHotspot1.setup(42, 0, 97, 60, 9350, 0, -1);
_sceneHotspot2.setup(37, 205, 82, 256, 9350, 0, -1);
_sceneHotspot3.setup(29, 93, 92, 174, 9350, 1, -1);
@@ -602,22 +601,22 @@ void Scene9350::postInit(SceneObjectList *OwnerList) {
if (_globals->_sceneManager._previousScene == 9360) {
_globals->_player.disableControl();
_sceneState = 9352;
- setAction(&_sequenceManager, this, 9352, &_globals->_player, &_object2, 0);
+ setAction(&_sequenceManager, this, 9352, &_globals->_player, &_object2, NULL);
} else if (_globals->_sceneManager._previousScene == 9400) {
_globals->_player.disableControl();
_sceneState = 9353;
- setAction(&_sequenceManager, this, 9353, &_globals->_player, &_object2, 0);
+ setAction(&_sequenceManager, this, 9353, &_globals->_player, &_object2, NULL);
} else {
- if (!_globals->getFlag(84)) {
+ if (_globals->getFlag(84)) {
_globals->clearFlag(84);
_object2.postInit();
_globals->_player.disableControl();
_sceneState = 9359;
- setAction(&_sequenceManager, this, 9359, &_globals->_player, &_object2, 0);
+ setAction(&_sequenceManager, this, 9359, &_globals->_player, &_object2, NULL);
} else {
_globals->_player.disableControl();
_sceneState = 9354;
- setAction(&_sequenceManager, this, 9354, &_globals->_player, &_object2, 0);
+ setAction(&_sequenceManager, this, 9354, &_globals->_player, &_object2, NULL);
}
}
}
@@ -713,6 +712,7 @@ void Scene9400::SceneHotspot7::doAction(int action) {
if ((action == CURSOR_USE) && (RING_INVENTORY._straw._sceneNumber != 1)) {
scene->_sceneState = 1;
+ RING_INVENTORY._straw._sceneNumber = 1;
scene->setAction(&scene->_sequenceManager, scene, 9408, &_globals->_player, 0);
} else {
NamedHotspot::doAction(action);
@@ -825,7 +825,7 @@ void Scene9400::postInit(SceneObjectList *OwnerList) {
void Scene9450::Object2::signal() {
Scene9450 *scene = (Scene9450 *)_globals->_sceneManager._scene;
- this->setAction(&scene->_sequenceManager3, this, 9458, &scene->_object1, 0);
+ this->setAction(&scene->_sequenceManager3, this, 9458, this, &scene->_object1, 0);
}
void Scene9450::Object3::dispatch() {
@@ -841,7 +841,7 @@ void Scene9450::Hotspot1::doAction(int action) {
scene->_object2._action->remove();
scene->_sceneMode = 9459;
_globals->_player.disableControl();
- setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0);
+ scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0);
} else {
NamedHotspot::doAction(action);
}
@@ -918,7 +918,9 @@ void Scene9450::signal() {
_globals->_sceneManager.changeScene(9360);
break;
case 9459:
+ RING_INVENTORY._tunic._sceneNumber = 1;
_object2.signal();
+ _globals->_player.enableControl();
_globals->_events.setCursor(CURSOR_WALK);
_hotspot1.remove();
break;
@@ -967,7 +969,7 @@ void Scene9450::postInit(SceneObjectList *OwnerList) {
} else {
_object2.setPosition(Common::Point(184, 144), 0);
_object2.setVisage(9451);
- _object2.setPriority2(250);
+ _object2.fixPriority(250);
_object2._strip = 5;
_object2._frame = 10;
}
@@ -1079,6 +1081,7 @@ void Scene9500::signal() {
break;
case 9505:
_candle.setStrip(2);
+ RING_INVENTORY._candle._sceneNumber = 1;
_globals->_player.enableControl();
break;
case 9506:
@@ -1086,6 +1089,7 @@ void Scene9500::signal() {
_globals->_player.enableControl();
break;
case 9511:
+ RING_INVENTORY._helmet._sceneNumber = 1;
_globals->_player.enableControl();
if (!_globals->getFlag(51)) {
_globals->setFlag(51);
@@ -1140,7 +1144,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) {
_object3.postInit(0);
_object3.hide();
- _object3.setPriority2(150);
+ _object3.fixPriority(150);
_object3.setPosition(Common::Point(166, 133));
if (RING_INVENTORY._straw._sceneNumber == 9500) {
_object3.show();
@@ -1164,7 +1168,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) {
_object2.setStrip(1);
_object2.setFrame(_object2.getFrameCount());
_object2.setPosition(Common::Point(303, 130));
- _object2.setPriority2(132);
+ _object2.fixPriority(132);
if (RING_INVENTORY._helmet._sceneNumber == 1) {
_hotspot2.setup(87, 294, 104, 314, 9400, 17, -1);
} else {
@@ -1243,7 +1247,7 @@ void Scene9700::signal() {
}
void Scene9700::process(Event &event) {
- if ((event.eventType == EVENT_BUTTON_DOWN) && (event.kbd.keycode == 0)) {
+ if ((event.eventType == EVENT_BUTTON_DOWN) && !_action) {
if (_gfxButton1.process(event)) {
_globals->_sceneManager.changeScene(9200);
} else if (_globals->_events._currentCursor == OBJECT_SCANNER) {
@@ -1545,7 +1549,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
_objDoor.setStrip(1);
_objDoor.setFrame(1);
_objDoor.setPosition(Common::Point(28, 118), 0);
- _objDoor.setPriority2(90);
+ _objDoor.fixPriority(90);
_objLever.postInit();
_objLever.setVisage(9850);
@@ -1557,7 +1561,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
_objCloak.setVisage(9850);
_objCloak.setStrip(5);
_objCloak.setFrame(1);
- _objCloak.setPriority2(90);
+ _objCloak.fixPriority(90);
_objCloak.setPosition(Common::Point(157, 81), 0);
if (RING_INVENTORY._cloak._sceneNumber != 9850)
_objCloak.hide();
@@ -1566,7 +1570,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
_objJacket.setVisage(9850);
_objJacket.setStrip(5);
_objJacket.setFrame(2);
- _objJacket.setPriority2(90);
+ _objJacket.fixPriority(90);
_objJacket.setPosition(Common::Point(201, 84));
if (RING_INVENTORY._jacket._sceneNumber != 9850)
_objJacket.hide();
@@ -1575,7 +1579,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
_objTunic2.setVisage(9850);
_objTunic2.setStrip(5);
_objTunic2.setFrame(3);
- _objTunic2.setPriority2(90);
+ _objTunic2.fixPriority(90);
_objTunic2.setPosition(Common::Point(295, 90));
if (RING_INVENTORY._tunic2._sceneNumber != 9850)
_objTunic2.hide();
@@ -1586,7 +1590,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
_objScimitar.setStrip(2);
_objScimitar.setFrame(1);
_objScimitar.setPosition(Common::Point(55, 83), 0);
- _objScimitar.setPriority2(80);
+ _objScimitar.fixPriority(80);
_objScimitar.hide();
}
@@ -1596,7 +1600,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) {
_objSword.setStrip(3);
_objSword.setFrame(1);
_objSword.setPosition(Common::Point(56, 101), 0);
- _objSword.setPriority2(80);
+ _objSword.fixPriority(80);
_objSword.hide();
}
@@ -1708,7 +1712,7 @@ void Scene9900::strAction2::signal() {
_txtArray1[_txtArray1Index].setup(msg);
_txtArray1[_txtArray1Index]._moveRate = 20;
_txtArray1[_txtArray1Index]._moveDiff.y = 2;
- _txtArray1[_txtArray1Index].setPriority2(255);
+ _txtArray1[_txtArray1Index].fixPriority(255);
int frameWidth = _txtArray1[_txtArray1Index].getFrame().getBounds().width();
int frameHeight = _txtArray1[_txtArray1Index].getFrame().getBounds().height();
_txtArray1[_txtArray1Index].setPosition(Common::Point((320 - frameWidth) / 2, 200));
@@ -1725,7 +1729,7 @@ void Scene9900::strAction2::signal() {
_txtArray2[_txtArray1Index].setup(msg);
_txtArray2[_txtArray1Index]._moveRate = 20;
_txtArray2[_txtArray1Index]._moveDiff.y = 2;
- _txtArray2[_txtArray1Index].setPriority2(255);
+ _txtArray2[_txtArray1Index].fixPriority(255);
frameWidth = _txtArray2[_txtArray1Index].getFrame().getBounds().width();
_txtArray2[_txtArray1Index].setPosition(Common::Point((320 - frameWidth) / 2, 200 + frameHeight));
} else {
@@ -1834,7 +1838,7 @@ void Scene9900::signal() {
_object8.setVisage(2002);
_object8.setStrip(1);
_object8.setFrame(1);
- _object8.setPriority2(200);
+ _object8.fixPriority(200);
_object8.setPosition(Common::Point(64, 199));
_globals->_player.disableControl();
_sceneMode = 9908;
@@ -2021,7 +2025,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) {
_globals->_player.postInit();
_globals->_player.setVisage(1303);
_globals->_player.setStrip2(1);
- _globals->_player.setPriority2(250);
+ _globals->_player.fixPriority(250);
_globals->_player.animate(ANIM_MODE_2, 0);
_globals->_player.setPosition(Common::Point(194, 98), 0);
_globals->_player._numFrames = 20;
@@ -2030,13 +2034,13 @@ void Scene9999::postInit(SceneObjectList *OwnerList) {
_object2.postInit();
_object2.setVisage(1303);
_object2.setStrip2(2);
- _object2.setPriority2(2);
+ _object2.fixPriority(2);
_object2.setPosition(Common::Point(164, 149), 0);
_object3.postInit();
_object3.setVisage(1303);
_object3.setStrip2(2);
- _object3.setPriority2(2);
+ _object3.fixPriority(2);
_object3.setFrame(2);
_object3.setPosition(Common::Point(292, 149), 0);
_object3.setAction(&_action3);
diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp
index 3e3686e2d5..6a8db81adf 100644
--- a/engines/tsage/ringworld_scenes2.cpp
+++ b/engines/tsage/ringworld_scenes2.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "common/config-manager.h"
#include "tsage/ringworld_scenes2.h"
#include "tsage/scenes.h"
#include "tsage/tsage.h"
@@ -112,20 +113,22 @@ void Scene1000::Action3::signal() {
setDelay(240);
break;
case 5: {
- // WORKAROUND: At this point, the original used the presence of a file called 'Intro.txt'
- // to determine whether the introduction has been played the first time the game was started.
- // In ScummVM, we don't like creating any files that aren't explicitly savegames, so the
- // game startup will always show the Start Play / Introduction buttons, even when the game
- // is played for the first time
-
- // Prompt user for whether to start play or watch introduction
- _globals->_player.enableControl();
-
- if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) {
- _actionIndex = 20;
- _globals->_soundHandler.proc1(this);
- } else {
+ const char *SEEN_INTRO = "seen_intro";
+ if (!ConfMan.hasKey(SEEN_INTRO) || !ConfMan.getBool(SEEN_INTRO)) {
+ // First time being played, so show the introduction
+ ConfMan.setBool(SEEN_INTRO, true);
+ ConfMan.flushToDisk();
setDelay(1);
+ } else {
+ // Prompt user for whether to start play or watch introduction
+ _globals->_player.enableControl();
+
+ if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) {
+ _actionIndex = 20;
+ _globals->_soundHandler.proc1(this);
+ } else {
+ setDelay(1);
+ }
}
_globals->_player.disableControl();
@@ -434,7 +437,7 @@ void Scene1001::Action1::signal() {
scene->_object6.setStrip2(6);
scene->_object6.setFrame2(2);
scene->_object6._moveDiff = Common::Point(20, 20);
- scene->_object6.setPriority2(20);
+ scene->_object6.fixPriority(20);
scene->_object6.setPosition(Common::Point(scene->_object2._position.x - 6, scene->_object2._position.y + 7));
scene->_object6.animate(ANIM_MODE_5, NULL);
@@ -453,7 +456,7 @@ void Scene1001::Action1::signal() {
scene->_object7.setFrame2(1);
scene->_object7._moveDiff = Common::Point(20, 20);
scene->_object7.setPosition(Common::Point(scene->_object3._position.x - 28, scene->_object3._position.y - 11));
- scene->_object7.setPriority2(200);
+ scene->_object7.fixPriority(200);
scene->_object7.animate(ANIM_MODE_5, NULL);
Common::Point pt(scene->_object7._position.x - 70, scene->_object7._position.y - 70);
@@ -468,7 +471,7 @@ void Scene1001::Action1::signal() {
scene->_object5.setVisage(16);
scene->_object5.setPosition(Common::Point(306, 93));
scene->_object5._strip = 3;
- scene->_object5.setPriority2(200);
+ scene->_object5.fixPriority(200);
scene->_object5.animate(ANIM_MODE_2, NULL);
setDelay(30);
break;
@@ -633,7 +636,7 @@ void Scene1250::postInit(SceneObjectList *OwnerList) {
_object2.setVisage(1250);
_object2.setPosition(Common::Point(126, 69));
_object2.setStrip2(2);
- _object2.setPriority2(255);
+ _object2.fixPriority(255);
_object2._frame = 1;
_object2.setAction(&_action2);
@@ -766,7 +769,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(1401);
_globals->_player.animate(ANIM_MODE_2, 0);
_globals->_player.setStrip2(4);
- _globals->_player.setPriority2(4);
+ _globals->_player.fixPriority(4);
_globals->_player.disableControl();
_globals->_player._moveDiff = Common::Point(4, 2);
@@ -869,7 +872,7 @@ void Scene1500::Action2::signal() {
case 1: {
scene->_object2.postInit();
scene->_object2.setVisage(1502);
- scene->_object2.setPriority2(255);
+ scene->_object2.fixPriority(255);
scene->_object2.changeZoom(5);
scene->_object2._frame = 1;
scene->_object2._moveDiff = Common::Point(1, 1);
diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp
index 4ed2d98662..13dfc1a40b 100644
--- a/engines/tsage/ringworld_scenes3.cpp
+++ b/engines/tsage/ringworld_scenes3.cpp
@@ -405,7 +405,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) {
_object9.setStrip2(3);
_object9.setFrame(4);
_object9.setPosition(Common::Point(136, 86));
- _object9.setPriority2(190);
+ _object9.fixPriority(190);
_object9.hide();
_object10.postInit();
@@ -413,7 +413,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) {
_object10.setStrip2(5);
_object10.setFrame(4);
_object10.setPosition(Common::Point(202, 86));
- _object10.setPriority2(195);
+ _object10.fixPriority(195);
_object10.hide();
switch (_globals->_sceneManager._previousScene) {
@@ -519,7 +519,7 @@ void Scene2100::Action1::signal() {
setDelay(3);
break;
case 5:
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
scene->_area1.display();
scene->_area2.display();
scene->_area3.display();
@@ -578,7 +578,7 @@ void Scene2100::Action1::signal() {
}
break;
case 7:
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
scene->_soundHandler.startSound(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
@@ -684,6 +684,7 @@ void Scene2100::Action5::signal() {
}
void Scene2100::Action6::signal() {
+ // Seeker stands up and walks to the elevator
Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -699,14 +700,14 @@ void Scene2100::Action6::signal() {
Common::Point pt(130, 116);
NpcMover *mover = new NpcMover();
- scene->_object2.addMover(mover, &pt, NULL);
+ scene->_object2.addMover(mover, &pt, this);
break;
}
case 1: {
- scene->_object2.setPriority2(-1);
+ scene->_object2.fixPriority(-1);
Common::Point pt(153, 67);
NpcMover *mover = new NpcMover();
- scene->_object2.addMover(mover, &pt, NULL);
+ scene->_object2.addMover(mover, &pt, this);
break;
}
case 2:
@@ -835,7 +836,7 @@ void Scene2100::Action10::signal() {
scene->_object3.setVisage(2705);
scene->_object3.setStrip2(-1);
scene->_object3.changeZoom(-1);
- scene->_object3.setPriority2(-1);
+ scene->_object3.fixPriority(-1);
scene->_object3.setPosition(Common::Point(260, 156));
scene->_object3.setObjectWrapper(new SceneObjectWrapper());
scene->_object3.animate(ANIM_MODE_1, NULL);
@@ -852,30 +853,30 @@ void Scene2100::Action10::signal() {
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 6: {
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
Common::Point pt(144, 54);
NpcMover *mover = new NpcMover();
_globals->_player.addMover(mover, &pt, this);
break;
}
case 7: {
- scene->_object3.setPriority2(2);
+ scene->_object3.fixPriority(2);
Common::Point pt1(163, 55);
NpcMover *mover1 = new NpcMover();
scene->_object3.addMover(mover1, &pt1, NULL);
- scene->_object2.setPriority2(2);
+ scene->_object2.fixPriority(2);
Common::Point pt2(158, 55);
NpcMover *mover2 = new NpcMover();
scene->_object2.addMover(mover2, &pt2, this);
break;
}
case 8:
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setStrip(1);
- scene->_object3.setPriority2(1);
+ scene->_object3.fixPriority(1);
scene->_object3.setStrip(2);
- scene->_object2.setPriority2(2);
+ scene->_object2.fixPriority(2);
scene->_object2.setStrip(3);
setDelay(45);
@@ -893,6 +894,7 @@ void Scene2100::Action10::signal() {
}
void Scene2100::Action11::signal() {
+ // Miranda stands up and walks to the elevator
Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -911,7 +913,7 @@ void Scene2100::Action11::signal() {
scene->_object3.setVisage(2705);
scene->_object3.setStrip2(-1);
scene->_object3.changeZoom(-1);
- scene->_object3.setPriority2(-1);
+ scene->_object3.fixPriority(-1);
scene->_object3.setPosition(Common::Point(260, 156));
scene->_object3.setObjectWrapper(new SceneObjectWrapper());
scene->_object3.animate(ANIM_MODE_1, NULL);
@@ -928,12 +930,12 @@ void Scene2100::Action11::signal() {
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 4: {
- scene->_object3.setPriority2(1);
+ scene->_object3.fixPriority(1);
Common::Point pt1(163, 55);
NpcMover *mover1 = new NpcMover();
scene->_object3.addMover(mover1, &pt1, NULL);
- scene->_object2.setPriority2(1);
+ scene->_object2.fixPriority(1);
Common::Point pt2(158, 55);
NpcMover *mover2 = new NpcMover();
scene->_object2.addMover(mover2, &pt2, this);
@@ -987,12 +989,12 @@ void Scene2100::Action12::signal() {
scene->_soundHandler.startSound(162);
scene->_object1.animate(ANIM_MODE_6, NULL);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
Common::Point pt1(277, 84);
PlayerMover *mover1 = new PlayerMover();
_globals->_player.addMover(mover1, &pt1, this);
- scene->_object2.setPriority2(-1);
+ scene->_object2.fixPriority(-1);
Common::Point pt2(255, 76);
PlayerMover *mover2 = new PlayerMover();
scene->_object2.addMover(mover2, &pt2, this);
@@ -1020,6 +1022,8 @@ void Scene2100::Action12::signal() {
case 10:
if (_globals->getFlag(74))
setDelay(1);
+ else
+ setAction(&scene->_sequenceManager, this, 2101, &_globals->_player, NULL);
break;
case 11:
scene->_stripManager.start(2170, this);
@@ -1050,7 +1054,7 @@ void Scene2100::Action13::signal() {
setDelay(6);
break;
case 1: {
- scene->_object2.setPriority2(113);
+ scene->_object2.fixPriority(113);
Common::Point pt(178, 116);
PlayerMover *mover = new PlayerMover();
scene->_object2.addMover(mover, &pt, this);
@@ -1123,7 +1127,7 @@ void Scene2100::Action14::signal() {
scene->_object3.setVisage(2705);
scene->_object3.setStrip2(-1);
scene->_object3.changeZoom(-1);
- scene->_object3.setPriority2(-1);
+ scene->_object3.fixPriority(-1);
scene->_object3.setPosition(Common::Point(260, 156));
scene->_object3.setObjectWrapper(new SceneObjectWrapper());
scene->_object3.animate(ANIM_MODE_1, NULL);
@@ -1147,7 +1151,7 @@ void Scene2100::Action14::signal() {
scene->_object3.setStrip(2);
setDelay(30);
case 13:
- scene->_object3.setPriority2(1);
+ scene->_object3.fixPriority(1);
scene->_soundHandler.startSound(162);
scene->_object1.animate(ANIM_MODE_6, this);
break;
@@ -1174,14 +1178,14 @@ void Scene2100::Action15::signal() {
scene->_object3.animate(ANIM_MODE_1, NULL);
scene->_object3.setObjectWrapper(new SceneObjectWrapper());
scene->_object3.setPosition(Common::Point(157, 56));
- scene->_object3.setPriority2(1);
+ scene->_object3.fixPriority(1);
scene->_object3.changeZoom(-1);
scene->_soundHandler.startSound(162);
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 2: {
- scene->_object3.setPriority2(-1);
+ scene->_object3.fixPriority(-1);
Common::Point pt(177, 68);
NpcMover *mover = new NpcMover();
scene->_object3.addMover(mover, &pt, this);
@@ -1203,7 +1207,7 @@ void Scene2100::Action15::signal() {
break;
}
case 5: {
- scene->_object3.setPriority2(156);
+ scene->_object3.fixPriority(156);
Common::Point pt(260, 156);
NpcMover *mover = new NpcMover();
@@ -1258,7 +1262,7 @@ void Scene2100::Action16::signal() {
break;
}
case 7:
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setStrip(3);
setDelay(45);
break;
@@ -1342,6 +1346,7 @@ void Scene2100::Hotspot2::doAction(int action) {
}
void Scene2100::Hotspot3::doAction(int action) {
+ // Computer, on the left
Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene;
switch (action) {
@@ -1442,6 +1447,7 @@ void Scene2100::Hotspot14::doAction(int action) {
}
void Scene2100::Object1::doAction(int action) {
+ // Elevator
Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene;
switch (action) {
@@ -1555,7 +1561,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_object1.setVisage(2100);
_object1.animate(ANIM_MODE_NONE, NULL);
_object1.setPosition(Common::Point(157, 57));
- _object1.setPriority(5);
+ _object1.fixPriority(5);
_hotspot3.postInit();
_hotspot3.setVisage(2101);
@@ -1563,7 +1569,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_hotspot3.animate(ANIM_MODE_2, NULL);
_hotspot3.setPosition(Common::Point(53, 44));
_hotspot3.changeZoom(100);
- _hotspot3.setPriority2(1);
+ _hotspot3.fixPriority(1);
_hotspot4.postInit();
_hotspot4.setVisage(2101);
@@ -1572,7 +1578,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_hotspot4.animate(ANIM_MODE_8, 0, NULL);
_hotspot4.setPosition(Common::Point(274, 52));
_hotspot4.changeZoom(100);
- _hotspot4.setPriority2(1);
+ _hotspot4.fixPriority(1);
_hotspot5.postInit();
_hotspot5.setVisage(2101);
@@ -1581,13 +1587,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_hotspot5.animate(ANIM_MODE_8, 0, NULL);
_hotspot5.setPosition(Common::Point(219, 141));
_hotspot5.changeZoom(100);
- _hotspot5.setPriority2(160);
+ _hotspot5.fixPriority(160);
_hotspot6.postInit();
_hotspot6.setVisage(2101);
_hotspot6._frame = 1;
_hotspot6._strip = 5;
- _hotspot6.setPriority2(175);
+ _hotspot6.fixPriority(175);
_hotspot6.animate(ANIM_MODE_8, 0, NULL);
_hotspot6.setPosition(Common::Point(97, 142));
_hotspot6.changeZoom(100);
@@ -1599,7 +1605,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_hotspot7.animate(ANIM_MODE_NONE, NULL);
_hotspot7.setPosition(Common::Point(133, 46));
_hotspot7.changeZoom(100);
- _hotspot7.setPriority2(1);
+ _hotspot7.fixPriority(1);
_hotspot8.postInit();
_hotspot8.setVisage(2101);
@@ -1608,16 +1614,16 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_hotspot8.animate(ANIM_MODE_8, 0, NULL);
_hotspot8.setPosition(Common::Point(20, 45));
_hotspot8.changeZoom(100);
- _hotspot8.setPriority2(1);
+ _hotspot8.fixPriority(1);
_hotspot2.postInit();
_hotspot2.setVisage(2101);
_hotspot2._frame = 1;
- _hotspot2._strip = 7;
+ _hotspot2._strip = 8;
_hotspot2.animate(ANIM_MODE_8, 0, NULL);
_hotspot2.setPosition(Common::Point(88, 41));
_hotspot2.changeZoom(100);
- _hotspot2.setPriority2(1);
+ _hotspot2.fixPriority(1);
_hotspot11.setBounds(Rect(139, 74, 173, 96));
_hotspot10.setBounds(Rect(71, 100, 91, 135));
@@ -1633,7 +1639,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_object3.setPosition(Common::Point(246, 156));
_object3.animate(ANIM_MODE_NONE, NULL);
_object3.changeZoom(100);
- _object3.setPriority2(156);
+ _object3.fixPriority(156);
_object3.setVisage(2107);
_object3.setStrip(1);
_object3.setAction(&_action2);
@@ -1647,7 +1653,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_object2.setPosition(Common::Point(150, 100));
_object2.animate(ANIM_MODE_NONE, NULL);
_object2.changeZoom(100);
- _object2.setPriority2(113);
+ _object2.fixPriority(113);
_object2.setAction(&_action3);
_globals->_sceneItems.push_back(&_object2);
}
@@ -1666,7 +1672,14 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_area4._pt = Common::Point(237, 77);
_globals->_player.postInit();
- _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0);
+ if (_globals->getFlag(13)) {
+ _globals->_player.setVisage(2170);
+ _globals->_player._moveDiff.y = 1;
+ } else {
+ _globals->_player.setVisage(0);
+ _globals->_player._moveDiff.y = 3;
+ }
+
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player._moveDiff.x = 4;
@@ -1678,13 +1691,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
case 2120:
_globals->_soundHandler.startSound(160);
_globals->_soundHandler.proc5(true);
- _object1.setPriority2(-1);
- _globals->_player.setPriority2(-1);
+ _object1.fixPriority(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.setPosition(Common::Point(80, 66));
_globals->_player.enableControl();
break;
case 2150:
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setPosition(Common::Point(157, 56));
_sceneMode = 2104;
setAction(&_sequenceManager, this, 2104, &_globals->_player, &_object1, NULL);
@@ -1693,13 +1706,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
if (_globals->_sceneObjects->contains(&_object3))
_object3.remove();
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setPosition(Common::Point(144, 55));
_object2.setVisage(2806);
_object2.changeZoom(-1);
_object2.setPosition(Common::Point(158, 55));
- _object2.setPriority2(1);
+ _object2.fixPriority(1);
_object2.setAction(NULL);
_object2.setObjectWrapper(new SceneObjectWrapper());
_object2.animate(ANIM_MODE_1, NULL);
@@ -1711,7 +1724,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
if (_globals->_sceneObjects->contains(&_object3))
_object3.remove();
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setPosition(Common::Point(144, 55));
_object2.postInit();
@@ -1719,7 +1732,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_object2.setStrip(1);
_object2.changeZoom(-1);
_object2.setPosition(Common::Point(158, 55));
- _object2.setPriority2(1);
+ _object2.fixPriority(1);
_object2.setAction(NULL);
_object2.setObjectWrapper(new SceneObjectWrapper());
_object2.animate(ANIM_MODE_1, NULL);
@@ -1727,7 +1740,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
setAction(&_action12);
} else if (_globals->_stripNum == 6100) {
_globals->_player.setPosition(Common::Point(157, 56));
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_object4.postInit();
_object4.setVisage(2102);
@@ -1754,11 +1767,11 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player._angle = 225;
_globals->_player.setStrip(6);
_globals->_player.setFrame(1);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.setPosition(Common::Point(272, 127));
_object3.setPosition(Common::Point(246, 156));
- _object3.setPriority2(156);
+ _object3.fixPriority(156);
_sceneMode = 2105;
setAction(&_sequenceManager, this, 2105, &_object3, NULL);
break;
@@ -1770,7 +1783,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(65, 149));
- _globals->_player.setPriority2(152);
+ _globals->_player.fixPriority(152);
_globals->_player.setStrip(2);
_object4.postInit();
@@ -1790,11 +1803,11 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setStrip(3);
_globals->_player.setFrame(1);
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setPosition(Common::Point(157, 56));
_object3.setPosition(Common::Point(246, 156));
- _object3.setPriority2(156);
+ _object3.fixPriority(156);
setAction(&_action5);
break;
@@ -1804,7 +1817,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(65, 149));
- _globals->_player.setPriority2(152);
+ _globals->_player.fixPriority(152);
_globals->_player.setStrip(2);
_field1800 = 1;
@@ -1822,7 +1835,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_soundHandler.proc5(true);
if (RING_INVENTORY._stasisBox2._sceneNumber == 1) {
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setPosition(Common::Point(157, 56));
_object4.postInit();
@@ -1838,7 +1851,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(65, 149));
- _globals->_player.setPriority2(152);
+ _globals->_player.fixPriority(152);
_globals->_player.setStrip(2);
_field1800 = 1;
@@ -1852,7 +1865,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
if (_globals->_sceneObjects->contains(&_object2))
_object2.remove();
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
_globals->_player.setPosition(Common::Point(157, 56));
setAction(&_action8);
@@ -1864,7 +1877,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(65, 149));
- _globals->_player.setPriority2(152);
+ _globals->_player.fixPriority(152);
_globals->_player.setStrip(2);
_sceneMode = 2106;
@@ -1877,7 +1890,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(2104);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(65, 149));
- _globals->_player.setPriority2(152);
+ _globals->_player.fixPriority(152);
_globals->_player.setStrip(2);
_object4.postInit();
@@ -2474,7 +2487,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) {
_hotspot7.animate(ANIM_MODE_8, NULL);
_hotspot7.setPosition(Common::Point(122, 62));
_hotspot7.changeZoom(100);
- _hotspot7.setPriority2(76);
+ _hotspot7.fixPriority(76);
_hotspot2.postInit();
_hotspot2.setVisage(2151);
@@ -2483,7 +2496,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) {
_hotspot2.animate(ANIM_MODE_NONE, NULL);
_hotspot2.setPosition(Common::Point(257, 67));
_hotspot2.changeZoom(100);
- _hotspot2.setPriority2(60);
+ _hotspot2.fixPriority(60);
_hotspot1.postInit();
_hotspot1.setVisage(2151);
@@ -2492,7 +2505,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) {
_hotspot1.animate(ANIM_MODE_NONE, NULL);
_hotspot1.setPosition(Common::Point(158, 99));
_hotspot1.changeZoom(100);
- _hotspot1.setPriority2(99);
+ _hotspot1.fixPriority(99);
_hotspot4.postInit();
_hotspot4.setVisage(2150);
@@ -2501,7 +2514,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) {
_hotspot4.animate(ANIM_MODE_NONE, NULL);
_hotspot4.setPosition(Common::Point(218, 200));
_hotspot4.changeZoom(100);
- _hotspot4.setPriority2(200);
+ _hotspot4.fixPriority(200);
_hotspot10.postInit();
_hotspot10.setVisage(2152);
@@ -2515,7 +2528,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0);
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.changeZoom(-1);
_globals->_player._moveDiff.y = 3;
@@ -2907,7 +2920,7 @@ void Scene2200::postInit(SceneObjectList *OwnerList) {
_hotspot8.setVisage(2840);
_hotspot8.setStrip(2);
_hotspot8.setPosition(Common::Point(96, 184));
- _hotspot8.setPriority2(236);
+ _hotspot8.fixPriority(236);
_globals->_player.postInit();
_globals->_player.setVisage(2640);
@@ -2930,19 +2943,19 @@ void Scene2200::postInit(SceneObjectList *OwnerList) {
_hotspot1.postInit();
_hotspot1.setVisage(2202);
_hotspot1.setPosition(Common::Point(175, 173));
- _hotspot1.setPriority2(99);
+ _hotspot1.fixPriority(99);
_hotspot3.postInit();
_hotspot3.setVisage(2202);
_hotspot3._strip = 2;
_hotspot3.setPosition(Common::Point(152, 76));
- _hotspot3.setPriority2(100);
+ _hotspot3.fixPriority(100);
_hotspot4.postInit();
_hotspot4.setVisage(2202);
_hotspot4._strip = 3;
_hotspot4.setPosition(Common::Point(115, 76));
- _hotspot4.setPriority2(200);
+ _hotspot4.fixPriority(200);
setAction(&_action1);
break;
@@ -2959,7 +2972,7 @@ void Scene2200::postInit(SceneObjectList *OwnerList) {
_hotspot4.setVisage(2215);
_hotspot4._strip = 2;
_hotspot4.setPosition(Common::Point(120, 78));
- _hotspot4.setPriority2(255);
+ _hotspot4.fixPriority(255);
_globals->_sceneItems.push_back(&_hotspot4);
_soundHandler1.startSound(101);
@@ -3197,7 +3210,7 @@ void Scene2230::Action2::signal() {
case 2:
_globals->_player.setVisage(2235);
_globals->_player.setStrip2(1);
- _globals->_player.setPriority2(100);
+ _globals->_player.fixPriority(100);
_globals->_player._frame = 1;
_globals->_player.setPosition(Common::Point(200, 68));
_globals->_player.animate(ANIM_MODE_5, this);
@@ -3241,7 +3254,7 @@ void Scene2230::Action3::signal() {
_globals->_player.setVisage(0);
_globals->_player.setStrip2(-1);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.setPosition(Common::Point(164, 96));
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player._canWalk = true;
@@ -3284,7 +3297,7 @@ void Scene2230::Action5::signal() {
break;
}
case 2:
- _globals->_player.setPriority2(1430);
+ _globals->_player.fixPriority(1430);
_globals->_player.setVisage(2232);
_globals->_player._strip = 1;
_globals->_player._frame = 1;
@@ -3306,7 +3319,7 @@ void Scene2230::Action6::signal() {
case 0:
_globals->_player._strip = 2;
_globals->_player._frame = 1;
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 1:
@@ -3359,7 +3372,7 @@ void Scene2230::Action7::signal() {
scene->_hotspot2.setVisage(2231);
scene->_hotspot2._strip = 3;
scene->_hotspot2.setPosition(Common::Point(166, 116));
- scene->_hotspot2.setPriority2(131);
+ scene->_hotspot2.fixPriority(131);
scene->_hotspot2.animate(ANIM_MODE_5, this);
scene->_hotspot8._frame = 2;
@@ -3425,7 +3438,7 @@ void Scene2230::Action8::signal() {
scene->_hotspot2._strip = 3;
scene->_hotspot2._frame = scene->_hotspot2.getFrameCount();
scene->_hotspot2.setPosition(Common::Point(166, 116));
- scene->_hotspot2.setPriority2(131);
+ scene->_hotspot2.fixPriority(131);
scene->_hotspot2.animate(ANIM_MODE_6, this);
break;
case 4: {
@@ -3688,7 +3701,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) {
_hotspot8.animate(ANIM_MODE_NONE, 0);
_hotspot8.setPosition(Common::Point(164, 133));
_hotspot8.changeZoom(100);
- _hotspot8.setPriority2(129);
+ _hotspot8.fixPriority(129);
_rect1 = Rect(59, 64, 89, 74);
@@ -3766,7 +3779,7 @@ void Scene2280::Action1::signal() {
setDelay(10);
break;
case 4:
- _globals->_player.setPriority2(1);
+ _globals->_player.fixPriority(1);
scene->_soundHandler.startSound(162);
scene->_hotspot16.animate(ANIM_MODE_6, this);
break;
@@ -3849,7 +3862,7 @@ void Scene2280::Action3::signal() {
scene->_hotspot12._strip = 2;
scene->_hotspot12._frame = 3;
scene->_hotspot12.setPosition(Common::Point(88, 76));
- scene->_hotspot12.setPriority2(1);
+ scene->_hotspot12.fixPriority(1);
_globals->_player.animate(ANIM_MODE_6, this);
break;
@@ -3867,7 +3880,7 @@ void Scene2280::Action3::signal() {
scene->_hotspot8.animate(ANIM_MODE_NONE, NULL);
scene->_hotspot8.setPosition(Common::Point(79, 108));
scene->_hotspot8.changeZoom(100);
- scene->_hotspot8.setPriority2(1);
+ scene->_hotspot8.fixPriority(1);
scene->_hotspot10.postInit();
scene->_hotspot10.setVisage(2280);
@@ -3876,7 +3889,7 @@ void Scene2280::Action3::signal() {
scene->_hotspot10.animate(ANIM_MODE_NONE, NULL);
scene->_hotspot10.setPosition(Common::Point(79, 104));
scene->_hotspot10.changeZoom(100);
- scene->_hotspot10.setPriority2(1);
+ scene->_hotspot10.fixPriority(1);
_globals->clearFlag(13);
@@ -3939,7 +3952,7 @@ void Scene2280::Action4::signal() {
scene->_hotspot17.animate(ANIM_MODE_NONE, NULL);
scene->_hotspot17.setPosition(Common::Point(162, 39));
scene->_hotspot17.changeZoom(100);
- scene->_hotspot17.setPriority2(1);
+ scene->_hotspot17.fixPriority(1);
RING_INVENTORY._medkit._sceneNumber = 2280;
_globals->_sceneItems.push_front(&scene->_hotspot17);
@@ -3952,7 +3965,7 @@ void Scene2280::Action4::signal() {
scene->_hotspot18.animate(ANIM_MODE_NONE, NULL);
scene->_hotspot18.setPosition(Common::Point(152, 43));
scene->_hotspot18.changeZoom(100);
- scene->_hotspot18.setPriority2(1);
+ scene->_hotspot18.fixPriority(1);
RING_INVENTORY._scanner._sceneNumber = 2280;
_globals->_sceneItems.push_front(&scene->_hotspot18);
@@ -4221,14 +4234,14 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
_hotspot16.postInit();
_hotspot16.setVisage(2281);
_hotspot16.setPosition(Common::Point(208, 90));
- _hotspot16.setPriority2(80);
+ _hotspot16.fixPriority(80);
if (RING_INVENTORY._medkit._sceneNumber == 2280) {
_hotspot17.postInit();
_hotspot17.setVisage(2161);
_hotspot17._strip = 2;
_hotspot17.setPosition(Common::Point(162, 39));
- _hotspot17.setPriority2(1);
+ _hotspot17.fixPriority(1);
_globals->_sceneItems.push_back(&_hotspot17);
}
@@ -4239,7 +4252,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
_hotspot18._strip = 2;
_hotspot18._frame = 2;
_hotspot17.setPosition(Common::Point(152, 43));
- _hotspot17.setPriority2(1);
+ _hotspot17.fixPriority(1);
_globals->_sceneItems.push_back(&_hotspot17);
}
@@ -4249,21 +4262,21 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
_hotspot8.setVisage(2280);
_hotspot8._strip = 2;
_hotspot8.setPosition(Common::Point(79, 108));
- _hotspot8.setPriority2(1);
+ _hotspot8.fixPriority(1);
_hotspot10.postInit();
_hotspot10.setVisage(2280);
_hotspot10._strip = 2;
_hotspot10._frame = 2;
_hotspot10.setPosition(Common::Point(79, 104));
- _hotspot10.setPriority2(2);
+ _hotspot10.fixPriority(2);
_hotspot12.postInit();
_hotspot12.setVisage(2280);
_hotspot12._strip = 2;
_hotspot12._frame = 3;
_hotspot12.setPosition(Common::Point(88, 76));
- _hotspot12.setPriority2(1);
+ _hotspot12.fixPriority(1);
_globals->_sceneItems.addItems(&_hotspot8, &_hotspot10, &_hotspot12, NULL);
}
@@ -4273,19 +4286,19 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
_hotspot9.postInit();
_hotspot9.setVisage(2280);
_hotspot9.setPosition(Common::Point(104, 96));
- _hotspot9.setPriority2(1);
+ _hotspot9.fixPriority(1);
_hotspot11.postInit();
_hotspot11.setVisage(2280);
_hotspot11._frame = 2;
_hotspot11.setPosition(Common::Point(130, 79));
- _hotspot11.setPriority2(1);
+ _hotspot11.fixPriority(1);
_hotspot13.postInit();
_hotspot13.setVisage(2280);
_hotspot13._frame = 3;
_hotspot13.setPosition(Common::Point(113, 63));
- _hotspot13.setPriority2(1);
+ _hotspot13.fixPriority(1);
_hotspot1.setBounds(Rect(225, 70, 234, 80));
_hotspot2.setBounds(Rect(44, 78, 56, 105));
@@ -4310,7 +4323,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
_globals->_player.enableControl();
} else {
_globals->setFlag(109);
- _globals->_player.setPriority2(76);
+ _globals->_player.fixPriority(76);
_globals->_player.disableControl();
_sceneMode = 2281;
@@ -4329,7 +4342,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) {
void Scene2280::signal() {
if (_sceneMode == 2281) {
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.enableControl();
}
}
@@ -4454,8 +4467,8 @@ void Scene2300::Action1::signal() {
scene->_hotspot6._frame = 1;
scene->_hotspot5.animate(ANIM_MODE_5, NULL);
scene->_hotspot6.animate(ANIM_MODE_5, NULL);
- scene->_hotspot5.setPriority2(20);
- scene->_hotspot6.setPriority2(20);
+ scene->_hotspot5.fixPriority(20);
+ scene->_hotspot6.fixPriority(20);
_globals->_player.setVisage(2672);
_globals->_player._strip = 5;
@@ -4626,7 +4639,7 @@ void Scene2300::Action4::signal() {
scene->_hotspot9.setStrip2(2);
scene->_hotspot9.setFrame(3);
scene->_hotspot9.setPosition(Common::Point(273, 199));
- scene->_hotspot9.setPriority2(19);
+ scene->_hotspot9.fixPriority(19);
scene->_hotspot9.animate(ANIM_MODE_5, this);
scene->_soundHandler1.startSound(11);
break;
@@ -4727,7 +4740,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) {
_hotspot9.setStrip2(2);
_hotspot9._frame = _hotspot9.getFrameCount();
_hotspot9.setPosition(Common::Point(273, 199));
- _hotspot9.setPriority2(1);
+ _hotspot9.fixPriority(1);
_hotspot10.postInit();
_hotspot10.setVisage(2301);
@@ -4882,14 +4895,14 @@ void Scene2310::signal() {
_sceneText._color1 = 35;
_sceneText._fontNumber = 2;
_sceneText.setup(msg);
- _sceneText.setPriority2(255);
+ _sceneText.fixPriority(255);
_sceneText.setPosition(Common::Point(30, 20));
break;
}
case 1: {
Common::String msg = _resourceManager->getMessage(2300, 23);
_sceneText.setup(msg);
- _sceneText.setPriority2(255);
+ _sceneText.fixPriority(255);
_sceneText.setPosition(Common::Point(30, 170));
_globals->_sceneObjects->draw();
@@ -5033,7 +5046,7 @@ void Scene2320::Action2::signal() {
switch (_actionIndex++) {
case 0: {
scene->_soundHandler.startSound(253);
- scene->_hotspot13.setPriority2(99);
+ scene->_hotspot13.fixPriority(99);
Common::Point pt(scene->_hotspot13._position.x, 200);
NpcMover *mover = new NpcMover();
@@ -5068,7 +5081,7 @@ void Scene2320::Action3::signal() {
break;
}
case 3:
- _globals->_player.setPriority2(scene->_hotspot6._priority - 1);
+ _globals->_player.fixPriority(scene->_hotspot6._priority - 1);
_globals->_player._strip = 3;
setDelay(10);
break;
@@ -5122,7 +5135,7 @@ void Scene2320::Action3::signal() {
break;
case 5: {
if (_state == 2320)
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
else
_globals->_sceneManager.changeScene(_state);
@@ -5165,13 +5178,13 @@ void Scene2320::Action4::signal() {
break;
case 3:
_globals->_player.animate(ANIM_MODE_6, NULL);
- scene->setAction(&scene->_action2);
+ setAction(&scene->_action2, this);
break;
case 4: {
scene->_hotspot16.postInit();
scene->_hotspot16.setVisage(2331);
scene->_hotspot16.setStrip(3);
- scene->_hotspot16.setPriority2(149);
+ scene->_hotspot16.fixPriority(149);
scene->_hotspot16.setPosition(Common::Point(320, 202));
scene->_hotspot16.show();
@@ -5181,14 +5194,14 @@ void Scene2320::Action4::signal() {
break;
}
case 5: {
- scene->_hotspot16.setPriority2(200);
+ scene->_hotspot16.fixPriority(200);
Common::Point pt(320, 180);
NpcMover *mover = new NpcMover();
scene->_hotspot16.addMover(mover, &pt, this);
break;
}
case 6: {
- scene->_hotspot16.setPriority2(-1);
+ scene->_hotspot16.fixPriority(-1);
_globals->_player.setVisage(0);
_globals->_player.animate(ANIM_MODE_1, NULL);
@@ -5262,7 +5275,7 @@ void Scene2320::Action4::signal() {
}
case 17: {
_globals->_player.animate(ANIM_MODE_6, NULL);
- scene->_hotspot16.setPriority2(160);
+ scene->_hotspot16.fixPriority(160);
Common::Point pt(320, 121);
NpcMover *mover = new NpcMover();
@@ -5290,7 +5303,7 @@ void Scene2320::Action4::signal() {
_globals->_player.setVisage(0);
_globals->_player.animate(ANIM_MODE_1, NULL);
- scene->_hotspot13.setPriority2(1);
+ scene->_hotspot13.fixPriority(1);
remove();
break;
}
@@ -5320,7 +5333,7 @@ void Scene2320::Action5::signal() {
_globals->_player.setVisage(2347);
_globals->_player.setStrip(1);
_globals->_player.setFrame(1);
- _globals->_player.setPriority2(137);
+ _globals->_player.fixPriority(137);
_globals->_player.animate(ANIM_MODE_5, this);
break;
case 5:
@@ -5376,7 +5389,7 @@ void Scene2320::Action6::signal() {
case 3:
_globals->_player.setVisage(0);
_globals->_player.setStrip(3);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.animate(ANIM_MODE_1, NULL);
@@ -5432,12 +5445,12 @@ void Scene2320::Action7::signal() {
scene->_hotspot6.animate(ANIM_MODE_5, this);
break;
case 2:
- scene->_hotspot10.setPriority2(-1);
+ scene->_hotspot10.fixPriority(-1);
ADD_MOVER_NULL(scene->_hotspot10, 321, 94);
- scene->_hotspot11.setPriority2(-1);
+ scene->_hotspot11.fixPriority(-1);
ADD_MOVER_NULL(scene->_hotspot11, 346, 85);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
ADD_MOVER(_globals->_player, 297, 89);
break;
case 3:
@@ -5454,10 +5467,6 @@ void Scene2320::Action7::signal() {
case 6:
ADD_MOVER_NULL(scene->_hotspot10, 491, 160);
ADD_MOVER(_globals->_player, 391, 88);
-
- _globals->_player.setStrip(1);
- _globals->_player.setFrame(1);
- _globals->_player.animate(ANIM_MODE_6, this);
break;
case 7:
ADD_PLAYER_MOVER(462, 182);
@@ -5689,7 +5698,7 @@ void Scene2320::Hotspot14::doAction(int action) {
scene->_hotspot9.setVisage(2345);
scene->_hotspot9._strip = 6;
scene->_hotspot9.setPosition(Common::Point(536, 103));
- scene->_hotspot9.setPriority2(200);
+ scene->_hotspot9.fixPriority(200);
scene->_hotspot9.hide();
scene->_hotspot16.postInit();
@@ -5779,7 +5788,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_hotspot13.postInit();
_hotspot13.setVisage(2323);
_hotspot13.setPosition(Common::Point(319, 157));
- _hotspot13.setPriority2(1);
+ _hotspot13.fixPriority(1);
_hotspot12.postInit();
_hotspot12.setVisage(2321);
@@ -5793,7 +5802,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_hotspot8.setStrip(5);
_hotspot8.setFrame(8);
_hotspot8.setPosition(Common::Point(541, 103));
- _hotspot8.setPriority2(201);
+ _hotspot8.fixPriority(201);
_globals->_sceneItems.push_back(&_hotspot8);
}
@@ -5825,7 +5834,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.setPosition(Common::Point(320, 79));
- _globals->_player.setPriority2(10);
+ _globals->_player.fixPriority(10);
_globals->_player.changeZoom(-1);
_globals->_player._moveDiff.y = 3;
_globals->_player.disableControl();
@@ -5860,7 +5869,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_globals->_soundHandler.startSound(160);
_globals->_soundHandler.proc5(true);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.setPosition(Common::Point(389, 72));
_globals->_player.enableControl();
break;
@@ -5886,7 +5895,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(2347);
_globals->_player.setStrip(2);
_globals->_player.setFrame(5);
- _globals->_player.setPriority2(137);
+ _globals->_player.fixPriority(137);
_globals->_player.setPosition(Common::Point(165, 132));
setAction(&_action6);
@@ -5912,7 +5921,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_globals->_player.setStrip(2);
_globals->_player.setFrame(_globals->_player.getFrameCount());
_globals->_player.setPosition(Common::Point(303, 176));
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.disableControl();
_hotspot13.setPosition(Common::Point(319, 199));
@@ -5920,7 +5929,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_hotspot16.postInit();
_hotspot16.setVisage(2331);
_hotspot16._strip = 3;
- _hotspot16.setPriority2(160);
+ _hotspot16.fixPriority(160);
_hotspot16.setPosition(Common::Point(320, 202));
_hotspot16.hide();
@@ -5937,7 +5946,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_hotspot11.postInit();
_hotspot11.setVisage(2705);
_hotspot11._strip = 2;
- _hotspot11.setPriority2(10);
+ _hotspot11.fixPriority(10);
_hotspot11.setPosition(Common::Point(322, 80));
_hotspot11.setObjectWrapper(new SceneObjectWrapper());
_hotspot11.animate(ANIM_MODE_1, NULL);
@@ -5946,7 +5955,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) {
_hotspot10.setVisage(2806);
_hotspot10.setObjectWrapper(new SceneObjectWrapper());
_hotspot10.changeZoom(-1);
- _hotspot10.setPriority2(10);
+ _hotspot10.fixPriority(10);
_hotspot10.setPosition(Common::Point(318, 89));
_hotspot10._strip = 3;
_hotspot10.animate(ANIM_MODE_1, NULL);
diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp
index 910a35e492..73d2df5989 100644
--- a/engines/tsage/ringworld_scenes5.cpp
+++ b/engines/tsage/ringworld_scenes5.cpp
@@ -315,7 +315,7 @@ void Scene4000::Action7::signal() {
_globals->_player.setVisage(4008);
_globals->_player.setStrip(4);
_globals->_player.setFrame(1);
- _globals->_player.setPriority2(16);
+ _globals->_player.fixPriority(16);
_globals->_player.setPosition(Common::Point(260, 55));
_globals->_player.animate(ANIM_MODE_5, this);
break;
@@ -700,7 +700,6 @@ void Scene4000::Hotspot::doAction(int action) {
if (_globals->_sceneObjects->contains(&scene->_hotspot8)) {
scene->_hotspot8.setAction(NULL);
-// ADD_MOVER_NULL(scene->_hotspot8, 118, 145);
Common::Point pt(118, 145);
NpcMover *mover = new NpcMover();
scene->_hotspot18.addMover(mover, &pt, NULL);
@@ -824,7 +823,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_smoke1.postInit();
_smoke1.setVisage(4000);
- _smoke1.setPriority2(1);
+ _smoke1.fixPriority(1);
_smoke1.setFrame(2);
_smoke1.setPosition(Common::Point(242, 59));
_smoke1.animate(ANIM_MODE_2, NULL);
@@ -832,7 +831,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_smoke2.postInit();
_smoke2.setVisage(4000);
_smoke2.setStrip(2);
- _smoke2.setPriority2(1);
+ _smoke2.fixPriority(1);
_smoke2.setFrame(2);
_smoke2.setPosition(Common::Point(299, 59));
_smoke2.animate(ANIM_MODE_2, NULL);
@@ -852,7 +851,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_theTech.setVisage(4000);
_theTech.setStrip(3);
_theTech.setFrame(3);
- _theTech.setPriority2(200);
+ _theTech.fixPriority(200);
_theTech.setPosition(Common::Point(281, 176));
if (_globals->getFlag(34)) {
@@ -862,7 +861,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_forceField.setVisage(4000);
_forceField.setStrip(4);
_forceField.setPosition(Common::Point(312, 174));
- _forceField.setPriority2(200);
+ _forceField.fixPriority(200);
_forceField.animate(ANIM_MODE_8, 0, NULL);
_globals->_sceneItems.push_back(&_forceField);
@@ -1036,7 +1035,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(4008);
_globals->_player.setStrip(4);
_globals->_player.setFrame(_globals->_player.getFrameCount());
- _globals->_player.setPriority2(16);
+ _globals->_player.fixPriority(16);
_globals->_player.setPosition(Common::Point(260, 55));
_sceneMode = 4007;
@@ -1096,7 +1095,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_forceField.setVisage(4000);
_forceField.setStrip(4);
_forceField.setPosition(Common::Point(312, 174));
- _forceField.setPriority2(200);
+ _forceField.fixPriority(200);
_forceField.animate(ANIM_MODE_8, 0, NULL);
} else {
if (!_globals->getFlag(37)) {
@@ -1127,7 +1126,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) {
_rope.postInit();
_rope.setVisage(4000);
_rope.setStrip(7);
- _rope.setPriority2(1);
+ _rope.fixPriority(1);
_rope.setPosition(Common::Point(268, 44));
}
@@ -1195,19 +1194,19 @@ void Scene4000::dispatch() {
Scene::dispatch();
if ((_globals->_player.getRegionIndex() == 10) || (_globals->_player.getRegionIndex() == 6))
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
if (_globals->_player.getRegionIndex() == 11)
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
if (_globals->_player.getRegionIndex() == 5)
- _globals->_player.setPriority2(94);
+ _globals->_player.fixPriority(94);
if (_globals->_sceneObjects->contains(&_hotspot5)) {
if ((_hotspot5.getRegionIndex() == 10) || (_hotspot5.getRegionIndex() == 6))
- _hotspot5.setPriority2(200);
+ _hotspot5.fixPriority(200);
if (_hotspot5.getRegionIndex() == 11)
- _hotspot5.setPriority2(-1);
+ _hotspot5.fixPriority(-1);
if (_hotspot5.getRegionIndex() == 5)
- _hotspot5.setPriority2(94);
+ _hotspot5.fixPriority(94);
}
if (_globals->_sceneObjects->contains(&_miranda)) {
@@ -1218,11 +1217,11 @@ void Scene4000::dispatch() {
}
if ((_miranda.getRegionIndex() == 10) || (_miranda.getRegionIndex() == 6))
- _miranda.setPriority2(200);
+ _miranda.fixPriority(200);
if (_miranda.getRegionIndex() == 11)
- _miranda.setPriority2(-1);
+ _miranda.fixPriority(-1);
if (_miranda.getRegionIndex() == 5)
- _miranda.setPriority2(94);
+ _miranda.fixPriority(94);
}
if (!_action) {
@@ -1531,6 +1530,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) {
_peg5.setFrame(5);
_peg5.hide();
+ // Hole N-W
_hole1.postInit();
_hole1.setVisage(4025);
_hole1.setStrip(1);
@@ -1540,6 +1540,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) {
_hole1._newPosition = Common::Point(123, 44);
_hole1._armStrip = 8;
+ // Hole N-E
_hole2.postInit();
_hole2.setVisage(4025);
_hole2.setStrip(1);
@@ -1549,6 +1550,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) {
_hole2._newPosition = Common::Point(166, 44);
_hole2._armStrip = 7;
+ // Hole Center
_hole3.postInit();
_hole3.setVisage(4025);
_hole3.setStrip(1);
@@ -1558,15 +1560,17 @@ void Scene4025::postInit(SceneObjectList *OwnerList) {
_hole3._newPosition = Common::Point(145, 60);
_hole3._armStrip = 6;
+ // Hole S-W
_hole4.postInit();
_hole4.setVisage(4025);
_hole4.setStrip(1);
- _hole4.setFrame2(6);
+ _hole4.setFrame2(9);
_hole4.setPosition(Common::Point(123, 87));
_hole4._pegPtr = NULL;
_hole4._newPosition = Common::Point(123, 80);
_hole4._armStrip = 5;
+ // Hole S-E
_hole5.postInit();
_hole5.setVisage(4025);
_hole5.setStrip(1);
@@ -1576,11 +1580,11 @@ void Scene4025::postInit(SceneObjectList *OwnerList) {
_hole5._newPosition = Common::Point(166, 80);
_hole5._armStrip = 4;
- _hole1.setPriority2(1);
- _hole2.setPriority2(1);
- _hole3.setPriority2(1);
- _hole4.setPriority2(1);
- _hole5.setPriority2(1);
+ _hole1.fixPriority(1);
+ _hole2.fixPriority(1);
+ _hole3.fixPriority(1);
+ _hole4.fixPriority(1);
+ _hole5.fixPriority(1);
_armHotspot.postInit();
_armHotspot.setVisage(4025);
@@ -1855,7 +1859,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_flame.setVisage(4045);
_flame.setPosition(Common::Point(47, 111));
_flame.animate(ANIM_MODE_2, NULL);
- _flame.setPriority2(156);
+ _flame.fixPriority(156);
_globals->_sceneItems.push_back(&_flame);
_globals->_player.postInit();
@@ -1870,7 +1874,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_olloFace.postInit();
_olloFace.setVisage(4051);
_olloFace.setStrip(4);
- _olloFace.setPriority2(152);
+ _olloFace.fixPriority(152);
if(_globals->_sceneManager._previousScene == 4050) {
_globals->_soundHandler.startSound(155);
@@ -1930,7 +1934,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) {
_hotspot4.postInit();
_hotspot4.setVisage(4051);
_hotspot4.setStrip(2);
- _hotspot4.setPriority2(152);
+ _hotspot4.fixPriority(152);
_hotspot4.setPosition(Common::Point(202, 80));
_olloFace.setPosition(Common::Point(192, 77));
@@ -2003,6 +2007,7 @@ void Scene4045::dispatch() {
*--------------------------------------------------------------------------*/
void Scene4050::Action1::signal() {
+ // "Map" on the wall
Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -2010,9 +2015,12 @@ void Scene4050::Action1::signal() {
_globals->_player.disableControl();
setDelay(3);
break;
- case 1:
- ADD_PLAYER_MOVER(204, 152);
+ case 1: {
+ Common::Point pt(204, 152);
+ PlayerMover *mover = new PlayerMover();
+ _globals->_player.addMover(mover, &pt, this);
break;
+ }
case 2:
_globals->_player.checkAngle(&scene->_hotspot17);
@@ -2020,7 +2028,8 @@ void Scene4050::Action1::signal() {
scene->_hotspot14.setVisage(4050);
scene->_hotspot14.setStrip(2);
scene->_hotspot14.setPosition(Common::Point(91, 154));
- scene->_hotspot14.setPriority2(200);
+ scene->_hotspot14.fixPriority(200);
+ setDelay(10);
break;
case 3:
_globals->_events.waitForPress();
@@ -2034,6 +2043,7 @@ void Scene4050::Action1::signal() {
}
void Scene4050::Action2::signal() {
+ // Climb down the rope
switch (_actionIndex++) {
case 0:
_globals->_player.disableControl();
@@ -2062,7 +2072,7 @@ void Scene4050::Action2::signal() {
_globals->_player.setVisage(4202);
_globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setPosition(Common::Point(210, 185));
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.enableControl();
remove();
break;
@@ -2070,12 +2080,13 @@ void Scene4050::Action2::signal() {
}
void Scene4050::Action3::signal() {
+ // Climb up the rope
switch (_actionIndex++) {
case 0:
ADD_PLAYER_MOVER(210, 185);
break;
case 1:
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
_globals->_player.setVisage(4052);
_globals->_player.setStrip(5);
_globals->_player.changeZoom(100);
@@ -2104,7 +2115,7 @@ void Scene4050::Action4::signal() {
case 0:
_globals->_player.disableControl();
ADD_MOVER(_globals->_player, 189, 135);
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
break;
case 1:
_globals->_player._moveDiff.y = 3;
@@ -2140,7 +2151,7 @@ void Scene4050::Action4::signal() {
_globals->_player.setStrip(2);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(216, 184));
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
break;
case 5:
scene->_hotspot16.setStrip2(4);
@@ -2169,7 +2180,7 @@ void Scene4050::Action4::signal() {
/*--------------------------------------------------------------------------*/
-void Scene4050::Hotspot14::doAction(int action) {
+void Scene4050::Hotspot15::doAction(int action) {
Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene;
switch (action) {
@@ -2243,7 +2254,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(4008);
_globals->_player.setPosition(Common::Point(206, 62));
_globals->_player.changeZoom(130);
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
_globals->_player.setStrip(2);
setAction(&_action2);
@@ -2286,7 +2297,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) {
_hotspot17.postInit();
_hotspot17.setVisage(4050);
_hotspot17.setPosition(Common::Point(209, 119));
- _hotspot17.setPriority2(2);
+ _hotspot17.fixPriority(2);
_hotspot1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
_hotspot2.setBounds(Rect(150, 25, 198, 125));
@@ -2361,7 +2372,7 @@ void Scene4100::Action2::signal() {
scene->_hotspot2.setVisage(4120);
scene->_hotspot2.animate(ANIM_MODE_1, NULL);
scene->_hotspot2.setStrip2(4);
- scene->_hotspot2.setPriority2(100);
+ scene->_hotspot2.fixPriority(100);
scene->_hotspot2.setPosition(Common::Point(214, 119));
setDelay(3);
@@ -2641,13 +2652,13 @@ void Scene4100::postInit(SceneObjectList *OwnerList) {
_hotspot1.postInit();
_hotspot1.setVisage(4102);
- _hotspot1.setPriority2(129);
+ _hotspot1.fixPriority(129);
_hotspot1.setPosition(Common::Point(171, 120));
_hotspot3.postInit();
_hotspot3.setVisage(4130);
_hotspot3.animate(ANIM_MODE_2, NULL);
- _hotspot3.setPriority2(200);
+ _hotspot3.fixPriority(200);
_hotspot3.setPosition(Common::Point(272, 110));
_hotspot4.postInit();
@@ -2960,7 +2971,7 @@ void Scene4150::Hotspot3::doAction(int action) {
/*--------------------------------------------------------------------------*/
Scene4150::Scene4150() :
- _hotspot1(0, CURSOR_LOOK, 4000, 17, CURSOR_USE, 4150, 21, CURSOR_TALK, 4150, 21,
+ _hotspot1(0, CURSOR_LOOK, 4150, 17, CURSOR_USE, 4150, 21, CURSOR_TALK, 4150, 21,
OBJECT_SCANNER, 4150, 22, OBJECT_STUNNER, 4150, 23, LIST_END),
_hotspot2(0, CURSOR_LOOK, 4150, 4, CURSOR_USE, 4150, 24, LIST_END),
_hotspot7(0, CURSOR_LOOK, 4150, 1, CURSOR_USE, 4150, 25, OBJECT_ROPE, 4150, 26, LIST_END),
@@ -2993,7 +3004,7 @@ void Scene4150::postInit(SceneObjectList *OwnerList) {
_hotspot2.postInit();
_hotspot2.setVisage(4171);
_hotspot2.animate(ANIM_MODE_2, NULL);
- _hotspot2.setPriority2(100);
+ _hotspot2.fixPriority(100);
_hotspot2.setPosition(Common::Point(76, 147));
_hotspot1.postInit();
@@ -3117,7 +3128,7 @@ void Scene4250::Action1::signal() {
break;
case 5:
ADD_PLAYER_MOVER(220, 175);
- scene->_hotspot1.setPriority2(105);
+ scene->_hotspot1.fixPriority(105);
ADD_PLAYER_MOVER_NULL(scene->_hotspot1, 197, 173);
break;
case 6:
@@ -3234,8 +3245,8 @@ void Scene4250::Action5::signal() {
setDelay(3);
break;
case 1:
- scene->_hotspot4.setPriority2(195);
- scene->_hotspot1.setPriority2(105);
+ scene->_hotspot4.fixPriority(195);
+ scene->_hotspot1.fixPriority(105);
ADD_MOVER_NULL(_globals->_player, 6, 185);
ADD_MOVER_NULL(scene->_hotspot4, 9, 190);
ADD_MOVER(scene->_hotspot1, 12, 180);
@@ -3246,7 +3257,7 @@ void Scene4250::Action5::signal() {
ADD_PLAYER_MOVER_NULL(scene->_hotspot4, 239, 195);
break;
case 3:
- scene->_hotspot4.setPriority2(-1);
+ scene->_hotspot4.fixPriority(-1);
scene->_hotspot1.setStrip(5);
scene->_hotspot4.setStrip(7);
_globals->_player.enableControl();
@@ -3528,7 +3539,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) {
_hotspot5.postInit();
_hotspot5.setVisage(4250);
_hotspot5.setPosition(Common::Point(268, 168));
- _hotspot5.setPriority2(1);
+ _hotspot5.fixPriority(1);
_hotspot4.postInit();
_hotspot4.setVisage(2701);
@@ -3552,7 +3563,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) {
_hotspot6.setStrip(4);
_hotspot6.setFrame(3);
_hotspot6.changeZoom(50);
- _hotspot6.setPriority2(70);
+ _hotspot6.fixPriority(70);
_hotspot6.setPosition(Common::Point(261, 175));
if (RING_INVENTORY._helmet._sceneNumber == 4250) {
@@ -3609,7 +3620,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) {
_hotspot2.postInit();
_hotspot2.setVisage(4251);
_hotspot2.setStrip2(1);
- _hotspot2.setPriority2(2);
+ _hotspot2.fixPriority(2);
_hotspot2.setFrame(1);
_hotspot2.setPosition(Common::Point(267, 172));
@@ -3671,7 +3682,7 @@ void Scene4250::dispatch() {
_globals->_player.changeZoom(70);
if (_globals->_player.getRegionIndex() == 15) {
_globals->_player.changeZoom(-1);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
}
if (_hotspot1.getRegionIndex() == 8)
@@ -3680,7 +3691,7 @@ void Scene4250::dispatch() {
_hotspot1.changeZoom(70);
if (_hotspot1.getRegionIndex() == 15) {
_hotspot1.changeZoom(-1);
- _hotspot1.setPriority2(-1);
+ _hotspot1.fixPriority(-1);
}
if (_hotspot4.getRegionIndex() == 8)
@@ -3689,7 +3700,7 @@ void Scene4250::dispatch() {
_hotspot4.changeZoom(70);
if (_hotspot4.getRegionIndex() == 15) {
_hotspot4.changeZoom(-1);
- _hotspot4.setPriority2(-1);
+ _hotspot4.fixPriority(-1);
}
Scene::dispatch();
@@ -3751,7 +3762,7 @@ void Scene4300::Action1::signal() {
setDelay(60);
break;
case 7:
- scene->_hotspot10.setPriority2(250);
+ scene->_hotspot10.fixPriority(250);
scene->_hotspot10.animate(ANIM_MODE_5, this);
break;
case 8:
@@ -4001,7 +4012,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) {
_hotspot7.postInit();
_hotspot7.setPosition(Common::Point(90, 128));
_hotspot7.setVisage(4303);
- _hotspot7.setPriority2(250);
+ _hotspot7.fixPriority(250);
_globals->_sceneItems.push_back(&_hotspot7);
_hotspot9.setup(120, 49, 174, 91, 4300, -1, -1);
@@ -4023,7 +4034,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) {
_hotspot17.postInit();
_hotspot17.setVisage(4300);
_hotspot17.setStrip(6);
- _hotspot17.setPriority2(1);
+ _hotspot17.fixPriority(1);
_hotspot17.setPosition(Common::Point(200, 69));
if (RING_INVENTORY._stasisBox2._sceneNumber == 4300)
@@ -4036,14 +4047,14 @@ void Scene4300::postInit(SceneObjectList *OwnerList) {
_hotspot10.postInit();
_hotspot10.setVisage(4302);
_hotspot10.setPosition(Common::Point(244, 179));
- _hotspot10.setPriority2(100);
+ _hotspot10.fixPriority(100);
_globals->_sceneItems.push_back(&_hotspot10);
_hotspot12.postInit();
_hotspot12.setVisage(4302);
_hotspot12.setStrip2(3);
_hotspot12.setPosition(Common::Point(231, 185));
- _hotspot12.setPriority2(251);
+ _hotspot12.fixPriority(251);
_hotspot12.hide();
_hotspot13.postInit();
@@ -4051,7 +4062,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) {
_hotspot13.setVisage(4302);
_hotspot13.setStrip2(2);
_hotspot13.setPosition(Common::Point(256, 168));
- _hotspot13.setPriority2(251);
+ _hotspot13.fixPriority(251);
_hotspot13._numFrames = 1;
_hotspot13.animate(ANIM_MODE_8, 0, NULL);
}
@@ -4060,7 +4071,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) {
_hotspot16.postInit();
_hotspot16.setVisage(4300);
_hotspot16.setPosition(Common::Point(169, 141));
- _hotspot16.setPriority2(1);
+ _hotspot16.fixPriority(1);
_hotspot16.setStrip(4);
_globals->_sceneItems.push_back(&_hotspot16);
}
@@ -4071,37 +4082,37 @@ void Scene4300::postInit(SceneObjectList *OwnerList) {
_hotspot1.postInit();
_hotspot1.setVisage(4301);
- _hotspot1.setPriority2(145);
+ _hotspot1.fixPriority(145);
_hotspot1.setPosition(Common::Point(160, 64));
_hotspot2.postInit();
_hotspot2.setVisage(4301);
_hotspot2.setStrip2(2);
- _hotspot2.setPriority2(140);
+ _hotspot2.fixPriority(140);
_hotspot2.setPosition(Common::Point(166, 90));
_hotspot3.postInit();
_hotspot3.setVisage(4301);
_hotspot3.setStrip2(3);
- _hotspot3.setPriority2(135);
+ _hotspot3.fixPriority(135);
_hotspot3.setPosition(Common::Point(173, 114));
_hotspot4.postInit();
_hotspot4.setVisage(4301);
_hotspot4.setStrip2(4);
- _hotspot4.setPriority2(130);
+ _hotspot4.fixPriority(130);
_hotspot4.setPosition(Common::Point(187, 141));
_hotspot5.postInit();
_hotspot5.setVisage(4301);
_hotspot5.setStrip2(5);
- _hotspot5.setPriority2(125);
+ _hotspot5.fixPriority(125);
_hotspot5.setPosition(Common::Point(201, 164));
_hotspot6.postInit();
_hotspot6.setVisage(4301);
_hotspot6.setStrip2(6);
- _hotspot6.setPriority2(120);
+ _hotspot6.fixPriority(120);
_hotspot6.setPosition(Common::Point(219, 186));
setAction(&_action1);
@@ -4218,14 +4229,14 @@ void Scene4301::Action1::signal() {
scene->_hotspot2.setStrip(2);
scene->_hotspot2.setFrame(1);
scene->_hotspot2.setPosition(Common::Point(30, 15));
- scene->_hotspot2.setPriority2(255);
+ scene->_hotspot2.fixPriority(255);
scene->_hotspot3.postInit();
scene->_hotspot3.setVisage(4303);
scene->_hotspot3.setStrip(2);
scene->_hotspot3.setFrame(2);
scene->_hotspot3.setPosition(Common::Point(48, 29));
- scene->_hotspot3.setPriority2(255);
+ scene->_hotspot3.fixPriority(255);
scene->_hotspot3.hide();
_field34E = 0;
@@ -4301,7 +4312,7 @@ void Scene4301::Action1::process(Event &event) {
_buttonList[_state].setStrip(buttonIndex + 3);
_buttonList[_state].setFrame(1);
_buttonList[_state].setPosition(Common::Point((_state % 3) * 25 + 55, (_state / 3) * 25 + 121));
- _buttonList[_state].setPriority2(255);
+ _buttonList[_state].fixPriority(255);
_buttonList[_state]._numFrames = 25;
_buttonList[_state].animate(ANIM_MODE_5, NULL);
@@ -4380,7 +4391,7 @@ void Scene4301::postInit(SceneObjectList *OwnerList) {
_hotspot1.setVisage(4303);
_hotspot1._strip = 1;
_hotspot1._frame = 1;
- _hotspot1.setPriority2(250);
+ _hotspot1.fixPriority(250);
_hotspot5.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
_globals->_sceneItems.push_back(&_hotspot5);
diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h
index e3d1ae08b5..626eab5dab 100644
--- a/engines/tsage/ringworld_scenes5.h
+++ b/engines/tsage/ringworld_scenes5.h
@@ -330,7 +330,7 @@ class Scene4050 : public Scene {
};
/* Hotspots */
- class Hotspot14 : public SceneObject {
+ class Hotspot15 : public SceneObject {
public:
virtual void doAction(int action);
};
@@ -349,8 +349,9 @@ public:
DisplayHotspot _hotspot1, _hotspot2, _hotspot3, _hotspot4, _hotspot5;
DisplayHotspot _hotspot6, _hotspot7, _hotspot8, _hotspot9, _hotspot10;
DisplayHotspot _hotspot11, _hotspot12, _hotspot13;
- Hotspot14 _hotspot14;
- SceneObject _hotspot15, _hotspot16;
+ SceneObject _hotspot14;
+ Hotspot15 _hotspot15;
+ SceneObject _hotspot16;
Hotspot17 _hotspot17;
Scene4050();
diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp
index 2c9670d99a..17f7654e70 100644
--- a/engines/tsage/ringworld_scenes6.cpp
+++ b/engines/tsage/ringworld_scenes6.cpp
@@ -36,6 +36,7 @@ namespace tSage {
*--------------------------------------------------------------------------*/
void Scene5000::Action1::signal() {
+ // Ship landing
Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -127,7 +128,7 @@ void Scene5000::Action2::signal() {
case 2:
if (!_globals->getFlag(59))
setAction(&scene->_action3, this);
- _globals->_player.setPriority2(15);
+ _globals->_player.fixPriority(15);
ADD_MOVER(_globals->_player, 208, 100);
break;
case 3:
@@ -145,7 +146,7 @@ void Scene5000::Action2::signal() {
break;
case 7:
_globals->_player.changeZoom(-1);
- _globals->_player.setPriority2(35);
+ _globals->_player.fixPriority(35);
ADD_MOVER(_globals->_player, 201, 166);
break;
case 8:
@@ -154,7 +155,7 @@ void Scene5000::Action2::signal() {
break;
case 9:
_globals->_player.changeZoom(-1);
- _globals->_player.setPriority2(50);
+ _globals->_player.fixPriority(50);
ADD_MOVER(_globals->_player, 220, 182);
break;
case 10:
@@ -164,7 +165,7 @@ void Scene5000::Action2::signal() {
case 11:
_globals->_player.changeZoom(-1);
_globals->_player.setStrip2(-1);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
ADD_MOVER(_globals->_player, 208, 175);
break;
case 12:
@@ -200,7 +201,7 @@ void Scene5000::Action3::signal() {
scene->_hotspot7.setPosition(Common::Point(217, 76));
scene->_hotspot7.changeZoom(10);
scene->_hotspot7.setStrip2(3);
- scene->_hotspot7.setPriority2(200);
+ scene->_hotspot7.fixPriority(200);
scene->_hotspot7._moveDiff.y = 2;
scene->_hotspot7.animate(ANIM_MODE_1, NULL);
ADD_MOVER(scene->_hotspot7, 214, 89);
@@ -209,14 +210,14 @@ void Scene5000::Action3::signal() {
break;
case 2:
scene->_hotspot7.changeZoom(-1);
- scene->_hotspot7.setPriority2(14);
+ scene->_hotspot7.fixPriority(14);
ADD_MOVER(scene->_hotspot7, 208, 100);
break;
case 3:
ADD_MOVER(scene->_hotspot7, 213, 98);
break;
case 4:
- scene->_hotspot7.setPriority2(19);
+ scene->_hotspot7.fixPriority(19);
ADD_MOVER(scene->_hotspot7, 213, 98);
break;
case 5:
@@ -228,7 +229,7 @@ void Scene5000::Action3::signal() {
break;
case 7:
scene->_hotspot7.changeZoom(-1);
- scene->_hotspot7.setPriority2(34);
+ scene->_hotspot7.fixPriority(34);
ADD_MOVER(scene->_hotspot7, 201, 166);
break;
case 8:
@@ -237,7 +238,7 @@ void Scene5000::Action3::signal() {
break;
case 9:
scene->_hotspot7.changeZoom(-1);
- scene->_hotspot7.setPriority2(49);
+ scene->_hotspot7.fixPriority(49);
ADD_MOVER(scene->_hotspot7, 210, 182);
break;
case 10:
@@ -247,7 +248,7 @@ void Scene5000::Action3::signal() {
case 11:
scene->_hotspot7.changeZoom(-1);
scene->_hotspot7.setStrip2(-1);
- scene->_hotspot7.setPriority2(-1);
+ scene->_hotspot7.fixPriority(-1);
ADD_MOVER(scene->_hotspot7, 175, 166);
break;
case 12:
@@ -268,7 +269,7 @@ void Scene5000::Action4::signal() {
setDelay(1);
break;
case 1:
- _globals->_player.setPriority2(50);
+ _globals->_player.fixPriority(50);
_globals->_player.setStrip2(4);
ADD_MOVER(_globals->_player, 210, 182);
break;
@@ -276,14 +277,14 @@ void Scene5000::Action4::signal() {
ADD_MOVER(_globals->_player, 205, 146);
break;
case 3:
- _globals->_player.setPriority2(35);
+ _globals->_player.fixPriority(35);
ADD_MOVER(_globals->_player, 201, 166);
break;
case 4:
ADD_MOVER(_globals->_player, 229, 115);
break;
case 5:
- _globals->_player.setPriority2(20);
+ _globals->_player.fixPriority(20);
_globals->_player.changeZoom(47);
ADD_MOVER(_globals->_player, 220, 125);
break;
@@ -295,7 +296,7 @@ void Scene5000::Action4::signal() {
ADD_MOVER(_globals->_player, 213, 98);
break;
case 8:
- _globals->_player.setPriority2(15);
+ _globals->_player.fixPriority(15);
ADD_MOVER(_globals->_player, 208, 100);
break;
case 9:
@@ -345,6 +346,7 @@ void Scene5000::Action5::signal() {
}
void Scene5000::Action6::signal() {
+ // Discussion between the hero and Seeker, then the hero goes back to the lander
Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -364,7 +366,7 @@ void Scene5000::Action6::signal() {
ADD_PLAYER_MOVER(208, 163);
break;
case 4:
- _globals->_player.setPriority2(50);
+ _globals->_player.fixPriority(50);
_globals->_player.setStrip2(4);
ADD_MOVER(_globals->_player, 210, 182);
break;
@@ -393,6 +395,7 @@ void Scene5000::Hotspot7::doAction(int action) {
}
void Scene5000::Hotspot8::doAction(int action) {
+ // Cave
Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene;
switch (action) {
@@ -455,14 +458,14 @@ void Scene5000::postInit(SceneObjectList *OwnerList) {
_hotspot1.setVisage(5001);
_hotspot1.setFrame2(1);
_hotspot1._moveDiff = Common::Point(5, 5);
- _hotspot1.setPriority2(10);
+ _hotspot1.fixPriority(10);
_hotspot1.changeZoom(10);
_hotspot4.postInit();
_hotspot4.setVisage(5001);
_hotspot4.setStrip2(2);
_hotspot4._moveDiff = Common::Point(5, 1);
- _hotspot4.setPriority2(10);
+ _hotspot4.fixPriority(10);
_hotspot4.changeZoom(100);
_hotspot4.animate(ANIM_MODE_8, 0, NULL);
_hotspot4.hide();
@@ -484,13 +487,13 @@ void Scene5000::postInit(SceneObjectList *OwnerList) {
_hotspot5.setVisage(5001);
_hotspot5.setStrip2(4);
_hotspot5._numFrames = 5;
- _hotspot5.setPriority2(15);
+ _hotspot5.fixPriority(15);
_hotspot5.setPosition(Common::Point(218, 76));
_hotspot5.hide();
_hotspot9.postInit();
_hotspot9.setVisage(5002);
- _hotspot9.setPriority2(80);
+ _hotspot9.fixPriority(80);
_hotspot9.setPosition(Common::Point(71, 174));
_hotspot10.postInit();
@@ -644,7 +647,7 @@ void Scene5100::Action1::signal() {
scene->_hotspot5.setPosition(Common::Point(1160, 34));
scene->_hotspot5.setStrip2(2);
scene->_hotspot5.animate(ANIM_MODE_1, NULL);
- scene->_hotspot5.setPriority2(10);
+ scene->_hotspot5.fixPriority(10);
_globals->_sceneItems.push_front(&scene->_hotspot5);
ADD_MOVER(scene->_hotspot5, 999, 14);
@@ -689,9 +692,9 @@ void Scene5100::Action2::signal() {
break;
case 3:
if (_globals->_player._position.x >= 966) {
- ADD_PLAYER_MOVER(1215, 155);
+ ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 1215, 155);
} else {
- ADD_PLAYER_MOVER_THIS(scene->_hotspot8, 966, 185);
+ ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 966, 185);
}
if (_globals->_player._position.x >= 966) {
@@ -701,7 +704,7 @@ void Scene5100::Action2::signal() {
}
break;
case 4:
- ADD_PLAYER_MOVER_THIS(scene->_hotspot8, 1215, 155);
+ ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 1215, 155);
ADD_PLAYER_MOVER(1215, 155);
break;
case 5:
@@ -829,6 +832,7 @@ void Scene5100::Action5::signal() {
/*--------------------------------------------------------------------------*/
void Scene5100::HotspotGroup1::doAction(int action) {
+ // Flesh Eaters
Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene;
switch (action) {
@@ -881,11 +885,12 @@ void Scene5100::Hotspot4::doAction(int action) {
}
void Scene5100::HotspotGroup2::doAction(int action) {
+ // Bat
Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene;
switch (action) {
case CURSOR_LOOK:
- SceneItem::display2(5100, _globals->getFlag(62) ? 47 : 23);
+ SceneItem::display2(5100, _globals->getFlag(108) ? 47 : 23);
break;
case CURSOR_USE:
SceneItem::display2(5100, 29);
@@ -909,6 +914,7 @@ void Scene5100::HotspotGroup2::doAction(int action) {
}
void Scene5100::Hotspot9::doAction(int action) {
+ // Rope
Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene;
switch (action) {
@@ -929,7 +935,7 @@ void Scene5100::Hotspot9::doAction(int action) {
case OBJECT_BONE:
_globals->_player.disableControl();
scene->_sceneMode = 5116;
- scene->setAction(&scene->_sequenceManager, scene, 5116, &_globals->_player, &scene->_hotspot10,
+ scene->setAction(&scene->_sequenceManager, scene, 5116, &_globals->_player, this, &scene->_hotspot10,
&scene->_hotspot4, NULL);
break;
default:
@@ -1004,6 +1010,7 @@ void Scene5100::Hotspot18::doAction(int action) {
}
void Scene5100::Hotspot19::doAction(int action) {
+ // Pillar
Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene;
switch (action) {
@@ -1082,14 +1089,14 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
_hotspot14.postInit();
_hotspot14.setVisage(5101);
_hotspot14.setPosition(Common::Point(498, 147));
- _hotspot14.setPriority2(200);
+ _hotspot14.fixPriority(200);
_hotspot14._moveDiff.y = 10;
}
_hotspot17.postInit();
_hotspot17.setVisage(5101);
_hotspot17._strip = 2;
- _hotspot17.setPriority2(200);
+ _hotspot17.fixPriority(200);
if (_globals->getFlag(67))
_hotspot17.setPosition(Common::Point(554, 192));
@@ -1178,7 +1185,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
case 5200:
if (_globals->_stripNum == 5200) {
_globals->_player.setVisage(5101);
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
_globals->_player.setStrip(5);
_globals->_player.setFrame(1);
_globals->_player.setPosition(Common::Point(513, 199));
@@ -1227,7 +1234,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
_globals->_player.setVisage(5101);
_globals->_player.setStrip(6);
- _globals->_player.setPriority2(170);
+ _globals->_player.fixPriority(170);
_globals->_player.setPosition(Common::Point(1168, 110));
setAction(&_sequenceManager, this, 5111, &_globals->_player, NULL);
@@ -1260,7 +1267,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
_hotspot6.postInit();
_hotspot6.setVisage(5362);
_hotspot6.setPosition(Common::Point(1152, 70));
- _hotspot6.setPriority2(170);
+ _hotspot6.fixPriority(170);
_hotspot6.setStrip(6);
_hotspot6.setFrame(1);
_globals->_sceneItems.push_back(&_hotspot6);
@@ -1275,7 +1282,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) {
_hotspot15.setVisage(5140);
_hotspot15.setStrip(3);
_hotspot15.setPosition(Common::Point(977, 173));
- _hotspot15.setPriority2(1);
+ _hotspot15.fixPriority(1);
_globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
loadScene(5100);
@@ -1324,9 +1331,9 @@ void Scene5100::signal() {
break;
case 5111:
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
- _globals->_player.setVisage(6);
+ _globals->_player.setVisage(0);
_globals->_player.setStrip(6);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.animate(ANIM_MODE_1, NULL);
if ((RING_INVENTORY._vial._sceneNumber != 5100) && !_globals->getFlag(108)) {
@@ -1349,9 +1356,9 @@ void Scene5100::signal() {
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.setVisage(0);
_globals->_player.setStrip(6);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.animate(ANIM_MODE_1, NULL);
- break;
+ // No break on purpose
case 5117:
_globals->_player.enableControl();
break;
@@ -1370,6 +1377,7 @@ void Scene5100::signal() {
}
void Scene5100::dispatch() {
+ // Flesheater trap
if (_hotspot15._bounds.contains(_globals->_player._position) && !_globals->_player._visage) {
_globals->_player.disableControl();
_globals->_player.addMover(NULL);
@@ -1398,9 +1406,9 @@ void Scene5100::dispatch() {
_hotspot3.setStrip2(2);
ObjectMover3 *mover1 = new ObjectMover3();
- _hotspot2.addMover(mover1, 20, this);
+ _hotspot2.addMover(mover1, &_globals->_player, 20, this);
ObjectMover3 *mover2 = new ObjectMover3();
- _hotspot3.addMover(mover2, 20, this);
+ _hotspot3.addMover(mover2, &_globals->_player, 20, this);
}
if (!_action) {
@@ -1408,8 +1416,9 @@ void Scene5100::dispatch() {
_globals->_player._canWalk = false;
_globals->_player.addMover(NULL);
+ Common::Point pt(20, 25);
PlayerMover2 *mover = new PlayerMover2();
- _hotspot3.addMover(mover, 20, 25, &_globals->_player);
+ _hotspot3.addMover(mover, &pt, &_globals->_player);
setAction(&_action4);
}
@@ -1445,6 +1454,7 @@ void Scene5200::Action1::signal() {
}
void Scene5200::Action2::signal() {
+ // Quinn obtains the stasis box from the flesheater throne room
Scene5200 *scene = (Scene5200 *)_globals->_sceneManager._scene;
switch (_actionIndex++) {
@@ -1489,6 +1499,7 @@ void Scene5200::Action2::signal() {
void Scene5200::Action3::signal() {
switch (_actionIndex++) {
+ case 0:
_globals->_player.disableControl();
setDelay(5);
break;
@@ -1563,7 +1574,7 @@ void Scene5200::Hotspot10::doAction(int action) {
}
break;
default:
- SceneItem::doAction(action);
+ SceneObject::doAction(action);
break;
}
}
@@ -1579,7 +1590,7 @@ void Scene5200::Hotspot14::doAction(int action) {
scene->setAction(&scene->_action2);
break;
default:
- SceneItem::doAction(action);
+ SceneObject::doAction(action);
break;
}
}
@@ -1619,17 +1630,20 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
_hotspot14.setVisage(5202);
_hotspot14._strip = 3;
_hotspot14.setPosition(Common::Point(105, 52));
- _hotspot14.setPriority2(90);
+ _hotspot14.fixPriority(90);
_hotspot8.postInit();
_hotspot8.setVisage(5202);
_hotspot8._strip = 1;
_hotspot8.setPosition(Common::Point(96, 53));
- _hotspot8.setPriority2(90);
+ _hotspot8.fixPriority(90);
_globals->_sceneItems.push_back(&_hotspot14);
}
- if (_globals->_stripNum == 1111) {
+ if (_globals->_stripNum == 5111) {
+ // Happens when the player enters the throne room via the secret passage,
+ // after talking with the bat. No NPCs are around and the player can
+ // obtain the stasis box.
_globals->_soundHandler.startSound(205);
_globals->_player.disableControl();
@@ -1644,6 +1658,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
setAction(&_action3);
} else {
+ // Happens when the player is captured by the flesh eaters the first time.
_globals->_player.postInit();
_globals->_player.setVisage(2640);
_globals->_player._strip = 1;
@@ -1665,7 +1680,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
_hotspot7.setVisage(5210);
_hotspot7._frame = 1;
_hotspot7._strip = 4;
- _hotspot7.setPriority2(168);
+ _hotspot7.fixPriority(168);
_hotspot7.setPosition(Common::Point(186, 106));
_hotspot1.postInit();
@@ -1677,20 +1692,20 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
_hotspot2.setVisage(5212);
_hotspot2._strip = 3;
_hotspot2.setPosition(Common::Point(148, 141));
- _hotspot2.setPriority2(90);
+ _hotspot2.fixPriority(90);
_hotspot3.postInit();
_hotspot3.setVisage(5212);
_hotspot3._strip = 2;
_hotspot3.setPosition(Common::Point(62, 109));
- _hotspot3.setPriority2(138);
+ _hotspot3.fixPriority(138);
_hotspot3.setAction(&_action1);
_hotspot4.postInit();
_hotspot4.setVisage(5212);
_hotspot4._strip = 4;
_hotspot4.setPosition(Common::Point(146, 110));
- _hotspot4.setPriority2(90);
+ _hotspot4.fixPriority(90);
_globals->_player.disableControl();
_globals->setFlag(61);
@@ -1701,6 +1716,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) {
_hotspot11.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
_hotspot9._sceneRegionId = 11;
_hotspot10._sceneRegionId = 9;
+ _hotspot12._sceneRegionId = 10;
+ _hotspot13._sceneRegionId = 8;
_globals->_sceneItems.addItems(&_hotspot12, &_hotspot13, &_hotspot9, &_hotspot10, &_hotspot11, NULL);
_globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position);
@@ -1754,7 +1771,7 @@ void Scene5300::Action1::signal() {
ADD_MOVER(_globals->_player, 85, 170);
break;
case 3:
- scene->_hotspot2.setPriority2(-1);
+ scene->_hotspot2.fixPriority(-1);
_globals->_player.checkAngle(&scene->_hotspot2);
setAction(&scene->_sequenceManager, this, 5305, &scene->_hotspot2, NULL);
break;
@@ -1933,6 +1950,7 @@ void Scene5300::Hotspot5::doAction(int action) {
}
void Scene5300::Hotspot6::doAction(int action) {
+ // Left Hole
Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene;
switch (action) {
@@ -2033,7 +2051,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) {
_hotspot2.setVisage(5310);
_hotspot2.setPosition(Common::Point(63, 170));
_hotspot2.animate(ANIM_MODE_1, NULL);
- _hotspot2.setPriority2(98);
+ _hotspot2.fixPriority(98);
}
_hotspot1.postInit();
@@ -2075,7 +2093,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) {
_hotspot3.postInit();
_hotspot3.setVisage(5301);
_hotspot3.setPosition(Common::Point(172, 32));
- _hotspot3.setPriority2(1);
+ _hotspot3.fixPriority(1);
_hotspot3.animate(ANIM_MODE_NONE, NULL);
_globals->_player.postInit();
@@ -2113,6 +2131,9 @@ void Scene5300::signal() {
_globals->_stripNum = 5300;
_globals->_sceneManager.changeScene(5100);
break;
+ case 5307:
+ _soundHandler.proc1(NULL);
+ // No break on purpose
case 5302:
case 5308:
case 5316:
@@ -2149,15 +2170,12 @@ void Scene5300::signal() {
_stripManager.start(5302, this);
_sceneMode = 5302;
break;
- case 5307:
- _soundHandler.proc1(NULL);
- break;
case 5309:
_hotspot5.remove();
_globals->_player.enableControl();
break;
case 5310:
- _hotspot2.setPriority2(41);
+ _hotspot2.fixPriority(41);
_sceneMode = 5315;
setAction(&_sequenceManager, this, 5315, &_hotspot2, NULL);
diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h
index 272aea4fe9..16b2800fc6 100644
--- a/engines/tsage/ringworld_scenes6.h
+++ b/engines/tsage/ringworld_scenes6.h
@@ -216,11 +216,11 @@ class Scene5200 : public Scene {
};
/* Hotspots */
- class Hotspot9 : public SceneItemExt {
+ class Hotspot9 : public SceneObjectExt {
public:
virtual void doAction(int action);
};
- class Hotspot10 : public SceneItemExt {
+ class Hotspot10 : public SceneObjectExt {
public:
virtual void doAction(int action);
};
diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp
index 0891f64597..3f1895a432 100644
--- a/engines/tsage/ringworld_scenes8.cpp
+++ b/engines/tsage/ringworld_scenes8.cpp
@@ -31,6 +31,12 @@
namespace tSage {
+void NamedHotspotMult::synchronise(Serialiser &s) {
+ SceneHotspot::synchronise(s);
+ s.syncAsSint16LE(_useLineNum);
+ s.syncAsSint16LE(_lookLineNum);
+}
+
/*--------------------------------------------------------------------------
* Scene 7000
*
@@ -54,16 +60,17 @@ void Scene7000::Action1::signal() {
scene->_object1.setVisage(7003);
scene->_object1.animate(ANIM_MODE_5, this);
scene->_object1.setPosition(Common::Point(151, 182), 0);
- scene->_object1.setPriority2(205);
+ scene->_object1.fixPriority(205);
_globals->_sceneItems.push_front(&scene->_object1);
break;
case 3:
- scene->_object1.setStrip(4);
- scene->_object1.animate(ANIM_MODE_8, 0, 0);
+ scene->_object1._numFrames = 4;
+ scene->_object1.setStrip(2);
+ scene->_object1.animate(ANIM_MODE_8, 0, NULL);
scene->_stripManager.start(7005, this);
break;
case 4:
- scene->_object1.animate(ANIM_MODE_2, 0);
+ scene->_object1.animate(ANIM_MODE_2, NULL);
setDelay(3);
break;
case 5:
@@ -107,7 +114,7 @@ void Scene7000::Action3::dispatch() {
Action::dispatch();
if (_actionIndex == 4)
- scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y));
+ scene->_object4.setPosition(scene->_object3._position, 0);
}
/*--------------------------------------------------------------------------*/
@@ -122,9 +129,9 @@ void Scene7000::Action3::signal() {
scene->_object4.postInit();
scene->_object4.setVisage(5001);
scene->_object4.setStrip2(2);
- scene->_object4.animate(ANIM_MODE_8, 0, 0);
+ scene->_object4.animate(ANIM_MODE_8, 0, NULL);
scene->_object4.setPosition(Common::Point(10, 18), 0);
- scene->_object4.setPriority2(10);
+ scene->_object4.fixPriority(10);
scene->_object4.changeZoom(100);
scene->_object4.hide();
break;
@@ -135,7 +142,8 @@ void Scene7000::Action3::signal() {
break;
}
case 2:
- scene->_object3.setPriority2(10);
+ scene->_object3._moveDiff.y = 1;
+ scene->_object3.fixPriority(10);
scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15), 0);
scene->_object4.show();
setDelay(30);
@@ -176,8 +184,8 @@ void Scene7000::Action4::signal() {
scene->_object1.animate(ANIM_MODE_5, this);
break;
case 3:
- scene->_object1.setStrip(1);
- scene->_object1.animate(ANIM_MODE_8, 0, 0);
+ scene->_object1.setStrip(4);
+ scene->_object1.animate(ANIM_MODE_8, 0, NULL);
_globals->setFlag(81);
_globals->_player.enableControl();
remove();
@@ -222,7 +230,7 @@ void Scene7000::Action5::signal() {
break;
}
case 5: {
- _globals->_player.setPriority2(10);
+ _globals->_player.fixPriority(10);
NpcMover *mover = new NpcMover();
Common::Point pt(11, 89);
_globals->_player.addMover(mover, &pt, this);
@@ -268,7 +276,7 @@ void Scene7000::Action6::signal() {
NpcMover *mover = new NpcMover();
Common::Point pt(31, 96);
_globals->_player.addMover(mover, &pt, this);
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
break;
}
case 4: {
@@ -315,7 +323,7 @@ void Scene7000::Action7::signal() {
break;
}
case 4: {
- _globals->_player.setPriority2(10);
+ _globals->_player.fixPriority(10);
NpcMover *mover = new NpcMover();
Common::Point pt(11, 89);
_globals->_player.addMover(mover, &pt, this);
@@ -354,22 +362,19 @@ void Scene7000::Object1::doAction(int action) {
case OBJECT_TRANSLATOR:
_globals->_player.disableControl();
RING_INVENTORY._translator._sceneNumber = 7000;
- if (RING_INVENTORY._waldos._sceneNumber == 7000) {
- if (RING_INVENTORY._jar._sceneNumber == 7000) {
- scene->_sceneMode = 7012;
- scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, 0, 0);
- } else {
- scene->_sceneMode = 7015;
- scene->setAction(&scene->_sequenceManager, scene, 7017, &_globals->_player, 0, 0);
- }
+
+ if ((RING_INVENTORY._waldos._sceneNumber != 7000) && (RING_INVENTORY._jar._sceneNumber != 7000)) {
+ scene->_sceneMode = 7004;
+ scene->setAction(&scene->_sequenceManager, scene, 7004, &_globals->_player, this, NULL);
+ } else if (RING_INVENTORY._waldos._sceneNumber != 7000) {
+ scene->_sceneMode = 7011;
+ scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, NULL);
+ } else if (RING_INVENTORY._jar._sceneNumber != 7000) {
+ scene->_sceneMode = 7012;
+ scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, NULL);
} else {
- if (RING_INVENTORY._jar._sceneNumber == 7000) {
- scene->_sceneMode = 7011;
- scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, 0, 0);
- } else {
- scene->_sceneMode = 7004;
- scene->setAction(&scene->_sequenceManager, scene, 7004, &_globals->_player, this, 0, 0);
- }
+ scene->_sceneMode = 7015;
+ scene->setAction(&scene->_sequenceManager, scene, 7017, &_globals->_player, NULL);
}
break;
case OBJECT_WALDOS:
@@ -378,30 +383,31 @@ void Scene7000::Object1::doAction(int action) {
if (RING_INVENTORY._translator._sceneNumber == 7000) {
if (RING_INVENTORY._jar._sceneNumber == 7000) {
scene->_sceneMode = 7015;
- scene->setAction(&scene->_sequenceManager, scene, 7015, &_globals->_player, 0, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7015, &_globals->_player, NULL);
} else {
scene->_sceneMode = 7006;
- scene->setAction(&scene->_sequenceManager, scene, 7006, &_globals->_player, 0, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7006, &_globals->_player, NULL);
}
} else {
scene->_sceneMode = 7009;
- scene->setAction(&scene->_sequenceManager, scene, 7009, &_globals->_player, 0, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7009, &_globals->_player, NULL);
}
break;
case OBJECT_JAR:
_globals->_player.disableControl();
RING_INVENTORY._jar._sceneNumber = 7000;
+
if (RING_INVENTORY._translator._sceneNumber == 7000) {
- if (RING_INVENTORY._waldos._sceneNumber == 7000) {
+ if (RING_INVENTORY._waldos._sceneNumber != 7000) {
scene->_sceneMode = 7007;
- scene->setAction(&scene->_sequenceManager, scene, 7007, &_globals->_player, &scene->_object1, 0, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7007, &_globals->_player, &scene->_object1, NULL);
} else {
scene->_sceneMode = 7015;
- scene->setAction(&scene->_sequenceManager, scene, 7016, &_globals->_player, 0, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7016, &_globals->_player, NULL);
}
} else {
scene->_sceneMode = 7008;
- scene->setAction(&scene->_sequenceManager, scene, 7008, &_globals->_player, 0, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7008, &_globals->_player, NULL);
}
break;
case CURSOR_LOOK:
@@ -412,7 +418,7 @@ void Scene7000::Object1::doAction(int action) {
break;
case CURSOR_USE:
if (_globals->getFlag(81)) {
- RING_INVENTORY._stasisBox._sceneNumber = 1;
+ RING_INVENTORY._stasisBox2._sceneNumber = 1;
_globals->_player.disableControl();
scene->setAction(&scene->_action5);
} else {
@@ -421,7 +427,7 @@ void Scene7000::Object1::doAction(int action) {
break;
case CURSOR_TALK:
if (_globals->getFlag(81)) {
- RING_INVENTORY._stasisBox._sceneNumber = 1;
+ RING_INVENTORY._stasisBox2._sceneNumber = 1;
_globals->_player.disableControl();
scene->setAction(&scene->_action5);
} else if (_globals->getFlag(52)) {
@@ -450,8 +456,8 @@ void Scene7000::dispatch() {
if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 8) {
if (!_globals->getFlag(13)) {
_globals->_player.disableControl();
- _globals->_player.addMover(0);
- SceneItem::display(7000, 3, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
+ _globals->_player.addMover(NULL);
+ SceneItem::display2(7000, 3);
_sceneMode = 7001;
setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL);
} else if (!_globals->getFlag(52)) {
@@ -459,7 +465,7 @@ void Scene7000::dispatch() {
} else {
_globals->_player.disableControl();
_sceneMode = 7003;
- setAction(&scene->_sequenceManager, this, 7003, &_globals->_player, 0);
+ setAction(&scene->_sequenceManager, this, 7003, &_globals->_player, NULL);
}
}
if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 9)
@@ -486,39 +492,38 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object5.postInit();
_object5.setVisage(7001);
_object5.setStrip2(1);
- _object5.animate(ANIM_MODE_2, 0);
+ _object5.animate(ANIM_MODE_2, NULL);
_object5.setPosition(Common::Point(49, 147), 0);
- _object5.setPriority2(1);
+ _object5.fixPriority(1);
_object6.postInit();
_object6.setVisage(7001);
_object6.setStrip2(2);
- _object6.animate(ANIM_MODE_2, 0);
+ _object6.animate(ANIM_MODE_2, NULL);
_object6.setPosition(Common::Point(160, 139), 0);
- _object6.setPriority2(1);
+ _object6.fixPriority(1);
_object7.postInit();
_object7.setVisage(7001);
_object7.setStrip2(3);
- _object7.animate(ANIM_MODE_2, 0);
+ _object7.animate(ANIM_MODE_2, NULL);
_object7.setPosition(Common::Point(272, 129), 0);
- _object7.setPriority2(1);
+ _object7.fixPriority(1);
_object8.postInit();
_object8.setVisage(7001);
_object8.setStrip2(4);
- _object8.animate(ANIM_MODE_2, 0);
+ _object8.animate(ANIM_MODE_2, NULL);
_object8.setPosition(Common::Point(176, 175), 0);
- _object8.setPriority2(1);
+ _object8.fixPriority(1);
if (_globals->getFlag(72)) {
_object3.postInit();
_object3.setVisage(5001);
_object3.setStrip2(1);
- _object3.animate(ANIM_MODE_2, 0);
_object3.setPosition(Common::Point(107, 92), 0);
_object3.changeZoom(100);
- _object3.setPriority2(10);
+ _object3.fixPriority(10);
_object1.postInit();
_object1.setVisage(7003);
@@ -529,24 +534,25 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object1.setPosition(Common::Point(87, 129), 0);
_object1._numFrames = 4;
_object1.changeZoom(45);
- _object1.animate(ANIM_MODE_8, 0, 0);
- _globals->_sceneItems.addItems(&_object1, 0);
+ _object1.animate(ANIM_MODE_8, 0, NULL);
+ _globals->_sceneItems.push_back(&_object1);
}
_soundHandler.startSound(251);
if (_globals->_sceneManager._previousScene == 2100) {
if (_globals->getFlag(72)) {
_globals->_player.postInit();
_globals->_player.setVisage(0);
- _globals->_player.animate(ANIM_MODE_1, 0);
+ _globals->_player.animate(ANIM_MODE_1, NULL);
SceneObjectWrapper *wrapper = new SceneObjectWrapper();
_globals->_player.setObjectWrapper(wrapper);
_globals->_player.setPosition(Common::Point(57, 94), 0);
_globals->_player.changeZoom(-1);
- _globals->_player.setPriority2(10);
+ _globals->_player.fixPriority(10);
if (_globals->getFlag(81)) {
setAction(&_action4);
} else {
_object1.setPosition(Common::Point(151, 182), 0);
+ _object1.changeZoom(100);
setAction(&_action1);
}
} else {
@@ -556,7 +562,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_object3.postInit();
_object3.setVisage(5001);
_object3.setStrip2(1);
- _object3.animate(ANIM_MODE_1, 0);
+ _object3.animate(ANIM_MODE_1, NULL);
_object3.setPosition(Common::Point(307, 0), 0);
_object3.changeZoom(-1);
setAction(&_action3);
@@ -564,12 +570,11 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
} else if (_globals->_sceneManager._previousScene == 2280) {
_globals->_player.postInit();
_globals->_player.setVisage(2170);
- _globals->_player.animate(ANIM_MODE_1, 0);
- SceneObjectWrapper *wrapper = new SceneObjectWrapper();
- _globals->_player.setObjectWrapper(wrapper);
+ _globals->_player.animate(ANIM_MODE_1, NULL);
+ _globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.setPosition(Common::Point(57, 94), 0);
_globals->_player.changeZoom(-1);
- _globals->_player.setPriority2(10);
+ _globals->_player.fixPriority(10);
_globals->_player.disableControl();
_sceneMode = 7001;
setAction(&_action6, this);
@@ -587,7 +592,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_globals->_player.setObjectWrapper(wrapper);
_globals->_player.setPosition(Common::Point(57, 94), 0);
_globals->_player.changeZoom(-1);
- _globals->_player.setPriority2(10);
+ _globals->_player.fixPriority(10);
_sceneMode = 7001;
setAction(&_action6, this);
} else {
@@ -602,6 +607,9 @@ void Scene7000::postInit(SceneObjectList *OwnerList) {
_globals->_soundHandler.startSound(250);
setAction(&_action3);
}
+
+ _sceneItem1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
+ _globals->_sceneItems.push_back(&_sceneItem1);
}
/*--------------------------------------------------------------------------*/
@@ -612,6 +620,10 @@ void Scene7000::signal() {
case 7001:
case 7002:
case 7004:
+ case 7005:
+ case 7006:
+ case 7007:
+ case 7008:
case 7009:
_globals->_player.enableControl();
break;
@@ -709,7 +721,7 @@ void Scene7100::Action5::signal() {
}
case 3: {
scene->_object9.setStrip2(2);
- scene->_object9.setPriority2(180);
+ scene->_object9.fixPriority(180);
Common::Point pt(8, 181);
NpcMover *mover = new NpcMover();
scene->_object9.addMover(mover, &pt, this);
@@ -728,13 +740,13 @@ void Scene7100::Action6::signal() {
switch (_actionIndex++) {
case 0:
setDelay(1);
- scene->_object10.setPriority2(8);
+ scene->_object10.fixPriority(8);
scene->_object10.setPosition(Common::Point(155, 187), 0);
- scene->_object11.setPriority2(8);
+ scene->_object11.fixPriority(8);
scene->_object11.setPosition(Common::Point(155, 190), 0);
- scene->_object12.setPriority2(8);
+ scene->_object12.fixPriority(8);
scene->_object12.setPosition(Common::Point(151, 193), 0);
break;
case 1: {
@@ -758,13 +770,13 @@ void Scene7100::Action6::signal() {
scene->_object10.addMover(mover1, &pt1, this);
scene->_object11.setStrip2(6);
- scene->_object11.setPriority2(50);
+ scene->_object11.fixPriority(50);
Common::Point pt2(89, 185);
NpcMover *mover2 = new NpcMover();
scene->_object11.addMover(mover2, &pt2, 0);
scene->_object12.setStrip2(6);
- scene->_object12.setPriority2(50);
+ scene->_object12.fixPriority(50);
Common::Point pt3(87, 183);
NpcMover *mover3 = new NpcMover();
scene->_object12.addMover(mover3, &pt3, 0);
@@ -919,7 +931,7 @@ void Scene7100::Action9::signal() {
}
case 2: {
scene->_object24.setStrip2(2);
- scene->_object24.setPriority2(160);
+ scene->_object24.fixPriority(160);
Common::Point pt(34, 159);
NpcMover *mover = new NpcMover();
scene->_object24.addMover(mover, &pt, this);
@@ -934,7 +946,7 @@ void Scene7100::Action9::signal() {
}
case 4: {
scene->_object24.setStrip2(2);
- scene->_object24.setPriority2(180);
+ scene->_object24.fixPriority(180);
Common::Point pt(-12, 182);
NpcMover *mover = new NpcMover();
scene->_object24.addMover(mover, &pt, this);
@@ -1006,7 +1018,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object2.animate(ANIM_MODE_2, 0);
_object2.setPosition(Common::Point(10, 140), 0);
_object2._numFrames = 1;
- _object2.setPriority2(180);
+ _object2.fixPriority(180);
_object2.setAction(&_action1, 0);
_object3.postInit();
@@ -1014,7 +1026,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object3.animate(ANIM_MODE_2, 0);
_object3.setPosition(Common::Point(34, 115), 0);
_object3._numFrames = 1;
- _object3.setPriority2(180);
+ _object3.fixPriority(180);
_object3.setAction(&_action2, 0);
_object4.postInit();
@@ -1022,7 +1034,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object4.animate(ANIM_MODE_2, 0);
_object4.setPosition(Common::Point(-10, 159), 0);
_object4._numFrames = 2;
- _object4.setPriority2(250);
+ _object4.fixPriority(250);
_object4.setAction(&_action3, 0);
_object5.postInit();
@@ -1038,7 +1050,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object9.animate(ANIM_MODE_2, 0);
_object9.setPosition(Common::Point(110, 168), 0);
_object9._numFrames = 2;
- _object9.setPriority2(16);
+ _object9.fixPriority(16);
_object9.setAction(&_action5, 0);
_object13.postInit();
@@ -1047,7 +1059,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object13.animate(ANIM_MODE_2, 0);
_object13.setPosition(Common::Point(524, 104), 0);
_object13._numFrames = 5;
- _object13.setPriority2(250);
+ _object13.fixPriority(250);
_object13.setAction(&_action7, 0);
_object17.postInit();
@@ -1084,7 +1096,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object24.animate(ANIM_MODE_2, 0);
_object24.setPosition(Common::Point(-12, 182), 0);
_object24._numFrames = 4;
- _object24.setPriority2(180);
+ _object24.fixPriority(180);
_object24.setAction(&_action9, 0);
_object25.postInit();
@@ -1092,7 +1104,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_object25.animate(ANIM_MODE_2, 0);
_object25.setPosition(Common::Point(551, 145), 0);
_object25._numFrames = 5;
- _object25.setPriority2(160);
+ _object25.fixPriority(160);
_object25.setAction(&_action10, 0);
// Swimmer 1
@@ -1102,7 +1114,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) {
_globals->_player._moveDiff.x = 4;
_globals->_player._moveDiff.y = 2;
_globals->_player.setPosition(Common::Point(135, 135), 0);
- _globals->_player.setPriority2(200);
+ _globals->_player.fixPriority(200);
_globals->_player.disableControl();
// Swimmer 2
@@ -1158,9 +1170,9 @@ void Scene7200::Action2::signal() {
setDelay(3);
break;
case 1: {
- scene->_object2.setPriority2(25);
- scene->_object3.setPriority2(25);
- scene->_object4.setPriority2(25);
+ scene->_object2.fixPriority(25);
+ scene->_object3.fixPriority(25);
+ scene->_object4.fixPriority(25);
scene->_object2.setStrip(1);
scene->_object3.setStrip(1);
scene->_object4.setStrip(1);
@@ -1176,9 +1188,9 @@ void Scene7200::Action2::signal() {
break;
}
case 2: {
- scene->_object2.setPriority2(160);
- scene->_object3.setPriority2(160);
- scene->_object4.setPriority2(160);
+ scene->_object2.fixPriority(160);
+ scene->_object3.fixPriority(160);
+ scene->_object4.fixPriority(160);
scene->_object2.setStrip(2);
scene->_object3.setStrip(2);
scene->_object4.setStrip(2);
@@ -1323,7 +1335,7 @@ void Scene7300::Action1::signal() {
break;
case 7:
setDelay(3);
- _globals->_soundHandler.proc1(0);
+ _globals->_soundHandler.proc1(NULL);
break;
case 8:
_globals->_sceneManager.changeScene(2280);
@@ -1342,7 +1354,7 @@ void Scene7300::Action2::signal() {
break;
case 1:
NpcMover *mover1 = new NpcMover();
- Common::Point pt(_globals->_randomSource.getRandomNumber(203), _globals->_randomSource.getRandomNumber(96));
+ Common::Point pt(_globals->_randomSource.getRandomNumber(3) + 203, _globals->_randomSource.getRandomNumber(3) + 96);
scene->_object3.addMover(mover1, &pt, this);
_actionIndex = 0;
break;
@@ -1360,7 +1372,7 @@ void Scene7300::Action3::signal() {
break;
case 1:
NpcMover *mover1 = new NpcMover();
- Common::Point pt(_globals->_randomSource.getRandomNumber(76), _globals->_randomSource.getRandomNumber(78));
+ Common::Point pt(_globals->_randomSource.getRandomNumber(5) + 76, _globals->_randomSource.getRandomNumber(5) + 78);
scene->_object1.addMover(mover1, &pt, this);
_actionIndex = 0;
break;
@@ -1446,7 +1458,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) {
_object2.setStrip(2);
_object2.animate(ANIM_MODE_2, 0);
_object2.setPosition(Common::Point(77, 47), 0);
- _object2.setPriority2(190);
+ _object2.fixPriority(190);
_object5.postInit();
_object5.setVisage(7300);
@@ -1530,41 +1542,41 @@ void Scene7600::postInit(SceneObjectList *OwnerList) {
_object2.postInit();
_object2.setVisage(7601);
_object2.setStrip(1);
- _object2.animate(ANIM_MODE_2, 0);
+ _object2.animate(ANIM_MODE_2, NULL);
_object2.setPosition(Common::Point(48, 135));
- _object2.setPriority2(1);
+ _object2.fixPriority(1);
_object3.postInit();
_object3.setVisage(7601);
_object3.setStrip(2);
- _object3.animate(ANIM_MODE_2, 0);
+ _object3.animate(ANIM_MODE_2, NULL);
_object3.setPosition(Common::Point(158, 136));
- _object3.setPriority2(1);
+ _object3.fixPriority(1);
_object4.postInit();
_object4.setVisage(7601);
_object4.setStrip(3);
- _object4.animate(ANIM_MODE_2, 0);
+ _object4.animate(ANIM_MODE_2, NULL);
_object4.setPosition(Common::Point(293, 141));
- _object4.setPriority2(1);
+ _object4.fixPriority(1);
_object5.postInit();
_object5.setVisage(7601);
_object5.setStrip(4);
- _object5.animate(ANIM_MODE_2, 0);
+ _object5.animate(ANIM_MODE_2, NULL);
_object5.setPosition(Common::Point(405, 143));
- _object5.setPriority2(1);
+ _object5.fixPriority(1);
_object6.postInit();
_object6.setVisage(7601);
_object6.setStrip(5);
- _object6.animate(ANIM_MODE_2, 0);
+ _object6.animate(ANIM_MODE_2, NULL);
_object6.setPosition(Common::Point(379, 191));
- _object6.setPriority2(1);
+ _object6.fixPriority(1);
_globals->_player.postInit();
_globals->_player.setVisage(2333);
- _globals->_player.animate(ANIM_MODE_1, 0);
+ _globals->_player.animate(ANIM_MODE_1, NULL);
_globals->_player.setObjectWrapper(new SceneObjectWrapper());
_globals->_player.setStrip(1);
_globals->_player._moveDiff = Common::Point(16, 16);
@@ -1770,7 +1782,7 @@ void Scene7700::SceneHotspot3::doAction(int action) {
} else if (RING_INVENTORY._key._sceneNumber == 7700) {
_globals->_player.disableControl();
scene->_sceneMode = 7705;
- scene->setAction(&scene->_sequenceManager, scene, 7705, &_globals->_player, 0);
+ scene->setAction(&scene->_sequenceManager, scene, 7705, &_globals->_player, NULL);
}
break;
default:
@@ -2036,27 +2048,26 @@ void Scene7700::Object8::doAction(int action) {
scene->_object9.setVisage(7701);
scene->_object9.setStrip2(3);
scene->_object9.setPosition(Common::Point(91, 166), 0);
- scene->_object9.setPriority2(200);
+ scene->_object9.fixPriority(200);
scene->_object14.postInit();
scene->_object14.setVisage(7701);
scene->_object14.setStrip(2);
- scene->_object14.setPriority2(250);
+ scene->_object14.fixPriority(250);
scene->_object14.setPosition(Common::Point(139, 151), 0);
scene->_gfxButton.setText(EXIT_MSG);
scene->_gfxButton._bounds.center(140, 189);
scene->_gfxButton.draw();
- scene->_gfxButton._bounds.expandPanes();
- _globals->_sceneItems.push_front(&scene->_object10);
+ _globals->_sceneItems.push_front(&scene->_sceneItem10);
_globals->_sceneItems.push_front(&scene->_object9);
_globals->_player._canWalk = false;
- } else {
+ } else if (_globals->getFlag(78)) {
scene->_object15.postInit();
scene->_object15.setVisage(7701);
scene->_object15.setPosition(Common::Point(140, 165), 0);
- scene->_object15.setPriority2(200);
+ scene->_object15.fixPriority(200);
scene->_gfxButton.setText(EXIT_MSG);
scene->_gfxButton._bounds.center(140, 186);
@@ -2068,11 +2079,13 @@ void Scene7700::Object8::doAction(int action) {
scene->_object19.setStrip(6);
scene->_object19.setPosition(Common::Point(140, 192), 0);
- _globals->_sceneItems.push_front(&scene->_object10);
- _globals->_sceneItems.push_front(&scene->_object8);
- _globals->_sceneItems.push_front(&scene->_object9);
+ _globals->_sceneItems.push_front(&scene->_sceneItem10);
+ _globals->_sceneItems.push_front(&scene->_sceneHotspot8);
+ _globals->_sceneItems.push_front(&scene->_sceneHotspot9);
_globals->_events.setCursor(CURSOR_WALK);
_globals->_player._canWalk = false;
+ } else {
+ scene->setAction(&scene->_sequenceManager, scene, 7715, NULL);
}
} else {
SceneHotspot::doAction(action);
@@ -2100,7 +2113,7 @@ void Scene7700::Object9::doAction(int action) {
scene->_object10.setStrip(4);
scene->_object10.setPosition(Common::Point(159, 136));
_globals->_sceneItems.push_front(&scene->_object10);
- scene->_object10.setPriority2(240);
+ scene->_object10.fixPriority(240);
}
scene->_soundHandler.startSound(262);
scene->_object14.animate(ANIM_MODE_5, 0);
@@ -2118,6 +2131,8 @@ void Scene7700::Object10::doAction(int action) {
if (action == CURSOR_LOOK) {
SceneItem::display(7700, 50, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END);
} else if (action == CURSOR_USE) {
+ _globals->_player._canWalk = true;
+ RING_INVENTORY._translator._sceneNumber = 1;
_globals->setFlag(80);
scene->_sceneItem10.remove();
scene->_gfxButton._bounds.expandPanes();
@@ -2188,7 +2203,7 @@ void Scene7700::Object12::doAction(int action) {
void Scene7700::signal() {
switch (_sceneMode) {
case 7701:
- _globals->_player.setPriority2(-1);
+ _globals->_player.fixPriority(-1);
_globals->_player.setStrip2(-1);
if (_globals->getFlag(78)) {
_globals->_player.enableControl();
@@ -2216,10 +2231,13 @@ void Scene7700::signal() {
_globals->_player.enableControl();
break;
case 7705:
- case 7708:
RING_INVENTORY._key._sceneNumber = 1;
_globals->_player.enableControl();
break;
+ case 7708:
+ RING_INVENTORY._paper._sceneNumber = 1;
+ _globals->_player.enableControl();
+ break;
case 7709:
_globals->_events.setCursor(CURSOR_USE);
break;
@@ -2242,8 +2260,8 @@ void Scene7700::process(Event &event) {
if (contains<SceneItem *>(_globals->_sceneItems, &_sceneItem10)) {
if (_gfxButton.process(event)) {
_sceneItem10.remove();
- _sceneHotspot15.remove();
- _sceneHotspot9.remove();
+ _object15.remove();
+ _object9.remove();
if (_globals->_sceneObjects->contains(&_object10))
_object10.remove();
if (_globals->_sceneObjects->contains(&_object14))
@@ -2259,7 +2277,7 @@ void Scene7700::process(Event &event) {
_easterEgg1.postInit();
_easterEgg1.setVisage(7708);
_easterEgg1.setPosition(Common::Point(163, 50), 0);
- _easterEgg1.setPriority2(1);
+ _easterEgg1.fixPriority(1);
_easterEgg1.animate(ANIM_MODE_2, 0);
_easterEgg1.setAction(&_action6);
}
@@ -2301,7 +2319,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_globals->_player.setObjectWrapper(wrapper);
_globals->_player.setPosition(Common::Point(-19, 68), 0);
_globals->_player.setStrip2(7);
- _globals->_player.setPriority2(95);
+ _globals->_player.fixPriority(95);
_globals->_player.changeZoom(80);
_globals->_player._moveDiff.x = 6;
_globals->_player._moveDiff.y = 3;
@@ -2312,7 +2330,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
if (_globals->getFlag(78)) {
_prof.setStrip2(4);
- _prof.setPriority2(80);
+ _prof.fixPriority(80);
_prof.setPosition(Common::Point(159, 87), 0);
} else {
_prof.setPosition(Common::Point(203, 87), 0);
@@ -2324,7 +2342,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_cloud.postInit();
_cloud.setVisage(7700);
_cloud.setStrip2(5);
- _cloud.setPriority2(1);
+ _cloud.fixPriority(1);
_cloud.setPosition(Common::Point(133, 160), 0);
_cloud._moveDiff.x = 1;
_cloud._moveRate = 7;
@@ -2339,7 +2357,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_object2.postInit();
_object2.setVisage(7700);
_object2.setPosition(Common::Point(184, 70), 0);
- _object2.setPriority2(60);
+ _object2.fixPriority(60);
_object2._lookLineNum = 19;
_object2._defltLineNum = 17;
@@ -2358,7 +2376,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_object5.postInit();
_object5.setVisage(7700);
_object5.setPosition(Common::Point(268, 67), 0);
- _object5.setPriority2(58);
+ _object5.fixPriority(58);
_object5.setStrip2(3);
_object5._lookLineNum = 38;
_object5._defltLineNum = 36;
@@ -2366,7 +2384,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_object6.postInit();
_object6.setVisage(7700);
_object6.setPosition(Common::Point(268, 75), 0);
- _object6.setPriority2(57);
+ _object6.fixPriority(57);
_object6.setStrip2(4);
_object6._lookLineNum = 40;
_object6._defltLineNum = 43;
@@ -2375,7 +2393,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_object8.setVisage(7703);
_object8.setPosition(Common::Point(203, 91), 0);
_object8.setStrip2(4);
- _object8.setPriority2(86);
+ _object8.fixPriority(86);
_sceneHotspot8.setBounds(82, 141, 161, 92);
_sceneHotspot9.setBounds(82, 187, 161, 141);
@@ -2420,8 +2438,8 @@ void Scene7700::postInit(SceneObjectList *OwnerList) {
_sceneHotspot15._useLineNum = 6;
_sceneHotspot15._lookLineNum = 7;
_sceneHotspot16.setBounds(0, 130, 34, 103);
- _sceneHotspot16._useLineNum = 8;
- _sceneHotspot16._lookLineNum = 9;
+ _sceneHotspot16._useLineNum = 7;
+ _sceneHotspot16._lookLineNum = 8;
_sceneHotspot17.setBounds(41, 180, 46, 170);
_sceneHotspot17._useLineNum = 11;
_sceneHotspot17._lookLineNum = 13;
diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h
index 0c39920614..e40f3d4133 100644
--- a/engines/tsage/ringworld_scenes8.h
+++ b/engines/tsage/ringworld_scenes8.h
@@ -41,6 +41,7 @@ public:
NamedHotspotMult() : SceneHotspot() {}
virtual Common::String getClassName() { return "NamedHotspotMult"; }
+ virtual void synchronise(Serialiser &s);
};
class SceneObject7700 : public SceneObjectExt {
@@ -107,7 +108,7 @@ public:
SpeakerQL _speakerQL;
SpeakerQR _speakerQR;
SpeakerQText _speakerQText;
- SceneObject _object1;
+ Object1 _object1;
SceneObject _object2;
SceneObject _object3;
SceneObject _object4;
diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp
index 8b07767f22..317bc4bbb7 100644
--- a/engines/tsage/saveload.cpp
+++ b/engines/tsage/saveload.cpp
@@ -24,6 +24,7 @@
*/
#include "common/savefile.h"
+#include "graphics/palette.h"
#include "graphics/scaler.h"
#include "graphics/thumbnail.h"
#include "tsage/globals.h"
diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp
index e316a601fb..9a99049c19 100644
--- a/engines/tsage/scenes.cpp
+++ b/engines/tsage/scenes.cpp
@@ -114,10 +114,15 @@ void SceneManager::sceneChange() {
assert(_objectCount == _saver->getObjectCount());
}
_objectCount = _saver->getObjectCount();
+ _globals->_sceneHandler._delayTicks = 2;
// Instantiate and set the new scene
_scene = getNewScene();
- _scene->postInit();
+
+ if (!_saver->getMacroRestoreFlag())
+ _scene->postInit();
+ else
+ _scene->loadScene(_sceneNumber);
}
Scene *SceneManager::getNewScene() {
@@ -289,7 +294,7 @@ void Scene::loadScene(int sceneNum) {
}
void Scene::loadSceneData(int sceneNum) {
- _globals->_sceneManager._scene->_activeScreenNumber = sceneNum;
+ _activeScreenNumber = sceneNum;
// Get the basic scene size
byte *data = _resourceManager->getResource(RES_BITMAP, sceneNum, 9999);
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 7c8325d53e..63e753104e 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -23,8 +23,6 @@
*
*/
-#include "common/config-manager.h"
-#include "common/endian.h"
#include "tsage/core.h"
#include "tsage/globals.h"
#include "tsage/debugger.h"
diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp
index 46b75e30ea..bc85718035 100644
--- a/engines/tsage/staticres.cpp
+++ b/engines/tsage/staticres.cpp
@@ -114,4 +114,7 @@ const char *SCENE6100_SWEAT = "Humans sweat, Kzin twitch their tail. What's the
const char *SCENE6100_VERY_WELL = "Very well. I will retrieve the stasis box and return the probe. \
Wait for it's return in the lander bay.";
+const char *DEMO_HELP_MSG = " Help...\rF2 - Sound Options\rF3 - Exit demo\r\rPress ENTER\rto continue";
+const char *DEMO_PAUSED_MSG = " demo is paused";
+
} // End of namespace tSage
diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h
index cb62272735..0db349f8a7 100644
--- a/engines/tsage/staticres.h
+++ b/engines/tsage/staticres.h
@@ -79,6 +79,10 @@ extern const char *SCENE6100_SURPRISE;
extern const char *SCENE6100_SWEAT;
extern const char *SCENE6100_VERY_WELL;
+// Demo messages
+extern const char *DEMO_HELP_MSG;
+extern const char *DEMO_PAUSED_MSG;
+
} // End of namespace tSage
#endif
diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp
index 16756f59fa..d6f07c999b 100644
--- a/engines/tsage/tsage.cpp
+++ b/engines/tsage/tsage.cpp
@@ -23,11 +23,7 @@
*
*/
-#include "common/config-manager.h"
-#include "common/debug.h"
#include "common/debug-channels.h"
-#include "common/system.h"
-#include "common/savefile.h"
#include "engines/util.h"
#include "tsage/tsage.h"
@@ -94,8 +90,6 @@ Common::Error TSageEngine::run() {
// Basic initialisation
initialise();
- _globals->_events.showCursor();
-
_globals->_sceneHandler.registerHandler();
_globals->_game->execute();
diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp
index 108c6bcad5..ee117d233d 100644
--- a/engines/tucker/locations.cpp
+++ b/engines/tucker/locations.cpp
@@ -26,6 +26,7 @@
#include "tucker/tucker.h"
#include "tucker/graphics.h"
#include "common/system.h"
+#include "graphics/palette.h"
namespace Tucker {
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp
index c0f1baae99..aeb4399dee 100644
--- a/engines/tucker/resource.cpp
+++ b/engines/tucker/resource.cpp
@@ -24,6 +24,7 @@
*/
#include "common/file.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/decoders/flac.h"
diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp
index 83533a90c3..52c6bf19ce 100644
--- a/engines/tucker/saveload.cpp
+++ b/engines/tucker/saveload.cpp
@@ -24,6 +24,7 @@
*/
#include "common/savefile.h"
+#include "common/textconsole.h"
#include "tucker/tucker.h"
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp
index 5e99e3ccef..d747b346ee 100644
--- a/engines/tucker/sequences.cpp
+++ b/engines/tucker/sequences.cpp
@@ -24,11 +24,14 @@
*/
#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/decoders/raw.h"
#include "audio/decoders/wave.h"
+#include "graphics/palette.h"
+
#include "tucker/tucker.h"
#include "tucker/graphics.h"
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index e41cbfbeef..ed3046867b 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -26,10 +26,17 @@
#include "common/config-manager.h"
#include "common/events.h"
#include "common/system.h"
+#include "common/archive.h"
+#include "common/debug.h"
+#include "common/error.h"
+#include "common/keyboard.h"
+#include "common/textconsole.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
+#include "graphics/palette.h"
+#include "gui/debugger.h"
#include "tucker/tucker.h"
#include "tucker/graphics.h"
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 0237712f13..e3ca0bf588 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -23,14 +23,9 @@
*
*/
+#include "common/textconsole.h"
#include "common/util.h"
-#include "common/system.h"
-#include "common/events.h"
-#include "graphics/surface.h"
-#include "graphics/colormasks.h"
-
-#include "gui/ThemeEngine.h"
#include "graphics/VectorRenderer.h"
#define VECTOR_RENDERER_FAST_TRIANGLES
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 0a783a077d..9285fa21c5 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -26,16 +26,19 @@
#ifndef VECTOR_RENDERER_H
#define VECTOR_RENDERER_H
+#include "common/rect.h"
#include "common/scummsys.h"
-#include "common/system.h"
+#include "common/str.h"
#include "graphics/surface.h"
-#include "graphics/pixelformat.h"
#include "gui/ThemeEngine.h"
+class OSystem;
+
namespace Graphics {
class VectorRenderer;
+struct DrawStep;
typedef void (VectorRenderer::*DrawingFunctionCallback)(const Common::Rect &, const Graphics::DrawStep &);
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 0ee13033af..3eb8b1345f 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -25,7 +25,6 @@
#include "common/util.h"
#include "common/system.h"
-#include "common/events.h"
#include "common/frac.h"
#include "graphics/surface.h"
@@ -277,7 +276,7 @@ copyFrame(OSystem *sys, const Common::Rect &r) {
sys->copyRectToOverlay(
(const OverlayColor *)_activeSurface->getBasePtr(r.left, r.top),
- _activeSurface->pitch / _activeSurface->bytesPerPixel,
+ _activeSurface->pitch / _activeSurface->format.bytesPerPixel,
r.left, r.top, r.width(), r.height()
);
}
@@ -337,8 +336,8 @@ blitAlphaBitmap(const Graphics::Surface *source, const Common::Rect &r) {
PixelType *dst_ptr = (PixelType *)_activeSurface->getBasePtr(x, y);
const PixelType *src_ptr = (const PixelType *)source->getBasePtr(0, 0);
- int dst_pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
- int src_pitch = source->pitch / source->bytesPerPixel;
+ int dst_pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
+ int src_pitch = source->pitch / source->format.bytesPerPixel;
int w, h = source->h;
@@ -485,7 +484,7 @@ drawLine(int x1, int y1, int x2, int y2) {
return;
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int st = Base::_strokeWidth >> 1;
if (dy == 0) { // horizontal lines
@@ -733,7 +732,7 @@ void VectorRendererSpec<PixelType>::
drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer::FillMode fill_m, int baseLeft, int baseRight) {
int f, ddF_x, ddF_y;
int x, y, px, py;
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int sw = 0, sp = 0, hp = 0;
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
@@ -831,7 +830,7 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawBevelTabAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, int baseLeft, int baseRight) {
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int i, j;
PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
@@ -876,7 +875,7 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawSquareAlg(int x, int y, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x, y);
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int max_h = h;
if (fill_m != kFillDisabled) {
@@ -908,7 +907,7 @@ drawSquareAlg(int x, int y, int w, int h, PixelType color, VectorRenderer::FillM
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill) {
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int height = h;
PixelType *ptr_fill = (PixelType *)_activeSurface->getBasePtr(x, y);
@@ -965,7 +964,7 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawLineAlg(int x1, int y1, int x2, int y2, int dx, int dy, PixelType color) {
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int xdir = (x2 > x1) ? 1 : -1;
*ptr = (PixelType)color;
@@ -1013,7 +1012,7 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color, VectorRenderer::FillMode fill_m) {
int dx = w >> 1, dy = h, gradient_h = 0;
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
PixelType *ptr_right = 0, *ptr_left = 0;
if (inverted) {
@@ -1094,7 +1093,7 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, VectorRenderer::FillMode fill_m) {
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int hstep = 0, dy = size;
bool grad = (fill_m == kFillGradient);
@@ -1143,7 +1142,7 @@ void VectorRendererSpec<PixelType>::
drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
int f, ddF_x, ddF_y;
int x, y, px, py;
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int sw = 0, sp = 0, hp = h * pitch;
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
@@ -1234,7 +1233,7 @@ void VectorRendererSpec<PixelType>::
drawCircleAlg(int x1, int y1, int r, PixelType color, VectorRenderer::FillMode fill_m) {
int f, ddF_x, ddF_y;
int x, y, px, py, sw = 0;
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
PixelType *ptr = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
if (fill_m == kFillDisabled) {
@@ -1284,7 +1283,7 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawSquareShadow(int x, int y, int w, int h, int blur) {
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x + w - 1, y + blur);
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int i, j;
i = h - blur;
@@ -1321,7 +1320,7 @@ void VectorRendererSpec<PixelType>::
drawRoundedSquareShadow(int x1, int y1, int r, int w, int h, int blur) {
int f, ddF_x, ddF_y;
int x, y, px, py;
- int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int alpha = 102;
x1 += blur;
@@ -1368,7 +1367,7 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) {
int x, y;
- const int pitch = _activeSurface->pitch / _activeSurface->bytesPerPixel;
+ const int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int px, py;
int sw = 0, sp = 0;
@@ -1438,7 +1437,7 @@ void VectorRendererAA<PixelType>::
drawLineAlg(int x1, int y1, int x2, int y2, int dx, int dy, PixelType color) {
PixelType *ptr = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
- int pitch = Base::_activeSurface->pitch / Base::_activeSurface->bytesPerPixel;
+ int pitch = Base::_activeSurface->pitch / Base::_activeSurface->format.bytesPerPixel;
int xdir = (x2 > x1) ? 1 : -1;
uint16 error_tmp, error_acc, gradient;
uint8 alpha;
@@ -1489,7 +1488,7 @@ template<typename PixelType>
void VectorRendererAA<PixelType>::
drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
int x, y;
- const int pitch = Base::_activeSurface->pitch / Base::_activeSurface->bytesPerPixel;
+ const int pitch = Base::_activeSurface->pitch / Base::_activeSurface->format.bytesPerPixel;
int px, py;
int sw = 0, sp = 0, hp = h * pitch;
@@ -1566,7 +1565,7 @@ template<typename PixelType>
void VectorRendererAA<PixelType>::
drawCircleAlg(int x1, int y1, int r, PixelType color, VectorRenderer::FillMode fill_m) {
int x, y, sw = 0;
- const int pitch = Base::_activeSurface->pitch / Base::_activeSurface->bytesPerPixel;
+ const int pitch = Base::_activeSurface->pitch / Base::_activeSurface->format.bytesPerPixel;
int px, py;
uint32 rsq = r*r;
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
index fee4b05f66..c9679432fa 100644
--- a/graphics/conversion.cpp
+++ b/graphics/conversion.cpp
@@ -23,6 +23,7 @@
*/
#include "graphics/conversion.h"
+#include "graphics/pixelformat.h"
namespace Graphics {
diff --git a/graphics/conversion.h b/graphics/conversion.h
index b6d230612e..2759f3bb5e 100644
--- a/graphics/conversion.h
+++ b/graphics/conversion.h
@@ -27,10 +27,11 @@
#define GRAPHICS_CONVERSION_H
#include "common/util.h"
-#include "graphics/pixelformat.h"
namespace Graphics {
+struct PixelFormat;
+
/** Converting a color from YUV to RGB colorspace. */
inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
r = CLIP<int>(y + ((1357 * (v - 128)) >> 10), 0, 255);
diff --git a/graphics/font.cpp b/graphics/font.cpp
index 359374436c..7fa39d07db 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -25,7 +25,11 @@
#include "common/stream.h"
#include "common/file.h"
#include "common/endian.h"
+#include "common/array.h"
+#include "common/textconsole.h"
+#include "common/util.h"
#include "graphics/font.h"
+#include "graphics/surface.h"
namespace Graphics {
@@ -74,7 +78,7 @@ void NewFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const
assert(dst != 0);
assert(desc.bits != 0 && desc.maxwidth <= 16);
- assert(dst->bytesPerPixel == 1 || dst->bytesPerPixel == 2);
+ assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2);
// If this character is not included in the font, use the default char.
if (chr < desc.firstchar || chr >= desc.firstchar + desc.size) {
@@ -106,9 +110,9 @@ void NewFont::drawChar(Surface *dst, byte chr, const int tx, const int ty, const
tmp += bbh - y;
y -= MAX(0, ty + desc.ascent - bby - dst->h);
- if (dst->bytesPerPixel == 1)
+ if (dst->format.bytesPerPixel == 1)
drawCharIntern<byte>(ptr, dst->pitch, tmp, y, MAX(0, -(tx + bbx)), MIN(bbw, dst->w - tx - bbx), color);
- else if (dst->bytesPerPixel == 2)
+ else if (dst->format.bytesPerPixel == 2)
drawCharIntern<uint16>(ptr, dst->pitch, tmp, y, MAX(0, -(tx + bbx)), MIN(bbw, dst->w - tx - bbx), color);
}
diff --git a/graphics/font.h b/graphics/font.h
index b1a4735249..9e6e180ec3 100644
--- a/graphics/font.h
+++ b/graphics/font.h
@@ -26,15 +26,16 @@
#define GRAPHICS_FONT_H
#include "common/str.h"
-#include "common/array.h"
-#include "graphics/surface.h"
namespace Common {
class SeekableReadStream;
+template<class T> class Array;
}
namespace Graphics {
+struct Surface;
+
/** Text alignment modes */
enum TextAlign {
kTextAlignInvalid,
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp
index 35ea14b199..bbd75bfca2 100644
--- a/graphics/fontman.cpp
+++ b/graphics/fontman.cpp
@@ -22,6 +22,7 @@
* $Id$
*/
+#include "graphics/font.h"
#include "graphics/fontman.h"
DECLARE_SINGLETON(Graphics::FontManager);
diff --git a/graphics/fontman.h b/graphics/fontman.h
index 7871f32ba9..34b457ae83 100644
--- a/graphics/fontman.h
+++ b/graphics/fontman.h
@@ -30,11 +30,12 @@
#include "common/str.h"
#include "common/hashmap.h"
#include "common/hash-str.h"
-#include "graphics/font.h"
namespace Graphics {
+class Font;
+
class FontManager : public Common::Singleton<FontManager> {
public:
enum FontUsage {
diff --git a/graphics/fonts/scummfont.cpp b/graphics/fonts/scummfont.cpp
index 87078e1475..3331b72c47 100644
--- a/graphics/fonts/scummfont.cpp
+++ b/graphics/fonts/scummfont.cpp
@@ -23,6 +23,7 @@
*/
#include "graphics/font.h"
+#include "graphics/surface.h"
namespace Graphics {
@@ -302,9 +303,9 @@ void ScummFont::drawChar(Surface *dst, byte chr, int tx, int ty, uint32 color) c
}
c = ((buffer & mask) != 0);
if (c) {
- if (dst->bytesPerPixel == 1)
+ if (dst->format.bytesPerPixel == 1)
ptr[x] = color;
- else if (dst->bytesPerPixel == 2)
+ else if (dst->format.bytesPerPixel == 2)
((uint16 *)ptr)[x] = color;
}
}
diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp
index 12509fd9e1..7db9a233f6 100644
--- a/graphics/fonts/winfont.cpp
+++ b/graphics/fonts/winfont.cpp
@@ -24,8 +24,11 @@
#include "common/file.h"
#include "common/str.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/winexe_ne.h"
#include "common/winexe_pe.h"
+#include "graphics/surface.h"
#include "graphics/fonts/winfont.h"
namespace Graphics {
@@ -320,7 +323,7 @@ bool WinFont::loadFromFNT(Common::SeekableReadStream &stream) {
void WinFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const {
assert(dst);
- assert(dst->bytesPerPixel == 1 || dst->bytesPerPixel == 2 || dst->bytesPerPixel == 4);
+ assert(dst->format.bytesPerPixel == 1 || dst->format.bytesPerPixel == 2 || dst->format.bytesPerPixel == 4);
assert(_glyphs);
GlyphEntry &glyph = _glyphs[characterToIndex(chr)];
@@ -328,11 +331,11 @@ void WinFont::drawChar(Surface *dst, byte chr, int x, int y, uint32 color) const
for (uint16 i = 0; i < _pixHeight; i++) {
for (uint16 j = 0; j < glyph.charWidth; j++) {
if (glyph.bitmap[j + i * glyph.charWidth]) {
- if (dst->bytesPerPixel == 1)
+ if (dst->format.bytesPerPixel == 1)
*((byte *)dst->getBasePtr(x + j, y + i)) = color;
- else if (dst->bytesPerPixel == 2)
+ else if (dst->format.bytesPerPixel == 2)
*((uint16 *)dst->getBasePtr(x + j, y + i)) = color;
- else if (dst->bytesPerPixel == 4)
+ else if (dst->format.bytesPerPixel == 4)
*((uint32 *)dst->getBasePtr(x + j, y + i)) = color;
}
}
diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h
index fbe4a778e2..c31d45e2ce 100644
--- a/graphics/fonts/winfont.h
+++ b/graphics/fonts/winfont.h
@@ -25,11 +25,11 @@
#ifndef GRAPHICS_WINFONT_H
#define GRAPHICS_WINFONT_H
+#include "common/str.h"
#include "graphics/font.h"
namespace Common {
- class SeekableReadStream;
- class String;
+class SeekableReadStream;
}
namespace Graphics {
diff --git a/graphics/iff.cpp b/graphics/iff.cpp
index 2174291112..fee71de485 100644
--- a/graphics/iff.cpp
+++ b/graphics/iff.cpp
@@ -25,6 +25,10 @@
#include "graphics/iff.h"
#include "graphics/surface.h"
+#include "common/endian.h"
+#include "common/func.h"
+#include "common/iff_container.h"
+#include "common/textconsole.h"
#include "common/util.h"
namespace Graphics {
@@ -204,7 +208,7 @@ struct PBMLoader {
case ID_BODY:
if (_surface) {
- _surface->create(_decoder._header.width, _decoder._header.height, 1);
+ _surface->create(_decoder._header.width, _decoder._header.height, PixelFormat::createFormatCLUT8());
_decoder.loadBitmap((byte*)_surface->pixels, chunk._stream);
}
return true; // stop the parser
diff --git a/graphics/iff.h b/graphics/iff.h
index 0aab0e09cb..fc837a3ea2 100644
--- a/graphics/iff.h
+++ b/graphics/iff.h
@@ -31,7 +31,7 @@
#ifndef GRAPHICS_IFF_H
#define GRAPHICS_IFF_H
-#include "common/iff_container.h"
+#include "common/stream.h"
namespace Graphics {
diff --git a/graphics/imagedec.cpp b/graphics/imagedec.cpp
index a4d2fbc1cf..f45f0ce5ef 100644
--- a/graphics/imagedec.cpp
+++ b/graphics/imagedec.cpp
@@ -23,6 +23,7 @@
*/
#include "graphics/imagedec.h"
+#include "graphics/pixelformat.h"
#include "graphics/surface.h"
#include "common/file.h"
@@ -117,7 +118,7 @@ Surface *BMPDecoder::decodeImage(Common::SeekableReadStream &stream, const Pixel
uint8 r = 0, g = 0, b = 0;
Surface *newSurf = new Surface;
assert(newSurf);
- newSurf->create(info.width, info.height, sizeof(OverlayColor));
+ newSurf->create(info.width, info.height, format);
assert(newSurf->pixels);
OverlayColor *curPixel = (OverlayColor*)newSurf->pixels + (newSurf->h-1) * newSurf->w;
int pitchAdd = info.width % 4;
diff --git a/graphics/imagedec.h b/graphics/imagedec.h
index 13aa63a153..7ea987b1e4 100644
--- a/graphics/imagedec.h
+++ b/graphics/imagedec.h
@@ -28,14 +28,13 @@
#include "common/scummsys.h"
#include "common/str.h"
-#include "graphics/pixelformat.h"
-
namespace Common{
class SeekableReadStream;
}
namespace Graphics {
+struct PixelFormat;
struct Surface;
class ImageDecoder {
diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp
index 169c3b5f1b..70ffb06f6b 100644
--- a/graphics/jpeg.cpp
+++ b/graphics/jpeg.cpp
@@ -27,9 +27,10 @@
#include "graphics/jpeg.h"
#include "graphics/pixelformat.h"
+#include "common/debug.h"
#include "common/endian.h"
-#include "common/util.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Graphics {
@@ -95,7 +96,7 @@ Surface *JPEG::getSurface(const PixelFormat &format) {
Graphics::Surface *vComponent = getComponent(3);
Graphics::Surface *output = new Graphics::Surface();
- output->create(yComponent->w, yComponent->h, format.bytesPerPixel);
+ output->create(yComponent->w, yComponent->h, format);
for (uint16 i = 0; i < output->h; i++) {
for (uint16 j = 0; j < output->w; j++) {
@@ -443,7 +444,7 @@ bool JPEG::readSOS() {
// Initialize the scan surfaces
for (uint16 c = 0; c < _numScanComp; c++) {
- _scanComp[c]->surface.create(xMCU * _maxFactorH * 8, yMCU * _maxFactorV * 8, 1);
+ _scanComp[c]->surface.create(xMCU * _maxFactorH * 8, yMCU * _maxFactorV * 8, PixelFormat::createFormatCLUT8());
}
bool ok = true;
@@ -710,9 +711,9 @@ uint8 JPEG::readBit() {
if (byte2 == 0xDC) {
// DNL marker: Define Number of Lines
// TODO: terminate scan
- printf("DNL marker detected: terminate scan\n");
+ warning("DNL marker detected: terminate scan");
} else {
- printf("Error: marker 0x%02X read in entropy data\n", byte2);
+ warning("Error: marker 0x%02X read in entropy data", byte2);
}
}
}
diff --git a/graphics/palette.h b/graphics/palette.h
index 8d7fdbd99a..14e433f153 100644
--- a/graphics/palette.h
+++ b/graphics/palette.h
@@ -26,6 +26,7 @@
#ifndef GRAPHICS_PALETTE_H
#define GRAPHICS_PALETTE_H
+#include "common/scummsys.h"
#include "common/noncopyable.h"
/**
diff --git a/graphics/pict.cpp b/graphics/pict.cpp
index ca4aac751d..acade48515 100644
--- a/graphics/pict.cpp
+++ b/graphics/pict.cpp
@@ -23,9 +23,12 @@
*
*/
+#include "common/debug.h"
+#include "common/endian.h"
+#include "common/stream.h"
#include "common/substream.h"
+#include "common/textconsole.h"
-#include "graphics/conversion.h"
#include "graphics/jpeg.h"
#include "graphics/pict.h"
#include "graphics/surface.h"
@@ -209,7 +212,7 @@ void PictDecoder::decodeDirectBitsRect(Common::SeekableReadStream *stream, bool
bytesPerPixel = directBitsData.pixMap.pixelSize / 8;
_outputSurface = new Graphics::Surface();
- _outputSurface->create(width, height, (bytesPerPixel == 1) ? 1 : _pixelFormat.bytesPerPixel);
+ _outputSurface->create(width, height, (bytesPerPixel == 1) ? PixelFormat::createFormatCLUT8() : _pixelFormat);
byte *buffer = new byte[width * height * bytesPerPixel];
// Read in amount of data per row
diff --git a/graphics/pict.h b/graphics/pict.h
index a683a23bf6..22f36aafe7 100644
--- a/graphics/pict.h
+++ b/graphics/pict.h
@@ -32,7 +32,7 @@
#include "graphics/pixelformat.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Graphics {
diff --git a/graphics/png.cpp b/graphics/png.cpp
index b256c87cf5..3cdb9f7cca 100644
--- a/graphics/png.cpp
+++ b/graphics/png.cpp
@@ -23,13 +23,14 @@
*
*/
-#include "graphics/conversion.h"
#include "graphics/png.h"
#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
#include "common/endian.h"
#include "common/memstream.h"
#include "common/stream.h"
+#include "common/types.h"
#include "common/util.h"
#include "common/zlib.h"
@@ -112,60 +113,62 @@ PNG::~PNG() {
Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
Graphics::Surface *output = new Graphics::Surface();
- output->create(_unfilteredSurface->w, _unfilteredSurface->h, format.bytesPerPixel);
+ output->create(_unfilteredSurface->w, _unfilteredSurface->h, format);
byte *src = (byte *)_unfilteredSurface->pixels;
byte a = 0xFF;
if (_header.colorType != kIndexed) {
if (_header.colorType == kTrueColor || _header.colorType == kTrueColorWithAlpha) {
- if (_unfilteredSurface->bytesPerPixel != 3 && _unfilteredSurface->bytesPerPixel != 4)
+ if (_unfilteredSurface->format.bytesPerPixel != 3 && _unfilteredSurface->format.bytesPerPixel != 4)
error("Unsupported truecolor PNG format");
} else if (_header.colorType == kGrayScale || _header.colorType == kGrayScaleWithAlpha) {
- if (_unfilteredSurface->bytesPerPixel != 1 && _unfilteredSurface->bytesPerPixel != 2)
+ if (_unfilteredSurface->format.bytesPerPixel != 1 && _unfilteredSurface->format.bytesPerPixel != 2)
error("Unsupported grayscale PNG format");
}
for (uint16 i = 0; i < output->h; i++) {
for (uint16 j = 0; j < output->w; j++) {
- if (format.bytesPerPixel == 2) {
- if (_unfilteredSurface->bytesPerPixel == 1) { // Grayscale
+ if (format.bytesPerPixel == 2) { // 2bpp
+ uint16 *dest = ((uint16 *)output->getBasePtr(j, i));
+ if (_unfilteredSurface->format.bytesPerPixel == 1) { // Grayscale
if (_transparentColorSpecified)
a = (src[0] == _transparentColor[0]) ? 0 : 0xFF;
- *((uint16 *)output->getBasePtr(j, i)) = format.ARGBToColor( a, src[0], src[0], src[0]);
- } else if (_unfilteredSurface->bytesPerPixel == 2) { // Grayscale + alpha
- *((uint16 *)output->getBasePtr(j, i)) = format.ARGBToColor(src[1], src[0], src[0], src[0]);
- } else if (_unfilteredSurface->bytesPerPixel == 3) { // RGB
+ *dest = format.ARGBToColor( a, src[0], src[0], src[0]);
+ } else if (_unfilteredSurface->format.bytesPerPixel == 2) { // Grayscale + alpha
+ *dest = format.ARGBToColor(src[1], src[0], src[0], src[0]);
+ } else if (_unfilteredSurface->format.bytesPerPixel == 3) { // RGB
if (_transparentColorSpecified) {
bool isTransparentColor = (src[0] == _transparentColor[0] &&
src[1] == _transparentColor[1] &&
src[2] == _transparentColor[2]);
a = isTransparentColor ? 0 : 0xFF;
}
- *((uint16 *)output->getBasePtr(j, i)) = format.ARGBToColor( a, src[0], src[1], src[2]);
- } else if (_unfilteredSurface->bytesPerPixel == 4) { // RGBA
- *((uint16 *)output->getBasePtr(j, i)) = format.ARGBToColor(src[3], src[0], src[1], src[2]);
+ *dest = format.ARGBToColor( a, src[0], src[1], src[2]);
+ } else if (_unfilteredSurface->format.bytesPerPixel == 4) { // RGBA
+ *dest = format.ARGBToColor(src[3], src[0], src[1], src[2]);
}
- } else {
- if (_unfilteredSurface->bytesPerPixel == 1) { // Grayscale
+ } else { // 4bpp
+ uint32 *dest = ((uint32 *)output->getBasePtr(j, i));
+ if (_unfilteredSurface->format.bytesPerPixel == 1) { // Grayscale
if (_transparentColorSpecified)
a = (src[0] == _transparentColor[0]) ? 0 : 0xFF;
- *((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor( a, src[0], src[0], src[0]);
- } else if (_unfilteredSurface->bytesPerPixel == 2) { // Grayscale + alpha
- *((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor(src[1], src[0], src[0], src[0]);
- } else if (_unfilteredSurface->bytesPerPixel == 3) { // RGB
+ *dest = format.ARGBToColor( a, src[0], src[0], src[0]);
+ } else if (_unfilteredSurface->format.bytesPerPixel == 2) { // Grayscale + alpha
+ *dest = format.ARGBToColor(src[1], src[0], src[0], src[0]);
+ } else if (_unfilteredSurface->format.bytesPerPixel == 3) { // RGB
if (_transparentColorSpecified) {
bool isTransparentColor = (src[0] == _transparentColor[0] &&
src[1] == _transparentColor[1] &&
src[2] == _transparentColor[2]);
a = isTransparentColor ? 0 : 0xFF;
}
- *((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor( a, src[0], src[1], src[2]);
- } else if (_unfilteredSurface->bytesPerPixel == 4) { // RGBA
- *((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor(src[3], src[0], src[1], src[2]);
+ *dest = format.ARGBToColor( a, src[0], src[1], src[2]);
+ } else if (_unfilteredSurface->format.bytesPerPixel == 4) { // RGBA
+ *dest = format.ARGBToColor(src[3], src[0], src[1], src[2]);
}
}
- src += _unfilteredSurface->bytesPerPixel;
+ src += _unfilteredSurface->format.bytesPerPixel;
}
}
} else {
@@ -388,7 +391,8 @@ void PNG::constructImage() {
delete _unfilteredSurface;
}
_unfilteredSurface = new Graphics::Surface();
- _unfilteredSurface->create(_header.width, _header.height, (getNumColorChannels() * _header.bitDepth + 7) / 8);
+ // TODO/FIXME: It seems we can not properly determine the format here. But maybe there is a way...
+ _unfilteredSurface->create(_header.width, _header.height, PixelFormat((getNumColorChannels() * _header.bitDepth + 7) / 8, 0, 0, 0, 0, 0, 0, 0, 0));
scanLine = new byte[_unfilteredSurface->pitch];
dest = (byte *)_unfilteredSurface->getBasePtr(0, 0);
@@ -397,7 +401,7 @@ void PNG::constructImage() {
for (uint16 y = 0; y < _unfilteredSurface->h; y++) {
filterType = _imageData->readByte();
_imageData->read(scanLine, scanLineWidth);
- unfilterScanLine(dest, scanLine, prevLine, _unfilteredSurface->bytesPerPixel, filterType, scanLineWidth);
+ unfilterScanLine(dest, scanLine, prevLine, _unfilteredSurface->format.bytesPerPixel, filterType, scanLineWidth);
prevLine = dest;
dest += _unfilteredSurface->pitch;
}
diff --git a/graphics/png.h b/graphics/png.h
index 00c084da8e..21e0f35be1 100644
--- a/graphics/png.h
+++ b/graphics/png.h
@@ -31,8 +31,6 @@
#ifndef GRAPHICS_PNG_H
#define GRAPHICS_PNG_H
-#include "graphics/surface.h"
-
// PNG decoder, based on the W3C specs:
// http://www.w3.org/TR/PNG/
// Parts of the code have been adapted from LodePNG, by Lode Vandevenne:
@@ -54,12 +52,17 @@
// is a bit unclear. For now, these won't be supported, until a suitable sample
// is found.
+#include "common/scummsys.h"
+#include "common/textconsole.h"
+
namespace Common {
class SeekableReadStream;
}
namespace Graphics {
+struct Surface;
+
enum PNGColorType {
kGrayScale = 0, // bit depths: 1, 2, 4, 8, 16
kTrueColor = 2, // bit depths: 8, 16
@@ -117,18 +120,18 @@ public:
}
/**
- * Returns the palette of the specified PNG8 image.
- *
- * Note that the palette's format is RGBA.
+ * Returns the palette of the specified PNG8 image, given a pointer to
+ * an RGBA palette array (4 x 256).
*/
- void getPalette(byte *&palette, uint16 &entries) {
+ void getPalette(byte *palette, uint16 &entries) {
if (_header.colorType != kIndexed)
error("Palette requested for a non-indexed PNG");
- // TODO: It might be that this should really return a copy of the
- // palette, but since the implementation was like this I changed
- // the palette pointer to be a reference instead of a value copy.
- // Someone should check this code and verify this is as intended.
- palette = _palette;
+ for (int i = 0; i < 256; i++) {
+ palette[0 + i * 4] = _palette[0 + i * 4]; // R
+ palette[1 + i * 4] = _palette[1 + i * 4]; // G
+ palette[2 + i * 4] = _palette[2 + i * 4]; // B
+ palette[3 + i * 4] = _palette[3 + i * 4]; // A
+ }
entries = _paletteEntries;
}
diff --git a/graphics/scaler/scale2x.cpp b/graphics/scaler/scale2x.cpp
index deae44c1c7..ec2aa2086e 100644
--- a/graphics/scaler/scale2x.cpp
+++ b/graphics/scaler/scale2x.cpp
@@ -34,7 +34,6 @@
#include "common/scummsys.h"
-#include "graphics/scaler/intern.h"
#include "graphics/scaler/scale2x.h"
/***************************************************************************/
diff --git a/graphics/scaler/scale3x.cpp b/graphics/scaler/scale3x.cpp
index 4e78796ee7..788c8694c5 100644
--- a/graphics/scaler/scale3x.cpp
+++ b/graphics/scaler/scale3x.cpp
@@ -34,7 +34,6 @@
#include "common/scummsys.h"
-#include "graphics/scaler/intern.h"
#include "graphics/scaler/scale3x.h"
/***************************************************************************/
diff --git a/graphics/scaler/scalebit.cpp b/graphics/scaler/scalebit.cpp
index 706fea8f05..c6d2a0d752 100644
--- a/graphics/scaler/scalebit.cpp
+++ b/graphics/scaler/scalebit.cpp
@@ -35,7 +35,6 @@
#include "common/scummsys.h"
-#include "graphics/scaler/intern.h"
#include "graphics/scaler/scale2x.h"
#include "graphics/scaler/scale3x.h"
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index 5cee1c7a72..d78648c325 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -30,6 +30,7 @@
#include "graphics/colormasks.h"
#include "graphics/scaler.h"
#include "graphics/scaler/intern.h"
+#include "graphics/palette.h"
template<int bitFormat>
uint16 quadBlockInterpolate(const uint8 *src, uint32 srcPitch) {
@@ -99,12 +100,12 @@ static bool grabScreen565(Graphics::Surface *surf) {
if (!screen)
return false;
- assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2);
+ assert(screen->format.bytesPerPixel == 1 || screen->format.bytesPerPixel == 2);
assert(screen->pixels != 0);
Graphics::PixelFormat screenFormat = g_system->getScreenFormat();
- surf->create(screen->w, screen->h, 2);
+ surf->create(screen->w, screen->h, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
byte *palette = 0;
if (screenFormat.bytesPerPixel == 1) {
@@ -146,7 +147,7 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
// center MM NES screen
Graphics::Surface newscreen;
- newscreen.create(width, in.h, in.bytesPerPixel);
+ newscreen.create(width, in.h, in.format);
uint8 *dst = (uint8 *)newscreen.getBasePtr((320 - in.w) / 2, 0);
const uint8 *src = (const uint8 *)in.getBasePtr(0, 0);
@@ -171,13 +172,13 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
// cut off menu and so on..
Graphics::Surface newscreen;
- newscreen.create(width, 400, in.bytesPerPixel);
+ newscreen.create(width, 400, in.format);
uint8 *dst = (uint8 *)newscreen.getBasePtr(0, (400 - 240) / 2);
const uint8 *src = (const uint8 *)in.getBasePtr(41, 28);
for (int y = 0; y < 240; ++y) {
- memcpy(dst, src, 640 * in.bytesPerPixel);
+ memcpy(dst, src, 640 * in.format.bytesPerPixel);
dst += newscreen.pitch;
src += in.pitch;
}
@@ -190,9 +191,9 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
inHeight = 480;
Graphics::Surface newscreen;
- newscreen.create(width, 480, in.bytesPerPixel);
+ newscreen.create(width, 480, in.format);
- memcpy(newscreen.getBasePtr(0, 0), in.getBasePtr(0, 0), width * 440 * in.bytesPerPixel);
+ memcpy(newscreen.getBasePtr(0, 0), in.getBasePtr(0, 0), width * 440 * in.format.bytesPerPixel);
in.free();
in = newscreen;
@@ -200,7 +201,7 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
uint16 newHeight = !(inHeight % 240) ? kThumbnailHeight2 : kThumbnailHeight1;
- out.create(kThumbnailWidth, newHeight, sizeof(uint16));
+ out.create(kThumbnailWidth, newHeight, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
createThumbnail((const uint8 *)in.pixels, width * sizeof(uint16), (uint8 *)out.pixels, out.pitch, width, inHeight);
in.free();
@@ -223,7 +224,7 @@ bool createThumbnail(Graphics::Surface *surf, const uint8 *pixels, int w, int h,
assert(surf);
Graphics::Surface screen;
- screen.create(w, h, 2);
+ screen.create(w, h, Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0));
for (uint y = 0; y < screen.h; ++y) {
for (uint x = 0; x < screen.w; ++x) {
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index c581f9b265..caa53a4f63 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -31,6 +31,7 @@
#include "common/archive.h"
#include "common/endian.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "graphics/surface.h"
@@ -57,7 +58,7 @@ FontSJIS *FontSJIS::createFont(const Common::Platform platform) {
}
void FontSJIS::drawChar(Graphics::Surface &dst, uint16 ch, int x, int y, uint32 c1, uint32 c2) const {
- drawChar(dst.getBasePtr(x, y), ch, dst.pitch, dst.bytesPerPixel, c1, c2, dst.w - x, dst.h - y);
+ drawChar(dst.getBasePtr(x, y), ch, dst.pitch, dst.format.bytesPerPixel, c1, c2, dst.w - x, dst.h - y);
}
template<typename Color>
diff --git a/graphics/surface.cpp b/graphics/surface.cpp
index f06c24c2cd..88bdcfc822 100644
--- a/graphics/surface.cpp
+++ b/graphics/surface.cpp
@@ -24,7 +24,8 @@
#include "common/algorithm.h"
#include "common/util.h"
-#include "common/endian.h"
+#include "common/rect.h"
+#include "common/textconsole.h"
#include "graphics/primitives.h"
#include "graphics/surface.h"
@@ -40,23 +41,23 @@ static void plotPoint(int x, int y, int color, void *data) {
}
void Surface::drawLine(int x0, int y0, int x1, int y1, uint32 color) {
- if (bytesPerPixel == 1)
+ if (format.bytesPerPixel == 1)
Graphics::drawLine(x0, y0, x1, y1, color, plotPoint<byte>, this);
- else if (bytesPerPixel == 2)
+ else if (format.bytesPerPixel == 2)
Graphics::drawLine(x0, y0, x1, y1, color, plotPoint<uint16>, this);
else
error("Surface::drawLine: bytesPerPixel must be 1 or 2");
}
-void Surface::create(uint16 width, uint16 height, uint8 bytesPP) {
+void Surface::create(uint16 width, uint16 height, const PixelFormat &f) {
free();
w = width;
h = height;
- bytesPerPixel = bytesPP;
- pitch = w * bytesPP;
+ format = f;
+ pitch = w * format.bytesPerPixel;
- pixels = calloc(width * height, bytesPP);
+ pixels = calloc(width * height, format.bytesPerPixel);
assert(pixels);
}
@@ -64,11 +65,11 @@ void Surface::free() {
::free(pixels);
pixels = 0;
w = h = pitch = 0;
- bytesPerPixel = 0;
+ format = PixelFormat();
}
void Surface::copyFrom(const Surface &surf) {
- create(surf.w, surf.h, surf.bytesPerPixel);
+ create(surf.w, surf.h, surf.format);
memcpy(pixels, surf.pixels, h * pitch);
}
@@ -88,10 +89,10 @@ void Surface::hLine(int x, int y, int x2, uint32 color) {
if (x2 < x)
return;
- if (bytesPerPixel == 1) {
+ if (format.bytesPerPixel == 1) {
byte *ptr = (byte *)getBasePtr(x, y);
memset(ptr, (byte)color, x2-x+1);
- } else if (bytesPerPixel == 2) {
+ } else if (format.bytesPerPixel == 2) {
uint16 *ptr = (uint16 *)getBasePtr(x, y);
Common::set_to(ptr, ptr + (x2-x+1), (uint16)color);
} else {
@@ -112,13 +113,13 @@ void Surface::vLine(int x, int y, int y2, uint32 color) {
if (y2 >= h)
y2 = h - 1;
- if (bytesPerPixel == 1) {
+ if (format.bytesPerPixel == 1) {
byte *ptr = (byte *)getBasePtr(x, y);
while (y++ <= y2) {
*ptr = (byte)color;
ptr += pitch;
}
- } else if (bytesPerPixel == 2) {
+ } else if (format.bytesPerPixel == 2) {
uint16 *ptr = (uint16 *)getBasePtr(x, y);
while (y++ <= y2) {
*ptr = (uint16)color;
@@ -140,13 +141,13 @@ void Surface::fillRect(Common::Rect r, uint32 color) {
int height = r.height();
bool useMemset = true;
- if (bytesPerPixel == 2) {
+ if (format.bytesPerPixel == 2) {
lineLen *= 2;
if ((uint16)color != ((color & 0xff) | (color & 0xff) << 8))
useMemset = false;
- } else if (bytesPerPixel == 4) {
+ } else if (format.bytesPerPixel == 4) {
useMemset = false;
- } else if (bytesPerPixel != 1) {
+ } else if (format.bytesPerPixel != 1) {
error("Surface::fillRect: bytesPerPixel must be 1, 2 or 4");
}
@@ -157,7 +158,7 @@ void Surface::fillRect(Common::Rect r, uint32 color) {
ptr += pitch;
}
} else {
- if (bytesPerPixel == 2) {
+ if (format.bytesPerPixel == 2) {
uint16 *ptr = (uint16 *)getBasePtr(r.left, r.top);
while (height--) {
Common::set_to(ptr, ptr + width, (uint16)color);
@@ -185,7 +186,7 @@ void Surface::move(int dx, int dy, int height) {
if ((dx == 0 && dy == 0) || height <= 0)
return;
- if (bytesPerPixel != 1 && bytesPerPixel != 2)
+ if (format.bytesPerPixel != 1 && format.bytesPerPixel != 2)
error("Surface::move: bytesPerPixel must be 1 or 2");
byte *src, *dst;
@@ -215,37 +216,37 @@ void Surface::move(int dx, int dy, int height) {
// horizontal movement
if (dx > 0) {
// move right - copy from right to left
- dst = (byte *)pixels + (pitch - bytesPerPixel);
- src = dst - (dx * bytesPerPixel);
+ dst = (byte *)pixels + (pitch - format.bytesPerPixel);
+ src = dst - (dx * format.bytesPerPixel);
for (y = 0; y < height; y++) {
for (x = dx; x < w; x++) {
- if (bytesPerPixel == 1) {
+ if (format.bytesPerPixel == 1) {
*dst-- = *src--;
- } else if (bytesPerPixel == 2) {
+ } else if (format.bytesPerPixel == 2) {
*(uint16 *)dst = *(const uint16 *)src;
src -= 2;
dst -= 2;
}
}
- src += pitch + (pitch - dx * bytesPerPixel);
- dst += pitch + (pitch - dx * bytesPerPixel);
+ src += pitch + (pitch - dx * format.bytesPerPixel);
+ dst += pitch + (pitch - dx * format.bytesPerPixel);
}
} else if (dx < 0) {
// move left - copy from left to right
dst = (byte *)pixels;
- src = dst - (dx * bytesPerPixel);
+ src = dst - (dx * format.bytesPerPixel);
for (y = 0; y < height; y++) {
for (x = -dx; x < w; x++) {
- if (bytesPerPixel == 1) {
+ if (format.bytesPerPixel == 1) {
*dst++ = *src++;
- } else if (bytesPerPixel == 2) {
+ } else if (format.bytesPerPixel == 2) {
*(uint16 *)dst = *(const uint16 *)src;
src += 2;
dst += 2;
}
}
- src += pitch - (pitch + dx * bytesPerPixel);
- dst += pitch - (pitch + dx * bytesPerPixel);
+ src += pitch - (pitch + dx * format.bytesPerPixel);
+ dst += pitch - (pitch + dx * format.bytesPerPixel);
}
}
}
diff --git a/graphics/surface.h b/graphics/surface.h
index f9cb6cc474..1b54690aa9 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -26,7 +26,12 @@
#define GRAPHICS_SURFACE_H
#include "common/scummsys.h"
-#include "common/rect.h"
+
+namespace Common {
+struct Rect;
+}
+
+#include "graphics/pixelformat.h"
namespace Graphics {
@@ -65,14 +70,14 @@ struct Surface {
void *pixels;
/**
- * How many bytes a single pixel occupies.
+ * The pixel format of the surface.
*/
- uint8 bytesPerPixel;
+ PixelFormat format;
/**
* Construct a simple Surface object.
*/
- Surface() : w(0), h(0), pitch(0), pixels(0), bytesPerPixel(0) {
+ Surface() : w(0), h(0), pitch(0), pixels(0), format() {
}
/**
@@ -83,7 +88,7 @@ struct Surface {
* @return Pointer to the pixel.
*/
inline const void *getBasePtr(int x, int y) const {
- return (const byte *)(pixels) + y * pitch + x * bytesPerPixel;
+ return (const byte *)(pixels) + y * pitch + x * format.bytesPerPixel;
}
/**
@@ -94,7 +99,7 @@ struct Surface {
* @return Pointer to the pixel.
*/
inline void *getBasePtr(int x, int y) {
- return static_cast<byte *>(pixels) + y * pitch + x * bytesPerPixel;
+ return static_cast<byte *>(pixels) + y * pitch + x * format.bytesPerPixel;
}
/**
@@ -105,9 +110,9 @@ struct Surface {
*
* @param width Width of the surface object.
* @param height Height of the surface object.
- * @param bytePP The number of bytes a single pixel uses.
+ * @param format The pixel format the surface should use.
*/
- void create(uint16 width, uint16 height, uint8 bytesPP);
+ void create(uint16 width, uint16 height, const PixelFormat &format);
/**
* Release the memory used by the pixels memory of this surface. This is the
diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp
index 8688096c3d..32ab04ed24 100644
--- a/graphics/thumbnail.cpp
+++ b/graphics/thumbnail.cpp
@@ -28,6 +28,7 @@
#include "common/endian.h"
#include "common/system.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Graphics {
@@ -107,10 +108,10 @@ bool loadThumbnail(Common::SeekableReadStream &in, Graphics::Surface &to) {
return false;
}
- to.create(header.width, header.height, sizeof(OverlayColor));
+ Graphics::PixelFormat format = g_system->getOverlayFormat();
+ to.create(header.width, header.height, format);
OverlayColor *pixels = (OverlayColor *)to.pixels;
- Graphics::PixelFormat format = g_system->getOverlayFormat();
for (int y = 0; y < to.h; ++y) {
for (int x = 0; x < to.w; ++x) {
uint8 r, g, b;
@@ -139,18 +140,18 @@ bool saveThumbnail(Common::WriteStream &out) {
}
bool saveThumbnail(Common::WriteStream &out, const Graphics::Surface &thumb) {
- if (thumb.bytesPerPixel != 2) {
+ if (thumb.format.bytesPerPixel != 2) {
warning("trying to save thumbnail with bpp different than 2");
return false;
}
ThumbnailHeader header;
header.type = MKTAG('T','H','M','B');
- header.size = ThumbnailHeaderSize + thumb.w*thumb.h*thumb.bytesPerPixel;
+ header.size = ThumbnailHeaderSize + thumb.w*thumb.h*thumb.format.bytesPerPixel;
header.version = THMB_VERSION;
header.width = thumb.w;
header.height = thumb.h;
- header.bpp = thumb.bytesPerPixel;
+ header.bpp = thumb.format.bytesPerPixel;
out.writeUint32BE(header.type);
out.writeUint32BE(header.size);
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp
index 10939a677a..bae64f9303 100644
--- a/graphics/wincursor.cpp
+++ b/graphics/wincursor.cpp
@@ -23,12 +23,9 @@
*
*/
-#include "common/debug.h"
-#include "common/file.h"
-#include "common/memstream.h"
#include "common/ptr.h"
-#include "common/str.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "common/winexe_ne.h"
#include "common/winexe_pe.h"
diff --git a/graphics/wincursor.h b/graphics/wincursor.h
index ca0abf6fe1..717a1be588 100644
--- a/graphics/wincursor.h
+++ b/graphics/wincursor.h
@@ -30,9 +30,9 @@
#include "common/winexe.h"
namespace Common {
- class NEResources;
- class PEResources;
- class SeekableReadStream;
+class NEResources;
+class PEResources;
+class SeekableReadStream;
}
namespace Graphics {
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index e063e11674..78ea43ad79 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -24,7 +24,6 @@
*/
#include "common/system.h"
-#include "common/events.h"
#include "common/config-manager.h"
#include "common/file.h"
#include "common/fs.h"
@@ -32,14 +31,13 @@
#include "common/tokenizer.h"
#include "common/translation.h"
-#include "graphics/colormasks.h"
#include "graphics/cursorman.h"
#include "graphics/fontman.h"
#include "graphics/imagedec.h"
#include "graphics/surface.h"
#include "graphics/VectorRenderer.h"
-#include "gui/launcher.h"
+#include "gui/widget.h"
#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
#include "gui/ThemeParser.h"
@@ -373,8 +371,8 @@ const char *ThemeEngine::findModeConfigName(GraphicsMode mode) {
bool ThemeEngine::init() {
// reset everything and reload the graphics
_initOk = false;
- setGraphicsMode(_graphicsMode);
_overlayFormat = _system->getOverlayFormat();
+ setGraphicsMode(_graphicsMode);
if (_screen.pixels && _backBuffer.pixels) {
_initOk = true;
@@ -499,10 +497,10 @@ void ThemeEngine::setGraphicsMode(GraphicsMode mode) {
uint32 height = _system->getOverlayHeight();
_backBuffer.free();
- _backBuffer.create(width, height, _bytesPerPixel);
+ _backBuffer.create(width, height, _overlayFormat);
_screen.free();
- _screen.create(width, height, _bytesPerPixel);
+ _screen.create(width, height, _overlayFormat);
delete _vectorRenderer;
_vectorRenderer = Graphics::createRenderer(mode);
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 46065278d3..08560c8635 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -27,13 +27,25 @@
#define GUI_THEME_ENGINE_H
#include "common/scummsys.h"
-#include "common/system.h"
#include "common/fs.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
+#include "common/list.h"
+#include "common/str.h"
+
#include "graphics/surface.h"
#include "graphics/font.h"
+#include "graphics/pixelformat.h"
+
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.3"
+class OSystem;
+
+namespace Common {
+struct Rect;
+}
+
namespace Graphics {
struct DrawStep;
class VectorRenderer;
@@ -42,8 +54,6 @@ class VectorRenderer;
namespace GUI {
struct WidgetDrawData;
-struct DrawDataInfo;
-struct TextDataInfo;
struct TextDrawData;
struct TextColorData;
class Dialog;
diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp
index 017d47fd29..64e18f93a3 100644
--- a/gui/ThemeEval.cpp
+++ b/gui/ThemeEval.cpp
@@ -24,10 +24,10 @@
*/
#include "gui/ThemeEval.h"
-#include "gui/widget.h"
#include "graphics/scaler.h"
+#include "common/system.h"
#include "common/tokenizer.h"
namespace GUI {
diff --git a/gui/ThemeEval.h b/gui/ThemeEval.h
index ac867512da..65bed3e271 100644
--- a/gui/ThemeEval.h
+++ b/gui/ThemeEval.h
@@ -30,6 +30,8 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/stack.h"
+#include "common/str.h"
+#include "common/textconsole.h"
#include "graphics/font.h"
#include "gui/ThemeLayout.h"
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 3c930db73c..fbfc498bcb 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -25,14 +25,12 @@
#include "common/util.h"
#include "common/system.h"
-#include "common/events.h"
-#include "common/xmlparser.h"
-#include "gui/ThemeEval.h"
#include "gui/ThemeLayout.h"
-#ifdef LAYOUT_DEBUG_DIALOG
#include "graphics/font.h"
+
+#ifdef LAYOUT_DEBUG_DIALOG
#include "graphics/surface.h"
#endif
diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h
index 3d367df147..76d3f7d380 100644
--- a/gui/ThemeLayout.h
+++ b/gui/ThemeLayout.h
@@ -26,12 +26,13 @@
#ifndef THEME_LAYOUT_H
#define THEME_LAYOUT_H
+#include "common/array.h"
#include "common/rect.h"
+#include "graphics/font.h"
#ifdef LAYOUT_DEBUG_DIALOG
namespace Graphics {
- class Font;
- class Surface;
+class Surface;
}
#endif
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index e3523d11e8..230dad8cc5 100644
--- a/gui/ThemeParser.cpp
+++ b/gui/ThemeParser.cpp
@@ -26,10 +26,10 @@
#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
#include "gui/ThemeParser.h"
-#include "gui/gui-manager.h"
#include "graphics/VectorRenderer.h"
+#include "common/system.h"
#include "common/tokenizer.h"
namespace GUI {
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
index 7dec12d522..a7cb0610e7 100644
--- a/gui/Tooltip.cpp
+++ b/gui/Tooltip.cpp
@@ -23,7 +23,6 @@
*/
#include "common/util.h"
-#include "graphics/fontman.h"
#include "gui/widget.h"
#include "gui/dialog.h"
#include "gui/gui-manager.h"
diff --git a/gui/Tooltip.h b/gui/Tooltip.h
index d228ca8a49..f5e2bb08a8 100644
--- a/gui/Tooltip.h
+++ b/gui/Tooltip.h
@@ -25,11 +25,14 @@
#ifndef GUI_TOOLTIP_H
#define GUI_TOOLTIP_H
+#include "common/keyboard.h"
+#include "common/str-array.h"
#include "gui/dialog.h"
-#include "gui/widget.h"
namespace GUI {
+class Widget;
+
class Tooltip : public Dialog {
public:
Tooltip();
diff --git a/gui/about.cpp b/gui/about.cpp
index c2d9a3f983..0389f4c8da 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -31,8 +31,6 @@
#include "common/util.h"
#include "gui/about.h"
#include "gui/gui-manager.h"
-#include "gui/widget.h"
-
#include "gui/ThemeEval.h"
namespace GUI {
diff --git a/gui/about.h b/gui/about.h
index fc216a78dc..b49365c5e5 100644
--- a/gui/about.h
+++ b/gui/about.h
@@ -27,7 +27,8 @@
#include "gui/dialog.h"
#include "common/str.h"
-#include "graphics/surface.h"
+#include "common/array.h"
+#include "common/keyboard.h"
namespace GUI {
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 4ee6bafdde..2c7459623f 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -23,7 +23,6 @@
*/
#include "gui/browser.h"
-#include "gui/gui-manager.h"
#include "gui/widgets/list.h"
#include "common/config-manager.h"
diff --git a/gui/browser.h b/gui/browser.h
index 1fef041a5a..eb3498e654 100644
--- a/gui/browser.h
+++ b/gui/browser.h
@@ -26,13 +26,13 @@
#define BROWSER_DIALOG_H
#include "gui/dialog.h"
-#include "common/str.h"
#include "common/fs.h"
namespace GUI {
class ListWidget;
class StaticTextWidget;
+class CommandSender;
class BrowserDialog : public Dialog {
public:
diff --git a/gui/chooser.cpp b/gui/chooser.cpp
index f5e7d26a32..ecc8ebd894 100644
--- a/gui/chooser.cpp
+++ b/gui/chooser.cpp
@@ -22,10 +22,9 @@
* $Id$
*/
-#include "common/system.h"
#include "common/translation.h"
#include "gui/chooser.h"
-#include "gui/gui-manager.h"
+#include "gui/widget.h"
#include "gui/widgets/list.h"
namespace GUI {
diff --git a/gui/chooser.h b/gui/chooser.h
index ce67c008df..79a20383c5 100644
--- a/gui/chooser.h
+++ b/gui/chooser.h
@@ -25,12 +25,14 @@
#ifndef CHOOSER_DIALOG_H
#define CHOOSER_DIALOG_H
+#include "common/array.h"
#include "common/str.h"
#include "gui/dialog.h"
namespace GUI {
class ButtonWidget;
+class CommandSender;
class ListWidget;
/*
diff --git a/gui/console.cpp b/gui/console.cpp
index cb3319063d..cbab1b212e 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -27,10 +27,8 @@
#include "gui/ThemeEval.h"
#include "gui/gui-manager.h"
-#include "engines/engine.h"
#include "base/version.h"
-#include "common/events.h"
#include "common/system.h"
#include "graphics/fontman.h"
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index f113206ea1..2282bc3a1c 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -26,7 +26,6 @@
// NB: This is really only necessary if USE_READLINE is defined
#define FORBIDDEN_SYMBOL_ALLOW_ALL
-#include "common/debug.h"
#include "common/debug-channels.h"
#include "common/system.h"
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 2c2b0603d6..15e47141c8 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -22,14 +22,11 @@
* $Id$
*/
-#include "common/events.h"
+#include "common/rect.h"
#include "gui/gui-manager.h"
#include "gui/dialog.h"
#include "gui/widget.h"
-#include "gui/widgets/popup.h"
-
-#include "common/system.h"
namespace GUI {
diff --git a/gui/dialog.h b/gui/dialog.h
index 1845786044..c298ef107b 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -27,14 +27,14 @@
#include "common/scummsys.h"
#include "common/str.h"
+#include "common/keyboard.h"
#include "gui/object.h"
-#include "gui/widget.h"
+#include "gui/ThemeEngine.h"
namespace GUI {
-class GuiManager;
-class PopUpWidget;
+class Widget;
// Some "common" commands sent to handleCommand()
enum {
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 0cb06458ef..19ca66b7b1 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -27,7 +27,8 @@
#include "common/util.h"
#include "common/config-manager.h"
#include "common/algorithm.h"
-#include "common/timer.h"
+#include "common/rect.h"
+#include "common/textconsole.h"
#include "common/translation.h"
#include "backends/keymapper/keymapper.h"
@@ -37,6 +38,7 @@
#include "gui/ThemeEngine.h"
#include "gui/ThemeEval.h"
#include "gui/Tooltip.h"
+#include "gui/widget.h"
#include "graphics/cursorman.h"
diff --git a/gui/gui-manager.h b/gui/gui-manager.h
index a6c90bfe8d..ac4118bb06 100644
--- a/gui/gui-manager.h
+++ b/gui/gui-manager.h
@@ -30,13 +30,14 @@
#include "common/stack.h"
#include "common/str.h"
-#include "graphics/font.h"
-
-#include "gui/widget.h"
#include "gui/ThemeEngine.h"
class OSystem;
+namespace Graphics {
+class Font;
+}
+
namespace GUI {
class Dialog;
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 1d209ce71a..aed57decd3 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -28,7 +28,6 @@
#include "common/events.h"
#include "common/fs.h"
#include "common/util.h"
-#include "common/savefile.h"
#include "common/system.h"
#include "common/translation.h"
@@ -49,9 +48,6 @@
#include "graphics/cursorman.h"
-#include "audio/mididrv.h"
-
-
using Common::ConfigManager;
namespace GUI {
diff --git a/gui/launcher.h b/gui/launcher.h
index df9a6fb639..274fc45bb4 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -31,10 +31,13 @@
namespace GUI {
class BrowserDialog;
+class CommandSender;
class ListWidget;
+class ButtonWidget;
class GraphicsWidget;
-class SaveLoadChooser;
+class StaticTextWidget;
class EditTextWidget;
+class SaveLoadChooser;
Common::String addGameToConf(const GameDescriptor &result);
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 197caae675..80d580d2a0 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -24,14 +24,13 @@
#include "engines/metaengine.h"
#include "common/algorithm.h"
-#include "common/events.h"
-#include "common/func.h"
#include "common/config-manager.h"
+#include "common/debug.h"
+#include "common/system.h"
#include "common/translation.h"
#include "gui/launcher.h" // For addGameToConf()
#include "gui/massadd.h"
-#include "gui/gui-manager.h"
#include "gui/widget.h"
#include "gui/widgets/list.h"
@@ -63,6 +62,7 @@ enum {
MassAddDialog::MassAddDialog(const Common::FSNode &startDir)
: Dialog("MassAdd"),
_dirsScanned(0),
+ _oldGamesCount(0),
_okButton(0),
_dirProgressText(0),
_gameProgressText(0) {
@@ -213,8 +213,10 @@ void MassAddDialog::handleTickle() {
break;
}
}
- if (duplicate)
+ if (duplicate) {
+ _oldGamesCount++;
break; // Skip duplicates
+ }
}
result["path"] = path;
_games.push_back(result);
@@ -244,14 +246,14 @@ void MassAddDialog::handleTickle() {
snprintf(buf, sizeof(buf), "%s", _("Scan complete!"));
_dirProgressText->setLabel(buf);
- snprintf(buf, sizeof(buf), _("Discovered %d new games."), _games.size());
+ snprintf(buf, sizeof(buf), _("Discovered %d new games, ignored %d previously added games."), _games.size(), _oldGamesCount);
_gameProgressText->setLabel(buf);
} else {
snprintf(buf, sizeof(buf), _("Scanned %d directories ..."), _dirsScanned);
_dirProgressText->setLabel(buf);
- snprintf(buf, sizeof(buf), _("Discovered %d new games ..."), _games.size());
+ snprintf(buf, sizeof(buf), _("Discovered %d new games, ignored %d previously added games ..."), _games.size(), _oldGamesCount);
_gameProgressText->setLabel(buf);
}
diff --git a/gui/massadd.h b/gui/massadd.h
index 31a8821a26..6aad392b0d 100644
--- a/gui/massadd.h
+++ b/gui/massadd.h
@@ -30,7 +30,6 @@
#include "common/hashmap.h"
#include "common/stack.h"
#include "common/str.h"
-#include "common/hash-str.h"
namespace GUI {
@@ -63,6 +62,7 @@ private:
Common::HashMap<Common::String, StringArray> _pathToTargets;
int _dirsScanned;
+ int _oldGamesCount;
Widget *_okButton;
StaticTextWidget *_dirProgressText;
diff --git a/gui/message.cpp b/gui/message.cpp
index 2d097a75a9..5cb4cec3d3 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -22,7 +22,6 @@
* $Id$
*/
-#include "common/events.h"
#include "common/str.h"
#include "common/system.h"
#include "gui/message.h"
diff --git a/gui/message.h b/gui/message.h
index 912e3b0785..5c3308e425 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -30,6 +30,8 @@
namespace GUI {
+class CommandSender;
+
enum {
kMessageOK = 1,
kMessageCancel = 0
diff --git a/gui/object.cpp b/gui/object.cpp
index bf8e7a8642..6564fe2b68 100644
--- a/gui/object.cpp
+++ b/gui/object.cpp
@@ -22,7 +22,8 @@
* $Id$
*/
-#include "common/system.h"
+#include "common/textconsole.h"
+
#include "gui/object.h"
#include "gui/widget.h"
#include "gui/gui-manager.h"
diff --git a/gui/object.h b/gui/object.h
index fb5ff18290..3b181fd8a3 100644
--- a/gui/object.h
+++ b/gui/object.h
@@ -25,9 +25,11 @@
#ifndef GUI_OBJECT_H
#define GUI_OBJECT_H
+#include "common/scummsys.h"
+#include "common/str.h"
+
namespace GUI {
-class CommandReceiver;
class CommandSender;
class CommandReceiver {
diff --git a/gui/options.cpp b/gui/options.cpp
index a12630a0e7..547ab0f3c6 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -24,10 +24,8 @@
#include "gui/browser.h"
#include "gui/themebrowser.h"
-#include "gui/chooser.h"
#include "gui/message.h"
#include "gui/gui-manager.h"
-#include "gui/ThemeEval.h"
#include "gui/options.h"
#include "gui/widgets/popup.h"
#include "gui/widgets/tab.h"
@@ -35,10 +33,9 @@
#include "common/fs.h"
#include "common/config-manager.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "common/translation.h"
-#include "graphics/scaler.h"
-
#include "audio/mididrv.h"
#include "audio/musicplugin.h"
#include "audio/mixer.h"
diff --git a/gui/options.h b/gui/options.h
index 5cc13b5cf6..c097a3a9e9 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -27,7 +27,7 @@
#include "gui/dialog.h"
#include "common/str.h"
-#include "audio/musicplugin.h"
+#include "audio/mididrv.h"
#ifdef SMALL_SCREEN_DEVICE
#include "gui/KeysDialog.h"
@@ -35,13 +35,16 @@
namespace GUI {
-class BrowserDialog;
class CheckboxWidget;
class PopUpWidget;
class SliderWidget;
class StaticTextWidget;
-class ListWidget;
class TabWidget;
+class ButtonWidget;
+class CommandSender;
+class GuiObject;
+class RadiobuttonGroup;
+class RadiobuttonWidget;
class OptionsDialog : public Dialog {
public:
diff --git a/gui/saveload.h b/gui/saveload.h
index b3622c1f13..06f1251e11 100644
--- a/gui/saveload.h
+++ b/gui/saveload.h
@@ -32,6 +32,10 @@ namespace GUI {
class ListWidget;
class GraphicsWidget;
+class ButtonWidget;
+class CommandSender;
+class ContainerWidget;
+class StaticTextWidget;
class SaveLoadChooser : GUI::Dialog {
typedef Common::String String;
diff --git a/gui/themebrowser.h b/gui/themebrowser.h
index aba519886d..bd6b11fb46 100644
--- a/gui/themebrowser.h
+++ b/gui/themebrowser.h
@@ -33,8 +33,8 @@
namespace GUI {
+class CommandSender;
class ListWidget;
-class StaticTextWidget;
class ThemeBrowser : public Dialog {
public:
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index 0844880f28..86de121d1a 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 61f4a0e249..d3c8d3402d 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -22,10 +22,12 @@
* $Id$
*/
-#include "common/util.h"
-#include "graphics/fontman.h"
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/rect.h"
+#include "common/textconsole.h"
+#include "graphics/pixelformat.h"
#include "gui/widget.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
@@ -345,7 +347,7 @@ void PicButtonWidget::setGfx(const Graphics::Surface *gfx) {
void PicButtonWidget::drawWidget() {
g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), "", _state, getFlags());
- if (sizeof(OverlayColor) == _gfx.bytesPerPixel && _gfx.pixels) {
+ if (sizeof(OverlayColor) == _gfx.format.bytesPerPixel && _gfx.pixels) {
const int x = _x + (_w - _gfx.w) / 2;
const int y = _y + (_h - _gfx.h) / 2;
@@ -573,11 +575,12 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
if (h == -1)
h = _h;
+ Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
+
_gfx.free();
- _gfx.create(w, h, sizeof(OverlayColor));
+ _gfx.create(w, h, overlayFormat);
OverlayColor *dst = (OverlayColor *)_gfx.pixels;
- Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
OverlayColor fillCol = overlayFormat.RGBToColor(r, g, b);
while (h--) {
for (int i = 0; i < w; ++i) {
@@ -587,7 +590,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
}
void GraphicsWidget::drawWidget() {
- if (sizeof(OverlayColor) == _gfx.bytesPerPixel && _gfx.pixels) {
+ if (sizeof(OverlayColor) == _gfx.format.bytesPerPixel && _gfx.pixels) {
const int x = _x + (_w - _gfx.w) / 2;
const int y = _y + (_h - _gfx.h) / 2;
diff --git a/gui/widget.h b/gui/widget.h
index 1bb9823fdf..9acccd9684 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -26,17 +26,16 @@
#define GUI_WIDGET_H
#include "common/scummsys.h"
+#include "common/array.h"
#include "common/str.h"
-#include "common/str-array.h"
#include "common/keyboard.h"
+#include "graphics/font.h"
#include "graphics/surface.h"
#include "gui/object.h"
#include "gui/ThemeEngine.h"
namespace GUI {
-class Dialog;
-
enum {
WIDGET_ENABLED = 1 << 0,
WIDGET_INVISIBLE = 1 << 1,
diff --git a/gui/widgets/editable.cpp b/gui/widgets/editable.cpp
index 7d6e0fae01..2ee3575bc6 100644
--- a/gui/widgets/editable.cpp
+++ b/gui/widgets/editable.cpp
@@ -22,9 +22,11 @@
* $Id$
*/
-#include "common/events.h"
+#include "common/rect.h"
+#include "common/system.h"
#include "gui/widgets/editable.h"
#include "gui/gui-manager.h"
+#include "graphics/font.h"
namespace GUI {
diff --git a/gui/widgets/editable.h b/gui/widgets/editable.h
index b394e105d1..e0b6375919 100644
--- a/gui/widgets/editable.h
+++ b/gui/widgets/editable.h
@@ -25,9 +25,15 @@
#ifndef GUI_WIDGETS_EDITABLE_H
#define GUI_WIDGETS_EDITABLE_H
+#include "common/keyboard.h"
#include "common/str.h"
-#include "common/rect.h"
#include "gui/widget.h"
+#include "gui/ThemeEngine.h"
+#include "gui/object.h"
+
+namespace Common {
+struct Rect;
+}
namespace GUI {
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp
index 159943fcdd..106262bafe 100644
--- a/gui/widgets/edittext.cpp
+++ b/gui/widgets/edittext.cpp
@@ -23,7 +23,6 @@
*/
#include "gui/widgets/edittext.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp
index 1e13226d61..1f7846c503 100644
--- a/gui/widgets/list.cpp
+++ b/gui/widgets/list.cpp
@@ -23,7 +23,6 @@
*/
#include "common/system.h"
-#include "common/events.h"
#include "common/frac.h"
#include "common/tokenizer.h"
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 02cbd940b2..cab556065f 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -23,11 +23,9 @@
*/
#include "common/system.h"
-#include "common/events.h"
#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/widgets/popup.h"
-#include "engines/engine.h"
#include "gui/ThemeEval.h"
diff --git a/gui/widgets/scrollbar.cpp b/gui/widgets/scrollbar.cpp
index 5e963e04fe..38383c0e55 100644
--- a/gui/widgets/scrollbar.cpp
+++ b/gui/widgets/scrollbar.cpp
@@ -22,11 +22,12 @@
* $Id$
*/
+#include "common/rect.h"
+#include "common/system.h"
+#include "common/timer.h"
#include "gui/widgets/scrollbar.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
-
-#include "common/timer.h"
+#include "gui/ThemeEngine.h"
namespace GUI {
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index 10baeac901..721fb88cf8 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -24,7 +24,6 @@
#include "common/util.h"
#include "gui/widgets/tab.h"
-#include "gui/dialog.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
diff --git a/po/es_ES.po b/po/es_ES.po
index 83dec86e81..0aa90fe5c0 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
"POT-Creation-Date: 2011-04-22 19:33+0100\n"
-"PO-Revision-Date: 2010-09-25 17:11+0100\n"
+"PO-Revision-Date: 2011-04-27 11:06+0100\n"
"Last-Translator: Tomás Maidagan\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -592,11 +592,11 @@ msgstr "Corregir relación de aspecto en juegos 320x200"
#: gui/options.cpp:676
msgid "EGA undithering"
-msgstr ""
+msgstr "Difuminado EGA"
#: gui/options.cpp:676
msgid "Enable undithering in EGA games that support it"
-msgstr ""
+msgstr "Activar difuminado en los juegos EGA compatibles"
#: gui/options.cpp:684
msgid "Preferred Device:"
@@ -657,11 +657,11 @@ msgstr "Especifica el dispositivo de salida General MIDI por defecto"
#: gui/options.cpp:745
msgid "Don't use General MIDI music"
-msgstr ""
+msgstr "No usar música General MIDI"
#: gui/options.cpp:756 gui/options.cpp:817
msgid "Use first available device"
-msgstr ""
+msgstr "Utilizar el primer dispositivo disponible"
#: gui/options.cpp:768
msgid "SoundFont:"
@@ -726,9 +726,8 @@ msgid "Turns off General MIDI mapping for games with Roland MT-32 soundtrack"
msgstr "Desactiva la conversión General MIDI en juegos con sonido Roland MT-32"
#: gui/options.cpp:807
-#, fuzzy
msgid "Don't use Roland MT-32 music"
-msgstr "Roland MT-32 real (sin emulación GM)"
+msgstr "No usar música Roland MT-32"
#: gui/options.cpp:834
msgid "Text and Speech:"
@@ -902,6 +901,8 @@ msgid ""
"The theme you selected does not support your current language. If you want "
"to use this theme you need to switch to another language first."
msgstr ""
+"El tema seleccionado no es compatible con el idioma actual. Si quieres usar "
+"este tema debes cambiar a otro idioma primero."
#: gui/saveload.cpp:61 gui/saveload.cpp:242
msgid "No date saved"
@@ -1002,20 +1003,17 @@ msgstr "No se ha podido encontrar ningún motor capaz de ejecutar el juego"
#: common/error.cpp:42
msgid "No error"
-msgstr ""
+msgstr "Ningún error"
#: common/error.cpp:44
-#, fuzzy
msgid "Game data not found"
msgstr "No se han encontrado datos de juego"
#: common/error.cpp:46
-#, fuzzy
msgid "Game id not supported"
msgstr "ID del juego no soportada"
#: common/error.cpp:48
-#, fuzzy
msgid "Unsupported color mode"
msgstr "Modo de color no soportado"
@@ -1028,7 +1026,6 @@ msgid "Write permission denied"
msgstr "Permiso de escritura denegado"
#: common/error.cpp:56
-#, fuzzy
msgid "Path does not exist"
msgstr "La ruta no existe"
@@ -1045,7 +1042,6 @@ msgid "Cannot create file"
msgstr "Imposible crear el archivo"
#: common/error.cpp:65
-#, fuzzy
msgid "Reading data failed"
msgstr "Fallo de lectura"
@@ -1055,19 +1051,17 @@ msgstr "Fallo en la escritura de datos"
#: common/error.cpp:70
msgid "Could not find suitable engine plugin"
-msgstr ""
+msgstr "No se ha encontrado un plugin adecuado"
#: common/error.cpp:72
-#, fuzzy
msgid "Engine plugin does not support save states"
-msgstr "El motor no soporta el nivel de debug '%s'"
+msgstr "El plugin del motor no es compatible con partidas guardadas"
#: common/error.cpp:75
msgid "Command line argument not processed"
-msgstr ""
+msgstr "Argumento no válido de la línea de comando"
#: common/error.cpp:79
-#, fuzzy
msgid "Unknown error"
msgstr "Error desconocido"
@@ -1166,35 +1160,31 @@ msgstr "Cerra~r~"
#: engines/scumm/help.cpp:76
msgid "Common keyboard commands:"
-msgstr ""
+msgstr "Comandos básicos de teclado:"
#: engines/scumm/help.cpp:77
msgid "Save / Load dialog"
-msgstr ""
+msgstr "Pantalla de Guardar / Cargar"
#: engines/scumm/help.cpp:79
-#, fuzzy
msgid "Skip line of text"
msgstr "Saltar frase"
#: engines/scumm/help.cpp:80
msgid "Esc"
-msgstr ""
+msgstr "Esc"
#: engines/scumm/help.cpp:80
-#, fuzzy
msgid "Skip cutscene"
-msgstr "Saltar frase"
+msgstr "Saltar escena"
#: engines/scumm/help.cpp:81
-#, fuzzy
msgid "Space"
-msgstr "Voz"
+msgstr "Espacio"
#: engines/scumm/help.cpp:81
-#, fuzzy
msgid "Pause game"
-msgstr "Guardar partida"
+msgstr "Pausar el juego"
#: engines/scumm/help.cpp:82 engines/scumm/help.cpp:87
#: engines/scumm/help.cpp:98 engines/scumm/help.cpp:99
@@ -1202,23 +1192,21 @@ msgstr "Guardar partida"
#: engines/scumm/help.cpp:102 engines/scumm/help.cpp:103
#: engines/scumm/help.cpp:104 engines/scumm/help.cpp:105
msgid "Ctrl"
-msgstr ""
+msgstr "Ctrl"
#: engines/scumm/help.cpp:82
-#, fuzzy
msgid "Load game state 1-10"
-msgstr "Cargar juego:"
+msgstr "Cargar partida 1-10"
#: engines/scumm/help.cpp:83 engines/scumm/help.cpp:87
#: engines/scumm/help.cpp:89 engines/scumm/help.cpp:103
#: engines/scumm/help.cpp:104 engines/scumm/help.cpp:105
msgid "Alt"
-msgstr ""
+msgstr "Alt"
#: engines/scumm/help.cpp:83
-#, fuzzy
msgid "Save game state 1-10"
-msgstr "Guardar partida"
+msgstr "Guardar partida 1-10"
#: engines/scumm/help.cpp:85 engines/scumm/help.cpp:87
#: backends/platform/symbian/src/SymbianActions.cpp:55
@@ -1229,478 +1217,464 @@ msgstr "Salir"
#: engines/scumm/help.cpp:89 engines/scumm/help.cpp:92
msgid "Enter"
-msgstr ""
+msgstr "Enter"
#: engines/scumm/help.cpp:89
msgid "Toggle fullscreen"
-msgstr ""
+msgstr "Activar pantalla completa"
#: engines/scumm/help.cpp:90
-#, fuzzy
msgid "Music volume up / down"
-msgstr "Música:"
+msgstr "Subir / Bajar el volumen de la música"
#: engines/scumm/help.cpp:91
msgid "Text speed slower / faster"
-msgstr ""
+msgstr "Aumentar/disminuir la velocidad de texto"
#: engines/scumm/help.cpp:92
msgid "Simulate left mouse button"
-msgstr ""
+msgstr "Simular botón izquierdo del ratón"
#: engines/scumm/help.cpp:93
msgid "Tab"
-msgstr ""
+msgstr "Tab"
#: engines/scumm/help.cpp:93
msgid "Simulate right mouse button"
-msgstr ""
+msgstr "Simular botón derecho del ratón"
#: engines/scumm/help.cpp:96
msgid "Special keyboard commands:"
-msgstr ""
+msgstr "Comandos especiales de teclado:"
#: engines/scumm/help.cpp:97
-#, fuzzy
msgid "Show / Hide console"
-msgstr "Mostrar/ocultar cursor"
+msgstr "Mostrar / Ocultar consola"
#: engines/scumm/help.cpp:98
msgid "Start the debugger"
-msgstr ""
+msgstr "Iniciar debugger"
#: engines/scumm/help.cpp:99
msgid "Show memory consumption"
-msgstr ""
+msgstr "Mostrar consumo de memoria"
#: engines/scumm/help.cpp:100
msgid "Run in fast mode (*)"
-msgstr ""
+msgstr "Ejecutar en modo rápido (*)"
#: engines/scumm/help.cpp:101
msgid "Run in really fast mode (*)"
-msgstr ""
+msgstr "Ejecutar en modo muy rápido (*)"
#: engines/scumm/help.cpp:102
msgid "Toggle mouse capture"
-msgstr ""
+msgstr "Captura de ratón"
#: engines/scumm/help.cpp:103
msgid "Switch between graphics filters"
-msgstr ""
+msgstr "Alternar entre filtros gráficos"
#: engines/scumm/help.cpp:104
msgid "Increase / Decrease scale factor"
-msgstr ""
+msgstr "Aumentar / Disminuir factor de escalado"
#: engines/scumm/help.cpp:105
-#, fuzzy
msgid "Toggle aspect-ratio correction"
msgstr "Corrección de aspecto"
#: engines/scumm/help.cpp:110
msgid "* Note that using ctrl-f and"
-msgstr ""
+msgstr "* No se recomienda utilizar"
#: engines/scumm/help.cpp:111
msgid " ctrl-g are not recommended"
-msgstr ""
+msgstr " ctrl-f y ctrl-g, ya que pueden"
#: engines/scumm/help.cpp:112
msgid " since they may cause crashes"
-msgstr ""
+msgstr " provocar cuelgues o"
#: engines/scumm/help.cpp:113
msgid " or incorrect game behaviour."
-msgstr ""
+msgstr " un funcionamiento incorrecto del juego"
#: engines/scumm/help.cpp:117
msgid "Spinning drafts on the keyboard:"
-msgstr ""
+msgstr "Tejer hechizos con el teclado:"
#: engines/scumm/help.cpp:119
-#, fuzzy
msgid "Main game controls:"
-msgstr "Cambiar opciones de juego"
+msgstr "Controles básicos:"
#: engines/scumm/help.cpp:124 engines/scumm/help.cpp:139
#: engines/scumm/help.cpp:164
-#, fuzzy
msgid "Push"
-msgstr "Pausar"
+msgstr "Empujar"
#: engines/scumm/help.cpp:125 engines/scumm/help.cpp:140
#: engines/scumm/help.cpp:165
msgid "Pull"
-msgstr ""
+msgstr "Tirar"
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:199
#: engines/scumm/help.cpp:209
msgid "Give"
-msgstr ""
+msgstr "Dar"
#: engines/scumm/help.cpp:127 engines/scumm/help.cpp:142
#: engines/scumm/help.cpp:167 engines/scumm/help.cpp:192
#: engines/scumm/help.cpp:210
msgid "Open"
-msgstr ""
+msgstr "Abrir"
#: engines/scumm/help.cpp:129
-#, fuzzy
msgid "Go to"
-msgstr "Arriba"
+msgstr "Ir a"
#: engines/scumm/help.cpp:130
msgid "Get"
-msgstr ""
+msgstr "Coger"
#: engines/scumm/help.cpp:131 engines/scumm/help.cpp:155
#: engines/scumm/help.cpp:173 engines/scumm/help.cpp:200
#: engines/scumm/help.cpp:215 engines/scumm/help.cpp:226
#: engines/scumm/help.cpp:251
msgid "Use"
-msgstr ""
+msgstr "Usar"
#: engines/scumm/help.cpp:132 engines/scumm/help.cpp:144
msgid "Read"
-msgstr ""
+msgstr "Leer"
#: engines/scumm/help.cpp:133 engines/scumm/help.cpp:150
msgid "New kid"
-msgstr ""
+msgstr "Cambiar personaje"
#: engines/scumm/help.cpp:134 engines/scumm/help.cpp:156
#: engines/scumm/help.cpp:174
msgid "Turn on"
-msgstr ""
+msgstr "Encender"
#: engines/scumm/help.cpp:135 engines/scumm/help.cpp:157
#: engines/scumm/help.cpp:175
-#, fuzzy
msgid "Turn off"
-msgstr "Sonido activado/desactivado"
+msgstr "Apagar"
#: engines/scumm/help.cpp:145 engines/scumm/help.cpp:170
#: engines/scumm/help.cpp:196
msgid "Walk to"
-msgstr ""
+msgstr "Ir a"
#: engines/scumm/help.cpp:146 engines/scumm/help.cpp:171
#: engines/scumm/help.cpp:197 engines/scumm/help.cpp:212
#: engines/scumm/help.cpp:229
msgid "Pick up"
-msgstr ""
+msgstr "Recoger"
#: engines/scumm/help.cpp:147 engines/scumm/help.cpp:172
msgid "What is"
-msgstr ""
+msgstr "Qué es"
#: engines/scumm/help.cpp:149
msgid "Unlock"
-msgstr ""
+msgstr "Abrir con llave"
#: engines/scumm/help.cpp:152
msgid "Put on"
-msgstr ""
+msgstr "Ponerse"
#: engines/scumm/help.cpp:153
msgid "Take off"
-msgstr ""
+msgstr "Quitarse"
#: engines/scumm/help.cpp:159
msgid "Fix"
-msgstr ""
+msgstr "Arreglar"
#: engines/scumm/help.cpp:161
-#, fuzzy
msgid "Switch"
-msgstr "Voz"
+msgstr "Cambiar"
#: engines/scumm/help.cpp:169 engines/scumm/help.cpp:230
msgid "Look"
-msgstr ""
+msgstr "Mirar"
#: engines/scumm/help.cpp:176 engines/scumm/help.cpp:225
msgid "Talk"
-msgstr ""
+msgstr "Hablar"
#: engines/scumm/help.cpp:177
-#, fuzzy
msgid "Travel"
-msgstr "Guardar"
+msgstr "Viajar"
#: engines/scumm/help.cpp:178
msgid "To Henry / To Indy"
-msgstr ""
+msgstr "Henry / Indy"
#: engines/scumm/help.cpp:181
msgid "play C minor on distaff"
-msgstr ""
+msgstr "Tocar C menor con el bastón"
#: engines/scumm/help.cpp:182
msgid "play D on distaff"
-msgstr ""
+msgstr "Tocar D con el bastón"
#: engines/scumm/help.cpp:183
msgid "play E on distaff"
-msgstr ""
+msgstr "Tocar E con el bastón"
#: engines/scumm/help.cpp:184
msgid "play F on distaff"
-msgstr ""
+msgstr "Tocar F con el bastón"
#: engines/scumm/help.cpp:185
msgid "play G on distaff"
-msgstr ""
+msgstr "Tocar G con el bastón"
#: engines/scumm/help.cpp:186
msgid "play A on distaff"
-msgstr ""
+msgstr "Tocar A con el bastón"
#: engines/scumm/help.cpp:187
msgid "play B on distaff"
-msgstr ""
+msgstr "Tocar B con el bastón"
#: engines/scumm/help.cpp:188
msgid "play C major on distaff"
-msgstr ""
+msgstr "Tocar C mayor con el bastón"
#: engines/scumm/help.cpp:194 engines/scumm/help.cpp:216
msgid "puSh"
-msgstr ""
+msgstr "Empujar"
#: engines/scumm/help.cpp:195 engines/scumm/help.cpp:217
msgid "pull (Yank)"
-msgstr ""
+msgstr "Tirar"
#: engines/scumm/help.cpp:198 engines/scumm/help.cpp:214
#: engines/scumm/help.cpp:249
msgid "Talk to"
-msgstr ""
+msgstr "Hablar con"
#: engines/scumm/help.cpp:201 engines/scumm/help.cpp:213
msgid "Look at"
-msgstr ""
+msgstr "Mirar"
#: engines/scumm/help.cpp:202
msgid "turn oN"
-msgstr ""
+msgstr "Encender"
#: engines/scumm/help.cpp:203
msgid "turn oFf"
-msgstr ""
+msgstr "Apagar"
#: engines/scumm/help.cpp:219
-#, fuzzy
msgid "KeyUp"
-msgstr "Teclas"
+msgstr "Arriba"
#: engines/scumm/help.cpp:219
msgid "Highlight prev dialogue"
-msgstr ""
+msgstr "Seleccionar diálogo anterior"
#: engines/scumm/help.cpp:220
-#, fuzzy
msgid "KeyDown"
msgstr "Abajo"
#: engines/scumm/help.cpp:220
msgid "Highlight next dialogue"
-msgstr ""
+msgstr "Seleccionar diálogo siguiente"
#: engines/scumm/help.cpp:224
msgid "Walk"
-msgstr ""
+msgstr "Caminar"
#: engines/scumm/help.cpp:227 engines/scumm/help.cpp:236
#: engines/scumm/help.cpp:243 engines/scumm/help.cpp:250
msgid "Inventory"
-msgstr ""
+msgstr "Inventario"
#: engines/scumm/help.cpp:228
msgid "Object"
-msgstr ""
+msgstr "Objeto"
#: engines/scumm/help.cpp:231
msgid "Black and White / Color"
-msgstr ""
+msgstr "Blanco y negro / Color"
#: engines/scumm/help.cpp:234
msgid "Eyes"
-msgstr ""
+msgstr "Ojos"
#: engines/scumm/help.cpp:235
-#, fuzzy
msgid "Tongue"
-msgstr "Zona"
+msgstr "Lengua"
#: engines/scumm/help.cpp:237
msgid "Punch"
-msgstr ""
+msgstr "Puñetazo"
#: engines/scumm/help.cpp:238
msgid "Kick"
-msgstr ""
+msgstr "Patada"
#: engines/scumm/help.cpp:241 engines/scumm/help.cpp:248
msgid "Examine"
-msgstr ""
+msgstr "Examinar"
#: engines/scumm/help.cpp:242
msgid "Regular cursor"
-msgstr ""
+msgstr "Cursor normal"
#: engines/scumm/help.cpp:244
msgid "Comm"
-msgstr ""
+msgstr "Comm"
#: engines/scumm/help.cpp:247
msgid "Save / Load / Options"
-msgstr ""
+msgstr "Guardar / Cargar / Opciones"
#: engines/scumm/help.cpp:256
-#, fuzzy
msgid "Other game controls:"
-msgstr "Cambiar opciones de juego"
+msgstr "Otros controles:"
#: engines/scumm/help.cpp:258 engines/scumm/help.cpp:268
msgid "Inventory:"
-msgstr ""
+msgstr "Inventario:"
#: engines/scumm/help.cpp:259 engines/scumm/help.cpp:275
msgid "Scroll list up"
-msgstr ""
+msgstr "Subir"
#: engines/scumm/help.cpp:260 engines/scumm/help.cpp:276
msgid "Scroll list down"
-msgstr ""
+msgstr "Bajar"
#: engines/scumm/help.cpp:261 engines/scumm/help.cpp:269
msgid "Upper left item"
-msgstr ""
+msgstr "Objeto superior izquierdo"
#: engines/scumm/help.cpp:262 engines/scumm/help.cpp:271
msgid "Lower left item"
-msgstr ""
+msgstr "Objeto inferior izquierdo"
#: engines/scumm/help.cpp:263 engines/scumm/help.cpp:272
msgid "Upper right item"
-msgstr ""
+msgstr "Objeto superior derecho"
#: engines/scumm/help.cpp:264 engines/scumm/help.cpp:274
msgid "Lower right item"
-msgstr ""
+msgstr "Objeto inferior derecho"
#: engines/scumm/help.cpp:270
msgid "Middle left item"
-msgstr ""
+msgstr "Objeto izquierdo del medio"
#: engines/scumm/help.cpp:273
msgid "Middle right item"
-msgstr ""
+msgstr "Objeto derecho del medio"
#: engines/scumm/help.cpp:280 engines/scumm/help.cpp:285
-#, fuzzy
msgid "Switching characters:"
-msgstr "Cambiar personaje"
+msgstr "Cambiar personaje:"
#: engines/scumm/help.cpp:282
msgid "Second kid"
-msgstr ""
+msgstr "Segundo chaval"
#: engines/scumm/help.cpp:283
msgid "Third kid"
-msgstr ""
+msgstr "Tercer chaval"
#: engines/scumm/help.cpp:295
msgid "Fighting controls (numpad):"
-msgstr ""
+msgstr "Controles de lucha (tecl. num.)"
#: engines/scumm/help.cpp:296 engines/scumm/help.cpp:297
#: engines/scumm/help.cpp:298
msgid "Step back"
-msgstr ""
+msgstr "Retroceder"
#: engines/scumm/help.cpp:299
msgid "Block high"
-msgstr ""
+msgstr "Bloqueo alto"
#: engines/scumm/help.cpp:300
msgid "Block middle"
-msgstr ""
+msgstr "Bloqueo medio"
#: engines/scumm/help.cpp:301
msgid "Block low"
-msgstr ""
+msgstr "Bloqueo bajo"
#: engines/scumm/help.cpp:302
msgid "Punch high"
-msgstr ""
+msgstr "Puñetazo alto"
#: engines/scumm/help.cpp:303
msgid "Punch middle"
-msgstr ""
+msgstr "Puñetazo medio"
#: engines/scumm/help.cpp:304
msgid "Punch low"
-msgstr ""
+msgstr "Puñetazo bajo"
#: engines/scumm/help.cpp:307
msgid "These are for Indy on left."
-msgstr ""
+msgstr "Válidos cuando Indy está a la izquierda."
#: engines/scumm/help.cpp:308
msgid "When Indy is on the right,"
-msgstr ""
+msgstr "Cuando Indy está a la derecha,"
#: engines/scumm/help.cpp:309
msgid "7, 4, and 1 are switched with"
-msgstr ""
+msgstr "7, 4 y 1 se cambian por"
#: engines/scumm/help.cpp:310
msgid "9, 6, and 3, respectively."
-msgstr ""
+msgstr "9, 6 y 3, respectivamente."
#: engines/scumm/help.cpp:317
msgid "Biplane controls (numpad):"
-msgstr ""
+msgstr "Controles del biplano (tecl. num.)"
#: engines/scumm/help.cpp:318
msgid "Fly to upper left"
-msgstr ""
+msgstr "Volar arriba y a la izquierda"
#: engines/scumm/help.cpp:319
msgid "Fly to left"
-msgstr ""
+msgstr "Volar a la izquierda"
#: engines/scumm/help.cpp:320
msgid "Fly to lower left"
-msgstr ""
+msgstr "Volar abajo y a la izquierda"
#: engines/scumm/help.cpp:321
msgid "Fly upwards"
-msgstr ""
+msgstr "Volar arriba"
#: engines/scumm/help.cpp:322
msgid "Fly straight"
-msgstr ""
+msgstr "Volar recto"
#: engines/scumm/help.cpp:323
msgid "Fly down"
-msgstr ""
+msgstr "Volar abajo"
#: engines/scumm/help.cpp:324
msgid "Fly to upper right"
-msgstr ""
+msgstr "Volar arriba y a la derecha"
#: engines/scumm/help.cpp:325
msgid "Fly to right"
-msgstr ""
+msgstr "Volar a la derecha"
#: engines/scumm/help.cpp:326
msgid "Fly to lower right"
-msgstr ""
+msgstr "Volar abajo y a la derecha"
#: engines/scumm/scumm.cpp:2255 engines/agos/saveload.cpp:192
#, c-format
@@ -1741,6 +1715,9 @@ msgid ""
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
"directory inside the Tentacle game directory."
msgstr ""
+"Maniac Mansion debería arrancar en este momento, pero ScummVM aún no lo "
+"permite. Para jugar, ve a 'Añadir juego' en el menú de inicio de ScummVM y "
+"selecciona el directorio 'Maniac', dentro del directorio de DOTT."
#: engines/mohawk/dialogs.cpp:89 engines/mohawk/dialogs.cpp:127
msgid "~Z~ip Mode Activated"
@@ -1921,15 +1898,15 @@ msgstr "Normal"
#: backends/graphics/opengl/opengl-graphics.cpp:133
msgid "OpenGL Normal"
-msgstr ""
+msgstr "OpenGL Normal"
#: backends/graphics/opengl/opengl-graphics.cpp:134
msgid "OpenGL Conserve"
-msgstr ""
+msgstr "OpenGL Conserve"
#: backends/graphics/opengl/opengl-graphics.cpp:135
msgid "OpenGL Original"
-msgstr ""
+msgstr "OpenGL Original"
#: backends/platform/symbian/src/SymbianActions.cpp:41
#: backends/platform/wince/CEActionsSmartphone.cpp:42
@@ -2218,34 +2195,38 @@ msgid "Do you want to perform an automatic scan ?"
msgstr "¿Quieres realizar una búsqueda automática?"
#: backends/platform/wince/wince-sdl.cpp:486
-#, fuzzy
msgid "Map right click action"
-msgstr "Clic derecho"
+msgstr "Asignar acción 'Clic derecho'"
#: backends/platform/wince/wince-sdl.cpp:490
msgid "You must map a key to the 'Right Click' action to play this game"
msgstr ""
+"Debes asignar una tecla a la acción 'Clic derecho' para jugar a este juego"
#: backends/platform/wince/wince-sdl.cpp:499
msgid "Map hide toolbar action"
-msgstr ""
+msgstr "Asignar acción 'Ocultar barra de tareas'"
#: backends/platform/wince/wince-sdl.cpp:503
msgid "You must map a key to the 'Hide toolbar' action to play this game"
msgstr ""
+"Debes asignar una tecla a la acción 'Ocultar barra de tareas' para jugar a "
+"este juego"
#: backends/platform/wince/wince-sdl.cpp:512
msgid "Map Zoom Up action (optional)"
-msgstr ""
+msgstr "Asignar acción 'Zoom' (opcional)"
#: backends/platform/wince/wince-sdl.cpp:515
msgid "Map Zoom Down action (optional)"
-msgstr ""
+msgstr "Asignar acción 'Disminuir zoom' (opcional)"
#: backends/platform/wince/wince-sdl.cpp:523
msgid ""
"Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory"
msgstr ""
+"No olvides asignar una tecla a la acción 'Ocultar barra de tareas' para ver "
+"todo el inventario"
#~ msgid "Invalid Path"
#~ msgstr "Ruta no válida"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index b131e7da4d..e73d2c8345 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
"POT-Creation-Date: 2011-04-22 19:33+0100\n"
-"PO-Revision-Date: 2011-04-22 19:40+0100\n"
+"PO-Revision-Date: 2011-05-02 19:50+0100\n"
"Last-Translator: Thierry Crozat <criezy@scummvm.org>\n"
"Language-Team: French <scummvm-devel@lists.sf.net>\n"
"MIME-Version: 1.0\n"
@@ -593,14 +593,12 @@ msgid "Correct aspect ratio for 320x200 games"
msgstr "Corrige le rapport d'aspect pour les jeu 320x200"
#: gui/options.cpp:676
-#, fuzzy
msgid "EGA undithering"
-msgstr "Désactiver tramage EGA"
+msgstr "Détramage EGA"
#: gui/options.cpp:676
-#, fuzzy
msgid "Enable undithering in EGA games that support it"
-msgstr "Désactive le tramage dans les jeux EGA"
+msgstr "Active le détramage dans les jeux EGA qui le supporte"
#: gui/options.cpp:684
msgid "Preferred Device:"
@@ -1010,14 +1008,13 @@ msgstr "Impossible de trouver un moteur pour exécuter le jeu sélectionné"
#: common/error.cpp:42
msgid "No error"
-msgstr ""
+msgstr "Pas d'erreur"
#: common/error.cpp:44
msgid "Game data not found"
msgstr "Fichier de donées introuvable"
#: common/error.cpp:46
-#, fuzzy
msgid "Game id not supported"
msgstr "ID de jeu non supporté"
@@ -1059,19 +1056,17 @@ msgstr "Echec de l'écriture des données"
#: common/error.cpp:70
msgid "Could not find suitable engine plugin"
-msgstr ""
+msgstr "Aucun plugin n'a pu être trouvé pour ce jeu"
#: common/error.cpp:72
-#, fuzzy
msgid "Engine plugin does not support save states"
-msgstr "Le niveau de debug '%s' n'est pas supporté par ce moteur de jeu"
+msgstr "Ce moteur de jeu ne supporte pas les sauvegardes"
#: common/error.cpp:75
msgid "Command line argument not processed"
-msgstr ""
+msgstr "Argument de ligne de commande non traité"
#: common/error.cpp:79
-#, fuzzy
msgid "Unknown error"
msgstr "Erreur inconnue"
@@ -1202,7 +1197,7 @@ msgstr "Mettre en pause:"
#: engines/scumm/help.cpp:102 engines/scumm/help.cpp:103
#: engines/scumm/help.cpp:104 engines/scumm/help.cpp:105
msgid "Ctrl"
-msgstr ""
+msgstr "Ctrl"
#: engines/scumm/help.cpp:82
msgid "Load game state 1-10"
@@ -1212,7 +1207,7 @@ msgstr "Charger sauvegarde 1-10:"
#: engines/scumm/help.cpp:89 engines/scumm/help.cpp:103
#: engines/scumm/help.cpp:104 engines/scumm/help.cpp:105
msgid "Alt"
-msgstr ""
+msgstr "Alt"
#: engines/scumm/help.cpp:83
msgid "Save game state 1-10"
@@ -1311,7 +1306,7 @@ msgstr " un comportement incorrect du jeu"
#: engines/scumm/help.cpp:117
msgid "Spinning drafts on the keyboard:"
-msgstr ""
+msgstr "Filage au clavier:"
#: engines/scumm/help.cpp:119
msgid "Main game controls:"
@@ -1481,18 +1476,16 @@ msgid "turn oFf"
msgstr "Éteindre"
#: engines/scumm/help.cpp:219
-#, fuzzy
msgid "KeyUp"
-msgstr "Touches"
+msgstr "Touche Haut"
#: engines/scumm/help.cpp:219
msgid "Highlight prev dialogue"
msgstr "Sélectionner le dialogue précédent"
#: engines/scumm/help.cpp:220
-#, fuzzy
msgid "KeyDown"
-msgstr "Bas"
+msgstr "Touche Bas"
#: engines/scumm/help.cpp:220
msgid "Highlight next dialogue"
@@ -1557,35 +1550,35 @@ msgstr "Inventaires:"
#: engines/scumm/help.cpp:259 engines/scumm/help.cpp:275
msgid "Scroll list up"
-msgstr ""
+msgstr "Faire défiler vers le haut"
#: engines/scumm/help.cpp:260 engines/scumm/help.cpp:276
msgid "Scroll list down"
-msgstr ""
+msgstr "Faire défiler vers le bas"
#: engines/scumm/help.cpp:261 engines/scumm/help.cpp:269
msgid "Upper left item"
-msgstr ""
+msgstr "Élément en haut à gauche"
#: engines/scumm/help.cpp:262 engines/scumm/help.cpp:271
msgid "Lower left item"
-msgstr ""
+msgstr "Élément en bas à gauche"
#: engines/scumm/help.cpp:263 engines/scumm/help.cpp:272
msgid "Upper right item"
-msgstr ""
+msgstr "Élément en haut à droite"
#: engines/scumm/help.cpp:264 engines/scumm/help.cpp:274
msgid "Lower right item"
-msgstr ""
+msgstr "Élément en bas à droite"
#: engines/scumm/help.cpp:270
msgid "Middle left item"
-msgstr ""
+msgstr "Élément au milieu à gauche"
#: engines/scumm/help.cpp:273
msgid "Middle right item"
-msgstr ""
+msgstr "Élément au milieu à droite"
#: engines/scumm/help.cpp:280 engines/scumm/help.cpp:285
msgid "Switching characters:"
@@ -1911,15 +1904,15 @@ msgstr "Normal"
#: backends/graphics/opengl/opengl-graphics.cpp:133
msgid "OpenGL Normal"
-msgstr ""
+msgstr "OpenGL Normal"
#: backends/graphics/opengl/opengl-graphics.cpp:134
msgid "OpenGL Conserve"
-msgstr ""
+msgstr "OpenGL Préserve"
#: backends/graphics/opengl/opengl-graphics.cpp:135
msgid "OpenGL Original"
-msgstr ""
+msgstr "OpenGL Originel"
#: backends/platform/symbian/src/SymbianActions.cpp:41
#: backends/platform/wince/CEActionsSmartphone.cpp:42
diff --git a/po/pl_PL.po b/po/pl_PL.po
index 6fb09dd31e..d6e5b9b5e8 100644
--- a/po/pl_PL.po
+++ b/po/pl_PL.po
@@ -5,10 +5,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: ScummVM 1.2.0\n"
+"Project-Id-Version: ScummVM 1.3.0\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
"POT-Creation-Date: 2011-04-22 19:33+0100\n"
-"PO-Revision-Date: 2011-01-10 19:42+0100\n"
+"PO-Revision-Date: 2011-05-02 12:09+0100\n"
"Last-Translator: \n"
"Language-Team: Grajpopolsku.pl <grajpopolsku@gmail.com>\n"
"MIME-Version: 1.0\n"
@@ -999,20 +999,17 @@ msgstr "Nie uda³o siê znale¼æ silnika zdolnego do uruchomienia zaznaczonej gry"
#: common/error.cpp:42
msgid "No error"
-msgstr ""
+msgstr "Brak b³êdu"
#: common/error.cpp:44
-#, fuzzy
msgid "Game data not found"
msgstr "Nie znaleziono plików gry"
#: common/error.cpp:46
-#, fuzzy
msgid "Game id not supported"
msgstr "Identyfikator gry nie jest wspierany"
#: common/error.cpp:48
-#, fuzzy
msgid "Unsupported color mode"
msgstr "Niewspierany tryb kolorów"
@@ -1025,7 +1022,6 @@ msgid "Write permission denied"
msgstr "Brak praw do zapisu"
#: common/error.cpp:56
-#, fuzzy
msgid "Path does not exist"
msgstr "¦cie¿ka nie istnieje"
@@ -1042,9 +1038,8 @@ msgid "Cannot create file"
msgstr "Nie mo¿na utworzyæ pliku"
#: common/error.cpp:65
-#, fuzzy
msgid "Reading data failed"
-msgstr "Odczyt nieudany"
+msgstr "Odczyt danych nieudany"
#: common/error.cpp:67
msgid "Writing data failed"
@@ -1052,19 +1047,17 @@ msgstr "Zapisywanie danych nie powiod³o siê"
#: common/error.cpp:70
msgid "Could not find suitable engine plugin"
-msgstr ""
+msgstr "Nie uda³o siê znale¼æ odpowiedniej wtyczki silnika"
#: common/error.cpp:72
-#, fuzzy
msgid "Engine plugin does not support save states"
-msgstr "Silnik nie wspiera poziomu debugowania '%s'"
+msgstr "Silnik nie wspiera zapisu stanu gry"
#: common/error.cpp:75
msgid "Command line argument not processed"
-msgstr ""
+msgstr "Argument wiersza poleceñ nie zosta³ przetworzony"
#: common/error.cpp:79
-#, fuzzy
msgid "Unknown error"
msgstr "Nieznany b³±d"
@@ -1718,6 +1711,9 @@ msgid ""
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
"directory inside the Tentacle game directory."
msgstr ""
+"Zwykle w tym momencie uruchomi³oby siê Maniac Mansion, ale ScummVM jeszcze "
+"tego nie obs³uguje. Aby zagraæ, u¿yj \"Dodaj grê...\" z menu startowego "
+"ScummVM i wybierz podkatalog \"Maniac\" z katalogu gry Tentacle."
#: engines/mohawk/dialogs.cpp:89 engines/mohawk/dialogs.cpp:127
msgid "~Z~ip Mode Activated"
diff --git a/po/se_SE.po b/po/se_SE.po
index b633663c3d..0bf6f3ac8b 100644
--- a/po/se_SE.po
+++ b/po/se_SE.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
"POT-Creation-Date: 2011-04-22 19:33+0100\n"
-"PO-Revision-Date: 2011-03-21 13:45+0100\n"
+"PO-Revision-Date: 2011-05-02 13:07+0100\n"
"Last-Translator: Hampus Flink <hampus.flink@gmail.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -23,15 +23,16 @@ msgstr ""
#: gui/about.cpp:96
#, c-format
msgid "(built on %s)"
-msgstr ""
+msgstr "(byggt på %s)"
#: gui/about.cpp:103
+#, fuzzy
msgid "Features compiled in:"
-msgstr ""
+msgstr "Funktioner kompilerade i:"
#: gui/about.cpp:112
msgid "Available engines:"
-msgstr ""
+msgstr "Tillgängliga motorer"
#: gui/browser.cpp:70
msgid "Go up"
@@ -1003,15 +1004,13 @@ msgstr "Kunde inte hitta en motor kapabel till att köra det valda spelet"
#: common/error.cpp:42
msgid "No error"
-msgstr ""
+msgstr "Inget fel"
#: common/error.cpp:44
-#, fuzzy
msgid "Game data not found"
msgstr "Kunde inte hitta speldata"
#: common/error.cpp:46
-#, fuzzy
msgid "Game id not supported"
msgstr "Spel-ID stöds inte"
@@ -1029,7 +1028,6 @@ msgid "Write permission denied"
msgstr "Skrivtillbehörighet nekad"
#: common/error.cpp:56
-#, fuzzy
msgid "Path does not exist"
msgstr "Sökvägen existerar inte"
@@ -1056,7 +1054,7 @@ msgstr "Skriva data misslyckades"
#: common/error.cpp:70
msgid "Could not find suitable engine plugin"
-msgstr ""
+msgstr "Kunde inte hitta lämpligt motortillägg"
#: common/error.cpp:72
#, fuzzy
@@ -1064,11 +1062,11 @@ msgid "Engine plugin does not support save states"
msgstr "Motorn stöder inte debug-nivå '%s'"
#: common/error.cpp:75
+#, fuzzy
msgid "Command line argument not processed"
-msgstr ""
+msgstr "Argument i kommandoraden ej verkställt"
#: common/error.cpp:79
-#, fuzzy
msgid "Unknown error"
msgstr "Okänt fel"
@@ -1722,6 +1720,9 @@ msgid ""
"play it, go to 'Add Game' in the ScummVM start menu and select the 'Maniac' "
"directory inside the Tentacle game directory."
msgstr ""
+"Vanligtvis hade Maniac Mansion startat nu, men ScummVM kan inte göra detta "
+"än. För att spela spelet, gå till \"Lägg till spel\" i ScummVM:s huvudmeny "
+"och välj \"Maniac\"-katalogen inuti \"Tentacle\" katalogen."
#: engines/mohawk/dialogs.cpp:89 engines/mohawk/dialogs.cpp:127
msgid "~Z~ip Mode Activated"
diff --git a/ports.mk b/ports.mk
index aa687441d4..06ca61fa19 100644
--- a/ports.mk
+++ b/ports.mk
@@ -180,6 +180,8 @@ endif
cp $(srcdir)/README $(WIN32PATH)/README.txt
cp /usr/local/README-SDL.txt $(WIN32PATH)
cp /usr/local/bin/SDL.dll $(WIN32PATH)
+ cp $(srcdir)/icons/scummvm.ico $(WIN32PATH)
+ cp $(srcdir)/dists/win32/ScummVM.iss $(WIN32PATH)
unix2dos $(WIN32PATH)/*.txt
# Special target to create a win32 installer
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 715741f41d..47322c86b7 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -23,10 +23,9 @@
*
*/
-#include "common/endian.h"
-#include "common/file.h"
#include "common/stream.h"
-#include "common/events.h"
+#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
@@ -407,7 +406,7 @@ Codec *AviDecoder::createCodec() {
case ID_IV32:
return new Indeo3Decoder(_bmInfo.width, _bmInfo.height);
#endif
-#ifdef GRAPHICS_TRUEMOTION1_H
+#ifdef VIDEO_CODECS_TRUEMOTION1_H
case ID_DUCK:
return new TrueMotion1Decoder(_bmInfo.width, _bmInfo.height);
#endif
diff --git a/video/avi_decoder.h b/video/avi_decoder.h
index 33189910c7..0154b57ea6 100644
--- a/video/avi_decoder.h
+++ b/video/avi_decoder.h
@@ -26,13 +26,34 @@
#ifndef VIDEO_AVI_PLAYER_H
#define VIDEO_AVI_PLAYER_H
+#include "common/endian.h"
+#include "common/rational.h"
+#include "common/rect.h"
+#include "common/str.h"
+
#include "video/video_decoder.h"
-#include "video/codecs/codec.h"
-#include "audio/audiostream.h"
#include "audio/mixer.h"
+namespace Audio {
+class QueuingAudioStream;
+}
+
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Video {
+class Codec;
+
#define UNKNOWN_HEADER(a) error("Unknown header found -- \'%s\'", tag2str(a))
// IDs used throughout the AVI files
diff --git a/video/codecs/cdtoons.cpp b/video/codecs/cdtoons.cpp
index d4552b78d7..51e3c23eaa 100644
--- a/video/codecs/cdtoons.cpp
+++ b/video/codecs/cdtoons.cpp
@@ -24,9 +24,9 @@
*/
#include "video/codecs/cdtoons.h"
+#include "common/rect.h"
#include "common/stream.h"
-
-#include "common/system.h"
+#include "common/textconsole.h"
namespace Video {
@@ -54,7 +54,7 @@ CDToonsDecoder::CDToonsDecoder(uint16 width, uint16 height) {
debugN(5, "CDToons: width %d, height %d\n", width, height);
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_currentPaletteId = 0;
memset(_palette, 0, 256 * 3);
diff --git a/video/codecs/cinepak.cpp b/video/codecs/cinepak.cpp
index 2f5cb73561..2a782dbafe 100644
--- a/video/codecs/cinepak.cpp
+++ b/video/codecs/cinepak.cpp
@@ -25,7 +25,13 @@
#include "video/codecs/cinepak.h"
+#include "common/debug.h"
+#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/util.h"
+
+#include "graphics/surface.h"
// Code here partially based off of ffmpeg ;)
@@ -89,7 +95,7 @@ const Graphics::Surface *CinepakDecoder::decodeImage(Common::SeekableReadStream
if (!_curFrame.surface) {
_curFrame.surface = new Graphics::Surface();
- _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat.bytesPerPixel);
+ _curFrame.surface->create(_curFrame.width, _curFrame.height, _pixelFormat);
}
// Reset the y variable.
diff --git a/video/codecs/cinepak.h b/video/codecs/cinepak.h
index 8b4c0216a3..34e4fe98eb 100644
--- a/video/codecs/cinepak.h
+++ b/video/codecs/cinepak.h
@@ -27,13 +27,19 @@
#define VIDEO_CODECS_CINEPAK_H
#include "common/scummsys.h"
-#include "common/stream.h"
#include "common/rect.h"
-#include "graphics/surface.h"
#include "graphics/pixelformat.h"
#include "video/codecs/codec.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Video {
struct CinepakCodebook {
diff --git a/video/codecs/indeo3.cpp b/video/codecs/indeo3.cpp
index e7f470bd3a..b4f6c6ffe3 100644
--- a/video/codecs/indeo3.cpp
+++ b/video/codecs/indeo3.cpp
@@ -35,8 +35,8 @@
#include "common/system.h"
#include "common/endian.h"
-#include "common/frac.h"
-#include "common/file.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
#include "graphics/conversion.h"
@@ -51,7 +51,7 @@ Indeo3Decoder::Indeo3Decoder(uint16 width, uint16 height) : _ModPred(0), _correc
_pixelFormat = g_system->getScreenFormat();
_surface = new Graphics::Surface;
- _surface->create(width, height, _pixelFormat.bytesPerPixel);
+ _surface->create(width, height, _pixelFormat);
buildModPred();
allocFrames();
@@ -322,10 +322,10 @@ const Graphics::Surface *Indeo3Decoder::decodeImage(Common::SeekableReadStream *
const uint32 color = _pixelFormat.RGBToColor(r, g, b);
- for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->bytesPerPixel) {
- if (_surface->bytesPerPixel == 1)
+ for (uint32 sW = 0; sW < scaleWidth; sW++, rowDest += _surface->format.bytesPerPixel) {
+ if (_surface->format.bytesPerPixel == 1)
*((uint8 *)rowDest) = (uint8)color;
- else if (_surface->bytesPerPixel == 2)
+ else if (_surface->format.bytesPerPixel == 2)
*((uint16 *)rowDest) = (uint16)color;
}
}
diff --git a/video/codecs/mjpeg.cpp b/video/codecs/mjpeg.cpp
index d6ec391a84..2ef854039b 100644
--- a/video/codecs/mjpeg.cpp
+++ b/video/codecs/mjpeg.cpp
@@ -24,10 +24,16 @@
*/
#include "common/system.h"
-#include "graphics/conversion.h" // For YUV2RGB
+#include "common/textconsole.h"
+#include "graphics/jpeg.h"
+#include "graphics/surface.h"
#include "video/codecs/mjpeg.h"
+namespace Common {
+class SeekableReadStream;
+}
+
namespace Video {
JPEGDecoder::JPEGDecoder() : Codec() {
@@ -53,7 +59,7 @@ const Graphics::Surface *JPEGDecoder::decodeImage(Common::SeekableReadStream* st
if (!_surface) {
_surface = new Graphics::Surface();
- _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat.bytesPerPixel);
+ _surface->create(_jpeg->getWidth(), _jpeg->getHeight(), _pixelFormat);
}
Graphics::Surface *frame = _jpeg->getSurface(_pixelFormat);
diff --git a/video/codecs/mjpeg.h b/video/codecs/mjpeg.h
index c9f931f091..d1395a8248 100644
--- a/video/codecs/mjpeg.h
+++ b/video/codecs/mjpeg.h
@@ -26,12 +26,18 @@
#ifndef VIDEO_CODECS_MJPEG_H
#define VIDEO_CODECS_MJPEG_H
-#include "common/scummsys.h"
-
#include "video/codecs/codec.h"
-#include "graphics/jpeg.h"
#include "graphics/pixelformat.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+class JPEG;
+struct Surface;
+}
+
namespace Video {
// Motion JPEG Decoder
diff --git a/video/codecs/msrle.cpp b/video/codecs/msrle.cpp
index 46158c49d7..19309bc7aa 100644
--- a/video/codecs/msrle.cpp
+++ b/video/codecs/msrle.cpp
@@ -27,12 +27,13 @@
#include "video/codecs/msrle.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Video {
MSRLEDecoder::MSRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) {
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_bitsPerPixel = bitsPerPixel;
}
diff --git a/video/codecs/msvideo1.cpp b/video/codecs/msvideo1.cpp
index 2075d7f013..93e9aaae64 100644
--- a/video/codecs/msvideo1.cpp
+++ b/video/codecs/msvideo1.cpp
@@ -27,6 +27,7 @@
#include "video/codecs/msvideo1.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Video {
@@ -38,7 +39,8 @@ namespace Video {
MSVideo1Decoder::MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() {
_surface = new Graphics::Surface();
- _surface->create(width, height, (bitsPerPixel == 8) ? 1 : 2);
+ // TODO: Specify the correct pixel format for 2Bpp mode.
+ _surface->create(width, height, (bitsPerPixel == 8) ? Graphics::PixelFormat::createFormatCLUT8() : Graphics::PixelFormat(2, 0, 0, 0, 0, 0, 0, 0, 0));
_bitsPerPixel = bitsPerPixel;
}
diff --git a/video/codecs/qdm2.cpp b/video/codecs/qdm2.cpp
index 61e59c8aba..8126b57a95 100644
--- a/video/codecs/qdm2.cpp
+++ b/video/codecs/qdm2.cpp
@@ -34,8 +34,9 @@
#include "video/codecs/qdm2data.h"
#include "common/array.h"
+#include "common/debug.h"
#include "common/stream.h"
-#include "common/system.h"
+#include "common/textconsole.h"
namespace Video {
diff --git a/video/codecs/qdm2.h b/video/codecs/qdm2.h
index a6acf3a83e..b224e801a6 100644
--- a/video/codecs/qdm2.h
+++ b/video/codecs/qdm2.h
@@ -30,11 +30,11 @@
#define VIDEO_CODECS_QDM2_H
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Audio {
- class AudioStream;
+class AudioStream;
}
namespace Video {
diff --git a/video/codecs/qtrle.cpp b/video/codecs/qtrle.cpp
index 26b2f02ce1..0ae27f6284 100644
--- a/video/codecs/qtrle.cpp
+++ b/video/codecs/qtrle.cpp
@@ -28,9 +28,11 @@
#include "video/codecs/qtrle.h"
+#include "common/debug.h"
#include "common/scummsys.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "graphics/colormasks.h"
#include "graphics/surface.h"
@@ -48,7 +50,7 @@ QTRLEDecoder::QTRLEDecoder(uint16 width, uint16 height, byte bitsPerPixel) : Cod
debug(2, "QTRLE corrected width: %d", width);
_surface = new Graphics::Surface();
- _surface->create(width, height, _bitsPerPixel <= 8 ? 1 : _pixelFormat.bytesPerPixel);
+ _surface->create(width, height, _bitsPerPixel <= 8 ? Graphics::PixelFormat::createFormatCLUT8() : _pixelFormat);
}
#define CHECK_STREAM_PTR(n) \
diff --git a/video/codecs/rpza.cpp b/video/codecs/rpza.cpp
index cc9739b673..0c06661c50 100644
--- a/video/codecs/rpza.cpp
+++ b/video/codecs/rpza.cpp
@@ -27,8 +27,10 @@
#include "video/codecs/rpza.h"
+#include "common/debug.h"
#include "common/system.h"
#include "common/stream.h"
+#include "common/textconsole.h"
#include "graphics/colormasks.h"
namespace Video {
@@ -44,7 +46,7 @@ RPZADecoder::RPZADecoder(uint16 width, uint16 height) : Codec() {
debug(2, "RPZA corrected width: %d", width);
_surface = new Graphics::Surface();
- _surface->create(width, height, _pixelFormat.bytesPerPixel);
+ _surface->create(width, height, _pixelFormat);
}
RPZADecoder::~RPZADecoder() {
diff --git a/video/codecs/smc.cpp b/video/codecs/smc.cpp
index d03c60490f..bbd6073497 100644
--- a/video/codecs/smc.cpp
+++ b/video/codecs/smc.cpp
@@ -27,6 +27,7 @@
#include "video/codecs/smc.h"
#include "common/stream.h"
+#include "common/textconsole.h"
namespace Video {
@@ -49,7 +50,7 @@ namespace Video {
SMCDecoder::SMCDecoder(uint16 width, uint16 height) {
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
}
SMCDecoder::~SMCDecoder() {
diff --git a/video/codecs/truemotion1.cpp b/video/codecs/truemotion1.cpp
index a0456869ab..70c456d4a8 100644
--- a/video/codecs/truemotion1.cpp
+++ b/video/codecs/truemotion1.cpp
@@ -32,6 +32,8 @@
#include "video/codecs/truemotion1data.h"
#include "common/stream.h"
+#include "common/textconsole.h"
+#include "common/util.h"
namespace Video {
@@ -92,7 +94,7 @@ TrueMotion1Decoder::TrueMotion1Decoder(uint16 width, uint16 height) {
_width = width;
_height = height;
- _surface->create(width, height, 2);
+ _surface->create(width, height, getPixelFormat());
// there is a vertical predictor for each pixel in a line; each vertical
// predictor is 0 to start with
diff --git a/video/coktel_decoder.cpp b/video/coktel_decoder.cpp
index 0ab12e91cc..4448c9162e 100644
--- a/video/coktel_decoder.cpp
+++ b/video/coktel_decoder.cpp
@@ -24,6 +24,13 @@
*/
#include "common/scummsys.h"
+#include "common/rect.h"
+#include "common/endian.h"
+#include "common/stream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/types.h"
+#include "common/util.h"
#include "video/coktel_decoder.h"
@@ -92,11 +99,12 @@ void CoktelDecoder::setSurfaceMemory(void *mem, uint16 width, uint16 height, uin
assert(bpp == getPixelFormat().bytesPerPixel);
// Create a surface over this memory
- _surface.w = width;
- _surface.h = height;
- _surface.pitch = width * bpp;
- _surface.pixels = mem;
- _surface.bytesPerPixel = bpp;
+ _surface.w = width;
+ _surface.h = height;
+ _surface.pitch = width * bpp;
+ _surface.pixels = mem;
+ // TODO: Check whether it is fine to assume we want the setup PixelFormat.
+ _surface.format = getPixelFormat();
_ownSurface = false;
}
@@ -127,18 +135,18 @@ void CoktelDecoder::createSurface() {
return;
if ((_width > 0) && (_height > 0))
- _surface.create(_width, _height, getPixelFormat().bytesPerPixel);
+ _surface.create(_width, _height, getPixelFormat());
_ownSurface = true;
}
void CoktelDecoder::freeSurface() {
if (!_ownSurface) {
- _surface.w = 0;
- _surface.h = 0;
- _surface.pitch = 0;
- _surface.pixels = 0;
- _surface.bytesPerPixel = 0;
+ _surface.w = 0;
+ _surface.h = 0;
+ _surface.pitch = 0;
+ _surface.pixels = 0;
+ _surface.format = Graphics::PixelFormat();
} else
_surface.free();
@@ -449,11 +457,11 @@ void CoktelDecoder::renderBlockWhole(Graphics::Surface &dstSurf, const byte *src
rect.clip(dstSurf.w, dstSurf.h);
- byte *dst = (byte *)dstSurf.pixels + (rect.top * dstSurf.pitch) + rect.left * dstSurf.bytesPerPixel;
+ byte *dst = (byte *)dstSurf.pixels + (rect.top * dstSurf.pitch) + rect.left * dstSurf.format.bytesPerPixel;
for (int i = 0; i < rect.height(); i++) {
- memcpy(dst, src, rect.width() * dstSurf.bytesPerPixel);
+ memcpy(dst, src, rect.width() * dstSurf.format.bytesPerPixel);
- src += srcRect.width() * dstSurf.bytesPerPixel;
+ src += srcRect.width() * dstSurf.format.bytesPerPixel;
dst += dstSurf.pitch;
}
}
@@ -1375,12 +1383,12 @@ bool IMDDecoder::renderFrame(Common::Rect &rect) {
if ((type == 2) && (rect.width() == _surface.w) && (_x == 0)) {
// Directly uncompress onto the video surface
- const int offsetX = rect.left * _surface.bytesPerPixel;
+ const int offsetX = rect.left * _surface.format.bytesPerPixel;
const int offsetY = (_y + rect.top) * _surface.pitch;
const int offset = offsetX + offsetY;
if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
- _surface.w * _surface.h * _surface.bytesPerPixel - offset))
+ _surface.w * _surface.h * _surface.format.bytesPerPixel - offset))
return true;
}
@@ -1806,11 +1814,11 @@ bool VMDDecoder::assessVideoProperties() {
_videoBuffer[i] = new byte[_videoBufferSize];
memset(_videoBuffer[i], 0, _videoBufferSize);
- _8bppSurface[i].w = _width * _bytesPerPixel;
- _8bppSurface[i].h = _height;
- _8bppSurface[i].pitch = _width * _bytesPerPixel;
- _8bppSurface[i].pixels = _videoBuffer[i];
- _8bppSurface[i].bytesPerPixel = 1;
+ _8bppSurface[i].w = _width * _bytesPerPixel;
+ _8bppSurface[i].h = _height;
+ _8bppSurface[i].pitch = _width * _bytesPerPixel;
+ _8bppSurface[i].pixels = _videoBuffer[i];
+ _8bppSurface[i].format = Graphics::PixelFormat::createFormatCLUT8();
}
}
@@ -2223,12 +2231,12 @@ bool VMDDecoder::renderFrame(Common::Rect &rect) {
if ((type == 2) && (rect.width() == _surface.w) && (_x == 0) && (_blitMode == 0)) {
// Directly uncompress onto the video surface
- const int offsetX = rect.left * _surface.bytesPerPixel;
+ const int offsetX = rect.left * _surface.format.bytesPerPixel;
const int offsetY = (_y + rect.top) * _surface.pitch;
const int offset = offsetX - offsetY;
if (deLZ77((byte *)_surface.pixels + offset, dataPtr, dataSize,
- _surface.w * _surface.h * _surface.bytesPerPixel - offset))
+ _surface.w * _surface.h * _surface.format.bytesPerPixel - offset))
return true;
}
@@ -2338,13 +2346,13 @@ void VMDDecoder::blit16(const Graphics::Surface &srcSurf, Common::Rect &rect) {
const byte *src = (byte *)srcSurf.pixels +
(srcRect.top * srcSurf.pitch) + srcRect.left * _bytesPerPixel;
byte *dst = (byte *)_surface.pixels +
- ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.bytesPerPixel;
+ ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.format.bytesPerPixel;
for (int i = 0; i < rect.height(); i++) {
const byte *srcRow = src;
byte *dstRow = dst;
- for (int j = 0; j < rect.width(); j++, srcRow += 2, dstRow += _surface.bytesPerPixel) {
+ for (int j = 0; j < rect.width(); j++, srcRow += 2, dstRow += _surface.format.bytesPerPixel) {
uint16 data = READ_LE_UINT16(srcRow);
byte r = ((data & 0x7C00) >> 10) << 3;
@@ -2355,7 +2363,7 @@ void VMDDecoder::blit16(const Graphics::Surface &srcSurf, Common::Rect &rect) {
if ((r == 0) && (g == 0) && (b == 0))
c = 0;
- if (_surface.bytesPerPixel == 2)
+ if (_surface.format.bytesPerPixel == 2)
*((uint16 *)dstRow) = (uint16) c;
}
@@ -2376,13 +2384,13 @@ void VMDDecoder::blit24(const Graphics::Surface &srcSurf, Common::Rect &rect) {
const byte *src = (byte *)srcSurf.pixels +
(srcRect.top * srcSurf.pitch) + srcRect.left * _bytesPerPixel;
byte *dst = (byte *)_surface.pixels +
- ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.bytesPerPixel;
+ ((_y + rect.top) * _surface.pitch) + (_x + rect.left) * _surface.format.bytesPerPixel;
for (int i = 0; i < rect.height(); i++) {
const byte *srcRow = src;
byte *dstRow = dst;
- for (int j = 0; j < rect.width(); j++, srcRow += 3, dstRow += _surface.bytesPerPixel) {
+ for (int j = 0; j < rect.width(); j++, srcRow += 3, dstRow += _surface.format.bytesPerPixel) {
byte r = srcRow[2];
byte g = srcRow[1];
byte b = srcRow[0];
@@ -2391,7 +2399,7 @@ void VMDDecoder::blit24(const Graphics::Surface &srcSurf, Common::Rect &rect) {
if ((r == 0) && (g == 0) && (b == 0))
c = 0;
- if (_surface.bytesPerPixel == 2)
+ if (_surface.format.bytesPerPixel == 2)
*((uint16 *)dstRow) = (uint16) c;
}
diff --git a/video/coktel_decoder.h b/video/coktel_decoder.h
index e83e1d29ed..46007d55da 100644
--- a/video/coktel_decoder.h
+++ b/video/coktel_decoder.h
@@ -35,14 +35,25 @@
#include "common/list.h"
#include "common/array.h"
-#include "common/rect.h"
+#include "common/rational.h"
+#include "common/str.h"
+
+#include "graphics/surface.h"
#include "video/video_decoder.h"
#include "audio/mixer.h"
+namespace Common {
+struct Rect;
+class SeekableReadStream;
+}
namespace Audio {
- class QueuingAudioStream;
+class QueuingAudioStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
}
namespace Video {
diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp
index a64b8f6fee..9e3f59705c 100644
--- a/video/dxa_decoder.cpp
+++ b/video/dxa_decoder.cpp
@@ -25,10 +25,11 @@
#include "common/debug.h"
#include "common/endian.h"
-#include "common/archive.h"
#include "common/system.h"
#include "common/stream.h"
-#include "common/util.h"
+#include "common/textconsole.h"
+
+#include "graphics/surface.h"
#include "video/dxa_decoder.h"
@@ -101,7 +102,7 @@ bool DXADecoder::loadStream(Common::SeekableReadStream *stream) {
}
_surface = new Graphics::Surface();
- _surface->bytesPerPixel = 1;
+ _surface->format = Graphics::PixelFormat::createFormatCLUT8();
debug(2, "flags 0x0%x framesCount %d width %d height %d rate %d", flags, getFrameCount(), getWidth(), getHeight(), getFrameRate().toInt());
diff --git a/video/dxa_decoder.h b/video/dxa_decoder.h
index 614cb2d90b..498f4630d4 100644
--- a/video/dxa_decoder.h
+++ b/video/dxa_decoder.h
@@ -26,8 +26,18 @@
#ifndef VIDEO_DXA_DECODER_H
#define VIDEO_DXA_DECODER_H
+#include "common/rational.h"
+#include "graphics/pixelformat.h"
#include "video/video_decoder.h"
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct Surface;
+}
+
namespace Video {
/**
diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp
index 90f7a8e9ac..47a9244a13 100644
--- a/video/flic_decoder.cpp
+++ b/video/flic_decoder.cpp
@@ -24,10 +24,11 @@
*/
#include "video/flic_decoder.h"
-#include "common/archive.h"
-#include "common/stream.h"
#include "common/endian.h"
+#include "common/rect.h"
+#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
namespace Video {
@@ -79,7 +80,7 @@ bool FlicDecoder::loadStream(Common::SeekableReadStream *stream) {
_offsetFrame2 = _fileStream->readUint32LE();
_surface = new Graphics::Surface();
- _surface->create(width, height, 1);
+ _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
_palette = (byte *)malloc(3 * 256);
memset(_palette, 0, 3 * 256);
_paletteChanged = false;
@@ -226,7 +227,7 @@ const Graphics::Surface *FlicDecoder::decodeNextFrame() {
_surface->free();
delete _surface;
_surface = new Graphics::Surface();
- _surface->create(newWidth, newHeight, 1);
+ _surface->create(newWidth, newHeight, Graphics::PixelFormat::createFormatCLUT8());
}
}
break;
diff --git a/video/flic_decoder.h b/video/flic_decoder.h
index 954fed7bfa..4ca8615de1 100644
--- a/video/flic_decoder.h
+++ b/video/flic_decoder.h
@@ -28,10 +28,13 @@
#include "video/video_decoder.h"
#include "common/list.h"
+#include "common/rational.h"
#include "common/rect.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Video {
diff --git a/video/mpeg_player.h b/video/mpeg_player.h
index 44baff9c2b..dde272a9c6 100644
--- a/video/mpeg_player.h
+++ b/video/mpeg_player.h
@@ -81,7 +81,7 @@ typedef sequence_t mpeg2_sequence_t;
#define BUFFER_SIZE 4096
namespace Common {
- class File;
+class File;
}
class OSystem;
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp
index 826b7bfcaf..d455b13b64 100644
--- a/video/qt_decoder.cpp
+++ b/video/qt_decoder.cpp
@@ -39,20 +39,32 @@
#include "common/memstream.h"
#include "common/util.h"
#include "common/zlib.h"
+#include "common/stream.h"
+#include "common/system.h"
+#include "common/textconsole.h"
+#include "common/types.h"
+
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
+
+
+#include "audio/audiostream.h"
// Audio codecs
#include "audio/decoders/adpcm.h"
#include "audio/decoders/raw.h"
-#include "video/codecs/qdm2.h"
// Video codecs
+#include "video/codecs/codec.h"
#include "video/codecs/cinepak.h"
#include "video/codecs/mjpeg.h"
+#include "video/codecs/qdm2.h"
#include "video/codecs/qtrle.h"
#include "video/codecs/rpza.h"
#include "video/codecs/smc.h"
#include "video/codecs/cdtoons.h"
+
namespace Video {
////////////////////////////////////////////
@@ -381,7 +393,7 @@ const Graphics::Surface *QuickTimeDecoder::scaleSurface(const Graphics::Surface
for (int32 j = 0; j < _scaledSurface->h; j++)
for (int32 k = 0; k < _scaledSurface->w; k++)
- memcpy(_scaledSurface->getBasePtr(k, j), frame->getBasePtr((k * getScaleFactorX()).toInt() , (j * getScaleFactorY()).toInt()), frame->bytesPerPixel);
+ memcpy(_scaledSurface->getBasePtr(k, j), frame->getBasePtr((k * getScaleFactorX()).toInt() , (j * getScaleFactorY()).toInt()), frame->format.bytesPerPixel);
return _scaledSurface;
}
@@ -526,7 +538,7 @@ void QuickTimeDecoder::init() {
if (getScaleFactorX() != 1 || getScaleFactorY() != 1) {
// We have to initialize the scaled surface
_scaledSurface = new Graphics::Surface();
- _scaledSurface->create(getWidth(), getHeight(), getPixelFormat().bytesPerPixel);
+ _scaledSurface->create(getWidth(), getHeight(), getPixelFormat());
}
}
}
diff --git a/video/qt_decoder.h b/video/qt_decoder.h
index f11689e021..624134a26a 100644
--- a/video/qt_decoder.h
+++ b/video/qt_decoder.h
@@ -35,22 +35,32 @@
#define VIDEO_QT_DECODER_H
#include "common/scummsys.h"
-#include "common/queue.h"
#include "common/rational.h"
#include "video/video_decoder.h"
-#include "video/codecs/codec.h"
-#include "audio/audiostream.h"
#include "audio/mixer.h"
+#include "audio/timestamp.h"
namespace Common {
- class File;
- class MacResManager;
+class MacResManager;
+class SeekableReadStream;
+}
+
+namespace Audio {
+class AudioStream;
+class QueuingAudioStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
+struct Surface;
}
namespace Video {
+class Codec;
+
/**
* Decoder for QuickTime videos.
*
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index 760d0045d9..7a95eedf6a 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -29,11 +29,11 @@
#include "video/smk_decoder.h"
-#include "common/archive.h"
#include "common/endian.h"
#include "common/util.h"
#include "common/stream.h"
#include "common/system.h"
+#include "common/textconsole.h"
#include "audio/audiostream.h"
#include "audio/mixer.h"
@@ -483,7 +483,7 @@ bool SmackerDecoder::loadStream(Common::SeekableReadStream *stream) {
_surface = new Graphics::Surface();
// Height needs to be doubled if we have flags (Y-interlaced or Y-doubled)
- _surface->create(width, height * (_header.flags ? 2 : 1), 1);
+ _surface->create(width, height * (_header.flags ? 2 : 1), Graphics::PixelFormat::createFormatCLUT8());
memset(_palette, 0, 3 * 256);
return true;
diff --git a/video/smk_decoder.h b/video/smk_decoder.h
index 2d01909a44..b4eda88203 100644
--- a/video/smk_decoder.h
+++ b/video/smk_decoder.h
@@ -26,11 +26,18 @@
#ifndef VIDEO_SMK_PLAYER_H
#define VIDEO_SMK_PLAYER_H
+#include "common/rational.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
#include "video/video_decoder.h"
#include "audio/mixer.h"
namespace Audio {
- class QueuingAudioStream;
+class QueuingAudioStream;
+}
+
+namespace Common {
+class SeekableReadStream;
}
namespace Video {
diff --git a/video/video_decoder.cpp b/video/video_decoder.cpp
index a6317bac8f..dde2c09082 100644
--- a/video/video_decoder.cpp
+++ b/video/video_decoder.cpp
@@ -25,9 +25,12 @@
#include "video/video_decoder.h"
+#include "common/rational.h"
#include "common/file.h"
#include "common/system.h"
+#include "graphics/palette.h"
+
namespace Video {
VideoDecoder::VideoDecoder() {
diff --git a/video/video_decoder.h b/video/video_decoder.h
index 348b5dc0a3..b5574fd3fc 100644
--- a/video/video_decoder.h
+++ b/video/video_decoder.h
@@ -26,18 +26,19 @@
#ifndef VIDEO_DECODER_H
#define VIDEO_DECODER_H
-#include "common/events.h"
-#include "common/list.h"
-#include "common/rational.h"
-
-#include "graphics/surface.h"
-#include "graphics/pixelformat.h"
+#include "common/str.h"
#include "audio/timestamp.h" // TODO: Move this to common/ ?
namespace Common {
- class SeekableReadStream;
+class Rational;
+class SeekableReadStream;
+}
+
+namespace Graphics {
+struct PixelFormat;
+struct Surface;
}
namespace Video {