diff options
Diffstat (limited to 'src/T2DLL/T2Animation.h')
-rw-r--r-- | src/T2DLL/T2Animation.h | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/src/T2DLL/T2Animation.h b/src/T2DLL/T2Animation.h index 410a449..a7bd371 100644 --- a/src/T2DLL/T2Animation.h +++ b/src/T2DLL/T2Animation.h @@ -1,18 +1,50 @@ #pragma once #include "common.h" +#include "T2Sprite.h" -class T2Animation { +struct AnimationDef { + POINT position; + short pattern; +}; + +struct SpriteDef { + unsigned int resID; + short count; + short width; + short height; +}; + +class AFX_EXT_CLASS T2Animation { public: - void Rewind(); - int HasNextStep() const; - int SetFrame(int); - int GetFrame() const; - T2Animation(T2TowerDoc*, short, short, const SpriteDef*, const AnimationDef*, T2Sprite::ELayer); + T2Animation(T2TowerDoc* inDoc, short inNumOfFrame, short inNumOfSprite, const SpriteDef* inSpriteDef, const AnimationDef* inAnimationDef, T2Sprite::ELayer inLayer); ~T2Animation(); - int Start(POINT, int); - int Idle(); - void Play(POINT, int); - int Step(); + BOOL Start(POINT inPt, int inLen); + BOOL Idle(); + void Play(POINT inPt, int inLen); + BOOL Step(); + + void Rewind() { SetFrame(0); } + BOOL HasNextStep() const { + return (mFrame >= 0) && (mFrame < mNumOfFrame); + } + BOOL SetFrame(int inFrame) { + mFrame = inFrame; + return HasNextStep(); + } + int GetFrame() const { return mFrame; } + protected: void Draw(); + + T2TowerDoc *mDocument; + short mNumOfFrame; + short mNumOfSprite; + const AnimationDef *mAnimationDef; + int *mSpriteIndices; + T2ImageObj **mImageObjs; + T2BitImage **mImages; + POINT mPoint; + short mFrame; + int mInterval; + DWORD mTickCount; }; |