Browse Source

Clean up SetTownerGPtrs

pull/25/head
Anders Jenbo 7 years ago
parent
commit
7a084eebf8
  1. 19
      Source/towners.cpp
  2. 2
      Source/towners.h

19
Source/towners.cpp

@ -120,20 +120,13 @@ int __fastcall GetActiveTowner(int t)
return -1;
}
void __fastcall SetTownerGPtrs(void *pData, void **pAnim)
void __fastcall SetTownerGPtrs(BYTE *pData, BYTE **pAnim)
{
void **v2; // esi
signed int v3; // edx
char *v4; // eax
signed int v5; // [esp+Ch] [ebp-4h]
int i;
v5 = 0;
v2 = pAnim;
do {
v3 = v5;
v4 = (char *)pData + *((_DWORD *)pData + v5++);
v2[v3] = v4;
} while (v5 < 8);
for (i = 0; i < 8; i++) {
pAnim[i] = pData + *((_DWORD *)pData + i);
}
}
void __fastcall NewTownerAnim(int tnum, unsigned char *pAnim, int numFrames, int Delay)
@ -356,7 +349,7 @@ void __cdecl InitCows()
InitTownerInfo(numtowners, 128, 0, TOWN_COW, TownCowX[i], TownCowY[i], -1, 10);
tnum = numtowners;
towner[tnum]._tNData = pCowCels;
SetTownerGPtrs(towner[tnum]._tNData, (void **)towner[tnum]._tNAnim);
SetTownerGPtrs(towner[tnum]._tNData, (BYTE **)towner[tnum]._tNAnim);
towner[tnum]._tNFrames = 12;
NewTownerAnim(numtowners, towner[tnum]._tNAnim[dir], towner[tnum]._tNFrames, 3);
towner[tnum]._tAnimFrame = random(0, 11) + 1;

2
Source/towners.h

@ -5,7 +5,7 @@
extern TownerStruct towner[16];
int __fastcall GetActiveTowner(int t);
void __fastcall SetTownerGPtrs(void *pData, void **pAnim); /* unsigned char *+** */
void __fastcall SetTownerGPtrs(BYTE *pData, BYTE **pAnim); /* unsigned char *+** */
void __fastcall NewTownerAnim(int tnum, unsigned char *pAnim, int numFrames, int Delay);
void __fastcall InitTownerInfo(int i, int w, int sel, int t, int x, int y, int ao, int tp);
void __fastcall InitQstSnds(int i);

Loading…
Cancel
Save