From d5545bd8c5589e8d919350b932eaed76b28e83e9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 May 2008 19:23:45 +0000 Subject: - Moved newShape/temporaryScript code to KyraEngine_v2. - Renamed newShape/temporaryScript code to animationScript. svn-id: r31841 --- engines/kyra/kyra_v2.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 4 deletions(-) (limited to 'engines/kyra/kyra_v2.h') diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 6a426f3761..730366a435 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -40,12 +40,31 @@ class Screen_v2; class KyraEngine_v2 : public KyraEngine { friend class Debugger_v2; public: - KyraEngine_v2(OSystem *system, const GameFlags &flags); + struct EngineDesc { + // Generic shape related + const int itemShapeStart; + + // Scene script + const int firstAnimSceneScript; + + // Animation script specific + const int animScriptFrameAdd; + }; + + KyraEngine_v2(OSystem *system, const GameFlags &flags, const EngineDesc &desc); ~KyraEngine_v2(); virtual Screen_v2 *screen_v2() const = 0; + + const EngineDesc &engineDesc() const { return _desc; } protected: + EngineDesc _desc; + // run + bool _runFlag; + bool _showOutro; + int8 _deathHandler; + virtual void update() = 0; virtual void updateWithText() = 0; @@ -138,6 +157,8 @@ protected: virtual int getScale(int x, int y) = 0; + const uint8 *_characterFrameTable; + // Scene struct SceneDesc { char filename1[10]; @@ -197,7 +218,36 @@ protected: bool _specialSceneScriptRunFlag; void updateSpecialSceneScripts(); - virtual int getFirstSpecialSceneScript() const = 0; + + // Sequences + EMCData _animationScriptData; + EMCState _animationScriptState; + Common::Array _opcodesAnimation; + + void runAnimationScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload); + + int o2a_setAnimationShapes(EMCState *script); + int o2a_setResetFrame(EMCState *script); + + char _animShapeFilename[14]; + + uint8 *_animShapeFiledata; + int _animShapeCount; + int _animShapeLastEntry; + + int _animNewFrame; + int _animDelayTime; + + int _animResetFrame; + + int _animShapeWidth, _animShapeHeight; + int _animShapeXAdd, _animShapeYAdd; + + bool _animNeedUpdate; + + virtual int initAnimationShapes(uint8 *filedata) = 0; + void processAnimationScript(int allowSkip, int resetChar); + virtual void uninitAnimationShapes(int count, uint8 *filedata) = 0; // Shapes typedef Common::HashMap ShapeMap; @@ -208,8 +258,6 @@ protected: void addShapeToPool(uint8 *shpData, int index); void remShapeFromPool(int idx); - virtual int getItemShape(int item) const = 0; - int _characterShapeFile; virtual void loadCharacterShapes(int shapes) = 0; @@ -289,6 +337,17 @@ protected: virtual int getCharacterWalkspeed() const = 0; virtual void updateCharAnimFrame(int num, int *table) = 0; + // chat + int _vocHigh; + + const char *_chatText; + int _chatObject; + uint32 _chatEndTime; + int _chatVocHigh, _chatVocLow; + + EMCData _chatScriptData; + EMCState _chatScriptState; + // unknown int _unk3, _unk4, _unk5; bool _unkSceneScreenFlag1; -- cgit v1.2.3