diff options
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2Animation.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/T2DLL/T2Animation.cpp b/src/T2DLL/T2Animation.cpp index 88f6abe..9031777 100644 --- a/src/T2DLL/T2Animation.cpp +++ b/src/T2DLL/T2Animation.cpp @@ -23,7 +23,7 @@ T2Animation::T2Animation(T2TowerDoc* inDoc, short inNumOfFrame, short inNumOfSpr maxCount = inSpriteDef[i].count; } - HINSTANCE theModuleHandle = inDoc->mWorldPluginSpecifier->mInstance; + HINSTANCE theWorldModule = inDoc->mWorldPluginSpecifier->mInstance; mSpriteIndices = new int[inNumOfSprite]; #line 41 @@ -44,18 +44,18 @@ T2Animation::T2Animation(T2TowerDoc* inDoc, short inNumOfFrame, short inNumOfSpr T2ImageObj *theImageObj = new T2ImageObj; mImageObjs[i] = theImageObj; - T2BitImage *theImage = new T2BitImage(theModuleHandle, inSpriteDef[i].resID, true); - mImages[i] = theImage; + T2BitImage *theBitImage = new T2BitImage(theWorldModule, inSpriteDef[i].resID, true); + mImages[i] = theBitImage; - RECT rect; - rect.left = 0; - rect.top = 0; - rect.right = inSpriteDef[i].width; - rect.bottom = inSpriteDef[i].height; + RECT theFrameRect; + theFrameRect.left = 0; + theFrameRect.top = 0; + theFrameRect.right = inSpriteDef[i].width; + theFrameRect.bottom = inSpriteDef[i].height; for (short j = 0; j < inSpriteDef[i].count; j++) { - theImageObj->AddObject(name, j + 1, *theImage, &rect, true, false); - OffsetRect(&rect, 0, inSpriteDef[i].height); + theImageObj->AddObject(name, j + 1, *theBitImage, &theFrameRect, true, false); + OffsetRect(&theFrameRect, 0, inSpriteDef[i].height); } mSpriteIndices[i] = mDocument->mSprite.NewSprite(*theImageObj, name, inLayer); @@ -106,8 +106,8 @@ BOOL T2Animation::Idle() { void T2Animation::Play(POINT inPt, int inLen) { mPoint = inPt; - int delay = 60 / inLen; - int endTick = GetTickCount() + delay; + int interval = 60 / inLen; + int endTick = GetTickCount() + interval; BOOL playing = mFrame < mNumOfFrame; while (playing) { @@ -119,7 +119,7 @@ void T2Animation::Play(POINT inPt, int inLen) { // nothing there! } - endTick = now + delay; + endTick = now + interval; } } @@ -132,12 +132,12 @@ BOOL T2Animation::Step() { void T2Animation::Draw() { if (HasNextStep()) { for (int i = 0; i < mNumOfSprite; i++) { - const AnimationDef *def = mAnimationDef + (mFrame * mNumOfSprite) + i; + const AnimationDef *theAnimationDef = mAnimationDef + (mFrame * mNumOfSprite) + i; CPoint pt = mPoint; - pt.Offset(def->position); + pt.Offset(theAnimationDef->position); mDocument->mSprite.MoveSprite(mSpriteIndices[i], pt); - mDocument->mSprite.ChangePattern(mSpriteIndices[i], def->pattern); + mDocument->mSprite.ChangePattern(mSpriteIndices[i], theAnimationDef->pattern); mDocument->mSprite.ShowSprite(mSpriteIndices[i], true); } } |