diff options
Diffstat (limited to 'engines/tinsel/tinsel.h')
-rw-r--r-- | engines/tinsel/tinsel.h | 70 |
1 files changed, 64 insertions, 6 deletions
diff --git a/engines/tinsel/tinsel.h b/engines/tinsel/tinsel.h index 080e539f69..370d500abc 100644 --- a/engines/tinsel/tinsel.h +++ b/engines/tinsel/tinsel.h @@ -28,6 +28,7 @@ #include "common/scummsys.h" #include "common/system.h" +#include "common/error.h" #include "common/events.h" #include "common/keyboard.h" #include "common/util.h" @@ -39,10 +40,12 @@ #include "tinsel/debugger.h" #include "tinsel/graphics.h" #include "tinsel/sound.h" +#include "tinsel/dw.h" namespace Tinsel { -class MusicPlayer; +class MidiMusicPlayer; +class PCMMusicPlayer; class Scheduler; class SoundManager; @@ -65,11 +68,34 @@ enum TinselGameFeatures { GF_USE_5FLAGS = 1 << 6 // All 5 flags }; +/** + * The following is the ScummVM definitions of the various Tinsel versions: + * TINSEL_V0 - This was an early engine version that was only used in the Discworld 1 + * demo. It is not currently supported. + * TINSEL_V1 - This was the engine version used by Discworld 1. Note that there were two + * major releases: an earlier version that used *.gra files, and a later one that + * used *.scn files, and contained certain script and engine bugfixes. In ScummVM, + * we treat both releases as 'Tinsel 1', since the engine fixes from the later + * version work equally well the earlier version data. + * TINSEL_V2 - This is the engine used for the Discworld 2 game. + */ enum TinselEngineVersion { - TINSEL_V0 = 0, // Used in the DW1 demo only - TINSEL_V1 = 1 + TINSEL_V0 = 0, + TINSEL_V1 = 1, + TINSEL_V2 = 2 +}; + +enum { + kTinselDebugAnimations = 1 << 0, + kTinselDebugActions = 1 << 1, + kTinselDebugSound = 1 << 2, + kTinselDebugMusic = 2 << 3 }; +#define DEBUG_BASIC 1 +#define DEBUG_INTERMEDIATE 2 +#define DEBUG_DETAILED 3 + struct TinselGameDescription; enum TinselKeyDirection { @@ -79,6 +105,22 @@ enum TinselKeyDirection { typedef bool (*KEYFPTR)(const Common::KeyState &); +#define SCREEN_WIDTH (_vm->screen().w) // PC screen dimensions +#define SCREEN_HEIGHT (_vm->screen().h) +#define SCRN_CENTRE_X ((SCREEN_WIDTH - 1) / 2) // screen centre x +#define SCRN_CENTRE_Y ((SCREEN_HEIGHT - 1) / 2) // screen centre y +#define UNUSED_LINES 48 +#define EXTRA_UNUSED_LINES 3 +//#define SCREEN_BOX_HEIGHT1 (SCREEN_HEIGHT - UNUSED_LINES) +//#define SCREEN_BOX_HEIGHT2 (SCREEN_BOX_HEIGHT1 - EXTRA_UNUSED_LINES) +#define SCREEN_BOX_HEIGHT1 SCREEN_HEIGHT +#define SCREEN_BOX_HEIGHT2 SCREEN_HEIGHT + +#define GAME_FRAME_DELAY (1000 / ONE_SECOND) + +#define TinselVersion (_vm->getVersion()) +#define TinselV2 (TinselVersion == TINSEL_V2) + class TinselEngine : public Engine { int _gameId; Common::KeyState _keyPressed; @@ -89,11 +131,16 @@ class TinselEngine : public Engine { Console *_console; Scheduler *_scheduler; + static const char *_sampleIndices[][3]; + static const char *_sampleFiles[][3]; + static const char *_textFiles[][3]; + protected: // Engine APIs virtual Common::Error init(); virtual Common::Error go(); + virtual void syncSoundSettings(); public: TinselEngine(OSystem *syst, const TinselGameDescription *gameDesc); @@ -109,13 +156,18 @@ public: uint16 getVersion() const; Common::Platform getPlatform() const; + const char *getSampleIndex(LANGUAGE lang); + const char *getSampleFile(LANGUAGE lang); + const char *getTextFile(LANGUAGE lang); + MidiDriver *_driver; SoundManager *_sound; - MusicPlayer *_music; + MidiMusicPlayer *_midiMusic; + PCMMusicPlayer *_pcmMusic; KEYFPTR _keyHandler; private: - //MusicPlayer *_music; + //MidiMusicPlayer *_midiMusic; int _musicVolume; void NextGameCycle(void); @@ -134,7 +186,8 @@ public: Common::Point getMousePosition() const { return _mousePos; } void setMousePosition(const Common::Point &pt) { - g_system->warpMouse(pt.x, pt.y); + int ySize = (g_system->getHeight() - _screenSurface.h) / 2; + g_system->warpMouse(pt.x, pt.y + ySize); _mousePos = pt; } void divertKeyInput(KEYFPTR fptr) { _keyHandler = fptr; } @@ -145,6 +198,11 @@ public: // Global reference to the TinselEngine object extern TinselEngine *_vm; +// Externally available methods +void CuttingScene(bool bCutting); +void CDChangeForRestore(int cdNumber); +void CdHasChanged(void); + } // End of namespace Tinsel #endif /* TINSEL_H */ |