Browse Source

Apply the Cel helper functions in a few more places

pull/304/head
Anders Jenbo 7 years ago
parent
commit
d2b1f0cfc8
  1. 6
      Source/control.cpp
  2. 8
      Source/minitext.cpp
  3. 2
      Source/monster.cpp
  4. 2
      Source/player.cpp
  5. 2
      Source/towners.cpp

6
Source/control.cpp

@ -174,12 +174,8 @@ void DrawSpellCel(int xp, int yp, BYTE *pCelBuff, int nCel, int nWidth)
{
int nDataSize;
BYTE *pRLEBytes;
DWORD *pFrameTable;
pFrameTable = (DWORD *)pCelBuff;
pRLEBytes = &pCelBuff[pFrameTable[nCel]];
nDataSize = pFrameTable[nCel + 1] - pFrameTable[nCel];
pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize);
CelDecDatLightOnly(&gpBuffer[xp + PitchTbl[yp]], pRLEBytes, nDataSize, nWidth, SplTransTbl);
}

8
Source/minitext.cpp

@ -87,14 +87,12 @@ void PrintQTextChr(int sx, int sy, BYTE *pCelBuff, int nCel)
pStart = &gpBuffer[PitchTbl[209]];
pEnd = &gpBuffer[PitchTbl[469]];
int i;
int i, nDataSize;
BYTE width;
BYTE *src;
DWORD *pFrameTable;
pFrameTable = (DWORD *)&pCelBuff[4 * nCel];
src = &pCelBuff[pFrameTable[0]];
end = &src[pFrameTable[1] - pFrameTable[0]];
src = CelGetFrame(pCelBuff,nCel, &nDataSize);
end = &src[nDataSize];
for (; src != end; dst -= BUFFER_WIDTH + 22) {
for (i = 22; i;) {

2
Source/monster.cpp

@ -294,7 +294,7 @@ void InitMonsterGFX(int monst)
if (Monsters[monst].mtype != MT_GOLEM || (animletter[anim] != 's' && animletter[anim] != 'd')) {
for (i = 0; i < 8; i++) {
Monsters[monst].Anims[anim].Data[i] = &celBuf[((int *)celBuf)[i]];
Monsters[monst].Anims[anim].Data[i] = CelGetFrameStart(celBuf, i);
}
} else {
for (i = 0; i < 8; i++) {

2
Source/player.cpp

@ -127,7 +127,7 @@ void SetPlayerGPtrs(BYTE *pData, BYTE **pAnim)
int i;
for (i = 0; i < 8; i++) {
pAnim[i] = pData + ((DWORD *)pData)[i];
pAnim[i] = CelGetFrameStart(pData, i);
}
}

2
Source/towners.cpp

@ -130,7 +130,7 @@ void SetTownerGPtrs(BYTE *pData, BYTE **pAnim)
pFrameTable = (DWORD *)pData;
for (i = 0; i < 8; i++) {
pAnim[i] = &pData[pFrameTable[i]];
pAnim[i] = CelGetFrameStart(pData, i);
}
}

Loading…
Cancel
Save