summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2Animation.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 23:04:04 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 23:04:04 +0100
commitc2efba6907fab934a04959b9bb644cf7141cc955 (patch)
treec047244f99870e44a7a5d7e733c2857434c03765 /src/T2DLL/T2Animation.cpp
parent1eb8da84d77d0c865623421069ec38bfc7b0d461 (diff)
downloadt2win-c2efba6907fab934a04959b9bb644cf7141cc955.tar.gz
t2win-c2efba6907fab934a04959b9bb644cf7141cc955.zip
matched T2DLL as well as i can
Diffstat (limited to 'src/T2DLL/T2Animation.cpp')
-rw-r--r--src/T2DLL/T2Animation.cpp32
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);
}
}