From dd1b43a5a91da0051a32938807d7a7fa157caa2a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 9 Oct 2007 08:44:45 +0000 Subject: HoF: - More input handling (should be rather complete now, not finished but nearlly) - Implemented the following opcodes: -> o2_trySceneChange 0x0d -> o2_setHandItem 0x2a -> o2_handItemSet 0x2c -> o2_setCharPalEntry 0x3c -> o2_drawSceneShape 0x3e -> o2_update 0x4b -> o2_fadeScenePal 0x4d -> o2_enterNewSceneEx 0x50 -> o2_setZanthiaPos 0x56 -> o2_runTemporaryScript 0x6e -> o2t_defineNewShape 0x00 -> o2t_setCurrentFrame 0x01 -> o2t_setShapeFlag 0x04 svn-id: r29178 --- engines/kyra/kyra_v2.h | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v2.h') diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index b8ea7234ce..e7d3f6c2d0 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -169,6 +169,7 @@ protected: int checkInput(void *p); void removeInputTop(); void handleInput(int x, int y); + bool handleInputUnkSub(int x, int y); int inputSceneChange(int x, int y, int unk1, int unk2); @@ -199,7 +200,7 @@ protected: struct ShapeDesc { uint8 unk0, unk1, unk2, unk3, unk4; - uint16 unk5, unk7; + uint16 width, height; int16 xAdd, yAdd; }; @@ -243,6 +244,20 @@ protected: int _drawLayerTable[15]; int _layerFlagTable[16]; // seems to indicate layers where items get destroyed when dropped to (TODO: check this!) + + char _newShapeFilename[13]; + int _newShapeLastEntry; + int _newShapeWidth, _newShapeHeight; + int _newShapeXAdd, _newShapeYAdd; + int _newShapeFlag; + uint8 *_newShapeFiledata; + int _newShapeCount; + int _newShapeAnimFrame; + int _newShapeDelay; + + int initNewShapes(uint8 *filedata); + void processNewShapes(int unk1, int unk2); + void resetNewShapes(int count, uint8 *filedata); // animator struct AnimObj { @@ -286,6 +301,8 @@ protected: void refreshAnimObjects(int force); void refreshAnimObjectsIfNeed(); + + void flagAnimObjsForRefresh(); void updateCharFacing(); void updateCharacterAnim(int); @@ -293,6 +310,10 @@ protected: void addItemToAnimList(int item); void deleteItemAnimEntry(int item); + + int _animObj0Width, _animObj0Height; + void setCharacterAnimDim(int w, int h); + void resetCharacterAnimDim(); // scene struct SceneDesc { @@ -323,6 +344,8 @@ protected: void loadScenePal(); void loadSceneMsc(); + + void fadeScenePal(int srcIndex, int delay); void startSceneScript(int unk1); void runSceneScript2(); @@ -388,6 +411,7 @@ protected: int getItemCommandStringPickUp(uint16 item); void setMouseCursor(uint16 item); + void setHandItem(uint16 item); void removeHandItem(); // inventroy @@ -437,6 +461,7 @@ protected: int _charPalEntry; uint8 _charPalTable[16]; void updateCharPal(int unk1); + void setCharPalEntry(int entry, int value); void moveCharacter(int facing, int x, int y); int updateCharPos(int *table); @@ -479,6 +504,7 @@ protected: int o2_getCharacterY(ScriptState *script); int o2_getCharacterFacing(ScriptState *script); int o2_setSceneComment(ScriptState *script); + int o2_trySceneChange(ScriptState *script); int o2_showChapterMessage(ScriptState *script); int o2_wsaClose(ScriptState *script); int o2_displayWsaFrame(ScriptState *script); @@ -488,17 +514,27 @@ protected: int o2_queryGameFlag(ScriptState *script); int o2_resetGameFlag(ScriptState *script); int o2_setGameFlag(ScriptState *script); + int o2_setHandItem(ScriptState *script); + int o2_handItemSet(ScriptState *script); int o2_hideMouse(ScriptState *script); int o2_addSpecialExit(ScriptState *script); int o2_showMouse(ScriptState *script); + int o2_delay(ScriptState *script); int o2_setScaleTableItem(ScriptState *script); int o2_setDrawLayerTableItem(ScriptState *script); + int o2_setCharPalEntry(ScriptState *script); + int o2_drawSceneShape(ScriptState *script); int o2_drawSceneShapeOnPage(ScriptState *script); int o2_restoreBackBuffer(ScriptState *script); + int o2_update(ScriptState *script); + int o2_fadeScenePal(ScriptState *script); + int o2_enterNewSceneEx(ScriptState *script); int o2_setLayerFlag(ScriptState *script); + int o2_setZanthiaPos(ScriptState *script); int o2_getRand(ScriptState *script); int o2_encodeShape(ScriptState *script); int o2_defineRoomEntrance(ScriptState *script); + int o2_runTemporaryScript(ScriptState *script); int o2_setSpecialSceneScriptRunTime(ScriptState *script); int o2_defineSceneAnim(ScriptState *script); int o2_updateSceneAnim(ScriptState *script); @@ -507,6 +543,11 @@ protected: int o2_clearSpecialSceneScriptState(ScriptState *script); int o2_querySpecialSceneScriptState(ScriptState *script); int o2_dummy(ScriptState *script); + + // opcodes temporary + int o2t_defineNewShapes(ScriptState *script); + int o2t_setCurrentFrame(ScriptState *script); + int o2t_setShapeFlag(ScriptState *script); // script void runStartScript(int script, int unk1); @@ -519,6 +560,13 @@ protected: ScriptData _sceneScriptData; ScriptState _sceneScriptState; + ScriptData _temporaryScriptData; + ScriptState _temporaryScriptState; + bool _temporaryScriptExecBit; + Common::Array _opcodesTemporary; + + void runTemporaryScript(const char *filename, int unk1, int unk2, int newShapes, int shapeUnload); + // pathfinder int _pathfinderFlag; -- cgit v1.2.3