25 #include "backends/keymapper/keymap.h" 26 #include "common/platform.h" 27 #include "common/random.h" 28 #include "common/rect.h" 29 #include "engines/advancedDetector.h" 30 #include "engines/engine.h" 32 #include "engines/metaengine.h" 33 #include "graphics/managed_surface.h" 34 #include "graphics/screen.h" 35 #include "graphics/pixelformat.h" 36 #include "graphics/surface.h" 37 #include "twine/detection.h" 38 #include "twine/input.h" 39 #include "twine/scene/actor.h" 40 #include "twine/scene/buggy.h" 41 #include "twine/script/script_life.h" 42 #include "twine/script/script_move.h" 43 #include "twine/shared.h" 48 #define EUROPE_VERSION 0 52 #define MODIFICATION_VERSION 2 55 #define DEFAULT_FRAMES_PER_SECOND 20 56 #define DEFAULT_HZ (1000 / DEFAULT_FRAMES_PER_SECOND) 58 #define ORIGINAL_WIDTH 640 59 #define ORIGINAL_HEIGHT 480 61 static const struct TwinELanguage {
66 {
"English",
"EN_", 1},
69 {
"Spanish",
"SP_", 1},
70 {
"Italian",
"IT_", 1},
71 {
"Portuguese",
"", 1}};
83 CONF_MOVIE_FLAWIDE = 2,
93 int32 _languageId = 0;
95 bool FlagDisplayText =
false;
99 MidiFileType MidiType = MIDIFILE_NONE;
101 int32 Version = EUROPE_VERSION;
107 int32 Movie = CONF_MOVIE_FLA;
113 bool WallCollision =
false;
115 bool UseAutoSaving =
false;
120 int32 ShadowMode = 0;
121 int32 PolygonDetails = 2;
123 bool SceZoom =
false;
153 enum class EngineState {
160 enum class SceneLoopState {
197 void update()
override;
202 int32 _isTimeFreezed = 0;
203 int32 _saveFreezedTime = 0;
204 int32 _mouseCursorState = 0;
207 TwineGameType _gameType;
208 EngineState _state = EngineState::Menu;
217 void processBookOfBu();
218 void processBonusList();
219 void processInventoryAction();
220 void processOptionsMenu();
222 void initConfigurations();
226 void processActorSamplePosition(int32 actorIdx);
228 void allocVideoMemory(int32 w, int32 h);
234 bool runGameEngine();
248 int32 toSeconds(
int x)
const;
249 void wipeSaveSlot(
int slot);
253 void pushMouseCursorVisible();
254 void popMouseCursorVisible();
256 bool isCDROM()
const {
return true; }
257 bool isLBA1()
const {
return _gameType == TwineGameType::GType_LBA; }
258 bool isLBA2()
const {
return _gameType == TwineGameType::GType_LBA2; }
259 bool isLBASlideShow()
const {
return _gameType == TwineGameType::GType_LBASHOW; }
260 bool isMod()
const {
return (_gameFlags & TwinE::TF_MOD) != 0; }
261 bool isDotEmuEnhanced()
const {
return (_gameFlags & TwinE::TF_DOTEMU_ENHANCED) != 0; }
262 bool isLba1Classic()
const {
return (_gameFlags & TwinE::TF_LBA1_CLASSIC) != 0; }
263 bool isDemo()
const {
return (_gameFlags &
ADGF_DEMO) != 0; };
264 bool isAndroid()
const {
return _platform == Common::Platform::kPlatformAndroid; };
265 const char *getGameId()
const;
268 inline int numLocations()
const {
269 const int maxLocations = isLBA1() ? 150 : NUM_LOCATIONS;
305 int32 _frameCounter = 0;
306 SceneLoopState _sceneLoopState = SceneLoopState::ReturnToMenu;
309 int32 _loopInventoryItem = 0;
310 int32 _stepFalling = 0;
316 bool _disableScreenRecenter =
false;
328 int originalWidth()
const;
329 int originalHeight()
const;
333 Common::Rect centerOnScreenX(int32 w, int32 y, int32 h)
const;
337 void testRestoreModeSVGA(
bool redraw);
339 void queueMovie(
const char *filename);
342 void adjustScreenMax(
Common::Rect &rect, int16 x, int16 y);
347 int getRandomNumber(uint max = 0x7FFF);
351 void restoreFrontBuffer();
352 void saveFrontBuffer();
354 void freezeTime(
bool pause);
361 bool gameEngineLoop();
368 bool delaySkip(uint32 time);
374 void setPalette(
const uint32 *palette);
382 void setPalette(uint startColor, uint numColors,
const byte *palette);
391 void copyBlockPhys(int32 left, int32 top, int32 right, int32 bottom);
404 void drawText(int32 x, int32 y,
const Common::String &text,
bool center =
false,
bool bigFont =
false,
int width = 100);
407 inline int TwinEEngine::width()
const {
408 return _frontVideoBuffer.w;
411 inline int TwinEEngine::height()
const {
412 return _frontVideoBuffer.h;
416 return Common::Rect(0, 0, _frontVideoBuffer.w - 1, _frontVideoBuffer.h - 1);
419 inline int TwinEEngine::originalWidth()
const {
423 inline int TwinEEngine::originalHeight()
const {
Definition: managed_surface.h:51
Graphics::ManagedSurface _workVideoBuffer
Definition: twine.h:320
EngineFeature
Definition: engine.h:250
Definition: animations.h:34
ConfigFile _cfgfile
Definition: twine.h:303
Definition: script_life_v1.h:31
Definition: renderer.h:97
Definition: debug_scene.h:33
Definition: script_move_v1.h:31
Definition: script_move.h:59
TwineScreen _frontVideoBuffer
Definition: twine.h:322
Definition: script_life.h:71
Definition: achievements_tables.h:27
Definition: resources.h:128
Definition: gamestate.h:42
Definition: debug_grid.h:31
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: twine.h:242
Add "-demo" to gameid.
Definition: advancedDetector.h:113
Definition: movements.h:34
Definition: collision.h:34
Language
Definition: language.h:45
Definition: interface.h:36