25 #include "common/platform.h" 26 #include "common/random.h" 27 #include "common/rect.h" 28 #include "engines/advancedDetector.h" 29 #include "engines/engine.h" 31 #include "engines/metaengine.h" 32 #include "graphics/managed_surface.h" 33 #include "graphics/screen.h" 34 #include "graphics/surface.h" 35 #include "twine/detection.h" 36 #include "twine/input.h" 37 #include "twine/scene/actor.h" 38 #include "twine/script/script_life.h" 39 #include "twine/script/script_move.h" 40 #include "twine/shared.h" 45 #define EUROPE_VERSION 0 49 #define MODIFICATION_VERSION 2 52 #define DEFAULT_FRAMES_PER_SECOND 20 53 #define DEFAULT_HZ (1000 / DEFAULT_FRAMES_PER_SECOND) 55 #define ORIGINAL_WIDTH 640 56 #define ORIGINAL_HEIGHT 480 58 static const struct TwinELanguage {
63 {
"English",
"EN_", 1},
66 {
"Spanish",
"SP_", 1},
67 {
"Italian",
"IT_", 1},
68 {
"Portuguese",
"", 1}};
80 CONF_MOVIE_FLAWIDE = 2,
90 int32 _languageId = 0;
92 bool FlagDisplayText =
false;
94 MidiFileType MidiType = MIDIFILE_NONE;
96 int32 Version = EUROPE_VERSION;
100 int32 Movie = CONF_MOVIE_FLA;
106 bool WallCollision =
false;
108 bool UseAutoSaving =
false;
113 int32 ShadowMode = 0;
114 int32 PolygonDetails = 2;
116 bool SceZoom =
false;
152 enum class EngineState {
159 enum class SceneLoopState {
190 void update()
override;
194 int32 boundRuleThree(int32 val1, int32 val2, int32 nbstep, int32 step);
205 int32 ruleThree32(int32 value, int32 start, int32 end, int32 t);
209 int32 _isTimeFreezed = 0;
210 int32 _saveFreezedTime = 0;
211 int32 _mouseCursorState = 0;
214 TwineGameType _gameType;
215 EngineState _state = EngineState::Menu;
221 void processBookOfBu();
222 void processBonusList();
223 void processInventoryAction();
224 void processOptionsMenu();
226 void initConfigurations();
230 void processActorSamplePosition(int32 actorIdx);
232 void allocVideoMemory(int32 w, int32 h);
238 bool runGameEngine();
252 int32 toSeconds(
int x)
const;
253 void wipeSaveSlot(
int slot);
257 void pushMouseCursorVisible();
258 void popMouseCursorVisible();
260 bool isCDROM()
const {
return true; }
261 bool isLBA1()
const {
return _gameType == TwineGameType::GType_LBA; }
262 bool isLBA2()
const {
return _gameType == TwineGameType::GType_LBA2; }
263 bool isLBASlideShow()
const {
return _gameType == TwineGameType::GType_LBASHOW; }
264 bool isMod()
const {
return (_gameFlags & TwinE::TF_MOD) != 0; }
265 bool isDotEmuEnhanced()
const {
return (_gameFlags & TwinE::TF_DOTEMU_ENHANCED) != 0; }
266 bool isLba1Classic()
const {
return (_gameFlags & TwinE::TF_LBA1_CLASSIC) != 0; }
267 bool isDemo()
const {
return (_gameFlags &
ADGF_DEMO) != 0; };
268 bool isAndroid()
const {
return _platform == Common::Platform::kPlatformAndroid; };
269 const char *getGameId()
const;
272 inline int numHoloPos()
const {
273 const int maxLocations = isLBA1() ? MAX_HOLO_POS : MAX_HOLO_POS_2;
277 inline int getMaxLife()
const {
278 return isLBA1() ? 50 : 255;
317 int32 _frameCounter = 0;
318 SceneLoopState _sceneLoopState = SceneLoopState::ReturnToMenu;
321 int32 _loopInventoryItem = 0;
322 int32 _stepFalling = 0;
323 uint32 _gameFlags = 0u;
325 bool _flagRain =
false;
328 bool _cameraZone =
false;
340 int originalWidth()
const;
341 int originalHeight()
const;
345 Common::Rect centerOnScreenX(int32 w, int32 y, int32 h)
const;
349 void testRestoreModeSVGA(
bool redraw);
351 void queueMovie(
const char *filename);
354 void adjustScreenMax(
Common::Rect &rect, int16 x, int16 y);
359 int getRandomNumber(uint max = 0x7FFF);
363 void restoreFrontBuffer();
364 void saveFrontBuffer();
366 void saveTimer(
bool pause);
380 bool delaySkip(uint32 time);
395 void setPalette(uint startColor, uint numColors,
const byte *palette);
404 void copyBlockPhys(int32 left, int32 top, int32 right, int32 bottom);
417 void drawText(int32 x, int32 y,
const Common::String &text,
bool center =
false,
bool bigFont =
false,
int width = 100);
420 inline int TwinEEngine::width()
const {
421 return _frontVideoBuffer.w;
424 inline int TwinEEngine::height()
const {
425 return _frontVideoBuffer.h;
429 return Common::Rect(0, 0, _frontVideoBuffer.w - 1, _frontVideoBuffer.h - 1);
432 inline int TwinEEngine::originalWidth()
const {
436 inline int TwinEEngine::originalHeight()
const {
Definition: managed_surface.h:51
Graphics::ManagedSurface _workVideoBuffer
Definition: twine.h:332
EngineFeature
Definition: engine.h:253
Definition: animations.h:34
ConfigFile _cfgfile
Definition: twine.h:315
Definition: debug_state.h:36
Definition: script_life_v1.h:31
Definition: renderer.h:100
Definition: script_move_v1.h:31
Definition: script_move.h:59
TwineScreen _frontVideoBuffer
Definition: twine.h:334
Definition: script_life.h:71
Definition: achievements_tables.h:27
Definition: resources.h:130
Simple class for handling a palette data.
Definition: palette.h:45
Definition: gamestate.h:42
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: twine.h:246
Add "-demo" to gameid.
Definition: advancedDetector.h:156
Definition: movements.h:34
Definition: collision.h:34
Language
Definition: language.h:45
Definition: interface.h:36