22 #ifndef TINSEL_TINSEL_H 23 #define TINSEL_TINSEL_H 25 #include "common/scummsys.h" 26 #include "common/system.h" 27 #include "common/error.h" 28 #include "common/events.h" 29 #include "common/keyboard.h" 30 #include "common/random.h" 31 #include "common/util.h" 33 #include "engines/engine.h" 34 #include "gui/debugger.h" 36 #include "tinsel/debugger.h" 37 #include "tinsel/graphics.h" 38 #include "tinsel/sound.h" 39 #include "tinsel/dw.h" 40 #include "tinsel/detection.h" 56 class MidiMusicPlayer;
73 kTinselDebugAnimations = 1 << 0,
74 kTinselDebugActions = 1 << 1,
75 kTinselDebugSound = 1 << 2,
76 kTinselDebugMusic = 2 << 3
80 #define DEBUG_INTERMEDIATE 2 81 #define DEBUG_DETAILED 3 83 enum TinselKeyDirection {
84 MSK_LEFT = 1, MSK_RIGHT = 2, MSK_UP = 4, MSK_DOWN = 8,
85 MSK_DIRECTION = MSK_LEFT | MSK_RIGHT | MSK_UP | MSK_DOWN
90 #define SCREEN_WIDTH (_vm->screen().w) // PC screen dimensions 91 #define SCREEN_HEIGHT (_vm->screen().h) 92 #define SCRN_CENTER_X ((SCREEN_WIDTH - 1) / 2) // screen center x 93 #define SCRN_CENTER_Y ((SCREEN_HEIGHT - 1) / 2) // screen center y 94 #define UNUSED_LINES 48 95 #define EXTRA_UNUSED_LINES 3 98 #define SCREEN_BOX_HEIGHT1 SCREEN_HEIGHT 99 #define SCREEN_BOX_HEIGHT2 SCREEN_HEIGHT 101 #define GAME_FRAME_DELAY (1000 / ONE_SECOND) 103 #define TinselVersion (_vm->getVersion()) 104 #define TinselV2Demo (TinselVersion == 2 && _vm->getIsADGFDemo()) 105 #define TinselV1PSX (TinselVersion == 1 && _vm->getPlatform() == Common::kPlatformPSX) 106 #define TinselV1Mac (TinselVersion == 1 && _vm->getPlatform() == Common::kPlatformMacintosh) 107 #define TinselV1Saturn (TinselVersion == 1 && _vm->getPlatform() == Common::kPlatformSaturn) 109 #define READ_16(v) (TinselV1Mac || TinselV1Saturn ? READ_BE_UINT16(v) : READ_LE_UINT16(v)) 110 #define READ_32(v) (TinselV1Mac || TinselV1Saturn ? READ_BE_UINT32(v) : READ_LE_UINT32(v)) 111 #define WRITE_32(p, v) (TinselV1Mac || TinselV1Saturn ? WRITE_BE_UINT32(p, v) : WRITE_LE_UINT32(p, v)) 112 #define FROM_16(v) (TinselV1Mac || TinselV1Saturn ? FROM_BE_16(v) : FROM_LE_16(v)) 113 #define FROM_32(v) (TinselV1Mac || TinselV1Saturn ? FROM_BE_32(v) : FROM_LE_32(v)) 114 #define TO_32(v) (TinselV1Mac || TinselV1Saturn ? TO_BE_32(v) : TO_LE_32(v)) 117 extern TinselEngine *_vm;
127 static const char *
const _sampleIndices[][3];
128 static const char *
const _sampleFiles[][3];
129 static const char *
const _textFiles[][3];
130 static const char *
const _sceneFiles[];
155 uint32 getGameID()
const;
156 uint32 getFeatures()
const;
158 uint16 getVersion()
const;
160 bool getIsADGFDemo()
const;
163 const char *getSampleIndex(LANGUAGE lang);
164 const char *getSampleFile(LANGUAGE lang);
165 const char *getTextFile(LANGUAGE lang);
167 const char *getSceneFile(LANGUAGE lang);
199 void NextGameCycle();
200 void CreateConstProcesses();
202 void RestartDrivers();
216 pt.
x = CLIP<int16>(pt.
x, 0, SCREEN_WIDTH - 1);
217 pt.
y = CLIP<int16>(pt.
y, 0, SCREEN_HEIGHT - 1);
219 int yOffset = (TinselVersion >= 2) ? (
g_system->
getHeight() - _screenSurface.
h) / 2 : 0;
223 void divertKeyInput(KEYFPTR fptr) { _keyHandler = fptr; }
224 int getRandomNumber(
int maxNumber) {
return _random.
getRandomNumber(maxNumber); }
225 uint8 getKeyDirection()
const {
return _dosPlayerDir; }
229 void CuttingScene(
bool bCutting);
230 void CDChangeForRestore(
int cdNumber);
EngineFeature
Definition: engine.h:250
RectList _clipRects
Definition: tinsel.h:196
Common::Error run() override
int16 h
Definition: surface.h:75
uint getRandomNumber(uint max)
Common::List< Common::EventType > _mouseButtons
Definition: tinsel.h:189
Definition: background.h:81
virtual int16 getHeight()=0
Definition: mididrv.h:299
virtual Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false)
Definition: notebook.h:60
bool hasFeature(EngineFeature f) const override
Common::Error loadGameState(int slot) override
const Common::String _targetName
Definition: engine.h:180
Definition: detection.h:69
Definition: dialogs.h:267
int16 x
Definition: rect.h:46
int16 y
Definition: rect.h:47
Definition: keyboard.h:294
Definition: savefile.h:142
virtual void warpMouse(int x, int y)=0
void initializePath(const Common::FSNode &gamePath) override
Common::List< Common::Event > _keypresses
Definition: tinsel.h:192
Common::SaveFileManager * _saveFileMan
Definition: engine.h:166
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Language
Definition: language.h:45
virtual bool canSaveGameStateCurrently(Common::U32String *msg=nullptr)