22#ifndef TRECISION_TRECISION_H
23#define TRECISION_TRECISION_H
25#include "common/str-array.h"
26#include "common/events.h"
27#include "common/keyboard.h"
28#include "common/str.h"
29#include "common/serializer.h"
30#include "common/stream.h"
31#include "engines/advancedDetector.h"
32#include "engines/engine.h"
33#include "graphics/surface.h"
35#include "trecision/defines.h"
36#include "trecision/fastfile.h"
37#include "trecision/struct.h"
38#include "trecision/scheduler.h"
58#define SAVE_VERSION_ORIGINAL_MIN 102
59#define SAVE_VERSION_ORIGINAL_MAX 109
60#define SAVE_VERSION_SCUMMVM_MIN 110
61#define SAVE_VERSION_SCUMMVM 110
65#define MAXINVENTORY 150
73enum TrecisionMessageIds {
74 kMessageSavePosition = 9,
75 kMessageEmptySpot = 10,
76 kMessageLoadPosition = 11,
77 kMessageConfirmExit = 13,
78 kMessageDemoOver = 17,
119 void refreshInventory(uint8 startIcon, uint8 startLine);
120 void moveInventoryLeft();
121 void moveInventoryRight();
123 void rollInventory(uint8 status);
130 void processScriptFrame();
133 void processMouseMovement();
136 void doRoomIn(uint16 curObj);
137 void doRoomOut(uint16 curObj);
138 void doMouseExamine(uint16 curObj);
139 void doMouseOperate(uint16 curObj);
140 void doMouseTake(uint16 curObj);
142 void doScreenUseWithScreen();
146 void processCurrentMessage();
149 char *getNextSentence();
154 static bool isBetween(
int a,
int x,
int b);
157 bool canPlayerInteract();
163 TrecisionGameId _gameId;
166 uint16 _curScriptFrame[10];
182 TrecisionGameId getGameId()
const {
return _gameId; }
183 bool isDemo()
const {
return _gameDescription->
flags &
ADGF_DEMO; }
184 bool isAmiga()
const {
return _gameDescription->
platform == Common::kPlatformAmiga; }
197 void setInventoryStart(uint8 startIcon, uint8 startLine);
198 void showInventoryName(uint16 obj,
bool showhide);
201 int8 iconPos(uint8 icon);
202 void removeIcon(uint8 icon);
203 void addIcon(uint8 icon);
204 void replaceIcon(uint8 oldIcon, uint8 newIcon);
205 void openInventory();
206 void closeInventory();
207 void closeInventoryImmediately();
213 void playScript(uint16
id);
216 void startCharacterAction(uint16 action, uint16 newRoom, uint8 newPos, uint16 sent);
217 void doMouseTalk(uint16 curObj);
218 void changeRoom(uint16 room, uint16 action = 0,
byte position = 0);
221 uint16 textLength(
const Common::String &text, uint16 begin = 0, uint16 end = 0);
222 Common::KeyCode waitKey();
223 void waitDelay(uint32 val);
227 float sinCosAngle(
float sinus,
float cosinus);
228 float dist2D(
float x1,
float y1,
float x2,
float y2);
229 float dist3D(
float x1,
float y1,
float z1,
float x2,
float y2,
float z2);
233 int getRoomObjectIndex(uint16 objectId);
234 int floatComp(
float f1,
float f2)
const;
243 void setObjectVisible(uint16 objectId,
bool visible);
244 void refreshObject(uint16 objectId);
245 bool isObjectVisible(uint16 objectId);
246 void setObjectAnim(uint16 objectId, uint16 animId);
251 void readExtraObj2C();
252 void readPositionerSnapshots();
260 bool _controlPanelSave =
false;
264 SRoom _room[MAXROOMS];
274 uint16 _curInventory;
279 uint8 _inventoryStatus;
281 uint8 _inventoryRefreshStartIcon;
282 uint8 _inventoryRefreshStartLine;
283 int16 _inventoryCounter;
284 bool _flagInventoryLocked;
285 uint8 _inventorySpeedIndex;
286 uint32 _inventoryScrollTime;
297 const char *_objName[MAXOBJNAME];
298 const char *_sentence[MAXSENTENCE];
299 const char *_sysText[MAXSYSTEXT];
309 bool _mouseMoved, _mouseLeftBtn, _mouseRightBtn;
310 Common::KeyCode _curKey;
312 bool _joyButtonUp =
false;
314 bool _flagScriptActive;
316 uint16 _scriptFirstFrame[MAXSCRIPT];
334 bool _flagDialogActive;
335 bool _flagDialogMenuActive;
337 bool _flagPaintCharacter;
338 bool _flagShowCharacter;
339 bool _flagSomeoneSpeaks;
340 bool _flagCharacterSpeak;
341 bool _flagUseWithStarted;
342 bool _flagNoPaintScreen;
348 uint32 _characterSpeakTime;
354 uint32 _pauseStartTime;
357uint8
static const defActionLen[hLAST + 1] = {
Definition: serializer.h:80
EngineFeature
Definition: engine.h:282
Definition: graphics.h:38
Definition: animmanager.h:49
Definition: animtype.h:38
Definition: fastfile.h:38
Definition: graphics.h:42
Definition: pathfinding3d.h:89
Definition: renderer3d.h:41
Definition: scheduler.h:55
Definition: trecision.h:112
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
Common::Error run() override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: trecision.h:186
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: trecision.h:187
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
bool hasFeature(EngineFeature f) const override
uint32 CustomEventType
Definition: events.h:212
@ ADGF_DEMO
Add "-demo" to gameid.
Definition: advancedDetector.h:157
Definition: advancedDetector.h:164
uint32 flags
Definition: advancedDetector.h:207
Common::Platform platform
Definition: advancedDetector.h:199
Definition: list_intern.h:54
Definition: trecision.h:100
Definition: scheduler.h:34
Definition: trecision.h:107