22 #ifndef KYRA_KYRA_V2_H 23 #define KYRA_KYRA_V2_H 25 #include "kyra/kyra_v1.h" 26 #include "kyra/gui/gui_v1.h" 27 #include "kyra/graphics/wsamovie.h" 28 #include "kyra/engine/item.h" 30 #include "common/list.h" 31 #include "common/hashmap.h" 60 const uint8 *characterFrameTable;
63 int firstAnimSceneScript;
66 int animScriptFrameAdd;
75 void pauseEngineIntern(
bool pause)
override;
79 void delay(uint32 time,
bool update =
false,
bool isMainLoop =
false)
override;
81 const EngineDesc &engineDesc()
const {
return _desc; }
90 virtual void update() = 0;
91 virtual void updateWithText() = 0;
100 virtual int inputSceneChange(
int x,
int y,
int unk1,
int unk2) = 0;
108 uint16 specialRefresh;
120 int16 width2, height2;
125 void allocAnimObjects(
int actors,
int anims,
int items);
132 bool _drawNoShapeFlag;
139 virtual void refreshAnimObjects(
int force) = 0;
140 void refreshAnimObjectsIfNeed();
142 void flagAnimObjsSpecialRefresh();
143 void flagAnimObjsForRefresh();
145 virtual void clearAnimObjects() = 0;
147 virtual void drawAnimObjects() = 0;
148 virtual void drawSceneAnimObject(
AnimObj *obj,
int x,
int y,
int drawLayer) = 0;
149 virtual void drawCharacterAnimObject(
AnimObj *obj,
int x,
int y,
int drawLayer) = 0;
151 virtual void updateCharacterAnim(
int) = 0;
152 virtual void updateSceneAnim(
int anim,
int newFrame) = 0;
154 void addItemToAnimList(
int item);
155 void deleteItemAnimEntry(
int item);
157 virtual void animSetupPaletteEntry(
AnimObj *){}
159 virtual void setCharacterAnimDim(
int w,
int h) = 0;
160 virtual void resetCharacterAnimDim() = 0;
162 virtual int getScale(
int x,
int y) = 0;
164 uint8 *_screenBuffer;
171 uint16 exit1, exit2, exit3, exit4;
178 uint16 _currentScene;
180 uint16 _sceneExit1, _sceneExit2, _sceneExit3, _sceneExit4;
181 int _sceneEnterX1, _sceneEnterY1, _sceneEnterX2, _sceneEnterY2,
182 _sceneEnterX3, _sceneEnterY3, _sceneEnterX4, _sceneEnterY4;
183 int _specialExitCount;
184 uint16 _specialExitTable[25];
185 bool checkSpecialSceneExit(
int num,
int x,
int y);
187 bool _overwriteSceneFacing;
189 virtual void enterNewScene(uint16 newScene,
int facing,
int unk1,
int unk2,
int unk3) = 0;
191 void runSceneScript6();
196 virtual int trySceneChange(
int *moveTable,
int unk1,
int unk2) = 0;
199 virtual void restorePage3() = 0;
215 void freeSceneAnims();
217 bool _specialSceneScriptState[10];
218 bool _specialSceneScriptStateBackup[10];
220 uint32 _sceneSpecialScriptsTimer[10];
221 int _lastProcessedSceneScript;
222 bool _specialSceneScriptRunFlag;
224 void updateSpecialSceneScripts();
231 void runAnimationScript(
const char *filename,
int allowSkip,
int resetChar,
int newShapes,
int shapeUnload);
233 int o2a_setAnimationShapes(
EMCState *script);
234 int o2a_setResetFrame(
EMCState *script);
236 char _animShapeFilename[14];
238 uint8 *_animShapeFiledata;
240 int _animShapeLastEntry;
247 int _animShapeWidth, _animShapeHeight;
248 int _animShapeXAdd, _animShapeYAdd;
250 bool _animNeedUpdate;
252 virtual int initAnimationShapes(uint8 *filedata) = 0;
253 void processAnimationScript(
int allowSkip,
int resetChar);
254 virtual void uninitAnimationShapes(
int count, uint8 *filedata) = 0;
258 ShapeMap _gameShapes;
260 uint8 *getShapePtr(
int index)
const;
261 void addShapeToPool(
const uint8 *data,
int realIndex,
int shape);
262 void addShapeToPool(uint8 *shpData,
int index);
263 void remShapeFromPool(
int idx);
265 int _characterShapeFile;
266 virtual void loadCharacterShapes(
int shapes) = 0;
269 int _movFacingTable[600];
273 int findWay(
int curX,
int curY,
int dstX,
int dstY,
int *moveTable,
int moveTableSize)
override;
275 bool directLinePassable(
int x,
int y,
int toX,
int toY);
277 int pathfinderInitPositionTable(
int *moveTable);
278 int pathfinderAddToPositionTable(
int index,
int v1,
int v2);
279 int pathfinderInitPositionIndexTable(
int tableLen,
int x,
int y);
280 int pathfinderAddToPositionIndexTable(
int index,
int v);
281 void pathfinderFinializePath(
int *moveTable,
int unk1,
int x,
int y,
int moveTableSize);
283 int _pathfinderPositionTable[400];
284 int _pathfinderPositionIndexTable[200];
294 void initItemList(
int size);
296 Item _hiddenItems[100];
302 int _savedMouseState;
307 int findItem(uint16 sceneId, Item
id);
308 int findItem(Item item);
310 void resetItemList();
311 void resetItem(
int index);
313 virtual void setMouseCursor(Item item) = 0;
315 void setHandItem(Item item)
override;
316 void removeHandItem()
override;
333 int _mainCharX, _mainCharY;
336 void moveCharacter(
int facing,
int x,
int y);
337 int updateCharPos(
int *table,
int force = 0);
338 void updateCharPosWithUpdate();
340 uint32 _updateCharPosNextUpdate;
342 virtual int getCharacterWalkspeed()
const = 0;
343 virtual void updateCharAnimFrame(
int *table) = 0;
351 int _chatVocHigh, _chatVocLow;
352 bool _chatTextEnabled;
357 virtual void setDlgIndex(
int dlgIndex) = 0;
359 virtual void randomSceneChat() = 0;
363 bool _unkSceneScreenFlag1;
364 bool _unkHandleSceneChangeFlag;
367 int o2_getCharacterX(
EMCState *script);
368 int o2_getCharacterY(
EMCState *script);
369 int o2_getCharacterFacing(
EMCState *script);
370 int o2_getCharacterScene(
EMCState *script);
371 int o2_setCharacterFacingOverwrite(
EMCState *script);
372 int o2_trySceneChange(
EMCState *script);
373 int o2_moveCharacter(
EMCState *script);
374 int o2_checkForItem(
EMCState *script);
375 int o2_defineItem(
EMCState *script);
376 int o2_addSpecialExit(
EMCState *script);
379 int o2_getShapeFlag1(
EMCState *script);
380 int o2_waitForConfirmationClick(
EMCState *script);
381 int o2_randomSceneChat(
EMCState *script);
382 int o2_setDlgIndex(
EMCState *script);
383 int o2_getDlgIndex(
EMCState *script);
384 int o2_defineRoomEntrance(
EMCState *script);
385 int o2_runAnimationScript(
EMCState *script);
386 int o2_setSpecialSceneScriptRunTime(
EMCState *script);
387 int o2_defineScene(
EMCState *script);
388 int o2_setSpecialSceneScriptState(
EMCState *script);
389 int o2_clearSpecialSceneScriptState(
EMCState *script);
390 int o2_querySpecialSceneScriptState(
EMCState *script);
391 int o2_setHiddenItemsEntry(
EMCState *script);
392 int o2_getHiddenItemsEntry(
EMCState *script);
393 int o2_disableTimer(
EMCState *script);
394 int o2_enableTimer(
EMCState *script);
395 int o2_setTimerCountdown(
EMCState *script);
396 int o2_setVocHigh(
EMCState *script);
397 int o2_getVocHigh(
EMCState *script);
Definition: kyra_v2.h:201
Definition: kyra_v2.h:287
Definition: kyra_v1.h:126
Definition: kyra_v2.h:167
Definition: kyra_v2.h:319
Definition: detection.h:38
Definition: kyra_v2.h:103
Definition: detection.h:27
Definition: debugger.h:68
Definition: screen_v2.h:30
Definition: wsamovie.h:112