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" 57 class MidiMusicPlayer;
97 kTinselDebugAnimations = 1 << 0,
98 kTinselDebugActions = 1 << 1,
99 kTinselDebugSound = 1 << 2,
100 kTinselDebugMusic = 2 << 3
104 #define NOIR_SKIP_INTRO 0 106 #define DEBUG_BASIC 1 107 #define DEBUG_INTERMEDIATE 2 108 #define DEBUG_DETAILED 3 110 enum TinselKeyDirection {
111 MSK_LEFT = 1, MSK_RIGHT = 2, MSK_UP = 4, MSK_DOWN = 8,
112 MSK_DIRECTION = MSK_LEFT | MSK_RIGHT | MSK_UP | MSK_DOWN
117 #define SCREEN_WIDTH (_vm->screen().w) // PC screen dimensions 118 #define SCREEN_HEIGHT (_vm->screen().h) 119 #define SCRN_CENTER_X ((SCREEN_WIDTH - 1) / 2) // screen center x 120 #define SCRN_CENTER_Y ((SCREEN_HEIGHT - 1) / 2) // screen center y 121 #define UNUSED_LINES 48 122 #define EXTRA_UNUSED_LINES 3 125 #define SCREEN_BOX_HEIGHT1 SCREEN_HEIGHT 126 #define SCREEN_BOX_HEIGHT2 SCREEN_HEIGHT 128 #define GAME_FRAME_DELAY (1000 / ONE_SECOND) 130 #define TinselVersion (_vm->getVersion()) 131 #define TinselV2Demo (TinselVersion == 2 && _vm->getIsADGFDemo()) 132 #define TinselV1PSX (TinselVersion == 1 && _vm->getPlatform() == Common::kPlatformPSX) 133 #define TinselV1Mac (TinselVersion == 1 && _vm->getPlatform() == Common::kPlatformMacintosh) 134 #define TinselV1Saturn (TinselVersion == 1 && _vm->getPlatform() == Common::kPlatformSaturn) 136 #define READ_16(v) (TinselV1Mac || TinselV1Saturn ? READ_BE_UINT16(v) : READ_LE_UINT16(v)) 137 #define READ_32(v) (TinselV1Mac || TinselV1Saturn ? READ_BE_UINT32(v) : READ_LE_UINT32(v)) 138 #define WRITE_32(p, v) (TinselV1Mac || TinselV1Saturn ? WRITE_BE_UINT32(p, v) : WRITE_LE_UINT32(p, v)) 139 #define FROM_16(v) (TinselV1Mac || TinselV1Saturn ? FROM_BE_16(v) : FROM_LE_16(v)) 140 #define FROM_32(v) (TinselV1Mac || TinselV1Saturn ? FROM_BE_32(v) : FROM_LE_32(v)) 141 #define TO_32(v) (TinselV1Mac || TinselV1Saturn ? TO_BE_32(v) : TO_LE_32(v)) 144 extern TinselEngine *_vm;
148 Common::KeyState _keyPressed;
154 static const char *
const _sampleIndices[][3];
155 static const char *
const _sampleFiles[][3];
156 static const char *
const _textFiles[][3];
157 static const char *
const _sceneFiles[];
182 uint32 getGameID()
const;
183 uint32 getFeatures()
const;
185 uint16 getVersion()
const;
187 bool getIsADGFDemo()
const;
190 const char *getSampleIndex(LANGUAGE lang);
191 const char *getSampleFile(LANGUAGE lang);
192 const char *getTextFile(LANGUAGE lang);
194 const char *getSceneFile(LANGUAGE lang);
227 void NextGameCycle();
228 void CreateConstProcesses();
230 void RestartDrivers();
244 pt.
x = CLIP<int16>(pt.
x, 0, SCREEN_WIDTH - 1);
245 pt.
y = CLIP<int16>(pt.
y, 0, SCREEN_HEIGHT - 1);
247 int yOffset = (TinselVersion >= 2) ? (
g_system->
getHeight() - _screenSurface.
h) / 2 : 0;
251 void divertKeyInput(KEYFPTR fptr) { _keyHandler = fptr; }
252 int getRandomNumber(
int maxNumber) {
return _random.
getRandomNumber(maxNumber); }
253 uint8 getKeyDirection()
const {
return _dosPlayerDir; }
257 void CuttingScene(
bool bCutting);
258 void CDChangeForRestore(
int cdNumber);
EngineFeature
Definition: engine.h:253
RectList _clipRects
Definition: tinsel.h:224
Common::Error run() override
int16 h
Definition: surface.h:76
uint getRandomNumber(uint max)
Common::List< Common::EventType > _mouseButtons
Definition: tinsel.h:217
uint32 CustomEventType
Definition: events.h:193
Definition: background.h:81
virtual int16 getHeight()=0
Definition: mididrv.h:309
virtual Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false)
Definition: notebook.h:60
Definition: atari-cursor.h:38
bool hasFeature(EngineFeature f) const override
Common::Error loadGameState(int slot) override
const Common::String _targetName
Definition: engine.h:181
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:220
Common::SaveFileManager * _saveFileMan
Definition: engine.h:167
Definition: spriter.h:200
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Language
Definition: language.h:45
virtual bool canSaveGameStateCurrently(Common::U32String *msg=nullptr)