[Scummvm-cvs-logs] scummvm master -> 9414d7a6e287ff8abfb5746b564e92c8f0e6de58

salty-horse ori at avtalion.name
Thu Apr 28 14:13:52 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code


Commit: 9414d7a6e287ff8abfb5746b564e92c8f0e6de58
    https://github.com/scummvm/scummvm/commit/9414d7a6e287ff8abfb5746b564e92c8f0e6de58
Author: Ori Avtalion (ori at avtalion.name)
Date: 2011-04-28T05:08:58-07:00

Commit Message:
JANITORIAL: Reduce header dependencies in shared code

Some backends may break as I only compiled SDL

Changed paths:
    audio/audiostream.cpp
    audio/audiostream.h
    audio/decoders/adpcm.cpp
    audio/decoders/adpcm.h
    audio/decoders/adpcm_intern.h
    audio/decoders/aiff.cpp
    audio/decoders/flac.cpp
    audio/decoders/flac.h
    audio/decoders/iff_sound.cpp
    audio/decoders/mac_snd.cpp
    audio/decoders/mp3.cpp
    audio/decoders/mp3.h
    audio/decoders/raw.cpp
    audio/decoders/raw.h
    audio/decoders/vag.h
    audio/decoders/voc.cpp
    audio/decoders/vorbis.cpp
    audio/decoders/vorbis.h
    audio/decoders/wave.cpp
    audio/fmopl.cpp
    audio/mididrv.cpp
    audio/mididrv.h
    audio/midiparser.cpp
    audio/midiparser.h
    audio/midiparser_smf.cpp
    audio/midiparser_xmidi.cpp
    audio/mixer.cpp
    audio/mixer.h
    audio/mods/infogrames.cpp
    audio/mods/infogrames.h
    audio/mods/maxtrax.cpp
    audio/mods/module.cpp
    audio/mods/module.h
    audio/mods/protracker.cpp
    audio/mods/protracker.h
    audio/mods/rjp1.cpp
    audio/mods/rjp1.h
    audio/mods/soundfx.cpp
    audio/mods/soundfx.h
    audio/mods/tfmx.cpp
    audio/mpu401.h
    audio/musicplugin.h
    audio/null.cpp
    audio/rate.cpp
    audio/rate.h
    audio/softsynth/adlib.cpp
    audio/softsynth/fluidsynth.cpp
    audio/softsynth/fmtowns_pc98/towns_audio.cpp
    audio/softsynth/fmtowns_pc98/towns_euphony.cpp
    audio/softsynth/fmtowns_pc98/towns_pc98_driver.cpp
    audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.cpp
    audio/softsynth/fmtowns_pc98/towns_pc98_fmsynth.h
    audio/softsynth/mt32.cpp
    audio/softsynth/mt32/part.h
    audio/softsynth/mt32/synth.cpp
    audio/softsynth/mt32/synth.h
    audio/softsynth/opl/dosbox.cpp
    audio/softsynth/opl/mame.cpp
    audio/softsynth/opl/mame.h
    audio/softsynth/pcspk.h
    audio/softsynth/sid.cpp
    audio/softsynth/ym2612.cpp
    backends/audiocd/sdl/sdl-audiocd.cpp
    backends/events/sdl/sdl-events.cpp
    backends/graphics/opengl/gltexture.h
    backends/graphics/opengl/opengl-graphics.cpp
    backends/graphics/opengl/opengl-graphics.h
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.h
    backends/midi/alsa.cpp
    backends/midi/seq.cpp
    backends/midi/timidity.cpp
    backends/mixer/sdl/sdl-mixer.cpp
    backends/modular-backend.cpp
    backends/platform/sdl/sdl.cpp
    backends/plugins/dynamic-plugin.h
    backends/saves/posix/posix-saves.cpp
    backends/saves/savefile.cpp
    backends/timer/default/default-timer.h
    backends/timer/sdl/sdl-timer.cpp
    base/commandLine.cpp
    base/commandLine.h
    base/main.cpp
    base/plugins.h
    common/EventRecorder.cpp
    common/archive.cpp
    common/archive.h
    common/config-file.cpp
    common/config-file.h
    common/config-manager.cpp
    common/dcl.cpp
    common/debug.cpp
    common/error.cpp
    common/file.cpp
    common/file.h
    common/fs.cpp
    common/fs.h
    common/hashmap.h
    common/iff_container.h
    common/macresman.cpp
    common/macresman.h
    common/md5.cpp
    common/md5.h
    common/memstream.h
    common/stream.cpp
    common/stream.h
    common/substream.h
    common/system.cpp
    common/system.h
    common/textconsole.cpp
    common/translation.cpp
    common/translation.h
    common/unarj.cpp
    common/unarj.h
    common/unzip.cpp
    common/unzip.h
    common/util.cpp
    common/util.h
    common/winexe.h
    common/winexe_ne.h
    common/winexe_pe.cpp
    common/winexe_pe.h
    common/xmlparser.cpp
    common/xmlparser.h
    engines/advancedDetector.cpp
    engines/advancedDetector.h
    engines/agi/agi.cpp
    engines/agi/agi.h
    engines/agi/detection.cpp
    engines/agi/graphics.cpp
    engines/agi/loader_v2.cpp
    engines/agi/loader_v3.cpp
    engines/agi/lzw.cpp
    engines/agi/objects.cpp
    engines/agi/op_cmd.cpp
    engines/agi/picture.cpp
    engines/agi/preagi.cpp
    engines/agi/preagi_mickey.cpp
    engines/agi/preagi_troll.cpp
    engines/agi/preagi_winnie.cpp
    engines/agi/predictive.cpp
    engines/agi/saveload.cpp
    engines/agi/sound.cpp
    engines/agi/sound_2gs.cpp
    engines/agi/sound_midi.cpp
    engines/agi/sound_sarien.cpp
    engines/agi/wagparser.cpp
    engines/agi/words.cpp
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/animation.cpp
    engines/agos/charset-fontdata.cpp
    engines/agos/debug.cpp
    engines/agos/detection.cpp
    engines/agos/draw.cpp
    engines/agos/event.cpp
    engines/agos/gfx.cpp
    engines/agos/icons.cpp
    engines/agos/items.cpp
    engines/agos/menus.cpp
    engines/agos/midi.cpp
    engines/agos/midiparser_s1d.cpp
    engines/agos/res.cpp
    engines/agos/res_snd.cpp
    engines/agos/rooms.cpp
    engines/agos/saveload.cpp
    engines/agos/script.cpp
    engines/agos/script_pn.cpp
    engines/agos/script_s1.cpp
    engines/agos/script_s2.cpp
    engines/agos/sound.cpp
    engines/agos/string.cpp
    engines/agos/string_pn.cpp
    engines/agos/subroutine.cpp
    engines/agos/vga.cpp
    engines/agos/vga_e2.cpp
    engines/agos/vga_ww.cpp
    engines/agos/window.cpp
    engines/cine/anim.cpp
    engines/cine/bg.cpp
    engines/cine/cine.cpp
    engines/cine/detection.cpp
    engines/cine/gfx.cpp
    engines/cine/msg.cpp
    engines/cine/pal.cpp
    engines/cine/part.cpp
    engines/cine/saveload.cpp
    engines/cine/script_fw.cpp
    engines/cine/script_os.cpp
    engines/cine/sound.cpp
    engines/cine/texte.cpp
    engines/cine/various.cpp
    engines/cruise/actor.cpp
    engines/cruise/background.cpp
    engines/cruise/cruise.cpp
    engines/cruise/cruise.h
    engines/cruise/cruise_main.cpp
    engines/cruise/dataLoader.cpp
    engines/cruise/detection.cpp
    engines/cruise/function.cpp
    engines/cruise/gfxModule.cpp
    engines/cruise/menu.cpp
    engines/cruise/object.cpp
    engines/cruise/overlay.cpp
    engines/cruise/saveload.cpp
    engines/cruise/script.cpp
    engines/cruise/sound.cpp
    engines/dialogs.cpp
    engines/dialogs.h
    engines/draci/animation.cpp
    engines/draci/music.cpp
    engines/draci/screen.cpp
    engines/draci/sound.cpp
    engines/draci/surface.h
    engines/drascula/converse.cpp
    engines/drascula/drascula.cpp
    engines/drascula/graphics.cpp
    engines/drascula/objects.cpp
    engines/drascula/palette.cpp
    engines/drascula/rooms.cpp
    engines/drascula/saveload.cpp
    engines/drascula/sound.cpp
    engines/engine.cpp
    engines/engine.h
    engines/game.cpp
    engines/game.h
    engines/gob/databases.cpp
    engines/gob/gob.cpp
    engines/gob/gob.h
    engines/gob/inter_v1.cpp
    engines/gob/inter_v4.cpp
    engines/gob/inter_v5.cpp
    engines/gob/inter_v6.cpp
    engines/gob/save/saveload.cpp
    engines/gob/sound/adlib.cpp
    engines/gob/sound/bgatmosphere.cpp
    engines/gob/sound/cdrom.cpp
    engines/gob/sound/infogrames.cpp
    engines/gob/sound/sounddesc.cpp
    engines/gob/sound/soundmixer.cpp
    engines/gob/surface.cpp
    engines/gob/util.cpp
    engines/gob/video.cpp
    engines/groovie/cursor.cpp
    engines/groovie/debug.cpp
    engines/groovie/font.cpp
    engines/groovie/graphics.cpp
    engines/groovie/groovie.cpp
    engines/groovie/music.cpp
    engines/groovie/player.cpp
    engines/groovie/resource.cpp
    engines/groovie/roq.cpp
    engines/groovie/script.cpp
    engines/groovie/vdx.cpp
    engines/hugo/detection.cpp
    engines/hugo/display.cpp
    engines/hugo/file.cpp
    engines/hugo/file_v1d.cpp
    engines/hugo/file_v1w.cpp
    engines/hugo/file_v2d.cpp
    engines/hugo/file_v3d.cpp
    engines/hugo/hugo.cpp
    engines/hugo/intro.cpp
    engines/hugo/inventory.cpp
    engines/hugo/mouse.cpp
    engines/hugo/object.cpp
    engines/hugo/object_v1d.cpp
    engines/hugo/object_v1w.cpp
    engines/hugo/object_v2d.cpp
    engines/hugo/object_v3d.cpp
    engines/hugo/parser.cpp
    engines/hugo/parser.h
    engines/hugo/parser_v1d.cpp
    engines/hugo/parser_v1w.cpp
    engines/hugo/parser_v2d.cpp
    engines/hugo/parser_v3d.cpp
    engines/hugo/route.cpp
    engines/hugo/schedule.cpp
    engines/hugo/sound.cpp
    engines/kyra/animator_hof.cpp
    engines/kyra/animator_lok.cpp
    engines/kyra/animator_mr.cpp
    engines/kyra/animator_v2.cpp
    engines/kyra/detection.cpp
    engines/kyra/gui.cpp
    engines/kyra/gui_hof.cpp
    engines/kyra/gui_lok.cpp
    engines/kyra/gui_lol.cpp
    engines/kyra/gui_mr.cpp
    engines/kyra/gui_v2.cpp
    engines/kyra/items_hof.cpp
    engines/kyra/items_lok.cpp
    engines/kyra/items_mr.cpp
    engines/kyra/kyra_lok.cpp
    engines/kyra/kyra_lok.h
    engines/kyra/kyra_v1.cpp
    engines/kyra/kyra_v1.h
    engines/kyra/kyra_v2.cpp
    engines/kyra/lol.cpp
    engines/kyra/resource.cpp
    engines/kyra/saveload_lok.cpp
    engines/kyra/saveload_lol.cpp
    engines/kyra/scene_hof.cpp
    engines/kyra/scene_lol.cpp
    engines/kyra/scene_mr.cpp
    engines/kyra/scene_v2.cpp
    engines/kyra/screen.cpp
    engines/kyra/screen_lok.cpp
    engines/kyra/screen_lol.cpp
    engines/kyra/script_hof.cpp
    engines/kyra/script_lol.cpp
    engines/kyra/script_mr.cpp
    engines/kyra/script_tim.cpp
    engines/kyra/script_tim.h
    engines/kyra/script_v1.cpp
    engines/kyra/script_v2.cpp
    engines/kyra/sequences_lol.cpp
    engines/kyra/sequences_v2.cpp
    engines/kyra/sound.cpp
    engines/kyra/sound_amiga.cpp
    engines/kyra/sound_lok.cpp
    engines/kyra/sound_lol.cpp
    engines/kyra/text_hof.cpp
    engines/kyra/text_lok.cpp
    engines/kyra/text_lol.cpp
    engines/kyra/text_mr.cpp
    engines/kyra/timer.cpp
    engines/kyra/timer_lol.cpp
    engines/kyra/timer_mr.cpp
    engines/lastexpress/data/animation.cpp
    engines/lastexpress/data/archive.h
    engines/lastexpress/data/background.cpp
    engines/lastexpress/data/font.cpp
    engines/lastexpress/data/font.h
    engines/lastexpress/data/scene.cpp
    engines/lastexpress/data/scene.h
    engines/lastexpress/data/sequence.cpp
    engines/lastexpress/data/sequence.h
    engines/lastexpress/data/snd.cpp
    engines/lastexpress/data/subtitle.cpp
    engines/lastexpress/entities/entity.h
    engines/lastexpress/game/state.h
    engines/lastexpress/graphics.cpp
    engines/lastexpress/resource.cpp
    engines/lure/memory.cpp
    engines/lure/res_struct.h
    engines/lure/screen.cpp
    engines/lure/sound.h
    engines/m4/actor.cpp
    engines/m4/animation.cpp
    engines/m4/compression.cpp
    engines/m4/console.cpp
    engines/m4/converse.cpp
    engines/m4/dialogs.cpp
    engines/m4/globals.cpp
    engines/m4/graphics.cpp
    engines/m4/gui.cpp
    engines/m4/m4.cpp
    engines/m4/m4_menus.cpp
    engines/m4/m4_scene.cpp
    engines/m4/m4_views.cpp
    engines/m4/mads_anim.cpp
    engines/m4/mads_logic.cpp
    engines/m4/mads_menus.cpp
    engines/m4/mads_scene.cpp
    engines/m4/mads_views.cpp
    engines/m4/midi.cpp
    engines/m4/resource.cpp
    engines/m4/script.cpp
    engines/m4/sound.cpp
    engines/m4/sprite.cpp
    engines/m4/woodscript.cpp
    engines/made/database.cpp
    engines/made/graphics.cpp
    engines/made/made.cpp
    engines/made/music.cpp
    engines/made/redreader.cpp
    engines/made/resource.cpp
    engines/made/resource.h
    engines/made/screen.cpp
    engines/made/script.h
    engines/made/scriptfuncs.cpp
    engines/mohawk/bitmap.cpp
    engines/mohawk/console.cpp
    engines/mohawk/cstime.cpp
    engines/mohawk/cstime_cases.cpp
    engines/mohawk/cstime_game.cpp
    engines/mohawk/cstime_ui.cpp
    engines/mohawk/cstime_view.cpp
    engines/mohawk/detection.cpp
    engines/mohawk/dialogs.cpp
    engines/mohawk/graphics.cpp
    engines/mohawk/installer_archive.cpp
    engines/mohawk/installer_archive.h
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks_code.cpp
    engines/mohawk/mohawk.cpp
    engines/mohawk/myst.cpp
    engines/mohawk/myst_areas.cpp
    engines/mohawk/myst_scripts.cpp
    engines/mohawk/myst_stacks/channelwood.cpp
    engines/mohawk/myst_stacks/credits.cpp
    engines/mohawk/myst_stacks/dni.cpp
    engines/mohawk/myst_stacks/mechanical.cpp
    engines/mohawk/myst_stacks/myst.cpp
    engines/mohawk/myst_stacks/preview.cpp
    engines/mohawk/myst_stacks/selenitic.cpp
    engines/mohawk/myst_stacks/slides.cpp
    engines/mohawk/myst_stacks/stoneship.cpp
    engines/mohawk/myst_state.cpp
    engines/mohawk/resource.cpp
    engines/mohawk/riven.h
    engines/mohawk/riven_external.cpp
    engines/mohawk/riven_scripts.cpp
    engines/mohawk/riven_scripts.h
    engines/mohawk/sound.cpp
    engines/mohawk/video.cpp
    engines/mohawk/view.cpp
    engines/parallaction/callables_br.cpp
    engines/parallaction/detection.cpp
    engines/parallaction/dialogue.cpp
    engines/parallaction/disk.cpp
    engines/parallaction/disk.h
    engines/parallaction/disk_br.cpp
    engines/parallaction/disk_ns.cpp
    engines/parallaction/exec_br.cpp
    engines/parallaction/exec_ns.cpp
    engines/parallaction/font.cpp
    engines/parallaction/gfxbase.cpp
    engines/parallaction/graphics.cpp
    engines/parallaction/gui.cpp
    engines/parallaction/gui_br.cpp
    engines/parallaction/gui_ns.cpp
    engines/parallaction/input.cpp
    engines/parallaction/inventory.cpp
    engines/parallaction/objects.cpp
    engines/parallaction/parallaction.cpp
    engines/parallaction/parallaction_br.cpp
    engines/parallaction/parallaction_ns.cpp
    engines/parallaction/parser.cpp
    engines/parallaction/parser_br.cpp
    engines/parallaction/parser_ns.cpp
    engines/parallaction/saveload.cpp
    engines/parallaction/sound_br.cpp
    engines/parallaction/sound_ns.cpp
    engines/queen/command.cpp
    engines/queen/cutaway.cpp
    engines/queen/display.cpp
    engines/queen/graphics.cpp
    engines/queen/input.cpp
    engines/queen/journal.cpp
    engines/queen/logic.cpp
    engines/queen/midiadlib.cpp
    engines/queen/queen.cpp
    engines/queen/resource.cpp
    engines/queen/sound.cpp
    engines/queen/talk.cpp
    engines/queen/walk.cpp
    engines/saga/gfx.cpp
    engines/saga/gfx.h
    engines/saga/introproc_saga2.cpp
    engines/saga/saga.h
    engines/saga/saveload.cpp
    engines/saga/shorten.cpp
    engines/savestate.cpp
    engines/sci/decompressor.cpp
    engines/sci/engine/kfile.cpp
    engines/sci/engine/ksound.cpp
    engines/sci/engine/kvideo.cpp
    engines/sci/engine/object.h
    engines/sci/engine/vm.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/paint.cpp
    engines/sci/graphics/paint16.cpp
    engines/sci/graphics/paint32.cpp
    engines/sci/graphics/palette.cpp
    engines/sci/graphics/portrait.cpp
    engines/sci/graphics/transitions.cpp
    engines/sci/parser/grammar.cpp
    engines/sci/resource.cpp
    engines/sci/resource_audio.cpp
    engines/sci/sound/drivers/adlib.cpp
    engines/sci/sound/drivers/amigamac.cpp
    engines/sci/sound/drivers/cms.cpp
    engines/sci/sound/drivers/fb01.cpp
    engines/sci/sound/drivers/pcjr.cpp
    engines/sci/video/robot_decoder.cpp
    engines/sci/video/robot_decoder.h
    engines/sci/video/seq_decoder.cpp
    engines/sci/video/seq_decoder.h
    engines/scumm/debugger.cpp
    engines/scumm/file_nes.cpp
    engines/scumm/he/cup_player_he.cpp
    engines/scumm/he/palette_he.cpp
    engines/scumm/imuse/imuse_part.cpp
    engines/scumm/imuse/sysex_scumm.cpp
    engines/scumm/imuse_digi/dimuse.h
    engines/scumm/midiparser_ro.cpp
    engines/scumm/palette.cpp
    engines/scumm/player_pce.h
    engines/scumm/player_v4a.h
    engines/scumm/scumm.h
    engines/scumm/smush/channel.cpp
    engines/scumm/smush/codec37.cpp
    engines/scumm/smush/codec47.cpp
    engines/scumm/smush/saud_channel.cpp
    engines/scumm/smush/smush_mixer.h
    engines/scumm/smush/smush_player.cpp
    engines/scumm/util.cpp
    engines/sky/autoroute.cpp
    engines/sky/compact.cpp
    engines/sky/control.cpp
    engines/sky/debug.cpp
    engines/sky/detection.cpp
    engines/sky/disk.cpp
    engines/sky/disk.h
    engines/sky/intro.cpp
    engines/sky/logic.cpp
    engines/sky/mouse.cpp
    engines/sky/music/adlibchannel.cpp
    engines/sky/music/gmchannel.cpp
    engines/sky/music/gmmusic.cpp
    engines/sky/music/mt32music.cpp
    engines/sky/music/musicbase.cpp
    engines/sky/screen.cpp
    engines/sky/sky.cpp
    engines/sky/sky.h
    engines/sky/sound.cpp
    engines/sky/text.cpp
    engines/sword1/animation.cpp
    engines/sword1/control.cpp
    engines/sword1/detection.cpp
    engines/sword1/eventman.cpp
    engines/sword1/logic.cpp
    engines/sword1/memman.cpp
    engines/sword1/mouse.h
    engines/sword1/music.cpp
    engines/sword1/objectman.cpp
    engines/sword1/resman.cpp
    engines/sword1/router.cpp
    engines/sword1/screen.cpp
    engines/sword1/sound.cpp
    engines/sword1/sword1.cpp
    engines/sword1/sword1.h
    engines/sword1/text.cpp
    engines/sword2/animation.cpp
    engines/sword2/controls.cpp
    engines/sword2/events.cpp
    engines/sword2/function.cpp
    engines/sword2/interpreter.cpp
    engines/sword2/layers.cpp
    engines/sword2/logic.cpp
    engines/sword2/maketext.cpp
    engines/sword2/memory.cpp
    engines/sword2/mouse.cpp
    engines/sword2/music.cpp
    engines/sword2/palette.cpp
    engines/sword2/resman.cpp
    engines/sword2/router.cpp
    engines/sword2/saveload.cpp
    engines/sword2/screen.cpp
    engines/sword2/sound.cpp
    engines/sword2/sound.h
    engines/sword2/speech.cpp
    engines/sword2/startup.cpp
    engines/sword2/sword2.cpp
    engines/sword2/sync.cpp
    engines/sword25/detection.cpp
    engines/sword25/fmv/movieplayer.cpp
    engines/sword25/fmv/theora_decoder.cpp
    engines/sword25/fmv/theora_decoder.h
    engines/sword25/gfx/screenshot.cpp
    engines/sword25/kernel/filesystemutil.cpp
    engines/sword25/kernel/inputpersistenceblock.cpp
    engines/sword25/kernel/kernel.h
    engines/sword25/kernel/objectregistry.h
    engines/sword25/script/luacallback.cpp
    engines/sword25/sfx/soundengine.cpp
    engines/sword25/sword25.cpp
    engines/sword25/sword25.h
    engines/teenagent/actor.cpp
    engines/teenagent/animation.cpp
    engines/teenagent/callbacks.cpp
    engines/teenagent/font.cpp
    engines/teenagent/font.h
    engines/teenagent/inventory.cpp
    engines/teenagent/music.cpp
    engines/teenagent/resources.cpp
    engines/teenagent/scene.cpp
    engines/teenagent/scene.h
    engines/teenagent/segment.cpp
    engines/teenagent/surface.h
    engines/teenagent/teenagent.cpp
    engines/testbed/detection.cpp
    engines/testbed/events.cpp
    engines/testbed/graphics.cpp
    engines/testbed/sound.cpp
    engines/testbed/testbed.cpp
    engines/testbed/testbed.h
    engines/testbed/testsuite.h
    engines/tinsel/actors.cpp
    engines/tinsel/adpcm.cpp
    engines/tinsel/anim.cpp
    engines/tinsel/bg.cpp
    engines/tinsel/bmv.cpp
    engines/tinsel/dialogs.cpp
    engines/tinsel/drives.cpp
    engines/tinsel/graphics.cpp
    engines/tinsel/handle.cpp
    engines/tinsel/mareels.cpp
    engines/tinsel/object.cpp
    engines/tinsel/palette.cpp
    engines/tinsel/pcode.cpp
    engines/tinsel/pdisplay.cpp
    engines/tinsel/polygons.cpp
    engines/tinsel/rince.cpp
    engines/tinsel/saveload.cpp
    engines/tinsel/savescn.cpp
    engines/tinsel/scene.cpp
    engines/tinsel/sched.cpp
    engines/tinsel/scn.cpp
    engines/tinsel/sound.cpp
    engines/tinsel/strres.cpp
    engines/tinsel/sysvar.cpp
    engines/tinsel/timers.cpp
    engines/tinsel/tinlib.cpp
    engines/tinsel/tinsel.cpp
    engines/toon/anim.cpp
    engines/toon/audio.cpp
    engines/toon/character.cpp
    engines/toon/drew.cpp
    engines/toon/flux.cpp
    engines/toon/font.cpp
    engines/toon/hotspot.cpp
    engines/toon/movie.cpp
    engines/toon/path.cpp
    engines/toon/picture.cpp
    engines/toon/resource.cpp
    engines/toon/script.cpp
    engines/toon/script_func.cpp
    engines/toon/state.cpp
    engines/toon/text.cpp
    engines/toon/tools.cpp
    engines/toon/toon.cpp
    engines/touche/resource.cpp
    engines/touche/saveload.cpp
    engines/touche/touche.cpp
    engines/tsage/core.cpp
    engines/tsage/debugger.cpp
    engines/tsage/dialogs.cpp
    engines/tsage/graphics.cpp
    engines/tsage/resources.h
    engines/tsage/saveload.cpp
    engines/tsage/sound.cpp
    engines/tsage/tsage.cpp
    engines/tucker/locations.cpp
    engines/tucker/resource.cpp
    engines/tucker/saveload.cpp
    engines/tucker/sequences.cpp
    engines/tucker/tucker.cpp
    graphics/VectorRenderer.cpp
    graphics/VectorRenderer.h
    graphics/VectorRendererSpec.cpp
    graphics/conversion.cpp
    graphics/conversion.h
    graphics/font.cpp
    graphics/font.h
    graphics/fontman.cpp
    graphics/fontman.h
    graphics/fonts/scummfont.cpp
    graphics/fonts/winfont.cpp
    graphics/fonts/winfont.h
    graphics/iff.cpp
    graphics/iff.h
    graphics/imagedec.cpp
    graphics/imagedec.h
    graphics/jpeg.cpp
    graphics/palette.h
    graphics/pict.cpp
    graphics/png.cpp
    graphics/png.h
    graphics/scaler/scale2x.cpp
    graphics/scaler/scale3x.cpp
    graphics/scaler/scalebit.cpp
    graphics/scaler/thumbnail_intern.cpp
    graphics/sjis.cpp
    graphics/surface.cpp
    graphics/surface.h
    graphics/thumbnail.cpp
    graphics/wincursor.cpp
    gui/ThemeEngine.cpp
    gui/ThemeEngine.h
    gui/ThemeEval.cpp
    gui/ThemeEval.h
    gui/ThemeLayout.cpp
    gui/ThemeLayout.h
    gui/ThemeParser.cpp
    gui/Tooltip.cpp
    gui/Tooltip.h
    gui/about.cpp
    gui/about.h
    gui/browser.cpp
    gui/browser.h
    gui/chooser.cpp
    gui/chooser.h
    gui/console.cpp
    gui/debugger.cpp
    gui/dialog.cpp
    gui/dialog.h
    gui/gui-manager.cpp
    gui/gui-manager.h
    gui/launcher.cpp
    gui/launcher.h
    gui/massadd.cpp
    gui/massadd.h
    gui/message.cpp
    gui/message.h
    gui/object.cpp
    gui/object.h
    gui/options.cpp
    gui/options.h
    gui/saveload.h
    gui/themebrowser.h
    gui/widget.cpp
    gui/widget.h
    gui/widgets/editable.cpp
    gui/widgets/editable.h
    gui/widgets/edittext.cpp
    gui/widgets/list.cpp
    gui/widgets/popup.cpp
    gui/widgets/scrollbar.cpp
    gui/widgets/tab.cpp
    video/avi_decoder.cpp
    video/avi_decoder.h
    video/codecs/cdtoons.cpp
    video/codecs/cinepak.cpp
    video/codecs/cinepak.h
    video/codecs/indeo3.cpp
    video/codecs/mjpeg.cpp
    video/codecs/mjpeg.h
    video/codecs/msrle.cpp
    video/codecs/msvideo1.cpp
    video/codecs/qdm2.cpp
    video/codecs/qtrle.cpp
    video/codecs/rpza.cpp
    video/codecs/smc.cpp
    video/codecs/truemotion1.cpp
    video/coktel_decoder.cpp
    video/coktel_decoder.h
    video/dxa_decoder.cpp
    video/dxa_decoder.h
    video/flic_decoder.cpp
    video/flic_decoder.h
    video/qt_decoder.cpp
    video/qt_decoder.h
    video/smk_decoder.cpp
    video/smk_decoder.h
    video/video_decoder.cpp
    video/video_decoder.h



diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp
index 0c41a38..776f904 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 cd6456c..22de21c 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 3b53ca2..a928497 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 b0f0e9e..1034410 100644
--- a/audio/decoders/adpcm.h
+++ b/audio/decoders/adpcm.h
@@ -47,7 +47,6 @@ 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 dd8c14b..f875bd8 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 0f94775..957fb13 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/flac.cpp b/audio/decoders/flac.cpp
index 76b6d35..fe15877 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 211347a..69222f2 100644
--- a/audio/decoders/flac.h
+++ b/audio/decoders/flac.h
@@ -54,7 +54,6 @@ class SeekableReadStream;
 
 namespace Audio {
 
-class AudioStream;
 class SeekableAudioStream;
 
 /**
diff --git a/audio/decoders/iff_sound.cpp b/audio/decoders/iff_sound.cpp
index 2ec189c..8efe017 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/mac_snd.cpp b/audio/decoders/mac_snd.cpp
index 7c1a2f7..fc69988 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/mp3.cpp b/audio/decoders/mp3.cpp
index 53d68fa..91bd498 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 84f7fac..d3a5b70 100644
--- a/audio/decoders/mp3.h
+++ b/audio/decoders/mp3.h
@@ -55,7 +55,6 @@ class SeekableReadStream;
 
 namespace Audio {
 
-class AudioStream;
 class SeekableAudioStream;
 
 /**
diff --git a/audio/decoders/raw.cpp b/audio/decoders/raw.cpp
index 8b833c7..cf787f9 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 6434366..23ed021 100644
--- a/audio/decoders/raw.h
+++ b/audio/decoders/raw.h
@@ -38,7 +38,6 @@ class SeekableReadStream;
 
 namespace Audio {
 
-class AudioStream;
 class SeekableAudioStream;
 
 /**
diff --git a/audio/decoders/vag.h b/audio/decoders/vag.h
index 4db9eee..4adc1d3 100644
--- a/audio/decoders/vag.h
+++ b/audio/decoders/vag.h
@@ -40,7 +40,6 @@ class SeekableReadStream;
 
 namespace Audio {
 
-class AudioStream;
 class RewindableAudioStream;
 
 /**
diff --git a/audio/decoders/voc.cpp b/audio/decoders/voc.cpp
index b811a64..9c2dc4f 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/vorbis.cpp b/audio/decoders/vorbis.cpp
index a9bcb61..63f7ba8 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 9829f74..51d0b82 100644
--- a/audio/decoders/vorbis.h
+++ b/audio/decoders/vorbis.h
@@ -54,7 +54,6 @@ class SeekableReadStream;
 
 namespace Audio {
 
-class AudioStream;
 class SeekableAudioStream;
 
 /**
diff --git a/audio/decoders/wave.cpp b/audio/decoders/wave.cpp
index 1f0ddd8..a648748 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/fmopl.cpp b/audio/fmopl.cpp
index 1f61e16..5952a98 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 a1487ff..6cc3366 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 92fbb09..c6c5179 100644
--- a/audio/mididrv.h
+++ b/audio/mididrv.h
@@ -27,17 +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 a6df602..a1399d0 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 eeeee98..24f2ba7 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 9e4e8ed..8ead95d 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 edc7c7a..1146084 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 63f006c..4d23487 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 89b50e5..5802abd 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 27e42c6..8bfffea 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 c7abebf..9787210 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 a577c72..0738966 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 3dad379..987b17b 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 550b636..c9b72bd 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 6051338..f781920 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 af72263..fa9895b 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 957bbb9..eaa99e6 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 e196092..e3cb0b8 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 06a1e29..44fdd65 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 089c19d..9dd5240 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 8c69a75..f7cfc50 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 07e2817..5f1a510 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 da0e0ff..53a2ae4 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 152f5da..2066a6d 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 1fcf0ad..fd52503 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 fb231e4..af37994 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/softsynth/adlib.cpp b/audio/softsynth/adlib.cpp
index 9e86347..0b5215e 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/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp
index f6f66ce..a4877a4 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 e019aa2..7b6658a 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 0ad96f7..cd3a348 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 79fd95e..a551276 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 67de8fa..9d3751a 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 18cca56..2b916b2 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 dd2c7e2..0b84a56 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) { }
diff --git a/audio/softsynth/mt32/part.h b/audio/softsynth/mt32/part.h
index 54c4999..9672982 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 1646079..4d1c612 100644
--- a/audio/softsynth/mt32/synth.cpp
+++ b/audio/softsynth/mt32/synth.cpp
@@ -25,8 +25,6 @@
 
 #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 3fc303d..edda446 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 29993ce..7a494d7 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 b4bbcb5..5d790f9 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 58ef5f1..4314aa6 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 c0d85bb..8f01fa8 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 241766f..de8f0ee 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 {
 
diff --git a/audio/softsynth/ym2612.cpp b/audio/softsynth/ym2612.cpp
index 6b3c2aa..162c92f 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 4136c34..82c9549 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/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index ce846a0..26df038 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
diff --git a/backends/graphics/opengl/gltexture.h b/backends/graphics/opengl/gltexture.h
index e7951a0..238b035 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 4ac2747..2fb02ba 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"
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 374f1c1..1725817 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 b9022af..d5ba6ee 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()
 	:
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 67b979a..41f5c2a 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
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index f467c38..4895b24 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/midi/alsa.cpp b/backends/midi/alsa.cpp
index 2257f60..5110734 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/seq.cpp b/backends/midi/seq.cpp
index 7cd7f0a..b90a9b1 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 c01b9bb..dd76196 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/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index fa2bf3e..9062995 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/modular-backend.cpp b/backends/modular-backend.cpp
index 19cba89..b691250 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/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 2c0c459..4694a06 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -32,6 +32,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/plugins/dynamic-plugin.h b/backends/plugins/dynamic-plugin.h
index 32d4116..775e887 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/saves/posix/posix-saves.cpp b/backends/saves/posix/posix-saves.cpp
index 866cd91..be870ab 100644
--- a/backends/saves/posix/posix-saves.cpp
+++ b/backends/saves/posix/posix-saves.cpp
@@ -31,6 +31,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 7b7d6b0..9888146 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 a4c7385..9a353f5 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 0a4cd42..647ddba 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/base/commandLine.cpp b/base/commandLine.cpp
index bb2141b..b74370d 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -30,6 +30,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 c7e8d8b..6205c91 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/main.cpp b/base/main.cpp
index 1335903..7a77d6a 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -43,14 +43,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 22b2877..d8f1cb9 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 1dedbb5..d2ad4bc 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 c65408b..c2c9c8e 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 c12ca79..375136f 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/config-file.cpp b/common/config-file.cpp
index 878d293..cd8f098 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 2f7d9cb..231162f 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 77c918d..5f5c14f 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 ef45bc9..efe1de0 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 c87d195..a871105 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 8fa58e2..b07e5eb 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 dec0f2a..485255b 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 d28cd9c..c3805ba 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/fs.cpp b/common/fs.cpp
index 87067df..d3cdc06 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 6b20a05..f93c111 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 233d7f5..907a107 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 01fc801..43a551a 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 b06d986..489f8f9 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 2ad0b60..fdb3ce4 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 e4736e8..bea9ca0 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 29f3aee..e613028 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 13b8e26..ac42e1b 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/stream.cpp b/common/stream.cpp
index 1be3fbf..e870e68 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 65b4971..530b50e 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 4d90ec5..ecf11c5 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 1ec7c14..4e902bc 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 f727ff6..0f01fcd 100644
--- a/common/system.h
+++ b/common/system.h
@@ -28,25 +28,23 @@
 
 #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;
 }
 
 namespace Graphics {
+struct PixelFormat;
 struct Surface;
 }
 
 namespace Common {
-struct Event;
 class EventManager;
+struct Rect;
 class SaveFileManager;
 class SearchSet;
+class String;
 class TimerManager;
 class SeekableReadStream;
 class WriteStream;
diff --git a/common/textconsole.cpp b/common/textconsole.cpp
index 9c72699..8d62cd4 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 407da2c..5494849 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 523f2f4..f8183b6 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 2c4225f..4bda7ac 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 fa7d388..fe23ba5 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 7b78da0..a55dfd1 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -105,7 +105,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 c460840..fe7acdc 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 cba921a..7ffd5e4 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 b3dd6a4..4493455 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 af0d70c..ce2f19c 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 c1d0408..2988132 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 99d44ca..6bb831b 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 5298e99..60c4adb 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 b53a9a3..7a6e794 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -24,7 +24,6 @@
  */
 
 #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 ec8f371..c456fd0 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/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index bf152ce..d6f7436 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -23,8 +23,6 @@
  *
  */
 
-#include "base/plugins.h"
-
 #include "common/debug.h"
 #include "common/util.h"
 #include "common/hash-str.h"
@@ -32,6 +30,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 03d255c..757fb12 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;
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 632587f..a69d19f 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 70ffbf1..c71a0eb 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"
 
@@ -695,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 0a53f0c..5192505 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -29,6 +29,7 @@
 #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 d0bc83d..f0d3876 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 8780e1d..0141a61 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 18ea4ca..025e755 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 f645cb1..495d645 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 d942a2b..bea53d7 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 2ea53e5..e1f9945 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 d17fe1d..8951fc8 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 7457a31..c51c53e 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 10ca797..64fc4e9 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 4e87c80..7684994 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 e97c144..c92434c 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 0230b9b..96ad78a 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 13e7215..c8df726 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 b215822..b40cef6 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 11bf5a9..f5758ed 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 9867157..997c1ed 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 4ed7f8d..6f2f3c5 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 22de667..fab3b5c 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 c48ed90..d8596de 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 498c7e4..94346e2 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 {
 
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 735920e..aecf243 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 acdc008..ee47f62 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 a477b3d..a131bb8 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 d0dc8cc..bb27557 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 646e63d..c8c70c0 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 317c68d..6b9f65e 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 fc0b4f9..8799dba 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 710c9dd..4c998df 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 ca603db..39a7705 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 81da526..5d1523b 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 5629a1d..2b103a7 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 a37c96a..26e2f2c 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/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp
index 156dc6e..f96518b 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 b840966..0e81896 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 fe09e74..34deff3 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 a2eff06..0993197 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 eefa246..d6f2581 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 90992b5..94a3f37 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 909c051..b8ba7fb 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 05a725c..dab0302 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 dd52516..a0b1452 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 3530179..25d861a 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 bda605a..1152d6e 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 a4e40d8..92d85ab 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 733d40e..bd07596 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 83ee050..6c07db1 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 b0431db..9e163ba 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 8aecd34..08b2cee 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 a03c7e1..08680c9 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 14b8de9..6b4b29d 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 b3171de..22fd28a 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 54d113d..8104ad3 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 9dfa2f7..058c1a1 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 3970d88..18feacd 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 a01afd1..3d58d6d 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 3c8ffc2..0f52600 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 f5c9402..17ef019 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 4911f78..1fc2a8b 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 ffbee3d..674bf4d 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 9ee3a89..aa2c8c3 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 f0c0668..4147611 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/texte.cpp b/engines/cine/texte.cpp
index 9dbfa31..fb6818d 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 5b86636..fdc7a28 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 9cbc3dd..2c83aff 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 edd52d3..7c63c15 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 2c5659c..9712bd9 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 ad3bb20..8d03d47 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 b1d7a59..e2f2d74 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 b9e4ca8..3ccd168 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 66018fa..63d7328 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 0b25ee5..75b90f7 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 1b6f394..4d48c2c 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 a722b94..36689ca 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 8644916..8e2be0c 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 9a77891..b7a0293 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 a1a3067..6e75088 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 aae4dba..d6ff784 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 2826a34..322f808 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 18c184e..7e1f292 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 885e86a..587e91a 100644
--- a/engines/dialogs.h
+++ b/engines/dialogs.h
@@ -25,13 +25,13 @@
 #ifndef GLOBAL_DIALOGS_H
 #define GLOBAL_DIALOGS_H
 
-#include "common/str.h"
 #include "gui/dialog.h"
 
 class Engine;
 
 namespace GUI {
 class ButtonWidget;
+class CommandSender;
 class GraphicsWidget;
 class SaveLoadChooser;
 }
diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp
index bc38e84..f2f1727 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/music.cpp b/engines/draci/music.cpp
index 750410b..1d725eb 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 c04f066..ab9c49c 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/sound.cpp b/engines/draci/sound.cpp
index 0df1979..ab2479f 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.h b/engines/draci/surface.h
index b00abcd..cb15ece 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 d0906fd..dcd93d8 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 19395dc..470f28c 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 9c5f3dc..4cd91e4 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 6b507ab..630eb08 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 b521c03..a75e72e 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 d6774cb..35d4eed 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 db67409..eacbe67 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 48e7492..5cb1c44 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 71f9b68..d322097 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -32,25 +32,25 @@
 
 #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 adec62b..b7afc0f 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -26,7 +26,6 @@
 #define ENGINES_ENGINE_H
 
 #include "common/scummsys.h"
-#include "common/error.h"
 #include "common/str.h"
 
 class OSystem;
@@ -35,6 +34,7 @@ namespace Audio {
 class Mixer;
 }
 namespace Common {
+class Error;
 class EventManager;
 class SaveFileManager;
 class TimerManager;
diff --git a/engines/game.cpp b/engines/game.cpp
index dea6d37..a27080c 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 3e5d7f2..c9a3b25 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 66a711e..94f641d 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/gob.cpp b/engines/gob/gob.cpp
index 1291416..3d697d3 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 57ad11c..4a92874 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -30,6 +30,8 @@
 #include "common/system.h"
 #include "common/savefile.h"
 
+#include "graphics/pixelformat.h"
+
 #include "engines/engine.h"
 
 #include "gob/console.h"
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 262fdc8..8f1ff4c 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 778387e..1da92b3 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 85b213a..f5e87bb 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 06a06f4..53ebfe7 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/save/saveload.cpp b/engines/gob/save/saveload.cpp
index 3508e58..e490509 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 f070bf1..4244df6 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 8850a72..b351d92 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 4f3d783..217aa9c 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 6377b4e..9fb7410 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 d33ea89..cc1c6b1 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 b6082c5..3b6b2e5 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 c3e8cd9..7bd8aae 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/util.cpp b/engines/gob/util.cpp
index 4d51b3d..787f851 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 444ff8e..1d74a07 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/groovie/cursor.cpp b/engines/groovie/cursor.cpp
index db4134c..8b62b82 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/debug.cpp b/engines/groovie/debug.cpp
index bd4b671..0b70e4f 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 92ebcce..13d0df0 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 3ceeeb6..3eaadbe 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -25,8 +25,12 @@
 
 #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) :
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index 67c8f3d..795cd6f 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/music.cpp b/engines/groovie/music.cpp
index 45f9800..b7078f4 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 8badd90..3fee87d 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 9c4e6fb..7670ab4 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/roq.cpp b/engines/groovie/roq.cpp
index 4d7157c..8b40fa8 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
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 8c7d3b0..fabb70c 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 6643177..432b178 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/hugo/detection.cpp b/engines/hugo/detection.cpp
index e862e33..95302c9 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/display.cpp b/engines/hugo/display.cpp
index 41e6940..af4d094 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 3a79ba1..ba4e420 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 48f274e..021969f 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 dbb0937..4f327b3 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 d385157..0ad89e9 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 2f3e5af..6370fff 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 7a42ca2..a872a97 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 63e8192..65dff78 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"
diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp
index ab58e38..45893f6 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 e8926b1..c02908e 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 0a52a0f..acf9f6e 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 a8edb45..95bedf4 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 f3ba793..54becd8 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 b3c4926..7c47bf4 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 2c6fc5d..3ff6c56 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 19cd4a3..29a1d5e 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 dd9244b..b00b8d5 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 de18427..b2e515f 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 305fb99..a390633 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 19570eb..6233f11 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 e5575ab..8c4946c 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 76ec583..68b659c 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 9782dbc..0e91124 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 24359a2..d657eb9 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 e147123..aa39ae6 100644
--- a/engines/kyra/animator_hof.cpp
+++ b/engines/kyra/animator_hof.cpp
@@ -27,6 +27,7 @@
 #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 b906d3a..3f09362 100644
--- a/engines/kyra/animator_lok.cpp
+++ b/engines/kyra/animator_lok.cpp
@@ -24,14 +24,15 @@
  */
 
 #include "common/endian.h"
+#include "common/error.h"
+#include "common/rect.h"
+#include "common/util.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;
diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp
index e6daba7..47c0e3b 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_v2.cpp b/engines/kyra/animator_v2.cpp
index b06dffd..07ff445 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/detection.cpp b/engines/kyra/detection.cpp
index 6c111a6..34d1834 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -30,9 +30,11 @@
 
 
 #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 ff7bf23..8c1a8ab 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -30,6 +30,7 @@
 #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 56971e5..1a28980 100644
--- a/engines/kyra/gui_hof.cpp
+++ b/engines/kyra/gui_hof.cpp
@@ -31,7 +31,7 @@
 #include "kyra/sound.h"
 #include "kyra/resource.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 3560478..a4bec82 100644
--- a/engines/kyra/gui_lok.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -34,7 +34,6 @@
 #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_lol.cpp b/engines/kyra/gui_lol.cpp
index 07fbf16..f52dd32c 100644
--- a/engines/kyra/gui_lol.cpp
+++ b/engines/kyra/gui_lol.cpp
@@ -32,6 +32,7 @@
 #include "kyra/util.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 6bdecfc..b34ff6a 100644
--- a/engines/kyra/gui_mr.cpp
+++ b/engines/kyra/gui_mr.cpp
@@ -31,7 +31,7 @@
 #include "kyra/sound.h"
 #include "kyra/timer.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 2247a0c..9cce543 100644
--- a/engines/kyra/gui_v2.cpp
+++ b/engines/kyra/gui_v2.cpp
@@ -30,6 +30,7 @@
 #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 6a78a77..d460698 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 322314e..f8271ad 100644
--- a/engines/kyra/items_lok.cpp
+++ b/engines/kyra/items_lok.cpp
@@ -34,7 +34,6 @@
 #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 2bc268a..5659876 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_lok.cpp b/engines/kyra/kyra_lok.cpp
index d7ec6ad..978a5a3 100644
--- a/engines/kyra/kyra_lok.cpp
+++ b/engines/kyra/kyra_lok.cpp
@@ -25,9 +25,7 @@
 
 #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"
 
diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h
index d1ff24a..cfa231e 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_v1.cpp b/engines/kyra/kyra_v1.cpp
index 3a5d211..506b262 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -23,6 +23,7 @@
  *
  */
 
+#include "common/error.h"
 #include "common/config-manager.h"
 #include "common/debug-channels.h"
 #include "common/EventRecorder.h"
@@ -36,7 +37,6 @@
 #include "kyra/screen.h"
 #include "kyra/text.h"
 #include "kyra/timer.h"
-#include "kyra/script.h"
 #include "kyra/debugger.h"
 
 namespace Kyra {
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 801d31d..08dc831 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 804097c..38c176e 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -24,10 +24,11 @@
  */
 
 #include "common/config-manager.h"
+#include "common/error.h"
+#include "common/system.h"
 
 #include "kyra/kyra_v2.h"
 #include "kyra/screen_v2.h"
-#include "kyra/debugger.h"
 
 namespace Kyra {
 
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 78c9ed2..613d5b0 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -39,6 +39,7 @@
 
 #include "common/config-manager.h"
 #include "common/endian.h"
+#include "common/system.h"
 
 namespace Kyra {
 
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 63b8072..22786c1 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_lok.cpp b/engines/kyra/saveload_lok.cpp
index 012ff13..77d6bb9 100644
--- a/engines/kyra/saveload_lok.cpp
+++ b/engines/kyra/saveload_lok.cpp
@@ -23,9 +23,7 @@
  *
  */
 
-#include "common/endian.h"
 #include "common/savefile.h"
-#include "common/system.h"
 
 #include "kyra/kyra_lok.h"
 #include "kyra/animator_lok.h"
diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp
index b6c0693..fdf8df3 100644
--- a/engines/kyra/saveload_lol.cpp
+++ b/engines/kyra/saveload_lol.cpp
@@ -29,10 +29,8 @@
 #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 7982736..3797b70 100644
--- a/engines/kyra/scene_hof.cpp
+++ b/engines/kyra/scene_hof.cpp
@@ -30,6 +30,7 @@
 #include "kyra/resource.h"
 
 #include "common/func.h"
+#include "common/system.h"
 
 namespace Kyra {
 
diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp
index e070b91..053f549 100644
--- a/engines/kyra/scene_lol.cpp
+++ b/engines/kyra/scene_lol.cpp
@@ -32,6 +32,7 @@
 #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 acb0710..ccb7788 100644
--- a/engines/kyra/scene_mr.cpp
+++ b/engines/kyra/scene_mr.cpp
@@ -29,6 +29,8 @@
 #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_v2.cpp b/engines/kyra/scene_v2.cpp
index fdfbceb..8255fc5 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -26,6 +26,8 @@
 #include "kyra/kyra_v2.h"
 #include "kyra/screen.h"
 
+#include "common/system.h"
+
 namespace Kyra {
 
 void KyraEngine_v2::freeSceneAnims() {
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index 58d8e7f..9e25d2e 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -31,6 +31,7 @@
 #include "engines/util.h"
 
 #include "graphics/cursorman.h"
+#include "graphics/palette.h"
 #include "graphics/sjis.h"
 
 #include "kyra/screen.h"
diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp
index 2273497..1ce00f9 100644
--- a/engines/kyra/screen_lok.cpp
+++ b/engines/kyra/screen_lok.cpp
@@ -26,7 +26,10 @@
 #include "kyra/kyra_lok.h"
 #include "kyra/screen_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 ff35fac..d2bc72b 100644
--- a/engines/kyra/screen_lol.cpp
+++ b/engines/kyra/screen_lol.cpp
@@ -29,6 +29,10 @@
 #include "kyra/lol.h"
 #include "kyra/resource.h"
 
+#include "common/system.h"
+
+#include "graphics/palette.h"
+
 namespace Kyra {
 
 Screen_LoL::Screen_LoL(LoLEngine *vm, OSystem *system) : Screen_v2(vm, system), _vm(vm) {
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index d57bb7e..ad13990 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -32,6 +32,7 @@
 #include "kyra/resource.h"
 
 #include "common/endian.h"
+#include "common/system.h"
 
 namespace Kyra {
 
diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp
index c9fb8df..29e0324 100644
--- a/engines/kyra/script_lol.cpp
+++ b/engines/kyra/script_lol.cpp
@@ -31,6 +31,7 @@
 #include "kyra/resource.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 18878b6..c049a94 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -32,6 +32,7 @@
 #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 1e978ca..b990b68 100644
--- a/engines/kyra/script_tim.cpp
+++ b/engines/kyra/script_tim.cpp
@@ -36,6 +36,7 @@
 
 #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 91f2e85..7cf7d0a 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 12f26ec..13fdcb7 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 17e8823..7779a15 100644
--- a/engines/kyra/script_v2.cpp
+++ b/engines/kyra/script_v2.cpp
@@ -28,6 +28,7 @@
 #include "kyra/timer.h"
 
 #include "common/endian.h"
+#include "common/system.h"
 
 namespace Kyra {
 
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index e8ea7a9..3588842 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -31,6 +31,8 @@
 
 #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 3824676..4d9cdf0 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 9dd046e..c65523d 100644
--- a/engines/kyra/sound.cpp
+++ b/engines/kyra/sound.cpp
@@ -24,9 +24,6 @@
  */
 
 
-#include "common/system.h"
-#include "common/config-manager.h"
-
 #include "kyra/resource.h"
 #include "kyra/sound.h"
 
diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp
index c5e9f61..7a50bb0 100644
--- a/engines/kyra/sound_amiga.cpp
+++ b/engines/kyra/sound_amiga.cpp
@@ -23,8 +23,6 @@
  *
  */
 
-#include "common/system.h"
-#include "common/mutex.h"
 #include "kyra/resource.h"
 #include "kyra/sound_intern.h"
 
diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp
index 40daa0b..3b1ee50 100644
--- a/engines/kyra/sound_lok.cpp
+++ b/engines/kyra/sound_lok.cpp
@@ -26,6 +26,8 @@
 #include "kyra/sound.h"
 #include "kyra/kyra_lok.h"
 
+#include "common/system.h"
+
 namespace Kyra {
 
 void KyraEngine_LoK::snd_playSoundEffect(int track, int volume) {
diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp
index 87679f5..5c9dc8c 100644
--- a/engines/kyra/sound_lol.cpp
+++ b/engines/kyra/sound_lol.cpp
@@ -29,6 +29,8 @@
 #include "kyra/lol.h"
 #include "kyra/resource.h"
 
+#include "common/system.h"
+
 #include "audio/audiostream.h"
 
 namespace Kyra {
diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp
index 4c292b7..a1179b3 100644
--- a/engines/kyra/text_hof.cpp
+++ b/engines/kyra/text_hof.cpp
@@ -29,6 +29,7 @@
 #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 40f2217..4796d74 100644
--- a/engines/kyra/text_lok.cpp
+++ b/engines/kyra/text_lok.cpp
@@ -30,6 +30,8 @@
 #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 9f98586..98f93e2 100644
--- a/engines/kyra/text_lol.cpp
+++ b/engines/kyra/text_lol.cpp
@@ -30,6 +30,8 @@
 #include "kyra/timer.h"
 #include "kyra/util.h"
 
+#include "common/system.h"
+
 namespace Kyra {
 
 TextDisplayer_LoL::TextDisplayer_LoL(LoLEngine *vm, Screen_LoL *screen) : _vm(vm), _screen(screen),
diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp
index 001faab..cc10273 100644
--- a/engines/kyra/text_mr.cpp
+++ b/engines/kyra/text_mr.cpp
@@ -27,6 +27,8 @@
 #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 66b78d3..dbde3d3 100644
--- a/engines/kyra/timer.cpp
+++ b/engines/kyra/timer.cpp
@@ -28,6 +28,7 @@
 
 #include "common/func.h"
 #include "common/stream.h"
+#include "common/system.h"
 
 namespace Kyra {
 
diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp
index 90cfc1a..aa6688f 100644
--- a/engines/kyra/timer_lol.cpp
+++ b/engines/kyra/timer_lol.cpp
@@ -29,6 +29,8 @@
 #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 0d89dec..97ce7c1 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/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp
index 7288889..6e80d3d 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"
 
diff --git a/engines/lastexpress/data/archive.h b/engines/lastexpress/data/archive.h
index 3860245..17b1d66 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 8b0d338..e8236bc 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 9923960..d9acbb8 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 d49db35..7bcf03e 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 5a94398..e893d64 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 7fc9425..9ec1899 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 2308d70..0e6df13 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 {
 
diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h
index 7ad0a57..cd16f26 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 6389489..a50fa7b 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/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp
index 953edd1..2bc5d3c 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 ccef312..8c6cc2b 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 d97ebc1..4196bfe 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 e5a69d1..5c72fa7 100644
--- a/engines/lastexpress/graphics.cpp
+++ b/engines/lastexpress/graphics.cpp
@@ -25,7 +25,9 @@
 
 #include "lastexpress/graphics.h"
 
+#include "common/rect.h"
 #include "common/system.h"
+#include "common/textconsole.h"
 
 namespace LastExpress {
 
diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp
index 5a77b23..dff686a 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/memory.cpp b/engines/lure/memory.cpp
index f96b501..d3d5067 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 6e2c11c..58ee3f4 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 b64ef63..e02f492 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 dd55380..7a894d8 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 ce8574a..c61c6fe 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 26de121..3fe050e 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 9b14169..8fe4fbf 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 88b4240..cbcaa04 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 f67291f..46c4b35 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 7efbc52..0583d5f 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 {
 
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index d982eca..3db9934 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 a3eca13..a685b36 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"
diff --git a/engines/m4/gui.cpp b/engines/m4/gui.cpp
index 6619b37..56cf96b 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 d9a1bf9..1a48432 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 118b09f..a20bb26 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 0ace40b..a0d8a50 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 f434578..83f23ed 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 571a6fa..e7ca9cb 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 878e86c..98a0d06 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 4ca8154..437e9d2 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 fd972cc..7b82480 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 b4385db..33c679c 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 e49dbfa..24ac60c 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 192cab0..1946797 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 42d55c6..cc60ec3 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 14c60c1..fb90cea 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 77528ec..cef9917 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 1b9d985..dc24548 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 8d06aa0..4e7a046 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 7e8330d..388ff60 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 c81fa3d..c791b65 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 2e06871..e5bbbc3 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/redreader.cpp b/engines/made/redreader.cpp
index 3d36b69..2fcd7f4 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 e556e4a..35a659a 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"
diff --git a/engines/made/resource.h b/engines/made/resource.h
index ade6a23..f1aeb7a 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 2649e2b..a863906 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) {
diff --git a/engines/made/script.h b/engines/made/script.h
index 16c5ad6..be719eb 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 4f1937c..c0a7234 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/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp
index a6ec2cf..05284f8 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 {
 
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp
index ee67c9f..56d4a97 100644
--- a/engines/mohawk/console.cpp
+++ b/engines/mohawk/console.cpp
@@ -29,6 +29,8 @@
 #include "mohawk/sound.h"
 #include "mohawk/video.h"
 
+#include "common/system.h"
+
 #ifdef ENABLE_CSTIME
 #include "mohawk/cstime.h"
 #endif
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp
index 955e0e5..46faae0 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 408f1c9..c4801f8 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 14e5d99..66dce1d 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 935b032..106f7ea 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 115b363..12d641a 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/detection.cpp b/engines/mohawk/detection.cpp
index 80f4c0f..cd64cc9 100644
--- a/engines/mohawk/detection.cpp
+++ b/engines/mohawk/detection.cpp
@@ -26,9 +26,8 @@
 #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 "mohawk/livingbooks.h"
 
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp
index c5a0c7e..4c7e52f 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 81d2b6f..54dc85b 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -28,7 +28,9 @@
 #include "mohawk/livingbooks.h"
 
 #include "common/substream.h"
+#include "common/system.h"
 #include "engines/util.h"
+#include "graphics/palette.h"
 #include "graphics/primitives.h"
 #include "gui/message.h"
 
diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp
index 4ea742d..5079375 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 565b363..d33fbe5 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 22ea8d0..2475965 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 84f69af..4237c71 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 015cbff..f63645f 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/myst.cpp b/engines/mohawk/myst.cpp
index 1aba820..655a38b 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 21f6627..dc00bff 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 17a2c66..71c408e 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 26267cf..cba2583 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 61772ed..bb8397f 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 ffbf9c9..e2a11eb 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 3dab2f7..c5c1102 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 5d07032..2b8ef94 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 dc491c7..fddf629 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 a84cd06..c670cb6 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 e664081..4057edd 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 b5b403d..07701c2 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 968bb42..de71dcf 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/resource.cpp b/engines/mohawk/resource.cpp
index de1513b..62250b7 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 8892788..3aba564 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 7c453de..dc0d66f 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 35f38c4..b8f86f9 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 46cd965..2ac805c 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 9759f14..fba8780 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 f481b5c..36b9455 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() {
diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp
index 837d386..e5a4412 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/callables_br.cpp b/engines/parallaction/callables_br.cpp
index 21703dc..0bc6f67 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 f67a77a..8e3c2cb 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 e3d02ba..944d9f4 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 6928c1e..a577b16 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"
 
diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h
index 69d3215..9af189a 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 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 34b04cd..e0342f7 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"
 
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index 133b7be..7c14a31 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"
 
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp
index 99aa27b..c879745 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 c8a5ee1..ee35757 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 18f469f..a459e6a 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 6c39b2e..ca99624e 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 35441d7..c9504f1 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"
 
diff --git a/engines/parallaction/gui.cpp b/engines/parallaction/gui.cpp
index c4a36e5..db70ebb 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 c80a994..cfc7b12 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"
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index 51d3ba5..eb94b07 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"
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index e508668..95ea547 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"
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 5ead55b..76c4e2c 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 {
 
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index c345b92..e1306dc 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 3055439..516d465 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_br.cpp b/engines/parallaction/parallaction_br.cpp
index 619a4f7..ca34479 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 ffac22e..ffc0412 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 c964b74..a7b926e 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 9748be0..f8818de 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 5053a3d..6c9afe3 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 50a777f..4c77aa3 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 ee53f96..abfaa4b 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 ba81314..5123695 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 356856e..87b2473 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 11a8704..6fb48c7 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 b130b27..c78fd8e 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/graphics.cpp b/engines/queen/graphics.cpp
index 17e36b1..c86f679 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 9518388..eac855a 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 aff24be..4200168 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 de25430..e99a739 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 b03c90f..af52f7e 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 519f028..0dde5c7 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/resource.cpp b/engines/queen/resource.cpp
index e8519ee..62b13e2 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 a34af99..afb77f3 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/talk.cpp b/engines/queen/talk.cpp
index 106b0d6..18c712b 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 7765828..a778ea5 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 5fc2082..0a438e4 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 {
diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h
index 33fac10..56d9104 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/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp
index 5ae80b1..7f04474 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/saga.h b/engines/saga/saga.h
index 52c4b82..4df44a2 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 6a6992f..2730037 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 685cb26..8f0baa9 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 368f59e..bed19ba 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/sci/decompressor.cpp b/engines/sci/decompressor.cpp
index 73d4ed4..c122fce 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/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 82522a6..0e2f642 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 911713d..7fb6ac2 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 6a411d8..a8d4437 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 81d5b2c..8ae06f2 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/vm.cpp b/engines/sci/engine/vm.cpp
index d209a0c..b441815 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/frameout.cpp b/engines/sci/graphics/frameout.cpp
index dd55b3b..7fafe84 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/paint.cpp b/engines/sci/graphics/paint.cpp
index c347da3..27a0bdf 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 ff738fc..cba2868 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"
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index 69a278e..f277436 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 0433479..42551e9 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 6e9df2f..3f9ebaa 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 fb12405..dde1be1 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 77db56a..b330a43 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 2a7c646..a48ae0f 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"
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 6e74553..1e0b9c0 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/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp
index 65a8e2e..f00c99d 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 030b095..7ee8d21 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 051fa7f..47c59a1 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 971c2ff..f217738 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/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp
index 0633325..4b1efb3 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/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp
index ecdce3b..9cb292c 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"
diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h
index 52bf0ba..aeb638e 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 0e69a9a..17d1f9a 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"
 
diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h
index 70aaa66..70d3985 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/debugger.cpp b/engines/scumm/debugger.cpp
index 63188c1..4c1942b 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/file_nes.cpp b/engines/scumm/file_nes.cpp
index d9d84f0..47704d6 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/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp
index a16af73..5cd75a5 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/palette_he.cpp b/engines/scumm/he/palette_he.cpp
index 7f517c5..49e43a0 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 40889ec..487429c 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 c96b2f7..78028c6 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 236edb5..1e96aa8 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 e737d74..be77e4f 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 e81212f..b0786c9 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_pce.h b/engines/scumm/player_pce.h
index 3f5033f..42153e8 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_v4a.h b/engines/scumm/player_v4a.h
index 108dbcf..458a39b 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/scumm.h b/engines/scumm/scumm.h
index 59ff0f1..62c6c70 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"
 
diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp
index 4389890..95b7653 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/codec37.cpp b/engines/scumm/smush/codec37.cpp
index 658d67c..9dbbc68 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 3a1639c..47286ba 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 04ed955..f730acf 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 c7a7354..3d62fdc 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 0e4f588..2e39558 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/util.cpp b/engines/scumm/util.cpp
index ccd0230..5c3e4c9 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 dae4b94..d697483 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 08184ad..672fb38 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/control.cpp b/engines/sky/control.cpp
index 8a5409a..f31f0f6 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/debug.cpp b/engines/sky/debug.cpp
index 2839665..df55966 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 e72875f..6871fc9 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 5ad0c3e..3795c41 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 9e26028..0cdcbb4 100644
--- a/engines/sky/disk.h
+++ b/engines/sky/disk.h
@@ -28,7 +28,6 @@
 
 
 #include "common/scummsys.h"
-#include "common/str.h"
 #include "sky/rnc_deco.h"
 
 #define MAX_FILES_IN_LIST 60
diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp
index cf1910c..506a669 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 b52e908..f9ebd0f 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 ca0ebcc..611010f 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 e9c20de..9b3c433 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 3852a69..be0afa8 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 8818c5b..6a8529f 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 51df95e..4f47e51 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 e1044a9..748637f 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 1b815b9..a209571 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/sky.cpp b/engines/sky/sky.cpp
index f3556c8..f10ec10 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 378bba7..58ac3ed 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 3d247ed..7191f6c 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 548c9cb..2464d93 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 60176be..7c17bef 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 d4f6bfd..d8ddd53 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/detection.cpp b/engines/sword1/detection.cpp
index 855c7d1..fa82770 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 55a438f..9200e6a 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 ef54167..3da3c45 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 b08631d..f315895 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 1b4ca12..3a7ea74 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 2b81ae1..49f9f72 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 9ac2c7a..dde1498 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 2bad8a7..f7b9eb8 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 9ff5ae0..3694ed2 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 1906fcb..de96f6e 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 f8219eb..c970e72 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/sword1.cpp b/engines/sword1/sword1.cpp
index 8768e62..3b3eaaf 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 255299d..dbb683c 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 ef3e07f..7c65533 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 8d1a983..a5a2499 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 b488092..4332f28 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 f0e0e56..24101e2 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 a968a56..e0990ea 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 e039ae3..a3804366 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 c5091a2..47cc3ec 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 511561c..c27bd76 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 648d1d7..fda3098 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 cd36f9a..2b37841 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 b6e9b16..3a26ab1 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 aa91843..233d936 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 f43efca..a52160d 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 fa9c396..36280cf 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/router.cpp b/engines/sword2/router.cpp
index 8f35515..c2b4d2e 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 fab360a..94ef897 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 74a23c8..a83e581 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 261c829..3cf8523 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 2c4c836..c37e006 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 b67f079..ec8e198 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 e4572d3..ea1751e 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 7ad021b..58f3547 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 1adc652..ee4c6b2 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 3900df2..fe24675 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 177bd38..919e669 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 {
 
diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp
index e9901c0..2b09be7 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"
diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h
index a753bc5..4ed2af5 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/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index 35e9497..ee664d6 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>
diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp
index b4d4b25..e5ec6c1 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 f3aebef..26c924d 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 9e7ee0f..3abf43d 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 8d0f4a3..69d961a 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/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp
index 137e37b..8096767 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 03cdaf8..08f0f5b 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 8740e44..38c1c89 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 9e96795..5bd27b3 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 1620aa7..9dd30f4 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 5681200..623966f 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 d0662a7..f4be917 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 7d252f5..2d98ae9 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 e08a351..29a8121 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 bc4ac24..4d18d68 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 395b254..f0be516 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 9fe889f..6990823 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 f9756b5..1c2c311 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"
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 2dc5bc9..2d7a5e9 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 {
+class Event;
+}
+
 namespace TeenAgent {
 
 class TeenAgentEngine;
diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp
index 7ba6809..829c847 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.h b/engines/teenagent/surface.h
index b44fd3c..82c13c8 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 e66de70..ec1e945 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 734ed0c..b08cca2 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 b0a9301..37b0a7e 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 c0ce3fe..c8558e3 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 76f9e85..dca1163 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 1ceecb8..179be2b 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 e0feb52..ca803a4 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 a738f40..94b3d70 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 1d25723..9ec253e 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 9f951e8..530395d 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 {
diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp
index 37d8de9..61c8b67 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 747fdfe..0e67c3a 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 e3fbad6..793febd 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 ee9c9ae..281dd2d 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/drives.cpp b/engines/tinsel/drives.cpp
index ab606f3..d252e45 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 0b550f5..bdcd320 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 f2db42b..6f5f92c 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 cf28749..5d96729 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 1aac68c..ad02a61 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 2d2ebd6..0877337 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 ccd86d7..a1cc02a 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/pdisplay.cpp b/engines/tinsel/pdisplay.cpp
index 33eee8b..5022f47 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 0811dae..f49ddde 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 c0878b6..38ac0a2 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 7a6b587..b6935d4 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 ef0f5cd..aa359d2 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 80f4c58..b82bac3 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 427e288..37c04ab 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 17ae7c8..20d75b6 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 304223e..ec42ca5 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 aa303a5..2dc0e83 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 ed4c99a..ad795fd 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 5f15cd9..c1a4cd0 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/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 13b08a2..afd409c 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 d78175d..748f132 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"
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 6004aac..856acbd 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 c2e0bf7..026450d 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 e63bc91..29a61ff 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 4f81528..77333c4 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 034332a..833fdbf 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 0e2d58c..9367d79 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 0573e92..1c1e23e 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 4305abb..19c85d1 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 {
 
diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp
index e0cdf87..677876f 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 {
diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp
index 1945f0f..ce28f9c 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 b29aa3b..f9f65b4 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 0242ace..8703666 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 b181591..8f75097 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 0d69778..af37ea9 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 f0d17dd..94a3ea5 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 da6e0f7..ff72e69 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 5c8ca77..297390c 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"
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp
index 3c108e2..93406dc 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 73817a5..42b68d0 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 6b47a7f..15a2b1c 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/core.cpp b/engines/tsage/core.cpp
index 887994f..770b091 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"
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index e8f0215..c50a4f5 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"
diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp
index be9200c..7be1c88 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"
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index f9f9e4b..dce1b86 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"
 
diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h
index b33cc37..4ae41f6 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/saveload.cpp b/engines/tsage/saveload.cpp
index 8b07767..317bc4b 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/sound.cpp b/engines/tsage/sound.cpp
index 7c8325d..63e7531 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/tsage.cpp b/engines/tsage/tsage.cpp
index 2d3f303..d6f07c9 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"
diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp
index 108c6bc..ee117d2 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 c0f1baa..aeb4399 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 83533a9..52c6bf1 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 5e99e3c..d747b34 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 e41cbfb..ed30468 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 0237712..e3ca0bf 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 0a783a0..9285fa2 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 0ee1303..3eef1b1 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"
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
index fee4b05..c967943 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 b6d2306..2759f3b 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 3593744..9d450e8 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 {
 
diff --git a/graphics/font.h b/graphics/font.h
index b1a4735..9e6e180 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 35ea14b..bbd75bf 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 7871f32..34b457a 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 87078e1..ea1935c 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 {
 
diff --git a/graphics/fonts/winfont.cpp b/graphics/fonts/winfont.cpp
index 12509fd..18866b4 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 {
diff --git a/graphics/fonts/winfont.h b/graphics/fonts/winfont.h
index a552b18..c31d45e 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;
 }
 
 namespace Graphics {
diff --git a/graphics/iff.cpp b/graphics/iff.cpp
index 2174291..a1f4e8a 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 {
diff --git a/graphics/iff.h b/graphics/iff.h
index 0aab0e0..fc837a3 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 a4d2fbc..91da83c 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"
diff --git a/graphics/imagedec.h b/graphics/imagedec.h
index 13aa63a..7ea987b 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 169c3b5..2d990b9 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 {
 
diff --git a/graphics/palette.h b/graphics/palette.h
index 8d7fdbd..14e433f 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 ca4aac7..b61b000 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"
diff --git a/graphics/png.cpp b/graphics/png.cpp
index ed1dd78..46e3c25 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"
 
diff --git a/graphics/png.h b/graphics/png.h
index af6630c..21e0f35 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
diff --git a/graphics/scaler/scale2x.cpp b/graphics/scaler/scale2x.cpp
index deae44c..ec2aa20 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 4e78796..788c869 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 706fea8..c6d2a0d 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 5cee1c7..4b460b2 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) {
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index c581f9b..13ea339 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"
 
diff --git a/graphics/surface.cpp b/graphics/surface.cpp
index f06c24c..271e32f 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"
 
diff --git a/graphics/surface.h b/graphics/surface.h
index f9cb6cc..92c7b7e 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -26,7 +26,10 @@
 #define GRAPHICS_SURFACE_H
 
 #include "common/scummsys.h"
-#include "common/rect.h"
+
+namespace Common {
+struct Rect;
+}
 
 namespace Graphics {
 
diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp
index 8688096..fa906ca 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 {
 
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp
index 10939a6..bae64f9 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/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index e063e11..3b62d6b 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"
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 4606527..08560c8 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 017d47f..64e18f9 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 ac86751..65bed3e 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 3c930db..fbfc498 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 372b007..76d3f7d 100644
--- a/gui/ThemeLayout.h
+++ b/gui/ThemeLayout.h
@@ -26,11 +26,12 @@
 #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;
 }
 #endif
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp
index e3523d1..230dad8 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 7dec12d..a7cb061 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 d228ca8..f5e2bb0 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 c2d9a3f..0389f4c 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 fc216a7..b49365c 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 4ee6baf..2c74596 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 1fef041..eb3498e 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;






More information about the Scummvm-git-logs mailing list