diff options
Diffstat (limited to 'engines')
658 files changed, 2255 insertions, 1363 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index bf152ce90a..8170452102 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -23,7 +23,8 @@ * */ -#include "base/plugins.h" +// FIXME: Avoid using printf +#define FORBIDDEN_SYMBOL_EXCEPTION_printf #include "common/debug.h" #include "common/util.h" @@ -32,6 +33,7 @@ #include "common/macresman.h" #include "common/md5.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "engines/advancedDetector.h" diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 515127b23d..757fb12f33 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -25,11 +25,13 @@ #ifndef ENGINES_ADVANCED_DETECTOR_H #define ENGINES_ADVANCED_DETECTOR_H -#include "common/fs.h" -#include "common/error.h" - #include "engines/metaengine.h" +namespace Common { +class Error; +class FSList; +} + struct ADGameFileDescription { const char *fileName; @@ -62,8 +64,8 @@ struct ADGameDescription { Common::Platform platform; /** - * A bitmask of extra flags. The top 8 bits are reserved for generic flags - * defined in the ADGameFlags. This leaves 24 flags to be used by client + * A bitmask of extra flags. The top 16 bits are reserved for generic flags + * defined in the ADGameFlags. This leaves 16 bits to be used by client * code. */ uint32 flags; diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index 632587f7f7..a69d19f06c 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -32,6 +32,7 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/random.h" +#include "common/textconsole.h" #include "engines/util.h" diff --git a/engines/agi/agi.h b/engines/agi/agi.h index aca0b32a5c..c71a0ebf64 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -27,9 +27,10 @@ #define AGI_H #include "common/scummsys.h" -#include "common/endian.h" +#include "common/error.h" #include "common/util.h" #include "common/file.h" +#include "common/rect.h" #include "common/stack.h" #include "common/system.h" @@ -45,7 +46,9 @@ #include "agi/sound.h" -namespace Common { class RandomSource; } +namespace Common { +class RandomSource; +} /** * This is the namespace of the AGI engine. @@ -693,7 +696,6 @@ public: class GfxMgr; class SpritesMgr; class Menu; -class SearchTree; // Image stack support struct ImageStackElement { diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 0a53f0c4f4..fb92344de2 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -23,12 +23,16 @@ * */ +// FIXME: Avoid using printf +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "base/plugins.h" #include "engines/advancedDetector.h" #include "common/config-manager.h" #include "common/file.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "graphics/thumbnail.h" #include "graphics/surface.h" diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index d0bc83d4c4..f0d38761d0 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -24,9 +24,10 @@ */ #include "common/file.h" - +#include "common/textconsole.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "agi/agi.h" #include "agi/graphics.h" diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp index 8780e1dab8..0141a61065 100644 --- a/engines/agi/loader_v2.cpp +++ b/engines/agi/loader_v2.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "agi/agi.h" namespace Agi { diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp index 18ea4cae7d..025e755c8b 100644 --- a/engines/agi/loader_v3.cpp +++ b/engines/agi/loader_v3.cpp @@ -28,6 +28,7 @@ #include "common/config-manager.h" #include "common/fs.h" +#include "common/textconsole.h" namespace Agi { diff --git a/engines/agi/lzw.cpp b/engines/agi/lzw.cpp index f645cb16d3..495d6458da 100644 --- a/engines/agi/lzw.cpp +++ b/engines/agi/lzw.cpp @@ -36,6 +36,8 @@ #include "agi/agi.h" #include "agi/lzw.h" +#include "common/textconsole.h" + namespace Agi { diff --git a/engines/agi/objects.cpp b/engines/agi/objects.cpp index d942a2b538..bea53d7fa4 100644 --- a/engines/agi/objects.cpp +++ b/engines/agi/objects.cpp @@ -25,6 +25,8 @@ #include "agi/agi.h" +#include "common/textconsole.h" + namespace Agi { int AgiEngine::allocObjects(int n) { diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 2ea53e57ad..e1f99456e8 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -32,6 +32,7 @@ #include "agi/menu.h" #include "common/random.h" +#include "common/textconsole.h" namespace Agi { diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index d17fe1d497..8951fc81df 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -26,6 +26,8 @@ #include "agi/agi.h" #include "agi/graphics.h" +#include "common/textconsole.h" + namespace Agi { PictureMgr::PictureMgr(AgiBase *agi, GfxMgr *gfx) { diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp index 7457a317c2..c51c53e76e 100644 --- a/engines/agi/preagi.cpp +++ b/engines/agi/preagi.cpp @@ -26,6 +26,7 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/random.h" +#include "common/textconsole.h" #include "audio/mididrv.h" diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index 10ca797587..64fc4e9ae5 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -25,6 +25,7 @@ #include "common/events.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index 4e87c8063c..76849949c7 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -28,6 +28,7 @@ #include "agi/graphics.h" #include "common/events.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index e97c144872..c92434c15f 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -32,6 +32,7 @@ #include "common/events.h" #include "common/memstream.h" #include "common/savefile.h" +#include "common/textconsole.h" namespace Agi { diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index 0230b9bd74..96ad78ace5 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -28,6 +28,7 @@ #include "agi/keyboard.h" #include "common/config-manager.h" +#include "common/textconsole.h" #ifdef __DS__ #include "wordcompletion.h" diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 13e7215180..c8df726fc7 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -31,6 +31,7 @@ #include "common/file.h" #include "common/config-manager.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "graphics/thumbnail.h" #include "graphics/surface.h" diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index b215822917..b40cef67ef 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -31,6 +31,8 @@ #include "agi/sound_sarien.h" #include "agi/sound_pcjr.h" +#include "common/textconsole.h" + namespace Agi { // diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp index 11bf5a9034..f5758ed140 100644 --- a/engines/agi/sound_2gs.cpp +++ b/engines/agi/sound_2gs.cpp @@ -28,6 +28,7 @@ #include "common/md5.h" #include "common/memstream.h" #include "common/str-array.h" +#include "common/textconsole.h" #include "agi/agi.h" #include "agi/sound_2gs.h" diff --git a/engines/agi/sound_midi.cpp b/engines/agi/sound_midi.cpp index 986715721f..997c1edd6b 100644 --- a/engines/agi/sound_midi.cpp +++ b/engines/agi/sound_midi.cpp @@ -49,6 +49,7 @@ #include "common/file.h" #include "common/memstream.h" #include "common/stream.h" +#include "common/textconsole.h" #include "agi/agi.h" diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp index 4ed7f8d029..6f2f3c5ad3 100644 --- a/engines/agi/sound_sarien.cpp +++ b/engines/agi/sound_sarien.cpp @@ -23,11 +23,7 @@ * */ -#include "common/md5.h" -#include "common/config-manager.h" -#include "common/fs.h" #include "common/random.h" -#include "common/str-array.h" #include "audio/mididrv.h" diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index 22de66712d..fab3b5cf50 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -27,6 +27,7 @@ #include "common/util.h" #include "common/fs.h" #include "common/debug.h" +#include "common/textconsole.h" #include "agi/wagparser.h" diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp index c48ed90ad8..d8596dec97 100644 --- a/engines/agi/words.cpp +++ b/engines/agi/words.cpp @@ -29,6 +29,8 @@ #include "agi/agi.h" +#include "common/textconsole.h" + namespace Agi { static uint8 *words; // words in the game diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 498c7e4961..56501b5294 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -25,9 +25,9 @@ #include "common/config-manager.h" #include "common/EventRecorder.h" -#include "common/events.h" #include "common/file.h" #include "common/fs.h" +#include "common/textconsole.h" #include "common/system.h" #include "engines/util.h" @@ -35,14 +35,12 @@ #include "agos/debugger.h" #include "agos/intern.h" #include "agos/agos.h" -#include "agos/vga.h" #include "backends/audiocd/audiocd.h" #include "graphics/surface.h" #include "audio/mididrv.h" -#include "audio/mods/protracker.h" namespace AGOS { @@ -568,33 +566,33 @@ Common::Error AGOSEngine::init() { // allocate buffers _backGroundBuf = new Graphics::Surface(); - _backGroundBuf->create(_screenWidth, _screenHeight, 1); + _backGroundBuf->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8()); if (getGameType() == GType_FF || getGameType() == GType_PP) { _backBuf = new Graphics::Surface(); - _backBuf->create(_screenWidth, _screenHeight, 1); + _backBuf->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8()); _scaleBuf = new Graphics::Surface(); - _scaleBuf->create(_screenWidth, _screenHeight, 1); + _scaleBuf->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8()); } if (getGameType() == GType_SIMON2) { _window4BackScn = new Graphics::Surface(); - _window4BackScn->create(_screenWidth, _screenHeight, 1); + _window4BackScn->create(_screenWidth, _screenHeight, Graphics::PixelFormat::createFormatCLUT8()); } else if (getGameType() == GType_SIMON1) { _window4BackScn = new Graphics::Surface(); - _window4BackScn->create(_screenWidth, 134, 1); + _window4BackScn->create(_screenWidth, 134, Graphics::PixelFormat::createFormatCLUT8()); } else if (getGameType() == GType_WW || getGameType() == GType_ELVIRA2) { _window4BackScn = new Graphics::Surface(); - _window4BackScn->create(224, 127, 1); + _window4BackScn->create(224, 127, Graphics::PixelFormat::createFormatCLUT8()); } else if (getGameType() == GType_ELVIRA1) { _window4BackScn = new Graphics::Surface(); if (getPlatform() == Common::kPlatformAmiga && (getFeatures() & GF_DEMO)) { - _window4BackScn->create(224, 196, 1); + _window4BackScn->create(224, 196, Graphics::PixelFormat::createFormatCLUT8()); } else { - _window4BackScn->create(224, 144, 1); + _window4BackScn->create(224, 144, Graphics::PixelFormat::createFormatCLUT8()); } _window6BackScn = new Graphics::Surface(); - _window6BackScn->create(48, 80, 1); + _window6BackScn->create(48, 80, Graphics::PixelFormat::createFormatCLUT8()); } setupGame(); diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 735920e427..aecf2437a7 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -29,6 +29,7 @@ #include "engines/engine.h" #include "common/array.h" +#include "common/error.h" #include "common/keyboard.h" #include "common/random.h" #include "common/rect.h" diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index acdc0084c4..ee47f62a58 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -31,8 +31,10 @@ #include "common/events.h" #include "common/file.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "agos/animation.h" diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp index a477b3dedc..a131bb841b 100644 --- a/engines/agos/charset-fontdata.cpp +++ b/engines/agos/charset-fontdata.cpp @@ -26,6 +26,7 @@ #include "common/system.h" +#include "common/textconsole.h" #include "agos/agos.h" #include "agos/intern.h" diff --git a/engines/agos/debug.cpp b/engines/agos/debug.cpp index d0dc8cc42e..bb27557a6b 100644 --- a/engines/agos/debug.cpp +++ b/engines/agos/debug.cpp @@ -27,6 +27,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "agos/debug.h" #include "agos/agos.h" diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 646e63dacf..c8c70c0ecc 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -29,6 +29,7 @@ #include "common/config-manager.h" #include "common/savefile.h" #include "common/system.h" +#include "common/textconsole.h" #include "agos/intern.h" #include "agos/agos.h" diff --git a/engines/agos/draw.cpp b/engines/agos/draw.cpp index 317c68d31a..6b9f65ee2b 100644 --- a/engines/agos/draw.cpp +++ b/engines/agos/draw.cpp @@ -28,6 +28,7 @@ #include "common/system.h" #include "graphics/surface.h" +#include "graphics/palette.h" #include "agos/agos.h" #include "agos/intern.h" diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index fc0b4f96cd..8799dbaa28 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -32,6 +32,7 @@ #include "common/events.h" #include "common/system.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 710c9ddd7e..4c998dfa5f 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -26,6 +26,7 @@ #include "common/system.h" +#include "common/textconsole.h" #include "graphics/surface.h" diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index ca603db1fa..39a7705c54 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -25,9 +25,9 @@ -#include "common/system.h" - #include "common/file.h" +#include "common/system.h" +#include "common/textconsole.h" #include "graphics/surface.h" diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index 81da5264ba..5d1523bbd5 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -26,6 +26,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "agos/intern.h" #include "agos/agos.h" diff --git a/engines/agos/menus.cpp b/engines/agos/menus.cpp index 5629a1dca6..2b103a75cb 100644 --- a/engines/agos/menus.cpp +++ b/engines/agos/menus.cpp @@ -27,6 +27,7 @@ #include "common/file.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/surface.h" diff --git a/engines/agos/midi.cpp b/engines/agos/midi.cpp index a37c96a787..26e2f2c736 100644 --- a/engines/agos/midi.cpp +++ b/engines/agos/midi.cpp @@ -28,6 +28,7 @@ #include "common/config-manager.h" #include "common/file.h" #include "common/system.h" +#include "common/textconsole.h" #include "agos/agos.h" diff --git a/engines/agos/midi.h b/engines/agos/midi.h index ad69a3ddde..40f54dbaf0 100644 --- a/engines/agos/midi.h +++ b/engines/agos/midi.h @@ -31,7 +31,7 @@ #include "common/mutex.h" namespace Common { - class File; +class File; } namespace AGOS { diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp index 156dc6ecaa..f96518b5e9 100644 --- a/engines/agos/midiparser_s1d.cpp +++ b/engines/agos/midiparser_s1d.cpp @@ -25,6 +25,7 @@ #include "common/debug.h" #include "common/util.h" +#include "common/textconsole.h" #include "audio/mididrv.h" #include "audio/midiparser.h" diff --git a/engines/agos/res.cpp b/engines/agos/res.cpp index b8409669ee..0e818963e2 100644 --- a/engines/agos/res.cpp +++ b/engines/agos/res.cpp @@ -28,6 +28,7 @@ #include "common/file.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "common/util.h" #include "agos/agos.h" diff --git a/engines/agos/res_snd.cpp b/engines/agos/res_snd.cpp index fe09e746ff..34deff37ab 100644 --- a/engines/agos/res_snd.cpp +++ b/engines/agos/res_snd.cpp @@ -26,6 +26,7 @@ #include "common/config-manager.h" #include "common/file.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "agos/intern.h" #include "agos/agos.h" diff --git a/engines/agos/rooms.cpp b/engines/agos/rooms.cpp index a2eff06fcc..0993197594 100644 --- a/engines/agos/rooms.cpp +++ b/engines/agos/rooms.cpp @@ -26,6 +26,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "agos/agos.h" #include "agos/intern.h" diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index eefa2460ec..d6f25814bb 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -26,6 +26,7 @@ #include "common/file.h" #include "common/savefile.h" #include "common/system.h" +#include "common/textconsole.h" #include "common/translation.h" #include "gui/about.h" diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 90992b52fe..94a3f371cc 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -28,6 +28,7 @@ #include "common/system.h" +#include "common/textconsole.h" #include "agos/animation.h" #include "agos/agos.h" diff --git a/engines/agos/script_pn.cpp b/engines/agos/script_pn.cpp index 909c051362..b8ba7fb015 100644 --- a/engines/agos/script_pn.cpp +++ b/engines/agos/script_pn.cpp @@ -26,6 +26,8 @@ #include "agos/agos.h" #include "agos/vga.h" +#include "common/textconsole.h" + namespace AGOS { enum { diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp index 05a725cb50..dab0302631 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -26,6 +26,8 @@ #include "common/system.h" +#include "graphics/palette.h" + #include "agos/agos.h" #ifdef _WIN32_WCE diff --git a/engines/agos/script_s2.cpp b/engines/agos/script_s2.cpp index dd525163c7..a0b14525f2 100644 --- a/engines/agos/script_s2.cpp +++ b/engines/agos/script_s2.cpp @@ -27,6 +27,8 @@ #include "agos/agos.h" +#include "common/textconsole.h" + namespace AGOS { #define OPCODE(x) _OPCODE(AGOSEngine_Simon2, x) diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp index 35301793bf..25d861acb5 100644 --- a/engines/agos/sound.cpp +++ b/engines/agos/sound.cpp @@ -25,6 +25,7 @@ #include "common/file.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "common/util.h" #include "agos/agos.h" diff --git a/engines/agos/string.cpp b/engines/agos/string.cpp index bda605a84a..1152d6ed04 100644 --- a/engines/agos/string.cpp +++ b/engines/agos/string.cpp @@ -26,6 +26,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "gui/about.h" #include "gui/message.h" diff --git a/engines/agos/string_pn.cpp b/engines/agos/string_pn.cpp index a4e40d8306..92d85ab96c 100644 --- a/engines/agos/string_pn.cpp +++ b/engines/agos/string_pn.cpp @@ -26,6 +26,8 @@ #include "agos/agos.h" #include "agos/intern.h" +#include "common/textconsole.h" + namespace AGOS { uint32 AGOSEngine_PN::ftext(uint32 base, int n) { diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index 733d40e52d..bd07596a46 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -26,6 +26,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "agos/agos.h" #include "agos/intern.h" diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index 83ee05036c..6c07db13c1 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -31,6 +31,7 @@ #include "agos/vga.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/surface.h" diff --git a/engines/agos/vga_e2.cpp b/engines/agos/vga_e2.cpp index b0431db801..9e163ba91f 100644 --- a/engines/agos/vga_e2.cpp +++ b/engines/agos/vga_e2.cpp @@ -32,6 +32,7 @@ #include "common/system.h" #include "graphics/surface.h" +#include "graphics/palette.h" namespace AGOS { diff --git a/engines/agos/vga_ww.cpp b/engines/agos/vga_ww.cpp index 8aecd3448a..08b2cee303 100644 --- a/engines/agos/vga_ww.cpp +++ b/engines/agos/vga_ww.cpp @@ -32,6 +32,7 @@ #include "common/system.h" #include "graphics/surface.h" +#include "graphics/palette.h" namespace AGOS { diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index a03c7e178a..08680c9e45 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -26,6 +26,7 @@ #include "common/system.h" +#include "common/textconsole.h" #include "graphics/surface.h" diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp index 14b8de9e39..6b4b29dcfe 100644 --- a/engines/cine/anim.cpp +++ b/engines/cine/anim.cpp @@ -29,6 +29,7 @@ #include "common/endian.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/anim.h" diff --git a/engines/cine/bg.cpp b/engines/cine/bg.cpp index b3171de918..22fd28a99c 100644 --- a/engines/cine/bg.cpp +++ b/engines/cine/bg.cpp @@ -26,6 +26,7 @@ #include "common/endian.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/various.h" diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp index 54d113d69c..8104ad38cd 100644 --- a/engines/cine/cine.cpp +++ b/engines/cine/cine.cpp @@ -23,13 +23,9 @@ * */ -#include "common/events.h" #include "common/EventRecorder.h" -#include "common/file.h" -#include "common/savefile.h" #include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/system.h" #include "engines/util.h" diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index 9dfa2f71ea..058c1a1140 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -27,6 +27,7 @@ #include "engines/advancedDetector.h" #include "common/system.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/various.h" diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp index 3970d88117..18feacd08b 100644 --- a/engines/cine/gfx.cpp +++ b/engines/cine/gfx.cpp @@ -30,8 +30,9 @@ #include "cine/pal.h" #include "common/endian.h" -#include "common/system.h" #include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" diff --git a/engines/cine/msg.cpp b/engines/cine/msg.cpp index a01afd147b..3d58d6ddcd 100644 --- a/engines/cine/msg.cpp +++ b/engines/cine/msg.cpp @@ -25,6 +25,7 @@ #include "common/debug.h" #include "common/endian.h" +#include "common/textconsole.h" #include "cine/msg.h" #include "cine/various.h" diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp index 3c8ffc295b..0f52600db5 100644 --- a/engines/cine/pal.cpp +++ b/engines/cine/pal.cpp @@ -27,6 +27,9 @@ #include "cine/various.h" #include "cine/pal.h" #include "common/system.h" // For g_system->getPaletteManager()->setPalette +#include "common/textconsole.h" + +#include "graphics/palette.h" namespace Cine { diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index f5c9402388..17ef01948c 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -25,6 +25,7 @@ #include "common/debug.h" #include "common/endian.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/unpack.h" diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp index 4911f78da9..1fc2a8b2fd 100644 --- a/engines/cine/saveload.cpp +++ b/engines/cine/saveload.cpp @@ -25,6 +25,7 @@ #include "common/debug.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/bg_list.h" diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index ffbee3d389..674bf4dd86 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -28,6 +28,7 @@ */ #include "common/endian.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/bg_list.h" diff --git a/engines/cine/script_os.cpp b/engines/cine/script_os.cpp index 9ee3a892a9..aa2c8c33ac 100644 --- a/engines/cine/script_os.cpp +++ b/engines/cine/script_os.cpp @@ -28,6 +28,7 @@ */ #include "common/endian.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/bg_list.h" diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp index f0c0668e33..414761159b 100644 --- a/engines/cine/sound.cpp +++ b/engines/cine/sound.cpp @@ -26,6 +26,8 @@ #include "common/endian.h" #include "common/file.h" #include "common/memstream.h" +#include "common/system.h" +#include "common/textconsole.h" #include "cine/cine.h" #include "cine/sound.h" diff --git a/engines/cine/sound.h b/engines/cine/sound.h index e9a797989e..7b506ab5f3 100644 --- a/engines/cine/sound.h +++ b/engines/cine/sound.h @@ -30,7 +30,7 @@ #include "audio/mixer.h" namespace Audio { - class AudioStream; +class AudioStream; } namespace Cine { diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp index 9dbfa315d9..fb6818d690 100644 --- a/engines/cine/texte.cpp +++ b/engines/cine/texte.cpp @@ -23,8 +23,10 @@ * */ -#include "cine/cine.h" #include "common/file.h" +#include "common/textconsole.h" + +#include "cine/cine.h" #include "cine/various.h" namespace Cine { diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp index 5b8663606e..fdc7a28867 100644 --- a/engines/cine/various.cpp +++ b/engines/cine/various.cpp @@ -26,6 +26,7 @@ #include "common/endian.h" #include "common/events.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp index 9cbc3dd9ae..2c83aff743 100644 --- a/engines/cruise/actor.cpp +++ b/engines/cruise/actor.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "cruise/cruise.h" #include "cruise/staticres.h" diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index edd52d3b4a..7c63c155d3 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "cruise/cruise_main.h" namespace Cruise { diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp index 2c5659c4d9..9712bd9439 100644 --- a/engines/cruise/cruise.cpp +++ b/engines/cruise/cruise.cpp @@ -23,13 +23,10 @@ * */ -#include "common/events.h" #include "common/EventRecorder.h" #include "common/file.h" -#include "common/savefile.h" -#include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/system.h" +#include "common/textconsole.h" #include "engines/util.h" diff --git a/engines/cruise/cruise.h b/engines/cruise/cruise.h index ad3bb20ca1..8d03d47327 100644 --- a/engines/cruise/cruise.h +++ b/engines/cruise/cruise.h @@ -31,7 +31,6 @@ #include "common/random.h" #include "engines/engine.h" -#include "engines/game.h" #include "cruise/cruise_main.h" #include "cruise/debugger.h" diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index b1d7a594fe..e2f2d7468e 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -27,6 +27,7 @@ #include "common/endian.h" #include "common/events.h" #include "common/system.h" // for g_system->getEventManager() +#include "common/textconsole.h" #include "cruise/cruise.h" #include "cruise/cruise_main.h" diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp index b9e4ca8bc9..3ccd1689b8 100644 --- a/engines/cruise/dataLoader.cpp +++ b/engines/cruise/dataLoader.cpp @@ -26,6 +26,7 @@ #include "cruise/cruise_main.h" #include "common/endian.h" #include "common/memstream.h" +#include "common/textconsole.h" namespace Cruise { diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 66018fac2e..63d7328e78 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -27,6 +27,7 @@ #include "base/plugins.h" #include "common/savefile.h" +#include "common/system.h" #include "engines/advancedDetector.h" #include "cruise/cruise.h" diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 0b25ee59c1..75b90f7ec8 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -28,6 +28,8 @@ #include "cruise/cell.h" #include "cruise/sound.h" #include "cruise/staticres.h" + +#include "common/textconsole.h" #include "common/util.h" namespace Cruise { diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 1b6f3942de..4d48c2c466 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -29,6 +29,8 @@ #include "common/list.h" #include "common/rect.h" +#include "graphics/palette.h" + #include "cruise/cruise.h" #include "cruise/cruise_main.h" diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index a722b947ff..36689ca0e3 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -29,6 +29,7 @@ #include "engines/metaengine.h" #include "gui/saveload.h" +#include "common/system.h" #include "common/translation.h" namespace Cruise { diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp index 864491605f..8e2be0cf13 100644 --- a/engines/cruise/object.cpp +++ b/engines/cruise/object.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "cruise/cruise_main.h" namespace Cruise { diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp index 9a77891deb..b7a0293f33 100644 --- a/engines/cruise/overlay.cpp +++ b/engines/cruise/overlay.cpp @@ -24,6 +24,7 @@ */ #include "common/memstream.h" +#include "common/textconsole.h" #include "cruise/cruise.h" #include "cruise/cruise_main.h" diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index a1a306705e..6e75088d45 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -30,6 +30,7 @@ #include "common/serializer.h" #include "common/savefile.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/scaler.h" #include "graphics/thumbnail.h" diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index aae4dba475..d6ff784644 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -26,6 +26,7 @@ #include "cruise/cruise.h" #include "cruise/cruise_main.h" #include "common/endian.h" +#include "common/textconsole.h" namespace Cruise { diff --git a/engines/cruise/sound.cpp b/engines/cruise/sound.cpp index 2826a34351..322f808439 100644 --- a/engines/cruise/sound.cpp +++ b/engines/cruise/sound.cpp @@ -24,6 +24,8 @@ */ #include "common/endian.h" +#include "common/system.h" +#include "common/textconsole.h" #include "cruise/cruise.h" #include "cruise/cruise_main.h" diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 18c184e568..7e1f29271e 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -25,21 +25,21 @@ #include "base/version.h" #include "common/config-manager.h" -#include "common/savefile.h" -#include "common/system.h" #include "common/events.h" +#include "common/str.h" +#include "common/system.h" #include "common/translation.h" -#include "graphics/scaler.h" - #include "gui/about.h" #include "gui/gui-manager.h" -#include "gui/launcher.h" -#include "gui/widgets/list.h" #include "gui/message.h" #include "gui/options.h" #include "gui/saveload.h" +#include "gui/ThemeEngine.h" #include "gui/ThemeEval.h" +#include "gui/widget.h" + +#include "graphics/font.h" #include "engines/dialogs.h" #include "engines/engine.h" diff --git a/engines/dialogs.h b/engines/dialogs.h index 6e5338b317..587e91a2bb 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -25,15 +25,15 @@ #ifndef GLOBAL_DIALOGS_H #define GLOBAL_DIALOGS_H -#include "common/str.h" #include "gui/dialog.h" class Engine; namespace GUI { - class ButtonWidget; - class GraphicsWidget; - class SaveLoadChooser; +class ButtonWidget; +class CommandSender; +class GraphicsWidget; +class SaveLoadChooser; } class MainMenuDialog : public GUI::Dialog { diff --git a/engines/draci/animation.cpp b/engines/draci/animation.cpp index bc38e84d72..f2f1727fdd 100644 --- a/engines/draci/animation.cpp +++ b/engines/draci/animation.cpp @@ -32,6 +32,7 @@ #include "draci/surface.h" #include "common/memstream.h" +#include "common/system.h" namespace Draci { diff --git a/engines/draci/game.h b/engines/draci/game.h index 0ecbcf68f0..0b5b3a03cc 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -31,7 +31,7 @@ #include "draci/walking.h" namespace Common { - class Serializer; +class Serializer; } namespace Draci { diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp index 750410b329..1d725ebb15 100644 --- a/engines/draci/music.cpp +++ b/engines/draci/music.cpp @@ -29,6 +29,7 @@ #include "audio/mididrv.h" #include "audio/midiparser.h" #include "common/config-manager.h" +#include "common/debug.h" #include "common/file.h" #include "draci/draci.h" diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index c04f0668bb..ab9c49c63a 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -26,6 +26,8 @@ #include "common/memstream.h" #include "common/system.h" +#include "graphics/palette.h" + #include "draci/draci.h" #include "draci/screen.h" #include "draci/surface.h" diff --git a/engines/draci/script.h b/engines/draci/script.h index e81691204e..a75f6bcbc3 100644 --- a/engines/draci/script.h +++ b/engines/draci/script.h @@ -30,7 +30,7 @@ #include "common/stream.h" namespace Common { - class ReadStream; +class ReadStream; } namespace Draci { diff --git a/engines/draci/sound.cpp b/engines/draci/sound.cpp index 0df19794f7..ab2479f811 100644 --- a/engines/draci/sound.cpp +++ b/engines/draci/sound.cpp @@ -29,6 +29,7 @@ #include "common/file.h" #include "common/str.h" #include "common/substream.h" +#include "common/textconsole.h" #include "common/memstream.h" #include "common/unzip.h" diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp index 532d87a19f..37a76dbe0e 100644 --- a/engines/draci/surface.cpp +++ b/engines/draci/surface.cpp @@ -29,7 +29,7 @@ namespace Draci { Surface::Surface(int width, int height) { - this->create(width, height, 1); + this->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); this->markClean(); _transparentColor = kDefaultTransparent; } diff --git a/engines/draci/surface.h b/engines/draci/surface.h index b00abcd943..cb15ecebe4 100644 --- a/engines/draci/surface.h +++ b/engines/draci/surface.h @@ -27,6 +27,7 @@ #define DRACI_SURFACE_H #include "common/list.h" +#include "common/rect.h" #include "graphics/surface.h" namespace Draci { diff --git a/engines/drascula/converse.cpp b/engines/drascula/converse.cpp index d0906fdf55..dcd93d84d7 100644 --- a/engines/drascula/converse.cpp +++ b/engines/drascula/converse.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "drascula/drascula.h" namespace Drascula { diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 19395dcd3f..470f28ccff 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -29,6 +29,7 @@ #include "common/file.h" #include "common/savefile.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 9c5f3dc12a..4cd91e48a0 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -25,8 +25,9 @@ #include "drascula/drascula.h" #include "graphics/surface.h" -#include "common/stream.h" +#include "common/stream.h" +#include "common/textconsole.h" namespace Drascula { diff --git a/engines/drascula/objects.cpp b/engines/drascula/objects.cpp index 6b507abc65..630eb08d3c 100644 --- a/engines/drascula/objects.cpp +++ b/engines/drascula/objects.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "drascula/drascula.h" namespace Drascula { diff --git a/engines/drascula/palette.cpp b/engines/drascula/palette.cpp index b521c0313b..a75e72e249 100644 --- a/engines/drascula/palette.cpp +++ b/engines/drascula/palette.cpp @@ -23,6 +23,8 @@ * */ +#include "graphics/palette.h" + #include "drascula/drascula.h" namespace Drascula { diff --git a/engines/drascula/rooms.cpp b/engines/drascula/rooms.cpp index d6774cbc65..35d4eedb5d 100644 --- a/engines/drascula/rooms.cpp +++ b/engines/drascula/rooms.cpp @@ -24,6 +24,7 @@ */ #include "common/array.h" +#include "common/textconsole.h" #include "drascula/drascula.h" diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp index db67409890..eacbe6756d 100644 --- a/engines/drascula/saveload.cpp +++ b/engines/drascula/saveload.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "drascula/drascula.h" namespace Drascula { diff --git a/engines/drascula/sound.cpp b/engines/drascula/sound.cpp index 48e7492b11..5cb1c4486a 100644 --- a/engines/drascula/sound.cpp +++ b/engines/drascula/sound.cpp @@ -29,6 +29,7 @@ #include "audio/decoders/voc.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" diff --git a/engines/engine.cpp b/engines/engine.cpp index 71f9b68f44..217740d9d5 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -32,25 +32,26 @@ #include "engines/engine.h" #include "engines/dialogs.h" -#include "engines/metaengine.h" -#include "engines/util.h" #include "common/config-manager.h" -#include "common/debug.h" #include "common/events.h" #include "common/file.h" -#include "common/timer.h" -#include "common/savefile.h" #include "common/system.h" #include "common/str.h" +#include "common/error.h" +#include "common/list.h" +#include "common/list_intern.h" +#include "common/scummsys.h" +#include "common/textconsole.h" #include "gui/debugger.h" +#include "gui/dialog.h" #include "gui/message.h" -#include "gui/gui-manager.h" #include "audio/mixer.h" #include "graphics/cursorman.h" +#include "graphics/pixelformat.h" #ifdef _WIN32_WCE extern bool isSmartphone(); diff --git a/engines/engine.h b/engines/engine.h index 168a1dc2a0..b7afc0f09d 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -26,22 +26,22 @@ #define ENGINES_ENGINE_H #include "common/scummsys.h" -#include "common/error.h" #include "common/str.h" class OSystem; namespace Audio { - class Mixer; +class Mixer; } namespace Common { - class EventManager; - class SaveFileManager; - class TimerManager; +class Error; +class EventManager; +class SaveFileManager; +class TimerManager; } namespace GUI { - class Debugger; - class Dialog; +class Debugger; +class Dialog; } /** diff --git a/engines/game.cpp b/engines/game.cpp index dea6d37485..a27080cbf8 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -24,7 +24,6 @@ */ #include "engines/game.h" -#include "base/plugins.h" const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list) { diff --git a/engines/game.h b/engines/game.h index 3e5d7f262c..c9a3b25853 100644 --- a/engines/game.h +++ b/engines/game.h @@ -28,6 +28,8 @@ #include "common/array.h" #include "common/hash-str.h" +#include "common/str.h" +#include "common/util.h" /** * A simple structure used to map gameids (like "monkey", "sword1", ...) to diff --git a/engines/gob/databases.cpp b/engines/gob/databases.cpp index 66a711e46e..94f641db4e 100644 --- a/engines/gob/databases.cpp +++ b/engines/gob/databases.cpp @@ -24,6 +24,7 @@ */ #include "common/file.h" +#include "common/textconsole.h" #include "gob/databases.h" diff --git a/engines/gob/dataio.h b/engines/gob/dataio.h index 6e12d15af8..f2b39aed09 100644 --- a/engines/gob/dataio.h +++ b/engines/gob/dataio.h @@ -33,7 +33,7 @@ #include "common/file.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } namespace Gob { diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index 12914163c2..3d697d3693 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -24,14 +24,11 @@ */ #include "common/debug-channels.h" -#include "common/endian.h" -#include "common/events.h" #include "common/EventRecorder.h" #include "backends/audiocd/audiocd.h" #include "base/plugins.h" #include "common/config-manager.h" -#include "common/md5.h" #include "audio/mididrv.h" #include "gui/gui-manager.h" diff --git a/engines/gob/gob.h b/engines/gob/gob.h index 9bdbed45cf..4a928747b0 100644 --- a/engines/gob/gob.h +++ b/engines/gob/gob.h @@ -30,12 +30,14 @@ #include "common/system.h" #include "common/savefile.h" +#include "graphics/pixelformat.h" + #include "engines/engine.h" #include "gob/console.h" namespace GUI { - class StaticTextWidget; +class StaticTextWidget; } /** diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 262fdc8045..8f1ff4c73f 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -23,9 +23,7 @@ * */ -#include "common/endian.h" #include "common/str.h" -#include "common/file.h" #include "gob/gob.h" #include "gob/inter.h" diff --git a/engines/gob/inter_v4.cpp b/engines/gob/inter_v4.cpp index 778387e52d..1da92b3766 100644 --- a/engines/gob/inter_v4.cpp +++ b/engines/gob/inter_v4.cpp @@ -23,9 +23,7 @@ * */ -#include "common/endian.h" #include "common/str.h" -#include "common/file.h" #include "gob/gob.h" #include "gob/inter.h" diff --git a/engines/gob/inter_v5.cpp b/engines/gob/inter_v5.cpp index 85b213ae66..f5e87bb936 100644 --- a/engines/gob/inter_v5.cpp +++ b/engines/gob/inter_v5.cpp @@ -23,9 +23,6 @@ * */ -#include "common/endian.h" -#include "common/file.h" - #include "gui/message.h" #include "gob/gob.h" diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp index 06a06f4fb6..53ebfe7513 100644 --- a/engines/gob/inter_v6.cpp +++ b/engines/gob/inter_v6.cpp @@ -23,9 +23,7 @@ * */ -#include "common/endian.h" #include "common/str.h" -#include "common/file.h" #include "graphics/dither.h" #include "gob/gob.h" diff --git a/engines/gob/resources.h b/engines/gob/resources.h index 9921dc6e76..dec64f6b7c 100644 --- a/engines/gob/resources.h +++ b/engines/gob/resources.h @@ -29,7 +29,7 @@ #include "common/str.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } namespace Gob { diff --git a/engines/gob/save/saveload.cpp b/engines/gob/save/saveload.cpp index 3508e58f16..e490509914 100644 --- a/engines/gob/save/saveload.cpp +++ b/engines/gob/save/saveload.cpp @@ -23,9 +23,6 @@ * */ -#include "common/endian.h" -#include "common/savefile.h" - #include "gob/gob.h" #include "gob/save/saveload.h" #include "gob/global.h" diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index f070bf14fa..4244df68e5 100644 --- a/engines/gob/sound/adlib.cpp +++ b/engines/gob/sound/adlib.cpp @@ -23,8 +23,10 @@ * */ +#include "common/debug.h" #include "common/file.h" #include "common/endian.h" +#include "common/textconsole.h" #include "gob/gob.h" #include "gob/sound/adlib.h" diff --git a/engines/gob/sound/bgatmosphere.cpp b/engines/gob/sound/bgatmosphere.cpp index 8850a727d3..b351d92275 100644 --- a/engines/gob/sound/bgatmosphere.cpp +++ b/engines/gob/sound/bgatmosphere.cpp @@ -23,8 +23,6 @@ * */ -#include "common/system.h" -#include "common/events.h" #include "common/EventRecorder.h" #include "gob/sound/bgatmosphere.h" diff --git a/engines/gob/sound/cdrom.cpp b/engines/gob/sound/cdrom.cpp index 4f3d783046..217aa9c18e 100644 --- a/engines/gob/sound/cdrom.cpp +++ b/engines/gob/sound/cdrom.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" #include "common/str.h" +#include "common/textconsole.h" #include "common/util.h" #include "backends/audiocd/audiocd.h" diff --git a/engines/gob/sound/infogrames.cpp b/engines/gob/sound/infogrames.cpp index 6377b4e798..9fb7410740 100644 --- a/engines/gob/sound/infogrames.cpp +++ b/engines/gob/sound/infogrames.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "gob/sound/infogrames.h" namespace Gob { diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp index d33ea89147..cc1c6b1f6b 100644 --- a/engines/gob/sound/sounddesc.cpp +++ b/engines/gob/sound/sounddesc.cpp @@ -25,6 +25,8 @@ #include "common/util.h" #include "common/memstream.h" +#include "common/textconsole.h" + #include "audio/mixer.h" #include "audio/decoders/raw.h" #include "audio/decoders/wave.h" diff --git a/engines/gob/sound/soundmixer.cpp b/engines/gob/sound/soundmixer.cpp index b6082c577c..3b6b2e5d52 100644 --- a/engines/gob/sound/soundmixer.cpp +++ b/engines/gob/sound/soundmixer.cpp @@ -23,6 +23,8 @@ * */ +#include "common/util.h" + #include "gob/sound/soundmixer.h" #include "gob/sound/sounddesc.h" diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp index c3e8cd9ff5..7bd8aae597 100644 --- a/engines/gob/surface.cpp +++ b/engines/gob/surface.cpp @@ -31,6 +31,8 @@ #include "common/frac.h" #include "graphics/primitives.h" +#include "graphics/pixelformat.h" +#include "graphics/surface.h" namespace Gob { diff --git a/engines/gob/surface.h b/engines/gob/surface.h index 3dea18e36e..b84927af70 100644 --- a/engines/gob/surface.h +++ b/engines/gob/surface.h @@ -34,7 +34,7 @@ #include "graphics/iff.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } namespace Gob { diff --git a/engines/gob/totfile.h b/engines/gob/totfile.h index 211232f870..ce467425e2 100644 --- a/engines/gob/totfile.h +++ b/engines/gob/totfile.h @@ -29,7 +29,7 @@ #include "common/str.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } namespace Gob { diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index 4d51b3d61f..787f85175a 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -36,6 +36,8 @@ #include "common/events.h" +#include "graphics/palette.h" + namespace Gob { Util::Util(GobEngine *vm) : _vm(vm) { diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 444ff8ed9e..1d74a07bfc 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -29,6 +29,7 @@ #include "graphics/cursorman.h" #include "graphics/fontman.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "gob/gob.h" diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index 8222c99ef3..de149c9787 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -720,7 +720,7 @@ bool VideoPlayer::copyFrame(int slot, Surface &dest, if (!surface) return false; - Surface src(surface->w, surface->h, surface->bytesPerPixel, (byte *)surface->pixels); + Surface src(surface->w, surface->h, surface->format.bytesPerPixel, (byte *)surface->pixels); dest.blit(src, left, top, left + width - 1, top + height - 1, x, y, transp); return true; diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp index db4134ccb0..8b62b829e1 100644 --- a/engines/groovie/cursor.cpp +++ b/engines/groovie/cursor.cpp @@ -26,8 +26,11 @@ #include "groovie/cursor.h" #include "groovie/groovie.h" +#include "common/debug.h" #include "common/archive.h" +#include "common/file.h" #include "common/macresman.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" namespace Groovie { diff --git a/engines/groovie/cursor.h b/engines/groovie/cursor.h index 7a1f3ccc0e..e40dc0c486 100644 --- a/engines/groovie/cursor.h +++ b/engines/groovie/cursor.h @@ -30,7 +30,7 @@ #include "common/system.h" namespace Common { - class MacResManager; +class MacResManager; } namespace Groovie { diff --git a/engines/groovie/debug.cpp b/engines/groovie/debug.cpp index bd4b671e11..0b70e4f83a 100644 --- a/engines/groovie/debug.cpp +++ b/engines/groovie/debug.cpp @@ -31,6 +31,8 @@ #include "common/debug-channels.h" #include "common/system.h" +#include "graphics/palette.h" + namespace Groovie { Debugger::Debugger(GroovieEngine *vm) : diff --git a/engines/groovie/font.cpp b/engines/groovie/font.cpp index 92ebcce298..13d0df0005 100644 --- a/engines/groovie/font.cpp +++ b/engines/groovie/font.cpp @@ -23,6 +23,10 @@ * */ +#include "common/array.h" +#include "common/textconsole.h" +#include "graphics/surface.h" + #include "groovie/font.h" namespace Groovie { diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp index 3ceeeb6018..71ee231b80 100644 --- a/engines/groovie/graphics.cpp +++ b/engines/groovie/graphics.cpp @@ -25,15 +25,19 @@ #include "groovie/graphics.h" #include "groovie/groovie.h" + +#include "common/rect.h" #include "common/system.h" +#include "graphics/palette.h" + namespace Groovie { GraphicsMan::GraphicsMan(GroovieEngine *vm) : _vm(vm), _changed(false), _fading(0) { // Create the game surfaces - _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel); - _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel); + _foreground.create(640, 320, _vm->_pixelFormat); + _background.create(640, 320, _vm->_pixelFormat); } GraphicsMan::~GraphicsMan() { diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp index 67c8f3dbc7..795cd6feb9 100644 --- a/engines/groovie/groovie.cpp +++ b/engines/groovie/groovie.cpp @@ -35,7 +35,9 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/events.h" +#include "common/file.h" #include "common/macresman.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" #include "engines/util.h" diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h index f8fad8d91f..9335ffb7e4 100644 --- a/engines/groovie/groovie.h +++ b/engines/groovie/groovie.h @@ -33,7 +33,7 @@ #include "graphics/pixelformat.h" namespace Common { - class MacResManager; +class MacResManager; } /** diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp index 45f9800211..b7078f4c9e 100644 --- a/engines/groovie/music.cpp +++ b/engines/groovie/music.cpp @@ -29,8 +29,11 @@ #include "backends/audiocd/audiocd.h" #include "common/config-manager.h" +#include "common/debug.h" +#include "common/file.h" #include "common/macresman.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "audio/midiparser.h" namespace Groovie { diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp index 8badd90012..3fee87d7bb 100644 --- a/engines/groovie/player.cpp +++ b/engines/groovie/player.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "groovie/player.h" #include "groovie/groovie.h" diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 9c4e6fb2fa..7670ab4315 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -24,8 +24,11 @@ */ #include "common/archive.h" +#include "common/debug.h" +#include "common/file.h" #include "common/macresman.h" #include "common/substream.h" +#include "common/textconsole.h" #include "groovie/resource.h" #include "groovie/groovie.h" diff --git a/engines/groovie/resource.h b/engines/groovie/resource.h index 37fa50f2ea..9c306beecb 100644 --- a/engines/groovie/resource.h +++ b/engines/groovie/resource.h @@ -27,7 +27,7 @@ #define GROOVIE_RESOURCE_H namespace Common { - class MacResManager; +class MacResManager; } namespace Groovie { diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp index 4d7157c797..be9c4f6921 100644 --- a/engines/groovie/roq.cpp +++ b/engines/groovie/roq.cpp @@ -30,7 +30,11 @@ #include "groovie/graphics.h" #include "groovie/groovie.h" +#include "common/debug.h" +#include "common/textconsole.h" + #include "graphics/jpeg.h" +#include "graphics/palette.h" #ifdef USE_RGB_COLOR // Required for the YUV to RGB conversion @@ -175,7 +179,7 @@ void ROQPlayer::buildShowBuf() { // Skip to the next pixel out += _vm->_pixelFormat.bytesPerPixel; if (!(x % _scaleX)) - in += _currBuf->bytesPerPixel; + in += _currBuf->format.bytesPerPixel; } #ifdef DITHER _dither->nextLine(); @@ -328,8 +332,13 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) { _prevBuf->free(); // Allocate new buffers - _currBuf->create(width, height, 3); - _prevBuf->create(width, height, 3); + // These buffers use YUV data, since we can not describe it with a + // PixelFormat struct we just add some dummy PixelFormat with the + // correct bytes per pixel value. Since the surfaces are only used + // internally and no code assuming RGB data is present is used on + // them it should be just fine. + _currBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); + _prevBuf->create(width, height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0)); // Clear the buffers with black YUV values byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0); @@ -697,7 +706,7 @@ void ROQPlayer::copy(byte size, int destx, int desty, int offx, int offy) { for (int i = 0; i < size; i++) { // Copy the current line - memcpy(dst, src, size * _currBuf->bytesPerPixel); + memcpy(dst, src, size * _currBuf->format.bytesPerPixel); // Move to the beginning of the next line dst += _currBuf->pitch; diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp index 8c7d3b0824..fabb70cca0 100644 --- a/engines/groovie/script.cpp +++ b/engines/groovie/script.cpp @@ -37,6 +37,7 @@ #include "common/config-manager.h" #include "common/debug-channels.h" #include "common/EventRecorder.h" +#include "common/file.h" #include "common/macresman.h" #include "gui/message.h" diff --git a/engines/groovie/vdx.cpp b/engines/groovie/vdx.cpp index 6643177328..432b17802c 100644 --- a/engines/groovie/vdx.cpp +++ b/engines/groovie/vdx.cpp @@ -28,9 +28,12 @@ #include "groovie/groovie.h" #include "groovie/lzss.h" +#include "common/debug.h" #include "common/debug-channels.h" +#include "common/textconsole.h" #include "audio/mixer.h" #include "audio/decoders/raw.h" +#include "graphics/palette.h" #define TILE_SIZE 4 // Size of each tile on the image: only ever seen 4 so far #define VDX_IDENT 0x9267 // 37479 diff --git a/engines/groovie/vdx.h b/engines/groovie/vdx.h index 38dd030bcb..31c7606cb7 100644 --- a/engines/groovie/vdx.h +++ b/engines/groovie/vdx.h @@ -29,7 +29,7 @@ #include "groovie/player.h" namespace Common { - class ReadStream; +class ReadStream; } namespace Groovie { diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index e862e339ce..95302c9235 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -26,6 +26,7 @@ #include "engines/advancedDetector.h" #include "common/system.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "graphics/thumbnail.h" #include "graphics/surface.h" diff --git a/engines/hugo/dialogs.cpp b/engines/hugo/dialogs.cpp index 50fcfa27db..f0dc84eae8 100644 --- a/engines/hugo/dialogs.cpp +++ b/engines/hugo/dialogs.cpp @@ -133,7 +133,7 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) { Common::SeekableSubReadStream stream(&in, filPos, filPos + bmpSize); arrayBmp[i * 2] = Graphics::ImageDecoder::loadFile(stream, g_system->getOverlayFormat()); arrayBmp[i * 2 + 1] = new Graphics::Surface(); - arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, arrayBmp[i * 2]->bytesPerPixel); + arrayBmp[i * 2 + 1]->create(arrayBmp[i * 2]->w * 2, arrayBmp[i * 2]->h * 2, g_system->getOverlayFormat()); byte *src = (byte *)arrayBmp[i * 2]->pixels; byte *dst = (byte *)arrayBmp[i * 2 + 1]->pixels; @@ -141,12 +141,12 @@ void TopMenu::loadBmpArr(Common::SeekableReadStream &in) { src = (byte *)arrayBmp[i * 2]->getBasePtr(0, j); dst = (byte *)arrayBmp[i * 2 + 1]->getBasePtr(0, j * 2); for (int k = arrayBmp[i * 2]->w; k > 0; k--) { - for (int m = arrayBmp[i * 2]->bytesPerPixel; m > 0; m--) { + for (int m = arrayBmp[i * 2]->format.bytesPerPixel; m > 0; m--) { *dst++ = *src++; } - src -= arrayBmp[i * 2]->bytesPerPixel; + src -= arrayBmp[i * 2]->format.bytesPerPixel; - for (int m = arrayBmp[i * 2]->bytesPerPixel; m > 0; m--) { + for (int m = arrayBmp[i * 2]->format.bytesPerPixel; m > 0; m--) { *dst++ = *src++; } } diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp index 41e69401d0..af4d094ceb 100644 --- a/engines/hugo/display.cpp +++ b/engines/hugo/display.cpp @@ -32,8 +32,11 @@ // Display.c - DIB related code for HUGOWIN +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "hugo/hugo.h" #include "hugo/display.h" diff --git a/engines/hugo/file.cpp b/engines/hugo/file.cpp index 3a79ba1e7d..ba4e420111 100644 --- a/engines/hugo/file.cpp +++ b/engines/hugo/file.cpp @@ -30,8 +30,10 @@ * */ +#include "common/debug.h" #include "common/system.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "common/config-manager.h" #include "graphics/thumbnail.h" #include "gui/saveload.h" diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp index 48f274e88a..021969f306 100644 --- a/engines/hugo/file_v1d.cpp +++ b/engines/hugo/file_v1d.cpp @@ -30,7 +30,9 @@ * */ +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/file.h" diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp index dbb093752a..4f327b3095 100644 --- a/engines/hugo/file_v1w.cpp +++ b/engines/hugo/file_v1w.cpp @@ -30,7 +30,9 @@ * */ +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/file.h" diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp index d385157a11..0ad89e987e 100644 --- a/engines/hugo/file_v2d.cpp +++ b/engines/hugo/file_v2d.cpp @@ -30,7 +30,9 @@ * */ +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/file.h" diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp index 2f3e5af3f0..6370fffa4d 100644 --- a/engines/hugo/file_v3d.cpp +++ b/engines/hugo/file_v3d.cpp @@ -30,7 +30,9 @@ * */ +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/file.h" diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 7a42ca2ebe..a872a97bae 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -25,13 +25,14 @@ #include "common/system.h" #include "common/random.h" +#include "common/error.h" #include "common/events.h" #include "common/EventRecorder.h" #include "common/debug-channels.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "hugo/hugo.h" -#include "hugo/game.h" #include "hugo/file.h" #include "hugo/schedule.h" #include "hugo/display.h" diff --git a/engines/hugo/intro.cpp b/engines/hugo/intro.cpp index 63e81924c4..c31d76abd0 100644 --- a/engines/hugo/intro.cpp +++ b/engines/hugo/intro.cpp @@ -31,6 +31,7 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/intro.h" @@ -93,7 +94,7 @@ void intro_v1d::introInit() { surf.h = 200; surf.pixels = _vm->_screen->getFrontBuffer(); surf.pitch = 320; - surf.bytesPerPixel = 1; + surf.format = Graphics::PixelFormat::createFormatCLUT8(); _vm->_screen->displayList(kDisplayInit); } @@ -247,7 +248,7 @@ void intro_v2d::introInit() { surf.h = 200; surf.pixels = _vm->_screen->getFrontBuffer(); surf.pitch = 320; - surf.bytesPerPixel = 1; + surf.format = Graphics::PixelFormat::createFormatCLUT8(); char buffer[128]; @@ -293,7 +294,7 @@ void intro_v3d::introInit() { surf.h = 200; surf.pixels = _vm->_screen->getFrontBuffer(); surf.pitch = 320; - surf.bytesPerPixel = 1; + surf.format = Graphics::PixelFormat::createFormatCLUT8(); char buffer[128]; if (_vm->_boot.registered) diff --git a/engines/hugo/inventory.cpp b/engines/hugo/inventory.cpp index ab58e386ba..45893f6965 100644 --- a/engines/hugo/inventory.cpp +++ b/engines/hugo/inventory.cpp @@ -30,6 +30,7 @@ * */ +#include "common/debug.h" #include "common/system.h" #include "hugo/hugo.h" diff --git a/engines/hugo/mouse.cpp b/engines/hugo/mouse.cpp index e8926b17c4..c02908e579 100644 --- a/engines/hugo/mouse.cpp +++ b/engines/hugo/mouse.cpp @@ -32,6 +32,7 @@ // mouse.cpp : Handle all mouse activity +#include "common/debug.h" #include "common/system.h" #include "hugo/hugo.h" diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp index 0a52a0f62d..acf9f6e50c 100644 --- a/engines/hugo/object.cpp +++ b/engines/hugo/object.cpp @@ -30,8 +30,7 @@ * */ -#include "common/system.h" -#include "common/random.h" +#include "common/debug.h" #include "hugo/hugo.h" #include "hugo/game.h" diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp index a8edb45746..95bedf4fa2 100644 --- a/engines/hugo/object_v1d.cpp +++ b/engines/hugo/object_v1d.cpp @@ -30,6 +30,7 @@ * */ +#include "common/debug.h" #include "common/system.h" #include "common/random.h" diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp index f3ba793a3b..54becd8234 100644 --- a/engines/hugo/object_v1w.cpp +++ b/engines/hugo/object_v1w.cpp @@ -30,6 +30,7 @@ * */ +#include "common/debug.h" #include "common/system.h" #include "common/random.h" diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp index b3c49262ad..7c47bf4f92 100644 --- a/engines/hugo/object_v2d.cpp +++ b/engines/hugo/object_v2d.cpp @@ -30,6 +30,7 @@ * */ +#include "common/debug.h" #include "common/system.h" #include "common/random.h" diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp index 2c6fc5d99d..3ff6c56ad3 100644 --- a/engines/hugo/object_v3d.cpp +++ b/engines/hugo/object_v3d.cpp @@ -30,6 +30,7 @@ * */ +#include "common/debug.h" #include "common/system.h" #include "common/random.h" diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp index 19cd4a333c..29a1d5efa3 100644 --- a/engines/hugo/parser.cpp +++ b/engines/hugo/parser.cpp @@ -30,12 +30,8 @@ * */ -#include "common/system.h" #include "common/events.h" - -#include "common/random.h" -#include "common/EventRecorder.h" -#include "common/debug-channels.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/display.h" diff --git a/engines/hugo/parser.h b/engines/hugo/parser.h index dd9244ba93..b00b8d5c43 100644 --- a/engines/hugo/parser.h +++ b/engines/hugo/parser.h @@ -32,6 +32,11 @@ #ifndef HUGO_PARSER_H #define HUGO_PARSER_H + +namespace Common { +struct Event; +} + namespace Hugo { enum seqTextParser { diff --git a/engines/hugo/parser_v1d.cpp b/engines/hugo/parser_v1d.cpp index de18427d93..b2e515fd42 100644 --- a/engines/hugo/parser_v1d.cpp +++ b/engines/hugo/parser_v1d.cpp @@ -32,6 +32,7 @@ // parser.c - handles all keyboard/command input +#include "common/debug.h" #include "common/system.h" #include "hugo/hugo.h" diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp index 305fb995e1..a39063357b 100644 --- a/engines/hugo/parser_v1w.cpp +++ b/engines/hugo/parser_v1w.cpp @@ -32,8 +32,7 @@ // parser.c - handles all keyboard/command input -#include "common/system.h" -#include "common/events.h" +#include "common/debug.h" #include "hugo/hugo.h" #include "hugo/parser.h" diff --git a/engines/hugo/parser_v2d.cpp b/engines/hugo/parser_v2d.cpp index 19570eb44c..6233f11c29 100644 --- a/engines/hugo/parser_v2d.cpp +++ b/engines/hugo/parser_v2d.cpp @@ -32,6 +32,7 @@ // parser.c - handles all keyboard/command input +#include "common/debug.h" #include "common/system.h" #include "hugo/hugo.h" diff --git a/engines/hugo/parser_v3d.cpp b/engines/hugo/parser_v3d.cpp index e5575ab8b7..8c4946c534 100644 --- a/engines/hugo/parser_v3d.cpp +++ b/engines/hugo/parser_v3d.cpp @@ -32,6 +32,7 @@ // parser.c - handles all keyboard/command input +#include "common/debug.h" #include "common/system.h" #include "hugo/hugo.h" diff --git a/engines/hugo/route.cpp b/engines/hugo/route.cpp index 76ec583857..68b659cd3f 100644 --- a/engines/hugo/route.cpp +++ b/engines/hugo/route.cpp @@ -32,6 +32,7 @@ // Find shortest route from hero to destination +#include "common/debug.h" #include "common/system.h" #include "hugo/hugo.h" diff --git a/engines/hugo/schedule.cpp b/engines/hugo/schedule.cpp index 9782dbc0bd..0e91124a7e 100644 --- a/engines/hugo/schedule.cpp +++ b/engines/hugo/schedule.cpp @@ -32,7 +32,9 @@ // This module contains all the scheduling and timing stuff +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "hugo/hugo.h" #include "hugo/schedule.h" diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index 24359a2c54..d657eb96a6 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -32,7 +32,9 @@ // sound.c - sound effects and music support +#include "common/debug.h" #include "common/system.h" +#include "common/textconsole.h" #include "common/config-manager.h" #include "audio/decoders/raw.h" diff --git a/engines/kyra/animator_hof.cpp b/engines/kyra/animator_hof.cpp index e1471239da..a563bc2b4f 100644 --- a/engines/kyra/animator_hof.cpp +++ b/engines/kyra/animator_hof.cpp @@ -26,7 +26,7 @@ #include "kyra/kyra_hof.h" #include "kyra/wsamovie.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp index b906d3a724..452d5e8062 100644 --- a/engines/kyra/animator_lok.cpp +++ b/engines/kyra/animator_lok.cpp @@ -23,16 +23,13 @@ * */ -#include "common/endian.h" - #include "kyra/kyra_lok.h" #include "kyra/screen.h" #include "kyra/animator_lok.h" #include "kyra/sprites.h" -#include "common/system.h" - namespace Kyra { + Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) { _vm = vm; _screen = vm->screen(); diff --git a/engines/kyra/animator_mr.cpp b/engines/kyra/animator_mr.cpp index e6daba7aeb..47c0e3b03a 100644 --- a/engines/kyra/animator_mr.cpp +++ b/engines/kyra/animator_mr.cpp @@ -27,6 +27,8 @@ #include "kyra/resource.h" #include "kyra/wsamovie.h" +#include "common/system.h" + namespace Kyra { void KyraEngine_MR::restorePage3() { diff --git a/engines/kyra/animator_tim.cpp b/engines/kyra/animator_tim.cpp index 0290b2aa7f..fa42042bef 100644 --- a/engines/kyra/animator_tim.cpp +++ b/engines/kyra/animator_tim.cpp @@ -23,9 +23,6 @@ * */ -#include "common/endian.h" -#include "common/system.h" - #include "kyra/script_tim.h" #include "kyra/wsamovie.h" #include "kyra/screen_lol.h" @@ -36,6 +33,8 @@ #include "kyra/screen_v2.h" #endif +#include "common/system.h" + namespace Kyra { #ifdef ENABLE_LOL diff --git a/engines/kyra/animator_v2.cpp b/engines/kyra/animator_v2.cpp index b06dffd36f..07ff4456e5 100644 --- a/engines/kyra/animator_v2.cpp +++ b/engines/kyra/animator_v2.cpp @@ -25,9 +25,6 @@ #include "kyra/kyra_v2.h" #include "kyra/screen_v2.h" -#include "kyra/wsamovie.h" - -#include "common/endian.h" namespace Kyra { diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 301271ad3c..066648b96f 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -23,18 +23,15 @@ * */ - -#include "common/config-manager.h" -#include "common/system.h" #include "kyra/debugger.h" #include "kyra/kyra_lok.h" -#include "kyra/kyra_v2.h" #include "kyra/kyra_hof.h" -#include "kyra/screen.h" #include "kyra/timer.h" #include "kyra/resource.h" #include "kyra/lol.h" +#include "common/system.h" + namespace Kyra { Debugger::Debugger(KyraEngine_v1 *vm) diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 6c111a6601..87cda9f3b6 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -22,17 +22,17 @@ * $Id$ */ -#include "kyra/kyra_v1.h" #include "kyra/kyra_lok.h" #include "kyra/lol.h" #include "kyra/kyra_hof.h" #include "kyra/kyra_mr.h" - #include "common/config-manager.h" -#include "engines/advancedDetector.h" +#include "common/system.h" #include "common/savefile.h" +#include "engines/advancedDetector.h" + #include "base/plugins.h" struct KYRAGameDescription { diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index ff7bf233d2..849b65a24b 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -25,11 +25,11 @@ #include "kyra/gui.h" -#include "kyra/screen.h" #include "kyra/text.h" #include "kyra/wsamovie.h" #include "common/savefile.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index 56971e563c..26e0d8f18a 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -23,15 +23,13 @@ * */ -#include "kyra/kyra_v1.h" +#include "kyra/gui_hof.h" #include "kyra/kyra_hof.h" -#include "kyra/screen.h" -#include "kyra/wsamovie.h" #include "kyra/timer.h" -#include "kyra/sound.h" #include "kyra/resource.h" +#include "kyra/sound.h" -#include "common/savefile.h" +#include "common/system.h" #include "graphics/scaler.h" diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index 3560478a1b..c31cbe3db2 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -23,18 +23,13 @@ * */ +#include "kyra/gui_lok.h" #include "kyra/kyra_lok.h" -#include "kyra/screen.h" -#include "kyra/script.h" -#include "kyra/text.h" #include "kyra/animator_lok.h" -#include "kyra/sound.h" -#include "kyra/gui_lok.h" +#include "kyra/text.h" #include "kyra/timer.h" #include "kyra/util.h" -#include "kyra/item.h" -#include "common/config-manager.h" #include "common/savefile.h" #include "common/system.h" diff --git a/engines/kyra/gui_lok.h b/engines/kyra/gui_lok.h index e846933741..084a798de4 100644 --- a/engines/kyra/gui_lok.h +++ b/engines/kyra/gui_lok.h @@ -27,6 +27,7 @@ #define KYRA_GUI_LOK_H #include "kyra/gui.h" +#include "kyra/screen_lok.h" namespace Kyra { diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index 07fbf1664d..2625347d50 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -25,13 +25,15 @@ #ifdef ENABLE_LOL +#include "kyra/gui_lol.h" #include "kyra/lol.h" #include "kyra/screen_lol.h" -#include "kyra/gui_lol.h" #include "kyra/resource.h" #include "kyra/util.h" +#include "kyra/sound.h" #include "common/savefile.h" +#include "common/system.h" #include "common/config-manager.h" #include "graphics/scaler.h" diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 6bdecfc3b8..6eca24fd46 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -26,12 +26,11 @@ #include "kyra/gui_mr.h" #include "kyra/kyra_mr.h" #include "kyra/text_mr.h" -#include "kyra/wsamovie.h" #include "kyra/resource.h" -#include "kyra/sound.h" #include "kyra/timer.h" +#include "kyra/sound.h" -#include "common/savefile.h" +#include "common/system.h" #include "graphics/scaler.h" diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 2247a0ca2e..01922de7cf 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -24,12 +24,12 @@ */ #include "kyra/gui_v2.h" -#include "kyra/kyra_v2.h" #include "kyra/screen_v2.h" #include "kyra/text.h" #include "kyra/util.h" #include "common/savefile.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/items_hof.cpp b/engines/kyra/items_hof.cpp index 6a78a77c23..d460698272 100644 --- a/engines/kyra/items_hof.cpp +++ b/engines/kyra/items_hof.cpp @@ -25,6 +25,8 @@ #include "kyra/kyra_hof.h" +#include "common/system.h" + namespace Kyra { int KyraEngine_HoF::checkItemCollision(int x, int y) { diff --git a/engines/kyra/items_lok.cpp b/engines/kyra/items_lok.cpp index 322314e3ad..ed1299d239 100644 --- a/engines/kyra/items_lok.cpp +++ b/engines/kyra/items_lok.cpp @@ -24,17 +24,9 @@ */ #include "kyra/kyra_lok.h" -#include "kyra/seqplayer.h" -#include "kyra/screen.h" -#include "kyra/resource.h" -#include "kyra/sound.h" -#include "kyra/sprites.h" -#include "kyra/wsamovie.h" #include "kyra/animator_lok.h" -#include "kyra/text.h" #include "common/system.h" -#include "common/savefile.h" namespace Kyra { diff --git a/engines/kyra/items_mr.cpp b/engines/kyra/items_mr.cpp index 2bc268ace3..5659876307 100644 --- a/engines/kyra/items_mr.cpp +++ b/engines/kyra/items_mr.cpp @@ -26,6 +26,8 @@ #include "kyra/kyra_mr.h" #include "kyra/timer.h" +#include "common/system.h" + namespace Kyra { void KyraEngine_MR::removeTrashItems() { diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index c73792ef8e..de6aa55b08 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -23,18 +23,13 @@ * */ -#include "kyra/kyra_v1.h" #include "kyra/kyra_hof.h" -#include "kyra/screen.h" #include "kyra/resource.h" -#include "kyra/wsamovie.h" -#include "kyra/sound.h" -#include "kyra/script.h" -#include "kyra/script_tim.h" #include "kyra/text_hof.h" #include "kyra/timer.h" #include "kyra/debugger.h" #include "kyra/util.h" +#include "kyra/sound.h" #include "common/system.h" #include "common/config-manager.h" diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index d7ec6ada71..a04c28cad8 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -24,26 +24,19 @@ */ #include "kyra/kyra_lok.h" - -#include "common/file.h" -#include "common/system.h" -#include "common/savefile.h" -#include "common/config-manager.h" -#include "common/debug-channels.h" - -#include "gui/message.h" - #include "kyra/resource.h" -#include "kyra/screen.h" -#include "kyra/script.h" #include "kyra/seqplayer.h" -#include "kyra/sound.h" #include "kyra/sprites.h" -#include "kyra/wsamovie.h" #include "kyra/animator_lok.h" -#include "kyra/text.h" #include "kyra/debugger.h" #include "kyra/timer.h" +#include "kyra/sound.h" + +#include "common/system.h" +#include "common/config-manager.h" +#include "common/debug-channels.h" + +#include "gui/message.h" namespace Kyra { diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index d1ff24ad85..cfa231e2d0 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -32,6 +32,10 @@ #include "kyra/gui_lok.h" #include "kyra/item.h" +namespace Graphics { +struct Surface; +} + namespace Kyra { class Movie; diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 65e78448a5..570ebe0bab 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -23,18 +23,15 @@ * */ -#include "kyra/kyra_v1.h" #include "kyra/kyra_mr.h" -#include "kyra/screen_mr.h" #include "kyra/wsamovie.h" -#include "kyra/sound.h" #include "kyra/text_mr.h" #include "kyra/vqa.h" -#include "kyra/gui.h" #include "kyra/timer.h" #include "kyra/debugger.h" #include "kyra/gui_mr.h" #include "kyra/resource.h" +#include "kyra/sound.h" #include "common/system.h" #include "common/config-manager.h" diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 3a5d21196b..fb56e4a62a 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -23,22 +23,17 @@ * */ -#include "common/config-manager.h" -#include "common/debug-channels.h" -#include "common/EventRecorder.h" - -#include "audio/mididrv.h" -#include "audio/mixer.h" - #include "kyra/kyra_v1.h" #include "kyra/sound_intern.h" #include "kyra/resource.h" -#include "kyra/screen.h" -#include "kyra/text.h" #include "kyra/timer.h" -#include "kyra/script.h" #include "kyra/debugger.h" +#include "common/error.h" +#include "common/config-manager.h" +#include "common/debug-channels.h" +#include "common/EventRecorder.h" + namespace Kyra { KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h index 801d31d676..08dc831dd9 100644 --- a/engines/kyra/kyra_v1.h +++ b/engines/kyra/kyra_v1.h @@ -29,10 +29,10 @@ #include "engines/engine.h" #include "common/array.h" +#include "common/error.h" #include "common/events.h" #include "common/random.h" #include "common/hashmap.h" -#include "common/system.h" #include "audio/mixer.h" @@ -44,6 +44,10 @@ class SeekableReadStream; class WriteStream; } // End of namespace Common +namespace Graphics { +struct Surface; +} + class KyraMetaEngine; /** @@ -166,7 +170,6 @@ enum MusicDataID { class Screen; class Resource; class Sound; -class Movie; class TextDisplayer; class StaticResource; class TimerManager; diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 804097c81d..16b5ffa4e8 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -23,11 +23,12 @@ * */ -#include "common/config-manager.h" - #include "kyra/kyra_v2.h" #include "kyra/screen_v2.h" -#include "kyra/debugger.h" + +#include "common/config-manager.h" +#include "common/error.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 78c9ed260d..ce73bffc89 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -28,17 +28,15 @@ #include "kyra/lol.h" #include "kyra/screen_lol.h" #include "kyra/resource.h" - -#include "kyra/sound.h" #include "kyra/timer.h" #include "kyra/util.h" #include "kyra/debugger.h" +#include "kyra/sound.h" -#include "audio/decoders/voc.h" #include "audio/audiostream.h" #include "common/config-manager.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h index d24f3b427f..a3170c2193 100644 --- a/engines/kyra/lol.h +++ b/engines/kyra/lol.h @@ -31,12 +31,15 @@ #include "kyra/kyra_v1.h" #include "kyra/script_tim.h" #include "kyra/script.h" -#include "kyra/sound.h" #include "kyra/gui_lol.h" #include "kyra/text_lol.h" #include "common/list.h" +namespace Audio { +class SeekableAudioStream; +} // End of namespace Audio + namespace Kyra { class Screen_LoL; diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp index 63b8072654..22786c1c7e 100644 --- a/engines/kyra/resource.cpp +++ b/engines/kyra/resource.cpp @@ -27,11 +27,7 @@ #include "kyra/resource_intern.h" #include "common/config-manager.h" -#include "common/endian.h" -#include "common/file.h" #include "common/fs.h" -#include "common/func.h" -#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index d14001aea6..81b3ec15ae 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -23,15 +23,15 @@ * */ -#include "common/endian.h" +#include "kyra/kyra_v1.h" +#include "kyra/util.h" + #include "common/savefile.h" #include "common/system.h" + #include "graphics/thumbnail.h" #include "graphics/surface.h" -#include "kyra/kyra_v1.h" -#include "kyra/util.h" - #define CURRENT_SAVE_VERSION 16 #define GF_FLOPPY (1 << 0) diff --git a/engines/kyra/saveload_hof.cpp b/engines/kyra/saveload_hof.cpp index 7a487dcf7b..1fd6c0f3c8 100644 --- a/engines/kyra/saveload_hof.cpp +++ b/engines/kyra/saveload_hof.cpp @@ -23,17 +23,15 @@ * */ -#include "common/endian.h" -#include "common/savefile.h" -#include "common/substream.h" -#include "common/system.h" - -#include "kyra/kyra_v2.h" +#include "kyra/kyra_hof.h" #include "kyra/screen_v2.h" -#include "kyra/resource.h" #include "kyra/sound.h" #include "kyra/timer.h" +#include "common/savefile.h" +#include "common/substream.h" +#include "common/system.h" + namespace Kyra { Common::Error KyraEngine_HoF::saveGameStateIntern(int slot, const char *saveName, const Graphics::Surface *thumb) { diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index 012ff138b5..5af4f1d8ca 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -23,17 +23,14 @@ * */ -#include "common/endian.h" -#include "common/savefile.h" -#include "common/system.h" - #include "kyra/kyra_lok.h" #include "kyra/animator_lok.h" -#include "kyra/screen.h" #include "kyra/resource.h" #include "kyra/sound.h" #include "kyra/timer.h" +#include "common/savefile.h" + namespace Kyra { Common::Error KyraEngine_LoK::loadGameState(int slot) { diff --git a/engines/kyra/saveload_lol.cpp b/engines/kyra/saveload_lol.cpp index b6c0693a16..c5240e2624 100644 --- a/engines/kyra/saveload_lol.cpp +++ b/engines/kyra/saveload_lol.cpp @@ -27,12 +27,9 @@ #include "kyra/lol.h" #include "kyra/screen_lol.h" -#include "kyra/resource.h" -#include "common/endian.h" #include "common/savefile.h" #include "common/substream.h" -#include "common/system.h" #include "graphics/scaler.h" diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index 79827361a3..b44c88a0b4 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -24,12 +24,10 @@ */ #include "kyra/kyra_hof.h" -#include "kyra/screen_v2.h" #include "kyra/sound.h" -#include "kyra/wsamovie.h" #include "kyra/resource.h" -#include "common/func.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/scene_lok.cpp b/engines/kyra/scene_lok.cpp index 3abfe03fff..6200e2ab1e 100644 --- a/engines/kyra/scene_lok.cpp +++ b/engines/kyra/scene_lok.cpp @@ -24,19 +24,13 @@ */ #include "kyra/kyra_lok.h" -#include "kyra/seqplayer.h" -#include "kyra/screen.h" #include "kyra/resource.h" #include "kyra/sound.h" #include "kyra/sprites.h" -#include "kyra/wsamovie.h" #include "kyra/animator_lok.h" -#include "kyra/text.h" -#include "kyra/script.h" #include "kyra/timer.h" #include "common/system.h" -#include "common/savefile.h" namespace Kyra { diff --git a/engines/kyra/scene_lol.cpp b/engines/kyra/scene_lol.cpp index e070b91a44..ab9f89456b 100644 --- a/engines/kyra/scene_lol.cpp +++ b/engines/kyra/scene_lol.cpp @@ -29,9 +29,9 @@ #include "kyra/screen_lol.h" #include "kyra/resource.h" #include "kyra/timer.h" -#include "kyra/sound.h" #include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index acb0710616..4eac4889b6 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -25,10 +25,11 @@ #include "kyra/kyra_mr.h" #include "kyra/screen_mr.h" -#include "kyra/wsamovie.h" #include "kyra/sound.h" #include "kyra/resource.h" +#include "common/system.h" + namespace Kyra { void KyraEngine_MR::enterNewScene(uint16 sceneId, int facing, int unk1, int unk2, int unk3) { diff --git a/engines/kyra/scene_v1.cpp b/engines/kyra/scene_v1.cpp index 848735b4a5..bc88377892 100644 --- a/engines/kyra/scene_v1.cpp +++ b/engines/kyra/scene_v1.cpp @@ -24,7 +24,6 @@ */ #include "kyra/kyra_v1.h" -#include "kyra/screen.h" namespace Kyra { diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index fdfbceb521..897f2e937f 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -24,7 +24,8 @@ */ #include "kyra/kyra_v2.h" -#include "kyra/screen.h" + +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 58d8e7f3d4..20a1022b26 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -23,6 +23,9 @@ * */ +#include "kyra/screen.h" +#include "kyra/kyra_v1.h" +#include "kyra/resource.h" #include "common/endian.h" #include "common/memstream.h" @@ -31,12 +34,9 @@ #include "engines/util.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "graphics/sjis.h" -#include "kyra/screen.h" -#include "kyra/kyra_v1.h" -#include "kyra/resource.h" - namespace Kyra { Screen::Screen(KyraEngine_v1 *vm, OSystem *system) diff --git a/engines/kyra/screen_hof.cpp b/engines/kyra/screen_hof.cpp index a180c28442..f0af53f024 100644 --- a/engines/kyra/screen_hof.cpp +++ b/engines/kyra/screen_hof.cpp @@ -23,10 +23,8 @@ * */ -#include "common/endian.h" - -#include "kyra/kyra_hof.h" #include "kyra/screen_hof.h" +#include "kyra/kyra_hof.h" namespace Kyra { diff --git a/engines/kyra/screen_lok.cpp b/engines/kyra/screen_lok.cpp index 227349754f..2431cde20b 100644 --- a/engines/kyra/screen_lok.cpp +++ b/engines/kyra/screen_lok.cpp @@ -23,10 +23,12 @@ * */ -#include "kyra/kyra_lok.h" #include "kyra/screen_lok.h" +#include "kyra/kyra_lok.h" + +#include "common/system.h" -#include "graphics/cursorman.h" +#include "graphics/palette.h" namespace Kyra { diff --git a/engines/kyra/screen_lol.cpp b/engines/kyra/screen_lol.cpp index ff35facbb5..20756e1fae 100644 --- a/engines/kyra/screen_lol.cpp +++ b/engines/kyra/screen_lol.cpp @@ -27,7 +27,10 @@ #include "kyra/screen_lol.h" #include "kyra/lol.h" -#include "kyra/resource.h" + +#include "common/system.h" + +#include "graphics/palette.h" namespace Kyra { diff --git a/engines/kyra/screen_mr.cpp b/engines/kyra/screen_mr.cpp index 33bfc517f7..4ae52b924d 100644 --- a/engines/kyra/screen_mr.cpp +++ b/engines/kyra/screen_mr.cpp @@ -24,7 +24,6 @@ */ #include "kyra/screen_mr.h" - #include "kyra/kyra_mr.h" namespace Kyra { diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index 956bf39b5a..21dfe0bd31 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -23,15 +23,11 @@ * */ - -#include "common/endian.h" -#include "common/stream.h" -#include "common/util.h" -#include "common/system.h" - +#include "kyra/script.h" #include "kyra/kyra_v1.h" #include "kyra/resource.h" -#include "kyra/script.h" + +#include "common/endian.h" namespace Kyra { EMCInterpreter::EMCInterpreter(KyraEngine_v1 *vm) : _vm(vm), _scriptData(0), _filename(0) { diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index d57bb7efc5..056319e6d4 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -24,14 +24,11 @@ */ #include "kyra/kyra_hof.h" -#include "kyra/text_hof.h" -#include "kyra/wsamovie.h" -#include "kyra/sound.h" #include "kyra/timer.h" -#include "kyra/script_tim.h" #include "kyra/resource.h" +#include "kyra/sound.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index a2bad8035e..30f1138360 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -23,12 +23,7 @@ * */ -#include "common/endian.h" -#include "common/system.h" - #include "kyra/kyra_lok.h" -#include "kyra/script.h" -#include "kyra/screen.h" #include "kyra/sprites.h" #include "kyra/wsamovie.h" #include "kyra/animator_lok.h" @@ -36,6 +31,8 @@ #include "kyra/timer.h" #include "kyra/sound.h" +#include "common/system.h" + namespace Kyra { int KyraEngine_LoK::o1_magicInMouseItem(EMCState *script) { diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index c9fb8df1fb..3185032218 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -29,8 +29,9 @@ #include "kyra/screen_lol.h" #include "kyra/timer.h" #include "kyra/resource.h" +#include "kyra/sound.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index 18878b6543..b3943e1aef 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -24,14 +24,10 @@ */ #include "kyra/kyra_mr.h" -#include "kyra/script.h" -#include "kyra/screen_mr.h" #include "kyra/text_mr.h" -#include "kyra/wsamovie.h" -#include "kyra/timer.h" #include "kyra/resource.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/script_tim.cpp b/engines/kyra/script_tim.cpp index 1e978caf15..004ceb97bb 100644 --- a/engines/kyra/script_tim.cpp +++ b/engines/kyra/script_tim.cpp @@ -24,10 +24,8 @@ */ #include "kyra/script_tim.h" -#include "kyra/script.h" #include "kyra/resource.h" #include "kyra/sound.h" -#include "kyra/wsamovie.h" #ifdef ENABLE_LOL #include "kyra/lol.h" @@ -35,7 +33,7 @@ #endif // ENABLE_LOL #include "common/iff_container.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/script_tim.h b/engines/kyra/script_tim.h index 91f2e8589e..7cf7d0a7dd 100644 --- a/engines/kyra/script_tim.h +++ b/engines/kyra/script_tim.h @@ -36,6 +36,7 @@ namespace Kyra { class WSAMovie_v2; class Screen_v2; +class Movie; class LoLEngine; class TimAnimator { diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp index 12f26ec5f6..13fdcb7d97 100644 --- a/engines/kyra/script_v1.cpp +++ b/engines/kyra/script_v1.cpp @@ -26,6 +26,8 @@ #include "kyra/kyra_v1.h" #include "kyra/screen.h" +#include "common/system.h" + namespace Kyra { int KyraEngine_v1::o1_queryGameFlag(EMCState *script) { diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 17e882398e..081f9dd517 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -27,7 +27,7 @@ #include "kyra/screen_v2.h" #include "kyra/timer.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index 5160224591..16e89de146 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -23,18 +23,11 @@ * */ - -#include "common/system.h" - -#include "engines/engine.h" - +#include "kyra/seqplayer.h" #include "kyra/resource.h" -#include "kyra/screen.h" #include "kyra/sound.h" -#include "kyra/wsamovie.h" -#include "kyra/text.h" -#include "kyra/seqplayer.h" +#include "common/system.h" #define SEQOP(n, x) { n, &SeqPlayer::x, #x } diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index c55153b802..b268f13fc1 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -23,14 +23,10 @@ * */ -#include "kyra/kyra_v1.h" #include "kyra/kyra_hof.h" -#include "kyra/screen.h" -#include "kyra/wsamovie.h" -#include "kyra/sound.h" -#include "kyra/text_hof.h" #include "kyra/timer.h" #include "kyra/resource.h" +#include "kyra/sound.h" #include "common/system.h" diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 23af24064d..0b39201f85 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -25,14 +25,12 @@ #include "kyra/kyra_lok.h" #include "kyra/seqplayer.h" -#include "kyra/screen_lok.h" #include "kyra/resource.h" -#include "kyra/sound.h" #include "kyra/sprites.h" #include "kyra/wsamovie.h" #include "kyra/animator_lok.h" -#include "kyra/text.h" #include "kyra/timer.h" +#include "kyra/sound.h" #include "common/system.h" #include "common/savefile.h" diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index e8ea7a9dcb..da1245d7e6 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -28,9 +28,12 @@ #include "kyra/lol.h" #include "kyra/screen_lol.h" #include "kyra/resource.h" +#include "kyra/sound.h" #include "base/version.h" +#include "common/system.h" + namespace Kyra { #pragma mark - Intro diff --git a/engines/kyra/sequences_v2.cpp b/engines/kyra/sequences_v2.cpp index 3824676213..4d9cdf0d5d 100644 --- a/engines/kyra/sequences_v2.cpp +++ b/engines/kyra/sequences_v2.cpp @@ -26,6 +26,8 @@ #include "kyra/kyra_v2.h" #include "kyra/resource.h" +#include "common/system.h" + namespace Kyra { void KyraEngine_v2::runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) { diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 9dd046e50b..1392824235 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -24,19 +24,16 @@ */ -#include "common/system.h" -#include "common/config-manager.h" - -#include "kyra/resource.h" #include "kyra/sound.h" +#include "kyra/resource.h" #include "audio/mixer.h" -#include "audio/decoders/voc.h" #include "audio/audiostream.h" #include "audio/decoders/flac.h" #include "audio/decoders/mp3.h" #include "audio/decoders/raw.h" +#include "audio/decoders/voc.h" #include "audio/decoders/vorbis.h" namespace Kyra { diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index e2654afe12..16f6ca3eaa 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -40,10 +40,11 @@ */ +#include "kyra/sound_intern.h" +#include "kyra/resource.h" + #include "common/system.h" #include "common/mutex.h" -#include "kyra/resource.h" -#include "kyra/sound_intern.h" #include "audio/mixer.h" #include "audio/fmopl.h" diff --git a/engines/kyra/sound_amiga.cpp b/engines/kyra/sound_amiga.cpp index c5e9f6171d..fed21eba84 100644 --- a/engines/kyra/sound_amiga.cpp +++ b/engines/kyra/sound_amiga.cpp @@ -23,14 +23,11 @@ * */ -#include "common/system.h" -#include "common/mutex.h" -#include "kyra/resource.h" #include "kyra/sound_intern.h" +#include "kyra/resource.h" #include "audio/mixer.h" #include "audio/mods/maxtrax.h" -#include "audio/audiostream.h" namespace Kyra { diff --git a/engines/kyra/sound_lok.cpp b/engines/kyra/sound_lok.cpp index 40daa0b5bd..83566372bf 100644 --- a/engines/kyra/sound_lok.cpp +++ b/engines/kyra/sound_lok.cpp @@ -23,8 +23,10 @@ * */ -#include "kyra/sound.h" #include "kyra/kyra_lok.h" +#include "kyra/sound.h" + +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/sound_lol.cpp b/engines/kyra/sound_lol.cpp index 87679f5bfb..10d35e03d5 100644 --- a/engines/kyra/sound_lol.cpp +++ b/engines/kyra/sound_lol.cpp @@ -25,10 +25,12 @@ #ifdef ENABLE_LOL -#include "kyra/sound.h" #include "kyra/lol.h" +#include "kyra/sound.h" #include "kyra/resource.h" +#include "common/system.h" + #include "audio/audiostream.h" namespace Kyra { diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp index 084bae5aab..6b30824a2f 100644 --- a/engines/kyra/sound_towns.cpp +++ b/engines/kyra/sound_towns.cpp @@ -23,20 +23,17 @@ * */ +#include "kyra/sound_intern.h" +#include "kyra/resource.h" + #include "common/config-manager.h" #include "common/system.h" -#include "kyra/resource.h" -#include "kyra/sound_intern.h" -#include "kyra/screen.h" - #include "backends/audiocd/audiocd.h" #include "audio/audiostream.h" #include "audio/decoders/raw.h" -#include "common/util.h" - namespace Kyra { SoundTowns::SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer) diff --git a/engines/kyra/sprites.cpp b/engines/kyra/sprites.cpp index 52689869c6..23775d2946 100644 --- a/engines/kyra/sprites.cpp +++ b/engines/kyra/sprites.cpp @@ -23,19 +23,13 @@ * */ - -#include "common/endian.h" -#include "common/stream.h" -#include "common/util.h" -#include "common/system.h" -#include "common/EventRecorder.h" - -#include "kyra/screen.h" -#include "kyra/kyra_lok.h" #include "kyra/sprites.h" #include "kyra/resource.h" #include "kyra/animator_lok.h" +#include "common/system.h" +#include "common/EventRecorder.h" + namespace Kyra { Sprites::Sprites(KyraEngine_LoK *vm, OSystem *system) { diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index fe4bd2ad71..f83546e0dd 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -23,23 +23,22 @@ * */ -#include "common/endian.h" -#include "common/md5.h" -#include "kyra/kyra_v1.h" +#include "kyra/resource.h" #include "kyra/kyra_lok.h" -#include "kyra/kyra_v2.h" #include "kyra/kyra_hof.h" #include "kyra/kyra_mr.h" #include "kyra/screen.h" #include "kyra/screen_lok.h" #include "kyra/screen_hof.h" #include "kyra/screen_mr.h" -#include "kyra/resource.h" #include "kyra/gui_lok.h" #include "kyra/gui_hof.h" #include "kyra/gui_mr.h" #include "kyra/sound_intern.h" +#include "common/endian.h" +#include "common/md5.h" + namespace Kyra { #define RESFILE_VERSION 73 diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index 09f952f67e..e0114cda29 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -23,12 +23,8 @@ * */ -#include "kyra/kyra_v1.h" -#include "kyra/screen.h" #include "kyra/text.h" - -#include "common/system.h" -#include "common/endian.h" +#include "kyra/kyra_v1.h" namespace Kyra { diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index 4c292b70db..c961d2bf49 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -24,11 +24,9 @@ */ #include "kyra/text_hof.h" -#include "kyra/kyra_hof.h" -#include "kyra/script_tim.h" #include "kyra/resource.h" -#include "common/endian.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index 40f2217a2b..cca8e5aaf5 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -23,13 +23,14 @@ * */ -#include "kyra/kyra_lok.h" -#include "kyra/screen_lok.h" #include "kyra/text.h" +#include "kyra/kyra_lok.h" #include "kyra/animator_lok.h" #include "kyra/sprites.h" #include "kyra/timer.h" +#include "common/system.h" + namespace Kyra { void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const char *chatStr, uint8 charNum, const bool printText) { diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp index 9f98586303..c9a77be1b2 100644 --- a/engines/kyra/text_lol.cpp +++ b/engines/kyra/text_lol.cpp @@ -25,10 +25,13 @@ #ifdef ENABLE_LOL +#include "kyra/text_lol.h" #include "kyra/lol.h" #include "kyra/screen_lol.h" #include "kyra/timer.h" -#include "kyra/util.h" +#include "kyra/sound.h" + +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/text_lol.h b/engines/kyra/text_lol.h index 1e5bc8884e..edac131106 100644 --- a/engines/kyra/text_lol.h +++ b/engines/kyra/text_lol.h @@ -28,9 +28,11 @@ #ifndef KYRA_TEXT_LOL_H #define KYRA_TEXT_LOL_H +#include "common/scummsys.h" + namespace Kyra { -class Screen_v2; +class Screen_LoL; class LoLEngine; struct EMCState; diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index 001faab016..5679dc1ee6 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -24,9 +24,10 @@ */ #include "kyra/text_mr.h" -#include "kyra/screen_mr.h" #include "kyra/resource.h" +#include "common/system.h" + namespace Kyra { TextDisplayer_MR::TextDisplayer_MR(KyraEngine_MR *vm, Screen_MR *screen) diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index 66b78d3c03..475f17cadc 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -23,11 +23,9 @@ * */ -#include "kyra/kyra_v1.h" #include "kyra/timer.h" -#include "common/func.h" -#include "common/stream.h" +#include "common/system.h" namespace Kyra { diff --git a/engines/kyra/timer_lok.cpp b/engines/kyra/timer_lok.cpp index 85b98be724..3a312c22c6 100644 --- a/engines/kyra/timer_lok.cpp +++ b/engines/kyra/timer_lok.cpp @@ -23,14 +23,10 @@ * */ -#include "kyra/kyra_v1.h" #include "kyra/kyra_lok.h" -#include "kyra/screen.h" #include "kyra/animator_lok.h" #include "kyra/timer.h" -#include "common/system.h" - namespace Kyra { #define TimerV1(x) new Common::Functor1Mem<int, void, KyraEngine_LoK>(this, &KyraEngine_LoK::x) diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp index 90cfc1af78..a3dab365c7 100644 --- a/engines/kyra/timer_lol.cpp +++ b/engines/kyra/timer_lol.cpp @@ -26,9 +26,10 @@ #ifdef ENABLE_LOL #include "kyra/lol.h" -#include "kyra/screen_lol.h" #include "kyra/timer.h" +#include "common/system.h" + namespace Kyra { #define TimerV2(x) new Common::Functor1Mem<int, void, LoLEngine>(this, &LoLEngine::x) diff --git a/engines/kyra/timer_mr.cpp b/engines/kyra/timer_mr.cpp index 0d89decf5a..97ce7c166d 100644 --- a/engines/kyra/timer_mr.cpp +++ b/engines/kyra/timer_mr.cpp @@ -26,6 +26,8 @@ #include "kyra/kyra_mr.h" #include "kyra/timer.h" +#include "common/system.h" + namespace Kyra { #define TimerV3(x) new Common::Functor1Mem<int, void, KyraEngine_MR>(this, &KyraEngine_MR::x) diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index b3371793de..28071bc171 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -33,16 +33,14 @@ #include "kyra/vqa.h" +#include "kyra/resource.h" #include "common/system.h" + #include "audio/audiostream.h" #include "audio/mixer.h" #include "audio/decoders/raw.h" -#include "kyra/sound.h" -#include "kyra/screen.h" -#include "kyra/resource.h" - namespace Kyra { VQAMovie::VQAMovie(KyraEngine_v1 *vm, OSystem *system) { diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp index c9536484a3..db324d48d4 100644 --- a/engines/kyra/wsamovie.cpp +++ b/engines/kyra/wsamovie.cpp @@ -23,18 +23,13 @@ * */ - -#include "common/endian.h" -#include "common/system.h" - -#include "kyra/kyra_v1.h" -#include "kyra/kyra_v2.h" -#include "kyra/screen.h" -#include "kyra/screen_v2.h" #include "kyra/wsamovie.h" #include "kyra/resource.h" +#include "common/endian.h" + namespace Kyra { + WSAMovie_v1::WSAMovie_v1(KyraEngine_v1 *vm) : Movie(vm), _frameData(0), _frameOffsTable(0), _offscreenBuffer(0), _deltaBuffer(0) { } diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h index d2c041742a..f755cdd557 100644 --- a/engines/kyra/wsamovie.h +++ b/engines/kyra/wsamovie.h @@ -26,10 +26,10 @@ #ifndef KYRA_WSAMOVIE_H #define KYRA_WSAMOVIE_H +#include "kyra/kyra_v1.h" + namespace Kyra { -class KyraEngine_v1; -class Screen_v2; class Palette; class Movie { diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 7288889f09..2bf9bd4999 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -35,7 +35,10 @@ #include "common/events.h" #include "common/rational.h" +#include "common/rect.h" #include "common/stream.h" +#include "common/system.h" +#include "common/textconsole.h" #include "engines/engine.h" @@ -266,7 +269,7 @@ void Animation::play() { if (_changed) { // Create a temporary surface to merge the overlay with the background Graphics::Surface *s = new Graphics::Surface; - s->create(640, 480, 2); + s->create(640, 480, Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)); draw(s); diff --git a/engines/lastexpress/data/archive.h b/engines/lastexpress/data/archive.h index 3860245bc5..17b1d661fa 100644 --- a/engines/lastexpress/data/archive.h +++ b/engines/lastexpress/data/archive.h @@ -39,6 +39,9 @@ */ #include "common/archive.h" +#include "common/hash-str.h" +#include "common/hashmap.h" +#include "common/str.h" namespace LastExpress { diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp index 8b0d338f64..e8236bca86 100644 --- a/engines/lastexpress/data/background.cpp +++ b/engines/lastexpress/data/background.cpp @@ -31,6 +31,7 @@ #include "lastexpress/debug.h" +#include "common/rect.h" #include "common/stream.h" namespace LastExpress { diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp index 99239606ab..d9acbb8382 100644 --- a/engines/lastexpress/data/font.cpp +++ b/engines/lastexpress/data/font.cpp @@ -25,8 +25,10 @@ #include "lastexpress/data/font.h" +#include "common/rect.h" #include "common/stream.h" #include "common/system.h" +#include "common/textconsole.h" namespace LastExpress { diff --git a/engines/lastexpress/data/font.h b/engines/lastexpress/data/font.h index d49db35ba5..7bcf03ed7d 100644 --- a/engines/lastexpress/data/font.h +++ b/engines/lastexpress/data/font.h @@ -39,10 +39,12 @@ byte {x} - Unknown data (probably just garbage) */ +#include "common/str.h" #include "graphics/surface.h" namespace Common { class SeekableReadStream; +struct Rect; } namespace LastExpress { diff --git a/engines/lastexpress/data/scene.cpp b/engines/lastexpress/data/scene.cpp index 5a943982c4..e893d641a5 100644 --- a/engines/lastexpress/data/scene.cpp +++ b/engines/lastexpress/data/scene.cpp @@ -31,6 +31,7 @@ #include "lastexpress/lastexpress.h" #include "lastexpress/resource.h" +#include "common/textconsole.h" #include "common/stream.h" namespace LastExpress { diff --git a/engines/lastexpress/data/scene.h b/engines/lastexpress/data/scene.h index 7fc9425f28..9ec1899402 100644 --- a/engines/lastexpress/data/scene.h +++ b/engines/lastexpress/data/scene.h @@ -72,9 +72,15 @@ #include "lastexpress/shared.h" #include "common/array.h" +#include "common/rect.h" namespace Common { class SeekableReadStream; +class String; +} + +namespace Graphics { +struct Surface; } namespace LastExpress { diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index 2308d70a2b..b986a33d5c 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -30,6 +30,7 @@ #include "lastexpress/debug.h" #include "common/stream.h" +#include "common/textconsole.h" namespace LastExpress { @@ -82,7 +83,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) { AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f) : _palette(NULL) { _palSize = 1; // TODO: use just the needed rectangle - _image.create(640, 480, 1); + _image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); //debugC(6, kLastExpressDebugGraphics, " Offsets: data=%d, unknown=%d, palette=%d", f.dataOffset, f.unknown, f.paletteOffset); //debugC(6, kLastExpressDebugGraphics, " Position: (%d, %d) - (%d, %d)", f.xPos1, f.yPos1, f.xPos2, f.yPos2); diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h index 7ad0a57254..cd16f26ab2 100644 --- a/engines/lastexpress/data/sequence.h +++ b/engines/lastexpress/data/sequence.h @@ -77,6 +77,8 @@ #include "lastexpress/shared.h" #include "common/array.h" +#include "common/rect.h" +#include "common/str.h" namespace Common { class SeekableReadStream; diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp index 6389489abb..a50fa7be08 100644 --- a/engines/lastexpress/data/snd.cpp +++ b/engines/lastexpress/data/snd.cpp @@ -32,7 +32,10 @@ #include "audio/decoders/adpcm_intern.h" #include "audio/audiostream.h" +#include "common/debug.h" #include "common/memstream.h" +#include "common/system.h" +#include "common/textconsole.h" namespace LastExpress { diff --git a/engines/lastexpress/data/snd.h b/engines/lastexpress/data/snd.h index 2d28404f42..61d1c0951a 100644 --- a/engines/lastexpress/data/snd.h +++ b/engines/lastexpress/data/snd.h @@ -42,8 +42,8 @@ #include "audio/mixer.h" namespace Audio { - class AudioStream; - class QueuingAudioStream; +class AudioStream; +class QueuingAudioStream; } namespace Common { diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp index 953edd1d1a..2bc5d3c5ad 100644 --- a/engines/lastexpress/data/subtitle.cpp +++ b/engines/lastexpress/data/subtitle.cpp @@ -33,7 +33,9 @@ #include "lastexpress/debug.h" #include "common/debug.h" +#include "common/rect.h" #include "common/stream.h" +#include "common/textconsole.h" namespace LastExpress { diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index ccef312cd6..8c6cc2bafc 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -35,6 +35,7 @@ #include "common/array.h" #include "common/func.h" #include "common/serializer.h" +#include "common/textconsole.h" namespace LastExpress { diff --git a/engines/lastexpress/game/state.h b/engines/lastexpress/game/state.h index d97ebc1b55..4196bfe06a 100644 --- a/engines/lastexpress/game/state.h +++ b/engines/lastexpress/game/state.h @@ -28,8 +28,10 @@ #include "lastexpress/shared.h" +#include "common/rect.h" #include "common/serializer.h" #include "common/system.h" +#include "common/textconsole.h" namespace LastExpress { diff --git a/engines/lastexpress/graphics.cpp b/engines/lastexpress/graphics.cpp index e5a69d16ea..c45baba808 100644 --- a/engines/lastexpress/graphics.cpp +++ b/engines/lastexpress/graphics.cpp @@ -25,20 +25,23 @@ #include "lastexpress/graphics.h" +#include "common/rect.h" #include "common/system.h" +#include "common/textconsole.h" namespace LastExpress { #define COLOR_KEY 0xFFFF GraphicsManager::GraphicsManager() : _changed(false) { - _screen.create(640, 480, 2); + const Graphics::PixelFormat format(2, 5, 5, 5, 0, 10, 5, 0, 0); + _screen.create(640, 480, format); // Create the game surfaces - _backgroundA.create(640, 480, 2); - _backgroundC.create(640, 480, 2); - _overlay.create(640, 480, 2); - _inventory.create(640, 480, 2); + _backgroundA.create(640, 480, format); + _backgroundC.create(640, 480, format); + _overlay.create(640, 480, format); + _inventory.create(640, 480, format); clear(kBackgroundAll); } diff --git a/engines/lastexpress/resource.cpp b/engines/lastexpress/resource.cpp index 5a77b23602..dff686a503 100644 --- a/engines/lastexpress/resource.cpp +++ b/engines/lastexpress/resource.cpp @@ -34,6 +34,7 @@ #include "common/debug.h" #include "common/file.h" +#include "common/textconsole.h" namespace LastExpress { diff --git a/engines/lure/disk.h b/engines/lure/disk.h index d2848cc587..79aaf80bbc 100644 --- a/engines/lure/disk.h +++ b/engines/lure/disk.h @@ -33,7 +33,7 @@ #include "lure/res_struct.h" namespace Common { - class File; +class File; } namespace Lure { diff --git a/engines/lure/memory.cpp b/engines/lure/memory.cpp index f96b5015bc..d3d5067cce 100644 --- a/engines/lure/memory.cpp +++ b/engines/lure/memory.cpp @@ -25,6 +25,7 @@ #include "lure/memory.h" #include "common/file.h" +#include "common/textconsole.h" namespace Lure { diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h index 6e2c11cb24..58ee3f4c02 100644 --- a/engines/lure/res_struct.h +++ b/engines/lure/res_struct.h @@ -27,9 +27,11 @@ #define LURE_RESSTRUCT_H #include "lure/luredefs.h" +#include "common/rect.h" #include "common/list.h" #include "common/file.h" #include "common/ptr.h" +#include "common/textconsole.h" namespace Lure { diff --git a/engines/lure/screen.cpp b/engines/lure/screen.cpp index b64ef6393b..e02f492ef2 100644 --- a/engines/lure/screen.cpp +++ b/engines/lure/screen.cpp @@ -30,6 +30,8 @@ #include "lure/decode.h" #include "lure/events.h" +#include "graphics/palette.h" + namespace Lure { static Screen *int_disk = NULL; diff --git a/engines/lure/sound.h b/engines/lure/sound.h index dd5538085c..7a894d814d 100644 --- a/engines/lure/sound.h +++ b/engines/lure/sound.h @@ -30,6 +30,7 @@ #include "lure/disk.h" #include "lure/memory.h" +#include "common/mutex.h" #include "common/singleton.h" #include "common/ptr.h" #include "audio/mididrv.h" diff --git a/engines/m4/actor.cpp b/engines/m4/actor.cpp index ce8574a134..c61c6fe7d8 100644 --- a/engines/m4/actor.cpp +++ b/engines/m4/actor.cpp @@ -25,6 +25,7 @@ #include "common/system.h" #include "common/array.h" +#include "common/textconsole.h" #include "m4/actor.h" #include "m4/m4_views.h" #include "m4/assets.h" diff --git a/engines/m4/animation.cpp b/engines/m4/animation.cpp index 26de121611..3fe050e604 100644 --- a/engines/m4/animation.cpp +++ b/engines/m4/animation.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/assets.h" #include "m4/animation.h" #include "m4/compression.h" diff --git a/engines/m4/compression.cpp b/engines/m4/compression.cpp index 9b1416945c..8fe4fbf1eb 100644 --- a/engines/m4/compression.cpp +++ b/engines/m4/compression.cpp @@ -27,6 +27,7 @@ #include "m4/m4.h" #include "common/memstream.h" +#include "common/textconsole.h" namespace M4 { diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp index 88b4240901..cbcaa04669 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/m4.h" #include "m4/console.h" #include "m4/dialogs.h" diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp index f67291f0a6..46c4b35b79 100644 --- a/engines/m4/converse.cpp +++ b/engines/m4/converse.cpp @@ -26,6 +26,7 @@ #include "common/array.h" #include "common/hashmap.h" #include "common/substream.h" +#include "common/textconsole.h" #include "m4/converse.h" #include "m4/resource.h" diff --git a/engines/m4/dialogs.cpp b/engines/m4/dialogs.cpp index 7efbc523f8..bc6228658d 100644 --- a/engines/m4/dialogs.cpp +++ b/engines/m4/dialogs.cpp @@ -25,6 +25,7 @@ #include "m4/dialogs.h" #include "common/file.h" +#include "common/textconsole.h" namespace M4 { @@ -444,7 +445,7 @@ void Dialog::draw() { int dialogY = (_vm->_screen->height() - dlgHeight) / 2; // Create the surface for the dialog - create(dlgWidth, dlgHeight, 1); + create(dlgWidth, dlgHeight, Graphics::PixelFormat::createFormatCLUT8()); _coords.left = dialogX; _coords.top = dialogY; _coords.right = dialogX + dlgWidth + 1; diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp index d982ecad0e..3db9934cec 100644 --- a/engines/m4/globals.cpp +++ b/engines/m4/globals.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/m4.h" #include "m4/globals.h" #include "m4/graphics.h" diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index a3eca13e1e..689a6ab8b4 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -23,11 +23,12 @@ * */ -#include "common/file.h" -#include "common/endian.h" #include "common/system.h" #include "common/util.h" #include "common/ptr.h" +#include "common/textconsole.h" + +#include "graphics/palette.h" #include "m4/globals.h" #include "m4/graphics.h" @@ -96,7 +97,7 @@ void M4Surface::loadCodesM4(Common::SeekableReadStream *source) { uint16 widthVal = source->readUint16LE(); uint16 heightVal = source->readUint16LE(); - create(widthVal, heightVal, 1); + create(widthVal, heightVal, Graphics::PixelFormat::createFormatCLUT8()); source->read(pixels, widthVal * heightVal); } @@ -110,7 +111,7 @@ void M4Surface::loadCodesMads(Common::SeekableReadStream *source) { uint16 heightVal = 156; byte *walkMap = new byte[source->size()]; - create(widthVal, heightVal, 1); + create(widthVal, heightVal, Graphics::PixelFormat::createFormatCLUT8()); source->read(walkMap, source->size()); byte *ptr = (byte *)getBasePtr(0, 0); @@ -760,7 +761,7 @@ void M4Surface::rexLoadBackground(Common::SeekableReadStream *source, RGBList ** sourceUnc = packData.getItemStream(1); assert((int)sourceUnc->size() >= sceneSize); - create(sceneWidth, sceneHeight, 1); + create(sceneWidth, sceneHeight, Graphics::PixelFormat::createFormatCLUT8()); byte *pData = (byte *)pixels; sourceUnc->read(pData, sceneSize); @@ -813,7 +814,7 @@ void M4Surface::m4LoadBackground(Common::SeekableReadStream *source) { assert(width() == (int)widthVal); //debugCN(kDebugGraphics, "width(): %d, widthVal: %d, height(): %d, heightVal: %d\n", width(), widthVal, height(), heightVal); - tileBuffer->create(tileWidth, tileHeight, 1); + tileBuffer->create(tileWidth, tileHeight, Graphics::PixelFormat::createFormatCLUT8()); for (curTileY = 0; curTileY < tilesY; curTileY++) { clipY = MIN(heightVal, (1 + curTileY) * tileHeight) - (curTileY * tileHeight); @@ -854,7 +855,7 @@ void M4Surface::madsLoadInterface(const Common::String &filename) { // Chunk 1, data intStream = intFile.getItemStream(1); - create(320, 44, 1); + create(320, 44, Graphics::PixelFormat::createFormatCLUT8()); intStream->read(pixels, 320 * 44); delete intStream; diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h index dbf6fac8c8..96e81f746e 100644 --- a/engines/m4/graphics.h +++ b/engines/m4/graphics.h @@ -105,19 +105,19 @@ private: void m4LoadBackground(Common::SeekableReadStream *source); public: M4Surface(bool isScreen = false) { - create(g_system->getWidth(), isScreen ? g_system->getHeight() : MADS_SURFACE_HEIGHT, 1); + create(g_system->getWidth(), isScreen ? g_system->getHeight() : MADS_SURFACE_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); _isScreen = isScreen; _rgbList = NULL; _ownsData = true; } M4Surface(int width_, int height_) { - create(width_, height_, 1); + create(width_, height_, Graphics::PixelFormat::createFormatCLUT8()); _isScreen = false; _rgbList = NULL; _ownsData = true; } M4Surface(int width_, int height_, byte *srcPixels, int pitch_) { - bytesPerPixel = 1; + format = Graphics::PixelFormat::createFormatCLUT8(); w = width_; h = height_; pitch = pitch_; @@ -157,7 +157,7 @@ public: inline int width() const { return w; } inline int height() const { return h; } inline int getPitch() const { return pitch; } - void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, 1); } + void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, Graphics::PixelFormat::createFormatCLUT8()); } inline byte *getBasePtr() { return (byte *)pixels; } diff --git a/engines/m4/gui.cpp b/engines/m4/gui.cpp index 6619b37707..56cf96b589 100644 --- a/engines/m4/gui.cpp +++ b/engines/m4/gui.cpp @@ -25,6 +25,7 @@ #include "common/events.h" #include "common/keyboard.h" +#include "common/textconsole.h" #include "m4/globals.h" #include "m4/events.h" diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index d9a1bf940f..1a484322fd 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -30,7 +30,6 @@ #include "m4/burger_data.h" #include "m4/m4.h" #include "m4/resource.h" -#include "m4/sprite.h" #include "m4/hotspot.h" #include "m4/font.h" #include "m4/rails.h" @@ -50,17 +49,15 @@ #include "m4/mads_anim.h" #include "m4/mads_menus.h" +#include "common/error.h" #include "common/file.h" #include "common/fs.h" -#include "common/events.h" #include "common/EventRecorder.h" -#include "common/endian.h" #include "common/system.h" #include "common/config-manager.h" #include "common/debug-channels.h" +#include "common/textconsole.h" #include "engines/util.h" -#include "graphics/surface.h" -#include "audio/mididrv.h" namespace M4 { diff --git a/engines/m4/m4_menus.cpp b/engines/m4/m4_menus.cpp index 118b09f50b..a20bb2660b 100644 --- a/engines/m4/m4_menus.cpp +++ b/engines/m4/m4_menus.cpp @@ -24,6 +24,7 @@ */ #include "common/algorithm.h" // for find() +#include "common/textconsole.h" #include "gui/dialog.h" #include "gui/message.h" diff --git a/engines/m4/m4_scene.cpp b/engines/m4/m4_scene.cpp index 0ace40bfc5..a0d8a503ab 100644 --- a/engines/m4/m4_scene.cpp +++ b/engines/m4/m4_scene.cpp @@ -24,6 +24,7 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "m4/m4_scene.h" #include "m4/dialogs.h" diff --git a/engines/m4/m4_views.cpp b/engines/m4/m4_views.cpp index f4345787df..83f23edd3d 100644 --- a/engines/m4/m4_views.cpp +++ b/engines/m4/m4_views.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/m4_views.h" #include "m4/events.h" #include "m4/font.h" diff --git a/engines/m4/mads_anim.cpp b/engines/m4/mads_anim.cpp index 571a6fa899..e7ca9cb14d 100644 --- a/engines/m4/mads_anim.cpp +++ b/engines/m4/mads_anim.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/mads_anim.h" #include "m4/m4.h" #include "m4/compression.h" diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index 878e86c573..98a0d06412 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/m4.h" #include "m4/dialogs.h" #include "m4/mads_logic.h" diff --git a/engines/m4/mads_menus.cpp b/engines/m4/mads_menus.cpp index 4ca8154793..437e9d2a6b 100644 --- a/engines/m4/mads_menus.cpp +++ b/engines/m4/mads_menus.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "m4/mads_menus.h" #include "m4/m4.h" diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp index fd972cc6ea..7b82480ee2 100644 --- a/engines/m4/mads_scene.cpp +++ b/engines/m4/mads_scene.cpp @@ -24,6 +24,7 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "m4/mads_scene.h" #include "m4/dialogs.h" diff --git a/engines/m4/mads_views.cpp b/engines/m4/mads_views.cpp index b4385dbead..33c679c9bd 100644 --- a/engines/m4/mads_views.cpp +++ b/engines/m4/mads_views.cpp @@ -34,6 +34,7 @@ #include "m4/staticres.h" #include "common/algorithm.h" +#include "common/textconsole.h" namespace M4 { diff --git a/engines/m4/midi.cpp b/engines/m4/midi.cpp index e49dbfa2e7..24ac60c22e 100644 --- a/engines/m4/midi.cpp +++ b/engines/m4/midi.cpp @@ -31,6 +31,7 @@ #include "audio/midiparser.h" #include "common/config-manager.h" #include "common/memstream.h" +#include "common/textconsole.h" namespace M4 { diff --git a/engines/m4/resource.cpp b/engines/m4/resource.cpp index 192cab0c83..1946797f75 100644 --- a/engines/m4/resource.cpp +++ b/engines/m4/resource.cpp @@ -28,6 +28,7 @@ #include "m4/events.h" #include "common/substream.h" +#include "common/textconsole.h" namespace M4 { diff --git a/engines/m4/script.cpp b/engines/m4/script.cpp index 42d55c6dc7..cc60ec310d 100644 --- a/engines/m4/script.cpp +++ b/engines/m4/script.cpp @@ -24,6 +24,7 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "m4/m4.h" #include "m4/script.h" diff --git a/engines/m4/sound.cpp b/engines/m4/sound.cpp index 14c60c1c58..fb90cea5cc 100644 --- a/engines/m4/sound.cpp +++ b/engines/m4/sound.cpp @@ -28,6 +28,7 @@ #include "m4/compression.h" #include "common/stream.h" +#include "common/textconsole.h" #include "audio/audiostream.h" #include "audio/mixer.h" diff --git a/engines/m4/sprite.cpp b/engines/m4/sprite.cpp index 77528ec8a6..cef9917381 100644 --- a/engines/m4/sprite.cpp +++ b/engines/m4/sprite.cpp @@ -24,6 +24,7 @@ */ #include "common/rect.h" +#include "common/textconsole.h" #include "m4/globals.h" #include "m4/graphics.h" diff --git a/engines/m4/woodscript.cpp b/engines/m4/woodscript.cpp index 1b9d9859ef..dc24548f84 100644 --- a/engines/m4/woodscript.cpp +++ b/engines/m4/woodscript.cpp @@ -26,6 +26,7 @@ #include "m4/woodscript.h" #include "common/memstream.h" +#include "graphics/palette.h" namespace M4 { diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 8d06aa0085..4e7a0467b1 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -27,6 +27,7 @@ #include "common/endian.h" #include "common/util.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "made/database.h" diff --git a/engines/made/graphics.cpp b/engines/made/graphics.cpp index 7e8330d3f4..388ff60aa8 100644 --- a/engines/made/graphics.cpp +++ b/engines/made/graphics.cpp @@ -23,7 +23,9 @@ * */ +#include "common/debug.h" #include "common/endian.h" +#include "common/textconsole.h" #include "made/graphics.h" diff --git a/engines/made/made.cpp b/engines/made/made.cpp index c81fa3db25..c791b657e7 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -26,8 +26,6 @@ #include "common/events.h" #include "common/EventRecorder.h" #include "common/keyboard.h" -#include "common/file.h" -#include "common/savefile.h" #include "common/config-manager.h" #include "common/stream.h" diff --git a/engines/made/music.cpp b/engines/made/music.cpp index 2e06871e13..e5bbbc3b42 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -30,8 +30,6 @@ #include "audio/audiostream.h" #include "audio/mididrv.h" #include "audio/midiparser.h" -#include "common/config-manager.h" -#include "common/file.h" #include "made/music.h" diff --git a/engines/made/pmvplayer.cpp b/engines/made/pmvplayer.cpp index e37bd87a7e..5ab24c1984 100644 --- a/engines/made/pmvplayer.cpp +++ b/engines/made/pmvplayer.cpp @@ -169,7 +169,7 @@ bool PmvPlayer::play(const char *filename) { if (!_surface) { _surface = new Graphics::Surface(); - _surface->create(width, height, 1); + _surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); } decompressMovieImage(imageData, *_surface, cmdOffs, pixelOffs, maskOffs, lineSize); diff --git a/engines/made/redreader.cpp b/engines/made/redreader.cpp index 3d36b69a28..2fcd7f43da 100644 --- a/engines/made/redreader.cpp +++ b/engines/made/redreader.cpp @@ -25,6 +25,7 @@ #include "made/redreader.h" #include "common/memstream.h" +#include "common/textconsole.h" namespace Made { diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index e556e4ab38..403520bec3 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -23,6 +23,7 @@ * */ +#include "common/debug.h" #include "common/endian.h" #include "common/memstream.h" #include "audio/mixer.h" @@ -95,7 +96,7 @@ void PictureResource::loadRaw(byte *source, int size) { } _picture = new Graphics::Surface(); - _picture->create(width, height, 1); + _picture->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); decompressImage(source, *_picture, cmdOffs, pixelOffs, maskOffs, lineSize, cmdFlags, pixelFlags, maskFlags); @@ -171,7 +172,7 @@ void PictureResource::loadChunked(byte *source, int size) { } _picture = new Graphics::Surface(); - _picture->create(width, height, 1); + _picture->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); decompressImage(source, *_picture, cmdOffs, pixelOffs, maskOffs, lineSize, cmdFlags, pixelFlags, maskFlags); @@ -227,7 +228,7 @@ void AnimationResource::load(byte *source, int size) { uint16 lineSize = sourceS->readUint16LE(); Graphics::Surface *frame = new Graphics::Surface(); - frame->create(frameWidth, frameHeight, 1); + frame->create(frameWidth, frameHeight, Graphics::PixelFormat::createFormatCLUT8()); decompressImage(source + frameOffs, *frame, cmdOffs, pixelOffs, maskOffs, lineSize, 0, 0, 0, _flags & 1); diff --git a/engines/made/resource.h b/engines/made/resource.h index ade6a23029..f1aeb7a87c 100644 --- a/engines/made/resource.h +++ b/engines/made/resource.h @@ -30,6 +30,7 @@ #include "common/file.h" #include "common/stream.h" #include "common/hashmap.h" +#include "common/textconsole.h" #include "graphics/surface.h" #include "audio/audiostream.h" diff --git a/engines/made/screen.cpp b/engines/made/screen.cpp index 2649e2bd37..4a73ba8e38 100644 --- a/engines/made/screen.cpp +++ b/engines/made/screen.cpp @@ -28,6 +28,8 @@ #include "made/resource.h" #include "made/database.h" +#include "graphics/palette.h" + namespace Made { Screen::Screen(MadeEngine *vm) : _vm(vm) { @@ -36,10 +38,10 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) { _newPalette = new byte[768]; _backgroundScreen = new Graphics::Surface(); - _backgroundScreen->create(320, 200, 1); + _backgroundScreen->create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); _workScreen = new Graphics::Surface(); - _workScreen->create(320, 200, 1); + _workScreen->create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); _backgroundScreenDrawCtx.clipRect = Common::Rect(320, 200); _workScreenDrawCtx.clipRect = Common::Rect(320, 200); @@ -51,7 +53,7 @@ Screen::Screen(MadeEngine *vm) : _vm(vm) { // Screen mask is only needed in v2 games if (_vm->getGameID() != GID_RTZ) { _screenMask = new Graphics::Surface(); - _screenMask->create(320, 200, 1); + _screenMask->create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); _maskDrawCtx.clipRect = Common::Rect(320, 200); _maskDrawCtx.destSurface = _screenMask; } diff --git a/engines/made/script.h b/engines/made/script.h index 16c5ad604f..be719eba5f 100644 --- a/engines/made/script.h +++ b/engines/made/script.h @@ -29,6 +29,7 @@ #include "common/util.h" #include "common/file.h" #include "common/stream.h" +#include "common/textconsole.h" namespace Made { diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index 4f1937c057..c0a723438e 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -23,9 +23,7 @@ * */ -#include "common/endian.h" #include "common/util.h" -#include "common/events.h" #include "backends/audiocd/audiocd.h" #include "graphics/cursorman.h" diff --git a/engines/made/scriptfuncs.h b/engines/made/scriptfuncs.h index 3bed27c5c8..b8b2a87d19 100644 --- a/engines/made/scriptfuncs.h +++ b/engines/made/scriptfuncs.h @@ -34,7 +34,7 @@ #include "made/resource.h" namespace Audio { - class PCSpeaker; +class PCSpeaker; } namespace Made { diff --git a/engines/metaengine.h b/engines/metaengine.h index 2afed0703b..ef34506991 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -37,8 +37,8 @@ class Engine; class OSystem; namespace Common { - class FSList; - class String; +class FSList; +class String; } /** diff --git a/engines/mohawk/bitmap.cpp b/engines/mohawk/bitmap.cpp index a6ec2cf85a..02548d58fc 100644 --- a/engines/mohawk/bitmap.cpp +++ b/engines/mohawk/bitmap.cpp @@ -31,6 +31,7 @@ #include "common/memstream.h" #include "common/substream.h" #include "common/system.h" +#include "common/textconsole.h" namespace Mohawk { @@ -135,8 +136,12 @@ Common::Array<MohawkSurface *> MohawkBitmap::decodeImages(Common::SeekableReadSt Graphics::Surface *MohawkBitmap::createSurface(uint16 width, uint16 height) { Graphics::Surface *surface = new Graphics::Surface(); - byte bytesPerPixel = (getBitsPerPixel() <= 8) ? 1 : g_system->getScreenFormat().bytesPerPixel; - surface->create(width, height, bytesPerPixel); + Graphics::PixelFormat format; + if (getBitsPerPixel() <= 8) + format = Graphics::PixelFormat::createFormatCLUT8(); + else + format = g_system->getScreenFormat(); + surface->create(width, height, format); return surface; } @@ -569,7 +574,7 @@ void MohawkBitmap::drawRaw(Graphics::Surface *surface) { byte b = _data->readByte(); byte g = _data->readByte(); byte r = _data->readByte(); - if (surface->bytesPerPixel == 2) + if (surface->format.bytesPerPixel == 2) *((uint16 *)surface->getBasePtr(x, y)) = pixelFormat.RGBToColor(r, g, b); else *((uint32 *)surface->getBasePtr(x, y)) = pixelFormat.RGBToColor(r, g, b); @@ -856,7 +861,7 @@ MohawkSurface *DOSBitmap::decodeImage(Common::SeekableReadStream *stream) { } void DOSBitmap::expandMonochromePlane(Graphics::Surface *surface, Common::SeekableReadStream *rawStream) { - assert(surface->bytesPerPixel == 1); + assert(surface->format.bytesPerPixel == 1); byte *dst = (byte *)surface->pixels; @@ -882,7 +887,7 @@ void DOSBitmap::expandMonochromePlane(Graphics::Surface *surface, Common::Seekab *(dst + j * 4 + dstPixel) = (*(dst + j * 4 + dstPixel) >> 1) | (((temp >> srcBit) & 1) << 3) void DOSBitmap::expandEGAPlanes(Graphics::Surface *surface, Common::SeekableReadStream *rawStream) { - assert(surface->bytesPerPixel == 1); + assert(surface->format.bytesPerPixel == 1); // Note that the image is in EGA planar form and not just standard 4bpp // This seems to contradict the PoP specs which seem to do diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index ee67c9f23c..93cbe87e55 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -29,6 +29,9 @@ #include "mohawk/sound.h" #include "mohawk/video.h" +#include "common/system.h" +#include "common/textconsole.h" + #ifdef ENABLE_CSTIME #include "mohawk/cstime.h" #endif diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp index 955e0e5af6..46faae08f5 100644 --- a/engines/mohawk/cstime.cpp +++ b/engines/mohawk/cstime.cpp @@ -30,15 +30,14 @@ #include "mohawk/cstime_view.h" #include "mohawk/resource.h" #include "mohawk/cursors.h" -#include "mohawk/sound.h" #include "mohawk/video.h" #include "common/config-manager.h" +#include "common/error.h" #include "common/events.h" #include "common/EventRecorder.h" #include "common/fs.h" - -#include "engines/util.h" +#include "common/textconsole.h" namespace Mohawk { diff --git a/engines/mohawk/cstime_cases.cpp b/engines/mohawk/cstime_cases.cpp index 408f1c9d9a..c4801f822c 100644 --- a/engines/mohawk/cstime_cases.cpp +++ b/engines/mohawk/cstime_cases.cpp @@ -26,6 +26,8 @@ #include "mohawk/cstime_cases.h" #include "mohawk/cstime_ui.h" +#include "common/textconsole.h" + namespace Mohawk { CSTimeCase1::CSTimeCase1(MohawkEngine_CSTime *vm) : CSTimeCase(vm, 1) { diff --git a/engines/mohawk/cstime_game.cpp b/engines/mohawk/cstime_game.cpp index 14e5d99e51..66dce1da92 100644 --- a/engines/mohawk/cstime_game.cpp +++ b/engines/mohawk/cstime_game.cpp @@ -29,6 +29,8 @@ #include "mohawk/resource.h" #include "mohawk/sound.h" #include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" namespace Mohawk { diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp index 935b0321da..106f7ea319 100644 --- a/engines/mohawk/cstime_ui.cpp +++ b/engines/mohawk/cstime_ui.cpp @@ -29,6 +29,8 @@ #include "mohawk/resource.h" #include "common/algorithm.h" // find #include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" #include "graphics/fontman.h" namespace Mohawk { diff --git a/engines/mohawk/cstime_view.cpp b/engines/mohawk/cstime_view.cpp index 115b363b6e..12d641a9ff 100644 --- a/engines/mohawk/cstime_view.cpp +++ b/engines/mohawk/cstime_view.cpp @@ -30,6 +30,8 @@ #include "mohawk/cursors.h" #include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" namespace Mohawk { diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp index b4969f990a..66669e35c9 100644 --- a/engines/mohawk/cursors.cpp +++ b/engines/mohawk/cursors.cpp @@ -148,7 +148,7 @@ void MystCursorManager::setCursor(uint16 id) { delete clrcStream; // Myst ME stores some cursors as 24bpp images instead of 8bpp - if (surface->bytesPerPixel == 1) { + if (surface->format.bytesPerPixel == 1) { CursorMan.replaceCursor((byte *)surface->pixels, surface->w, surface->h, hotspotX, hotspotY, 0); CursorMan.replaceCursorPalette(mhkSurface->getPalette(), 0, 256); } else { diff --git a/engines/mohawk/cursors.h b/engines/mohawk/cursors.h index f8a9429689..1fb8b35714 100644 --- a/engines/mohawk/cursors.h +++ b/engines/mohawk/cursors.h @@ -29,11 +29,11 @@ #include "common/scummsys.h" namespace Common { - class MacResManager; - class NEResources; - class PEResources; - class SeekableReadStream; - class String; +class MacResManager; +class NEResources; +class PEResources; +class SeekableReadStream; +class String; } #include "mohawk/resource.h" diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index 80f4c0f702..c14d3327d0 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -26,9 +26,9 @@ #include "base/plugins.h" #include "engines/advancedDetector.h" -#include "common/config-manager.h" -#include "common/file.h" #include "common/savefile.h" +#include "common/system.h" +#include "common/textconsole.h" #include "mohawk/livingbooks.h" diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h index fb7203f855..36dbcbde7b 100644 --- a/engines/mohawk/detection_tables.h +++ b/engines/mohawk/detection_tables.h @@ -793,6 +793,21 @@ static const MohawkGameDescription gameDescriptions[] = { { { + "seussabc", + "Demo", + AD_ENTRY1("BookOutline", "17d72660680ae32cd7c560d0cf04d2ef"), + Common::EN_ANY, + Common::kPlatformMacintosh, + ADGF_DEMO, + Common::GUIO_NONE + }, + GType_LIVINGBOOKSV2, + GF_DEMO, + 0 + }, + + { + { "1stdegree", "", AD_ENTRY1("AL236_1.MHK", "3ba145492a7b8b4dee0ef4222c5639c3"), @@ -1023,6 +1038,23 @@ static const MohawkGameDescription gameDescriptions[] = { 0 }, + // Just Grandma and Me 1.0 + // From scoriae + { + { + "grandma", + "v1.0", + AD_ENTRY1("PAGES.512", "e694ac10f957dd2e20611350bf968da3"), + Common::EN_ANY, + Common::kPlatformWindows, + ADGF_NO_FLAGS, + Common::GUIO_NONE + }, + GType_LIVINGBOOKSV1, + GF_LB_10, + "GRANDMA.EXE" + }, + { { "grandma", diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index c5a0c7e86d..4c7e52f02f 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -27,7 +27,9 @@ #include "mohawk/dialogs.h" #include "gui/gui-manager.h" -#include "common/savefile.h" +#include "gui/ThemeEngine.h" +#include "gui/widget.h" +#include "common/system.h" #include "common/translation.h" #ifdef ENABLE_MYST diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp index 81d2b6f019..a1bcb55f7b 100644 --- a/engines/mohawk/graphics.cpp +++ b/engines/mohawk/graphics.cpp @@ -28,7 +28,10 @@ #include "mohawk/livingbooks.h" #include "common/substream.h" +#include "common/system.h" +#include "common/textconsole.h" #include "engines/util.h" +#include "graphics/palette.h" #include "graphics/primitives.h" #include "gui/message.h" @@ -70,14 +73,14 @@ MohawkSurface::~MohawkSurface() { void MohawkSurface::convertToTrueColor() { assert(_surface); - if (_surface->bytesPerPixel > 1) + if (_surface->format.bytesPerPixel > 1) return; assert(_palette); Graphics::PixelFormat pixelFormat = g_system->getScreenFormat(); Graphics::Surface *surface = new Graphics::Surface(); - surface->create(_surface->w, _surface->h, pixelFormat.bytesPerPixel); + surface->create(_surface->w, _surface->h, pixelFormat); for (uint16 i = 0; i < _surface->h; i++) { for (uint16 j = 0; j < _surface->w; j++) { @@ -292,7 +295,7 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) { // Initialize our buffer _backBuffer = new Graphics::Surface(); - _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat.bytesPerPixel); + _backBuffer->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat); } MystGraphics::~MystGraphics() { @@ -486,7 +489,7 @@ void MystGraphics::copyImageSectionToBackBuffer(uint16 image, Common::Rect src, debug(3, "\theight: %d", height); for (uint16 i = 0; i < height; i++) - memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->bytesPerPixel); + memcpy(_backBuffer->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->format.bytesPerPixel); } void MystGraphics::copyImageToScreen(uint16 image, Common::Rect dest) { @@ -646,7 +649,7 @@ RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) : GraphicsManager(), _vm(vm // The actual game graphics only take up the first 392 rows. The inventory // occupies the rest of the screen and we don't use the buffer to hold that. _mainScreen = new Graphics::Surface(); - _mainScreen->create(608, 392, _pixelFormat.bytesPerPixel); + _mainScreen->create(608, 392, _pixelFormat); _updatesEnabled = true; _scheduledTransition = -1; // no transition @@ -677,7 +680,7 @@ void RivenGraphics::copyImageToScreen(uint16 image, uint32 left, uint32 top, uin surface->w = 608 - left; for (uint16 i = 0; i < surface->h; i++) - memcpy(_mainScreen->getBasePtr(left, i + top), surface->getBasePtr(0, i), surface->w * surface->bytesPerPixel); + memcpy(_mainScreen->getBasePtr(left, i + top), surface->getBasePtr(0, i), surface->w * surface->format.bytesPerPixel); _dirtyScreen = true; } @@ -972,7 +975,7 @@ void RivenGraphics::drawImageRect(uint16 id, Common::Rect srcRect, Common::Rect assert(srcRect.width() == dstRect.width() && srcRect.height() == dstRect.height()); for (uint16 i = 0; i < srcRect.height(); i++) - memcpy(_mainScreen->getBasePtr(dstRect.left, i + dstRect.top), surface->getBasePtr(srcRect.left, i + srcRect.top), srcRect.width() * surface->bytesPerPixel); + memcpy(_mainScreen->getBasePtr(dstRect.left, i + dstRect.top), surface->getBasePtr(srcRect.left, i + srcRect.top), srcRect.width() * surface->format.bytesPerPixel); _dirtyScreen = true; } diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h index 5cac68c510..c7e9b98d49 100644 --- a/engines/mohawk/graphics.h +++ b/engines/mohawk/graphics.h @@ -33,7 +33,7 @@ #include "graphics/pict.h" namespace Graphics { - class JPEG; +class JPEG; } namespace Mohawk { diff --git a/engines/mohawk/installer_archive.cpp b/engines/mohawk/installer_archive.cpp index 4ea742dff6..5079375896 100644 --- a/engines/mohawk/installer_archive.cpp +++ b/engines/mohawk/installer_archive.cpp @@ -27,8 +27,6 @@ #include "common/dcl.h" #include "common/debug.h" -#include "common/substream.h" -#include "common/util.h" namespace Mohawk { diff --git a/engines/mohawk/installer_archive.h b/engines/mohawk/installer_archive.h index 565b363be3..d33fbe5bcd 100644 --- a/engines/mohawk/installer_archive.h +++ b/engines/mohawk/installer_archive.h @@ -27,6 +27,8 @@ #include "common/scummsys.h" #include "common/endian.h" #include "common/file.h" +#include "common/hash-str.h" +#include "common/hashmap.h" #include "common/str.h" #ifndef MOHAWK_INSTALLER_ARCHIVE_H diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp index 22ea8d07a1..2475965812 100644 --- a/engines/mohawk/livingbooks.cpp +++ b/engines/mohawk/livingbooks.cpp @@ -26,13 +26,17 @@ #include "mohawk/livingbooks.h" #include "mohawk/resource.h" #include "mohawk/cursors.h" -#include "mohawk/sound.h" #include "mohawk/video.h" +#include "common/config-manager.h" +#include "common/error.h" #include "common/events.h" #include "common/EventRecorder.h" #include "common/fs.h" #include "common/archive.h" +#include "common/textconsole.h" + +#include "graphics/palette.h" #include "engines/util.h" diff --git a/engines/mohawk/livingbooks_code.cpp b/engines/mohawk/livingbooks_code.cpp index 84f69af2ac..4237c712d9 100644 --- a/engines/mohawk/livingbooks_code.cpp +++ b/engines/mohawk/livingbooks_code.cpp @@ -26,6 +26,9 @@ #include "mohawk/livingbooks.h" #include "mohawk/resource.h" +#include "common/system.h" +#include "common/textconsole.h" + namespace Mohawk { bool LBValue::operator==(const LBValue &x) const { diff --git a/engines/mohawk/mohawk.cpp b/engines/mohawk/mohawk.cpp index 015cbffb26..f63645f1ac 100644 --- a/engines/mohawk/mohawk.cpp +++ b/engines/mohawk/mohawk.cpp @@ -24,13 +24,9 @@ */ #include "common/scummsys.h" -#include "common/config-manager.h" -#include "common/file.h" -#include "common/events.h" -#include "common/keyboard.h" - -#include "base/plugins.h" -#include "base/version.h" +#include "common/error.h" +#include "common/system.h" +#include "common/textconsole.h" #include "mohawk/mohawk.h" #include "mohawk/cursors.h" diff --git a/engines/mohawk/mohawk.h b/engines/mohawk/mohawk.h index 1bad8a08ce..8a853d151e 100644 --- a/engines/mohawk/mohawk.h +++ b/engines/mohawk/mohawk.h @@ -34,7 +34,7 @@ class OSystem; namespace Common { - class SeekableReadStream; +class SeekableReadStream; } /** diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index 1aba820fed..655a38b578 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -25,7 +25,9 @@ #include "common/config-manager.h" #include "common/debug-channels.h" +#include "common/system.h" #include "common/translation.h" +#include "common/textconsole.h" #include "mohawk/cursors.h" #include "mohawk/graphics.h" diff --git a/engines/mohawk/myst_areas.cpp b/engines/mohawk/myst_areas.cpp index 21f6627f60..dc00bff923 100644 --- a/engines/mohawk/myst_areas.cpp +++ b/engines/mohawk/myst_areas.cpp @@ -29,6 +29,10 @@ #include "mohawk/sound.h" #include "mohawk/video.h" +#include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" + namespace Mohawk { MystResource::MystResource(MohawkEngine_Myst *vm, Common::SeekableReadStream *rlstStream, MystResource *parent) { diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index 17a2c66091..71c408ed37 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -31,6 +31,8 @@ #include "mohawk/sound.h" #include "mohawk/video.h" +#include "common/system.h" +#include "common/textconsole.h" #include "gui/message.h" namespace Mohawk { diff --git a/engines/mohawk/myst_stacks/channelwood.cpp b/engines/mohawk/myst_stacks/channelwood.cpp index 26267cfbda..cba2583a50 100644 --- a/engines/mohawk/myst_stacks/channelwood.cpp +++ b/engines/mohawk/myst_stacks/channelwood.cpp @@ -32,7 +32,9 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/channelwood.h" -#include "gui/message.h" +#include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" namespace Mohawk { namespace MystStacks { diff --git a/engines/mohawk/myst_stacks/credits.cpp b/engines/mohawk/myst_stacks/credits.cpp index 61772eda4d..bb8397fd09 100644 --- a/engines/mohawk/myst_stacks/credits.cpp +++ b/engines/mohawk/myst_stacks/credits.cpp @@ -30,6 +30,7 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/credits.h" +#include "common/system.h" #include "gui/message.h" namespace Mohawk { diff --git a/engines/mohawk/myst_stacks/dni.cpp b/engines/mohawk/myst_stacks/dni.cpp index ffbf9c991f..e2a11eb94f 100644 --- a/engines/mohawk/myst_stacks/dni.cpp +++ b/engines/mohawk/myst_stacks/dni.cpp @@ -31,6 +31,8 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/dni.h" +#include "common/system.h" + namespace Mohawk { namespace MystStacks { diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp index 3dab2f7939..c5c11026f5 100644 --- a/engines/mohawk/myst_stacks/mechanical.cpp +++ b/engines/mohawk/myst_stacks/mechanical.cpp @@ -32,7 +32,8 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/mechanical.h" -#include "gui/message.h" +#include "common/events.h" +#include "common/system.h" namespace Mohawk { namespace MystStacks { diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp index 5d070322ca..2b8ef94442 100644 --- a/engines/mohawk/myst_stacks/myst.cpp +++ b/engines/mohawk/myst_stacks/myst.cpp @@ -33,6 +33,8 @@ #include "mohawk/myst_stacks/myst.h" #include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" #include "gui/message.h" diff --git a/engines/mohawk/myst_stacks/preview.cpp b/engines/mohawk/myst_stacks/preview.cpp index dc491c7573..fddf6290fb 100644 --- a/engines/mohawk/myst_stacks/preview.cpp +++ b/engines/mohawk/myst_stacks/preview.cpp @@ -30,6 +30,7 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/preview.h" +#include "common/system.h" #include "gui/message.h" namespace Mohawk { diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index a84cd0632d..c670cb6a48 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -32,6 +32,8 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/selenitic.h" +#include "common/system.h" +#include "common/textconsole.h" #include "gui/message.h" namespace Mohawk { diff --git a/engines/mohawk/myst_stacks/slides.cpp b/engines/mohawk/myst_stacks/slides.cpp index e664081c96..4057edd9c9 100644 --- a/engines/mohawk/myst_stacks/slides.cpp +++ b/engines/mohawk/myst_stacks/slides.cpp @@ -30,6 +30,7 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/slides.h" +#include "common/system.h" #include "gui/message.h" namespace Mohawk { diff --git a/engines/mohawk/myst_stacks/stoneship.cpp b/engines/mohawk/myst_stacks/stoneship.cpp index b5b403dad8..07701c273e 100644 --- a/engines/mohawk/myst_stacks/stoneship.cpp +++ b/engines/mohawk/myst_stacks/stoneship.cpp @@ -32,7 +32,9 @@ #include "mohawk/video.h" #include "mohawk/myst_stacks/stoneship.h" -#include "gui/message.h" +#include "common/events.h" +#include "common/system.h" +#include "common/textconsole.h" namespace Mohawk { namespace MystStacks { diff --git a/engines/mohawk/myst_state.cpp b/engines/mohawk/myst_state.cpp index 968bb422be..de71dcf382 100644 --- a/engines/mohawk/myst_state.cpp +++ b/engines/mohawk/myst_state.cpp @@ -27,7 +27,9 @@ #include "mohawk/myst.h" #include "mohawk/myst_state.h" +#include "common/debug.h" #include "common/serializer.h" +#include "common/textconsole.h" #include "common/util.h" namespace Mohawk { diff --git a/engines/mohawk/myst_state.h b/engines/mohawk/myst_state.h index a543cb1c4f..074c3e5f10 100644 --- a/engines/mohawk/myst_state.h +++ b/engines/mohawk/myst_state.h @@ -31,7 +31,7 @@ #include "common/str.h" namespace Common { - class Serializer; +class Serializer; } namespace Mohawk { diff --git a/engines/mohawk/resource.cpp b/engines/mohawk/resource.cpp index de1513b237..62250b75f2 100644 --- a/engines/mohawk/resource.cpp +++ b/engines/mohawk/resource.cpp @@ -28,6 +28,7 @@ #include "common/debug.h" #include "common/substream.h" #include "common/util.h" +#include "common/textconsole.h" namespace Mohawk { diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h index 88927884a2..3aba5643db 100644 --- a/engines/mohawk/riven.h +++ b/engines/mohawk/riven.h @@ -35,6 +35,7 @@ #include "common/hashmap.h" #include "common/hash-str.h" #include "common/random.h" +#include "common/rect.h" namespace Mohawk { diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index 7c453dec48..dc0d66f19b 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -32,6 +32,7 @@ #include "gui/message.h" #include "common/events.h" +#include "common/system.h" namespace Mohawk { diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 35f38c4069..b8f86f993a 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -33,6 +33,7 @@ #include "common/memstream.h" #include "common/stream.h" +#include "common/system.h" namespace Mohawk { diff --git a/engines/mohawk/riven_scripts.h b/engines/mohawk/riven_scripts.h index 46cd965f40..2ac805c366 100644 --- a/engines/mohawk/riven_scripts.h +++ b/engines/mohawk/riven_scripts.h @@ -28,6 +28,7 @@ #include "common/str-array.h" #include "common/ptr.h" +#include "common/textconsole.h" class MohawkEngine_Riven; diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 9759f14699..fba87808d2 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -25,7 +25,10 @@ #include "mohawk/sound.h" +#include "common/debug.h" +#include "common/system.h" #include "common/util.h" +#include "common/textconsole.h" #include "audio/musicplugin.h" #include "audio/audiostream.h" diff --git a/engines/mohawk/video.cpp b/engines/mohawk/video.cpp index f481b5ceb2..8f57d61cc4 100644 --- a/engines/mohawk/video.cpp +++ b/engines/mohawk/video.cpp @@ -27,9 +27,16 @@ #include "mohawk/resource.h" #include "mohawk/video.h" +#include "common/debug.h" #include "common/events.h" +#include "common/textconsole.h" +#include "common/system.h" + +#include "graphics/surface.h" + #include "video/qt_decoder.h" + namespace Mohawk { void VideoEntry::clear() { @@ -219,7 +226,7 @@ bool VideoManager::updateMovies() { // Convert from 8bpp to the current screen format if necessary Graphics::PixelFormat pixelFormat = _vm->_system->getScreenFormat(); - if (frame->bytesPerPixel == 1) { + if (frame->format.bytesPerPixel == 1) { if (pixelFormat.bytesPerPixel == 1) { if (_videoStreams[i]->hasDirtyPalette()) _videoStreams[i]->setSystemPalette(); @@ -228,7 +235,7 @@ bool VideoManager::updateMovies() { const byte *palette = _videoStreams[i]->getPalette(); assert(palette); - convertedFrame->create(frame->w, frame->h, pixelFormat.bytesPerPixel); + convertedFrame->create(frame->w, frame->h, pixelFormat); for (uint16 j = 0; j < frame->h; j++) { for (uint16 k = 0; k < frame->w; k++) { diff --git a/engines/mohawk/view.cpp b/engines/mohawk/view.cpp index 837d386b58..e5a44122ea 100644 --- a/engines/mohawk/view.cpp +++ b/engines/mohawk/view.cpp @@ -28,6 +28,8 @@ #include "mohawk/graphics.h" #include "common/stream.h" #include "common/system.h" +#include "common/textconsole.h" +#include "graphics/palette.h" namespace Mohawk { diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index 527f2d2812..2cf6eebf2a 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -304,7 +304,7 @@ int BalloonManager_ns::createBalloon(int16 w, int16 h, int16 winding, uint16 bor int16 real_h = (winding == -1) ? h : h + 9; balloon->surface = new Graphics::Surface; - balloon->surface->create(w, real_h, 1); + balloon->surface->create(w, real_h, Graphics::PixelFormat::createFormatCLUT8()); balloon->surface->fillRect(Common::Rect(w, real_h), BALLOON_TRANSPARENT_COLOR_NS); Common::Rect r(w, h); @@ -578,7 +578,7 @@ Graphics::Surface *BalloonManager_br::expandBalloon(Frames *data, int frameNum) rect.translate(-rect.left, -rect.top); Graphics::Surface *surf = new Graphics::Surface; - surf->create(rect.width(), rect.height(), 1); + surf->create(rect.width(), rect.height(), Graphics::PixelFormat::createFormatCLUT8()); _vm->_gfx->unpackBlt(rect, data->getData(frameNum), data->getRawSize(frameNum), surf, LAYER_FOREGROUND, 100, BALLOON_TRANSPARENT_COLOR_BR); @@ -670,7 +670,7 @@ int BalloonManager_br::createBalloon(int16 w, int16 h, uint16 borderThickness) { Balloon *balloon = &_intBalloons[id]; balloon->surface = new Graphics::Surface; - balloon->surface->create(w, h, 1); + balloon->surface->create(w, h, Graphics::PixelFormat::createFormatCLUT8()); Common::Rect rect(w, h); balloon->surface->fillRect(rect, 1); diff --git a/engines/parallaction/callables_br.cpp b/engines/parallaction/callables_br.cpp index 21703dc1dd..0bc6f6762c 100644 --- a/engines/parallaction/callables_br.cpp +++ b/engines/parallaction/callables_br.cpp @@ -25,6 +25,8 @@ #include "parallaction/parallaction.h" +#include "common/textconsole.h" + namespace Parallaction { void Parallaction_br::_c_null(void*) { diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index f67a77aa21..8e3c2cbeb8 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -28,6 +28,7 @@ #include "common/config-manager.h" #include "engines/advancedDetector.h" #include "common/system.h" +#include "common/textconsole.h" #include "parallaction/parallaction.h" diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index e3d02bac62..944d9f4b55 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -25,6 +25,7 @@ #include "common/events.h" #include "common/debug-channels.h" +#include "common/textconsole.h" #include "parallaction/exec.h" #include "parallaction/input.h" #include "parallaction/parallaction.h" diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index 6928c1eefc..d996b72e90 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -23,6 +23,9 @@ * */ +#include "common/iff_container.h" +#include "common/textconsole.h" + #include "parallaction/disk.h" #include "parallaction/graphics.h" @@ -36,7 +39,7 @@ void ILBMLoader::setupBuffer(uint32 w, uint32 h) { _surf = new Graphics::Surface; assert(_surf); } - _surf->create(w, h, 1); + _surf->create(w, h, Graphics::PixelFormat::createFormatCLUT8()); _mode = Graphics::ILBMDecoder::ILBM_UNPACK_PLANES; _intBuffer = (byte*)_surf->pixels; break; diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 8ff0efd3c6..9af189af68 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -29,14 +29,20 @@ #define PATH_LEN 200 #include "common/archive.h" +#include "common/str.h" -#include "graphics/surface.h" #include "graphics/iff.h" namespace Common { - class FSDirectory; +class FSDirectory; +class ReadStream; +class SeekableReadStream; +struct IFFChunk; } +namespace Graphics { +struct Surface; +} namespace Parallaction { diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp index 34b04cd00f..cea4091ee9 100644 --- a/engines/parallaction/disk_br.cpp +++ b/engines/parallaction/disk_br.cpp @@ -27,6 +27,7 @@ #include "common/config-manager.h" #include "common/fs.h" +#include "common/textconsole.h" #include "parallaction/parallaction.h" #include "parallaction/parser.h" @@ -227,7 +228,7 @@ void DosDisk_br::loadBitmap(Common::SeekableReadStream &stream, Graphics::Surfac stream.skip(768); } - surf.create(width, height, 1); + surf.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); stream.read(surf.pixels, width * height); } diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index 133b7bef6c..e695fa8798 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -27,6 +27,7 @@ #include "common/fs.h" #include "common/memstream.h" #include "common/substream.h" +#include "common/textconsole.h" #include "parallaction/parser.h" #include "parallaction/parallaction.h" @@ -473,7 +474,7 @@ void DosDisk_ns::loadBackground(BackgroundInfo& info, const char *filename) { } // read bitmap, mask and path data and extract them into the 3 buffers - info.bg.create(info.width, info.height, 1); + info.bg.create(info.width, info.height, Graphics::PixelFormat::createFormatCLUT8()); createMaskAndPathBuffers(info); unpackBackground(stream, (byte*)info.bg.pixels, info._mask->data, info._path->data); diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp index 99aa27b30f..c879745f65 100644 --- a/engines/parallaction/exec_br.cpp +++ b/engines/parallaction/exec_br.cpp @@ -27,6 +27,8 @@ #include "parallaction/input.h" #include "parallaction/parallaction.h" +#include "common/textconsole.h" + namespace Parallaction { #define INST_ON 1 diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index c8a5ee1548..ee357576d2 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -28,6 +28,7 @@ #include "parallaction/parallaction.h" #include "parallaction/sound.h" +#include "common/textconsole.h" namespace Parallaction { diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp index 18f469f0a2..a459e6a600 100644 --- a/engines/parallaction/font.cpp +++ b/engines/parallaction/font.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "parallaction/parallaction.h" diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index 6c39b2e696..ca99624ecd 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -28,6 +28,7 @@ #include "disk.h" #include "common/algorithm.h" +#include "common/textconsole.h" #include "parallaction/parallaction.h" namespace Parallaction { diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 35441d7e3e..d33e733677 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -26,6 +26,8 @@ #include "common/system.h" #include "common/file.h" +#include "common/textconsole.h" +#include "graphics/palette.h" #include "graphics/primitives.h" #include "engines/util.h" @@ -521,7 +523,7 @@ void Gfx::invertBackground(const Common::Rect& r) { void setupLabelSurface(Graphics::Surface &surf, uint w, uint h) { - surf.create(w, h, 1); + surf.create(w, h, Graphics::PixelFormat::createFormatCLUT8()); surf.fillRect(Common::Rect(w,h), LABEL_TRANSPARENT_COLOR); } @@ -857,7 +859,7 @@ void Gfx::setBackground(uint type, BackgroundInfo *info) { int height = CLIP(info->height, (int)_vm->_screenHeight, info->height); if (width != _backBuffer.w || height != _backBuffer.h) { - _backBuffer.create(width, height, 1); + _backBuffer.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); } } diff --git a/engines/parallaction/gui.cpp b/engines/parallaction/gui.cpp index c4a36e5362..db70ebb432 100644 --- a/engines/parallaction/gui.cpp +++ b/engines/parallaction/gui.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "parallaction/gui.h" namespace Parallaction { diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index c80a9940a2..41e3082464 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -24,6 +24,7 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "parallaction/gui.h" #include "parallaction/input.h" @@ -483,7 +484,7 @@ public: _y = 90; Graphics::Surface *surf = new Graphics::Surface; - surf->create(w, 110, 1); + surf->create(w, 110, Graphics::PixelFormat::createFormatCLUT8()); surf->fillRect(Common::Rect(0, 0, w, 110), 12); surf->fillRect(Common::Rect(10, 10, w-10, 100), 15); diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp index 51d3ba5799..6b863cc808 100644 --- a/engines/parallaction/gui_ns.cpp +++ b/engines/parallaction/gui_ns.cpp @@ -25,6 +25,7 @@ #include "common/system.h" #include "common/hashmap.h" +#include "common/textconsole.h" #include "parallaction/gui.h" #include "parallaction/input.h" @@ -474,7 +475,7 @@ class SelectCharacterInputState_NS : public MenuInputState { public: SelectCharacterInputState_NS(Parallaction_ns *vm, MenuInputHelper *helper) : MenuInputState("selectcharacter", helper), _vm(vm) { _keys = (_vm->getPlatform() == Common::kPlatformAmiga && (_vm->getFeatures() & GF_LANG_MULT)) ? _amigaKeys : _pcKeys; - _block.create(BLOCK_WIDTH, BLOCK_HEIGHT, 1); + _block.create(BLOCK_WIDTH, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); _labels[0] = 0; _labels[1] = 0; @@ -625,7 +626,7 @@ public: _vm->_soundManI->stopMusic(); _vm->showSlide("password"); - _emptySlots.create(BLOCK_WIDTH * 8, BLOCK_HEIGHT, 1); + _emptySlots.create(BLOCK_WIDTH * 8, BLOCK_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); Common::Rect rect(SLOT_X, SLOT_Y, SLOT_X + BLOCK_WIDTH * 8, SLOT_Y + BLOCK_HEIGHT); _vm->_gfx->grabBackground(rect, _emptySlots); diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index e508668d80..3a47b14deb 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -25,6 +25,7 @@ #include "common/events.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" #include "parallaction/exec.h" @@ -486,7 +487,7 @@ void Input::initCursors() { _donnaCursor = _vm->_disk->loadPointer("pointer3"); Graphics::Surface *surf = new Graphics::Surface; - surf->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, 1); + surf->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, Graphics::PixelFormat::createFormatCLUT8()); _comboArrow = new SurfaceToFrames(surf); // TODO: choose the pointer depending on the active character @@ -495,12 +496,12 @@ void Input::initCursors() { } else { // TODO: Where are the Amiga cursors? Graphics::Surface *surf1 = new Graphics::Surface; - surf1->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, 1); + surf1->create(_mouseComboProps_BR._width, _mouseComboProps_BR._height, Graphics::PixelFormat::createFormatCLUT8()); _comboArrow = new SurfaceToFrames(surf1); // TODO: scale mouse cursor (see staticres.cpp) Graphics::Surface *surf2 = new Graphics::Surface; - surf2->create(32, 16, 1); + surf2->create(32, 16, Graphics::PixelFormat::createFormatCLUT8()); memcpy(surf2->pixels, _resMouseArrow_BR_Amiga, 32*16); _mouseArrow = new SurfaceToFrames(surf2); } diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 5ead55bbef..2412cc6445 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -26,7 +26,7 @@ #include "parallaction/input.h" #include "parallaction/parallaction.h" - +#include "common/textconsole.h" namespace Parallaction { @@ -141,7 +141,7 @@ void Parallaction::closeInventory() { InventoryRenderer::InventoryRenderer(Parallaction *vm, InventoryProperties *props, Inventory *inv) : _vm(vm), _props(props), _inv(inv) { - _surf.create(_props->_width, _props->_height, 1); + _surf.create(_props->_width, _props->_height, Graphics::PixelFormat::createFormatCLUT8()); } InventoryRenderer::~InventoryRenderer() { diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index c345b92ffb..e1306dc956 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "parallaction/parallaction.h" #include "parallaction/objects.h" #include "parallaction/parser.h" diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 3055439e47..516d465671 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -23,13 +23,10 @@ * */ -#include "common/config-manager.h" #include "common/debug-channels.h" -#include "common/events.h" #include "common/EventRecorder.h" -#include "common/file.h" -#include "common/util.h" #include "common/system.h" +#include "common/textconsole.h" #include "parallaction/exec.h" #include "parallaction/input.h" diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index c5b6b23f55..b0b1145d2e 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -32,6 +32,7 @@ #include "common/func.h" #include "common/random.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "engines/engine.h" diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 619a4f7559..ca344792cf 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -25,6 +25,7 @@ #include "common/system.h" #include "common/util.h" +#include "common/textconsole.h" #include "parallaction/parallaction.h" #include "parallaction/exec.h" diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index ffac22e118..ffc0412b1d 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -25,6 +25,7 @@ #include "common/system.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "parallaction/parallaction.h" #include "parallaction/exec.h" diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index c964b74512..a7b926e485 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "parallaction/parallaction.h" #include "parallaction/parser.h" diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index 9748be0526..f8818def9a 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -23,6 +23,7 @@ * */ +#include "common/textconsole.h" #include "parallaction/parallaction.h" #include "parallaction/parser.h" diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 5053a3d7a5..6c9afe3d85 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -23,6 +23,8 @@ * */ +#include "common/textconsole.h" + #include "parallaction/parallaction.h" #include "parallaction/parser.h" #include "parallaction/sound.h" diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp index 50a777f7b8..4c77aa3e02 100644 --- a/engines/parallaction/saveload.cpp +++ b/engines/parallaction/saveload.cpp @@ -25,6 +25,7 @@ #include "common/savefile.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "gui/dialog.h" #include "gui/saveload.h" diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp index ee53f9641e..abfaa4bf5d 100644 --- a/engines/parallaction/sound_br.cpp +++ b/engines/parallaction/sound_br.cpp @@ -24,6 +24,7 @@ */ #include "common/stream.h" +#include "common/textconsole.h" #include "common/util.h" #include "audio/mixer.h" diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp index ba81314da6..5123695ebc 100644 --- a/engines/parallaction/sound_ns.cpp +++ b/engines/parallaction/sound_ns.cpp @@ -24,8 +24,8 @@ */ #include "common/file.h" - #include "common/stream.h" +#include "common/textconsole.h" #include "audio/mixer.h" #include "audio/midiparser.h" diff --git a/engines/queen/command.cpp b/engines/queen/command.cpp index 356856e940..87b24735a8 100644 --- a/engines/queen/command.cpp +++ b/engines/queen/command.cpp @@ -24,8 +24,6 @@ */ -#include "common/events.h" -#include "common/system.h" #include "queen/command.h" #include "queen/display.h" diff --git a/engines/queen/cutaway.cpp b/engines/queen/cutaway.cpp index 11a8704d60..6fb48c7fb0 100644 --- a/engines/queen/cutaway.cpp +++ b/engines/queen/cutaway.cpp @@ -23,6 +23,7 @@ * */ +#include "common/textconsole.h" #include "queen/cutaway.h" diff --git a/engines/queen/display.cpp b/engines/queen/display.cpp index b130b27a89..c78fd8ebcc 100644 --- a/engines/queen/display.cpp +++ b/engines/queen/display.cpp @@ -29,6 +29,7 @@ #include "common/events.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "queen/display.h" #include "queen/input.h" diff --git a/engines/queen/display.h b/engines/queen/display.h index d3391fc4d3..e7a2ecd4a1 100644 --- a/engines/queen/display.h +++ b/engines/queen/display.h @@ -32,8 +32,9 @@ #include "queen/defs.h" class OSystem; + namespace Common { - struct Rect; +struct Rect; } namespace Queen { diff --git a/engines/queen/graphics.cpp b/engines/queen/graphics.cpp index 17e36b1d90..c86f679765 100644 --- a/engines/queen/graphics.cpp +++ b/engines/queen/graphics.cpp @@ -34,6 +34,9 @@ #include "queen/resource.h" #include "queen/sound.h" +#include "common/debug.h" +#include "common/textconsole.h" + namespace Queen { void BobSlot::curPos(int16 xx, int16 yy) { diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index 9518388b26..eac855a0cd 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -26,6 +26,7 @@ #include "common/events.h" #include "common/system.h" +#include "common/textconsole.h" #include "queen/queen.h" #include "queen/input.h" diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index aff24be22e..4200168f07 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -24,6 +24,7 @@ */ +#include "common/error.h" #include "common/events.h" #include "common/system.h" #include "queen/journal.h" diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp index de254300b6..e99a739726 100644 --- a/engines/queen/logic.cpp +++ b/engines/queen/logic.cpp @@ -25,8 +25,7 @@ #include "common/config-manager.h" -#include "common/events.h" -#include "common/system.h" +#include "common/textconsole.h" #include "queen/logic.h" diff --git a/engines/queen/midiadlib.cpp b/engines/queen/midiadlib.cpp index b03c90f653..af52f7ed2b 100644 --- a/engines/queen/midiadlib.cpp +++ b/engines/queen/midiadlib.cpp @@ -24,6 +24,7 @@ */ #include "common/endian.h" +#include "common/textconsole.h" #include "audio/fmopl.h" #include "audio/softsynth/emumidi.h" diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 519f028cda..0dde5c7b42 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -32,6 +32,7 @@ #include "common/system.h" #include "common/events.h" #include "common/EventRecorder.h" +#include "common/textconsole.h" #include "engines/util.h" diff --git a/engines/queen/queen.h b/engines/queen/queen.h index 93d705b182..6098a9f5c2 100644 --- a/engines/queen/queen.h +++ b/engines/queen/queen.h @@ -30,7 +30,7 @@ #include "common/random.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } #if defined(_WIN32_WCE) && (_WIN32_WCE <= 300) diff --git a/engines/queen/resource.cpp b/engines/queen/resource.cpp index e8519ee68b..62b13e290c 100644 --- a/engines/queen/resource.cpp +++ b/engines/queen/resource.cpp @@ -27,6 +27,7 @@ #include "common/endian.h" #include "common/config-manager.h" #include "common/substream.h" +#include "common/textconsole.h" #include "queen/resource.h" namespace Queen { diff --git a/engines/queen/sound.cpp b/engines/queen/sound.cpp index a34af99ec3..afb77f3969 100644 --- a/engines/queen/sound.cpp +++ b/engines/queen/sound.cpp @@ -27,6 +27,7 @@ #include "common/config-manager.h" #include "common/endian.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "queen/sound.h" #include "queen/input.h" diff --git a/engines/queen/sound.h b/engines/queen/sound.h index cee0463ed1..a89e345791 100644 --- a/engines/queen/sound.h +++ b/engines/queen/sound.h @@ -32,7 +32,7 @@ #include "queen/defs.h" namespace Common { - class File; +class File; } namespace Queen { diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index 106b0d6123..18c712b799 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -24,9 +24,8 @@ */ -#include "common/events.h" -#include "common/system.h" #include "common/rect.h" +#include "common/textconsole.h" #include "queen/talk.h" diff --git a/engines/queen/walk.cpp b/engines/queen/walk.cpp index 7765828bd7..a778ea5b05 100644 --- a/engines/queen/walk.cpp +++ b/engines/queen/walk.cpp @@ -23,6 +23,7 @@ * */ +#include "common/textconsole.h" #include "queen/walk.h" diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp index 5fc2082178..4930718b67 100644 --- a/engines/saga/gfx.cpp +++ b/engines/saga/gfx.cpp @@ -34,6 +34,7 @@ #include "common/system.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "engines/util.h" namespace Saga { @@ -46,7 +47,7 @@ Gfx::Gfx(SagaEngine *vm, OSystem *system, int width, int height) : _vm(vm), _sys debug(5, "Init screen %dx%d", width, height); // Convert surface data to R surface data - _backBuffer.create(width, height, 1); + _backBuffer.create(width, height, Graphics::PixelFormat::createFormatCLUT8()); // Start with the cursor shown. It will be hidden before the intro, if // there is an intro. (With boot params, there may not be.) diff --git a/engines/saga/gfx.h b/engines/saga/gfx.h index 33fac10c63..56d9104371 100644 --- a/engines/saga/gfx.h +++ b/engines/saga/gfx.h @@ -28,6 +28,7 @@ #ifndef SAGA_GFX_H #define SAGA_GFX_H +#include "common/rect.h" #include "graphics/surface.h" namespace Saga { diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 0f84b09547..c3773b2cb2 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -2798,7 +2798,7 @@ void Interface::keyBoss() { Rect rect; ByteArray image; int imageWidth, imageHeight; - const byte *pal; + //const byte *pal; PalEntry cPal[PAL_ENTRIES]; _vm->_gfx->showCursor(false); @@ -2818,7 +2818,7 @@ void Interface::keyBoss() { rect.setHeight(imageHeight); _vm->_gfx->getCurrentPal(_mapSavedPal); - pal = _vm->getImagePal(resourceData); + //pal = _vm->getImagePal(resourceData); cPal[0].red = 0; cPal[0].green = 0; diff --git a/engines/saga/introproc_saga2.cpp b/engines/saga/introproc_saga2.cpp index 5ae80b14c9..7f04474c61 100644 --- a/engines/saga/introproc_saga2.cpp +++ b/engines/saga/introproc_saga2.cpp @@ -31,7 +31,10 @@ #include "saga/scene.h" #include "saga/gfx.h" -#include "audio/mixer.h" +#include "common/events.h" +#include "common/keyboard.h" +#include "common/system.h" +#include "common/textconsole.h" #include "graphics/surface.h" #include "video/smk_decoder.h" diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp index dc9334b037..837a9e5879 100644 --- a/engines/saga/render.cpp +++ b/engines/saga/render.cpp @@ -56,7 +56,7 @@ Render::Render(SagaEngine *vm, OSystem *system) { _vm->getTimerManager()->installTimerProc(&fpsTimerCallback, 1000000, this); #endif - _backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, 1); + _backGroundSurface.create(_vm->getDisplayInfo().width, _vm->getDisplayInfo().height, Graphics::PixelFormat::createFormatCLUT8()); _flags = 0; diff --git a/engines/saga/saga.h b/engines/saga/saga.h index 52c4b824e7..4df44a2e18 100644 --- a/engines/saga/saga.h +++ b/engines/saga/saga.h @@ -31,6 +31,7 @@ #include "common/array.h" #include "common/random.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "audio/mididrv.h" #include "saga/gfx.h" diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 6a6992fb5f..27300377e9 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -23,10 +23,8 @@ * */ -#include "common/config-manager.h" #include "common/savefile.h" #include "common/system.h" -#include "common/file.h" #include "graphics/thumbnail.h" #include "saga/saga.h" diff --git a/engines/saga/shorten.cpp b/engines/saga/shorten.cpp index 685cb26aa7..8f0baa9d53 100644 --- a/engines/saga/shorten.cpp +++ b/engines/saga/shorten.cpp @@ -24,6 +24,7 @@ */ #include "common/scummsys.h" +#include "common/textconsole.h" #include "saga/shorten.h" @@ -34,10 +35,8 @@ // FIXME: This doesn't work yet correctly -#include "common/endian.h" #include "common/util.h" -#include "audio/mixer.h" #include "audio/decoders/raw.h" namespace Saga { diff --git a/engines/savestate.cpp b/engines/savestate.cpp index 368f59ef51..bed19ba3e5 100644 --- a/engines/savestate.cpp +++ b/engines/savestate.cpp @@ -25,6 +25,7 @@ #include "engines/savestate.h" #include "graphics/surface.h" +#include "common/textconsole.h" void SaveStateDescriptor::setThumbnail(Graphics::Surface *t) { if (_thumbnail.get() == t) diff --git a/engines/savestate.h b/engines/savestate.h index 37f2b9bdd4..9b64a96aee 100644 --- a/engines/savestate.h +++ b/engines/savestate.h @@ -32,7 +32,7 @@ namespace Graphics { - struct Surface; +struct Surface; } /** diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index 73d4ed4198..c122fceeb0 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -28,9 +28,8 @@ #include "common/dcl.h" #include "common/util.h" #include "common/endian.h" -#include "common/debug.h" -#include "common/debug-channels.h" #include "common/stream.h" +#include "common/textconsole.h" #include "sci/decompressor.h" #include "sci/sci.h" diff --git a/engines/sci/decompressor.h b/engines/sci/decompressor.h index 88e24fcc47..8b6f955ddb 100644 --- a/engines/sci/decompressor.h +++ b/engines/sci/decompressor.h @@ -28,7 +28,9 @@ #include "common/scummsys.h" -namespace Common { class ReadStream; } +namespace Common { +class ReadStream; +} namespace Sci { diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 82522a6e77..0e2f64257a 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -28,6 +28,7 @@ #include "common/file.h" #include "common/str.h" #include "common/savefile.h" +#include "common/system.h" #include "common/translation.h" #include "gui/saveload.h" diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp index 911713d0bd..7fb6ac296e 100644 --- a/engines/sci/engine/ksound.cpp +++ b/engines/sci/engine/ksound.cpp @@ -32,6 +32,7 @@ #include "sci/sound/soundcmd.h" #include "audio/mixer.h" +#include "common/system.h" namespace Sci { diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index 6a411d8e23..a8d4437148 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -29,7 +29,14 @@ #include "sci/graphics/cursor.h" #include "sci/graphics/palette.h" #include "sci/graphics/screen.h" -#include "graphics/cursorman.h" +#include "common/events.h" +#include "common/keyboard.h" +#include "common/str.h" +#include "common/system.h" +#include "common/textconsole.h" +#include "graphics/pixelformat.h" +#include "graphics/surface.h" +#include "video/video_decoder.h" #include "video/avi_decoder.h" #include "video/qt_decoder.h" #include "sci/video/seq_decoder.h" diff --git a/engines/sci/engine/object.h b/engines/sci/engine/object.h index 81d5b2c983..8ae06f2707 100644 --- a/engines/sci/engine/object.h +++ b/engines/sci/engine/object.h @@ -28,6 +28,7 @@ #include "common/array.h" #include "common/serializer.h" +#include "common/textconsole.h" #include "sci/sci.h" // for the SCI versions #include "sci/engine/vm_types.h" // for reg_t diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h index d91118ec1e..cd6d56500a 100644 --- a/engines/sci/engine/state.h +++ b/engines/sci/engine/state.h @@ -32,8 +32,8 @@ #include "common/str-array.h" namespace Common { - class SeekableReadStream; - class WriteStream; +class SeekableReadStream; +class WriteStream; } #include "sci/sci.h" diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index d209a0ca5b..b441815014 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -25,8 +25,6 @@ #include "common/debug.h" #include "common/debug-channels.h" -#include "common/stack.h" -#include "common/config-manager.h" #include "sci/sci.h" #include "sci/console.h" diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h index 684e6cac5e..5538b5c2c5 100644 --- a/engines/sci/graphics/fontsjis.h +++ b/engines/sci/graphics/fontsjis.h @@ -29,7 +29,7 @@ #include "sci/graphics/helpers.h" namespace Graphics { - class FontSJIS; +class FontSJIS; } namespace Sci { diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index dd55b3b060..7fafe843fd 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -23,9 +23,15 @@ * */ -#include "common/util.h" -#include "common/stack.h" -#include "graphics/primitives.h" +#include "common/algorithm.h" +#include "common/events.h" +#include "common/keyboard.h" +#include "common/list_intern.h" +#include "common/str.h" +#include "common/system.h" +#include "common/textconsole.h" +#include "engines/engine.h" +#include "graphics/surface.h" #include "sci/sci.h" #include "sci/engine/kernel.h" diff --git a/engines/sci/graphics/maciconbar.h b/engines/sci/graphics/maciconbar.h index 3ac5475147..72609d19ab 100644 --- a/engines/sci/graphics/maciconbar.h +++ b/engines/sci/graphics/maciconbar.h @@ -31,7 +31,7 @@ #include "sci/engine/vm.h" namespace Graphics { - struct Surface; +struct Surface; } namespace Sci { diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp index c347da3c0f..27a0bdfc44 100644 --- a/engines/sci/graphics/paint.cpp +++ b/engines/sci/graphics/paint.cpp @@ -23,8 +23,6 @@ * */ -#include "common/util.h" -#include "common/stack.h" #include "graphics/primitives.h" #include "sci/sci.h" diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index ff738fc3b9..5172f7cdc0 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -23,11 +23,6 @@ * */ -#include "common/util.h" -#include "common/stack.h" -#include "common/system.h" -#include "graphics/primitives.h" - #include "sci/sci.h" #include "sci/engine/features.h" #include "sci/engine/state.h" @@ -302,6 +297,11 @@ void GfxPaint16::bitsShow(const Common::Rect &rect) { return; _ports->offsetRect(workerRect); + + // We adjust the left/right coordinates to even coordinates + workerRect.left &= 0xFFFE; // round down + workerRect.right = (workerRect.right + 1) & 0xFFFE; // round up + _screen->copyRectToScreen(workerRect); } @@ -472,6 +472,7 @@ void GfxPaint16::kernelGraphRedrawBox(Common::Rect rect) { #define SCI_DISPLAY_RESTOREUNDER 108 #define SCI_DISPLAY_DUMMY1 114 // used in longbow demo/qfg1 ega demo, not supported in sierra sci - no parameters #define SCI_DISPLAY_DUMMY2 115 // used in longbow demo, not supported in sierra sci - has 1 parameter +#define SCI_DISPLAY_DUMMY3 117 // used in qfg1 ega demo, not supported in sierra sci - no parameters #define SCI_DISPLAY_DONTSHOWBITS 121 reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { @@ -542,9 +543,10 @@ reg_t GfxPaint16::kernelDisplay(const char *text, int argc, reg_t *argv) { break; // 2 Dummy functions, longbow-demo is using those several times but sierra sci doesn't support them at all - // The Quest for Glory 1 EGA demo also calls kDisplay(114) + // The Quest for Glory 1 EGA demo also calls kDisplay(114) and kDisplay(117) case SCI_DISPLAY_DUMMY1: case SCI_DISPLAY_DUMMY2: + case SCI_DISPLAY_DUMMY3: if (!g_sci->isDemo() || (g_sci->getGameId() != GID_LONGBOW && g_sci->getGameId() != GID_QFG1)) error("Unknown kDisplay argument %d", displayArg.offset); if (displayArg.offset == SCI_DISPLAY_DUMMY2) { diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index 69a278eb8b..f277436631 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -23,11 +23,6 @@ * */ -#include "common/util.h" -#include "common/stack.h" - -#include "graphics/primitives.h" - #include "sci/sci.h" #include "sci/engine/state.h" #include "sci/engine/selector.h" diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 0433479a09..42551e9369 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -28,6 +28,8 @@ #include "common/util.h" #include "common/system.h" +#include "graphics/palette.h" + #include "sci/sci.h" #include "sci/engine/state.h" #include "sci/graphics/cache.h" diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 6e9df2f019..3f9ebaa07a 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -24,9 +24,7 @@ */ #include "common/archive.h" -#include "common/util.h" -#include "common/stack.h" -#include "graphics/primitives.h" +#include "common/system.h" #include "sci/sci.h" #include "sci/event.h" diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index fb124055d6..dde1be13ab 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -24,9 +24,8 @@ */ #include "common/events.h" -#include "common/util.h" -#include "common/stack.h" #include "common/system.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "sci/sci.h" diff --git a/engines/sci/parser/grammar.cpp b/engines/sci/parser/grammar.cpp index 77db56adba..b330a432e3 100644 --- a/engines/sci/parser/grammar.cpp +++ b/engines/sci/parser/grammar.cpp @@ -31,6 +31,7 @@ #include "sci/parser/vocabulary.h" #include "sci/console.h" #include "common/array.h" +#include "common/textconsole.h" namespace Sci { diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 4caa77b0ae..a48ae0fad7 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -28,6 +28,7 @@ #include "common/file.h" #include "common/fs.h" #include "common/macresman.h" +#include "common/textconsole.h" #include "sci/resource.h" #include "sci/resource_intern.h" @@ -1275,7 +1276,7 @@ ResVersion ResourceManager::detectVolVersion() { // SCI32 volume format: {bResType wResNumber dwPacked dwUnpacked wCompression} = 13 bytes // Try to parse volume with SCI0 scheme to see if it make sense // Checking 1MB of data should be enough to determine the version - uint16 resId, wCompression; + uint16 wCompression; uint32 dwPacked, dwUnpacked; ResVersion curVersion = kResVersionSci0Sci1Early; bool failed = false; @@ -1285,7 +1286,7 @@ ResVersion ResourceManager::detectVolVersion() { while (!fileStream->eos() && fileStream->pos() < 0x100000) { if (curVersion > kResVersionSci0Sci1Early) fileStream->readByte(); - resId = fileStream->readUint16LE(); + fileStream->skip(2); // resId dwPacked = (curVersion < kResVersionSci2) ? fileStream->readUint16LE() : fileStream->readUint32LE(); dwUnpacked = (curVersion < kResVersionSci2) ? fileStream->readUint16LE() : fileStream->readUint32LE(); diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp index 6e74553f56..1e0b9c0ddf 100644 --- a/engines/sci/resource_audio.cpp +++ b/engines/sci/resource_audio.cpp @@ -27,6 +27,7 @@ #include "common/archive.h" #include "common/file.h" +#include "common/textconsole.h" #include "sci/resource.h" #include "sci/resource_intern.h" diff --git a/engines/sci/resource_intern.h b/engines/sci/resource_intern.h index 98cca6283c..969e250e62 100644 --- a/engines/sci/resource_intern.h +++ b/engines/sci/resource_intern.h @@ -29,7 +29,7 @@ #include "sci/resource.h" namespace Common { - class MacResManager; +class MacResManager; } namespace Sci { diff --git a/engines/sci/sound/drivers/adlib.cpp b/engines/sci/sound/drivers/adlib.cpp index 65a8e2e3da..f00c99d5b5 100644 --- a/engines/sci/sound/drivers/adlib.cpp +++ b/engines/sci/sound/drivers/adlib.cpp @@ -26,6 +26,8 @@ #include "sci/sci.h" #include "common/file.h" +#include "common/system.h" +#include "common/textconsole.h" #include "audio/fmopl.h" #include "audio/softsynth/emumidi.h" diff --git a/engines/sci/sound/drivers/amigamac.cpp b/engines/sci/sound/drivers/amigamac.cpp index 030b095cc9..7ee8d21f86 100644 --- a/engines/sci/sound/drivers/amigamac.cpp +++ b/engines/sci/sound/drivers/amigamac.cpp @@ -30,6 +30,8 @@ #include "common/file.h" #include "common/frac.h" #include "common/memstream.h" +#include "common/system.h" +#include "common/textconsole.h" #include "common/util.h" namespace Sci { diff --git a/engines/sci/sound/drivers/cms.cpp b/engines/sci/sound/drivers/cms.cpp index 051fa7f1fd..47c59a1e3d 100644 --- a/engines/sci/sound/drivers/cms.cpp +++ b/engines/sci/sound/drivers/cms.cpp @@ -29,6 +29,8 @@ #include "audio/softsynth/cms.h" #include "audio/mixer.h" +#include "common/system.h" + #include "sci/resource.h" namespace Sci { diff --git a/engines/sci/sound/drivers/fb01.cpp b/engines/sci/sound/drivers/fb01.cpp index 971c2ff92d..f217738bb2 100644 --- a/engines/sci/sound/drivers/fb01.cpp +++ b/engines/sci/sound/drivers/fb01.cpp @@ -30,6 +30,7 @@ #include "common/file.h" #include "common/system.h" +#include "common/textconsole.h" namespace Sci { diff --git a/engines/sci/sound/drivers/midi.cpp b/engines/sci/sound/drivers/midi.cpp index 9eef867aeb..f36aac3a2a 100644 --- a/engines/sci/sound/drivers/midi.cpp +++ b/engines/sci/sound/drivers/midi.cpp @@ -745,7 +745,7 @@ uint8 MidiPlayer_Midi::getGmInstrument(const Mt32ToGmMap &Mt32Ins) { void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { // FIXME: Clean this up int memtimbres, patches; - uint8 group, number, keyshift, finetune, bender_range; + uint8 group, number, keyshift, /*finetune,*/ bender_range; uint8 *patchpointer; uint32 pos; int i; @@ -784,7 +784,7 @@ void MidiPlayer_Midi::mapMt32ToGm(byte *data, size_t size) { group = *patchpointer; number = *(patchpointer + 1); keyshift = *(patchpointer + 2); - finetune = *(patchpointer + 3); + //finetune = *(patchpointer + 3); bender_range = *(patchpointer + 4); debugCN(kDebugLevelSound, " [%03d] ", i); diff --git a/engines/sci/sound/drivers/pcjr.cpp b/engines/sci/sound/drivers/pcjr.cpp index 063332577e..4b1efb3c87 100644 --- a/engines/sci/sound/drivers/pcjr.cpp +++ b/engines/sci/sound/drivers/pcjr.cpp @@ -27,6 +27,9 @@ #include "audio/softsynth/emumidi.h" +#include "common/debug.h" +#include "common/system.h" + namespace Sci { #define VOLUME_SHIFT 3 diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index 9ad964b67e..a2b09eab4c 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -325,14 +325,6 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { return acc; } - // If the current volume of the slot is the same as the target volume, - // return without performing any fading. This fixes the music in room - // 406 in KQ6 (bug #3267956), where the game scripts ask for the background - // music to be played, and then faded to volume 127 (but the music is - // already at volume 127) and subsequently stopped. - if (argc >= 4 && musicSlot->volume == CLIP<uint16>(argv[1].toUint16(), 0, MUSIC_VOLUME_MAX)) - return acc; - switch (argc) { case 1: // SCI0 // SCI0 fades out all the time and when fadeout is done it will also @@ -353,7 +345,25 @@ reg_t SoundCommandParser::kDoSoundFade(int argc, reg_t *argv, reg_t acc) { musicSlot->fadeStep = volume > musicSlot->fadeTo ? -5 : 5; musicSlot->fadeTickerStep = argv[2].toUint16() * 16667 / _music->soundGetTempo(); musicSlot->fadeTicker = 0; - musicSlot->stopAfterFading = (argc == 5) ? (argv[4].toUint16() != 0) : false; + + if (argc == 5) { + // TODO: We currently treat this argument as a boolean, but may + // have to handle different non-zero values differently. (e.g., + // some KQ6 scripts pass 3 here) + musicSlot->stopAfterFading = (argv[4].toUint16() != 0); + } else { + musicSlot->stopAfterFading = false; + } + + // WORKAROUND/HACK: In the labyrinth in KQ6, when falling in the pit and + // lighting the lantern, the game scripts perform a fade in of the game + // music, but set it to stop after fading. Remove that flag here. This is + // marked as both a workaround and a hack because this issue could be a + // problem with our fading code and an incorrect handling of that + // parameter, or a script bug in that scene. Fixes bug #3267956. + if (g_sci->getGameId() == GID_KQ6 && g_sci->getEngineState()->currentRoomNumber() == 406 && + musicSlot->resourceId == 400) + musicSlot->stopAfterFading = false; break; default: diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index ecdce3bd6b..debc75dffd 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -23,11 +23,10 @@ * */ -#include "common/debug.h" -#include "common/endian.h" #include "common/archive.h" #include "common/stream.h" #include "common/system.h" +#include "common/textconsole.h" #include "common/util.h" #include "graphics/surface.h" @@ -126,7 +125,7 @@ bool RobotDecoder::loadStream(Common::SeekableReadStream *stream) { readPaletteChunk(_header.paletteDataSize); readFrameSizesChunk(); calculateVideoDimensions(); - _surface->create(_width, _height, 1); + _surface->create(_width, _height, Graphics::PixelFormat::createFormatCLUT8()); return true; } diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h index 52bf0bad07..aeb638e019 100644 --- a/engines/sci/video/robot_decoder.h +++ b/engines/sci/video/robot_decoder.h @@ -32,6 +32,7 @@ #include "common/substream.h" #include "audio/audiostream.h" #include "audio/mixer.h" +#include "graphics/pixelformat.h" #include "video/video_decoder.h" namespace Sci { diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp index 0e69a9a352..7168496893 100644 --- a/engines/sci/video/seq_decoder.cpp +++ b/engines/sci/video/seq_decoder.cpp @@ -23,12 +23,10 @@ * */ -#include "common/debug.h" #include "common/endian.h" -#include "common/archive.h" #include "common/stream.h" #include "common/system.h" -#include "common/util.h" +#include "common/textconsole.h" #include "graphics/surface.h" @@ -61,7 +59,7 @@ bool SeqDecoder::loadStream(Common::SeekableReadStream *stream) { _fileStream = stream; _surface = new Graphics::Surface(); - _surface->create(SEQ_SCREEN_WIDTH, SEQ_SCREEN_HEIGHT, 1); + _surface->create(SEQ_SCREEN_WIDTH, SEQ_SCREEN_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); _frameCount = _fileStream->readUint16LE(); diff --git a/engines/sci/video/seq_decoder.h b/engines/sci/video/seq_decoder.h index 70aaa661ae..70d3985ec5 100644 --- a/engines/sci/video/seq_decoder.h +++ b/engines/sci/video/seq_decoder.h @@ -26,8 +26,18 @@ #ifndef SCI_VIDEO_SEQ_DECODER_H #define SCI_VIDEO_SEQ_DECODER_H +#include "common/rational.h" +#include "graphics/pixelformat.h" #include "video/video_decoder.h" +namespace Common { +class SeekableReadStream; +} + +namespace Graphics { +struct Surface; +} + namespace Sci { /** diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp index 861e448221..9fb76d9d63 100644 --- a/engines/scumm/charset.cpp +++ b/engines/scumm/charset.cpp @@ -401,7 +401,7 @@ int CharsetRendererClassic::getCharWidth(uint16 chr) { spacing++; } } - + } else if (chr >= 0x80) { return _vm->_2byteWidth / 2; } @@ -618,11 +618,12 @@ int CharsetRendererV3::getCharWidth(uint16 chr) { spacing = 4; } else if (chr & 0x80) { spacing = _vm->_2byteWidth / 2; - } + } } - if (!spacing) + if (!spacing) { spacing = *(_widthTable + chr); + } return spacing; } @@ -777,7 +778,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) { (ignoreCharsetMask || !vs->hasTwoBuffers)) { dst = vs->getPixels(_left, drawTop); if (charPtr) - drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->bytesPerPixel); + drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->format.bytesPerPixel); #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE else if (_vm->_cjkFont) _vm->_cjkFont->drawChar(vs, chr, _left, drawTop, _color, _shadowColor); @@ -785,7 +786,7 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) { } else { dst = (byte *)_vm->_textSurface.getBasePtr(_left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier); if (charPtr) - drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.bytesPerPixel, (_vm->_textSurfaceMultiplier == 2 && !is2byte)); + drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.format.bytesPerPixel, (_vm->_textSurfaceMultiplier == 2 && !is2byte)); #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE else if (_vm->_cjkFont) _vm->_cjkFont->drawChar(_vm->_textSurface, chr, _left * _vm->_textSurfaceMultiplier, _top * _vm->_textSurfaceMultiplier, _color, _shadowColor); @@ -834,7 +835,7 @@ void CharsetRendererV3::drawChar(int chr, Graphics::Surface &s, int x, int y) { height = 8; } dst = (byte *)s.pixels + y * s.pitch + x; - drawBits1(s, dst, charPtr, y, width, height, s.bytesPerPixel); + drawBits1(s, dst, charPtr, y, width, height, s.format.bytesPerPixel); } void CharsetRenderer::translateColor() { @@ -857,17 +858,17 @@ void CharsetRenderer::processTownsCharsetColors(uint8 bytesPerPixel) { if (_vm->_game.platform == Common::kPlatformFMTowns) { for (int i = 0; i < (1 << bytesPerPixel); i++) { uint8 c = _vm->_charsetColorMap[i]; - + if (c > 16) { uint8 t = (_vm->_currentPalette[c * 3] < 32) ? 4 : 12; t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 2 : 10); t |= ((_vm->_currentPalette[c * 3 + 1] < 32) ? 1 : 9); c = t; } - + if (c == 0) c = _vm->_townsOverrideShadowColor; - + c = ((c & 0x0f) << 4) | (c & 0x0f); _vm->_townsCharsetColorMap[i] = c; } @@ -920,12 +921,12 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) { noSjis = true; } } - + if (useTownsFontRomCharacter(chr) && !noSjis) { charPtr = 0; _vm->_cjkChar = chr; enableShadow(true); - + width = getCharWidth(chr); // For whatever reason MI1 uses a different font width // for alignment calculation and for drawing when @@ -947,7 +948,7 @@ void CharsetRendererClassic::printChar(int chr, bool ignoreCharsetMask) { height++; } } else -#endif +#endif { uint32 charOffs = READ_LE_UINT32(_fontPtr + chr * 4 + 4); assert(charOffs < 0x14000); @@ -1096,7 +1097,7 @@ void CharsetRendererClassic::printCharIntern(bool is2byte, const byte *charPtr, } else #endif if (is2byte) { - drawBits1(dstSurface, dstPtr, charPtr, drawTop, origWidth, origHeight, dstSurface.bytesPerPixel); + drawBits1(dstSurface, dstPtr, charPtr, drawTop, origWidth, origHeight, dstSurface.format.bytesPerPixel); } else { drawBitsN(dstSurface, dstPtr, charPtr, *_fontPtr, drawTop, origWidth, origHeight, _vm->_textSurfaceMultiplier == 2); } @@ -1173,7 +1174,7 @@ void CharsetRendererClassic::drawChar(int chr, Graphics::Surface &s, int x, int dst = (byte *)s.pixels + y * s.pitch + x; if (is2byte) { - drawBits1(s, dst, charPtr, y, width, height, s.bytesPerPixel); + drawBits1(s, dst, charPtr, y, width, height, s.format.bytesPerPixel); } else { drawBitsN(s, dst, charPtr, *_fontPtr, y, width, height); } @@ -1259,14 +1260,14 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE byte *dst3 = dst2; byte *dst4 = dst2; - if (scale2x) { + if (scale2x) { dst3 = dst2 + s.pitch; dst4 = dst3 + s.pitch; pitch <<= 1; } if (_vm->_game.platform == Common::kPlatformFMTowns && _vm->_game.version == 5) col = _vm->_townsCharsetColorMap[1]; -#endif +#endif for (y = 0; y < height && y + drawTop < s.h; y++) { for (x = 0; x < width; x++) { @@ -1287,19 +1288,19 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con if (scale2x) { dst[2] = dst[3] = dst2[2] = dst2[3] = _shadowColor; dst3[0] = dst4[0] = dst3[1] = dst4[1] = _shadowColor; - } else + } else #endif { dst[1] = dst2[0] = _shadowColor; if (_shadowMode != kFMTOWNSShadowMode) dst2[1] = _shadowColor; - } + } } dst[0] = col; #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (scale2x) - dst[1] = dst2[0] = dst2[1] = col; + dst[1] = dst2[0] = dst2[1] = col; #endif } } @@ -1317,7 +1318,7 @@ void CharsetRendererCommon::drawBits1(const Graphics::Surface &s, byte *dst, con dst += pitch; dst2 += pitch; -#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE +#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE dst3 += pitch; dst4 += pitch; #endif @@ -1519,10 +1520,10 @@ void CharsetRendererNES::printChar(int chr, bool ignoreCharsetMask) { if (ignoreCharsetMask || !vs->hasTwoBuffers) { dst = vs->getPixels(_left, drawTop); - drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->bytesPerPixel); + drawBits1(*vs, dst, charPtr, drawTop, origWidth, origHeight, vs->format.bytesPerPixel); } else { dst = (byte *)_vm->_textSurface.pixels + _top * _vm->_textSurface.pitch + _left; - drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.bytesPerPixel); + drawBits1(_vm->_textSurface, dst, charPtr, drawTop, origWidth, origHeight, _vm->_textSurface.format.bytesPerPixel); } if (_str.left > _left) @@ -1552,7 +1553,7 @@ void CharsetRendererNES::drawChar(int chr, Graphics::Surface &s, int x, int y) { height = 8; dst = (byte *)s.pixels + y * s.pitch + x; - drawBits1(s, dst, charPtr, y, width, height, s.bytesPerPixel); + drawBits1(s, dst, charPtr, y, width, height, s.format.bytesPerPixel); } void CharsetRendererNES::drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height, uint8 bitDepth, bool scalex) { diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index bb3c4bcc02..820605924c 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -385,7 +385,7 @@ void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) { s.pitch = s.w; // s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917 assert(s.w <= 16 && s.h <= 17); - s.bytesPerPixel = 1; + s.format = Graphics::PixelFormat::createFormatCLUT8(); _charset->drawChar(chr, s, 0, 0); diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 63188c1d7a..4c1942b865 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -23,7 +23,6 @@ * */ -#include "common/config-manager.h" #include "common/debug-channels.h" #include "common/file.h" #include "common/str.h" diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 6db3ea740a..51b46b033c 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -23,6 +23,9 @@ * */ +// FIXME: Avoid using printf +#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include "base/plugins.h" #include "common/archive.h" @@ -1131,6 +1134,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co break; case 62: case 61: + case 60: *engine = new ScummEngine_v60he(syst, res); break; default: diff --git a/engines/scumm/detection_tables.h b/engines/scumm/detection_tables.h index a5542ca868..952abdb39a 100644 --- a/engines/scumm/detection_tables.h +++ b/engines/scumm/detection_tables.h @@ -372,7 +372,7 @@ static const GameSettings gameVariantsTable[] = { {"arttime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, {"baseball2001", 0, 0, GID_BASEBALL2001, 6, 99, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, {"readtime", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, - {"SoccerMLS", 0, 0, GID_SOCCER, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, + {"SoccerMLS", 0, 0, GID_SOCCERMLS, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, {"spyozon", 0, 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, {"freddicove", "", 0, GID_HEGAME, 6, 99, MDT_NONE, GF_USE_KEY | GF_HE_LOCALIZED | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, @@ -386,7 +386,7 @@ static const GameSettings gameVariantsTable[] = { {"Baseball2003", 0, 0, GID_HEGAME, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, {"basketball", 0, 0, GID_BASKETBALL, 6, 100, MDT_NONE, GF_USE_KEY| GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, {"football2002", 0, 0, GID_FOOTBALL, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, - {"Soccer2004", 0, 0, GID_SOCCER, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, + {"Soccer2004", 0, 0, GID_SOCCER2004, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, // U32 code required, for testing only {"moonbase", 0, 0, GID_MOONBASE, 6, 100, MDT_NONE, GF_USE_KEY | GF_16BIT_COLOR, UNK, GUIO_NOLAUNCHLOAD | GUIO_NOMIDI}, @@ -483,6 +483,7 @@ static const GameFilenamePattern gameFilenamesTable[] = { #ifdef ENABLE_SCUMM_7_8 { "dig", "dig.la%d", kGenDiskNum, UNK_LANG, UNK, 0 }, + { "dig", "thedig.la%d", kGenDiskNum, UNK_LANG, UNK, "Demo" }, // Used by an alternate version of the demo { "dig", "The Dig Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, 0 }, { "dig", "The Dig Demo Data", kGenUnchanged, UNK_LANG, Common::kPlatformMacintosh, "Demo" }, diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h index 0e6e18905f..40e549471b 100644 --- a/engines/scumm/dialogs.h +++ b/engines/scumm/dialogs.h @@ -33,8 +33,8 @@ #include "scumm/detection.h" namespace GUI { - class ListWidget; - class CommandSender; +class ListWidget; +class CommandSender; } diff --git a/engines/scumm/file_nes.cpp b/engines/scumm/file_nes.cpp index d9d84f04ff..47704d6eaf 100644 --- a/engines/scumm/file_nes.cpp +++ b/engines/scumm/file_nes.cpp @@ -28,6 +28,7 @@ #include "common/endian.h" #include "common/md5.h" #include "common/memstream.h" +#include "common/textconsole.h" namespace Scumm { diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp index 80c13d30e3..e7abd5610e 100644 --- a/engines/scumm/gfx.cpp +++ b/engines/scumm/gfx.cpp @@ -391,8 +391,11 @@ void ScummEngine::initVirtScreen(VirtScreenNumber slot, int top, int width, int vs->hasTwoBuffers = twobufs; vs->xstart = 0; vs->backBuf = NULL; - vs->bytesPerPixel = (_game.features & GF_16BIT_COLOR) ? 2 : 1; - vs->pitch = width * vs->bytesPerPixel; + if (_game.features & GF_16BIT_COLOR) + vs->format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); + else + vs->format = Graphics::PixelFormat::createFormatCLUT8(); + vs->pitch = width * vs->format.bytesPerPixel; if (_game.version >= 7) { // Increase the pitch by one; needed to accomodate the extra screen @@ -628,7 +631,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i int m = _textSurfaceMultiplier; int vsPitch; int pitch = vs->pitch; - vsPitch = vs->pitch - width * vs->bytesPerPixel; + vsPitch = vs->pitch - width * vs->format.bytesPerPixel; if (_game.version < 7) { @@ -673,7 +676,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i } else { WRITE_UINT16(dstPtr, _16BitPalette[tmp]); dstPtr += 2; } - srcPtr += vs->bytesPerPixel; + srcPtr += vs->format.bytesPerPixel; } srcPtr += vsPitch; textPtr += _textSurface.pitch - width * m; @@ -712,7 +715,7 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i } #endif src = _compositeBuf; - pitch = width * vs->bytesPerPixel; + pitch = width * vs->format.bytesPerPixel; if (_renderMode == Common::kRenderHercA || _renderMode == Common::kRenderHercG) { ditherHerc(_compositeBuf, _herculesBuf, width, &x, &y, &width, &height); @@ -1042,17 +1045,17 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) { return; if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) { - blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height, vs->bytesPerPixel); + blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height, vs->format.bytesPerPixel); if (vs->number == kMainVirtScreen && _charset->_hasMask) { #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns) { byte *mask = (byte *)_textSurface.getBasePtr(rect.left * _textSurfaceMultiplier, (rect.top + vs->topline) * _textSurfaceMultiplier); - fill(mask, _textSurface.pitch, 0, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel); + fill(mask, _textSurface.pitch, 0, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); } else #endif { byte *mask = (byte *)_textSurface.getBasePtr(rect.left, rect.top - _screenTop); - fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel); + fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); } } } else { @@ -1060,14 +1063,14 @@ void ScummEngine::restoreBackground(Common::Rect rect, byte backColor) { if (_game.platform == Common::kPlatformFMTowns) { backColor |= (backColor << 4); byte *mask = (byte *)_textSurface.getBasePtr(rect.left * _textSurfaceMultiplier, (rect.top + vs->topline) * _textSurfaceMultiplier); - fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel); + fill(mask, _textSurface.pitch, backColor, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); } #endif if (_game.features & GF_16BIT_COLOR) - fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->bytesPerPixel); + fill(screenBuf, vs->pitch, _16BitPalette[backColor], width, height, vs->format.bytesPerPixel); else - fill(screenBuf, vs->pitch, backColor, width, height, vs->bytesPerPixel); + fill(screenBuf, vs->pitch, backColor, width, height, vs->format.bytesPerPixel); } } @@ -1096,7 +1099,7 @@ void ScummEngine::restoreCharsetBg() { if (vs->number != kMainVirtScreen) { // Restore from back buffer const byte *backBuf = vs->getBackPixels(0, 0); - blit(screenBuf, vs->pitch, backBuf, vs->pitch, vs->w, vs->h, vs->bytesPerPixel); + blit(screenBuf, vs->pitch, backBuf, vs->pitch, vs->w, vs->h, vs->format.bytesPerPixel); } } else { // Clear area @@ -1124,7 +1127,7 @@ void ScummEngine::clearTextSurface() { #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE _game.platform == Common::kPlatformFMTowns ? 0 : #endif - CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.bytesPerPixel); + CHARSET_MASK_TRANSPARENCY, _textSurface.w, _textSurface.h, _textSurface.format.bytesPerPixel); } byte *ScummEngine::getMaskBuffer(int x, int y, int z) { @@ -1297,56 +1300,56 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) { if (vs->number != kMainVirtScreen) error("can only copy bg to main window"); - blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel); + blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->format.bytesPerPixel); if (_charset->_hasMask) { byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop) * _textSurfaceMultiplier); - fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel); + fill(mask, _textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); } } } else if (_game.heversion >= 72) { // Flags are used for different methods in HE games uint32 flags = color; if ((flags & 0x2000) || (flags & 0x4000000)) { - blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel); + blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->format.bytesPerPixel); } else if ((flags & 0x4000) || (flags & 0x2000000)) { - blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->bytesPerPixel); + blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->format.bytesPerPixel); } else if ((flags & 0x8000) || (flags & 0x1000000)) { flags &= (flags & 0x1000000) ? 0xFFFFFF : 0x7FFF; - fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel); - fill(bgbuff, vs->pitch, flags, width, height, vs->bytesPerPixel); + fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel); + fill(bgbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel); } else { - fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel); + fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel); } } else if (_game.heversion >= 60) { // Flags are used for different methods in HE games uint16 flags = color; if (flags & 0x2000) { - blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->bytesPerPixel); + blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height, vs->format.bytesPerPixel); } else if (flags & 0x4000) { - blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->bytesPerPixel); + blit(bgbuff, vs->pitch, backbuff, vs->pitch, width, height, vs->format.bytesPerPixel); } else if (flags & 0x8000) { flags &= 0x7FFF; - fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel); - fill(bgbuff, vs->pitch, flags, width, height, vs->bytesPerPixel); + fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel); + fill(bgbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel); } else { - fill(backbuff, vs->pitch, flags, width, height, vs->bytesPerPixel); + fill(backbuff, vs->pitch, flags, width, height, vs->format.bytesPerPixel); } } else { if (_game.features & GF_16BIT_COLOR) { - fill(backbuff, vs->pitch, _16BitPalette[color], width, height, vs->bytesPerPixel); + fill(backbuff, vs->pitch, _16BitPalette[color], width, height, vs->format.bytesPerPixel); } else { #ifndef DISABLE_TOWNS_DUAL_LAYER_MODE if (_game.platform == Common::kPlatformFMTowns) { color = ((color & 0x0f) << 4) | (color & 0x0f); byte *mask = (byte *)_textSurface.getBasePtr(x * _textSurfaceMultiplier, (y - _screenTop + vs->topline) * _textSurfaceMultiplier); - fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.bytesPerPixel); + fill(mask, _textSurface.pitch, color, width * _textSurfaceMultiplier, height * _textSurfaceMultiplier, _textSurface.format.bytesPerPixel); if (_game.id == GID_MONKEY2 || _game.id == GID_INDY4 || ((_game.id == GID_INDY3 || _game.id == GID_ZAK) && vs->number != kTextVirtScreen) || (_game.id == GID_LOOM && vs->number == kMainVirtScreen)) return; } #endif - fill(backbuff, vs->pitch, color, width, height, vs->bytesPerPixel); + fill(backbuff, vs->pitch, color, width, height, vs->format.bytesPerPixel); } } } @@ -1385,7 +1388,7 @@ void ScummEngine_v5::drawFlashlight() { _flashlight.y, _flashlight.y + _flashlight.h, USAGE_BIT_DIRTY); if (_flashlight.buffer) { - fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h, vs->bytesPerPixel); + fill(_flashlight.buffer, vs->pitch, 0, _flashlight.w, _flashlight.h, vs->format.bytesPerPixel); } _flashlight.isDrawn = false; } @@ -1432,20 +1435,20 @@ void ScummEngine_v5::drawFlashlight() { _flashlight.buffer = vs->getPixels(_flashlight.x, _flashlight.y); bgbak = vs->getBackPixels(_flashlight.x, _flashlight.y); - blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->bytesPerPixel); + blit(_flashlight.buffer, vs->pitch, bgbak, vs->pitch, _flashlight.w, _flashlight.h, vs->format.bytesPerPixel); // Round the corners. To do so, we simply hard-code a set of nicely // rounded corners. static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 }; int minrow = 0; - int maxcol = (_flashlight.w - 1) * vs->bytesPerPixel; + int maxcol = (_flashlight.w - 1) * vs->format.bytesPerPixel; int maxrow = (_flashlight.h - 1) * vs->pitch; for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) { int d = corner_data[i]; for (j = 0; j < d; j++) { - if (vs->bytesPerPixel == 2) { + if (vs->format.bytesPerPixel == 2) { WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0); WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0); WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0); @@ -1761,7 +1764,7 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const } #endif - _vertStripNextInc = height * vs->pitch - 1 * vs->bytesPerPixel; + _vertStripNextInc = height * vs->pitch - 1 * vs->format.bytesPerPixel; _objectMode = (flag & dbObjectMode) == dbObjectMode; prepareDrawBitmap(ptr, vs, x, y, width, height, stripnr, numstrip); @@ -1794,9 +1797,9 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const // In the case of a double buffered virtual screen, we draw to // the backbuffer, otherwise to the primary surface memory. if (vs->hasTwoBuffers) - dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->bytesPerPixel); + dstPtr = vs->backBuf + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel); else - dstPtr = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->bytesPerPixel); + dstPtr = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel); transpStrip = drawStrip(dstPtr, vs, x, y, width, height, stripnr, smap_ptr); @@ -1805,11 +1808,11 @@ void Gdi::drawBitmap(const byte *ptr, VirtScreen *vs, int x, const int y, const transpStrip = true; if (vs->hasTwoBuffers) { - byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->bytesPerPixel); + byte *frontBuf = (byte *)vs->pixels + y * vs->pitch + (x * 8 * vs->format.bytesPerPixel); if (lightsOn) - copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->bytesPerPixel); + copy8Col(frontBuf, vs->pitch, dstPtr, height, vs->format.bytesPerPixel); else - clear8Col(frontBuf, vs->pitch, height, vs->bytesPerPixel); + clear8Col(frontBuf, vs->pitch, height, vs->format.bytesPerPixel); } decodeMask(x, y, width, height, stripnr, numzbuf, zplane_list, transpStrip, flag, tmsk_ptr); @@ -2045,7 +2048,7 @@ void Gdi::drawBMAPBg(const byte *ptr, VirtScreen *vs) { drawStripHE(dst, vs->pitch, bmap_ptr, vs->w, vs->h, true); break; case 150: - fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h, vs->bytesPerPixel); + fill(dst, vs->pitch, *bmap_ptr, vs->w, vs->h, vs->format.bytesPerPixel); break; default: // Alternative russian freddi3 uses badly formatted bitmaps @@ -2156,7 +2159,7 @@ void ScummEngine_v70he::restoreBackgroundHE(Common::Rect rect, int dirtybit) { assert(rw <= _screenWidth && rw > 0); assert(rh <= _screenHeight && rh > 0); - blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh, vs->bytesPerPixel); + blit(dst, _virtscr[kMainVirtScreen].pitch, src, _virtscr[kMainVirtScreen].pitch, rw, rh, vs->format.bytesPerPixel); markRectAsDirty(kMainVirtScreen, rect, dirtybit); } #endif @@ -2186,15 +2189,15 @@ void Gdi::resetBackground(int top, int bottom, int strip) { if (bottom > vs->bdirty[strip]) vs->bdirty[strip] = bottom; - bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->bytesPerPixel; - backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->bytesPerPixel; + bgbak_ptr = (byte *)vs->backBuf + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel; + backbuff_ptr = (byte *)vs->pixels + top * vs->pitch + (strip + vs->xstart/8) * 8 * vs->format.bytesPerPixel; numLinesToProcess = bottom - top; if (numLinesToProcess) { if (_vm->isLightOn()) { - copy8Col(backbuff_ptr, vs->pitch, bgbak_ptr, numLinesToProcess, vs->bytesPerPixel); + copy8Col(backbuff_ptr, vs->pitch, bgbak_ptr, numLinesToProcess, vs->format.bytesPerPixel); } else { - clear8Col(backbuff_ptr, vs->pitch, numLinesToProcess, vs->bytesPerPixel); + clear8Col(backbuff_ptr, vs->pitch, numLinesToProcess, vs->format.bytesPerPixel); } } } diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h index c6062ef9be..3f69d75efd 100644 --- a/engines/scumm/gfx.h +++ b/engines/scumm/gfx.h @@ -158,11 +158,11 @@ struct VirtScreen : Graphics::Surface { } byte *getPixels(int x, int y) const { - return (byte *)pixels + y * pitch + (xstart + x) * bytesPerPixel; + return (byte *)pixels + y * pitch + (xstart + x) * format.bytesPerPixel; } byte *getBackPixels(int x, int y) const { - return (byte *)backBuf + y * pitch + (xstart + x) * bytesPerPixel; + return (byte *)backBuf + y * pitch + (xstart + x) * format.bytesPerPixel; } }; diff --git a/engines/scumm/gfx_towns.cpp b/engines/scumm/gfx_towns.cpp index abf2da63a6..78c7ef23f1 100644 --- a/engines/scumm/gfx_towns.cpp +++ b/engines/scumm/gfx_towns.cpp @@ -48,7 +48,7 @@ void ScummEngine::towns_drawStripToScreen(VirtScreen *vs, int dstX, int dstY, in int dp1 = _townsScreen->getLayerPitch(0) - width * _townsScreen->getLayerBpp(0); int dp2 = _townsScreen->getLayerPitch(1) - width * m * _townsScreen->getLayerBpp(1); - int sp1 = vs->pitch - (width * vs->bytesPerPixel); + int sp1 = vs->pitch - (width * vs->format.bytesPerPixel); int sp2 = _textSurface.pitch - width * m; if (vs->number == kMainVirtScreen || _game.id == GID_INDY3 || _game.id == GID_ZAK) { diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index a16af73135..5cd75a5c62 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -30,6 +30,7 @@ #include "audio/audiostream.h" #include "audio/mixer.h" #include "audio/decoders/raw.h" +#include "graphics/palette.h" #include "scumm/scumm.h" #include "scumm/util.h" #include "scumm/he/intern_he.h" diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index 0f2d232179..297c2992db 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -823,12 +823,18 @@ int LogicHEsoccer::versionID() { } LogicHEsoccer::LogicHEsoccer(ScummEngine_v90he *vm) : LogicHE(vm) { - _userData = (byte *)calloc(6921, 1); // Allocate user data - _userDataD = (double *)_userData; + _userDataD = (double *)calloc(1732, sizeof(double)); + _intArray1 = 0; + _intArray2 = 0; + _intArraysAllocated = false; + _array1013 = 0; + _array1013Allocated = false; } LogicHEsoccer::~LogicHEsoccer() { - free(_userData); + free(_userDataD); + op_1020(); // clear int arrays + delete[] _array1013; } int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) { @@ -853,6 +859,8 @@ int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) { case 1011: // args[4] is ignored! + // soccer passes the argument, but then ends up not using it + // Makes sense that they removed it for soccermls res = op_1011(args[0], args[1], args[2], args[3], args[5]); break; @@ -864,10 +872,18 @@ int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) { res = op_1013(args[0], args[1], args[2]); break; + case 1019: + res = op_1019(args); + break; + case 1020: res = op_1020(); break; + case 1021: + res = op_1021(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + break; + case 8221968: // Someone had a fun and used his birthday as opcode number res = getFromArray(args[0], args[1], args[2]); @@ -882,7 +898,7 @@ int32 LogicHEsoccer::dispatch(int op, int numArgs, int32 *args) { } void LogicHEsoccer::beforeBootScript() { - if (_userData[6869]) + if (_intArraysAllocated) op_1020(); _userDataD[530] = 0; @@ -890,7 +906,7 @@ void LogicHEsoccer::beforeBootScript() { void LogicHEsoccer::initOnce() { // The original sets some paths here that we don't need to worry about - _userData[6881] = 0; + _array1013Allocated = false; _userDataD[530] = 0; } @@ -899,6 +915,8 @@ int LogicHEsoccer::startOfFrame() { int res = (int)_userDataD[530]; // _userDataD[535] is not used! + // soccer passes the argument, but then ends up not using it + // Makes sense that they removed it for soccermls if (res) res = op_1011((int)_userDataD[531], (int)_userDataD[532], (int)_userDataD[533], (int)_userDataD[534], (int)_userDataD[536]); @@ -968,11 +986,11 @@ int LogicHEsoccer::op_1006(int32 a1, int32 a2, int32 a3, int32 a4) { } int LogicHEsoccer::op_1007(int32 *args) { - // TODO: Used when the HE logo is shown + // Used when the HE logo is shown // This initializes the _userDataD fields that are used in op_1006/op_1011 + _intArraysAllocated = false; double v14 = (double)args[0] * 0.01; - _userData[6873] = 0; double v13 = (double)args[2] * 0.01; _userDataD[524] = v14; double v12 = atan2(v13, v14); @@ -990,25 +1008,20 @@ int LogicHEsoccer::op_1007(int32 *args) { _userDataD[523] = _userDataD[527] / _userDataD[519]; _userDataD[518] = v13; - *((uint32 *)_userData[6857]) = 0; - memset(_userData + 2737, 0, 4 * 1024); - for (int i = 0; i < 146; i++) - _userDataD[538 + i] = 0; - _userData[2736] = 0; + // Clear both byte arrays + memset(_byteArray1, 0, 4096); + memset(_byteArray2, 0, 585); - if (*((uint32 *)_userData[6885]) == 0 ) + if (_array1013Allocated == 0 ) op_1013(4, args[8], args[9]); return 1; } -#if 0 -// TODO: Used by several opcodes // Returns the square root of the sum of the squares of the arguments -static inline double fsqrtSquare(double a1, double a2, double a3) { +static inline double sqrtSquare(double a1, double a2, double a3) { return sqrt(a1 * a1 + a2 * a2 + a3 * a3); -} -#endif +} int LogicHEsoccer::op_1008(int32 *args) { // TODO: Used during a match (kicking?) @@ -1020,7 +1033,7 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5) { // This is called on each frame by startOfFrame() if activated by op_1012. // This seems to do player placement! - float v28; + float v28 = 0.0; for (int i = 0; i < 18; i++) { // These seem to be some sort of percent? of angles? @@ -1060,15 +1073,15 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5) { putInArray(a5, 0, i, v24 + 11 * v21); } - float v7 = atan2(_userDataD[524] - v28, v31); + float v7 = atan2(_userDataD[524] - v28, (double)v31); int v8 = (int)(_userDataD[526] - (_userDataD[521] - v7) * _userDataD[522] + 300.0); - double v9 = atan2(_userDataD[523], v31); + double v9 = atan2(_userDataD[523], (double)v31); // x/y position? putInArray(a2, i, 0, (int32)(v29 * v9 + 640.0)); putInArray(a2, i, 1, v8); - double v10 = atan2(_userDataD[524], v31); + double v10 = atan2(_userDataD[524], (double)v31); int v12 = (int)(_userDataD[526] - (_userDataD[521] - (float)v10) * _userDataD[522] + 300.0); double v13 = _userDataD[523]; @@ -1078,7 +1091,12 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5) { putInArray(a2, i + 22, 1, v12); } - for (int i = 18; i < 22; i++) { + // soccer only uses one array here + // soccermls/soccer2004 use four + int start = (_vm->_game.id == GID_SOCCER) ? 19 : 18; + int end = (_vm->_game.id == GID_SOCCER) ? 19 : 21; + + for (int i = start; i <= end; i++) { int v14 = getFromArray(a2, i, 0); int v15 = getFromArray(a2, i, 1); @@ -1131,10 +1149,6 @@ void LogicHEsoccer::op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4) { } } - int v9 = getFromArray(a1, 20, 0); - int v10 = getFromArray(a1, 20, 2); - int v11 = getFromArray(a1, 21, 0); - int v12 = getFromArray(a1, 21, 2); int v13 = getFromArray(a1, 18, 0); int v14 = getFromArray(a1, 18, 2); int v15 = getFromArray(a1, 19, 0); @@ -1142,14 +1156,29 @@ void LogicHEsoccer::op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4) { int v19[15]; int v20[15]; - for (int i = 0; i < 6; i++) { - v20[i] = distance(v9, v7[i], v10, v8[i]); - v19[i] = distance(v13, v7[i], v14, v8[i]); - } + if (_vm->_game.id == GID_SOCCER) { + // soccer gets to be different + for (int i = 0; i < 13; i++) + v20[i] = distance(v13, v7[i], v14, v8[i]); + + for (int i = 0; i < 13; i++) + v19[i] = distance(v15, v7[i], v16, v8[i]); + } else { + // soccermls and soccer2004 use two other arrays here + int v9 = getFromArray(a1, 20, 0); + int v10 = getFromArray(a1, 20, 2); + int v11 = getFromArray(a1, 21, 0); + int v12 = getFromArray(a1, 21, 2); + + for (int i = 0; i < 6; i++) { + v20[i] = distance(v9, v7[i], v10, v8[i]); + v19[i] = distance(v13, v7[i], v14, v8[i]); + } - for (int i = 6; i < 13; i++) { - v20[i] = distance(v11, v7[i], v12, v8[i]); - v19[i] = distance(v15, v7[i], v16, v8[i]); + for (int i = 6; i < 13; i++) { + v20[i] = distance(v11, v7[i], v12, v8[i]); + v19[i] = distance(v15, v7[i], v16, v8[i]); + } } for (int i = 0; i < 13; i++) { @@ -1164,6 +1193,7 @@ void LogicHEsoccer::op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4) { int LogicHEsoccer::op_1012(int32 *args) { // Used after op_1019 // This function activates startOfFrame() to call op_1011 + // (Possibly field parameters?) _userDataD[530] = (args[0] != 0) ? 1 : 0; _userDataD[531] = args[1]; @@ -1176,8 +1206,6 @@ int LogicHEsoccer::op_1012(int32 *args) { return 1; } -#if 0 -// TODO: Used by op_1013 // Some strange power operation, ignores negative exponents static inline double u32Pow(float a1, int a2) { if (a2 < 0) @@ -1190,34 +1218,126 @@ static inline double u32Pow(float a1, int a2) { return v4; } -#endif + +int LogicHEsoccer::op_sub5(int a1, int a2, int a3) { + byte *v9 = _array1013 + 44 * a2; + + *((uint32 *)v9 + 4) = a3; + *((uint32 *)v9) = a2; + + if (a1 > 2) { + // Casual observation: 585 is also the size of _byteArray2 + *((uint32 *)v9 + 40) = 8 * a2 - 585; + for (int i = 0; i < 8; i++) + *((uint32 *)v9 + 4 * i + 8) = 0xffffffff; + } else { + for (int i = 0; i < 8; i++) + *((uint32 *)v9 + 4 * i + 8) = op_sub5(a1 + 1, i + 8 * a2 + 1, a2); + } + + return a2; +} int LogicHEsoccer::op_1013(int32 a1, int32 a2, int32 a3) { - // TODO: Called by op_1007 + // Creates _array1013 for *some* purpose + // _array1013Temp is used again op_1014 for some reason... + // Seems to be used in op_1015 + + int v4 = (int)((1.0 - u32Pow(8.0, 4)) / -7.0); + + _array1013 = new byte[v4 * 44]; + memset(_array1013, 0, v4 * 44); + _array1013Allocated = true; + memset(_array1013Temp, 0, 44); + + for (int i = 0; i < 8; i++) + _array1013Temp[i + 2] = op_sub5(1, i + 1, 0); + + // Yes, this is not endian-safe, but should not matter since we're + // not saving/loading the data anywhere + memcpy(_array1013, _array1013Temp, 44); return 1; } -int LogicHEsoccer::op_1014(int32 *args) { +int LogicHEsoccer::op_1014(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7, int32 a8, int32 a9, int32 a10, int32 a11, int32 a12, int32 a13, int32 a14) { // TODO: Used many times during a match + // And called from op_1008! return 1; } int LogicHEsoccer::op_1019(int32 *args) { - // TODO: Used at the beginning of a match + // Used at the beginning of a match + // Initializes some arrays. Player positions? + + // These two arrays are used in op_1014 and op_1015 + for (int i = 0; i < 4096; i++) + _byteArray1[i] = getFromArray(args[1], 0, i); + + for (int i = 0; i < 585; i++) + _byteArray2[i] = getFromArray(args[0], 0, i); + + // Deallocate the two integer arrays + if (_intArraysAllocated) + op_1020(); + + // Reallocate them + _intArray1 = new uint32[1008]; + _intArray2 = new uint32[168]; + _intArraysAllocated = true; + + memset(_intArray1, 0, 4 * 4); + memset(_intArray2, 0, 24 * 4); + + // These two arrays are used in op_1015 + for (int i = 0; i < 42; i++) { + for (int j = 0; j < 24; j++) + _intArray1[j + 24 * i] = getFromArray(args[3], 0, j + 24 * i); + + for (int j = 0; j < 4; j++) + _intArray2[j + 4 * i] = getFromArray(args[2], 0, j + 4 * i); + } return 1; } int LogicHEsoccer::op_1020() { - // TODO: Called by several other opcodes. Possibly "stop play"? + // Deallocate integer arrays + // The arrays can be allocated in op_1015 or op_1019 + + delete[] _intArray1; _intArray1 = 0; + delete[] _intArray2; _intArray2 = 0; + _intArraysAllocated = false; return 1; } -int LogicHEsoccer::op_1021(int32 *args) { - // TODO: Used during a match (ball movement?) +int LogicHEsoccer::op_1021(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7) { + // Used during a match (ball movement?) + // Also called from op_1008 + + int v10; + if (a4 && a5) + v10 = (int)(((double)a2 - (double)a5 * (double)a1 / (double)a4) * -1.0 * (double)a4 / (double)a5); + else + v10 = a1; + + int v9; + if (a6 && a5) + v9 = (int)(((double)a2 - (double)a5 * (double)a3 / (double)a6) * -1.0 * (double)a6 / (double)a5); + else + v9 = a3; + + // The final argument chooses whether to store the results for op_1008 or + // store them in SCUMM variables. + if (a7) { + _var1021[0] = v10; + _var1021[1] = v9; + } else { + writeScummVar(108, v10); + writeScummVar(109, v9); + } return 1; } diff --git a/engines/scumm/he/logic_he.h b/engines/scumm/he/logic_he.h index c2ea2b8ec6..d097d37e75 100644 --- a/engines/scumm/he/logic_he.h +++ b/engines/scumm/he/logic_he.h @@ -111,7 +111,6 @@ private: class LogicHEsoccer : public LogicHE { private: - byte *_userData; double *_userDataD; public: @@ -130,21 +129,38 @@ private: int op_1002(int32 *args); int op_1003(int32 *args); int op_1004(int32 *args); - // op_1006 can be called from other opcodes! int op_1006(int32 a1, int32 a2, int32 a3, int32 a4); int op_1007(int32 *args); int op_1008(int32 *args); - // op_1011 can be called from other opcodes! int op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5); - void op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4); int op_1012(int32 *args); - // op_1013 can be called from other opcodes! int op_1013(int32 a1, int32 a2, int32 a3); - int op_1014(int32 *args); + int op_1014(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7, int32 a8, int32 a9, int32 a10, int32 a11, int32 a12, int32 a13, int32 a14); int op_1019(int32 *args); - // op_1020 can be called from other opcodes! int op_1020(); - int op_1021(int32 *args); + int op_1021(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int32 a6, int32 a7); + + // Two integer arrays are used between some functions + // Originally, these pointers were in _userData, but we keep them separate + // Also, doing it that would break things on non 32-bit systems... + bool _intArraysAllocated; + uint32 *_intArray1, *_intArray2; + + // op_1007 allocates some arrays + // they're then filled by op_1019 + byte _byteArray1[4096], _byteArray2[585]; + + // op_1011 has a subfunction + void op_1011_sub(int32 a1, int32 a2, int32 a3, int32 a4); + + // op_1013 creates some array, purpose unknown + bool _array1013Allocated; + byte *_array1013; + uint32 _array1013Temp[11]; + int op_sub5(int a1, int a2, int a3); + + // op_1021 can (optionally) set two variables for use in op_1008 + uint32 _var1021[2]; }; class LogicHEbaseball2001 : public LogicHE { diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp index 7f517c56ed..49e43a040b 100644 --- a/engines/scumm/he/palette_he.cpp +++ b/engines/scumm/he/palette_he.cpp @@ -26,6 +26,7 @@ #ifdef ENABLE_HE #include "common/system.h" +#include "graphics/palette.h" #include "scumm/scumm.h" #include "scumm/he/intern_he.h" #include "scumm/resource.h" diff --git a/engines/scumm/imuse/imuse_part.cpp b/engines/scumm/imuse/imuse_part.cpp index 40889ec24f..487429c294 100644 --- a/engines/scumm/imuse/imuse_part.cpp +++ b/engines/scumm/imuse/imuse_part.cpp @@ -25,6 +25,8 @@ +#include "common/debug.h" +#include "common/textconsole.h" #include "common/util.h" #include "scumm/imuse/imuse_internal.h" #include "scumm/saveload.h" diff --git a/engines/scumm/imuse/sysex_scumm.cpp b/engines/scumm/imuse/sysex_scumm.cpp index c96b2f757b..78028c6056 100644 --- a/engines/scumm/imuse/sysex_scumm.cpp +++ b/engines/scumm/imuse/sysex_scumm.cpp @@ -24,6 +24,7 @@ #include "common/endian.h" +#include "common/textconsole.h" #include "common/util.h" /* diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index 236edb5a89..1e96aa8827 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -26,6 +26,8 @@ #define SCUMM_IMUSE_DIGI_H #include "common/scummsys.h" +#include "common/mutex.h" +#include "common/textconsole.h" #include "common/util.h" #include "scumm/imuse_digi/dimuse.h" diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp index e737d747ac..be77e4fd66 100644 --- a/engines/scumm/midiparser_ro.cpp +++ b/engines/scumm/midiparser_ro.cpp @@ -26,6 +26,7 @@ #include "audio/midiparser.h" #include "audio/mididrv.h" +#include "common/textconsole.h" #include "common/util.h" namespace Scumm { diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index e81212fec8..b0786c924d 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -23,8 +23,11 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "common/util.h" +#include "graphics/palette.h" + #include "scumm/resource.h" #include "scumm/scumm.h" #include "scumm/scumm_v6.h" diff --git a/engines/scumm/player_mod.h b/engines/scumm/player_mod.h index 67d1bb4cbf..3f97c4cab9 100644 --- a/engines/scumm/player_mod.h +++ b/engines/scumm/player_mod.h @@ -31,7 +31,7 @@ #include "audio/mixer.h" namespace Audio { - class RateConverter; +class RateConverter; } namespace Scumm { diff --git a/engines/scumm/player_nes.h b/engines/scumm/player_nes.h index 5f6e8f2d8d..402eea7bf8 100644 --- a/engines/scumm/player_nes.h +++ b/engines/scumm/player_nes.h @@ -35,7 +35,7 @@ namespace Scumm { class ScummEngine; namespace APUe { - class APU; +class APU; } static const int MAXVOLUME = 0x7F; diff --git a/engines/scumm/player_pce.h b/engines/scumm/player_pce.h index 3f5033f724..42153e8abc 100644 --- a/engines/scumm/player_pce.h +++ b/engines/scumm/player_pce.h @@ -27,6 +27,7 @@ #define SCUMM_PLAYER_PCE_H #include "common/scummsys.h" +#include "common/mutex.h" #include "scumm/music.h" #include "audio/audiostream.h" #include "audio/mixer.h" diff --git a/engines/scumm/player_sid.cpp b/engines/scumm/player_sid.cpp index 0d5832a5fb..11468f3097 100644 --- a/engines/scumm/player_sid.cpp +++ b/engines/scumm/player_sid.cpp @@ -1296,7 +1296,7 @@ int Player_SID::readBuffer(int16 *buffer, const int numSamples) { _cpuCyclesLeft = timingProps[_videoSystem].cyclesPerFrame; } // fetch samples - int sampleCount = _sid->clock(_cpuCyclesLeft, (short*)buffer, samplesLeft); + int sampleCount = _sid->updateClock(_cpuCyclesLeft, (short*)buffer, samplesLeft); samplesLeft -= sampleCount; buffer += sampleCount; } diff --git a/engines/scumm/player_v4a.h b/engines/scumm/player_v4a.h index 108dbcf317..458a39b5fe 100644 --- a/engines/scumm/player_v4a.h +++ b/engines/scumm/player_v4a.h @@ -27,6 +27,7 @@ #define SCUMM_PLAYER_V4A_H #include "common/scummsys.h" +#include "common/util.h" #include "scumm/music.h" #include "audio/mixer.h" #include "audio/mods/tfmx.h" diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h index 91e780bcd1..eead241b90 100644 --- a/engines/scumm/saveload.h +++ b/engines/scumm/saveload.h @@ -30,8 +30,8 @@ #include <stddef.h> // for ptrdiff_t namespace Common { - class SeekableReadStream; - class WriteStream; +class SeekableReadStream; +class WriteStream; } namespace Scumm { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 920887e387..f43aed53f7 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1222,7 +1222,7 @@ void ScummEngine::setupScumm() { setupCharsetRenderer(); // Create and clear the text surface - _textSurface.create(_screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, 1); + _textSurface.create(_screenWidth * _textSurfaceMultiplier, _screenHeight * _textSurfaceMultiplier, Graphics::PixelFormat::createFormatCLUT8()); clearTextSurface(); // Create the costume renderer @@ -1648,6 +1648,8 @@ void ScummEngine_v90he::resetScumm() { break; case GID_SOCCER: + case GID_SOCCERMLS: + case GID_SOCCER2004: _logicHE = new LogicHEsoccer(this); break; diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 266a2c4948..62c6c70e5a 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -35,6 +35,7 @@ #include "common/random.h" #include "common/rect.h" #include "common/str.h" +#include "common/textconsole.h" #include "graphics/surface.h" #include "graphics/sjis.h" @@ -56,12 +57,12 @@ #endif namespace GUI { - class Dialog; +class Dialog; } using GUI::Dialog; namespace Common { - class SeekableReadStream; - class WriteStream; +class SeekableReadStream; +class WriteStream; } /** @@ -253,6 +254,8 @@ enum ScummGameId { GID_FUNSHOP, // Used for all three funshops GID_FOOTBALL, GID_SOCCER, + GID_SOCCERMLS, + GID_SOCCER2004, GID_BASEBALL2001, GID_BASKETBALL, GID_MOONBASE, diff --git a/engines/scumm/smush/channel.cpp b/engines/scumm/smush/channel.cpp index 4389890994..95b7653262 100644 --- a/engines/scumm/smush/channel.cpp +++ b/engines/scumm/smush/channel.cpp @@ -24,6 +24,8 @@ */ +#include "common/textconsole.h" + #include "scumm/smush/channel.h" namespace Scumm { diff --git a/engines/scumm/smush/channel.h b/engines/scumm/smush/channel.h index c35ac0ac00..717a294d96 100644 --- a/engines/scumm/smush/channel.h +++ b/engines/scumm/smush/channel.h @@ -29,7 +29,7 @@ #include "common/util.h" namespace Common { - class SeekableReadStream; +class SeekableReadStream; } namespace Scumm { diff --git a/engines/scumm/smush/codec37.cpp b/engines/scumm/smush/codec37.cpp index 658d67c1b4..9dbbc6816f 100644 --- a/engines/scumm/smush/codec37.cpp +++ b/engines/scumm/smush/codec37.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" +#include "common/textconsole.h" #include "common/util.h" #include "scumm/bomp.h" #include "scumm/smush/codec37.h" diff --git a/engines/scumm/smush/codec47.cpp b/engines/scumm/smush/codec47.cpp index 3a1639c35f..47286ba4fc 100644 --- a/engines/scumm/smush/codec47.cpp +++ b/engines/scumm/smush/codec47.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" +#include "common/textconsole.h" #include "common/util.h" #include "scumm/bomp.h" #include "scumm/smush/codec47.h" diff --git a/engines/scumm/smush/saud_channel.cpp b/engines/scumm/smush/saud_channel.cpp index 04ed955224..f730acf804 100644 --- a/engines/scumm/smush/saud_channel.cpp +++ b/engines/scumm/smush/saud_channel.cpp @@ -26,6 +26,7 @@ #include "common/endian.h" #include "common/stream.h" +#include "common/textconsole.h" #include "scumm/util.h" #include "scumm/smush/channel.h" diff --git a/engines/scumm/smush/smush_mixer.h b/engines/scumm/smush/smush_mixer.h index c7a7354511..3d62fdc722 100644 --- a/engines/scumm/smush/smush_mixer.h +++ b/engines/scumm/smush/smush_mixer.h @@ -27,6 +27,8 @@ #define SCUMM_SMUSH_MIXER_H +#include "audio/mixer.h" +#include "common/mutex.h" #include "scumm/sound.h" namespace Scumm { diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 0e4f588593..2e39558372 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -31,6 +31,7 @@ #include "common/util.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "scumm/bomp.h" #include "scumm/file.h" diff --git a/engines/scumm/sound.cpp b/engines/scumm/sound.cpp index 54f35c1969..a38119584f 100644 --- a/engines/scumm/sound.cpp +++ b/engines/scumm/sound.cpp @@ -527,6 +527,10 @@ void Sound::startTalkSound(uint32 offset, uint32 b, int mode, Audio::SoundHandle sprintf(filename, "audio/%s.%d/%d.voc", roomname, offset, b); _vm->openFile(*_sfxFile, filename); if (!_sfxFile->isOpen()) { + sprintf(filename, "audio/%s_%d/%d.voc", roomname, offset, b); + _vm->openFile(*_sfxFile, filename); + } + if (!_sfxFile->isOpen()) { sprintf(filename, "%d.%d.voc", offset, b); _vm->openFile(*_sfxFile, filename); } diff --git a/engines/scumm/util.cpp b/engines/scumm/util.cpp index ccd0230efa..5c3e4c9d0c 100644 --- a/engines/scumm/util.cpp +++ b/engines/scumm/util.cpp @@ -25,6 +25,7 @@ #include "scumm/util.h" #include "common/util.h" +#include "common/textconsole.h" namespace Scumm { diff --git a/engines/sky/autoroute.cpp b/engines/sky/autoroute.cpp index dae4b94291..d6974837c6 100644 --- a/engines/sky/autoroute.cpp +++ b/engines/sky/autoroute.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" +#include "common/textconsole.h" #include "common/util.h" #include "sky/autoroute.h" diff --git a/engines/sky/compact.cpp b/engines/sky/compact.cpp index 08184adcdb..672fb38ca9 100644 --- a/engines/sky/compact.cpp +++ b/engines/sky/compact.cpp @@ -24,9 +24,10 @@ */ +#include "common/debug.h" #include "common/endian.h" -#include "common/util.h" #include "common/file.h" +#include "common/textconsole.h" #include "sky/compact.h" #include "gui/message.h" #include <stddef.h> // for ptrdiff_t diff --git a/engines/sky/compact.h b/engines/sky/compact.h index cd80d5cfbe..4861273146 100644 --- a/engines/sky/compact.h +++ b/engines/sky/compact.h @@ -31,7 +31,7 @@ #include "sky/skydefs.h" namespace Common { - class File; +class File; } enum CptIds { diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index 8a5409a488..f31f0f6ba9 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -26,11 +26,10 @@ #include "common/endian.h" #include "common/config-manager.h" -#include "common/file.h" #include "common/events.h" #include "common/system.h" #include "common/savefile.h" -#include "common/util.h" +#include "common/textconsole.h" #include "gui/message.h" #include "sky/compact.h" diff --git a/engines/sky/control.h b/engines/sky/control.h index a0024ce73b..e4428c1876 100644 --- a/engines/sky/control.h +++ b/engines/sky/control.h @@ -33,7 +33,7 @@ class OSystem; namespace Common { - class SaveFileManager; +class SaveFileManager; } namespace Sky { diff --git a/engines/sky/debug.cpp b/engines/sky/debug.cpp index 2839665ff8..df55966a9a 100644 --- a/engines/sky/debug.cpp +++ b/engines/sky/debug.cpp @@ -24,7 +24,7 @@ */ -#include "common/endian.h" +#include "common/debug.h" #include "common/util.h" #include "sky/debug.h" diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index e72875fa4e..6871fc9604 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -34,6 +34,7 @@ #include "common/file.h" #include "common/fs.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "engines/metaengine.h" diff --git a/engines/sky/disk.cpp b/engines/sky/disk.cpp index 5ad0c3eb19..3795c4166d 100644 --- a/engines/sky/disk.cpp +++ b/engines/sky/disk.cpp @@ -24,12 +24,12 @@ */ +#include "common/debug.h" +#include "common/textconsole.h" #include "common/endian.h" #include "common/file.h" -#include "common/util.h" #include "sky/disk.h" -#include "sky/rnc_deco.h" #include "sky/sky.h" #include "sky/struc.h" diff --git a/engines/sky/disk.h b/engines/sky/disk.h index 3338cce385..0cdcbb4d0f 100644 --- a/engines/sky/disk.h +++ b/engines/sky/disk.h @@ -28,13 +28,12 @@ #include "common/scummsys.h" -#include "common/str.h" #include "sky/rnc_deco.h" #define MAX_FILES_IN_LIST 60 namespace Common { - class File; +class File; } namespace Sky { diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index cf1910c5b1..506a6699c1 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -28,6 +28,7 @@ #include "common/util.h" #include "common/events.h" #include "common/system.h" +#include "common/textconsole.h" #include "sky/disk.h" #include "sky/intro.h" diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp index b52e908455..f9ebd0fb64 100644 --- a/engines/sky/logic.cpp +++ b/engines/sky/logic.cpp @@ -25,9 +25,8 @@ #include "common/endian.h" #include "common/rect.h" -#include "common/events.h" #include "common/EventRecorder.h" -#include "common/system.h" +#include "common/textconsole.h" #include "sky/autoroute.h" #include "sky/compact.h" diff --git a/engines/sky/mouse.cpp b/engines/sky/mouse.cpp index ca0ebcc19c..611010fa46 100644 --- a/engines/sky/mouse.cpp +++ b/engines/sky/mouse.cpp @@ -26,6 +26,7 @@ #include "common/events.h" #include "common/system.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" #include "sky/disk.h" #include "sky/logic.h" diff --git a/engines/sky/music/adlibchannel.cpp b/engines/sky/music/adlibchannel.cpp index e9c20de8c7..9b3c4338ab 100644 --- a/engines/sky/music/adlibchannel.cpp +++ b/engines/sky/music/adlibchannel.cpp @@ -25,6 +25,7 @@ #include "common/endian.h" +#include "common/textconsole.h" #include "common/util.h" #include "sky/music/adlibchannel.h" #include "sky/sky.h" diff --git a/engines/sky/music/gmchannel.cpp b/engines/sky/music/gmchannel.cpp index 3852a69068..be0afa8894 100644 --- a/engines/sky/music/gmchannel.cpp +++ b/engines/sky/music/gmchannel.cpp @@ -25,6 +25,7 @@ #include "gmchannel.h" #include "common/util.h" +#include "common/textconsole.h" #include "audio/mididrv.h" namespace Sky { diff --git a/engines/sky/music/gmmusic.cpp b/engines/sky/music/gmmusic.cpp index 8818c5b711..6a8529f287 100644 --- a/engines/sky/music/gmmusic.cpp +++ b/engines/sky/music/gmmusic.cpp @@ -28,6 +28,7 @@ #include "sky/sky.h" #include "common/util.h" #include "common/endian.h" +#include "common/textconsole.h" #include "audio/mididrv.h" namespace Sky { diff --git a/engines/sky/music/mt32music.cpp b/engines/sky/music/mt32music.cpp index 51df95e451..4f47e511c7 100644 --- a/engines/sky/music/mt32music.cpp +++ b/engines/sky/music/mt32music.cpp @@ -28,6 +28,7 @@ #include "common/util.h" #include "common/system.h" #include "common/endian.h" +#include "common/textconsole.h" #include "audio/mididrv.h" namespace Sky { diff --git a/engines/sky/music/musicbase.cpp b/engines/sky/music/musicbase.cpp index e1044a9505..748637f9d0 100644 --- a/engines/sky/music/musicbase.cpp +++ b/engines/sky/music/musicbase.cpp @@ -27,6 +27,7 @@ #include "sky/disk.h" #include "common/util.h" #include "common/endian.h" +#include "common/textconsole.h" namespace Sky { diff --git a/engines/sky/screen.cpp b/engines/sky/screen.cpp index 1b815b9c38..a209571b37 100644 --- a/engines/sky/screen.cpp +++ b/engines/sky/screen.cpp @@ -27,6 +27,9 @@ #include "common/endian.h" #include "common/events.h" #include "common/system.h" +#include "common/textconsole.h" + +#include "graphics/palette.h" #include "sky/disk.h" #include "sky/logic.h" diff --git a/engines/sky/screen.h b/engines/sky/screen.h index 2c870ebd89..5e226c49ed 100644 --- a/engines/sky/screen.h +++ b/engines/sky/screen.h @@ -31,8 +31,9 @@ #include "sky/skydefs.h" class OSystem; + namespace Common { - struct Rect; +struct Rect; } namespace Sky { diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index f3556c84b3..f10ec1083a 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -25,6 +25,7 @@ #include "common/config-manager.h" #include "common/system.h" +#include "common/textconsole.h" #include "sky/control.h" #include "sky/debug.h" diff --git a/engines/sky/sky.h b/engines/sky/sky.h index 378bba73ee..58ac3ed26e 100644 --- a/engines/sky/sky.h +++ b/engines/sky/sky.h @@ -27,7 +27,8 @@ #define SKY_H -#include "common/events.h" +#include "common/error.h" +#include "common/keyboard.h" #include "engines/engine.h" /** @@ -52,7 +53,6 @@ struct SystemVars { bool paused; }; -struct Compact; class Sound; class Disk; class Text; diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp index 3d247ed334..7191f6cd00 100644 --- a/engines/sky/sound.cpp +++ b/engines/sky/sound.cpp @@ -24,7 +24,9 @@ */ +#include "common/debug.h" #include "common/endian.h" +#include "common/textconsole.h" #include "sky/disk.h" #include "sky/logic.h" diff --git a/engines/sky/text.cpp b/engines/sky/text.cpp index 548c9cb3c2..2464d93581 100644 --- a/engines/sky/text.cpp +++ b/engines/sky/text.cpp @@ -24,7 +24,9 @@ */ +#include "common/debug.h" #include "common/endian.h" +#include "common/textconsole.h" #include "sky/disk.h" #include "sky/logic.h" diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index 60176be1a9..7c17befcff 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -24,15 +24,16 @@ */ #include "common/file.h" +#include "common/events.h" +#include "common/keyboard.h" +#include "common/textconsole.h" #include "sword1/sword1.h" #include "sword1/animation.h" #include "sword1/text.h" -#include "audio/decoders/vorbis.h" -#include "common/config-manager.h" -#include "common/endian.h" #include "common/str.h" #include "common/system.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "gui/message.h" diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index d4f6bfd1fe..d8ddd53e2e 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -29,7 +29,9 @@ #include "common/events.h" #include "common/system.h" #include "common/config-manager.h" +#include "common/textconsole.h" +#include "graphics/palette.h" #include "graphics/thumbnail.h" #include "gui/message.h" diff --git a/engines/sword1/control.h b/engines/sword1/control.h index 2e5bfc7197..db910f521f 100644 --- a/engines/sword1/control.h +++ b/engines/sword1/control.h @@ -33,7 +33,7 @@ class OSystem; namespace Common { - class SaveFileManager; +class SaveFileManager; } namespace Sword1 { diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp index 855c7d1f83..fa8277033c 100644 --- a/engines/sword1/detection.cpp +++ b/engines/sword1/detection.cpp @@ -27,8 +27,6 @@ #include "sword1/control.h" #include "base/plugins.h" -#include "common/config-manager.h" -#include "common/file.h" #include "common/fs.h" #include "common/savefile.h" #include "common/system.h" diff --git a/engines/sword1/eventman.cpp b/engines/sword1/eventman.cpp index 55a438f506..9200e6a229 100644 --- a/engines/sword1/eventman.cpp +++ b/engines/sword1/eventman.cpp @@ -26,6 +26,7 @@ #include "sword1/eventman.h" #include "sword1/sworddefs.h" +#include "common/textconsole.h" #include "common/util.h" namespace Sword1 { diff --git a/engines/sword1/logic.cpp b/engines/sword1/logic.cpp index ef54167d41..3da3c457d0 100644 --- a/engines/sword1/logic.cpp +++ b/engines/sword1/logic.cpp @@ -25,9 +25,8 @@ #include "common/endian.h" #include "common/util.h" -#include "common/system.h" -#include "common/events.h" #include "common/EventRecorder.h" +#include "common/textconsole.h" #include "sword1/logic.h" #include "sword1/text.h" diff --git a/engines/sword1/memman.cpp b/engines/sword1/memman.cpp index b08631dfc8..f315895eb0 100644 --- a/engines/sword1/memman.cpp +++ b/engines/sword1/memman.cpp @@ -25,6 +25,7 @@ #include "sword1/memman.h" +#include "common/textconsole.h" #include "common/util.h" namespace Sword1 { diff --git a/engines/sword1/mouse.h b/engines/sword1/mouse.h index 1b4ca12183..3a7ea747fb 100644 --- a/engines/sword1/mouse.h +++ b/engines/sword1/mouse.h @@ -27,6 +27,7 @@ #define SWORD1_MOUSE_H #include "common/scummsys.h" +#include "common/rect.h" #include "sword1/sworddefs.h" #include "sword1/object.h" diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index 2b81ae1eb4..49f9f7271b 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -24,10 +24,9 @@ */ -#include "common/endian.h" #include "common/file.h" #include "common/util.h" -#include "common/system.h" +#include "common/textconsole.h" #include "sword1/sword1.h" #include "sword1/music.h" diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp index 9ac2c7a255..dde1498591 100644 --- a/engines/sword1/objectman.cpp +++ b/engines/sword1/objectman.cpp @@ -24,6 +24,7 @@ */ +#include "common/textconsole.h" #include "common/util.h" #include "sword1/objectman.h" diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp index 2bad8a79a7..f7b9eb8908 100644 --- a/engines/sword1/resman.cpp +++ b/engines/sword1/resman.cpp @@ -24,19 +24,14 @@ */ -#include "common/config-manager.h" -#include "common/util.h" -#include "common/str.h" - -#include "engines/engine.h" +#include "common/debug.h" +#include "common/textconsole.h" #include "sword1/memman.h" #include "sword1/resman.h" -#include "sword1/sworddefs.h" #include "sword1/swordres.h" #include "gui/message.h" -#include "gui/gui-manager.h" namespace Sword1 { void guiFatalError(char *msg) { diff --git a/engines/sword1/router.cpp b/engines/sword1/router.cpp index 9ff5ae0c8e..3694ed2459 100644 --- a/engines/sword1/router.cpp +++ b/engines/sword1/router.cpp @@ -24,6 +24,7 @@ */ #include "common/debug.h" +#include "common/textconsole.h" #include "common/util.h" #include "sword1/router.h" diff --git a/engines/sword1/screen.cpp b/engines/sword1/screen.cpp index 1906fcb7fd..de96f6e7b4 100644 --- a/engines/sword1/screen.cpp +++ b/engines/sword1/screen.cpp @@ -25,8 +25,11 @@ #include "common/system.h" +#include "common/textconsole.h" #include "common/util.h" +#include "graphics/palette.h" + #include "sword1/screen.h" #include "sword1/logic.h" #include "sword1/sworddefs.h" diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index f8219eb21a..c970e72748 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -27,10 +27,9 @@ #include "common/endian.h" #include "common/util.h" -#include "common/events.h" #include "common/EventRecorder.h" #include "common/memstream.h" -#include "common/system.h" +#include "common/textconsole.h" #include "sword1/sound.h" #include "sword1/resman.h" diff --git a/engines/sword1/sound.h b/engines/sword1/sound.h index ae96132241..b6fcd6706f 100644 --- a/engines/sword1/sound.h +++ b/engines/sword1/sound.h @@ -34,7 +34,7 @@ #include "audio/mixer.h" namespace Audio { - class Mixer; +class Mixer; } namespace Sword1 { diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 8768e62457..3b3eaaf8b9 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -37,6 +37,7 @@ #include "sword1/control.h" #include "common/config-manager.h" +#include "common/textconsole.h" #include "engines/util.h" diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h index 255299d33e..dbb683cd74 100644 --- a/engines/sword1/sword1.h +++ b/engines/sword1/sword1.h @@ -27,7 +27,9 @@ #define SWORD1_H #include "engines/engine.h" -#include "common/events.h" +#include "common/error.h" +#include "common/keyboard.h" +#include "common/rect.h" #include "common/util.h" #include "sword1/sworddefs.h" #include "sword1/console.h" diff --git a/engines/sword1/text.cpp b/engines/sword1/text.cpp index ef3e07fe74..7c65533067 100644 --- a/engines/sword1/text.cpp +++ b/engines/sword1/text.cpp @@ -24,8 +24,7 @@ */ -#include "common/endian.h" -#include "common/util.h" +#include "common/textconsole.h" #include "sword1/text.h" #include "sword1/resman.h" diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 8d1a9836f4..a5a2499b01 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -26,7 +26,9 @@ */ #include "common/file.h" +#include "common/mutex.h" #include "common/system.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index b488092007..4332f2811c 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -26,9 +26,7 @@ */ -#include "common/events.h" #include "common/rect.h" -#include "common/config-manager.h" #include "common/system.h" #include "sword2/sword2.h" diff --git a/engines/sword2/events.cpp b/engines/sword2/events.cpp index f0e0e567a4..24101e271c 100644 --- a/engines/sword2/events.cpp +++ b/engines/sword2/events.cpp @@ -26,6 +26,7 @@ */ +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index a968a5600d..e0990ea120 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -28,6 +28,7 @@ #include "common/system.h" #include "common/file.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/interpreter.cpp b/engines/sword2/interpreter.cpp index e039ae3888..a3804366d4 100644 --- a/engines/sword2/interpreter.cpp +++ b/engines/sword2/interpreter.cpp @@ -28,6 +28,7 @@ #include "common/util.h" #include "common/stack.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/header.h" diff --git a/engines/sword2/layers.cpp b/engines/sword2/layers.cpp index c5091a248f..47cc3ec232 100644 --- a/engines/sword2/layers.cpp +++ b/engines/sword2/layers.cpp @@ -35,6 +35,7 @@ #include "common/rect.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/logic.cpp b/engines/sword2/logic.cpp index 511561c55a..c27bd76ff4 100644 --- a/engines/sword2/logic.cpp +++ b/engines/sword2/logic.cpp @@ -26,6 +26,7 @@ */ +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp index 648d1d761b..fda30981c8 100644 --- a/engines/sword2/maketext.cpp +++ b/engines/sword2/maketext.cpp @@ -45,6 +45,7 @@ #include "common/system.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/memory.cpp b/engines/sword2/memory.cpp index cd36f9a19b..2b3784164e 100644 --- a/engines/sword2/memory.cpp +++ b/engines/sword2/memory.cpp @@ -48,6 +48,7 @@ // // The number zero is used to represent the NULL pointer. +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/memory.h" diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp index b6e9b169c3..3a26ab17b7 100644 --- a/engines/sword2/mouse.cpp +++ b/engines/sword2/mouse.cpp @@ -29,6 +29,7 @@ #include "common/system.h" #include "common/events.h" #include "common/memstream.h" +#include "common/textconsole.h" #include "graphics/cursorman.h" diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp index aa91843432..233d9369d2 100644 --- a/engines/sword2/music.cpp +++ b/engines/sword2/music.cpp @@ -36,6 +36,7 @@ #include "common/memstream.h" #include "common/substream.h" #include "common/system.h" +#include "common/textconsole.h" #include "audio/decoders/mp3.h" #include "audio/decoders/vorbis.h" diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index f43efcaa7f..a52160db25 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -27,6 +27,9 @@ #include "common/system.h" +#include "common/textconsole.h" + +#include "graphics/palette.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index fa9c396ef3..36280cfda2 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -28,6 +28,7 @@ #include "common/file.h" #include "common/system.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/resman.h b/engines/sword2/resman.h index dcc79927ea..75748e1568 100644 --- a/engines/sword2/resman.h +++ b/engines/sword2/resman.h @@ -29,7 +29,7 @@ #define SWORD2_RESMAN_H namespace Common { - class File; +class File; } #define MAX_MEM_CACHE (8 * 1024 * 1024) // we keep up to 8 megs of resource data files in memory diff --git a/engines/sword2/router.cpp b/engines/sword2/router.cpp index 8f355151f4..c2b4d2e67f 100644 --- a/engines/sword2/router.cpp +++ b/engines/sword2/router.cpp @@ -27,6 +27,7 @@ #include "common/memstream.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/saveload.cpp b/engines/sword2/saveload.cpp index fab360a8ac..94ef8975b4 100644 --- a/engines/sword2/saveload.cpp +++ b/engines/sword2/saveload.cpp @@ -37,6 +37,7 @@ #include "common/memstream.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index 74a23c8b2c..a83e581fd4 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -32,6 +32,7 @@ #include "common/system.h" #include "common/events.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/sound.cpp b/engines/sword2/sound.cpp index 261c8293bd..3cf8523113 100644 --- a/engines/sword2/sound.cpp +++ b/engines/sword2/sound.cpp @@ -39,6 +39,7 @@ #include "common/file.h" #include "common/memstream.h" #include "common/system.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/sound.h b/engines/sword2/sound.h index 2c4c8364c7..c37e006b76 100644 --- a/engines/sword2/sound.h +++ b/engines/sword2/sound.h @@ -39,6 +39,7 @@ #define SWORD2_SOUND_H #include "common/file.h" +#include "common/mutex.h" #include "audio/audiostream.h" #include "audio/mixer.h" diff --git a/engines/sword2/speech.cpp b/engines/sword2/speech.cpp index b67f079a83..ec8e198377 100644 --- a/engines/sword2/speech.cpp +++ b/engines/sword2/speech.cpp @@ -27,6 +27,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/startup.cpp b/engines/sword2/startup.cpp index e4572d3c1a..ea1751eb5f 100644 --- a/engines/sword2/startup.cpp +++ b/engines/sword2/startup.cpp @@ -27,6 +27,7 @@ #include "common/file.h" +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 7ad021b3a5..58f3547ff7 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -34,6 +34,7 @@ #include "common/EventRecorder.h" #include "common/savefile.h" #include "common/system.h" +#include "common/textconsole.h" #include "engines/metaengine.h" #include "engines/util.h" diff --git a/engines/sword2/sync.cpp b/engines/sword2/sync.cpp index 1adc652b75..ee4c6b2238 100644 --- a/engines/sword2/sync.cpp +++ b/engines/sword2/sync.cpp @@ -26,6 +26,7 @@ */ +#include "common/textconsole.h" #include "sword2/sword2.h" #include "sword2/defs.h" diff --git a/engines/sword25/detection.cpp b/engines/sword25/detection.cpp index 3900df2fcf..fe24675f8a 100644 --- a/engines/sword25/detection.cpp +++ b/engines/sword25/detection.cpp @@ -24,8 +24,6 @@ */ #include "base/plugins.h" -#include "common/savefile.h" -#include "common/system.h" #include "engines/advancedDetector.h" #include "sword25/sword25.h" diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp index 177bd38303..975f08be22 100644 --- a/engines/sword25/fmv/movieplayer.cpp +++ b/engines/sword25/fmv/movieplayer.cpp @@ -32,13 +32,17 @@ * */ +#include "common/debug.h" +#include "common/system.h" +#include "common/textconsole.h" +#include "common/util.h" + #include "sword25/sword25.h" // for kDebugScript #include "sword25/fmv/movieplayer.h" #include "sword25/gfx/graphicengine.h" #include "sword25/gfx/panel.h" #include "sword25/kernel/kernel.h" #include "sword25/package/packagemanager.h" -#include "sword25/sfx/soundengine.h" namespace Sword25 { @@ -121,7 +125,7 @@ void MoviePlayer::update() { const Graphics::Surface *s = _decoder.decodeNextFrame(); if (s) { // Transfer the next frame - assert(s->bytesPerPixel == 4); + assert(s->format.bytesPerPixel == 4); #ifdef THEORA_INDIRECT_RENDERING byte *frameData = (byte *)s->getBasePtr(0, 0); diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index e9901c04b0..86236fbd21 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -41,6 +41,7 @@ #ifdef USE_THEORADEC #include "common/system.h" +#include "common/textconsole.h" #include "graphics/conversion.h" #include "audio/decoders/raw.h" #include "sword25/kernel/common.h" @@ -289,7 +290,7 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { _surface = new Graphics::Surface(); - _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, 4); + _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); return true; } diff --git a/engines/sword25/fmv/theora_decoder.h b/engines/sword25/fmv/theora_decoder.h index a753bc58ac..4ed2af5f98 100644 --- a/engines/sword25/fmv/theora_decoder.h +++ b/engines/sword25/fmv/theora_decoder.h @@ -30,9 +30,12 @@ #ifdef USE_THEORADEC +#include "common/rational.h" #include "video/video_decoder.h" #include "audio/audiostream.h" #include "audio/mixer.h" +#include "graphics/pixelformat.h" +#include "graphics/surface.h" #include <theora/theoradec.h> #include <vorbis/codec.h> diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index 502d2d3b2a..8bdf2a4a6e 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -112,8 +112,10 @@ bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCoun _screenRect.right = _width; _screenRect.bottom = _height; - _backSurface.create(width, height, 4); - _frameBuffer.create(width, height, 4); + const Graphics::PixelFormat format = g_system->getScreenFormat(); + + _backSurface.create(width, height, format); + _frameBuffer.create(width, height, format); // Standardmäßig ist Vsync an. setVsync(true); diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index b740c0ec68..806d9b27ad 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -187,7 +187,8 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe // Create an encapsulating surface for the data Graphics::Surface srcImage; - srcImage.bytesPerPixel = 4; + // TODO: Is the data really in the screen format? + srcImage.format = g_system->getScreenFormat(); srcImage.pitch = _width * 4; srcImage.w = _width; srcImage.h = _height; @@ -409,7 +410,7 @@ void RenderedImage::copyDirectly(int posX, int posY) { */ Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int xSize, int ySize) { Graphics::Surface *s = new Graphics::Surface(); - s->create(xSize, ySize, srcImage.bytesPerPixel); + s->create(xSize, ySize, srcImage.format); int *horizUsage = scaleLine(xSize, srcImage.w); int *vertUsage = scaleLine(ySize, srcImage.h); @@ -420,8 +421,8 @@ Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int x byte *destP = (byte *)s->getBasePtr(0, yp); for (int xp = 0; xp < xSize; ++xp) { - const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.bytesPerPixel); - for (int byteCtr = 0; byteCtr < srcImage.bytesPerPixel; ++byteCtr) { + const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.format.bytesPerPixel); + for (int byteCtr = 0; byteCtr < srcImage.format.bytesPerPixel; ++byteCtr) { *destP++ = *tempSrcP++; } } diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 35e94976eb..6ea2b574d6 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -36,6 +36,7 @@ #define FORBIDDEN_SYMBOL_ALLOW_ALL #include "common/memstream.h" +#include "common/textconsole.h" #include "sword25/gfx/screenshot.h" #include "sword25/kernel/filesystemutil.h" #include <png.h> @@ -127,14 +128,14 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) // generates a pixel of the target image. Finally, the result as a PNG file is stored as a file. // The source image must be 800x600. - if (data->w != 800 || data->h != 600 || data->bytesPerPixel != 4) { + if (data->w != 800 || data->h != 600 || data->format.bytesPerPixel != 4) { error("The sreenshot dimensions have to be 800x600 in order to be saved as a thumbnail."); return false; } // Buffer for the output thumbnail Graphics::Surface thumbnail; - thumbnail.create(200, 125, 4); + thumbnail.create(200, 125, g_system->getScreenFormat()); // Über das Zielbild iterieren und einen Pixel zur Zeit berechnen. uint x, y; diff --git a/engines/sword25/kernel/filesystemutil.cpp b/engines/sword25/kernel/filesystemutil.cpp index b4d4b25f8d..e5ec6c15db 100644 --- a/engines/sword25/kernel/filesystemutil.cpp +++ b/engines/sword25/kernel/filesystemutil.cpp @@ -34,8 +34,7 @@ #include "common/config-manager.h" #include "common/fs.h" -#include "common/savefile.h" -#include "common/system.h" +#include "common/textconsole.h" #include "sword25/kernel/filesystemutil.h" #include "sword25/kernel/persistenceservice.h" diff --git a/engines/sword25/kernel/inputpersistenceblock.cpp b/engines/sword25/kernel/inputpersistenceblock.cpp index f3aebef203..26c924dc82 100644 --- a/engines/sword25/kernel/inputpersistenceblock.cpp +++ b/engines/sword25/kernel/inputpersistenceblock.cpp @@ -32,6 +32,8 @@ * */ +#include "common/textconsole.h" + #include "sword25/kernel/inputpersistenceblock.h" namespace Sword25 { diff --git a/engines/sword25/kernel/kernel.h b/engines/sword25/kernel/kernel.h index 9e7ee0fdd9..3abf43d239 100644 --- a/engines/sword25/kernel/kernel.h +++ b/engines/sword25/kernel/kernel.h @@ -48,6 +48,7 @@ #include "common/scummsys.h" #include "common/random.h" #include "common/stack.h" +#include "common/textconsole.h" #include "common/util.h" #include "engines/engine.h" diff --git a/engines/sword25/kernel/objectregistry.h b/engines/sword25/kernel/objectregistry.h index 8d0f4a314b..69d961ae91 100644 --- a/engines/sword25/kernel/objectregistry.h +++ b/engines/sword25/kernel/objectregistry.h @@ -37,6 +37,7 @@ #include "common/func.h" #include "common/hashmap.h" +#include "common/textconsole.h" #include "sword25/kernel/common.h" namespace Sword25 { diff --git a/engines/sword25/kernel/persistenceservice.cpp b/engines/sword25/kernel/persistenceservice.cpp index be66b6abf0..506eef3c57 100644 --- a/engines/sword25/kernel/persistenceservice.cpp +++ b/engines/sword25/kernel/persistenceservice.cpp @@ -32,6 +32,9 @@ * */ +// Disable symbol overrides so that we can use zlib.h +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "common/fs.h" #include "common/savefile.h" #include "sword25/kernel/kernel.h" diff --git a/engines/sword25/script/luacallback.cpp b/engines/sword25/script/luacallback.cpp index 137e37bf8d..809676796e 100644 --- a/engines/sword25/script/luacallback.cpp +++ b/engines/sword25/script/luacallback.cpp @@ -32,6 +32,8 @@ * */ +#include "common/textconsole.h" + #include "sword25/script/luacallback.h" #include "sword25/script/luabindhelper.h" diff --git a/engines/sword25/sfx/soundengine.cpp b/engines/sword25/sfx/soundengine.cpp index 03cdaf82b7..08f0f5b4ae 100644 --- a/engines/sword25/sfx/soundengine.cpp +++ b/engines/sword25/sfx/soundengine.cpp @@ -39,6 +39,8 @@ #include "audio/decoders/vorbis.h" +#include "common/system.h" + namespace Sword25 { class SoundResource : public Resource { diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp index 8740e44e9c..38c1c89109 100644 --- a/engines/sword25/sword25.cpp +++ b/engines/sword25/sword25.cpp @@ -34,10 +34,18 @@ #include "common/config-manager.h" #include "common/debug-channels.h" +#include "common/algorithm.h" +#include "common/array.h" +#include "common/error.h" +#include "common/fs.h" +#include "common/singleton.h" +#include "common/str-array.h" +#include "common/str.h" +#include "common/system.h" +#include "common/textconsole.h" #include "engines/util.h" #include "sword25/sword25.h" -#include "sword25/kernel/filesystemutil.h" #include "sword25/kernel/kernel.h" #include "sword25/kernel/persistenceservice.h" #include "sword25/package/packagemanager.h" diff --git a/engines/sword25/sword25.h b/engines/sword25/sword25.h index 9e9679526b..5bd27b311f 100644 --- a/engines/sword25/sword25.h +++ b/engines/sword25/sword25.h @@ -27,12 +27,18 @@ #define SWORD25_H #include "common/scummsys.h" -#include "common/str-array.h" -#include "common/util.h" #include "engines/engine.h" #include "sword25/console.h" +namespace Common { +class Error; +} + +namespace GUI { +class Debugger; +} + struct ADGameDescription; /** diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp index 1620aa700c..9dd30f43c3 100644 --- a/engines/teenagent/actor.cpp +++ b/engines/teenagent/actor.cpp @@ -27,6 +27,7 @@ #include "teenagent/resources.h" #include "common/random.h" +#include "common/textconsole.h" namespace TeenAgent { diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp index 56812001e8..623966f265 100644 --- a/engines/teenagent/animation.cpp +++ b/engines/teenagent/animation.cpp @@ -24,6 +24,7 @@ #include "teenagent/animation.h" #include "common/endian.h" +#include "common/textconsole.h" namespace TeenAgent { diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index d0662a73d6..f4be917eac 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -27,6 +27,8 @@ #include "teenagent/resources.h" #include "teenagent/dialog.h" +#include "common/textconsole.h" + namespace TeenAgent { #define CHECK_FLAG(addr, v) (res->dseg.get_byte(addr) == (v)) diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index 7d252f59e8..2d98ae9de7 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -24,8 +24,12 @@ #include "teenagent/font.h" #include "teenagent/pack.h" +#include "common/debug.h" +#include "common/endian.h" #include "common/stream.h" +#include "common/textconsole.h" #include "common/ptr.h" +#include "graphics/surface.h" namespace TeenAgent { diff --git a/engines/teenagent/font.h b/engines/teenagent/font.h index e08a3513af..29a8121435 100644 --- a/engines/teenagent/font.h +++ b/engines/teenagent/font.h @@ -25,6 +25,7 @@ #ifndef TEENAGENT_FONT_H #define TEENAGENT_FONT_H +#include "common/str.h" #include "graphics/surface.h" namespace TeenAgent { diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index bc4ac24da4..4d18d68502 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -24,6 +24,7 @@ #include "common/memstream.h" #include "common/ptr.h" +#include "common/textconsole.h" #include "teenagent/inventory.h" #include "teenagent/resources.h" diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp index 395b2546b9..f0be5165f6 100644 --- a/engines/teenagent/music.cpp +++ b/engines/teenagent/music.cpp @@ -25,7 +25,9 @@ #include "teenagent/music.h" #include "teenagent/resources.h" +#include "common/debug.h" #include "common/ptr.h" +#include "common/textconsole.h" namespace TeenAgent { diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 9fe889fa41..69908239ab 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -24,6 +24,7 @@ #include "teenagent/resources.h" #include "teenagent/teenagent.h" +#include "common/textconsole.h" #include "common/zlib.h" namespace TeenAgent { diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index f9756b5b91..ee431b2ab5 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -26,6 +26,9 @@ #include "common/debug.h" #include "common/algorithm.h" #include "common/ptr.h" +#include "common/textconsole.h" + +#include "graphics/palette.h" #include "teenagent/scene.h" #include "teenagent/resources.h" @@ -379,7 +382,7 @@ void Scene::init(int id, const Common::Point &pos) { custom_animation[i].free(); if (background.pixels == NULL) - background.create(320, 200, 1); + background.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); warp(pos); diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index 2dc5bc9c83..28def3a064 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -35,6 +35,10 @@ #include "common/array.h" #include "common/list.h" +namespace Common { +struct Event; +} + namespace TeenAgent { class TeenAgentEngine; diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp index 7ba680907b..829c84765d 100644 --- a/engines/teenagent/segment.cpp +++ b/engines/teenagent/segment.cpp @@ -23,6 +23,7 @@ */ #include "teenagent/segment.h" +#include "common/textconsole.h" #include "common/util.h" namespace TeenAgent { diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp index 96672ca1b3..545b0f75f0 100644 --- a/engines/teenagent/surface.cpp +++ b/engines/teenagent/surface.cpp @@ -61,7 +61,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) { } //debug(0, "creating surface %ux%u -> %u,%u", w_, h_, x, y); - create(w_, h_, 1); + create(w_, h_, Graphics::PixelFormat::createFormatCLUT8()); stream->read(pixels, w_ * h_); } diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h index b44fd3c21a..82c13c84bd 100644 --- a/engines/teenagent/surface.h +++ b/engines/teenagent/surface.h @@ -25,8 +25,12 @@ #ifndef TEENAGENT_SURFACE_H #define TEENAGENT_SURFACE_H +#include "common/rect.h" #include "graphics/surface.h" -#include "common/stream.h" + +namespace Common { + class SeekableReadStream; +} namespace TeenAgent { diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index e66de70079..ec1e945f8d 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -27,6 +27,7 @@ #include "common/events.h" #include "common/savefile.h" #include "common/system.h" +#include "common/textconsole.h" #include "backends/audiocd/audiocd.h" @@ -37,6 +38,7 @@ #include "audio/decoders/raw.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" #include "graphics/thumbnail.h" #include "teenagent/console.h" diff --git a/engines/testbed/detection.cpp b/engines/testbed/detection.cpp index 734ed0c22a..b08cca291a 100644 --- a/engines/testbed/detection.cpp +++ b/engines/testbed/detection.cpp @@ -23,10 +23,8 @@ * */ -#include "common/config-manager.h" #include "engines/advancedDetector.h" #include "common/system.h" -#include "common/fs.h" #include "base/plugins.h" diff --git a/engines/testbed/events.cpp b/engines/testbed/events.cpp index b0a930172d..37b0a7ead4 100644 --- a/engines/testbed/events.cpp +++ b/engines/testbed/events.cpp @@ -24,10 +24,17 @@ #include "common/events.h" #include "common/keyboard.h" +#include "common/rect.h" +#include "common/str.h" +#include "common/system.h" +#include "common/util.h" #include "engines/engine.h" #include "graphics/cursorman.h" +#include "graphics/font.h" +#include "graphics/fontman.h" +#include "graphics/surface.h" #include "testbed/events.h" #include "testbed/graphics.h" diff --git a/engines/testbed/graphics.cpp b/engines/testbed/graphics.cpp index c0ce3fea32..c8558e30f4 100644 --- a/engines/testbed/graphics.cpp +++ b/engines/testbed/graphics.cpp @@ -33,6 +33,7 @@ #include "graphics/cursorman.h" #include "graphics/fontman.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "graphics/VectorRendererSpec.h" diff --git a/engines/testbed/sound.cpp b/engines/testbed/sound.cpp index 76f9e850c0..dca116368e 100644 --- a/engines/testbed/sound.cpp +++ b/engines/testbed/sound.cpp @@ -26,6 +26,8 @@ #include "backends/audiocd/audiocd.h" +#include "common/config-manager.h" + #include "testbed/sound.h" namespace Testbed { diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index 1ceecb8ebf..179be2bb8b 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -24,7 +24,12 @@ #include "common/debug-channels.h" #include "common/scummsys.h" -#include "common/system.h" +#include "common/archive.h" +#include "common/config-manager.h" +#include "common/error.h" +#include "common/fs.h" +#include "common/rect.h" +#include "common/str.h" #include "engines/util.h" diff --git a/engines/testbed/testbed.h b/engines/testbed/testbed.h index e0feb52ff5..ca803a4cec 100644 --- a/engines/testbed/testbed.h +++ b/engines/testbed/testbed.h @@ -25,9 +25,9 @@ #ifndef TESTBED_H #define TESTBED_H -#include "engines/engine.h" +#include "common/array.h" -#include "gui/options.h" +#include "engines/engine.h" #include "testbed/config.h" #include "testbed/testsuite.h" diff --git a/engines/testbed/testsuite.h b/engines/testbed/testsuite.h index a738f40764..94b3d70fd4 100644 --- a/engines/testbed/testsuite.h +++ b/engines/testbed/testsuite.h @@ -25,9 +25,12 @@ #ifndef TESTBED_TESTSUITE_H #define TESTBED_TESTSUITE_H +#include "common/array.h" +#include "common/rect.h" +#include "common/scummsys.h" #include "common/system.h" #include "common/str.h" -#include "common/array.h" +#include "graphics/font.h" #include "graphics/fontman.h" diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp index 1d25723a35..9ec253e512 100644 --- a/engines/tinsel/actors.cpp +++ b/engines/tinsel/actors.cpp @@ -44,6 +44,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/adpcm.cpp b/engines/tinsel/adpcm.cpp index ec51d150dc..530395d754 100644 --- a/engines/tinsel/adpcm.cpp +++ b/engines/tinsel/adpcm.cpp @@ -23,6 +23,9 @@ * */ +#include "common/stream.h" +#include "common/util.h" + #include "tinsel/adpcm.h" namespace Tinsel { @@ -44,14 +47,14 @@ void Tinsel_ADPCMStream::readBufferTinselHeader() { // Negate start = ~(start | 0xC0) + 1; - _status.predictor = 1 << start; + _status.predictor = (unsigned long long int)1 << start; } else { // Lower 6 bit are positive // Truncate start &= 0x1F; - _status.predictor = ((double) 1.0) / (1 << start); + _status.predictor = ((double) 1.0) / ((unsigned long long int)1 << start); } _status.K0 = TinselFilterTable[filterVal][0]; diff --git a/engines/tinsel/anim.cpp b/engines/tinsel/anim.cpp index 37d8de925e..61c8b67624 100644 --- a/engines/tinsel/anim.cpp +++ b/engines/tinsel/anim.cpp @@ -31,6 +31,7 @@ #include "tinsel/sched.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/bg.cpp b/engines/tinsel/bg.cpp index 747fdfe93c..0e67c3a06e 100644 --- a/engines/tinsel/bg.cpp +++ b/engines/tinsel/bg.cpp @@ -40,6 +40,7 @@ #include "tinsel/tinlib.h" // For Control() #include "tinsel/tinsel.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp index e3fbad678c..793febdc21 100644 --- a/engines/tinsel/bmv.cpp +++ b/engines/tinsel/bmv.cpp @@ -44,6 +44,8 @@ #include "audio/decoders/raw.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- LOCAL DEFINES ---------------------------- diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp index ee9c9aed39..281dd2da55 100644 --- a/engines/tinsel/dialogs.cpp +++ b/engines/tinsel/dialogs.cpp @@ -62,6 +62,8 @@ #include "tinsel/tinsel.h" // For engine access #include "tinsel/token.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- EXTERNAL GLOBAL DATA -------------------- diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h index a256ed73e8..f81a59a0b7 100644 --- a/engines/tinsel/dialogs.h +++ b/engines/tinsel/dialogs.h @@ -32,7 +32,7 @@ #include "tinsel/events.h" // for PLR_EVENT, PLR_EVENT namespace Common { - class Serializer; +class Serializer; } namespace Tinsel { diff --git a/engines/tinsel/drives.cpp b/engines/tinsel/drives.cpp index ab606f3159..d252e45cf5 100644 --- a/engines/tinsel/drives.cpp +++ b/engines/tinsel/drives.cpp @@ -24,9 +24,7 @@ * CD/drive handling functions */ -#include "common/config-manager.h" -#include "common/substream.h" -#include "gui/message.h" +#include "common/textconsole.h" #include "tinsel/drives.h" #include "tinsel/scene.h" #include "tinsel/tinsel.h" diff --git a/engines/tinsel/graphics.cpp b/engines/tinsel/graphics.cpp index 0b550f50f3..bdcd3207f9 100644 --- a/engines/tinsel/graphics.cpp +++ b/engines/tinsel/graphics.cpp @@ -32,6 +32,8 @@ #include "tinsel/tinsel.h" #include "tinsel/scn.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- LOCAL DEFINES -------------------- diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index f2db42bede..6f5f92c969 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -27,6 +27,7 @@ #define BODGE #include "common/file.h" +#include "common/textconsole.h" #include "tinsel/drives.h" #include "tinsel/dw.h" diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp index cf28749e76..5d9672972a 100644 --- a/engines/tinsel/mareels.cpp +++ b/engines/tinsel/mareels.cpp @@ -28,6 +28,7 @@ #include "tinsel/pcode.h" // For D_UP, D_DOWN #include "tinsel/rince.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp index 1aac68c7f0..ad02a614a5 100644 --- a/engines/tinsel/object.cpp +++ b/engines/tinsel/object.cpp @@ -32,6 +32,8 @@ #include "tinsel/text.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" + #define OID_EFFECTS 0x2000 // generic special effects object id namespace Tinsel { diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 2d2ebd6f60..0877337603 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -32,6 +32,8 @@ #include "tinsel/tinsel.h" #include "common/system.h" +#include "common/textconsole.h" +#include "graphics/palette.h" namespace Tinsel { diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index ccd86d7ed7..a1cc02a832 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -36,6 +36,7 @@ #include "tinsel/tinlib.h" // Library routines #include "tinsel/tinsel.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/pcode.h b/engines/tinsel/pcode.h index f3690e9257..f31f2eb5c6 100644 --- a/engines/tinsel/pcode.h +++ b/engines/tinsel/pcode.h @@ -31,7 +31,7 @@ #include "tinsel/sched.h" // for PROCESS namespace Common { - class Serializer; +class Serializer; } namespace Tinsel { diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp index 33eee8bc98..5022f4757a 100644 --- a/engines/tinsel/pdisplay.cpp +++ b/engines/tinsel/pdisplay.cpp @@ -44,6 +44,8 @@ #include "tinsel/text.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- EXTERNAL GLOBAL DATA -------------------- diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp index 0811dae079..f49dddeef4 100644 --- a/engines/tinsel/polygons.cpp +++ b/engines/tinsel/polygons.cpp @@ -34,6 +34,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/rince.cpp index c0878b6849..38ac0a2ce6 100644 --- a/engines/tinsel/rince.cpp +++ b/engines/tinsel/rince.cpp @@ -47,6 +47,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 7a6b5877e8..b6935d41ab 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -36,6 +36,7 @@ #include "common/serializer.h" #include "common/savefile.h" +#include "common/textconsole.h" #include "gui/message.h" diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp index ef0f5cdc25..aa359d281f 100644 --- a/engines/tinsel/savescn.cpp +++ b/engines/tinsel/savescn.cpp @@ -48,6 +48,8 @@ #include "tinsel/tinlib.h" #include "tinsel/token.h" +#include "common/textconsole.h" + namespace Tinsel { //----------------- EXTERN FUNCTIONS -------------------- diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp index 80f4c585a7..b82bac32cc 100644 --- a/engines/tinsel/scene.cpp +++ b/engines/tinsel/scene.cpp @@ -51,6 +51,7 @@ #include "tinsel/sysvar.h" #include "tinsel/token.h" +#include "common/textconsole.h" namespace Tinsel { diff --git a/engines/tinsel/sched.cpp b/engines/tinsel/sched.cpp index 427e28826f..37c04abd22 100644 --- a/engines/tinsel/sched.cpp +++ b/engines/tinsel/sched.cpp @@ -30,6 +30,7 @@ #include "tinsel/polygons.h" #include "tinsel/sched.h" +#include "common/textconsole.h" #include "common/util.h" namespace Tinsel { diff --git a/engines/tinsel/scn.cpp b/engines/tinsel/scn.cpp index 17ae7c8687..20d75b6b93 100644 --- a/engines/tinsel/scn.cpp +++ b/engines/tinsel/scn.cpp @@ -24,9 +24,6 @@ * A (some would say very) small collection of utility functions. */ -#include "common/endian.h" -#include "common/util.h" - #include "tinsel/dw.h" #include "tinsel/film.h" #include "tinsel/handle.h" diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index 304223ed61..ec42ca5da4 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -35,9 +35,7 @@ #include "tinsel/sysvar.h" #include "tinsel/background.h" -#include "common/config-manager.h" #include "common/endian.h" -#include "common/file.h" #include "common/memstream.h" #include "common/system.h" diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp index aa303a5391..2dc0e833d1 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -31,6 +31,7 @@ #include "tinsel/scn.h" #include "common/file.h" #include "common/endian.h" +#include "common/textconsole.h" #include "gui/message.h" diff --git a/engines/tinsel/sysvar.cpp b/engines/tinsel/sysvar.cpp index ed4c99a560..ad795fd219 100644 --- a/engines/tinsel/sysvar.cpp +++ b/engines/tinsel/sysvar.cpp @@ -31,6 +31,8 @@ #include "tinsel/sysvar.h" #include "tinsel/tinsel.h" +#include "common/textconsole.h" + namespace Tinsel { // Return for SYS_Platform diff --git a/engines/tinsel/timers.cpp b/engines/tinsel/timers.cpp index 5f15cd9d3b..c1a4cd0ff5 100644 --- a/engines/tinsel/timers.cpp +++ b/engines/tinsel/timers.cpp @@ -31,7 +31,7 @@ #include "tinsel/timers.h" #include "tinsel/dw.h" #include "common/serializer.h" - +#include "common/textconsole.h" #include "common/system.h" namespace Tinsel { diff --git a/engines/tinsel/timers.h b/engines/tinsel/timers.h index 022604b662..1456d9a1d5 100644 --- a/engines/tinsel/timers.h +++ b/engines/tinsel/timers.h @@ -31,7 +31,7 @@ #include "tinsel/dw.h" namespace Common { - class Serializer; +class Serializer; } namespace Tinsel { diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp index 13b08a234c..afd409ce27 100644 --- a/engines/tinsel/tinlib.cpp +++ b/engines/tinsel/tinlib.cpp @@ -70,6 +70,7 @@ #include "tinsel/tinsel.h" #include "tinsel/token.h" +#include "common/textconsole.h" namespace Tinsel { diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index d78175d00c..20d4f1d31a 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -29,22 +29,14 @@ #include "common/events.h" #include "common/EventRecorder.h" #include "common/keyboard.h" -#include "common/file.h" #include "common/fs.h" -#include "common/savefile.h" #include "common/config-manager.h" #include "common/serializer.h" -#include "common/stream.h" #include "backends/audiocd/audiocd.h" #include "engines/util.h" -#include "graphics/cursorman.h" - -#include "base/plugins.h" -#include "base/version.h" - #include "tinsel/actors.h" #include "tinsel/background.h" #include "tinsel/bmv.h" @@ -911,10 +903,10 @@ Common::Error TinselEngine::run() { #else initGraphics(640, 432, true); #endif - _screenSurface.create(640, 432, 1); + _screenSurface.create(640, 432, Graphics::PixelFormat::createFormatCLUT8()); } else { initGraphics(320, 200, false); - _screenSurface.create(320, 200, 1); + _screenSurface.create(320, 200, Graphics::PixelFormat::createFormatCLUT8()); } g_eventRec.registerRandomSource(_random, "tinsel"); diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp index 6004aacead..856acbd986 100644 --- a/engines/toon/anim.cpp +++ b/engines/toon/anim.cpp @@ -23,6 +23,9 @@ * */ +#include "common/debug.h" +#include "common/rect.h" + #include "toon/anim.h" #include "toon/toon.h" #include "toon/tools.h" diff --git a/engines/toon/audio.cpp b/engines/toon/audio.cpp index c2e0bf7b20..026450d3c9 100644 --- a/engines/toon/audio.cpp +++ b/engines/toon/audio.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/audio.h" #include "common/memstream.h" #include "common/substream.h" diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index e63bc912c4..29a61ffd78 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -23,6 +23,9 @@ * */ +#include "common/debug.h" +#include "common/system.h" + #include "toon/character.h" #include "toon/drew.h" #include "toon/flux.h" diff --git a/engines/toon/drew.cpp b/engines/toon/drew.cpp index 4f8152833b..77333c4a9f 100644 --- a/engines/toon/drew.cpp +++ b/engines/toon/drew.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/drew.h" namespace Toon { diff --git a/engines/toon/flux.cpp b/engines/toon/flux.cpp index 034332af56..833fdbf5ce 100644 --- a/engines/toon/flux.cpp +++ b/engines/toon/flux.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/flux.h" namespace Toon { diff --git a/engines/toon/font.cpp b/engines/toon/font.cpp index 0e2d58ca83..9367d79036 100644 --- a/engines/toon/font.cpp +++ b/engines/toon/font.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/font.h" namespace Toon { diff --git a/engines/toon/hotspot.cpp b/engines/toon/hotspot.cpp index 0573e92fef..1c1e23e39e 100644 --- a/engines/toon/hotspot.cpp +++ b/engines/toon/hotspot.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/hotspot.h" #include "toon/tools.h" diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp index 4305abb62b..64b80c29b3 100644 --- a/engines/toon/movie.cpp +++ b/engines/toon/movie.cpp @@ -23,7 +23,16 @@ * */ +#include "common/debug.h" +#include "common/events.h" +#include "common/keyboard.h" +#include "common/stream.h" +#include "common/system.h" +#include "graphics/surface.h" + +#include "toon/audio.h" #include "toon/movie.h" +#include "toon/toon.h" namespace Toon { @@ -50,7 +59,7 @@ bool ToonstruckSmackerDecoder::loadFile(const Common::String &filename) { delete _surface; } _surface = new Graphics::Surface(); - _surface->create(640, 400, 1); + _surface->create(640, 400, Graphics::PixelFormat::createFormatCLUT8()); _header.flags = 4; } diff --git a/engines/toon/path.cpp b/engines/toon/path.cpp index e0cdf87502..26355863f6 100644 --- a/engines/toon/path.cpp +++ b/engines/toon/path.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/path.h" namespace Toon { @@ -407,7 +409,11 @@ void PathFinding::init(Picture *mask) { _height = mask->getHeight(); _currentMask = mask; _heap->unload(); - _heap->init(_width * _height); + // In order to reduce memory fragmentation on small devices, we use the maximum + // possible size here which is TOON_BACKBUFFER_WIDTH. Even though this is + // 1280 as opposed to the possible 640, it actually helps memory allocation on + // those devices. + _heap->init(TOON_BACKBUFFER_WIDTH * _height); // should really be _width delete[] _gridTemp; _gridTemp = new int32[_width*_height]; } diff --git a/engines/toon/picture.cpp b/engines/toon/picture.cpp index 1945f0fe45..ce28f9c68b 100644 --- a/engines/toon/picture.cpp +++ b/engines/toon/picture.cpp @@ -25,6 +25,9 @@ #include "toon/picture.h" #include "toon/tools.h" + +#include "common/debug.h" +#include "common/rect.h" #include "common/stack.h" namespace Toon { diff --git a/engines/toon/resource.cpp b/engines/toon/resource.cpp index b29aa3b72d..f9f65b423b 100644 --- a/engines/toon/resource.cpp +++ b/engines/toon/resource.cpp @@ -24,6 +24,7 @@ */ #include "toon/resource.h" +#include "common/debug.h" #include "common/file.h" #include "common/memstream.h" #include "common/substream.h" diff --git a/engines/toon/script.cpp b/engines/toon/script.cpp index 0242ace7e3..8703666781 100644 --- a/engines/toon/script.cpp +++ b/engines/toon/script.cpp @@ -23,10 +23,9 @@ * */ +#include "common/debug.h" #include "common/endian.h" #include "common/stream.h" -#include "common/util.h" -#include "common/system.h" #include "toon/toon.h" #include "toon/script.h" diff --git a/engines/toon/script_func.cpp b/engines/toon/script_func.cpp index b181591bf0..8f75097bd4 100644 --- a/engines/toon/script_func.cpp +++ b/engines/toon/script_func.cpp @@ -23,6 +23,9 @@ * */ +#include "common/debug.h" +#include "common/system.h" + #include "toon/script_func.h" #include "toon/script.h" #include "toon/state.h" diff --git a/engines/toon/state.cpp b/engines/toon/state.cpp index 0d6977842d..af37ea9e68 100644 --- a/engines/toon/state.cpp +++ b/engines/toon/state.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/state.h" #include "toon/toon.h" diff --git a/engines/toon/text.cpp b/engines/toon/text.cpp index f0d17dd34e..94a3ea5aa7 100644 --- a/engines/toon/text.cpp +++ b/engines/toon/text.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/text.h" namespace Toon { diff --git a/engines/toon/tools.cpp b/engines/toon/tools.cpp index da6e0f712e..ff72e69543 100644 --- a/engines/toon/tools.cpp +++ b/engines/toon/tools.cpp @@ -23,6 +23,8 @@ * */ +#include "common/debug.h" + #include "toon/tools.h" #include "toon/toon.h" diff --git a/engines/toon/toon.cpp b/engines/toon/toon.cpp index 5c8ca77b8b..81c4d313e4 100644 --- a/engines/toon/toon.cpp +++ b/engines/toon/toon.cpp @@ -33,6 +33,7 @@ #include "common/memstream.h" #include "engines/util.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "graphics/thumbnail.h" #include "gui/saveload.h" @@ -57,7 +58,7 @@ void ToonEngine::init() { _hotspots = new Hotspots(this); _mainSurface = new Graphics::Surface(); - _mainSurface->create(TOON_BACKBUFFER_WIDTH, TOON_BACKBUFFER_HEIGHT, 1); + _mainSurface->create(TOON_BACKBUFFER_WIDTH, TOON_BACKBUFFER_HEIGHT, Graphics::PixelFormat::createFormatCLUT8()); _finalPalette = new uint8[768]; _backupPalette = new uint8[768]; diff --git a/engines/touche/midi.h b/engines/touche/midi.h index f0f55e64e6..bde4950b93 100644 --- a/engines/touche/midi.h +++ b/engines/touche/midi.h @@ -34,7 +34,7 @@ class MidiParser; namespace Common { - class ReadStream; +class ReadStream; } namespace Touche { diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index 3c108e2931..93406dcb8b 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -24,6 +24,7 @@ */ +#include "common/textconsole.h" #include "audio/decoders/flac.h" #include "audio/mixer.h" diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index 73817a5a1a..42b68d015c 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -24,6 +24,7 @@ */ +#include "common/textconsole.h" #include "common/savefile.h" #include "touche/graphics.h" diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index 6b47a7fc4d..15a2b1c53a 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -28,13 +28,18 @@ #include "common/debug-channels.h" #include "common/events.h" #include "common/EventRecorder.h" -#include "common/file.h" #include "common/fs.h" #include "common/system.h" +#include "common/archive.h" +#include "common/debug.h" +#include "common/error.h" +#include "common/keyboard.h" +#include "common/textconsole.h" #include "engines/util.h" #include "graphics/cursorman.h" -#include "audio/mididrv.h" +#include "graphics/palette.h" +#include "gui/debugger.h" #include "touche/midi.h" #include "touche/touche.h" diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index 7183266cf4..c4358dc4b2 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -208,7 +208,7 @@ void SequenceManager::signal() { break; case 22: v1 = getNextValue(); - _sceneObject->setPriority2(v1); + _sceneObject->fixPriority(v1); break; case 23: v1 = getNextValue(); @@ -296,6 +296,8 @@ void SequenceManager::process(Event &event) { !event.handled && _globals->_sceneObjects->contains(&_sceneText)) { // Remove the text item _sceneText.remove(); + setDelay(2); + event.handled = true; } else { Action::process(event); } @@ -355,7 +357,7 @@ void SequenceManager::setMessage(int resNum, int lineNum, int color, const Commo // Set the text message _sceneText.setup(msg); _sceneText.setPosition(Common::Point(textRect.left, textRect.top)); - _sceneText.setPriority2(255); + _sceneText.fixPriority(255); _sceneText.show(); // Set the delay based on the number of words @@ -849,7 +851,7 @@ void Speaker::setText(const Common::String &msg) { _sceneText._textMode = _textMode; _sceneText.setup(msg); _sceneText.setPosition(_textPos); - _sceneText.setPriority2(256); + _sceneText.fixPriority(256); // Count the number of words (by spaces) in the string const char *msgP = msg.c_str(); diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index e56cadb68a..f03f10ffd2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -25,6 +25,7 @@ #include "common/system.h" #include "engines/engine.h" +#include "graphics/palette.h" #include "tsage/tsage.h" #include "tsage/core.h" #include "tsage/dialogs.h" @@ -556,7 +557,6 @@ void PlayerMover::pathfind(Common::Point *routeList, Common::Point srcPos, Commo } while (routeRegions[++idx] != destRegion); tempList[idx] = 1; - idx = 0; for (int listIndex = 1; listIndex <= endIndex; ++listIndex) { int var10 = tempList[listIndex]; int var12 = tempList[listIndex + 1]; @@ -1520,7 +1520,7 @@ void SceneItem::display(int resNum, int lineNum, ...) { _globals->_sceneText.setPosition(pos, 0); } - _globals->_sceneText.setPriority2(255); + _globals->_sceneText.fixPriority(255); _globals->_sceneObjects->draw(); } @@ -1585,7 +1585,7 @@ void NamedHotspot::doAction(int action) { } } -void NamedHotspot::setup(const int ys, const int xe, const int ye, const int xs, const int resnum, const int lookLineNum, const int useLineNum) { +void NamedHotspot::setup(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum) { setBounds(ys, xe, ye, xs); _resnum = resnum; _lookLineNum = lookLineNum; @@ -1593,6 +1593,13 @@ void NamedHotspot::setup(const int ys, const int xe, const int ye, const int xs, _globals->_sceneItems.addItems(this, NULL); } +void NamedHotspot::synchronise(Serialiser &s) { + SceneHotspot::synchronise(s); + s.syncAsSint16LE(_resnum); + s.syncAsSint16LE(_lookLineNum); + s.syncAsSint16LE(_useLineNum); +} + /*--------------------------------------------------------------------------*/ void SceneObjectWrapper::setSceneObject(SceneObject *so) { @@ -1794,7 +1801,7 @@ void SceneObject::setPriority(int priority) { } } -void SceneObject::setPriority2(int priority) { +void SceneObject::fixPriority(int priority) { if (priority == -1) { _flags &= ~OBJFLAG_FIXED_PRIORITY; } else { @@ -2238,7 +2245,7 @@ void SceneObject::setup(int visage, int stripFrameNum, int frameNum, int posX, i setStrip(stripFrameNum); setFrame(frameNum); setPosition(Common::Point(posX, posY), 0); - setPriority2(priority); + fixPriority(priority); } /*--------------------------------------------------------------------------*/ @@ -3309,7 +3316,7 @@ void WalkRegions::loadRevised() { */ int WalkRegions::indexOf(const Common::Point &pt, const Common::List<int> *indexList) { for (uint idx = 0; idx < _regionList.size(); ++idx) { - if ((!indexList || contains(*indexList, int(idx + 1))) && _regionList[idx].contains(pt)) + if ((!indexList || !contains(*indexList, int(idx + 1))) && _regionList[idx].contains(pt)) return idx + 1; } @@ -3449,8 +3456,7 @@ void SceneHandler::process(Event &event) { switch (event.kbd.keycode) { case Common::KEYCODE_F1: // F1 - Help - _globals->_events.setCursor(CURSOR_ARROW); - MessageDialog::show(HELP_MSG, OK_BTN_STRING); + MessageDialog::show((_vm->getFeatures() & GF_DEMO) ? DEMO_HELP_MSG : HELP_MSG, OK_BTN_STRING); break; case Common::KEYCODE_F2: { diff --git a/engines/tsage/core.h b/engines/tsage/core.h index e1ff95dcdd..45a39b24bb 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -432,9 +432,10 @@ public: int _resnum, _lookLineNum, _useLineNum; NamedHotspot() : SceneHotspot() {} - void setup(const int ys, const int xe, const int ye, const int xs, const int resnum, const int lookLineNum, const int useLineNum); + void setup(int ys, int xs, int ye, int xe, const int resnum, const int lookLineNum, const int useLineNum); virtual void doAction(int action); virtual Common::String getClassName() { return "NamedHotspot"; } + virtual void synchronise(Serialiser &s); }; enum AnimateMode {ANIM_MODE_NONE = 0, ANIM_MODE_1 = 1, ANIM_MODE_2 = 2, ANIM_MODE_3 = 3, @@ -529,7 +530,7 @@ public: void setFrame(int frameNum); void setFrame2(int frameNum); void setPriority(int priority); - void setPriority2(int priority); + void fixPriority(int priority); void setVisage(int visage); void setObjectWrapper(SceneObjectWrapper *objWrapper); void addMover(ObjectMover *mover, ...); diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index e8f0215e0e..eecc844292 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -24,8 +24,6 @@ */ #include "tsage/debugger.h" -#include "common/config-manager.h" -#include "common/endian.h" #include "tsage/globals.h" #include "tsage/graphics.h" #include "tsage/ringworld_logic.h" @@ -94,6 +92,8 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { Graphics::Surface destSurface = _globals->_sceneManager._scene->_backSurface.lockSurface(); // Loop through drawing each walk region in a different color to the background surface + Common::String regionsDesc; + for (uint regionIndex = 0; regionIndex < _globals->_walkRegions._regionList.size(); ++regionIndex, ++color) { WalkRegion &wr = _globals->_walkRegions._regionList[regionIndex]; @@ -104,6 +104,9 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { destSurface.hLine(sliceSet.items[idx].xs - _globals->_sceneOffset.x, yp, sliceSet.items[idx].xe - _globals->_sceneOffset.x, color); } + + regionsDesc += Common::String::format("Region #%d d bounds=%d,%d,%d,%d\n", + regionIndex, wr._bounds.left, wr._bounds.top, wr._bounds.right, wr._bounds.bottom); } // Release the surface @@ -112,6 +115,9 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) { // Mark the scene as requiring a full redraw _globals->_paneRefreshFlag[0] = 2; + DebugPrintf("Total regions = %d\n", _globals->_walkRegions._regionList.size()); + DebugPrintf("%s\n", regionsDesc.c_str()); + return false; } @@ -385,7 +391,7 @@ bool Debugger::Cmd_MoveObject(int argc, const char **argv) { * Give a specified item to the player */ bool Debugger::Cmd_Item(int argc, const char **argv) { - RING_INVENTORY._infoDisk._sceneNumber = 1; + RING_INVENTORY._stasisBox._sceneNumber = 1; return true; } diff --git a/engines/tsage/detection.cpp b/engines/tsage/detection.cpp index 5d34037b7b..ba7b459304 100644 --- a/engines/tsage/detection.cpp +++ b/engines/tsage/detection.cpp @@ -126,16 +126,18 @@ public: virtual SaveStateList listSaves(const char *target) const { Common::String pattern = target; - pattern += ".*"; + pattern += ".???"; Common::StringArray filenames = g_system->getSavefileManager()->listSavefiles(pattern); + sort(filenames.begin(), filenames.end()); tSage::tSageSavegameHeader header; SaveStateList saveList; for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) { - int slot; const char *ext = strrchr(file->c_str(), '.'); - if (ext && (slot = atoi(ext + 1)) >= 0 && slot < MAX_SAVES) { + int slot = ext ? atoi(ext + 1) : -1; + + if (slot >= 0 && slot < MAX_SAVES) { Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(*file); if (in) { diff --git a/engines/tsage/dialogs.cpp b/engines/tsage/dialogs.cpp index ba3a11f619..b5f00bf73c 100644 --- a/engines/tsage/dialogs.cpp +++ b/engines/tsage/dialogs.cpp @@ -24,11 +24,13 @@ */ #include "common/translation.h" + +#include "gui/dialog.h" +#include "gui/widget.h" + #include "tsage/tsage.h" #include "tsage/core.h" #include "tsage/dialogs.h" -#include "tsage/graphics.h" -#include "tsage/core.h" #include "tsage/staticres.h" #include "tsage/globals.h" #include "tsage/ringworld_logic.h" @@ -71,17 +73,12 @@ MessageDialog::MessageDialog(const Common::String &message, const Common::String int MessageDialog::show(const Common::String &message, const Common::String &btn1Message, const Common::String &btn2Message) { // Ensure that the cursor is the arrow - CursorType currentCursor = _globals->_events.getCursor(); - if (currentCursor != CURSOR_ARROW) - _globals->_events.setCursor(CURSOR_ARROW); + _globals->_events.pushCursor(CURSOR_ARROW); _globals->_events.showCursor(); int result = show2(message, btn1Message, btn2Message); - // If the cursor was changed, change it back - if (currentCursor != CURSOR_ARROW) - _globals->_events.setCursor(currentCursor); - + _globals->_events.popCursor(); return result; } @@ -96,7 +93,6 @@ int MessageDialog::show2(const Common::String &message, const Common::String &bt return result; } - /*--------------------------------------------------------------------------*/ ConfigDialog::ConfigDialog() : GUI::OptionsDialog("", "GlobalConfig") { @@ -416,10 +412,11 @@ InventoryDialog::InventoryDialog() { imgHeight = MAX(imgHeight, (int)itemSurface.getBounds().height()); // Add the item to the display list - _images.push_back(GfxInvImage()); - _images[_images.size() - 1].setDetails(invObject->_displayResNum, invObject->_rlbNum, invObject->_cursorNum); - _images[_images.size() - 1]._invObject = invObject; - add(&_images[_images.size() - 1]); + GfxInvImage *img = new GfxInvImage(); + _images.push_back(img); + img->setDetails(invObject->_displayResNum, invObject->_rlbNum, invObject->_cursorNum); + img->_invObject = invObject; + add(img); } } assert(_images.size() > 0); @@ -441,7 +438,7 @@ InventoryDialog::InventoryDialog() { cellX = 0; } - _images[idx]._bounds.moveTo(pt.x, pt.y); + _images[idx]->_bounds.moveTo(pt.x, pt.y); pt.x += imgWidth + 2; ++cellX; @@ -459,6 +456,11 @@ InventoryDialog::InventoryDialog() { setCenter(SCREEN_CENTER_X, SCREEN_CENTER_Y); } +InventoryDialog::~InventoryDialog() { + for (uint idx = 0; idx < _images.size(); ++idx) + delete _images[idx]; +} + void InventoryDialog::execute() { if ((RING_INVENTORY._selectedItem) && RING_INVENTORY._selectedItem->inInventory()) RING_INVENTORY._selectedItem->setCursor(); @@ -491,7 +493,7 @@ void InventoryDialog::execute() { if (!event.handled && event.eventType == EVENT_KEYPRESS) { if ((event.kbd.keycode == Common::KEYCODE_RETURN) || (event.kbd.keycode == Common::KEYCODE_ESCAPE)) { // Exit the dialog - hiliteObj = &_btnOk; + //hiliteObj = &_btnOk; break; } } diff --git a/engines/tsage/dialogs.h b/engines/tsage/dialogs.h index d7828526eb..c24fa2dd3b 100644 --- a/engines/tsage/dialogs.h +++ b/engines/tsage/dialogs.h @@ -105,11 +105,11 @@ public: class InventoryDialog : public ModalDialog { private: - Common::Array<GfxInvImage> _images; + Common::Array<GfxInvImage *> _images; GfxButton _btnOk, _btnLook; public: InventoryDialog(); - virtual ~InventoryDialog() {} + virtual ~InventoryDialog(); void execute(); static void show(); diff --git a/engines/tsage/events.cpp b/engines/tsage/events.cpp index a92cbb9df9..bcfff9fc1d 100644 --- a/engines/tsage/events.cpp +++ b/engines/tsage/events.cpp @@ -38,6 +38,7 @@ namespace tSage { EventsClass::EventsClass() { _currentCursor = CURSOR_NONE; + hideCursor(); _frameNumber = 0; _priorFrameTime = 0; _prevDelayFrame = 0; @@ -208,6 +209,62 @@ void EventsClass::setCursor(CursorType cursorType) { DEALLOCATE(cursor); } +void EventsClass::pushCursor(CursorType cursorType) { + const byte *cursor; + bool delFlag = true; + uint size; + + switch (cursorType) { + case CURSOR_CROSSHAIRS: + // Crosshairs cursor + cursor = _resourceManager->getSubResource(4, 1, 6, &size); + break; + + case CURSOR_LOOK: + // Look cursor + cursor = _resourceManager->getSubResource(4, 1, 5, &size); + break; + + case CURSOR_USE: + // Use cursor + cursor = _resourceManager->getSubResource(4, 1, 4, &size); + break; + + case CURSOR_TALK: + // Talk cursor + cursor = _resourceManager->getSubResource(4, 1, 3, &size); + break; + + case CURSOR_ARROW: + // Arrow cursor + cursor = CURSOR_ARROW_DATA; + delFlag = false; + break; + + case CURSOR_WALK: + default: + // Walk cursor + cursor = CURSOR_WALK_DATA; + delFlag = false; + break; + } + + // Decode the cursor + GfxSurface s = surfaceFromRes(cursor); + + Graphics::Surface surface = s.lockSurface(); + const byte *cursorData = (const byte *)surface.getBasePtr(0, 0); + CursorMan.pushCursor(cursorData, surface.w, surface.h, s._centroid.x, s._centroid.y, s._transColor); + s.unlockSurface(); + + if (delFlag) + DEALLOCATE(cursor); +} + +void EventsClass::popCursor() { + CursorMan.popCursor(); +} + void EventsClass::setCursor(Graphics::Surface &cursor, int transColor, const Common::Point &hotspot, CursorType cursorId) { const byte *cursorData = (const byte *)cursor.getBasePtr(0, 0); CursorMan.replaceCursor(cursorData, cursor.w, cursor.h, hotspot.x, hotspot.y, transColor); @@ -227,6 +284,10 @@ void EventsClass::hideCursor() { CursorMan.showMouse(false); } +bool EventsClass::isCursorVisible() const { + return CursorMan.isVisible(); +} + /** * Delays the game for the specified number of frames, if necessary, from the * previous time the delay method was called diff --git a/engines/tsage/events.h b/engines/tsage/events.h index ef0256e81f..90516b2353 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -82,11 +82,14 @@ public: CursorType _currentCursor; void setCursor(CursorType cursorType); + void pushCursor(CursorType cursorType); + void popCursor(); void setCursor(Graphics::Surface &cursor, int transColor, const Common::Point &hotspot, CursorType cursorId); void setCursorFromFlag(); CursorType getCursor() const { return _currentCursor; } void showCursor(); void hideCursor(); + bool isCursorVisible() const; bool pollEvent(); void waitForPress(int eventMask = EVENT_BUTTON_DOWN | EVENT_KEYPRESS); diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 00444f3672..3914d77185 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -43,6 +43,7 @@ static SavedObject *classFactoryProc(const Common::String &className) { if (className == "ObjectMover2") return new ObjectMover2(); if (className == "ObjectMover3") return new ObjectMover3(); if (className == "PlayerMover") return new PlayerMover(); + if (className == "SceneObjectWrapper") return new SceneObjectWrapper(); return NULL; } @@ -54,12 +55,21 @@ Globals::Globals() : _gfxManagerInstance(_screenSurface) { reset(); _stripNum = 0; - _gfxFontNumber = (_vm->getFeatures() & GF_DEMO) ? 0 : 50; - _gfxColors.background = 53; - _gfxColors.foreground = 18; - _fontColors.background = 51; - _fontColors.foreground = 54; + if (_vm->getFeatures() & GF_DEMO) { + _gfxFontNumber = 0; + _gfxColors.background = 6; + _gfxColors.foreground = 0; + _fontColors.background = 0; + _fontColors.foreground = 0; + _dialogCenter.y = 80; + } else { + _gfxFontNumber = 50; + _gfxColors.background = 53; + _gfxColors.foreground = 18; + _fontColors.background = 51; + _fontColors.foreground = 54; + } _screenSurface.setScreenSurface(); _gfxManagers.push_back(&_gfxManagerInstance); diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index f9f9e4b4ca..9d840bf00d 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -29,6 +29,7 @@ #include "tsage/tsage.h" #include "tsage/core.h" #include "common/algorithm.h" +#include "graphics/palette.h" #include "graphics/surface.h" #include "tsage/globals.h" @@ -257,7 +258,7 @@ void GfxSurface::create(int width, int height) { assert((width >= 0) && (height >= 0)); _screenSurface = false; _customSurface = new Graphics::Surface(); - _customSurface->create(width, height, 1); + _customSurface->create(width, height, Graphics::PixelFormat::createFormatCLUT8()); _bounds = Rect(0, 0, width, height); } @@ -282,7 +283,7 @@ Graphics::Surface GfxSurface::lockSurface() { result.w = _bounds.width(); result.h = _bounds.height(); result.pitch = src->pitch; - result.bytesPerPixel = src->bytesPerPixel; + result.format = src->format; result.pixels = src->getBasePtr(_bounds.left, _bounds.top); return result; @@ -331,7 +332,7 @@ GfxSurface &GfxSurface::operator=(const GfxSurface &s) { if (_customSurface) { // Surface owns the internal data, so replicate it so new surface owns it's own _customSurface = new Graphics::Surface(); - _customSurface->create(s._customSurface->w, s._customSurface->h, 1); + _customSurface->create(s._customSurface->w, s._customSurface->h, Graphics::PixelFormat::createFormatCLUT8()); const byte *srcP = (const byte *)s._customSurface->getBasePtr(0, 0); byte *destP = (byte *)_customSurface->getBasePtr(0, 0); diff --git a/engines/tsage/resources.cpp b/engines/tsage/resources.cpp index 5320a573b2..a73c23ab7f 100644 --- a/engines/tsage/resources.cpp +++ b/engines/tsage/resources.cpp @@ -200,11 +200,11 @@ struct DecodeReference { */ byte *TLib::getResource(uint16 id, bool suppressErrors) { // Scan for an entry for the given Id - ResourceEntry *re= NULL; - ResourceList::iterator i; - for (i = _resources.begin(); i != _resources.end(); ++i) { - if ((*i).id == id) { - re = &(*i); + ResourceEntry *re = NULL; + ResourceList::iterator iter; + for (iter = _resources.begin(); iter != _resources.end(); ++iter) { + if ((*iter).id == id) { + re = &(*iter); break; } } @@ -239,6 +239,9 @@ byte *TLib::getResource(uint16 id, bool suppressErrors) { uint16 word_48050 = 0, currentToken = 0, word_48054 =0; byte byte_49068 = 0, byte_49069 = 0; DecodeReference table[0x1000]; + for (int i = 0; i < 0x1000; ++i) { + table[i].vByte = table[i].vWord = 0; + } Common::Stack<uint16> tokenList; for (;;) { diff --git a/engines/tsage/resources.h b/engines/tsage/resources.h index b33cc37266..4ae41f6557 100644 --- a/engines/tsage/resources.h +++ b/engines/tsage/resources.h @@ -32,6 +32,7 @@ #include "common/list.h" #include "common/str.h" #include "common/str-array.h" +#include "common/textconsole.h" #include "common/util.h" #include "graphics/surface.h" diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 0a2220c690..c0cfe3a938 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -344,7 +344,7 @@ void SpeakerGText::setText(const Common::String &msg) { _sceneObject.postInit(); _sceneObject.setVisage(9405); _sceneObject.setStrip2(3); - _sceneObject.setPriority2(255); + _sceneObject.fixPriority(255); _sceneObject.changeZoom(100); _sceneObject._frame = 1; _sceneObject.setPosition(Common::Point(183, 71)); @@ -405,7 +405,7 @@ void SpeakerPOR::setText(const Common::String &msg) { _object3.setVisage(7223); _object3.setStrip(3); _object3.setPosition(Common::Point(119, 107), 0); - _object3.setPriority2(199); + _object3.fixPriority(199); _object3.setAction(&_action2); Speaker::setText(msg); @@ -425,7 +425,7 @@ void SpeakerOR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(9431); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(202, 147), 0); @@ -434,7 +434,7 @@ void SpeakerOR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(9431); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.setZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(199, 85), 0); @@ -605,7 +605,7 @@ void SpeakerSKL::setText(const Common::String &msg) { _object1.setVisage(7013); _object1.setStrip2(2); _object1._frame = 1; - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1.setPosition(Common::Point(203, 120)); _object1.animate(ANIM_MODE_7, 0, NULL); @@ -613,7 +613,7 @@ void SpeakerSKL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(7013); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(197, 80)); @@ -636,7 +636,7 @@ void SpeakerQL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2612); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(128, 146)); @@ -645,7 +645,7 @@ void SpeakerQL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2612); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(122, 84)); @@ -668,7 +668,7 @@ void SpeakerSR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2813); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(224, 198)); @@ -677,7 +677,7 @@ void SpeakerSR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2813); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(203, 96)); @@ -687,7 +687,7 @@ void SpeakerSR::setText(const Common::String &msg) { _object3.setVisage(2813); _object3.setStrip(3); _object3.setPosition(Common::Point(204, 91)); - _object3.setPriority2(199); + _object3.fixPriority(199); _object3._numFrames = 3; _object3.animate(ANIM_MODE_7, 0, NULL); @@ -709,7 +709,7 @@ void SpeakerSL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2812); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(95, 198)); @@ -718,7 +718,7 @@ void SpeakerSL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2812); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(116, 96)); @@ -741,7 +741,7 @@ void SpeakerQR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2613); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(191, 146)); @@ -750,7 +750,7 @@ void SpeakerQR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2613); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(197, 84)); @@ -773,7 +773,7 @@ void SpeakerQU::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(7021); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(116, 120), 0); @@ -782,7 +782,7 @@ void SpeakerQU::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(7021); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(111, 84), 0); @@ -804,14 +804,14 @@ void SpeakerCR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(9011); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.setPosition(Common::Point(219, 168)); _object1.animate(ANIM_MODE_7, 0, NULL); _object2.postInit(&_objectList); _object2.setVisage(9011); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.setPosition(Common::Point(232, 81)); _object2.setAction(&_speakerAction, NULL); @@ -831,7 +831,7 @@ void SpeakerMR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2713); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(220, 143)); @@ -840,7 +840,7 @@ void SpeakerMR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2713); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2._frame = 1; _object2.setPosition(Common::Point(215, 99)); _object2.setAction(&_speakerAction, NULL); @@ -862,7 +862,7 @@ void SpeakerSAL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2853); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(185, 200)); @@ -871,7 +871,7 @@ void SpeakerSAL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2853); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2._frame = 1; _object2.setPosition(Common::Point(170, 92)); _object2.setAction(&_speakerAction, NULL); @@ -892,7 +892,7 @@ void SpeakerML::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(2712); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(99, 143)); @@ -901,7 +901,7 @@ void SpeakerML::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(2712); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2._frame = 1; _object2.setPosition(Common::Point(105, 99)); _object2.setAction(&_speakerAction, NULL); @@ -922,7 +922,7 @@ void SpeakerCHFL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(4113); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(205, 116)); @@ -931,7 +931,7 @@ void SpeakerCHFL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(4113); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2._frame = 1; _object2.setPosition(Common::Point(202, 71)); _object2.setAction(&_speakerAction, NULL); @@ -952,7 +952,7 @@ void SpeakerCHFR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(4112); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(103, 116)); @@ -961,7 +961,7 @@ void SpeakerCHFR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(4112); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2._frame = 1; _object2.setPosition(Common::Point(106, 71)); _object2.setAction(&_speakerAction, NULL); @@ -982,7 +982,7 @@ void SpeakerPL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(4062); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(107, 117)); @@ -991,7 +991,7 @@ void SpeakerPL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(4062); _object2.setStrip2(1); - _object2.setPriority2(200); + _object2.fixPriority(200); _object2._frame = 1; _object2.setPosition(Common::Point(105, 62)); _object2.setAction(&_speakerAction, NULL); @@ -999,7 +999,7 @@ void SpeakerPL::setText(const Common::String &msg) { _object3.postInit(&_objectList); _object3.setVisage(4062); _object3.setStrip2(3); - _object3.setPriority2(255); + _object3.fixPriority(255); _object3._frame = 1; _object3.setPosition(Common::Point(105, 59)); _object3.setAction(&_speakerAction2, NULL); @@ -1025,7 +1025,7 @@ void SpeakerPR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(4063); _object1.setStrip2(1); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(212, 117)); @@ -1034,7 +1034,7 @@ void SpeakerPR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(4063); _object2.setStrip2(2); - _object2.setPriority2(200); + _object2.fixPriority(200); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(214, 62)); @@ -1043,7 +1043,7 @@ void SpeakerPR::setText(const Common::String &msg) { _object3.postInit(&_objectList); _object3.setVisage(4063); _object3.setStrip2(3); - _object3.setPriority2(255); + _object3.fixPriority(255); _object3.changeZoom(100); _object3._frame = 1; _object3.setPosition(Common::Point(214, 59)); @@ -1070,7 +1070,7 @@ void SpeakerCDR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(4163); _object1.setStrip2(1); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(208, 97)); @@ -1079,7 +1079,7 @@ void SpeakerCDR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(4163); _object2.setStrip2(2); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(200, 57)); @@ -1101,7 +1101,7 @@ void SpeakerCDL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(4162); _object1.setStrip2(1); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(112, 97)); @@ -1110,7 +1110,7 @@ void SpeakerCDL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(4162); _object2.setStrip2(2); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(115, 57)); @@ -1132,7 +1132,7 @@ void SpeakerFLL::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(5223); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(216, 129)); @@ -1141,7 +1141,7 @@ void SpeakerFLL::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(5223); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(210, 67)); @@ -1163,7 +1163,7 @@ void SpeakerBatR::setText(const Common::String &msg) { _object1.postInit(&_objectList); _object1.setVisage(5361); _object1.setStrip2(2); - _object1.setPriority2(255); + _object1.fixPriority(255); _object1.changeZoom(100); _object1._frame = 1; _object1.setPosition(Common::Point(137, 122)); @@ -1172,7 +1172,7 @@ void SpeakerBatR::setText(const Common::String &msg) { _object2.postInit(&_objectList); _object2.setVisage(5361); _object2.setStrip2(1); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2.changeZoom(100); _object2._frame = 1; _object2.setPosition(Common::Point(137, 104)); @@ -1319,6 +1319,8 @@ void RingworldGame::start() { // Switch to the title screen _globals->_sceneManager.setNewScene(1000); + + _globals->_events.showCursor(); } void RingworldGame::restart() { @@ -1407,6 +1409,8 @@ void RingworldGame::endGame(int resNum, int lineNum) { void RingworldDemoGame::start() { // Start the demo's single scene _globals->_sceneManager.changeScene(1); + + _globals->_events.setCursor(CURSOR_NONE); } void RingworldDemoGame::restart() { diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index fd51670fb8..9811cd52d3 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -149,20 +149,20 @@ void Scene10::postInit(SceneObjectList *OwnerList) { _object1.postInit(); _object1.setVisage(10); _object1.setPosition(Common::Point(232, 90)); - _object1.setPriority2(1); + _object1.fixPriority(1); _object2.postInit(); _object2.setVisage(10); _object2.setStrip(4); _object2.setFrame(1); _object2.setPosition(Common::Point(204, 59)); - _object2.setPriority2(198); + _object2.fixPriority(198); _object3.postInit(); _object3.setVisage(10); _object3.setStrip2(5); _object3.setPosition(Common::Point(180, 87)); - _object3.setPriority2(196); + _object3.fixPriority(196); _object3.setAction(&_action2); _object4.postInit(); @@ -565,7 +565,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(20); _globals->_player.setPosition(Common::Point(588, 79)); _globals->_player._moveDiff = Common::Point(5, 5); - _globals->_player.setPriority2(50); + _globals->_player.fixPriority(50); _globals->_player.animate(ANIM_MODE_1, NULL); _SceneObjectExt.postInit(); @@ -599,7 +599,7 @@ void Scene20::postInit(SceneObjectList *OwnerList) { _globals->_player.animate(ANIM_MODE_NONE, NULL); _globals->_player.setStrip2(1); _globals->_player.setFrame2(4); - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); _globals->_player.setPosition(Common::Point(425, 233)); setAction(&_action1); @@ -901,7 +901,7 @@ void Scene30::postInit(SceneObjectList *OwnerList) { _beam.setVisage(31); _beam.setStrip(2); _beam.setPosition(Common::Point(124, 178)); - _beam.setPriority2(188); + _beam.fixPriority(188); // Set up door object _door.postInit(); @@ -927,7 +927,7 @@ void Scene30::signal() { _beam.setVisage(31); _beam.setStrip(2); _beam.setPosition(Common::Point(124, 178)); - _beam.setPriority2(188); + _beam.fixPriority(188); _globals->_sceneItems.push_front(&_beam); _globals->_player.enableControl(); } else if (_sceneMode == 32) { @@ -1090,7 +1090,7 @@ void Scene40::Action2::signal() { scene->_doorway.postInit(); scene->_doorway.setVisage(16); scene->_doorway.setStrip2(6); - scene->_doorway.setPriority2(200); + scene->_doorway.fixPriority(200); scene->_doorway.setPosition(Common::Point(159, 191)); scene->_doorway._moveDiff = Common::Point(40, 40); scene->_doorway._moveRate = 60; @@ -1300,11 +1300,11 @@ void Scene40::Action8::signal() { scene->_doorway.postInit(); scene->_doorway.setVisage(16); scene->_doorway.setStrip2(6); - scene->_doorway.setPriority2(200); + scene->_doorway.fixPriority(200); scene->_doorway._moveRate = 60; if (_globals->_player._position.x >= 145) { - scene->_doorway.setPriority2(-1); + scene->_doorway.fixPriority(-1); scene->_doorway.setPosition(Common::Point(6, 157)); } else { scene->_doorway.setPosition(Common::Point(313, 53)); @@ -1492,14 +1492,14 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _object2.setVisage(41); _object2.setStrip(6); - _object2.setPriority2(200); + _object2.fixPriority(200); _object2.setPosition(Common::Point(94, 189)); _object2.setAction(&_action5); _object3.postInit(); _object3.setVisage(41); _object3.setStrip(5); - _object3.setPriority2(205); + _object3.fixPriority(205); _object3.setPosition(Common::Point(110, 186)); _object3._numFrames = 2; _object3.animate(ANIM_MODE_8, NULL, NULL); @@ -1512,7 +1512,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _dyingKzin.setVisage(40); _dyingKzin.setStrip(6); _dyingKzin.setPosition(Common::Point(-90, 65)); - _dyingKzin.setPriority2(170); + _dyingKzin.fixPriority(170); setAction(&_action1); } else { @@ -1525,7 +1525,7 @@ void Scene40::postInit(SceneObjectList *OwnerList) { _dyingKzin.postInit(); _dyingKzin.setVisage(40); _dyingKzin.setPosition(Common::Point(205, 183)); - _dyingKzin.setPriority2(170); + _dyingKzin.fixPriority(170); _dyingKzin._frame = 9; _dyingKzin.setAction(&_action7); @@ -1792,19 +1792,19 @@ void Scene50::postInit(SceneObjectList *OwnerList) { _object2.setVisage(2331); _object2.setStrip(6); _object2.setPosition(Common::Point(136, 192)); - _object2.setPriority2(200); + _object2.fixPriority(200); _object3.postInit(); _object3.setVisage(2337); _object3.setStrip(6); _object3.setPosition(Common::Point(260, 180)); - _object3.setPriority2(200); + _object3.fixPriority(200); _object4.postInit(); _object4.setVisage(2331); _object4.setStrip(6); _object4.setPosition(Common::Point(295, 144)); - _object4.setPriority2(178); + _object4.fixPriority(178); _globals->_sceneItems.addItems(&_object2, &_object3, &_object4, NULL); @@ -2649,7 +2649,7 @@ void Scene90::postInit(SceneObjectList *OwnerList) { _object3.setVisage(90); _object3.animate(ANIM_MODE_1, NULL); _object3.setPosition(Common::Point(196, 181)); - _object3.setPriority2(175); + _object3.fixPriority(175); _globals->_sceneItems.push_back(&_object3); _globals->_player.disableControl(); @@ -2879,7 +2879,7 @@ void Scene6100::Action3::signal() { break; case 1: _globals->_scenePalette.clearListeners(); - scene->_fadePercent = 0; + scene->_fadePercent = 100; _globals->_scenePalette.refresh(); scene->loadScene(9997); scene->_object1.hide(); @@ -2890,7 +2890,7 @@ void Scene6100::Action3::signal() { scene->_sunflower3.hide(); scene->_rocks.hide(); scene->_sceneText.hide(); - + _globals->_events.setCursor(CURSOR_WALK); scene->_stripManager.start(8120, this); break; @@ -2995,39 +2995,39 @@ void Scene6100::Action5::dispatch() { } scene->_objList[idx]->_flags |= OBJFLAG_PANES; -/* + if ((idx != 3) && (scene->_fadePercent == 100) && - (tempSet.sqrt(floatSet) < 150.0)) { + (tempSet.sqrt(zeroSet) < 150.0)) { switch (scene->_hitCount++) { case 1: scene->_soundHandler.startSound(233); - scene->showMessage(0, NULL, 0); + scene->showMessage(NULL, 0, NULL); if (!_globals->getFlag(76)) - scene->_object5.setAction(&scene->_action2); + scene->_probe.setAction(&scene->_action2); + break; case 2: scene->_soundHandler.startSound(234); - scene->showMessage(0, NULL, 0); + scene->showMessage(NULL, 0, NULL); if (!_globals->getFlag(76)) - scene->_object5.setAction(NULL); + scene->_probe.setAction(NULL); scene->setAction(&scene->_action3); break; default: scene->_soundHandler.startSound(233); - scene->showMessage(0, NULL, 0); + scene->showMessage(NULL, 0, NULL); if (!_globals->getFlag(76)) - scene->_object5.setAction(&scene->_action1); + scene->_probe.setAction(&scene->_action1); break; } _globals->_scenePalette.clearListeners(); scene->_fadePercent = 0; } - */ } } @@ -3129,6 +3129,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { loadScene(6100); Scene::postInit(); setZoomPercents(62, 2, 200, 425); + _globals->_sceneHandler._delayTicks = 8; _globals->_player.disableControl(); _globals->_events.setCursor(CURSOR_WALK); @@ -3140,28 +3141,28 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { _object1._frame = 1; _object1._strip = 4; _object1.setPosition(Common::Point(0, 60)); - _object1.setPriority2(1); + _object1.fixPriority(1); _object2.postInit(); _object2.setVisage(6100); _object2._frame = 1; _object2._strip = 4; _object2.setPosition(Common::Point(160, 60)); - _object2.setPriority2(1); + _object2.fixPriority(1); _object3.postInit(); _object3.setVisage(6100); _object3._frame = 1; _object3._strip = 4; _object3.setPosition(Common::Point(320, 60)); - _object3.setPriority2(1); + _object3.fixPriority(1); _rocks.postInit(); _rocks.setVisage(6100); _rocks._frame = 1; _rocks._strip = 3; _rocks.setPosition(Common::Point(320, 0)); - _rocks.setPriority2(2); + _rocks.fixPriority(2); _rocks.changeZoom(-1); _rocks._floats._float1 = 320.0; _rocks._floats._float2 = 25000.0; @@ -3173,7 +3174,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { _probe._frame = 1; _probe._strip = 5; _probe.setPosition(Common::Point(160, 260)); - _probe.setPriority2(3); + _probe.fixPriority(3); _probe._floats._float1 = 320.0; _probe._floats._float2 = 0.0; _probe._floats._float3 = 0.0; @@ -3198,7 +3199,7 @@ void Scene6100::postInit(SceneObjectList *OwnerList) { _objList[idx]->setPosition(Common::Point( _globals->_randomSource.getRandomNumber(319), 60)); - _objList[idx]->setPriority2(1); + _objList[idx]->fixPriority(1); _objList[idx]->changeZoom(-1); } diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index 045ea71586..d16c332a8c 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -38,7 +38,8 @@ Scene2::Scene2() : Scene() { /*--------------------------------------------------------------------------*/ void Object9350::postInit(SceneObjectList *OwnerList) { - _globals->_sceneManager.postInit(&_globals->_sceneManager._altSceneObjects); + //SceneObject::postInit(&_globals->_sceneManager._altSceneObjects); + SceneObject::postInit(OwnerList); } void Object9350::draw() { @@ -66,7 +67,7 @@ void Scene9100::SceneHotspot1::doAction(int action) { _globals->_player.disableControl(); scene->_sceneMode = 9105; } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, 0); + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, &scene->_object5, &scene->_object6, NULL); } else { NamedHotspot::doAction(action); } @@ -77,16 +78,16 @@ void Scene9100::dispatch() { if (!_action) { if (_globals->_player._position.x < 25) { - if (!_globals->getFlag(11)) { - scene->_sceneMode = 9106; - } else { - scene->_sceneMode = 9108; + _globals->_player.disableControl(); + if (!_globals->getFlag(23) || _globals->getFlag(11)) + _sceneMode = 9106; + else { + _sceneMode = 9108; _globals->setFlag(11); } - } else { - scene->_sceneMode = 9106; + + scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, NULL); } - scene->setAction(&scene->_sequenceManager, scene, scene->_sceneMode, &_globals->_player, 0); } else { Scene::dispatch(); } @@ -102,7 +103,7 @@ void Scene9100::signal() { _globals->_sceneManager.changeScene(9150); break; case 9105: - _sceneHotspot1.remove(); + _sceneHotspot3.remove(); // No break on purpose case 9103: case 9104: @@ -115,17 +116,15 @@ void Scene9100::signal() { } void Scene9100::postInit(SceneObjectList *OwnerList) { - Scene9100 *scene = (Scene9100 *)_globals->_sceneManager._scene; - Scene::postInit(); setZoomPercents(0, 100, 200, 100); _object1.postInit(); _object1.setVisage(9100); _object1._strip = 1; _object1._numFrames = 6; - _object1.setPosition(Common::Point(297, 132), 0); + _object1.setPosition(Common::Point(279, 132), 0); _object1.animate(ANIM_MODE_2, 0); - _object1.setPriority2(10); + _object1.fixPriority(10); _globals->_player.postInit(); @@ -146,7 +145,7 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _object6.setVisage(9111); _object6.setStrip(6); _object6.setFrame(1); - _object6.setPosition(Common::Point(138, 166), 0); + _object6.setPosition(Common::Point(138, 166)); _sceneHotspot3.setup(145, 125, 166, 156, 9100, 40, 43); } _sceneHotspot1.setup(140, 176, 185, 215, 9100, 36, 37); @@ -163,17 +162,17 @@ void Scene9100::postInit(SceneObjectList *OwnerList) { _sceneMode = 9107; else _sceneMode = 9109; - setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object5, 0); + setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object5, NULL); } else { _sceneMode = 9103; _globals->_player.disableControl(); - setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, 0); + setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL); _globals->setFlag(20); } } else { _sceneMode = 9102; _globals->_player.disableControl(); - setAction(&scene->_sequenceManager, scene, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, 0); + setAction(&_sequenceManager, this, _sceneMode, &_globals->_player, &_object2, &_object3, &_object4, &_object5, NULL); } } @@ -224,7 +223,7 @@ void Scene9150::dispatch() { if ((_sceneState != 0) && (_sceneBounds.left == 0)) { _object3._timer = 0; _sceneState = 0; - _sceneHotspot3.setAction(&_sequenceManager2, 0, 9154, &_object3, 0); + _object3.setAction(&_sequenceManager2, NULL, 9154, &_object3, NULL); _sceneHotspot10.remove(); } @@ -308,16 +307,16 @@ void Scene9200::SceneHotspot1::doAction(int action) { _globals->_player.disableControl(); if (_globals->getFlag(93)) { scene->_sceneState = 9214; - setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); } else { _globals->setFlag(93); scene->_sceneState = 9213; - setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9213, &_globals->_player, &scene->_object2, 0); } } else if (action <= 100) { _globals->_player.disableControl(); scene->_sceneState = 9214; - setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); + scene->setAction(&scene->_sequenceManager, scene, 9214, &_globals->_player, &scene->_object2, 0); } else { NamedHotspot::doAction(action); } @@ -405,7 +404,7 @@ void Scene9200::postInit(SceneObjectList *OwnerList) { _object1._strip = 3; _object1.animate(ANIM_MODE_2, 0); _object1.setPosition(Common::Point(132, 114), 0); - _object1.setPriority2(140); + _object1.fixPriority(140); _soundHandler.startSound(297); _stripManager.addSpeaker(&_speakerQText); _stripManager.addSpeaker(&_speakerGR); @@ -589,7 +588,7 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { setZoomPercents(95, 80, 200, 100); _globals->_player.postInit(); - _object1.setup(9350, 1, 3, 139, 97, 0); + _object1.setup(9351, 1, 3, 139, 97, 0); _sceneHotspot1.setup(42, 0, 97, 60, 9350, 0, -1); _sceneHotspot2.setup(37, 205, 82, 256, 9350, 0, -1); _sceneHotspot3.setup(29, 93, 92, 174, 9350, 1, -1); @@ -602,22 +601,22 @@ void Scene9350::postInit(SceneObjectList *OwnerList) { if (_globals->_sceneManager._previousScene == 9360) { _globals->_player.disableControl(); _sceneState = 9352; - setAction(&_sequenceManager, this, 9352, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9352, &_globals->_player, &_object2, NULL); } else if (_globals->_sceneManager._previousScene == 9400) { _globals->_player.disableControl(); _sceneState = 9353; - setAction(&_sequenceManager, this, 9353, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9353, &_globals->_player, &_object2, NULL); } else { - if (!_globals->getFlag(84)) { + if (_globals->getFlag(84)) { _globals->clearFlag(84); _object2.postInit(); _globals->_player.disableControl(); _sceneState = 9359; - setAction(&_sequenceManager, this, 9359, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9359, &_globals->_player, &_object2, NULL); } else { _globals->_player.disableControl(); _sceneState = 9354; - setAction(&_sequenceManager, this, 9354, &_globals->_player, &_object2, 0); + setAction(&_sequenceManager, this, 9354, &_globals->_player, &_object2, NULL); } } } @@ -713,6 +712,7 @@ void Scene9400::SceneHotspot7::doAction(int action) { if ((action == CURSOR_USE) && (RING_INVENTORY._straw._sceneNumber != 1)) { scene->_sceneState = 1; + RING_INVENTORY._straw._sceneNumber = 1; scene->setAction(&scene->_sequenceManager, scene, 9408, &_globals->_player, 0); } else { NamedHotspot::doAction(action); @@ -825,7 +825,7 @@ void Scene9400::postInit(SceneObjectList *OwnerList) { void Scene9450::Object2::signal() { Scene9450 *scene = (Scene9450 *)_globals->_sceneManager._scene; - this->setAction(&scene->_sequenceManager3, this, 9458, &scene->_object1, 0); + this->setAction(&scene->_sequenceManager3, this, 9458, this, &scene->_object1, 0); } void Scene9450::Object3::dispatch() { @@ -841,7 +841,7 @@ void Scene9450::Hotspot1::doAction(int action) { scene->_object2._action->remove(); scene->_sceneMode = 9459; _globals->_player.disableControl(); - setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0); + scene->setAction(&scene->_sequenceManager1, scene, 9459, &scene->_object2, &scene->_object1, &scene->_object3, &_globals->_player, 0); } else { NamedHotspot::doAction(action); } @@ -918,7 +918,9 @@ void Scene9450::signal() { _globals->_sceneManager.changeScene(9360); break; case 9459: + RING_INVENTORY._tunic._sceneNumber = 1; _object2.signal(); + _globals->_player.enableControl(); _globals->_events.setCursor(CURSOR_WALK); _hotspot1.remove(); break; @@ -967,7 +969,7 @@ void Scene9450::postInit(SceneObjectList *OwnerList) { } else { _object2.setPosition(Common::Point(184, 144), 0); _object2.setVisage(9451); - _object2.setPriority2(250); + _object2.fixPriority(250); _object2._strip = 5; _object2._frame = 10; } @@ -1079,6 +1081,7 @@ void Scene9500::signal() { break; case 9505: _candle.setStrip(2); + RING_INVENTORY._candle._sceneNumber = 1; _globals->_player.enableControl(); break; case 9506: @@ -1086,6 +1089,7 @@ void Scene9500::signal() { _globals->_player.enableControl(); break; case 9511: + RING_INVENTORY._helmet._sceneNumber = 1; _globals->_player.enableControl(); if (!_globals->getFlag(51)) { _globals->setFlag(51); @@ -1140,7 +1144,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _object3.postInit(0); _object3.hide(); - _object3.setPriority2(150); + _object3.fixPriority(150); _object3.setPosition(Common::Point(166, 133)); if (RING_INVENTORY._straw._sceneNumber == 9500) { _object3.show(); @@ -1164,7 +1168,7 @@ void Scene9500::postInit(SceneObjectList *OwnerList) { _object2.setStrip(1); _object2.setFrame(_object2.getFrameCount()); _object2.setPosition(Common::Point(303, 130)); - _object2.setPriority2(132); + _object2.fixPriority(132); if (RING_INVENTORY._helmet._sceneNumber == 1) { _hotspot2.setup(87, 294, 104, 314, 9400, 17, -1); } else { @@ -1243,7 +1247,7 @@ void Scene9700::signal() { } void Scene9700::process(Event &event) { - if ((event.eventType == EVENT_BUTTON_DOWN) && (event.kbd.keycode == 0)) { + if ((event.eventType == EVENT_BUTTON_DOWN) && !_action) { if (_gfxButton1.process(event)) { _globals->_sceneManager.changeScene(9200); } else if (_globals->_events._currentCursor == OBJECT_SCANNER) { @@ -1545,7 +1549,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objDoor.setStrip(1); _objDoor.setFrame(1); _objDoor.setPosition(Common::Point(28, 118), 0); - _objDoor.setPriority2(90); + _objDoor.fixPriority(90); _objLever.postInit(); _objLever.setVisage(9850); @@ -1557,7 +1561,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objCloak.setVisage(9850); _objCloak.setStrip(5); _objCloak.setFrame(1); - _objCloak.setPriority2(90); + _objCloak.fixPriority(90); _objCloak.setPosition(Common::Point(157, 81), 0); if (RING_INVENTORY._cloak._sceneNumber != 9850) _objCloak.hide(); @@ -1566,7 +1570,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objJacket.setVisage(9850); _objJacket.setStrip(5); _objJacket.setFrame(2); - _objJacket.setPriority2(90); + _objJacket.fixPriority(90); _objJacket.setPosition(Common::Point(201, 84)); if (RING_INVENTORY._jacket._sceneNumber != 9850) _objJacket.hide(); @@ -1575,7 +1579,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objTunic2.setVisage(9850); _objTunic2.setStrip(5); _objTunic2.setFrame(3); - _objTunic2.setPriority2(90); + _objTunic2.fixPriority(90); _objTunic2.setPosition(Common::Point(295, 90)); if (RING_INVENTORY._tunic2._sceneNumber != 9850) _objTunic2.hide(); @@ -1586,7 +1590,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objScimitar.setStrip(2); _objScimitar.setFrame(1); _objScimitar.setPosition(Common::Point(55, 83), 0); - _objScimitar.setPriority2(80); + _objScimitar.fixPriority(80); _objScimitar.hide(); } @@ -1596,7 +1600,7 @@ void Scene9850::postInit(SceneObjectList *OwnerList) { _objSword.setStrip(3); _objSword.setFrame(1); _objSword.setPosition(Common::Point(56, 101), 0); - _objSword.setPriority2(80); + _objSword.fixPriority(80); _objSword.hide(); } @@ -1708,7 +1712,7 @@ void Scene9900::strAction2::signal() { _txtArray1[_txtArray1Index].setup(msg); _txtArray1[_txtArray1Index]._moveRate = 20; _txtArray1[_txtArray1Index]._moveDiff.y = 2; - _txtArray1[_txtArray1Index].setPriority2(255); + _txtArray1[_txtArray1Index].fixPriority(255); int frameWidth = _txtArray1[_txtArray1Index].getFrame().getBounds().width(); int frameHeight = _txtArray1[_txtArray1Index].getFrame().getBounds().height(); _txtArray1[_txtArray1Index].setPosition(Common::Point((320 - frameWidth) / 2, 200)); @@ -1725,7 +1729,7 @@ void Scene9900::strAction2::signal() { _txtArray2[_txtArray1Index].setup(msg); _txtArray2[_txtArray1Index]._moveRate = 20; _txtArray2[_txtArray1Index]._moveDiff.y = 2; - _txtArray2[_txtArray1Index].setPriority2(255); + _txtArray2[_txtArray1Index].fixPriority(255); frameWidth = _txtArray2[_txtArray1Index].getFrame().getBounds().width(); _txtArray2[_txtArray1Index].setPosition(Common::Point((320 - frameWidth) / 2, 200 + frameHeight)); } else { @@ -1834,7 +1838,7 @@ void Scene9900::signal() { _object8.setVisage(2002); _object8.setStrip(1); _object8.setFrame(1); - _object8.setPriority2(200); + _object8.fixPriority(200); _object8.setPosition(Common::Point(64, 199)); _globals->_player.disableControl(); _sceneMode = 9908; @@ -2021,7 +2025,7 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { _globals->_player.postInit(); _globals->_player.setVisage(1303); _globals->_player.setStrip2(1); - _globals->_player.setPriority2(250); + _globals->_player.fixPriority(250); _globals->_player.animate(ANIM_MODE_2, 0); _globals->_player.setPosition(Common::Point(194, 98), 0); _globals->_player._numFrames = 20; @@ -2030,13 +2034,13 @@ void Scene9999::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _object2.setVisage(1303); _object2.setStrip2(2); - _object2.setPriority2(2); + _object2.fixPriority(2); _object2.setPosition(Common::Point(164, 149), 0); _object3.postInit(); _object3.setVisage(1303); _object3.setStrip2(2); - _object3.setPriority2(2); + _object3.fixPriority(2); _object3.setFrame(2); _object3.setPosition(Common::Point(292, 149), 0); _object3.setAction(&_action3); diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp index 3e3686e2d5..6a8db81adf 100644 --- a/engines/tsage/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld_scenes2.cpp @@ -23,6 +23,7 @@ * */ +#include "common/config-manager.h" #include "tsage/ringworld_scenes2.h" #include "tsage/scenes.h" #include "tsage/tsage.h" @@ -112,20 +113,22 @@ void Scene1000::Action3::signal() { setDelay(240); break; case 5: { - // WORKAROUND: At this point, the original used the presence of a file called 'Intro.txt' - // to determine whether the introduction has been played the first time the game was started. - // In ScummVM, we don't like creating any files that aren't explicitly savegames, so the - // game startup will always show the Start Play / Introduction buttons, even when the game - // is played for the first time - - // Prompt user for whether to start play or watch introduction - _globals->_player.enableControl(); - - if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { - _actionIndex = 20; - _globals->_soundHandler.proc1(this); - } else { + const char *SEEN_INTRO = "seen_intro"; + if (!ConfMan.hasKey(SEEN_INTRO) || !ConfMan.getBool(SEEN_INTRO)) { + // First time being played, so show the introduction + ConfMan.setBool(SEEN_INTRO, true); + ConfMan.flushToDisk(); setDelay(1); + } else { + // Prompt user for whether to start play or watch introduction + _globals->_player.enableControl(); + + if (MessageDialog::show2(WATCH_INTRO_MSG, START_PLAY_BTN_STRING, INTRODUCTION_BTN_STRING) == 0) { + _actionIndex = 20; + _globals->_soundHandler.proc1(this); + } else { + setDelay(1); + } } _globals->_player.disableControl(); @@ -434,7 +437,7 @@ void Scene1001::Action1::signal() { scene->_object6.setStrip2(6); scene->_object6.setFrame2(2); scene->_object6._moveDiff = Common::Point(20, 20); - scene->_object6.setPriority2(20); + scene->_object6.fixPriority(20); scene->_object6.setPosition(Common::Point(scene->_object2._position.x - 6, scene->_object2._position.y + 7)); scene->_object6.animate(ANIM_MODE_5, NULL); @@ -453,7 +456,7 @@ void Scene1001::Action1::signal() { scene->_object7.setFrame2(1); scene->_object7._moveDiff = Common::Point(20, 20); scene->_object7.setPosition(Common::Point(scene->_object3._position.x - 28, scene->_object3._position.y - 11)); - scene->_object7.setPriority2(200); + scene->_object7.fixPriority(200); scene->_object7.animate(ANIM_MODE_5, NULL); Common::Point pt(scene->_object7._position.x - 70, scene->_object7._position.y - 70); @@ -468,7 +471,7 @@ void Scene1001::Action1::signal() { scene->_object5.setVisage(16); scene->_object5.setPosition(Common::Point(306, 93)); scene->_object5._strip = 3; - scene->_object5.setPriority2(200); + scene->_object5.fixPriority(200); scene->_object5.animate(ANIM_MODE_2, NULL); setDelay(30); break; @@ -633,7 +636,7 @@ void Scene1250::postInit(SceneObjectList *OwnerList) { _object2.setVisage(1250); _object2.setPosition(Common::Point(126, 69)); _object2.setStrip2(2); - _object2.setPriority2(255); + _object2.fixPriority(255); _object2._frame = 1; _object2.setAction(&_action2); @@ -766,7 +769,7 @@ void Scene1400::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(1401); _globals->_player.animate(ANIM_MODE_2, 0); _globals->_player.setStrip2(4); - _globals->_player.setPriority2(4); + _globals->_player.fixPriority(4); _globals->_player.disableControl(); _globals->_player._moveDiff = Common::Point(4, 2); @@ -869,7 +872,7 @@ void Scene1500::Action2::signal() { case 1: { scene->_object2.postInit(); scene->_object2.setVisage(1502); - scene->_object2.setPriority2(255); + scene->_object2.fixPriority(255); scene->_object2.changeZoom(5); scene->_object2._frame = 1; scene->_object2._moveDiff = Common::Point(1, 1); diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 4ed2d98662..13dfc1a40b 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -405,7 +405,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { _object9.setStrip2(3); _object9.setFrame(4); _object9.setPosition(Common::Point(136, 86)); - _object9.setPriority2(190); + _object9.fixPriority(190); _object9.hide(); _object10.postInit(); @@ -413,7 +413,7 @@ void Scene2000::postInit(SceneObjectList *OwnerList) { _object10.setStrip2(5); _object10.setFrame(4); _object10.setPosition(Common::Point(202, 86)); - _object10.setPriority2(195); + _object10.fixPriority(195); _object10.hide(); switch (_globals->_sceneManager._previousScene) { @@ -519,7 +519,7 @@ void Scene2100::Action1::signal() { setDelay(3); break; case 5: - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); scene->_area1.display(); scene->_area2.display(); scene->_area3.display(); @@ -578,7 +578,7 @@ void Scene2100::Action1::signal() { } break; case 7: - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); scene->_soundHandler.startSound(162); scene->_object1.animate(ANIM_MODE_6, this); break; @@ -684,6 +684,7 @@ void Scene2100::Action5::signal() { } void Scene2100::Action6::signal() { + // Seeker stands up and walks to the elevator Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -699,14 +700,14 @@ void Scene2100::Action6::signal() { Common::Point pt(130, 116); NpcMover *mover = new NpcMover(); - scene->_object2.addMover(mover, &pt, NULL); + scene->_object2.addMover(mover, &pt, this); break; } case 1: { - scene->_object2.setPriority2(-1); + scene->_object2.fixPriority(-1); Common::Point pt(153, 67); NpcMover *mover = new NpcMover(); - scene->_object2.addMover(mover, &pt, NULL); + scene->_object2.addMover(mover, &pt, this); break; } case 2: @@ -835,7 +836,7 @@ void Scene2100::Action10::signal() { scene->_object3.setVisage(2705); scene->_object3.setStrip2(-1); scene->_object3.changeZoom(-1); - scene->_object3.setPriority2(-1); + scene->_object3.fixPriority(-1); scene->_object3.setPosition(Common::Point(260, 156)); scene->_object3.setObjectWrapper(new SceneObjectWrapper()); scene->_object3.animate(ANIM_MODE_1, NULL); @@ -852,30 +853,30 @@ void Scene2100::Action10::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 6: { - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); Common::Point pt(144, 54); NpcMover *mover = new NpcMover(); _globals->_player.addMover(mover, &pt, this); break; } case 7: { - scene->_object3.setPriority2(2); + scene->_object3.fixPriority(2); Common::Point pt1(163, 55); NpcMover *mover1 = new NpcMover(); scene->_object3.addMover(mover1, &pt1, NULL); - scene->_object2.setPriority2(2); + scene->_object2.fixPriority(2); Common::Point pt2(158, 55); NpcMover *mover2 = new NpcMover(); scene->_object2.addMover(mover2, &pt2, this); break; } case 8: - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setStrip(1); - scene->_object3.setPriority2(1); + scene->_object3.fixPriority(1); scene->_object3.setStrip(2); - scene->_object2.setPriority2(2); + scene->_object2.fixPriority(2); scene->_object2.setStrip(3); setDelay(45); @@ -893,6 +894,7 @@ void Scene2100::Action10::signal() { } void Scene2100::Action11::signal() { + // Miranda stands up and walks to the elevator Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -911,7 +913,7 @@ void Scene2100::Action11::signal() { scene->_object3.setVisage(2705); scene->_object3.setStrip2(-1); scene->_object3.changeZoom(-1); - scene->_object3.setPriority2(-1); + scene->_object3.fixPriority(-1); scene->_object3.setPosition(Common::Point(260, 156)); scene->_object3.setObjectWrapper(new SceneObjectWrapper()); scene->_object3.animate(ANIM_MODE_1, NULL); @@ -928,12 +930,12 @@ void Scene2100::Action11::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 4: { - scene->_object3.setPriority2(1); + scene->_object3.fixPriority(1); Common::Point pt1(163, 55); NpcMover *mover1 = new NpcMover(); scene->_object3.addMover(mover1, &pt1, NULL); - scene->_object2.setPriority2(1); + scene->_object2.fixPriority(1); Common::Point pt2(158, 55); NpcMover *mover2 = new NpcMover(); scene->_object2.addMover(mover2, &pt2, this); @@ -987,12 +989,12 @@ void Scene2100::Action12::signal() { scene->_soundHandler.startSound(162); scene->_object1.animate(ANIM_MODE_6, NULL); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); Common::Point pt1(277, 84); PlayerMover *mover1 = new PlayerMover(); _globals->_player.addMover(mover1, &pt1, this); - scene->_object2.setPriority2(-1); + scene->_object2.fixPriority(-1); Common::Point pt2(255, 76); PlayerMover *mover2 = new PlayerMover(); scene->_object2.addMover(mover2, &pt2, this); @@ -1020,6 +1022,8 @@ void Scene2100::Action12::signal() { case 10: if (_globals->getFlag(74)) setDelay(1); + else + setAction(&scene->_sequenceManager, this, 2101, &_globals->_player, NULL); break; case 11: scene->_stripManager.start(2170, this); @@ -1050,7 +1054,7 @@ void Scene2100::Action13::signal() { setDelay(6); break; case 1: { - scene->_object2.setPriority2(113); + scene->_object2.fixPriority(113); Common::Point pt(178, 116); PlayerMover *mover = new PlayerMover(); scene->_object2.addMover(mover, &pt, this); @@ -1123,7 +1127,7 @@ void Scene2100::Action14::signal() { scene->_object3.setVisage(2705); scene->_object3.setStrip2(-1); scene->_object3.changeZoom(-1); - scene->_object3.setPriority2(-1); + scene->_object3.fixPriority(-1); scene->_object3.setPosition(Common::Point(260, 156)); scene->_object3.setObjectWrapper(new SceneObjectWrapper()); scene->_object3.animate(ANIM_MODE_1, NULL); @@ -1147,7 +1151,7 @@ void Scene2100::Action14::signal() { scene->_object3.setStrip(2); setDelay(30); case 13: - scene->_object3.setPriority2(1); + scene->_object3.fixPriority(1); scene->_soundHandler.startSound(162); scene->_object1.animate(ANIM_MODE_6, this); break; @@ -1174,14 +1178,14 @@ void Scene2100::Action15::signal() { scene->_object3.animate(ANIM_MODE_1, NULL); scene->_object3.setObjectWrapper(new SceneObjectWrapper()); scene->_object3.setPosition(Common::Point(157, 56)); - scene->_object3.setPriority2(1); + scene->_object3.fixPriority(1); scene->_object3.changeZoom(-1); scene->_soundHandler.startSound(162); scene->_object1.animate(ANIM_MODE_5, this); break; case 2: { - scene->_object3.setPriority2(-1); + scene->_object3.fixPriority(-1); Common::Point pt(177, 68); NpcMover *mover = new NpcMover(); scene->_object3.addMover(mover, &pt, this); @@ -1203,7 +1207,7 @@ void Scene2100::Action15::signal() { break; } case 5: { - scene->_object3.setPriority2(156); + scene->_object3.fixPriority(156); Common::Point pt(260, 156); NpcMover *mover = new NpcMover(); @@ -1258,7 +1262,7 @@ void Scene2100::Action16::signal() { break; } case 7: - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setStrip(3); setDelay(45); break; @@ -1342,6 +1346,7 @@ void Scene2100::Hotspot2::doAction(int action) { } void Scene2100::Hotspot3::doAction(int action) { + // Computer, on the left Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (action) { @@ -1442,6 +1447,7 @@ void Scene2100::Hotspot14::doAction(int action) { } void Scene2100::Object1::doAction(int action) { + // Elevator Scene2100 *scene = (Scene2100 *)_globals->_sceneManager._scene; switch (action) { @@ -1555,7 +1561,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object1.setVisage(2100); _object1.animate(ANIM_MODE_NONE, NULL); _object1.setPosition(Common::Point(157, 57)); - _object1.setPriority(5); + _object1.fixPriority(5); _hotspot3.postInit(); _hotspot3.setVisage(2101); @@ -1563,7 +1569,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _hotspot3.animate(ANIM_MODE_2, NULL); _hotspot3.setPosition(Common::Point(53, 44)); _hotspot3.changeZoom(100); - _hotspot3.setPriority2(1); + _hotspot3.fixPriority(1); _hotspot4.postInit(); _hotspot4.setVisage(2101); @@ -1572,7 +1578,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _hotspot4.animate(ANIM_MODE_8, 0, NULL); _hotspot4.setPosition(Common::Point(274, 52)); _hotspot4.changeZoom(100); - _hotspot4.setPriority2(1); + _hotspot4.fixPriority(1); _hotspot5.postInit(); _hotspot5.setVisage(2101); @@ -1581,13 +1587,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _hotspot5.animate(ANIM_MODE_8, 0, NULL); _hotspot5.setPosition(Common::Point(219, 141)); _hotspot5.changeZoom(100); - _hotspot5.setPriority2(160); + _hotspot5.fixPriority(160); _hotspot6.postInit(); _hotspot6.setVisage(2101); _hotspot6._frame = 1; _hotspot6._strip = 5; - _hotspot6.setPriority2(175); + _hotspot6.fixPriority(175); _hotspot6.animate(ANIM_MODE_8, 0, NULL); _hotspot6.setPosition(Common::Point(97, 142)); _hotspot6.changeZoom(100); @@ -1599,7 +1605,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _hotspot7.animate(ANIM_MODE_NONE, NULL); _hotspot7.setPosition(Common::Point(133, 46)); _hotspot7.changeZoom(100); - _hotspot7.setPriority2(1); + _hotspot7.fixPriority(1); _hotspot8.postInit(); _hotspot8.setVisage(2101); @@ -1608,16 +1614,16 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _hotspot8.animate(ANIM_MODE_8, 0, NULL); _hotspot8.setPosition(Common::Point(20, 45)); _hotspot8.changeZoom(100); - _hotspot8.setPriority2(1); + _hotspot8.fixPriority(1); _hotspot2.postInit(); _hotspot2.setVisage(2101); _hotspot2._frame = 1; - _hotspot2._strip = 7; + _hotspot2._strip = 8; _hotspot2.animate(ANIM_MODE_8, 0, NULL); _hotspot2.setPosition(Common::Point(88, 41)); _hotspot2.changeZoom(100); - _hotspot2.setPriority2(1); + _hotspot2.fixPriority(1); _hotspot11.setBounds(Rect(139, 74, 173, 96)); _hotspot10.setBounds(Rect(71, 100, 91, 135)); @@ -1633,7 +1639,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object3.setPosition(Common::Point(246, 156)); _object3.animate(ANIM_MODE_NONE, NULL); _object3.changeZoom(100); - _object3.setPriority2(156); + _object3.fixPriority(156); _object3.setVisage(2107); _object3.setStrip(1); _object3.setAction(&_action2); @@ -1647,7 +1653,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object2.setPosition(Common::Point(150, 100)); _object2.animate(ANIM_MODE_NONE, NULL); _object2.changeZoom(100); - _object2.setPriority2(113); + _object2.fixPriority(113); _object2.setAction(&_action3); _globals->_sceneItems.push_back(&_object2); } @@ -1666,7 +1672,14 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _area4._pt = Common::Point(237, 77); _globals->_player.postInit(); - _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); + if (_globals->getFlag(13)) { + _globals->_player.setVisage(2170); + _globals->_player._moveDiff.y = 1; + } else { + _globals->_player.setVisage(0); + _globals->_player._moveDiff.y = 3; + } + _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player._moveDiff.x = 4; @@ -1678,13 +1691,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { case 2120: _globals->_soundHandler.startSound(160); _globals->_soundHandler.proc5(true); - _object1.setPriority2(-1); - _globals->_player.setPriority2(-1); + _object1.fixPriority(-1); + _globals->_player.fixPriority(-1); _globals->_player.setPosition(Common::Point(80, 66)); _globals->_player.enableControl(); break; case 2150: - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(157, 56)); _sceneMode = 2104; setAction(&_sequenceManager, this, 2104, &_globals->_player, &_object1, NULL); @@ -1693,13 +1706,13 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { if (_globals->_sceneObjects->contains(&_object3)) _object3.remove(); - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(144, 55)); _object2.setVisage(2806); _object2.changeZoom(-1); _object2.setPosition(Common::Point(158, 55)); - _object2.setPriority2(1); + _object2.fixPriority(1); _object2.setAction(NULL); _object2.setObjectWrapper(new SceneObjectWrapper()); _object2.animate(ANIM_MODE_1, NULL); @@ -1711,7 +1724,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { if (_globals->_sceneObjects->contains(&_object3)) _object3.remove(); - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(144, 55)); _object2.postInit(); @@ -1719,7 +1732,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _object2.setStrip(1); _object2.changeZoom(-1); _object2.setPosition(Common::Point(158, 55)); - _object2.setPriority2(1); + _object2.fixPriority(1); _object2.setAction(NULL); _object2.setObjectWrapper(new SceneObjectWrapper()); _object2.animate(ANIM_MODE_1, NULL); @@ -1727,7 +1740,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { setAction(&_action12); } else if (_globals->_stripNum == 6100) { _globals->_player.setPosition(Common::Point(157, 56)); - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _object4.postInit(); _object4.setVisage(2102); @@ -1754,11 +1767,11 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player._angle = 225; _globals->_player.setStrip(6); _globals->_player.setFrame(1); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.setPosition(Common::Point(272, 127)); _object3.setPosition(Common::Point(246, 156)); - _object3.setPriority2(156); + _object3.fixPriority(156); _sceneMode = 2105; setAction(&_sequenceManager, this, 2105, &_object3, NULL); break; @@ -1770,7 +1783,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.setPriority2(152); + _globals->_player.fixPriority(152); _globals->_player.setStrip(2); _object4.postInit(); @@ -1790,11 +1803,11 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.setStrip(3); _globals->_player.setFrame(1); - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(157, 56)); _object3.setPosition(Common::Point(246, 156)); - _object3.setPriority2(156); + _object3.fixPriority(156); setAction(&_action5); break; @@ -1804,7 +1817,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.setPriority2(152); + _globals->_player.fixPriority(152); _globals->_player.setStrip(2); _field1800 = 1; @@ -1822,7 +1835,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_soundHandler.proc5(true); if (RING_INVENTORY._stasisBox2._sceneNumber == 1) { - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(157, 56)); _object4.postInit(); @@ -1838,7 +1851,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.setPriority2(152); + _globals->_player.fixPriority(152); _globals->_player.setStrip(2); _field1800 = 1; @@ -1852,7 +1865,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { if (_globals->_sceneObjects->contains(&_object2)) _object2.remove(); - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); _globals->_player.setPosition(Common::Point(157, 56)); setAction(&_action8); @@ -1864,7 +1877,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.setPriority2(152); + _globals->_player.fixPriority(152); _globals->_player.setStrip(2); _sceneMode = 2106; @@ -1877,7 +1890,7 @@ void Scene2100::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2104); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(65, 149)); - _globals->_player.setPriority2(152); + _globals->_player.fixPriority(152); _globals->_player.setStrip(2); _object4.postInit(); @@ -2474,7 +2487,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot7.animate(ANIM_MODE_8, NULL); _hotspot7.setPosition(Common::Point(122, 62)); _hotspot7.changeZoom(100); - _hotspot7.setPriority2(76); + _hotspot7.fixPriority(76); _hotspot2.postInit(); _hotspot2.setVisage(2151); @@ -2483,7 +2496,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot2.animate(ANIM_MODE_NONE, NULL); _hotspot2.setPosition(Common::Point(257, 67)); _hotspot2.changeZoom(100); - _hotspot2.setPriority2(60); + _hotspot2.fixPriority(60); _hotspot1.postInit(); _hotspot1.setVisage(2151); @@ -2492,7 +2505,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot1.animate(ANIM_MODE_NONE, NULL); _hotspot1.setPosition(Common::Point(158, 99)); _hotspot1.changeZoom(100); - _hotspot1.setPriority2(99); + _hotspot1.fixPriority(99); _hotspot4.postInit(); _hotspot4.setVisage(2150); @@ -2501,7 +2514,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _hotspot4.animate(ANIM_MODE_NONE, NULL); _hotspot4.setPosition(Common::Point(218, 200)); _hotspot4.changeZoom(100); - _hotspot4.setPriority2(200); + _hotspot4.fixPriority(200); _hotspot10.postInit(); _hotspot10.setVisage(2152); @@ -2515,7 +2528,7 @@ void Scene2150::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(_globals->getFlag(13) ? 2170 : 0); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.changeZoom(-1); _globals->_player._moveDiff.y = 3; @@ -2907,7 +2920,7 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot8.setVisage(2840); _hotspot8.setStrip(2); _hotspot8.setPosition(Common::Point(96, 184)); - _hotspot8.setPriority2(236); + _hotspot8.fixPriority(236); _globals->_player.postInit(); _globals->_player.setVisage(2640); @@ -2930,19 +2943,19 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot1.postInit(); _hotspot1.setVisage(2202); _hotspot1.setPosition(Common::Point(175, 173)); - _hotspot1.setPriority2(99); + _hotspot1.fixPriority(99); _hotspot3.postInit(); _hotspot3.setVisage(2202); _hotspot3._strip = 2; _hotspot3.setPosition(Common::Point(152, 76)); - _hotspot3.setPriority2(100); + _hotspot3.fixPriority(100); _hotspot4.postInit(); _hotspot4.setVisage(2202); _hotspot4._strip = 3; _hotspot4.setPosition(Common::Point(115, 76)); - _hotspot4.setPriority2(200); + _hotspot4.fixPriority(200); setAction(&_action1); break; @@ -2959,7 +2972,7 @@ void Scene2200::postInit(SceneObjectList *OwnerList) { _hotspot4.setVisage(2215); _hotspot4._strip = 2; _hotspot4.setPosition(Common::Point(120, 78)); - _hotspot4.setPriority2(255); + _hotspot4.fixPriority(255); _globals->_sceneItems.push_back(&_hotspot4); _soundHandler1.startSound(101); @@ -3197,7 +3210,7 @@ void Scene2230::Action2::signal() { case 2: _globals->_player.setVisage(2235); _globals->_player.setStrip2(1); - _globals->_player.setPriority2(100); + _globals->_player.fixPriority(100); _globals->_player._frame = 1; _globals->_player.setPosition(Common::Point(200, 68)); _globals->_player.animate(ANIM_MODE_5, this); @@ -3241,7 +3254,7 @@ void Scene2230::Action3::signal() { _globals->_player.setVisage(0); _globals->_player.setStrip2(-1); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.setPosition(Common::Point(164, 96)); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player._canWalk = true; @@ -3284,7 +3297,7 @@ void Scene2230::Action5::signal() { break; } case 2: - _globals->_player.setPriority2(1430); + _globals->_player.fixPriority(1430); _globals->_player.setVisage(2232); _globals->_player._strip = 1; _globals->_player._frame = 1; @@ -3306,7 +3319,7 @@ void Scene2230::Action6::signal() { case 0: _globals->_player._strip = 2; _globals->_player._frame = 1; - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.animate(ANIM_MODE_5, this); break; case 1: @@ -3359,7 +3372,7 @@ void Scene2230::Action7::signal() { scene->_hotspot2.setVisage(2231); scene->_hotspot2._strip = 3; scene->_hotspot2.setPosition(Common::Point(166, 116)); - scene->_hotspot2.setPriority2(131); + scene->_hotspot2.fixPriority(131); scene->_hotspot2.animate(ANIM_MODE_5, this); scene->_hotspot8._frame = 2; @@ -3425,7 +3438,7 @@ void Scene2230::Action8::signal() { scene->_hotspot2._strip = 3; scene->_hotspot2._frame = scene->_hotspot2.getFrameCount(); scene->_hotspot2.setPosition(Common::Point(166, 116)); - scene->_hotspot2.setPriority2(131); + scene->_hotspot2.fixPriority(131); scene->_hotspot2.animate(ANIM_MODE_6, this); break; case 4: { @@ -3688,7 +3701,7 @@ void Scene2230::postInit(SceneObjectList *OwnerList) { _hotspot8.animate(ANIM_MODE_NONE, 0); _hotspot8.setPosition(Common::Point(164, 133)); _hotspot8.changeZoom(100); - _hotspot8.setPriority2(129); + _hotspot8.fixPriority(129); _rect1 = Rect(59, 64, 89, 74); @@ -3766,7 +3779,7 @@ void Scene2280::Action1::signal() { setDelay(10); break; case 4: - _globals->_player.setPriority2(1); + _globals->_player.fixPriority(1); scene->_soundHandler.startSound(162); scene->_hotspot16.animate(ANIM_MODE_6, this); break; @@ -3849,7 +3862,7 @@ void Scene2280::Action3::signal() { scene->_hotspot12._strip = 2; scene->_hotspot12._frame = 3; scene->_hotspot12.setPosition(Common::Point(88, 76)); - scene->_hotspot12.setPriority2(1); + scene->_hotspot12.fixPriority(1); _globals->_player.animate(ANIM_MODE_6, this); break; @@ -3867,7 +3880,7 @@ void Scene2280::Action3::signal() { scene->_hotspot8.animate(ANIM_MODE_NONE, NULL); scene->_hotspot8.setPosition(Common::Point(79, 108)); scene->_hotspot8.changeZoom(100); - scene->_hotspot8.setPriority2(1); + scene->_hotspot8.fixPriority(1); scene->_hotspot10.postInit(); scene->_hotspot10.setVisage(2280); @@ -3876,7 +3889,7 @@ void Scene2280::Action3::signal() { scene->_hotspot10.animate(ANIM_MODE_NONE, NULL); scene->_hotspot10.setPosition(Common::Point(79, 104)); scene->_hotspot10.changeZoom(100); - scene->_hotspot10.setPriority2(1); + scene->_hotspot10.fixPriority(1); _globals->clearFlag(13); @@ -3939,7 +3952,7 @@ void Scene2280::Action4::signal() { scene->_hotspot17.animate(ANIM_MODE_NONE, NULL); scene->_hotspot17.setPosition(Common::Point(162, 39)); scene->_hotspot17.changeZoom(100); - scene->_hotspot17.setPriority2(1); + scene->_hotspot17.fixPriority(1); RING_INVENTORY._medkit._sceneNumber = 2280; _globals->_sceneItems.push_front(&scene->_hotspot17); @@ -3952,7 +3965,7 @@ void Scene2280::Action4::signal() { scene->_hotspot18.animate(ANIM_MODE_NONE, NULL); scene->_hotspot18.setPosition(Common::Point(152, 43)); scene->_hotspot18.changeZoom(100); - scene->_hotspot18.setPriority2(1); + scene->_hotspot18.fixPriority(1); RING_INVENTORY._scanner._sceneNumber = 2280; _globals->_sceneItems.push_front(&scene->_hotspot18); @@ -4221,14 +4234,14 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot16.postInit(); _hotspot16.setVisage(2281); _hotspot16.setPosition(Common::Point(208, 90)); - _hotspot16.setPriority2(80); + _hotspot16.fixPriority(80); if (RING_INVENTORY._medkit._sceneNumber == 2280) { _hotspot17.postInit(); _hotspot17.setVisage(2161); _hotspot17._strip = 2; _hotspot17.setPosition(Common::Point(162, 39)); - _hotspot17.setPriority2(1); + _hotspot17.fixPriority(1); _globals->_sceneItems.push_back(&_hotspot17); } @@ -4239,7 +4252,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot18._strip = 2; _hotspot18._frame = 2; _hotspot17.setPosition(Common::Point(152, 43)); - _hotspot17.setPriority2(1); + _hotspot17.fixPriority(1); _globals->_sceneItems.push_back(&_hotspot17); } @@ -4249,21 +4262,21 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot8.setVisage(2280); _hotspot8._strip = 2; _hotspot8.setPosition(Common::Point(79, 108)); - _hotspot8.setPriority2(1); + _hotspot8.fixPriority(1); _hotspot10.postInit(); _hotspot10.setVisage(2280); _hotspot10._strip = 2; _hotspot10._frame = 2; _hotspot10.setPosition(Common::Point(79, 104)); - _hotspot10.setPriority2(2); + _hotspot10.fixPriority(2); _hotspot12.postInit(); _hotspot12.setVisage(2280); _hotspot12._strip = 2; _hotspot12._frame = 3; _hotspot12.setPosition(Common::Point(88, 76)); - _hotspot12.setPriority2(1); + _hotspot12.fixPriority(1); _globals->_sceneItems.addItems(&_hotspot8, &_hotspot10, &_hotspot12, NULL); } @@ -4273,19 +4286,19 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _hotspot9.postInit(); _hotspot9.setVisage(2280); _hotspot9.setPosition(Common::Point(104, 96)); - _hotspot9.setPriority2(1); + _hotspot9.fixPriority(1); _hotspot11.postInit(); _hotspot11.setVisage(2280); _hotspot11._frame = 2; _hotspot11.setPosition(Common::Point(130, 79)); - _hotspot11.setPriority2(1); + _hotspot11.fixPriority(1); _hotspot13.postInit(); _hotspot13.setVisage(2280); _hotspot13._frame = 3; _hotspot13.setPosition(Common::Point(113, 63)); - _hotspot13.setPriority2(1); + _hotspot13.fixPriority(1); _hotspot1.setBounds(Rect(225, 70, 234, 80)); _hotspot2.setBounds(Rect(44, 78, 56, 105)); @@ -4310,7 +4323,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { _globals->_player.enableControl(); } else { _globals->setFlag(109); - _globals->_player.setPriority2(76); + _globals->_player.fixPriority(76); _globals->_player.disableControl(); _sceneMode = 2281; @@ -4329,7 +4342,7 @@ void Scene2280::postInit(SceneObjectList *OwnerList) { void Scene2280::signal() { if (_sceneMode == 2281) { - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.enableControl(); } } @@ -4454,8 +4467,8 @@ void Scene2300::Action1::signal() { scene->_hotspot6._frame = 1; scene->_hotspot5.animate(ANIM_MODE_5, NULL); scene->_hotspot6.animate(ANIM_MODE_5, NULL); - scene->_hotspot5.setPriority2(20); - scene->_hotspot6.setPriority2(20); + scene->_hotspot5.fixPriority(20); + scene->_hotspot6.fixPriority(20); _globals->_player.setVisage(2672); _globals->_player._strip = 5; @@ -4626,7 +4639,7 @@ void Scene2300::Action4::signal() { scene->_hotspot9.setStrip2(2); scene->_hotspot9.setFrame(3); scene->_hotspot9.setPosition(Common::Point(273, 199)); - scene->_hotspot9.setPriority2(19); + scene->_hotspot9.fixPriority(19); scene->_hotspot9.animate(ANIM_MODE_5, this); scene->_soundHandler1.startSound(11); break; @@ -4727,7 +4740,7 @@ void Scene2300::postInit(SceneObjectList *OwnerList) { _hotspot9.setStrip2(2); _hotspot9._frame = _hotspot9.getFrameCount(); _hotspot9.setPosition(Common::Point(273, 199)); - _hotspot9.setPriority2(1); + _hotspot9.fixPriority(1); _hotspot10.postInit(); _hotspot10.setVisage(2301); @@ -4882,14 +4895,14 @@ void Scene2310::signal() { _sceneText._color1 = 35; _sceneText._fontNumber = 2; _sceneText.setup(msg); - _sceneText.setPriority2(255); + _sceneText.fixPriority(255); _sceneText.setPosition(Common::Point(30, 20)); break; } case 1: { Common::String msg = _resourceManager->getMessage(2300, 23); _sceneText.setup(msg); - _sceneText.setPriority2(255); + _sceneText.fixPriority(255); _sceneText.setPosition(Common::Point(30, 170)); _globals->_sceneObjects->draw(); @@ -5033,7 +5046,7 @@ void Scene2320::Action2::signal() { switch (_actionIndex++) { case 0: { scene->_soundHandler.startSound(253); - scene->_hotspot13.setPriority2(99); + scene->_hotspot13.fixPriority(99); Common::Point pt(scene->_hotspot13._position.x, 200); NpcMover *mover = new NpcMover(); @@ -5068,7 +5081,7 @@ void Scene2320::Action3::signal() { break; } case 3: - _globals->_player.setPriority2(scene->_hotspot6._priority - 1); + _globals->_player.fixPriority(scene->_hotspot6._priority - 1); _globals->_player._strip = 3; setDelay(10); break; @@ -5122,7 +5135,7 @@ void Scene2320::Action3::signal() { break; case 5: { if (_state == 2320) - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); else _globals->_sceneManager.changeScene(_state); @@ -5165,13 +5178,13 @@ void Scene2320::Action4::signal() { break; case 3: _globals->_player.animate(ANIM_MODE_6, NULL); - scene->setAction(&scene->_action2); + setAction(&scene->_action2, this); break; case 4: { scene->_hotspot16.postInit(); scene->_hotspot16.setVisage(2331); scene->_hotspot16.setStrip(3); - scene->_hotspot16.setPriority2(149); + scene->_hotspot16.fixPriority(149); scene->_hotspot16.setPosition(Common::Point(320, 202)); scene->_hotspot16.show(); @@ -5181,14 +5194,14 @@ void Scene2320::Action4::signal() { break; } case 5: { - scene->_hotspot16.setPriority2(200); + scene->_hotspot16.fixPriority(200); Common::Point pt(320, 180); NpcMover *mover = new NpcMover(); scene->_hotspot16.addMover(mover, &pt, this); break; } case 6: { - scene->_hotspot16.setPriority2(-1); + scene->_hotspot16.fixPriority(-1); _globals->_player.setVisage(0); _globals->_player.animate(ANIM_MODE_1, NULL); @@ -5262,7 +5275,7 @@ void Scene2320::Action4::signal() { } case 17: { _globals->_player.animate(ANIM_MODE_6, NULL); - scene->_hotspot16.setPriority2(160); + scene->_hotspot16.fixPriority(160); Common::Point pt(320, 121); NpcMover *mover = new NpcMover(); @@ -5290,7 +5303,7 @@ void Scene2320::Action4::signal() { _globals->_player.setVisage(0); _globals->_player.animate(ANIM_MODE_1, NULL); - scene->_hotspot13.setPriority2(1); + scene->_hotspot13.fixPriority(1); remove(); break; } @@ -5320,7 +5333,7 @@ void Scene2320::Action5::signal() { _globals->_player.setVisage(2347); _globals->_player.setStrip(1); _globals->_player.setFrame(1); - _globals->_player.setPriority2(137); + _globals->_player.fixPriority(137); _globals->_player.animate(ANIM_MODE_5, this); break; case 5: @@ -5376,7 +5389,7 @@ void Scene2320::Action6::signal() { case 3: _globals->_player.setVisage(0); _globals->_player.setStrip(3); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.animate(ANIM_MODE_1, NULL); @@ -5432,12 +5445,12 @@ void Scene2320::Action7::signal() { scene->_hotspot6.animate(ANIM_MODE_5, this); break; case 2: - scene->_hotspot10.setPriority2(-1); + scene->_hotspot10.fixPriority(-1); ADD_MOVER_NULL(scene->_hotspot10, 321, 94); - scene->_hotspot11.setPriority2(-1); + scene->_hotspot11.fixPriority(-1); ADD_MOVER_NULL(scene->_hotspot11, 346, 85); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); ADD_MOVER(_globals->_player, 297, 89); break; case 3: @@ -5454,10 +5467,6 @@ void Scene2320::Action7::signal() { case 6: ADD_MOVER_NULL(scene->_hotspot10, 491, 160); ADD_MOVER(_globals->_player, 391, 88); - - _globals->_player.setStrip(1); - _globals->_player.setFrame(1); - _globals->_player.animate(ANIM_MODE_6, this); break; case 7: ADD_PLAYER_MOVER(462, 182); @@ -5689,7 +5698,7 @@ void Scene2320::Hotspot14::doAction(int action) { scene->_hotspot9.setVisage(2345); scene->_hotspot9._strip = 6; scene->_hotspot9.setPosition(Common::Point(536, 103)); - scene->_hotspot9.setPriority2(200); + scene->_hotspot9.fixPriority(200); scene->_hotspot9.hide(); scene->_hotspot16.postInit(); @@ -5779,7 +5788,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot13.postInit(); _hotspot13.setVisage(2323); _hotspot13.setPosition(Common::Point(319, 157)); - _hotspot13.setPriority2(1); + _hotspot13.fixPriority(1); _hotspot12.postInit(); _hotspot12.setVisage(2321); @@ -5793,7 +5802,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot8.setStrip(5); _hotspot8.setFrame(8); _hotspot8.setPosition(Common::Point(541, 103)); - _hotspot8.setPriority2(201); + _hotspot8.fixPriority(201); _globals->_sceneItems.push_back(&_hotspot8); } @@ -5825,7 +5834,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setPosition(Common::Point(320, 79)); - _globals->_player.setPriority2(10); + _globals->_player.fixPriority(10); _globals->_player.changeZoom(-1); _globals->_player._moveDiff.y = 3; _globals->_player.disableControl(); @@ -5860,7 +5869,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _globals->_soundHandler.startSound(160); _globals->_soundHandler.proc5(true); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.setPosition(Common::Point(389, 72)); _globals->_player.enableControl(); break; @@ -5886,7 +5895,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(2347); _globals->_player.setStrip(2); _globals->_player.setFrame(5); - _globals->_player.setPriority2(137); + _globals->_player.fixPriority(137); _globals->_player.setPosition(Common::Point(165, 132)); setAction(&_action6); @@ -5912,7 +5921,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _globals->_player.setStrip(2); _globals->_player.setFrame(_globals->_player.getFrameCount()); _globals->_player.setPosition(Common::Point(303, 176)); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.disableControl(); _hotspot13.setPosition(Common::Point(319, 199)); @@ -5920,7 +5929,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot16.postInit(); _hotspot16.setVisage(2331); _hotspot16._strip = 3; - _hotspot16.setPriority2(160); + _hotspot16.fixPriority(160); _hotspot16.setPosition(Common::Point(320, 202)); _hotspot16.hide(); @@ -5937,7 +5946,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot11.postInit(); _hotspot11.setVisage(2705); _hotspot11._strip = 2; - _hotspot11.setPriority2(10); + _hotspot11.fixPriority(10); _hotspot11.setPosition(Common::Point(322, 80)); _hotspot11.setObjectWrapper(new SceneObjectWrapper()); _hotspot11.animate(ANIM_MODE_1, NULL); @@ -5946,7 +5955,7 @@ void Scene2320::postInit(SceneObjectList *OwnerList) { _hotspot10.setVisage(2806); _hotspot10.setObjectWrapper(new SceneObjectWrapper()); _hotspot10.changeZoom(-1); - _hotspot10.setPriority2(10); + _hotspot10.fixPriority(10); _hotspot10.setPosition(Common::Point(318, 89)); _hotspot10._strip = 3; _hotspot10.animate(ANIM_MODE_1, NULL); diff --git a/engines/tsage/ringworld_scenes5.cpp b/engines/tsage/ringworld_scenes5.cpp index 910a35e492..73d2df5989 100644 --- a/engines/tsage/ringworld_scenes5.cpp +++ b/engines/tsage/ringworld_scenes5.cpp @@ -315,7 +315,7 @@ void Scene4000::Action7::signal() { _globals->_player.setVisage(4008); _globals->_player.setStrip(4); _globals->_player.setFrame(1); - _globals->_player.setPriority2(16); + _globals->_player.fixPriority(16); _globals->_player.setPosition(Common::Point(260, 55)); _globals->_player.animate(ANIM_MODE_5, this); break; @@ -700,7 +700,6 @@ void Scene4000::Hotspot::doAction(int action) { if (_globals->_sceneObjects->contains(&scene->_hotspot8)) { scene->_hotspot8.setAction(NULL); -// ADD_MOVER_NULL(scene->_hotspot8, 118, 145); Common::Point pt(118, 145); NpcMover *mover = new NpcMover(); scene->_hotspot18.addMover(mover, &pt, NULL); @@ -824,7 +823,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _smoke1.postInit(); _smoke1.setVisage(4000); - _smoke1.setPriority2(1); + _smoke1.fixPriority(1); _smoke1.setFrame(2); _smoke1.setPosition(Common::Point(242, 59)); _smoke1.animate(ANIM_MODE_2, NULL); @@ -832,7 +831,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _smoke2.postInit(); _smoke2.setVisage(4000); _smoke2.setStrip(2); - _smoke2.setPriority2(1); + _smoke2.fixPriority(1); _smoke2.setFrame(2); _smoke2.setPosition(Common::Point(299, 59)); _smoke2.animate(ANIM_MODE_2, NULL); @@ -852,7 +851,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _theTech.setVisage(4000); _theTech.setStrip(3); _theTech.setFrame(3); - _theTech.setPriority2(200); + _theTech.fixPriority(200); _theTech.setPosition(Common::Point(281, 176)); if (_globals->getFlag(34)) { @@ -862,7 +861,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _forceField.setVisage(4000); _forceField.setStrip(4); _forceField.setPosition(Common::Point(312, 174)); - _forceField.setPriority2(200); + _forceField.fixPriority(200); _forceField.animate(ANIM_MODE_8, 0, NULL); _globals->_sceneItems.push_back(&_forceField); @@ -1036,7 +1035,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(4008); _globals->_player.setStrip(4); _globals->_player.setFrame(_globals->_player.getFrameCount()); - _globals->_player.setPriority2(16); + _globals->_player.fixPriority(16); _globals->_player.setPosition(Common::Point(260, 55)); _sceneMode = 4007; @@ -1096,7 +1095,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _forceField.setVisage(4000); _forceField.setStrip(4); _forceField.setPosition(Common::Point(312, 174)); - _forceField.setPriority2(200); + _forceField.fixPriority(200); _forceField.animate(ANIM_MODE_8, 0, NULL); } else { if (!_globals->getFlag(37)) { @@ -1127,7 +1126,7 @@ void Scene4000::postInit(SceneObjectList *OwnerList) { _rope.postInit(); _rope.setVisage(4000); _rope.setStrip(7); - _rope.setPriority2(1); + _rope.fixPriority(1); _rope.setPosition(Common::Point(268, 44)); } @@ -1195,19 +1194,19 @@ void Scene4000::dispatch() { Scene::dispatch(); if ((_globals->_player.getRegionIndex() == 10) || (_globals->_player.getRegionIndex() == 6)) - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); if (_globals->_player.getRegionIndex() == 11) - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); if (_globals->_player.getRegionIndex() == 5) - _globals->_player.setPriority2(94); + _globals->_player.fixPriority(94); if (_globals->_sceneObjects->contains(&_hotspot5)) { if ((_hotspot5.getRegionIndex() == 10) || (_hotspot5.getRegionIndex() == 6)) - _hotspot5.setPriority2(200); + _hotspot5.fixPriority(200); if (_hotspot5.getRegionIndex() == 11) - _hotspot5.setPriority2(-1); + _hotspot5.fixPriority(-1); if (_hotspot5.getRegionIndex() == 5) - _hotspot5.setPriority2(94); + _hotspot5.fixPriority(94); } if (_globals->_sceneObjects->contains(&_miranda)) { @@ -1218,11 +1217,11 @@ void Scene4000::dispatch() { } if ((_miranda.getRegionIndex() == 10) || (_miranda.getRegionIndex() == 6)) - _miranda.setPriority2(200); + _miranda.fixPriority(200); if (_miranda.getRegionIndex() == 11) - _miranda.setPriority2(-1); + _miranda.fixPriority(-1); if (_miranda.getRegionIndex() == 5) - _miranda.setPriority2(94); + _miranda.fixPriority(94); } if (!_action) { @@ -1531,6 +1530,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { _peg5.setFrame(5); _peg5.hide(); + // Hole N-W _hole1.postInit(); _hole1.setVisage(4025); _hole1.setStrip(1); @@ -1540,6 +1540,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { _hole1._newPosition = Common::Point(123, 44); _hole1._armStrip = 8; + // Hole N-E _hole2.postInit(); _hole2.setVisage(4025); _hole2.setStrip(1); @@ -1549,6 +1550,7 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { _hole2._newPosition = Common::Point(166, 44); _hole2._armStrip = 7; + // Hole Center _hole3.postInit(); _hole3.setVisage(4025); _hole3.setStrip(1); @@ -1558,15 +1560,17 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { _hole3._newPosition = Common::Point(145, 60); _hole3._armStrip = 6; + // Hole S-W _hole4.postInit(); _hole4.setVisage(4025); _hole4.setStrip(1); - _hole4.setFrame2(6); + _hole4.setFrame2(9); _hole4.setPosition(Common::Point(123, 87)); _hole4._pegPtr = NULL; _hole4._newPosition = Common::Point(123, 80); _hole4._armStrip = 5; + // Hole S-E _hole5.postInit(); _hole5.setVisage(4025); _hole5.setStrip(1); @@ -1576,11 +1580,11 @@ void Scene4025::postInit(SceneObjectList *OwnerList) { _hole5._newPosition = Common::Point(166, 80); _hole5._armStrip = 4; - _hole1.setPriority2(1); - _hole2.setPriority2(1); - _hole3.setPriority2(1); - _hole4.setPriority2(1); - _hole5.setPriority2(1); + _hole1.fixPriority(1); + _hole2.fixPriority(1); + _hole3.fixPriority(1); + _hole4.fixPriority(1); + _hole5.fixPriority(1); _armHotspot.postInit(); _armHotspot.setVisage(4025); @@ -1855,7 +1859,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _flame.setVisage(4045); _flame.setPosition(Common::Point(47, 111)); _flame.animate(ANIM_MODE_2, NULL); - _flame.setPriority2(156); + _flame.fixPriority(156); _globals->_sceneItems.push_back(&_flame); _globals->_player.postInit(); @@ -1870,7 +1874,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _olloFace.postInit(); _olloFace.setVisage(4051); _olloFace.setStrip(4); - _olloFace.setPriority2(152); + _olloFace.fixPriority(152); if(_globals->_sceneManager._previousScene == 4050) { _globals->_soundHandler.startSound(155); @@ -1930,7 +1934,7 @@ void Scene4045::postInit(SceneObjectList *OwnerList) { _hotspot4.postInit(); _hotspot4.setVisage(4051); _hotspot4.setStrip(2); - _hotspot4.setPriority2(152); + _hotspot4.fixPriority(152); _hotspot4.setPosition(Common::Point(202, 80)); _olloFace.setPosition(Common::Point(192, 77)); @@ -2003,6 +2007,7 @@ void Scene4045::dispatch() { *--------------------------------------------------------------------------*/ void Scene4050::Action1::signal() { + // "Map" on the wall Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -2010,9 +2015,12 @@ void Scene4050::Action1::signal() { _globals->_player.disableControl(); setDelay(3); break; - case 1: - ADD_PLAYER_MOVER(204, 152); + case 1: { + Common::Point pt(204, 152); + PlayerMover *mover = new PlayerMover(); + _globals->_player.addMover(mover, &pt, this); break; + } case 2: _globals->_player.checkAngle(&scene->_hotspot17); @@ -2020,7 +2028,8 @@ void Scene4050::Action1::signal() { scene->_hotspot14.setVisage(4050); scene->_hotspot14.setStrip(2); scene->_hotspot14.setPosition(Common::Point(91, 154)); - scene->_hotspot14.setPriority2(200); + scene->_hotspot14.fixPriority(200); + setDelay(10); break; case 3: _globals->_events.waitForPress(); @@ -2034,6 +2043,7 @@ void Scene4050::Action1::signal() { } void Scene4050::Action2::signal() { + // Climb down the rope switch (_actionIndex++) { case 0: _globals->_player.disableControl(); @@ -2062,7 +2072,7 @@ void Scene4050::Action2::signal() { _globals->_player.setVisage(4202); _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setPosition(Common::Point(210, 185)); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.enableControl(); remove(); break; @@ -2070,12 +2080,13 @@ void Scene4050::Action2::signal() { } void Scene4050::Action3::signal() { + // Climb up the rope switch (_actionIndex++) { case 0: ADD_PLAYER_MOVER(210, 185); break; case 1: - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); _globals->_player.setVisage(4052); _globals->_player.setStrip(5); _globals->_player.changeZoom(100); @@ -2104,7 +2115,7 @@ void Scene4050::Action4::signal() { case 0: _globals->_player.disableControl(); ADD_MOVER(_globals->_player, 189, 135); - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); break; case 1: _globals->_player._moveDiff.y = 3; @@ -2140,7 +2151,7 @@ void Scene4050::Action4::signal() { _globals->_player.setStrip(2); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(216, 184)); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); break; case 5: scene->_hotspot16.setStrip2(4); @@ -2169,7 +2180,7 @@ void Scene4050::Action4::signal() { /*--------------------------------------------------------------------------*/ -void Scene4050::Hotspot14::doAction(int action) { +void Scene4050::Hotspot15::doAction(int action) { Scene4050 *scene = (Scene4050 *)_globals->_sceneManager._scene; switch (action) { @@ -2243,7 +2254,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(4008); _globals->_player.setPosition(Common::Point(206, 62)); _globals->_player.changeZoom(130); - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); _globals->_player.setStrip(2); setAction(&_action2); @@ -2286,7 +2297,7 @@ void Scene4050::postInit(SceneObjectList *OwnerList) { _hotspot17.postInit(); _hotspot17.setVisage(4050); _hotspot17.setPosition(Common::Point(209, 119)); - _hotspot17.setPriority2(2); + _hotspot17.fixPriority(2); _hotspot1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot2.setBounds(Rect(150, 25, 198, 125)); @@ -2361,7 +2372,7 @@ void Scene4100::Action2::signal() { scene->_hotspot2.setVisage(4120); scene->_hotspot2.animate(ANIM_MODE_1, NULL); scene->_hotspot2.setStrip2(4); - scene->_hotspot2.setPriority2(100); + scene->_hotspot2.fixPriority(100); scene->_hotspot2.setPosition(Common::Point(214, 119)); setDelay(3); @@ -2641,13 +2652,13 @@ void Scene4100::postInit(SceneObjectList *OwnerList) { _hotspot1.postInit(); _hotspot1.setVisage(4102); - _hotspot1.setPriority2(129); + _hotspot1.fixPriority(129); _hotspot1.setPosition(Common::Point(171, 120)); _hotspot3.postInit(); _hotspot3.setVisage(4130); _hotspot3.animate(ANIM_MODE_2, NULL); - _hotspot3.setPriority2(200); + _hotspot3.fixPriority(200); _hotspot3.setPosition(Common::Point(272, 110)); _hotspot4.postInit(); @@ -2960,7 +2971,7 @@ void Scene4150::Hotspot3::doAction(int action) { /*--------------------------------------------------------------------------*/ Scene4150::Scene4150() : - _hotspot1(0, CURSOR_LOOK, 4000, 17, CURSOR_USE, 4150, 21, CURSOR_TALK, 4150, 21, + _hotspot1(0, CURSOR_LOOK, 4150, 17, CURSOR_USE, 4150, 21, CURSOR_TALK, 4150, 21, OBJECT_SCANNER, 4150, 22, OBJECT_STUNNER, 4150, 23, LIST_END), _hotspot2(0, CURSOR_LOOK, 4150, 4, CURSOR_USE, 4150, 24, LIST_END), _hotspot7(0, CURSOR_LOOK, 4150, 1, CURSOR_USE, 4150, 25, OBJECT_ROPE, 4150, 26, LIST_END), @@ -2993,7 +3004,7 @@ void Scene4150::postInit(SceneObjectList *OwnerList) { _hotspot2.postInit(); _hotspot2.setVisage(4171); _hotspot2.animate(ANIM_MODE_2, NULL); - _hotspot2.setPriority2(100); + _hotspot2.fixPriority(100); _hotspot2.setPosition(Common::Point(76, 147)); _hotspot1.postInit(); @@ -3117,7 +3128,7 @@ void Scene4250::Action1::signal() { break; case 5: ADD_PLAYER_MOVER(220, 175); - scene->_hotspot1.setPriority2(105); + scene->_hotspot1.fixPriority(105); ADD_PLAYER_MOVER_NULL(scene->_hotspot1, 197, 173); break; case 6: @@ -3234,8 +3245,8 @@ void Scene4250::Action5::signal() { setDelay(3); break; case 1: - scene->_hotspot4.setPriority2(195); - scene->_hotspot1.setPriority2(105); + scene->_hotspot4.fixPriority(195); + scene->_hotspot1.fixPriority(105); ADD_MOVER_NULL(_globals->_player, 6, 185); ADD_MOVER_NULL(scene->_hotspot4, 9, 190); ADD_MOVER(scene->_hotspot1, 12, 180); @@ -3246,7 +3257,7 @@ void Scene4250::Action5::signal() { ADD_PLAYER_MOVER_NULL(scene->_hotspot4, 239, 195); break; case 3: - scene->_hotspot4.setPriority2(-1); + scene->_hotspot4.fixPriority(-1); scene->_hotspot1.setStrip(5); scene->_hotspot4.setStrip(7); _globals->_player.enableControl(); @@ -3528,7 +3539,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) { _hotspot5.postInit(); _hotspot5.setVisage(4250); _hotspot5.setPosition(Common::Point(268, 168)); - _hotspot5.setPriority2(1); + _hotspot5.fixPriority(1); _hotspot4.postInit(); _hotspot4.setVisage(2701); @@ -3552,7 +3563,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) { _hotspot6.setStrip(4); _hotspot6.setFrame(3); _hotspot6.changeZoom(50); - _hotspot6.setPriority2(70); + _hotspot6.fixPriority(70); _hotspot6.setPosition(Common::Point(261, 175)); if (RING_INVENTORY._helmet._sceneNumber == 4250) { @@ -3609,7 +3620,7 @@ void Scene4250::postInit(tSage::SceneObjectList *OwnerList) { _hotspot2.postInit(); _hotspot2.setVisage(4251); _hotspot2.setStrip2(1); - _hotspot2.setPriority2(2); + _hotspot2.fixPriority(2); _hotspot2.setFrame(1); _hotspot2.setPosition(Common::Point(267, 172)); @@ -3671,7 +3682,7 @@ void Scene4250::dispatch() { _globals->_player.changeZoom(70); if (_globals->_player.getRegionIndex() == 15) { _globals->_player.changeZoom(-1); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); } if (_hotspot1.getRegionIndex() == 8) @@ -3680,7 +3691,7 @@ void Scene4250::dispatch() { _hotspot1.changeZoom(70); if (_hotspot1.getRegionIndex() == 15) { _hotspot1.changeZoom(-1); - _hotspot1.setPriority2(-1); + _hotspot1.fixPriority(-1); } if (_hotspot4.getRegionIndex() == 8) @@ -3689,7 +3700,7 @@ void Scene4250::dispatch() { _hotspot4.changeZoom(70); if (_hotspot4.getRegionIndex() == 15) { _hotspot4.changeZoom(-1); - _hotspot4.setPriority2(-1); + _hotspot4.fixPriority(-1); } Scene::dispatch(); @@ -3751,7 +3762,7 @@ void Scene4300::Action1::signal() { setDelay(60); break; case 7: - scene->_hotspot10.setPriority2(250); + scene->_hotspot10.fixPriority(250); scene->_hotspot10.animate(ANIM_MODE_5, this); break; case 8: @@ -4001,7 +4012,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot7.postInit(); _hotspot7.setPosition(Common::Point(90, 128)); _hotspot7.setVisage(4303); - _hotspot7.setPriority2(250); + _hotspot7.fixPriority(250); _globals->_sceneItems.push_back(&_hotspot7); _hotspot9.setup(120, 49, 174, 91, 4300, -1, -1); @@ -4023,7 +4034,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot17.postInit(); _hotspot17.setVisage(4300); _hotspot17.setStrip(6); - _hotspot17.setPriority2(1); + _hotspot17.fixPriority(1); _hotspot17.setPosition(Common::Point(200, 69)); if (RING_INVENTORY._stasisBox2._sceneNumber == 4300) @@ -4036,14 +4047,14 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot10.postInit(); _hotspot10.setVisage(4302); _hotspot10.setPosition(Common::Point(244, 179)); - _hotspot10.setPriority2(100); + _hotspot10.fixPriority(100); _globals->_sceneItems.push_back(&_hotspot10); _hotspot12.postInit(); _hotspot12.setVisage(4302); _hotspot12.setStrip2(3); _hotspot12.setPosition(Common::Point(231, 185)); - _hotspot12.setPriority2(251); + _hotspot12.fixPriority(251); _hotspot12.hide(); _hotspot13.postInit(); @@ -4051,7 +4062,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot13.setVisage(4302); _hotspot13.setStrip2(2); _hotspot13.setPosition(Common::Point(256, 168)); - _hotspot13.setPriority2(251); + _hotspot13.fixPriority(251); _hotspot13._numFrames = 1; _hotspot13.animate(ANIM_MODE_8, 0, NULL); } @@ -4060,7 +4071,7 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot16.postInit(); _hotspot16.setVisage(4300); _hotspot16.setPosition(Common::Point(169, 141)); - _hotspot16.setPriority2(1); + _hotspot16.fixPriority(1); _hotspot16.setStrip(4); _globals->_sceneItems.push_back(&_hotspot16); } @@ -4071,37 +4082,37 @@ void Scene4300::postInit(SceneObjectList *OwnerList) { _hotspot1.postInit(); _hotspot1.setVisage(4301); - _hotspot1.setPriority2(145); + _hotspot1.fixPriority(145); _hotspot1.setPosition(Common::Point(160, 64)); _hotspot2.postInit(); _hotspot2.setVisage(4301); _hotspot2.setStrip2(2); - _hotspot2.setPriority2(140); + _hotspot2.fixPriority(140); _hotspot2.setPosition(Common::Point(166, 90)); _hotspot3.postInit(); _hotspot3.setVisage(4301); _hotspot3.setStrip2(3); - _hotspot3.setPriority2(135); + _hotspot3.fixPriority(135); _hotspot3.setPosition(Common::Point(173, 114)); _hotspot4.postInit(); _hotspot4.setVisage(4301); _hotspot4.setStrip2(4); - _hotspot4.setPriority2(130); + _hotspot4.fixPriority(130); _hotspot4.setPosition(Common::Point(187, 141)); _hotspot5.postInit(); _hotspot5.setVisage(4301); _hotspot5.setStrip2(5); - _hotspot5.setPriority2(125); + _hotspot5.fixPriority(125); _hotspot5.setPosition(Common::Point(201, 164)); _hotspot6.postInit(); _hotspot6.setVisage(4301); _hotspot6.setStrip2(6); - _hotspot6.setPriority2(120); + _hotspot6.fixPriority(120); _hotspot6.setPosition(Common::Point(219, 186)); setAction(&_action1); @@ -4218,14 +4229,14 @@ void Scene4301::Action1::signal() { scene->_hotspot2.setStrip(2); scene->_hotspot2.setFrame(1); scene->_hotspot2.setPosition(Common::Point(30, 15)); - scene->_hotspot2.setPriority2(255); + scene->_hotspot2.fixPriority(255); scene->_hotspot3.postInit(); scene->_hotspot3.setVisage(4303); scene->_hotspot3.setStrip(2); scene->_hotspot3.setFrame(2); scene->_hotspot3.setPosition(Common::Point(48, 29)); - scene->_hotspot3.setPriority2(255); + scene->_hotspot3.fixPriority(255); scene->_hotspot3.hide(); _field34E = 0; @@ -4301,7 +4312,7 @@ void Scene4301::Action1::process(Event &event) { _buttonList[_state].setStrip(buttonIndex + 3); _buttonList[_state].setFrame(1); _buttonList[_state].setPosition(Common::Point((_state % 3) * 25 + 55, (_state / 3) * 25 + 121)); - _buttonList[_state].setPriority2(255); + _buttonList[_state].fixPriority(255); _buttonList[_state]._numFrames = 25; _buttonList[_state].animate(ANIM_MODE_5, NULL); @@ -4380,7 +4391,7 @@ void Scene4301::postInit(SceneObjectList *OwnerList) { _hotspot1.setVisage(4303); _hotspot1._strip = 1; _hotspot1._frame = 1; - _hotspot1.setPriority2(250); + _hotspot1.fixPriority(250); _hotspot5.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _globals->_sceneItems.push_back(&_hotspot5); diff --git a/engines/tsage/ringworld_scenes5.h b/engines/tsage/ringworld_scenes5.h index e3d1ae08b5..626eab5dab 100644 --- a/engines/tsage/ringworld_scenes5.h +++ b/engines/tsage/ringworld_scenes5.h @@ -330,7 +330,7 @@ class Scene4050 : public Scene { }; /* Hotspots */ - class Hotspot14 : public SceneObject { + class Hotspot15 : public SceneObject { public: virtual void doAction(int action); }; @@ -349,8 +349,9 @@ public: DisplayHotspot _hotspot1, _hotspot2, _hotspot3, _hotspot4, _hotspot5; DisplayHotspot _hotspot6, _hotspot7, _hotspot8, _hotspot9, _hotspot10; DisplayHotspot _hotspot11, _hotspot12, _hotspot13; - Hotspot14 _hotspot14; - SceneObject _hotspot15, _hotspot16; + SceneObject _hotspot14; + Hotspot15 _hotspot15; + SceneObject _hotspot16; Hotspot17 _hotspot17; Scene4050(); diff --git a/engines/tsage/ringworld_scenes6.cpp b/engines/tsage/ringworld_scenes6.cpp index 2c9670d99a..17f7654e70 100644 --- a/engines/tsage/ringworld_scenes6.cpp +++ b/engines/tsage/ringworld_scenes6.cpp @@ -36,6 +36,7 @@ namespace tSage { *--------------------------------------------------------------------------*/ void Scene5000::Action1::signal() { + // Ship landing Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -127,7 +128,7 @@ void Scene5000::Action2::signal() { case 2: if (!_globals->getFlag(59)) setAction(&scene->_action3, this); - _globals->_player.setPriority2(15); + _globals->_player.fixPriority(15); ADD_MOVER(_globals->_player, 208, 100); break; case 3: @@ -145,7 +146,7 @@ void Scene5000::Action2::signal() { break; case 7: _globals->_player.changeZoom(-1); - _globals->_player.setPriority2(35); + _globals->_player.fixPriority(35); ADD_MOVER(_globals->_player, 201, 166); break; case 8: @@ -154,7 +155,7 @@ void Scene5000::Action2::signal() { break; case 9: _globals->_player.changeZoom(-1); - _globals->_player.setPriority2(50); + _globals->_player.fixPriority(50); ADD_MOVER(_globals->_player, 220, 182); break; case 10: @@ -164,7 +165,7 @@ void Scene5000::Action2::signal() { case 11: _globals->_player.changeZoom(-1); _globals->_player.setStrip2(-1); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); ADD_MOVER(_globals->_player, 208, 175); break; case 12: @@ -200,7 +201,7 @@ void Scene5000::Action3::signal() { scene->_hotspot7.setPosition(Common::Point(217, 76)); scene->_hotspot7.changeZoom(10); scene->_hotspot7.setStrip2(3); - scene->_hotspot7.setPriority2(200); + scene->_hotspot7.fixPriority(200); scene->_hotspot7._moveDiff.y = 2; scene->_hotspot7.animate(ANIM_MODE_1, NULL); ADD_MOVER(scene->_hotspot7, 214, 89); @@ -209,14 +210,14 @@ void Scene5000::Action3::signal() { break; case 2: scene->_hotspot7.changeZoom(-1); - scene->_hotspot7.setPriority2(14); + scene->_hotspot7.fixPriority(14); ADD_MOVER(scene->_hotspot7, 208, 100); break; case 3: ADD_MOVER(scene->_hotspot7, 213, 98); break; case 4: - scene->_hotspot7.setPriority2(19); + scene->_hotspot7.fixPriority(19); ADD_MOVER(scene->_hotspot7, 213, 98); break; case 5: @@ -228,7 +229,7 @@ void Scene5000::Action3::signal() { break; case 7: scene->_hotspot7.changeZoom(-1); - scene->_hotspot7.setPriority2(34); + scene->_hotspot7.fixPriority(34); ADD_MOVER(scene->_hotspot7, 201, 166); break; case 8: @@ -237,7 +238,7 @@ void Scene5000::Action3::signal() { break; case 9: scene->_hotspot7.changeZoom(-1); - scene->_hotspot7.setPriority2(49); + scene->_hotspot7.fixPriority(49); ADD_MOVER(scene->_hotspot7, 210, 182); break; case 10: @@ -247,7 +248,7 @@ void Scene5000::Action3::signal() { case 11: scene->_hotspot7.changeZoom(-1); scene->_hotspot7.setStrip2(-1); - scene->_hotspot7.setPriority2(-1); + scene->_hotspot7.fixPriority(-1); ADD_MOVER(scene->_hotspot7, 175, 166); break; case 12: @@ -268,7 +269,7 @@ void Scene5000::Action4::signal() { setDelay(1); break; case 1: - _globals->_player.setPriority2(50); + _globals->_player.fixPriority(50); _globals->_player.setStrip2(4); ADD_MOVER(_globals->_player, 210, 182); break; @@ -276,14 +277,14 @@ void Scene5000::Action4::signal() { ADD_MOVER(_globals->_player, 205, 146); break; case 3: - _globals->_player.setPriority2(35); + _globals->_player.fixPriority(35); ADD_MOVER(_globals->_player, 201, 166); break; case 4: ADD_MOVER(_globals->_player, 229, 115); break; case 5: - _globals->_player.setPriority2(20); + _globals->_player.fixPriority(20); _globals->_player.changeZoom(47); ADD_MOVER(_globals->_player, 220, 125); break; @@ -295,7 +296,7 @@ void Scene5000::Action4::signal() { ADD_MOVER(_globals->_player, 213, 98); break; case 8: - _globals->_player.setPriority2(15); + _globals->_player.fixPriority(15); ADD_MOVER(_globals->_player, 208, 100); break; case 9: @@ -345,6 +346,7 @@ void Scene5000::Action5::signal() { } void Scene5000::Action6::signal() { + // Discussion between the hero and Seeker, then the hero goes back to the lander Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -364,7 +366,7 @@ void Scene5000::Action6::signal() { ADD_PLAYER_MOVER(208, 163); break; case 4: - _globals->_player.setPriority2(50); + _globals->_player.fixPriority(50); _globals->_player.setStrip2(4); ADD_MOVER(_globals->_player, 210, 182); break; @@ -393,6 +395,7 @@ void Scene5000::Hotspot7::doAction(int action) { } void Scene5000::Hotspot8::doAction(int action) { + // Cave Scene5000 *scene = (Scene5000 *)_globals->_sceneManager._scene; switch (action) { @@ -455,14 +458,14 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { _hotspot1.setVisage(5001); _hotspot1.setFrame2(1); _hotspot1._moveDiff = Common::Point(5, 5); - _hotspot1.setPriority2(10); + _hotspot1.fixPriority(10); _hotspot1.changeZoom(10); _hotspot4.postInit(); _hotspot4.setVisage(5001); _hotspot4.setStrip2(2); _hotspot4._moveDiff = Common::Point(5, 1); - _hotspot4.setPriority2(10); + _hotspot4.fixPriority(10); _hotspot4.changeZoom(100); _hotspot4.animate(ANIM_MODE_8, 0, NULL); _hotspot4.hide(); @@ -484,13 +487,13 @@ void Scene5000::postInit(SceneObjectList *OwnerList) { _hotspot5.setVisage(5001); _hotspot5.setStrip2(4); _hotspot5._numFrames = 5; - _hotspot5.setPriority2(15); + _hotspot5.fixPriority(15); _hotspot5.setPosition(Common::Point(218, 76)); _hotspot5.hide(); _hotspot9.postInit(); _hotspot9.setVisage(5002); - _hotspot9.setPriority2(80); + _hotspot9.fixPriority(80); _hotspot9.setPosition(Common::Point(71, 174)); _hotspot10.postInit(); @@ -644,7 +647,7 @@ void Scene5100::Action1::signal() { scene->_hotspot5.setPosition(Common::Point(1160, 34)); scene->_hotspot5.setStrip2(2); scene->_hotspot5.animate(ANIM_MODE_1, NULL); - scene->_hotspot5.setPriority2(10); + scene->_hotspot5.fixPriority(10); _globals->_sceneItems.push_front(&scene->_hotspot5); ADD_MOVER(scene->_hotspot5, 999, 14); @@ -689,9 +692,9 @@ void Scene5100::Action2::signal() { break; case 3: if (_globals->_player._position.x >= 966) { - ADD_PLAYER_MOVER(1215, 155); + ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 1215, 155); } else { - ADD_PLAYER_MOVER_THIS(scene->_hotspot8, 966, 185); + ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 966, 185); } if (_globals->_player._position.x >= 966) { @@ -701,7 +704,7 @@ void Scene5100::Action2::signal() { } break; case 4: - ADD_PLAYER_MOVER_THIS(scene->_hotspot8, 1215, 155); + ADD_PLAYER_MOVER_NULL(scene->_hotspot8, 1215, 155); ADD_PLAYER_MOVER(1215, 155); break; case 5: @@ -829,6 +832,7 @@ void Scene5100::Action5::signal() { /*--------------------------------------------------------------------------*/ void Scene5100::HotspotGroup1::doAction(int action) { + // Flesh Eaters Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (action) { @@ -881,11 +885,12 @@ void Scene5100::Hotspot4::doAction(int action) { } void Scene5100::HotspotGroup2::doAction(int action) { + // Bat Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (action) { case CURSOR_LOOK: - SceneItem::display2(5100, _globals->getFlag(62) ? 47 : 23); + SceneItem::display2(5100, _globals->getFlag(108) ? 47 : 23); break; case CURSOR_USE: SceneItem::display2(5100, 29); @@ -909,6 +914,7 @@ void Scene5100::HotspotGroup2::doAction(int action) { } void Scene5100::Hotspot9::doAction(int action) { + // Rope Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (action) { @@ -929,7 +935,7 @@ void Scene5100::Hotspot9::doAction(int action) { case OBJECT_BONE: _globals->_player.disableControl(); scene->_sceneMode = 5116; - scene->setAction(&scene->_sequenceManager, scene, 5116, &_globals->_player, &scene->_hotspot10, + scene->setAction(&scene->_sequenceManager, scene, 5116, &_globals->_player, this, &scene->_hotspot10, &scene->_hotspot4, NULL); break; default: @@ -1004,6 +1010,7 @@ void Scene5100::Hotspot18::doAction(int action) { } void Scene5100::Hotspot19::doAction(int action) { + // Pillar Scene5100 *scene = (Scene5100 *)_globals->_sceneManager._scene; switch (action) { @@ -1082,14 +1089,14 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot14.postInit(); _hotspot14.setVisage(5101); _hotspot14.setPosition(Common::Point(498, 147)); - _hotspot14.setPriority2(200); + _hotspot14.fixPriority(200); _hotspot14._moveDiff.y = 10; } _hotspot17.postInit(); _hotspot17.setVisage(5101); _hotspot17._strip = 2; - _hotspot17.setPriority2(200); + _hotspot17.fixPriority(200); if (_globals->getFlag(67)) _hotspot17.setPosition(Common::Point(554, 192)); @@ -1178,7 +1185,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { case 5200: if (_globals->_stripNum == 5200) { _globals->_player.setVisage(5101); - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); _globals->_player.setStrip(5); _globals->_player.setFrame(1); _globals->_player.setPosition(Common::Point(513, 199)); @@ -1227,7 +1234,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _globals->_player.setVisage(5101); _globals->_player.setStrip(6); - _globals->_player.setPriority2(170); + _globals->_player.fixPriority(170); _globals->_player.setPosition(Common::Point(1168, 110)); setAction(&_sequenceManager, this, 5111, &_globals->_player, NULL); @@ -1260,7 +1267,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot6.postInit(); _hotspot6.setVisage(5362); _hotspot6.setPosition(Common::Point(1152, 70)); - _hotspot6.setPriority2(170); + _hotspot6.fixPriority(170); _hotspot6.setStrip(6); _hotspot6.setFrame(1); _globals->_sceneItems.push_back(&_hotspot6); @@ -1275,7 +1282,7 @@ void Scene5100::postInit(SceneObjectList *OwnerList) { _hotspot15.setVisage(5140); _hotspot15.setStrip(3); _hotspot15.setPosition(Common::Point(977, 173)); - _hotspot15.setPriority2(1); + _hotspot15.fixPriority(1); _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); loadScene(5100); @@ -1324,9 +1331,9 @@ void Scene5100::signal() { break; case 5111: _globals->_player.setObjectWrapper(new SceneObjectWrapper()); - _globals->_player.setVisage(6); + _globals->_player.setVisage(0); _globals->_player.setStrip(6); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.animate(ANIM_MODE_1, NULL); if ((RING_INVENTORY._vial._sceneNumber != 5100) && !_globals->getFlag(108)) { @@ -1349,9 +1356,9 @@ void Scene5100::signal() { _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setVisage(0); _globals->_player.setStrip(6); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.animate(ANIM_MODE_1, NULL); - break; + // No break on purpose case 5117: _globals->_player.enableControl(); break; @@ -1370,6 +1377,7 @@ void Scene5100::signal() { } void Scene5100::dispatch() { + // Flesheater trap if (_hotspot15._bounds.contains(_globals->_player._position) && !_globals->_player._visage) { _globals->_player.disableControl(); _globals->_player.addMover(NULL); @@ -1398,9 +1406,9 @@ void Scene5100::dispatch() { _hotspot3.setStrip2(2); ObjectMover3 *mover1 = new ObjectMover3(); - _hotspot2.addMover(mover1, 20, this); + _hotspot2.addMover(mover1, &_globals->_player, 20, this); ObjectMover3 *mover2 = new ObjectMover3(); - _hotspot3.addMover(mover2, 20, this); + _hotspot3.addMover(mover2, &_globals->_player, 20, this); } if (!_action) { @@ -1408,8 +1416,9 @@ void Scene5100::dispatch() { _globals->_player._canWalk = false; _globals->_player.addMover(NULL); + Common::Point pt(20, 25); PlayerMover2 *mover = new PlayerMover2(); - _hotspot3.addMover(mover, 20, 25, &_globals->_player); + _hotspot3.addMover(mover, &pt, &_globals->_player); setAction(&_action4); } @@ -1445,6 +1454,7 @@ void Scene5200::Action1::signal() { } void Scene5200::Action2::signal() { + // Quinn obtains the stasis box from the flesheater throne room Scene5200 *scene = (Scene5200 *)_globals->_sceneManager._scene; switch (_actionIndex++) { @@ -1489,6 +1499,7 @@ void Scene5200::Action2::signal() { void Scene5200::Action3::signal() { switch (_actionIndex++) { + case 0: _globals->_player.disableControl(); setDelay(5); break; @@ -1563,7 +1574,7 @@ void Scene5200::Hotspot10::doAction(int action) { } break; default: - SceneItem::doAction(action); + SceneObject::doAction(action); break; } } @@ -1579,7 +1590,7 @@ void Scene5200::Hotspot14::doAction(int action) { scene->setAction(&scene->_action2); break; default: - SceneItem::doAction(action); + SceneObject::doAction(action); break; } } @@ -1619,17 +1630,20 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot14.setVisage(5202); _hotspot14._strip = 3; _hotspot14.setPosition(Common::Point(105, 52)); - _hotspot14.setPriority2(90); + _hotspot14.fixPriority(90); _hotspot8.postInit(); _hotspot8.setVisage(5202); _hotspot8._strip = 1; _hotspot8.setPosition(Common::Point(96, 53)); - _hotspot8.setPriority2(90); + _hotspot8.fixPriority(90); _globals->_sceneItems.push_back(&_hotspot14); } - if (_globals->_stripNum == 1111) { + if (_globals->_stripNum == 5111) { + // Happens when the player enters the throne room via the secret passage, + // after talking with the bat. No NPCs are around and the player can + // obtain the stasis box. _globals->_soundHandler.startSound(205); _globals->_player.disableControl(); @@ -1644,6 +1658,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { setAction(&_action3); } else { + // Happens when the player is captured by the flesh eaters the first time. _globals->_player.postInit(); _globals->_player.setVisage(2640); _globals->_player._strip = 1; @@ -1665,7 +1680,7 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot7.setVisage(5210); _hotspot7._frame = 1; _hotspot7._strip = 4; - _hotspot7.setPriority2(168); + _hotspot7.fixPriority(168); _hotspot7.setPosition(Common::Point(186, 106)); _hotspot1.postInit(); @@ -1677,20 +1692,20 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot2.setVisage(5212); _hotspot2._strip = 3; _hotspot2.setPosition(Common::Point(148, 141)); - _hotspot2.setPriority2(90); + _hotspot2.fixPriority(90); _hotspot3.postInit(); _hotspot3.setVisage(5212); _hotspot3._strip = 2; _hotspot3.setPosition(Common::Point(62, 109)); - _hotspot3.setPriority2(138); + _hotspot3.fixPriority(138); _hotspot3.setAction(&_action1); _hotspot4.postInit(); _hotspot4.setVisage(5212); _hotspot4._strip = 4; _hotspot4.setPosition(Common::Point(146, 110)); - _hotspot4.setPriority2(90); + _hotspot4.fixPriority(90); _globals->_player.disableControl(); _globals->setFlag(61); @@ -1701,6 +1716,8 @@ void Scene5200::postInit(SceneObjectList *OwnerList) { _hotspot11.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); _hotspot9._sceneRegionId = 11; _hotspot10._sceneRegionId = 9; + _hotspot12._sceneRegionId = 10; + _hotspot13._sceneRegionId = 8; _globals->_sceneItems.addItems(&_hotspot12, &_hotspot13, &_hotspot9, &_hotspot10, &_hotspot11, NULL); _globals->_sceneManager._scene->_sceneBounds.center(_globals->_player._position); @@ -1754,7 +1771,7 @@ void Scene5300::Action1::signal() { ADD_MOVER(_globals->_player, 85, 170); break; case 3: - scene->_hotspot2.setPriority2(-1); + scene->_hotspot2.fixPriority(-1); _globals->_player.checkAngle(&scene->_hotspot2); setAction(&scene->_sequenceManager, this, 5305, &scene->_hotspot2, NULL); break; @@ -1933,6 +1950,7 @@ void Scene5300::Hotspot5::doAction(int action) { } void Scene5300::Hotspot6::doAction(int action) { + // Left Hole Scene5300 *scene = (Scene5300 *)_globals->_sceneManager._scene; switch (action) { @@ -2033,7 +2051,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot2.setVisage(5310); _hotspot2.setPosition(Common::Point(63, 170)); _hotspot2.animate(ANIM_MODE_1, NULL); - _hotspot2.setPriority2(98); + _hotspot2.fixPriority(98); } _hotspot1.postInit(); @@ -2075,7 +2093,7 @@ void Scene5300::postInit(SceneObjectList *OwnerList) { _hotspot3.postInit(); _hotspot3.setVisage(5301); _hotspot3.setPosition(Common::Point(172, 32)); - _hotspot3.setPriority2(1); + _hotspot3.fixPriority(1); _hotspot3.animate(ANIM_MODE_NONE, NULL); _globals->_player.postInit(); @@ -2113,6 +2131,9 @@ void Scene5300::signal() { _globals->_stripNum = 5300; _globals->_sceneManager.changeScene(5100); break; + case 5307: + _soundHandler.proc1(NULL); + // No break on purpose case 5302: case 5308: case 5316: @@ -2149,15 +2170,12 @@ void Scene5300::signal() { _stripManager.start(5302, this); _sceneMode = 5302; break; - case 5307: - _soundHandler.proc1(NULL); - break; case 5309: _hotspot5.remove(); _globals->_player.enableControl(); break; case 5310: - _hotspot2.setPriority2(41); + _hotspot2.fixPriority(41); _sceneMode = 5315; setAction(&_sequenceManager, this, 5315, &_hotspot2, NULL); diff --git a/engines/tsage/ringworld_scenes6.h b/engines/tsage/ringworld_scenes6.h index 272aea4fe9..16b2800fc6 100644 --- a/engines/tsage/ringworld_scenes6.h +++ b/engines/tsage/ringworld_scenes6.h @@ -216,11 +216,11 @@ class Scene5200 : public Scene { }; /* Hotspots */ - class Hotspot9 : public SceneItemExt { + class Hotspot9 : public SceneObjectExt { public: virtual void doAction(int action); }; - class Hotspot10 : public SceneItemExt { + class Hotspot10 : public SceneObjectExt { public: virtual void doAction(int action); }; diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 0891f64597..3f1895a432 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -31,6 +31,12 @@ namespace tSage { +void NamedHotspotMult::synchronise(Serialiser &s) { + SceneHotspot::synchronise(s); + s.syncAsSint16LE(_useLineNum); + s.syncAsSint16LE(_lookLineNum); +} + /*-------------------------------------------------------------------------- * Scene 7000 * @@ -54,16 +60,17 @@ void Scene7000::Action1::signal() { scene->_object1.setVisage(7003); scene->_object1.animate(ANIM_MODE_5, this); scene->_object1.setPosition(Common::Point(151, 182), 0); - scene->_object1.setPriority2(205); + scene->_object1.fixPriority(205); _globals->_sceneItems.push_front(&scene->_object1); break; case 3: - scene->_object1.setStrip(4); - scene->_object1.animate(ANIM_MODE_8, 0, 0); + scene->_object1._numFrames = 4; + scene->_object1.setStrip(2); + scene->_object1.animate(ANIM_MODE_8, 0, NULL); scene->_stripManager.start(7005, this); break; case 4: - scene->_object1.animate(ANIM_MODE_2, 0); + scene->_object1.animate(ANIM_MODE_2, NULL); setDelay(3); break; case 5: @@ -107,7 +114,7 @@ void Scene7000::Action3::dispatch() { Action::dispatch(); if (_actionIndex == 4) - scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y)); + scene->_object4.setPosition(scene->_object3._position, 0); } /*--------------------------------------------------------------------------*/ @@ -122,9 +129,9 @@ void Scene7000::Action3::signal() { scene->_object4.postInit(); scene->_object4.setVisage(5001); scene->_object4.setStrip2(2); - scene->_object4.animate(ANIM_MODE_8, 0, 0); + scene->_object4.animate(ANIM_MODE_8, 0, NULL); scene->_object4.setPosition(Common::Point(10, 18), 0); - scene->_object4.setPriority2(10); + scene->_object4.fixPriority(10); scene->_object4.changeZoom(100); scene->_object4.hide(); break; @@ -135,7 +142,8 @@ void Scene7000::Action3::signal() { break; } case 2: - scene->_object3.setPriority2(10); + scene->_object3._moveDiff.y = 1; + scene->_object3.fixPriority(10); scene->_object4.setPosition(Common::Point(scene->_object3._position.x, scene->_object3._position.y + 15), 0); scene->_object4.show(); setDelay(30); @@ -176,8 +184,8 @@ void Scene7000::Action4::signal() { scene->_object1.animate(ANIM_MODE_5, this); break; case 3: - scene->_object1.setStrip(1); - scene->_object1.animate(ANIM_MODE_8, 0, 0); + scene->_object1.setStrip(4); + scene->_object1.animate(ANIM_MODE_8, 0, NULL); _globals->setFlag(81); _globals->_player.enableControl(); remove(); @@ -222,7 +230,7 @@ void Scene7000::Action5::signal() { break; } case 5: { - _globals->_player.setPriority2(10); + _globals->_player.fixPriority(10); NpcMover *mover = new NpcMover(); Common::Point pt(11, 89); _globals->_player.addMover(mover, &pt, this); @@ -268,7 +276,7 @@ void Scene7000::Action6::signal() { NpcMover *mover = new NpcMover(); Common::Point pt(31, 96); _globals->_player.addMover(mover, &pt, this); - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); break; } case 4: { @@ -315,7 +323,7 @@ void Scene7000::Action7::signal() { break; } case 4: { - _globals->_player.setPriority2(10); + _globals->_player.fixPriority(10); NpcMover *mover = new NpcMover(); Common::Point pt(11, 89); _globals->_player.addMover(mover, &pt, this); @@ -354,22 +362,19 @@ void Scene7000::Object1::doAction(int action) { case OBJECT_TRANSLATOR: _globals->_player.disableControl(); RING_INVENTORY._translator._sceneNumber = 7000; - if (RING_INVENTORY._waldos._sceneNumber == 7000) { - if (RING_INVENTORY._jar._sceneNumber == 7000) { - scene->_sceneMode = 7012; - scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, 0, 0); - } else { - scene->_sceneMode = 7015; - scene->setAction(&scene->_sequenceManager, scene, 7017, &_globals->_player, 0, 0); - } + + if ((RING_INVENTORY._waldos._sceneNumber != 7000) && (RING_INVENTORY._jar._sceneNumber != 7000)) { + scene->_sceneMode = 7004; + scene->setAction(&scene->_sequenceManager, scene, 7004, &_globals->_player, this, NULL); + } else if (RING_INVENTORY._waldos._sceneNumber != 7000) { + scene->_sceneMode = 7011; + scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, NULL); + } else if (RING_INVENTORY._jar._sceneNumber != 7000) { + scene->_sceneMode = 7012; + scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, NULL); } else { - if (RING_INVENTORY._jar._sceneNumber == 7000) { - scene->_sceneMode = 7011; - scene->setAction(&scene->_sequenceManager, scene, 7010, &_globals->_player, &scene->_object1, 0, 0); - } else { - scene->_sceneMode = 7004; - scene->setAction(&scene->_sequenceManager, scene, 7004, &_globals->_player, this, 0, 0); - } + scene->_sceneMode = 7015; + scene->setAction(&scene->_sequenceManager, scene, 7017, &_globals->_player, NULL); } break; case OBJECT_WALDOS: @@ -378,30 +383,31 @@ void Scene7000::Object1::doAction(int action) { if (RING_INVENTORY._translator._sceneNumber == 7000) { if (RING_INVENTORY._jar._sceneNumber == 7000) { scene->_sceneMode = 7015; - scene->setAction(&scene->_sequenceManager, scene, 7015, &_globals->_player, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7015, &_globals->_player, NULL); } else { scene->_sceneMode = 7006; - scene->setAction(&scene->_sequenceManager, scene, 7006, &_globals->_player, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7006, &_globals->_player, NULL); } } else { scene->_sceneMode = 7009; - scene->setAction(&scene->_sequenceManager, scene, 7009, &_globals->_player, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7009, &_globals->_player, NULL); } break; case OBJECT_JAR: _globals->_player.disableControl(); RING_INVENTORY._jar._sceneNumber = 7000; + if (RING_INVENTORY._translator._sceneNumber == 7000) { - if (RING_INVENTORY._waldos._sceneNumber == 7000) { + if (RING_INVENTORY._waldos._sceneNumber != 7000) { scene->_sceneMode = 7007; - scene->setAction(&scene->_sequenceManager, scene, 7007, &_globals->_player, &scene->_object1, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7007, &_globals->_player, &scene->_object1, NULL); } else { scene->_sceneMode = 7015; - scene->setAction(&scene->_sequenceManager, scene, 7016, &_globals->_player, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7016, &_globals->_player, NULL); } } else { scene->_sceneMode = 7008; - scene->setAction(&scene->_sequenceManager, scene, 7008, &_globals->_player, 0, 0); + scene->setAction(&scene->_sequenceManager, scene, 7008, &_globals->_player, NULL); } break; case CURSOR_LOOK: @@ -412,7 +418,7 @@ void Scene7000::Object1::doAction(int action) { break; case CURSOR_USE: if (_globals->getFlag(81)) { - RING_INVENTORY._stasisBox._sceneNumber = 1; + RING_INVENTORY._stasisBox2._sceneNumber = 1; _globals->_player.disableControl(); scene->setAction(&scene->_action5); } else { @@ -421,7 +427,7 @@ void Scene7000::Object1::doAction(int action) { break; case CURSOR_TALK: if (_globals->getFlag(81)) { - RING_INVENTORY._stasisBox._sceneNumber = 1; + RING_INVENTORY._stasisBox2._sceneNumber = 1; _globals->_player.disableControl(); scene->setAction(&scene->_action5); } else if (_globals->getFlag(52)) { @@ -450,8 +456,8 @@ void Scene7000::dispatch() { if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 8) { if (!_globals->getFlag(13)) { _globals->_player.disableControl(); - _globals->_player.addMover(0); - SceneItem::display(7000, 3, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); + _globals->_player.addMover(NULL); + SceneItem::display2(7000, 3); _sceneMode = 7001; setAction(&scene->_sequenceManager, this, 7001, &_globals->_player, NULL); } else if (!_globals->getFlag(52)) { @@ -459,7 +465,7 @@ void Scene7000::dispatch() { } else { _globals->_player.disableControl(); _sceneMode = 7003; - setAction(&scene->_sequenceManager, this, 7003, &_globals->_player, 0); + setAction(&scene->_sequenceManager, this, 7003, &_globals->_player, NULL); } } if (_globals->_sceneRegions.indexOf(_globals->_player._position) == 9) @@ -486,39 +492,38 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object5.postInit(); _object5.setVisage(7001); _object5.setStrip2(1); - _object5.animate(ANIM_MODE_2, 0); + _object5.animate(ANIM_MODE_2, NULL); _object5.setPosition(Common::Point(49, 147), 0); - _object5.setPriority2(1); + _object5.fixPriority(1); _object6.postInit(); _object6.setVisage(7001); _object6.setStrip2(2); - _object6.animate(ANIM_MODE_2, 0); + _object6.animate(ANIM_MODE_2, NULL); _object6.setPosition(Common::Point(160, 139), 0); - _object6.setPriority2(1); + _object6.fixPriority(1); _object7.postInit(); _object7.setVisage(7001); _object7.setStrip2(3); - _object7.animate(ANIM_MODE_2, 0); + _object7.animate(ANIM_MODE_2, NULL); _object7.setPosition(Common::Point(272, 129), 0); - _object7.setPriority2(1); + _object7.fixPriority(1); _object8.postInit(); _object8.setVisage(7001); _object8.setStrip2(4); - _object8.animate(ANIM_MODE_2, 0); + _object8.animate(ANIM_MODE_2, NULL); _object8.setPosition(Common::Point(176, 175), 0); - _object8.setPriority2(1); + _object8.fixPriority(1); if (_globals->getFlag(72)) { _object3.postInit(); _object3.setVisage(5001); _object3.setStrip2(1); - _object3.animate(ANIM_MODE_2, 0); _object3.setPosition(Common::Point(107, 92), 0); _object3.changeZoom(100); - _object3.setPriority2(10); + _object3.fixPriority(10); _object1.postInit(); _object1.setVisage(7003); @@ -529,24 +534,25 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object1.setPosition(Common::Point(87, 129), 0); _object1._numFrames = 4; _object1.changeZoom(45); - _object1.animate(ANIM_MODE_8, 0, 0); - _globals->_sceneItems.addItems(&_object1, 0); + _object1.animate(ANIM_MODE_8, 0, NULL); + _globals->_sceneItems.push_back(&_object1); } _soundHandler.startSound(251); if (_globals->_sceneManager._previousScene == 2100) { if (_globals->getFlag(72)) { _globals->_player.postInit(); _globals->_player.setVisage(0); - _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.animate(ANIM_MODE_1, NULL); SceneObjectWrapper *wrapper = new SceneObjectWrapper(); _globals->_player.setObjectWrapper(wrapper); _globals->_player.setPosition(Common::Point(57, 94), 0); _globals->_player.changeZoom(-1); - _globals->_player.setPriority2(10); + _globals->_player.fixPriority(10); if (_globals->getFlag(81)) { setAction(&_action4); } else { _object1.setPosition(Common::Point(151, 182), 0); + _object1.changeZoom(100); setAction(&_action1); } } else { @@ -556,7 +562,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _object3.postInit(); _object3.setVisage(5001); _object3.setStrip2(1); - _object3.animate(ANIM_MODE_1, 0); + _object3.animate(ANIM_MODE_1, NULL); _object3.setPosition(Common::Point(307, 0), 0); _object3.changeZoom(-1); setAction(&_action3); @@ -564,12 +570,11 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { } else if (_globals->_sceneManager._previousScene == 2280) { _globals->_player.postInit(); _globals->_player.setVisage(2170); - _globals->_player.animate(ANIM_MODE_1, 0); - SceneObjectWrapper *wrapper = new SceneObjectWrapper(); - _globals->_player.setObjectWrapper(wrapper); + _globals->_player.animate(ANIM_MODE_1, NULL); + _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setPosition(Common::Point(57, 94), 0); _globals->_player.changeZoom(-1); - _globals->_player.setPriority2(10); + _globals->_player.fixPriority(10); _globals->_player.disableControl(); _sceneMode = 7001; setAction(&_action6, this); @@ -587,7 +592,7 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _globals->_player.setObjectWrapper(wrapper); _globals->_player.setPosition(Common::Point(57, 94), 0); _globals->_player.changeZoom(-1); - _globals->_player.setPriority2(10); + _globals->_player.fixPriority(10); _sceneMode = 7001; setAction(&_action6, this); } else { @@ -602,6 +607,9 @@ void Scene7000::postInit(SceneObjectList *OwnerList) { _globals->_soundHandler.startSound(250); setAction(&_action3); } + + _sceneItem1.setBounds(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)); + _globals->_sceneItems.push_back(&_sceneItem1); } /*--------------------------------------------------------------------------*/ @@ -612,6 +620,10 @@ void Scene7000::signal() { case 7001: case 7002: case 7004: + case 7005: + case 7006: + case 7007: + case 7008: case 7009: _globals->_player.enableControl(); break; @@ -709,7 +721,7 @@ void Scene7100::Action5::signal() { } case 3: { scene->_object9.setStrip2(2); - scene->_object9.setPriority2(180); + scene->_object9.fixPriority(180); Common::Point pt(8, 181); NpcMover *mover = new NpcMover(); scene->_object9.addMover(mover, &pt, this); @@ -728,13 +740,13 @@ void Scene7100::Action6::signal() { switch (_actionIndex++) { case 0: setDelay(1); - scene->_object10.setPriority2(8); + scene->_object10.fixPriority(8); scene->_object10.setPosition(Common::Point(155, 187), 0); - scene->_object11.setPriority2(8); + scene->_object11.fixPriority(8); scene->_object11.setPosition(Common::Point(155, 190), 0); - scene->_object12.setPriority2(8); + scene->_object12.fixPriority(8); scene->_object12.setPosition(Common::Point(151, 193), 0); break; case 1: { @@ -758,13 +770,13 @@ void Scene7100::Action6::signal() { scene->_object10.addMover(mover1, &pt1, this); scene->_object11.setStrip2(6); - scene->_object11.setPriority2(50); + scene->_object11.fixPriority(50); Common::Point pt2(89, 185); NpcMover *mover2 = new NpcMover(); scene->_object11.addMover(mover2, &pt2, 0); scene->_object12.setStrip2(6); - scene->_object12.setPriority2(50); + scene->_object12.fixPriority(50); Common::Point pt3(87, 183); NpcMover *mover3 = new NpcMover(); scene->_object12.addMover(mover3, &pt3, 0); @@ -919,7 +931,7 @@ void Scene7100::Action9::signal() { } case 2: { scene->_object24.setStrip2(2); - scene->_object24.setPriority2(160); + scene->_object24.fixPriority(160); Common::Point pt(34, 159); NpcMover *mover = new NpcMover(); scene->_object24.addMover(mover, &pt, this); @@ -934,7 +946,7 @@ void Scene7100::Action9::signal() { } case 4: { scene->_object24.setStrip2(2); - scene->_object24.setPriority2(180); + scene->_object24.fixPriority(180); Common::Point pt(-12, 182); NpcMover *mover = new NpcMover(); scene->_object24.addMover(mover, &pt, this); @@ -1006,7 +1018,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object2.animate(ANIM_MODE_2, 0); _object2.setPosition(Common::Point(10, 140), 0); _object2._numFrames = 1; - _object2.setPriority2(180); + _object2.fixPriority(180); _object2.setAction(&_action1, 0); _object3.postInit(); @@ -1014,7 +1026,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object3.animate(ANIM_MODE_2, 0); _object3.setPosition(Common::Point(34, 115), 0); _object3._numFrames = 1; - _object3.setPriority2(180); + _object3.fixPriority(180); _object3.setAction(&_action2, 0); _object4.postInit(); @@ -1022,7 +1034,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object4.animate(ANIM_MODE_2, 0); _object4.setPosition(Common::Point(-10, 159), 0); _object4._numFrames = 2; - _object4.setPriority2(250); + _object4.fixPriority(250); _object4.setAction(&_action3, 0); _object5.postInit(); @@ -1038,7 +1050,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object9.animate(ANIM_MODE_2, 0); _object9.setPosition(Common::Point(110, 168), 0); _object9._numFrames = 2; - _object9.setPriority2(16); + _object9.fixPriority(16); _object9.setAction(&_action5, 0); _object13.postInit(); @@ -1047,7 +1059,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object13.animate(ANIM_MODE_2, 0); _object13.setPosition(Common::Point(524, 104), 0); _object13._numFrames = 5; - _object13.setPriority2(250); + _object13.fixPriority(250); _object13.setAction(&_action7, 0); _object17.postInit(); @@ -1084,7 +1096,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object24.animate(ANIM_MODE_2, 0); _object24.setPosition(Common::Point(-12, 182), 0); _object24._numFrames = 4; - _object24.setPriority2(180); + _object24.fixPriority(180); _object24.setAction(&_action9, 0); _object25.postInit(); @@ -1092,7 +1104,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _object25.animate(ANIM_MODE_2, 0); _object25.setPosition(Common::Point(551, 145), 0); _object25._numFrames = 5; - _object25.setPriority2(160); + _object25.fixPriority(160); _object25.setAction(&_action10, 0); // Swimmer 1 @@ -1102,7 +1114,7 @@ void Scene7100::postInit(SceneObjectList *OwnerList) { _globals->_player._moveDiff.x = 4; _globals->_player._moveDiff.y = 2; _globals->_player.setPosition(Common::Point(135, 135), 0); - _globals->_player.setPriority2(200); + _globals->_player.fixPriority(200); _globals->_player.disableControl(); // Swimmer 2 @@ -1158,9 +1170,9 @@ void Scene7200::Action2::signal() { setDelay(3); break; case 1: { - scene->_object2.setPriority2(25); - scene->_object3.setPriority2(25); - scene->_object4.setPriority2(25); + scene->_object2.fixPriority(25); + scene->_object3.fixPriority(25); + scene->_object4.fixPriority(25); scene->_object2.setStrip(1); scene->_object3.setStrip(1); scene->_object4.setStrip(1); @@ -1176,9 +1188,9 @@ void Scene7200::Action2::signal() { break; } case 2: { - scene->_object2.setPriority2(160); - scene->_object3.setPriority2(160); - scene->_object4.setPriority2(160); + scene->_object2.fixPriority(160); + scene->_object3.fixPriority(160); + scene->_object4.fixPriority(160); scene->_object2.setStrip(2); scene->_object3.setStrip(2); scene->_object4.setStrip(2); @@ -1323,7 +1335,7 @@ void Scene7300::Action1::signal() { break; case 7: setDelay(3); - _globals->_soundHandler.proc1(0); + _globals->_soundHandler.proc1(NULL); break; case 8: _globals->_sceneManager.changeScene(2280); @@ -1342,7 +1354,7 @@ void Scene7300::Action2::signal() { break; case 1: NpcMover *mover1 = new NpcMover(); - Common::Point pt(_globals->_randomSource.getRandomNumber(203), _globals->_randomSource.getRandomNumber(96)); + Common::Point pt(_globals->_randomSource.getRandomNumber(3) + 203, _globals->_randomSource.getRandomNumber(3) + 96); scene->_object3.addMover(mover1, &pt, this); _actionIndex = 0; break; @@ -1360,7 +1372,7 @@ void Scene7300::Action3::signal() { break; case 1: NpcMover *mover1 = new NpcMover(); - Common::Point pt(_globals->_randomSource.getRandomNumber(76), _globals->_randomSource.getRandomNumber(78)); + Common::Point pt(_globals->_randomSource.getRandomNumber(5) + 76, _globals->_randomSource.getRandomNumber(5) + 78); scene->_object1.addMover(mover1, &pt, this); _actionIndex = 0; break; @@ -1446,7 +1458,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object2.setStrip(2); _object2.animate(ANIM_MODE_2, 0); _object2.setPosition(Common::Point(77, 47), 0); - _object2.setPriority2(190); + _object2.fixPriority(190); _object5.postInit(); _object5.setVisage(7300); @@ -1530,41 +1542,41 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _object2.setVisage(7601); _object2.setStrip(1); - _object2.animate(ANIM_MODE_2, 0); + _object2.animate(ANIM_MODE_2, NULL); _object2.setPosition(Common::Point(48, 135)); - _object2.setPriority2(1); + _object2.fixPriority(1); _object3.postInit(); _object3.setVisage(7601); _object3.setStrip(2); - _object3.animate(ANIM_MODE_2, 0); + _object3.animate(ANIM_MODE_2, NULL); _object3.setPosition(Common::Point(158, 136)); - _object3.setPriority2(1); + _object3.fixPriority(1); _object4.postInit(); _object4.setVisage(7601); _object4.setStrip(3); - _object4.animate(ANIM_MODE_2, 0); + _object4.animate(ANIM_MODE_2, NULL); _object4.setPosition(Common::Point(293, 141)); - _object4.setPriority2(1); + _object4.fixPriority(1); _object5.postInit(); _object5.setVisage(7601); _object5.setStrip(4); - _object5.animate(ANIM_MODE_2, 0); + _object5.animate(ANIM_MODE_2, NULL); _object5.setPosition(Common::Point(405, 143)); - _object5.setPriority2(1); + _object5.fixPriority(1); _object6.postInit(); _object6.setVisage(7601); _object6.setStrip(5); - _object6.animate(ANIM_MODE_2, 0); + _object6.animate(ANIM_MODE_2, NULL); _object6.setPosition(Common::Point(379, 191)); - _object6.setPriority2(1); + _object6.fixPriority(1); _globals->_player.postInit(); _globals->_player.setVisage(2333); - _globals->_player.animate(ANIM_MODE_1, 0); + _globals->_player.animate(ANIM_MODE_1, NULL); _globals->_player.setObjectWrapper(new SceneObjectWrapper()); _globals->_player.setStrip(1); _globals->_player._moveDiff = Common::Point(16, 16); @@ -1770,7 +1782,7 @@ void Scene7700::SceneHotspot3::doAction(int action) { } else if (RING_INVENTORY._key._sceneNumber == 7700) { _globals->_player.disableControl(); scene->_sceneMode = 7705; - scene->setAction(&scene->_sequenceManager, scene, 7705, &_globals->_player, 0); + scene->setAction(&scene->_sequenceManager, scene, 7705, &_globals->_player, NULL); } break; default: @@ -2036,27 +2048,26 @@ void Scene7700::Object8::doAction(int action) { scene->_object9.setVisage(7701); scene->_object9.setStrip2(3); scene->_object9.setPosition(Common::Point(91, 166), 0); - scene->_object9.setPriority2(200); + scene->_object9.fixPriority(200); scene->_object14.postInit(); scene->_object14.setVisage(7701); scene->_object14.setStrip(2); - scene->_object14.setPriority2(250); + scene->_object14.fixPriority(250); scene->_object14.setPosition(Common::Point(139, 151), 0); scene->_gfxButton.setText(EXIT_MSG); scene->_gfxButton._bounds.center(140, 189); scene->_gfxButton.draw(); - scene->_gfxButton._bounds.expandPanes(); - _globals->_sceneItems.push_front(&scene->_object10); + _globals->_sceneItems.push_front(&scene->_sceneItem10); _globals->_sceneItems.push_front(&scene->_object9); _globals->_player._canWalk = false; - } else { + } else if (_globals->getFlag(78)) { scene->_object15.postInit(); scene->_object15.setVisage(7701); scene->_object15.setPosition(Common::Point(140, 165), 0); - scene->_object15.setPriority2(200); + scene->_object15.fixPriority(200); scene->_gfxButton.setText(EXIT_MSG); scene->_gfxButton._bounds.center(140, 186); @@ -2068,11 +2079,13 @@ void Scene7700::Object8::doAction(int action) { scene->_object19.setStrip(6); scene->_object19.setPosition(Common::Point(140, 192), 0); - _globals->_sceneItems.push_front(&scene->_object10); - _globals->_sceneItems.push_front(&scene->_object8); - _globals->_sceneItems.push_front(&scene->_object9); + _globals->_sceneItems.push_front(&scene->_sceneItem10); + _globals->_sceneItems.push_front(&scene->_sceneHotspot8); + _globals->_sceneItems.push_front(&scene->_sceneHotspot9); _globals->_events.setCursor(CURSOR_WALK); _globals->_player._canWalk = false; + } else { + scene->setAction(&scene->_sequenceManager, scene, 7715, NULL); } } else { SceneHotspot::doAction(action); @@ -2100,7 +2113,7 @@ void Scene7700::Object9::doAction(int action) { scene->_object10.setStrip(4); scene->_object10.setPosition(Common::Point(159, 136)); _globals->_sceneItems.push_front(&scene->_object10); - scene->_object10.setPriority2(240); + scene->_object10.fixPriority(240); } scene->_soundHandler.startSound(262); scene->_object14.animate(ANIM_MODE_5, 0); @@ -2118,6 +2131,8 @@ void Scene7700::Object10::doAction(int action) { if (action == CURSOR_LOOK) { SceneItem::display(7700, 50, SET_WIDTH, 200, SET_EXT_BGCOLOR, 7, LIST_END); } else if (action == CURSOR_USE) { + _globals->_player._canWalk = true; + RING_INVENTORY._translator._sceneNumber = 1; _globals->setFlag(80); scene->_sceneItem10.remove(); scene->_gfxButton._bounds.expandPanes(); @@ -2188,7 +2203,7 @@ void Scene7700::Object12::doAction(int action) { void Scene7700::signal() { switch (_sceneMode) { case 7701: - _globals->_player.setPriority2(-1); + _globals->_player.fixPriority(-1); _globals->_player.setStrip2(-1); if (_globals->getFlag(78)) { _globals->_player.enableControl(); @@ -2216,10 +2231,13 @@ void Scene7700::signal() { _globals->_player.enableControl(); break; case 7705: - case 7708: RING_INVENTORY._key._sceneNumber = 1; _globals->_player.enableControl(); break; + case 7708: + RING_INVENTORY._paper._sceneNumber = 1; + _globals->_player.enableControl(); + break; case 7709: _globals->_events.setCursor(CURSOR_USE); break; @@ -2242,8 +2260,8 @@ void Scene7700::process(Event &event) { if (contains<SceneItem *>(_globals->_sceneItems, &_sceneItem10)) { if (_gfxButton.process(event)) { _sceneItem10.remove(); - _sceneHotspot15.remove(); - _sceneHotspot9.remove(); + _object15.remove(); + _object9.remove(); if (_globals->_sceneObjects->contains(&_object10)) _object10.remove(); if (_globals->_sceneObjects->contains(&_object14)) @@ -2259,7 +2277,7 @@ void Scene7700::process(Event &event) { _easterEgg1.postInit(); _easterEgg1.setVisage(7708); _easterEgg1.setPosition(Common::Point(163, 50), 0); - _easterEgg1.setPriority2(1); + _easterEgg1.fixPriority(1); _easterEgg1.animate(ANIM_MODE_2, 0); _easterEgg1.setAction(&_action6); } @@ -2301,7 +2319,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _globals->_player.setObjectWrapper(wrapper); _globals->_player.setPosition(Common::Point(-19, 68), 0); _globals->_player.setStrip2(7); - _globals->_player.setPriority2(95); + _globals->_player.fixPriority(95); _globals->_player.changeZoom(80); _globals->_player._moveDiff.x = 6; _globals->_player._moveDiff.y = 3; @@ -2312,7 +2330,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { if (_globals->getFlag(78)) { _prof.setStrip2(4); - _prof.setPriority2(80); + _prof.fixPriority(80); _prof.setPosition(Common::Point(159, 87), 0); } else { _prof.setPosition(Common::Point(203, 87), 0); @@ -2324,7 +2342,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _cloud.postInit(); _cloud.setVisage(7700); _cloud.setStrip2(5); - _cloud.setPriority2(1); + _cloud.fixPriority(1); _cloud.setPosition(Common::Point(133, 160), 0); _cloud._moveDiff.x = 1; _cloud._moveRate = 7; @@ -2339,7 +2357,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object2.postInit(); _object2.setVisage(7700); _object2.setPosition(Common::Point(184, 70), 0); - _object2.setPriority2(60); + _object2.fixPriority(60); _object2._lookLineNum = 19; _object2._defltLineNum = 17; @@ -2358,7 +2376,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object5.postInit(); _object5.setVisage(7700); _object5.setPosition(Common::Point(268, 67), 0); - _object5.setPriority2(58); + _object5.fixPriority(58); _object5.setStrip2(3); _object5._lookLineNum = 38; _object5._defltLineNum = 36; @@ -2366,7 +2384,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object6.postInit(); _object6.setVisage(7700); _object6.setPosition(Common::Point(268, 75), 0); - _object6.setPriority2(57); + _object6.fixPriority(57); _object6.setStrip2(4); _object6._lookLineNum = 40; _object6._defltLineNum = 43; @@ -2375,7 +2393,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _object8.setVisage(7703); _object8.setPosition(Common::Point(203, 91), 0); _object8.setStrip2(4); - _object8.setPriority2(86); + _object8.fixPriority(86); _sceneHotspot8.setBounds(82, 141, 161, 92); _sceneHotspot9.setBounds(82, 187, 161, 141); @@ -2420,8 +2438,8 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _sceneHotspot15._useLineNum = 6; _sceneHotspot15._lookLineNum = 7; _sceneHotspot16.setBounds(0, 130, 34, 103); - _sceneHotspot16._useLineNum = 8; - _sceneHotspot16._lookLineNum = 9; + _sceneHotspot16._useLineNum = 7; + _sceneHotspot16._lookLineNum = 8; _sceneHotspot17.setBounds(41, 180, 46, 170); _sceneHotspot17._useLineNum = 11; _sceneHotspot17._lookLineNum = 13; diff --git a/engines/tsage/ringworld_scenes8.h b/engines/tsage/ringworld_scenes8.h index 0c39920614..e40f3d4133 100644 --- a/engines/tsage/ringworld_scenes8.h +++ b/engines/tsage/ringworld_scenes8.h @@ -41,6 +41,7 @@ public: NamedHotspotMult() : SceneHotspot() {} virtual Common::String getClassName() { return "NamedHotspotMult"; } + virtual void synchronise(Serialiser &s); }; class SceneObject7700 : public SceneObjectExt { @@ -107,7 +108,7 @@ public: SpeakerQL _speakerQL; SpeakerQR _speakerQR; SpeakerQText _speakerQText; - SceneObject _object1; + Object1 _object1; SceneObject _object2; SceneObject _object3; SceneObject _object4; diff --git a/engines/tsage/saveload.cpp b/engines/tsage/saveload.cpp index 8b07767f22..317bc4bbb7 100644 --- a/engines/tsage/saveload.cpp +++ b/engines/tsage/saveload.cpp @@ -24,6 +24,7 @@ */ #include "common/savefile.h" +#include "graphics/palette.h" #include "graphics/scaler.h" #include "graphics/thumbnail.h" #include "tsage/globals.h" diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index e316a601fb..9a99049c19 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -114,10 +114,15 @@ void SceneManager::sceneChange() { assert(_objectCount == _saver->getObjectCount()); } _objectCount = _saver->getObjectCount(); + _globals->_sceneHandler._delayTicks = 2; // Instantiate and set the new scene _scene = getNewScene(); - _scene->postInit(); + + if (!_saver->getMacroRestoreFlag()) + _scene->postInit(); + else + _scene->loadScene(_sceneNumber); } Scene *SceneManager::getNewScene() { @@ -289,7 +294,7 @@ void Scene::loadScene(int sceneNum) { } void Scene::loadSceneData(int sceneNum) { - _globals->_sceneManager._scene->_activeScreenNumber = sceneNum; + _activeScreenNumber = sceneNum; // Get the basic scene size byte *data = _resourceManager->getResource(RES_BITMAP, sceneNum, 9999); diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 7c8325d53e..63e753104e 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -23,8 +23,6 @@ * */ -#include "common/config-manager.h" -#include "common/endian.h" #include "tsage/core.h" #include "tsage/globals.h" #include "tsage/debugger.h" diff --git a/engines/tsage/staticres.cpp b/engines/tsage/staticres.cpp index 46b75e30ea..bc85718035 100644 --- a/engines/tsage/staticres.cpp +++ b/engines/tsage/staticres.cpp @@ -114,4 +114,7 @@ const char *SCENE6100_SWEAT = "Humans sweat, Kzin twitch their tail. What's the const char *SCENE6100_VERY_WELL = "Very well. I will retrieve the stasis box and return the probe. \ Wait for it's return in the lander bay."; +const char *DEMO_HELP_MSG = " Help...\rF2 - Sound Options\rF3 - Exit demo\r\rPress ENTER\rto continue"; +const char *DEMO_PAUSED_MSG = " demo is paused"; + } // End of namespace tSage diff --git a/engines/tsage/staticres.h b/engines/tsage/staticres.h index cb62272735..0db349f8a7 100644 --- a/engines/tsage/staticres.h +++ b/engines/tsage/staticres.h @@ -79,6 +79,10 @@ extern const char *SCENE6100_SURPRISE; extern const char *SCENE6100_SWEAT; extern const char *SCENE6100_VERY_WELL; +// Demo messages +extern const char *DEMO_HELP_MSG; +extern const char *DEMO_PAUSED_MSG; + } // End of namespace tSage #endif diff --git a/engines/tsage/tsage.cpp b/engines/tsage/tsage.cpp index 16756f59fa..d6f07c999b 100644 --- a/engines/tsage/tsage.cpp +++ b/engines/tsage/tsage.cpp @@ -23,11 +23,7 @@ * */ -#include "common/config-manager.h" -#include "common/debug.h" #include "common/debug-channels.h" -#include "common/system.h" -#include "common/savefile.h" #include "engines/util.h" #include "tsage/tsage.h" @@ -94,8 +90,6 @@ Common::Error TSageEngine::run() { // Basic initialisation initialise(); - _globals->_events.showCursor(); - _globals->_sceneHandler.registerHandler(); _globals->_game->execute(); diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index 108c6bcad5..ee117d233d 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -26,6 +26,7 @@ #include "tucker/tucker.h" #include "tucker/graphics.h" #include "common/system.h" +#include "graphics/palette.h" namespace Tucker { diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index c0f1baae99..aeb4399dee 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -24,6 +24,7 @@ */ #include "common/file.h" +#include "common/textconsole.h" #include "audio/audiostream.h" #include "audio/decoders/flac.h" diff --git a/engines/tucker/saveload.cpp b/engines/tucker/saveload.cpp index 83533a90c3..52c6bf19ce 100644 --- a/engines/tucker/saveload.cpp +++ b/engines/tucker/saveload.cpp @@ -24,6 +24,7 @@ */ #include "common/savefile.h" +#include "common/textconsole.h" #include "tucker/tucker.h" diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 5e99e3ccef..d747b346ee 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -24,11 +24,14 @@ */ #include "common/system.h" +#include "common/textconsole.h" #include "audio/audiostream.h" #include "audio/decoders/raw.h" #include "audio/decoders/wave.h" +#include "graphics/palette.h" + #include "tucker/tucker.h" #include "tucker/graphics.h" diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index e41cbfbeef..ed3046867b 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -26,10 +26,17 @@ #include "common/config-manager.h" #include "common/events.h" #include "common/system.h" +#include "common/archive.h" +#include "common/debug.h" +#include "common/error.h" +#include "common/keyboard.h" +#include "common/textconsole.h" #include "engines/util.h" #include "graphics/cursorman.h" +#include "graphics/palette.h" +#include "gui/debugger.h" #include "tucker/tucker.h" #include "tucker/graphics.h" |