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;
99 virtual int inputSceneChange(
int x,
int y,
int unk1,
int unk2) = 0;
107 uint16 specialRefresh;
119 int16 width2, height2;
124 void allocAnimObjects(
int actors,
int anims,
int items);
131 bool _drawNoShapeFlag;
138 virtual void refreshAnimObjects(
int force) = 0;
139 void refreshAnimObjectsIfNeed();
141 void flagAnimObjsSpecialRefresh();
142 void flagAnimObjsForRefresh();
144 virtual void clearAnimObjects() = 0;
146 virtual void drawAnimObjects() = 0;
147 virtual void drawSceneAnimObject(
AnimObj *obj,
int x,
int y,
int drawLayer) = 0;
148 virtual void drawCharacterAnimObject(
AnimObj *obj,
int x,
int y,
int drawLayer) = 0;
150 virtual void updateCharacterAnim(
int) = 0;
151 virtual void updateSceneAnim(
int anim,
int newFrame) = 0;
153 void addItemToAnimList(
int item);
154 void deleteItemAnimEntry(
int item);
156 virtual void animSetupPaletteEntry(
AnimObj *){}
158 virtual void setCharacterAnimDim(
int w,
int h) = 0;
159 virtual void resetCharacterAnimDim() = 0;
161 virtual int getScale(
int x,
int y) = 0;
163 uint8 *_screenBuffer;
170 uint16 exit1, exit2, exit3, exit4;
177 uint16 _currentScene;
179 uint16 _sceneExit1, _sceneExit2, _sceneExit3, _sceneExit4;
180 int _sceneEnterX1, _sceneEnterY1, _sceneEnterX2, _sceneEnterY2,
181 _sceneEnterX3, _sceneEnterY3, _sceneEnterX4, _sceneEnterY4;
182 int _specialExitCount;
183 uint16 _specialExitTable[25];
184 bool checkSpecialSceneExit(
int num,
int x,
int y);
186 bool _overwriteSceneFacing;
188 virtual void enterNewScene(uint16 newScene,
int facing,
int unk1,
int unk2,
int unk3) = 0;
190 void runSceneScript6();
195 virtual int trySceneChange(
int *moveTable,
int unk1,
int unk2) = 0;
198 virtual void restorePage3() = 0;
214 void freeSceneAnims();
216 bool _specialSceneScriptState[10];
217 bool _specialSceneScriptStateBackup[10];
219 uint32 _sceneSpecialScriptsTimer[10];
220 int _lastProcessedSceneScript;
221 bool _specialSceneScriptRunFlag;
223 void updateSpecialSceneScripts();
230 void runAnimationScript(
const char *filename,
int allowSkip,
int resetChar,
int newShapes,
int shapeUnload);
232 int o2a_setAnimationShapes(
EMCState *script);
233 int o2a_setResetFrame(
EMCState *script);
235 char _animShapeFilename[14];
237 uint8 *_animShapeFiledata;
239 int _animShapeLastEntry;
246 int _animShapeWidth, _animShapeHeight;
247 int _animShapeXAdd, _animShapeYAdd;
249 bool _animNeedUpdate;
251 virtual int initAnimationShapes(uint8 *filedata) = 0;
252 void processAnimationScript(
int allowSkip,
int resetChar);
253 virtual void uninitAnimationShapes(
int count, uint8 *filedata) = 0;
257 ShapeMap _gameShapes;
259 uint8 *getShapePtr(
int index)
const;
260 void addShapeToPool(
const uint8 *data,
int realIndex,
int shape);
261 void addShapeToPool(uint8 *shpData,
int index);
262 void remShapeFromPool(
int idx);
264 int _characterShapeFile;
265 virtual void loadCharacterShapes(
int shapes) = 0;
268 int _movFacingTable[600];
272 int findWay(
int curX,
int curY,
int dstX,
int dstY,
int *moveTable,
int moveTableSize)
override;
274 bool directLinePassable(
int x,
int y,
int toX,
int toY);
276 int pathfinderInitPositionTable(
int *moveTable);
277 int pathfinderAddToPositionTable(
int index,
int v1,
int v2);
278 int pathfinderInitPositionIndexTable(
int tableLen,
int x,
int y);
279 int pathfinderAddToPositionIndexTable(
int index,
int v);
280 void pathfinderFinializePath(
int *moveTable,
int unk1,
int x,
int y,
int moveTableSize);
282 int _pathfinderPositionTable[400];
283 int _pathfinderPositionIndexTable[200];
293 void initItemList(
int size);
295 Item _hiddenItems[100];
301 int _savedMouseState;
306 int findItem(uint16 sceneId, Item
id);
307 int findItem(Item item);
309 void resetItemList();
310 void resetItem(
int index);
312 virtual void setMouseCursor(Item item) = 0;
314 void setHandItem(Item item)
override;
315 void removeHandItem()
override;
332 int _mainCharX, _mainCharY;
335 void moveCharacter(
int facing,
int x,
int y);
336 int updateCharPos(
int *table,
int force = 0);
337 void updateCharPosWithUpdate();
339 uint32 _updateCharPosNextUpdate;
341 virtual int getCharacterWalkspeed()
const = 0;
342 virtual void updateCharAnimFrame(
int *table) = 0;
350 int _chatVocHigh, _chatVocLow;
351 bool _chatTextEnabled;
356 virtual void setDlgIndex(
int dlgIndex) = 0;
358 virtual void randomSceneChat() = 0;
362 bool _unkSceneScreenFlag1;
363 bool _unkHandleSceneChangeFlag;
366 int o2_getCharacterX(
EMCState *script);
367 int o2_getCharacterY(
EMCState *script);
368 int o2_getCharacterFacing(
EMCState *script);
369 int o2_getCharacterScene(
EMCState *script);
370 int o2_setCharacterFacingOverwrite(
EMCState *script);
371 int o2_trySceneChange(
EMCState *script);
372 int o2_moveCharacter(
EMCState *script);
373 int o2_checkForItem(
EMCState *script);
374 int o2_defineItem(
EMCState *script);
375 int o2_addSpecialExit(
EMCState *script);
378 int o2_getShapeFlag1(
EMCState *script);
379 int o2_waitForConfirmationClick(
EMCState *script);
380 int o2_randomSceneChat(
EMCState *script);
381 int o2_setDlgIndex(
EMCState *script);
382 int o2_getDlgIndex(
EMCState *script);
383 int o2_defineRoomEntrance(
EMCState *script);
384 int o2_runAnimationScript(
EMCState *script);
385 int o2_setSpecialSceneScriptRunTime(
EMCState *script);
386 int o2_defineScene(
EMCState *script);
387 int o2_setSpecialSceneScriptState(
EMCState *script);
388 int o2_clearSpecialSceneScriptState(
EMCState *script);
389 int o2_querySpecialSceneScriptState(
EMCState *script);
390 int o2_setHiddenItemsEntry(
EMCState *script);
391 int o2_getHiddenItemsEntry(
EMCState *script);
392 int o2_disableTimer(
EMCState *script);
393 int o2_enableTimer(
EMCState *script);
394 int o2_setTimerCountdown(
EMCState *script);
395 int o2_setVocHigh(
EMCState *script);
396 int o2_getVocHigh(
EMCState *script);
Definition: kyra_v2.h:200
Definition: kyra_v2.h:286
Definition: kyra_v1.h:126
Definition: kyra_v2.h:166
Definition: kyra_v2.h:318
Definition: detection.h:38
Definition: kyra_v2.h:102
Definition: detection.h:27
Definition: debugger.h:68
Definition: screen_v2.h:30
Definition: wsamovie.h:112