Browse Source

Rename cell functions

pull/362/head
Anders Jenbo 7 years ago
parent
commit
6597688eac
  1. 44
      Source/control.cpp
  2. 2
      Source/doom.cpp
  3. 150
      Source/engine.cpp
  4. 72
      Source/engine.h
  5. 16
      Source/error.cpp
  6. 12
      Source/gmenu.cpp
  7. 2
      Source/interfac.cpp
  8. 58
      Source/inv.cpp
  9. 2
      Source/items.cpp
  10. 2
      Source/minitext.cpp
  11. 6
      Source/quests.cpp
  12. 144
      Source/scrollrt.cpp
  13. 18
      Source/stores.cpp
  14. 60
      Source/town.cpp
  15. 72
      comparer-config/diablo.toml
  16. 72
      comparer-config/spawn.toml

44
Source/control.cpp

@ -1123,16 +1123,16 @@ void InitControlPan()
pSpellCels = LoadFileInMem("CtrlPan\\SpelIcon.CEL", NULL);
SetSpellTrans(RSPLTYPE_SKILL);
pStatusPanel = LoadFileInMem("CtrlPan\\Panel8.CEL", NULL);
CelDecodeRect(pBtmBuff, 0, (PANEL_HEIGHT + 16) - 1, PANEL_WIDTH, pStatusPanel, 1, PANEL_WIDTH);
CelBlitWidth(pBtmBuff, 0, (PANEL_HEIGHT + 16) - 1, PANEL_WIDTH, pStatusPanel, 1, PANEL_WIDTH);
MemFreeDbg(pStatusPanel);
pStatusPanel = LoadFileInMem("CtrlPan\\P8Bulbs.CEL", NULL);
CelDecodeRect(pLifeBuff, 0, 87, 88, pStatusPanel, 1, 88);
CelDecodeRect(pManaBuff, 0, 87, 88, pStatusPanel, 2, 88);
CelBlitWidth(pLifeBuff, 0, 87, 88, pStatusPanel, 1, 88);
CelBlitWidth(pManaBuff, 0, 87, 88, pStatusPanel, 2, 88);
MemFreeDbg(pStatusPanel);
talkflag = FALSE;
if (gbMaxPlayers != 1) {
pTalkPanel = LoadFileInMem("CtrlPan\\TalkPanl.CEL", NULL);
CelDecodeRect(pBtmBuff, 0, (PANEL_HEIGHT + 16) * 2 - 1, PANEL_WIDTH, pTalkPanel, 1, PANEL_WIDTH);
CelBlitWidth(pBtmBuff, 0, (PANEL_HEIGHT + 16) * 2 - 1, PANEL_WIDTH, pTalkPanel, 1, PANEL_WIDTH);
MemFreeDbg(pTalkPanel);
pMultiBtns = LoadFileInMem("CtrlPan\\P8But2.CEL", NULL);
pTalkBtns = LoadFileInMem("CtrlPan\\TalkButt.CEL", NULL);
@ -1201,14 +1201,14 @@ void DrawCtrlPan()
if (!panbtn[i])
DrawPanelBox(PanBtnPos[i][0], PanBtnPos[i][1] - 336, 71, 20, PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y);
else
CelDecodeOnly(PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y + 18, pPanelButtons, i + 1, 71);
CelDraw(PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y + 18, pPanelButtons, i + 1, 71);
}
if (numpanbtns == 8) {
CelDecodeOnly(87 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[6] + 1, 33);
CelDraw(87 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[6] + 1, 33);
if (FriendlyMode)
CelDecodeOnly(527 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[7] + 3, 33);
CelDraw(527 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[7] + 3, 33);
else
CelDecodeOnly(527 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[7] + 5, 33);
CelDraw(527 + SCREEN_X, 474 + SCREEN_Y, pMultiBtns, panbtn[7] + 5, 33);
}
}
@ -1660,7 +1660,7 @@ void DrawChr()
char chrstr[64];
int pc, mindam, maxdam;
CelDecodeOnly(SCREEN_X, 351 + SCREEN_Y, pChrPanel, 1, 320);
CelDraw(SCREEN_X, 351 + SCREEN_Y, pChrPanel, 1, 320);
ADD_PlrStringXY(20, 32, 151, plr[myplr]._pName, COL_WHITE);
if (plr[myplr]._pClass == PC_WARRIOR) {
@ -1833,13 +1833,13 @@ void DrawChr()
ADD_PlrStringXY(95, 266, 126, chrstr, COL_RED);
pc = plr[myplr]._pClass;
if (plr[myplr]._pBaseStr < MaxStats[pc][ATTRIB_STR])
CelDecodeOnly(137 + SCREEN_X, 159 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_STR] + 2, 41);
CelDraw(137 + SCREEN_X, 159 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_STR] + 2, 41);
if (plr[myplr]._pBaseMag < MaxStats[pc][ATTRIB_MAG])
CelDecodeOnly(137 + SCREEN_X, 187 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_MAG] + 4, 41);
CelDraw(137 + SCREEN_X, 187 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_MAG] + 4, 41);
if (plr[myplr]._pBaseDex < MaxStats[pc][ATTRIB_DEX])
CelDecodeOnly(137 + SCREEN_X, 216 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_DEX] + 6, 41);
CelDraw(137 + SCREEN_X, 216 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_DEX] + 6, 41);
if (plr[myplr]._pBaseVit < MaxStats[pc][ATTRIB_VIT])
CelDecodeOnly(137 + SCREEN_X, 244 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_VIT] + 8, 41);
CelDraw(137 + SCREEN_X, 244 + SCREEN_Y, pChrButtons, chrbtn[ATTRIB_VIT] + 8, 41);
}
col = plr[myplr]._pMaxHP <= plr[myplr]._pMaxHPBase ? COL_WHITE : COL_BLUE;
@ -1942,7 +1942,7 @@ void DrawLevelUpIcon()
if (!stextflag) {
nCel = lvlbtndown ? 3 : 2;
ADD_PlrStringXY(0, 303, 120, "Level Up", COL_WHITE);
CelDecodeOnly(40 + SCREEN_X, 335 + SCREEN_Y, pChrButtons, nCel, 41);
CelDraw(40 + SCREEN_X, 335 + SCREEN_Y, pChrButtons, nCel, 41);
}
}
@ -2067,7 +2067,7 @@ int DrawDurIcon4Item(ItemStruct *pItem, int x, int c)
}
if (pItem->_iDurability > 2)
c += 8;
CelDecodeOnly(x, 335 + SCREEN_Y, pDurIcons, c, 32);
CelDraw(x, 335 + SCREEN_Y, pDurIcons, c, 32);
return x - 40;
}
@ -2179,8 +2179,8 @@ void DrawSpellBook()
char st;
unsigned __int64 spl;
CelDecodeOnly(PANEL_RIGHT, 351 + SCREEN_Y, pSpellBkCel, 1, 320);
CelDecodeOnly(PANEL_RIGHT + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
CelDraw(PANEL_RIGHT, 351 + SCREEN_Y, pSpellBkCel, 1, 320);
CelDraw(PANEL_RIGHT + 76 * sbooktab + 7, 348 + SCREEN_Y, pSBkBtnCel, sbooktab + 1, 76);
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
@ -2305,7 +2305,7 @@ void DrawGoldSplit(int amount)
int screen_x, i;
screen_x = 0;
CelDecodeOnly(351 + SCREEN_X, 178 + SCREEN_Y, pGBoxBuff, 1, 261);
CelDraw(351 + SCREEN_X, 178 + SCREEN_Y, pGBoxBuff, 1, 261);
sprintf(tempstr, "You have %u gold", initialDropGoldValue);
ADD_PlrStringXY(366, 87, 600, tempstr, COL_GOLD);
sprintf(tempstr, "%s. How many do", get_pieces_str(initialDropGoldValue));
@ -2321,7 +2321,7 @@ void DrawGoldSplit(int amount)
} else {
screen_x = 450;
}
CelDecodeOnly(screen_x, 140 + SCREEN_Y, pSPentSpn2Cels, nGoldFrame, 12);
CelDraw(screen_x, 140 + SCREEN_Y, pSPentSpn2Cels, nGoldFrame, 12);
nGoldFrame = (nGoldFrame & 7) + 1;
}
@ -2428,7 +2428,7 @@ void DrawTalkPan()
}
if (msg)
*msg = '\0';
CelDecDatOnly(gpBuffer + x, pSPentSpn2Cels, frame, 12);
CelBlitFrame(gpBuffer + x, pSPentSpn2Cels, frame, 12);
frame = (frame & 7) + 1;
talk_btn = 0;
for (i = 0; i < 4; i++) {
@ -2441,7 +2441,7 @@ void DrawTalkPan()
nCel = 4;
else
nCel = 3;
CelDecodeOnly(172 + SCREEN_X, 436 + 18 * talk_btn + SCREEN_Y, pTalkBtns, nCel, 61);
CelDraw(172 + SCREEN_X, 436 + 18 * talk_btn + SCREEN_Y, pTalkBtns, nCel, 61);
}
} else {
color = COL_RED;
@ -2451,7 +2451,7 @@ void DrawTalkPan()
nCel = 1;
if (talkbtndown[talk_btn])
nCel += 4;
CelDecodeOnly(172 + SCREEN_X, 436 + 18 * talk_btn + SCREEN_Y, pTalkBtns, nCel, 61);
CelDraw(172 + SCREEN_X, 436 + 18 * talk_btn + SCREEN_Y, pTalkBtns, nCel, 61);
}
if (plr[i].plractive) {
control_print_talk_msg(plr[i]._pName, 46, 60 + talk_btn * 18, &x, color);

2
Source/doom.cpp

@ -91,5 +91,5 @@ void doom_draw()
}
}
CelDecodeOnly(SCREEN_X, PANEL_Y - 1, pDoomCel, 1, SCREEN_WIDTH);
CelDraw(SCREEN_X, PANEL_Y - 1, pDoomCel, 1, SCREEN_WIDTH);
}

150
Source/engine.cpp

@ -40,7 +40,7 @@ __FINLINE int CelGetFrameSize(BYTE *pCelBuff, int nCel)
return SwapLE32(pFrameTable[nCel + 1]) - SwapLE32(pFrameTable[nCel]);
}
void CelDrawDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
void CelBlit(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
int w;
@ -139,7 +139,7 @@ void CelDrawDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
#endif
}
void CelDecodeOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
void CelDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
{
int nDataSize;
BYTE *pRLEBytes;
@ -152,10 +152,10 @@ void CelDecodeOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
return;
pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize);
CelDrawDatOnly(&gpBuffer[sx + PitchTbl[sy]], pRLEBytes, nDataSize, nWidth);
CelBlit(&gpBuffer[sx + PitchTbl[sy]], pRLEBytes, nDataSize, nWidth);
}
void CelDecDatOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
{
int nDataSize;
BYTE *pRLEBytes;
@ -168,14 +168,14 @@ void CelDecDatOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth)
return;
pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize);
CelDrawDatOnly(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlit(pBuff, pRLEBytes, nDataSize, nWidth);
}
/**
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
BYTE *pRLEBytes;
DWORD *pFrameTable;
@ -205,7 +205,7 @@ void CelDrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Ce
else
nDataSize -= nDataStart;
CelDrawDatOnly(
CelBlit(
&gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]],
pRLEBytes + nDataStart,
nDataSize,
@ -216,7 +216,7 @@ void CelDrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Ce
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedBlit(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
BYTE *pRLEBytes;
DWORD *pFrameTable;
@ -246,10 +246,10 @@ void CelDecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int Cel
else
nDataSize -= nDataStart;
CelDrawDatOnly(pBuff, pRLEBytes + nDataStart, nDataSize, nWidth);
CelBlit(pBuff, pRLEBytes + nDataStart, nDataSize, nWidth);
}
void CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
void CelBlitLight(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
int w;
BYTE *tbl;
@ -286,7 +286,7 @@ void CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi
sub edx, eax
mov ecx, eax
push edx
call CelDecDatLightEntry
call CelBlitLightEntry
pop edx
pop ebx
or edx, edx
@ -307,7 +307,7 @@ void CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi
/* Assembly Macro */
// clang-format off
__asm {
CelDecDatLightEntry:
CelBlitLightEntry:
shr cl, 1
jnb label5
mov dl, [esi]
@ -402,7 +402,7 @@ void CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi
#endif
}
void CelDecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
void CelBlitLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
int w;
BOOL shift;
@ -589,7 +589,7 @@ void CelDecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nW
#endif
}
void CelDecodeLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
{
int nDataSize;
BYTE *pDecodeTo, *pRLEBytes;
@ -605,16 +605,16 @@ void CelDecodeLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth)
pDecodeTo = &gpBuffer[sx + PitchTbl[sy]];
if (light_table_index)
CelDecDatLightOnly(pDecodeTo, pRLEBytes, nDataSize, nWidth);
CelBlitLight(pDecodeTo, pRLEBytes, nDataSize, nWidth);
else
CelDrawDatOnly(pDecodeTo, pRLEBytes, nDataSize, nWidth);
CelBlit(pDecodeTo, pRLEBytes, nDataSize, nWidth);
}
/**
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDecodeHdrLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nDataCap;
BYTE *pRLEBytes, *pDecodeTo;
@ -648,16 +648,16 @@ void CelDecodeHdrLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth,
pDecodeTo = &gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]];
if (light_table_index)
CelDecDatLightOnly(pDecodeTo, pRLEBytes, nDataSize, nWidth);
CelBlitLight(pDecodeTo, pRLEBytes, nDataSize, nWidth);
else
CelDrawDatOnly(pDecodeTo, pRLEBytes, nDataSize, nWidth);
CelBlit(pDecodeTo, pRLEBytes, nDataSize, nWidth);
}
/**
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDecodeHdrLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nDataCap;
BYTE *pRLEBytes;
@ -690,18 +690,18 @@ void CelDecodeHdrLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, i
pRLEBytes += nDataStart;
if (cel_transparency_active)
CelDecDatLightTrans(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlitLightTrans(pBuff, pRLEBytes, nDataSize, nWidth);
else if (light_table_index)
CelDecDatLightOnly(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlitLight(pBuff, pRLEBytes, nDataSize, nWidth);
else
CelDrawDatOnly(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlit(pBuff, pRLEBytes, nDataSize, nWidth);
}
/**
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
{
int nDataStart, nDataSize, nDataCap, w, idx;
BYTE *pRLEBytes, *dst, *tbl;
@ -814,7 +814,10 @@ void CelDrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, in
#endif
}
void Cel2DecDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
/**
* @brief Same as CelBlit but checks for drawing outside the buffer
*/
void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
int w;
@ -931,7 +934,7 @@ void Cel2DecDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cel2DrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
BYTE *pRLEBytes;
DWORD *pFrameTable;
@ -961,7 +964,7 @@ void Cel2DrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C
else
nDataSize -= nDataStart;
Cel2DecDatOnly(
CelBlitSafe(
&gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]],
pRLEBytes + nDataStart,
nDataSize,
@ -972,7 +975,7 @@ void Cel2DrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cel2DecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedBlitSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
BYTE *pRLEBytes;
DWORD *pFrameTable;
@ -1002,10 +1005,13 @@ void Cel2DecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int Ce
else
nDataSize -= nDataStart;
Cel2DecDatOnly(pBuff, pRLEBytes + nDataStart, nDataSize, nWidth);
CelBlitSafe(pBuff, pRLEBytes + nDataStart, nDataSize, nWidth);
}
void Cel2DecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
/**
* @brief Same as CelBlitLight but checks for drawing outside the buffer
*/
void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
int w;
BYTE *tbl;
@ -1173,7 +1179,10 @@ void Cel2DecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nW
#endif
}
void Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
/**
* @brief Same as CelBlitLightTrans but checks for drawing outside the buffer
*/
void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
int w;
BOOL shift;
@ -1378,7 +1387,7 @@ void Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int n
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cel2DecodeHdrLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelDrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nDataCap;
BYTE *pRLEBytes, *pDecodeTo;
@ -1412,16 +1421,16 @@ void Cel2DecodeHdrLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, in
pDecodeTo = &gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]];
if (light_table_index)
Cel2DecDatLightOnly(pDecodeTo, pRLEBytes, nDataSize, nWidth);
CelBlitLightSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth);
else
Cel2DecDatOnly(pDecodeTo, pRLEBytes, nDataSize, nWidth);
CelBlitSafe(pDecodeTo, pRLEBytes, nDataSize, nWidth);
}
/**
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cel2DecodeLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelClippedBlitLightTransSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nDataCap;
BYTE *pRLEBytes;
@ -1451,18 +1460,19 @@ void Cel2DecodeLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int
pRLEBytes += nDataStart;
if (cel_transparency_active)
Cel2DecDatLightTrans(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlitLightTransSafe(pBuff, pRLEBytes, nDataSize, nWidth);
else if (light_table_index)
Cel2DecDatLightOnly(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlitLightSafe(pBuff, pRLEBytes, nDataSize, nWidth);
else
Cel2DecDatOnly(pBuff, pRLEBytes, nDataSize, nWidth);
CelBlitSafe(pBuff, pRLEBytes, nDataSize, nWidth);
}
/**
* @brief Same as CelDrawLightRed but checks for drawing outside the buffer
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cel2DrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
{
int nDataStart, nDataSize, nDataCap, w, idx;
BYTE *pRLEBytes, *dst, *tbl;
@ -1476,6 +1486,7 @@ void Cel2DrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i
return;
pFrameTable = (DWORD *)pCelBuff;
pRLEBytes = &pCelBuff[pFrameTable[nCel]];
nDataStart = *(WORD *)&pRLEBytes[CelSkip];
if (!nDataStart)
@ -1582,7 +1593,10 @@ void Cel2DrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i
#endif
}
void CelDecodeRect(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth)
/**
* @brief Same as CelBlit but cropped to given width
*/
void CelBlitWidth(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth)
{
BYTE *pRLEBytes, *dst, *end;
@ -1700,7 +1714,7 @@ void CelDecodeRect(BYTE *pBuff, int CelSkip, int hgt, int wdt, BYTE *pCelBuff, i
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDecodeClr(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nDataCap, w;
BYTE *pRLEBytes, *dst;
@ -1838,10 +1852,11 @@ void CelDecodeClr(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth
}
/**
* @brief Same as CelBlitOutline but checks for drawing outside the buffer
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void CelDrawHdrClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void CelBlitOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nDataCap, w;
BYTE *pRLEBytes, *dst;
@ -2443,6 +2458,9 @@ DWORD LoadFileWithMem(const char *pszName, void *p)
return dwFileLen;
}
/**
* @brief Apply the color swaps to a CL2 sprite
*/
void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel)
{
int i, nDataSize;
@ -2486,7 +2504,7 @@ void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel)
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeFrm1(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
BYTE *pRLEBytes;
DWORD *pFrameTable;
@ -2516,14 +2534,14 @@ void Cl2DecodeFrm1(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
if (!nDataSize)
nDataSize = pFrameTable[nCel + 1] - pFrameTable[nCel];
Cl2DecDatFrm1(
Cl2Blit(
&gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]],
pRLEBytes + nDataStart,
nDataSize - nDataStart,
nWidth);
}
void Cl2DecDatFrm1(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
void Cl2Blit(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
#ifdef USE_ASM
__asm {
@ -2668,7 +2686,7 @@ void Cl2DecDatFrm1(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeFrm2(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize;
BYTE *pRLEBytes;
@ -2698,7 +2716,7 @@ void Cl2DecodeFrm2(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidt
if (!nDataSize)
nDataSize = pFrameTable[nCel + 1] - pFrameTable[nCel];
Cl2DecDatFrm2(
Cl2BlitOutline(
&gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]],
pRLEBytes + nDataStart,
nDataSize - nDataStart,
@ -2706,7 +2724,7 @@ void Cl2DecodeFrm2(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidt
col);
}
void Cl2DecDatFrm2(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col)
void Cl2BlitOutline(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col)
{
#ifdef USE_ASM
__asm {
@ -2872,7 +2890,7 @@ void Cl2DecDatFrm2(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth,
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeFrm3(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
{
int nDataStart, nDataSize, idx, nSize;
BYTE *pRLEBytes, *pDecodeTo;
@ -2912,7 +2930,7 @@ void Cl2DecodeFrm3(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
if (light >= 4)
idx += (light - 1) << 8;
Cl2DecDatLightTbl1(
Cl2BlitLight(
pDecodeTo,
pRLEBytes,
nSize,
@ -2920,7 +2938,7 @@ void Cl2DecodeFrm3(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
&pLightTbl[idx]);
}
void Cl2DecDatLightTbl1(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable)
void Cl2BlitLight(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable)
{
#ifdef USE_ASM
__asm {
@ -3074,7 +3092,7 @@ void Cl2DecDatLightTbl1(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nSize;
BYTE *pRLEBytes, *pDecodeTo;
@ -3109,16 +3127,16 @@ void Cl2DecodeLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int
pDecodeTo = &gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]];
if (light_table_index)
Cl2DecDatLightTbl1(pDecodeTo, pRLEBytes, nSize, nWidth, &pLightTbl[light_table_index * 256]);
Cl2BlitLight(pDecodeTo, pRLEBytes, nSize, nWidth, &pLightTbl[light_table_index * 256]);
else
Cl2DecDatFrm1(pDecodeTo, pRLEBytes, nSize, nWidth);
Cl2Blit(pDecodeTo, pRLEBytes, nSize, nWidth);
}
/**
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeFrm4(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void Cl2DrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
BYTE *pRLEBytes;
DWORD *pFrameTable;
@ -3148,14 +3166,14 @@ void Cl2DecodeFrm4(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
if (!nDataSize)
nDataSize = pFrameTable[nCel + 1] - pFrameTable[nCel];
Cl2DecDatFrm4(
Cl2BlitSafe(
&gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]],
pRLEBytes + nDataStart,
nDataSize - nDataStart,
nWidth);
}
void Cl2DecDatFrm4(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
{
#ifdef USE_ASM
__asm {
@ -3313,7 +3331,7 @@ void Cl2DecDatFrm4(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth)
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void Cl2DrawOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize;
BYTE *pRLEBytes;
@ -3344,7 +3362,7 @@ void Cl2DecodeClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid
nDataSize = pFrameTable[nCel + 1] - pFrameTable[nCel];
gpBufEnd -= BUFFER_WIDTH;
Cl2DecDatClrHL(
Cl2BlitOutlineSafe(
&gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]],
pRLEBytes + nDataStart,
nDataSize - nDataStart,
@ -3353,7 +3371,7 @@ void Cl2DecodeClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid
gpBufEnd += BUFFER_WIDTH;
}
void Cl2DecDatClrHL(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col)
void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col)
{
#ifdef USE_ASM
__asm {
@ -3530,7 +3548,7 @@ void Cl2DecDatClrHL(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth,
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeFrm5(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
void Cl2DrawLightTblSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light)
{
int nDataStart, nDataSize, idx, nSize;
BYTE *pRLEBytes, *pDecodeTo;
@ -3570,7 +3588,7 @@ void Cl2DecodeFrm5(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
if (light >= 4)
idx += (light - 1) << 8;
Cl2DecDatLightTbl2(
Cl2BlitLightSafe(
pDecodeTo,
pRLEBytes,
nSize,
@ -3578,7 +3596,7 @@ void Cl2DecodeFrm5(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
&pLightTbl[idx]);
}
void Cl2DecDatLightTbl2(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable)
void Cl2BlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable)
{
#ifdef USE_ASM
__asm {
@ -3745,7 +3763,7 @@ void Cl2DecDatLightTbl2(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWi
* @param CelSkip Skip lower parts of sprite, must be multiple of 2, max 8
* @param CelCap Amount of sprite to render from lower to upper, must be multiple of 2, max 8
*/
void Cl2DecodeFrm6(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
void Cl2DrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
{
int nDataStart, nDataSize, nSize;
BYTE *pRLEBytes, *pDecodeTo;
@ -3780,9 +3798,9 @@ void Cl2DecodeFrm6(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Cel
pDecodeTo = &gpBuffer[sx + PitchTbl[sy - 16 * CelSkip]];
if (light_table_index)
Cl2DecDatLightTbl2(pDecodeTo, pRLEBytes, nSize, nWidth, &pLightTbl[light_table_index * 256]);
Cl2BlitLightSafe(pDecodeTo, pRLEBytes, nSize, nWidth, &pLightTbl[light_table_index * 256]);
else
Cl2DecDatFrm4(pDecodeTo, pRLEBytes, nSize, nWidth);
Cl2BlitSafe(pDecodeTo, pRLEBytes, nSize, nWidth);
}
void PlayInGameMovie(char *pszMovie)

72
Source/engine.h

@ -13,28 +13,28 @@ extern BOOL gbNotInView; // valid - if x/y are in bounds
__FINLINE BYTE *CelGetFrame(BYTE *pCelBuff, int nCel, int *nDataSize);
void CelDrawDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelDecodeOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void CelDecDatOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth);
void CelDrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelDecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelDecodeLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void CelDecodeHdrLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDecodeHdrLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void Cel2DecDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cel2DrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cel2DecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cel2DecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cel2DecodeHdrLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cel2DecodeLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cel2DrawHdrLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void CelDecodeRect(BYTE *pBuff, int always_0, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth);
void CelDecodeClr(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDrawHdrClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelBlit(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth);
void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelClippedBlit(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelBlitLight(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelBlitLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelClippedBlitSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void CelDrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelClippedBlitLightTransSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void CelBlitWidth(BYTE *pBuff, int always_0, int hgt, int wdt, BYTE *pCelBuff, int nCel, int nWidth);
void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void CelBlitOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void ENG_set_pixel(int sx, int sy, BYTE col);
void engine_draw_pixel(int sx, int sy);
void DrawLine(int x0, int y0, int x1, int y1, BYTE col);
@ -48,20 +48,20 @@ void mem_free_dbg(void *p);
BYTE *LoadFileInMem(char *pszName, DWORD *pdwFileLen);
DWORD LoadFileWithMem(const char *pszName, void *p);
void Cl2ApplyTrans(BYTE *p, BYTE *ttbl, int nCel);
void Cl2DecodeFrm1(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2DecDatFrm1(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cl2DecodeFrm2(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2DecDatFrm2(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col);
void Cl2DecodeFrm3(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void Cl2DecDatLightTbl1(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable);
void Cl2DecodeLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2DecodeFrm4(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2DecDatFrm4(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cl2DecodeClrHL(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2DecDatClrHL(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col);
void Cl2DecodeFrm5(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void Cl2DecDatLightTbl2(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable);
void Cl2DecodeFrm6(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2Blit(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2BlitOutline(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col);
void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void Cl2BlitLight(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable);
void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2DrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2BlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void Cl2DrawOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void Cl2BlitOutlineSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, char col);
void Cl2DrawLightTblSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap, char light);
void Cl2BlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth, BYTE *pTable);
void Cl2DrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap);
void PlayInGameMovie(char *pszMovie);
/* rdata */

16
Source/error.cpp

@ -85,21 +85,21 @@ void DrawDiabloMsg()
int i, len, off, width, sx, sy;
BYTE c;
CelDecodeOnly(165, 318, pSTextSlidCels, 1, 12);
CelDecodeOnly(591, 318, pSTextSlidCels, 4, 12);
CelDecodeOnly(165, 366, pSTextSlidCels, 2, 12);
CelDecodeOnly(591, 366, pSTextSlidCels, 3, 12);
CelDraw(165, 318, pSTextSlidCels, 1, 12);
CelDraw(591, 318, pSTextSlidCels, 4, 12);
CelDraw(165, 366, pSTextSlidCels, 2, 12);
CelDraw(591, 366, pSTextSlidCels, 3, 12);
sx = 173;
for (i = 0; i < 35; i++) {
CelDecodeOnly(sx, 318, pSTextSlidCels, 5, 12);
CelDecodeOnly(sx, 366, pSTextSlidCels, 7, 12);
CelDraw(sx, 318, pSTextSlidCels, 5, 12);
CelDraw(sx, 366, pSTextSlidCels, 7, 12);
sx += 12;
}
sy = 330;
for (i = 0; i < 3; i++) {
CelDecodeOnly(165, sy, pSTextSlidCels, 6, 12);
CelDecodeOnly(591, sy, pSTextSlidCels, 8, 12);
CelDraw(165, sy, pSTextSlidCels, 6, 12);
CelDraw(591, sy, pSTextSlidCels, 8, 12);
sy += 12;
}

12
Source/gmenu.cpp

@ -55,7 +55,7 @@ void gmenu_print_text(int x, int y, char *pszStr)
c = gbFontTransTbl[(BYTE)*pszStr++];
c = lfontframe[c];
if (c)
CelDecodeLightOnly(x, y, BigTGold_cel, c, 46);
CelDrawLight(x, y, BigTGold_cel, c, 46);
x += lfontkern[c] + 2;
}
}
@ -151,7 +151,7 @@ void gmenu_draw()
if (sgpCurrentMenu) {
if (dword_63447C)
dword_63447C(sgpCurrentMenu);
CelDecodeOnly((SCREEN_WIDTH - 296) / 2 + SCREEN_X, 102 + SCREEN_Y, sgpLogo, 1, 296);
CelDraw((SCREEN_WIDTH - 296) / 2 + SCREEN_X, 102 + SCREEN_Y, sgpLogo, 1, 296);
y = 160 + SCREEN_Y;
i = sgpCurrentMenu;
if (sgpCurrentMenu->fnMenu) {
@ -179,21 +179,21 @@ void gmenu_draw_menu_item(TMenuItem *pItem, int y)
w = gmenu_get_lfont(pItem);
if (pItem->dwFlags & GMENU_SLIDER) {
x = 16 + w / 2 + SCREEN_X;
CelDecodeOnly(x, t - 8, optbar_cel, 1, 287);
CelDraw(x, t - 8, optbar_cel, 1, 287);
step = pItem->dwFlags & 0xFFF;
nSteps = (pItem->dwFlags & 0xFFF000) >> 12;
if (nSteps < 2)
nSteps = 2;
pos = step * 256 / nSteps;
gmenu_clear_buffer(x + 2, t - 10, pos + 13, 28);
CelDecodeOnly(x + 2 + pos, y - 12, option_cel, 1, 27);
CelDraw(x + 2 + pos, y - 12, option_cel, 1, 27);
}
x = SCREEN_WIDTH / 2 - w / 2 + SCREEN_X;
light_table_index = (pItem->dwFlags & GMENU_ENABLED) ? 0 : 15;
gmenu_print_text(x, y, pItem->pszStr);
if (pItem == sgpCurrItem) {
CelDecodeOnly(x - 54, y + 1, PentSpin_cel, PentSpin_frame, 48);
CelDecodeOnly(x + 4 + w, y + 1, PentSpin_cel, PentSpin_frame, 48);
CelDraw(x - 54, y + 1, PentSpin_cel, PentSpin_frame, 48);
CelDraw(x + 4 + w, y + 1, PentSpin_cel, PentSpin_frame, 48);
}
}

2
Source/interfac.cpp

@ -36,7 +36,7 @@ void DrawCutscene()
DWORD i;
lock_buf(1);
CelDecodeOnly(SCREEN_X, 480 + SCREEN_Y - 1, (BYTE *)sgpBackCel, 1, 640);
CelDraw(SCREEN_X, 480 + SCREEN_Y - 1, (BYTE *)sgpBackCel, 1, 640);
for (i = 0; i < sgdwProgress; i++) {
DrawProgress(

58
Source/inv.cpp

@ -172,7 +172,7 @@ void DrawInv()
BOOL invtest[NUM_INV_GRID_ELEM];
int frame, frame_width, colour, screen_x, screen_y, i, j, ii;
CelDecodeOnly(PANEL_RIGHT, 351 + SCREEN_Y, pInvCels, 1, 320);
CelDraw(PANEL_RIGHT, 351 + SCREEN_Y, pInvCels, 1, 320);
if (plr[myplr].InvBody[INVLOC_HEAD]._itype != ITYPE_NONE) {
InvDrawSlotBack(PANEL_RIGHT + 133, 59 + SCREEN_Y, 2 * INV_SLOT_SIZE_PX, 2 * INV_SLOT_SIZE_PX);
@ -188,13 +188,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
CelDrawHdrOnly(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(PANEL_RIGHT + 133, 59 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -212,13 +212,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
CelDrawHdrOnly(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(PANEL_RIGHT + 48, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -236,13 +236,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
CelDrawHdrOnly(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(PANEL_RIGHT + 249, 205 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -260,13 +260,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
CelDrawHdrOnly(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(PANEL_RIGHT + 205, 60 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -287,13 +287,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
}
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iLoc == ILOC_TWOHAND) {
@ -301,7 +301,7 @@ void DrawInv()
light_table_index = 0;
cel_transparency_active = 1;
CelDecodeHdrLightTrans(
CelClippedBlitLightTrans(
frame_width == INV_SLOT_SIZE_PX
? &gpBuffer[SCREENXY(PANEL_RIGHT + 197, SCREEN_Y)]
: &gpBuffer[SCREENXY(PANEL_RIGHT + 183, SCREEN_Y)],
@ -327,13 +327,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(screen_x, screen_y, pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -351,13 +351,13 @@ void DrawInv()
if (!plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(colour, PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
CelDrawHdrOnly(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(PANEL_RIGHT + 133, 160 + SCREEN_Y, pCursCels, frame, frame_width, 0, 8, 1);
}
}
@ -388,7 +388,7 @@ void DrawInv()
if (!plr[myplr].InvList[ii]._iStatFlag) {
colour = ICOL_RED;
}
CelDecodeClr(
CelBlitOutline(
colour,
InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X,
InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1,
@ -396,12 +396,12 @@ void DrawInv()
}
if (plr[myplr].InvList[ii]._iStatFlag) {
CelDrawHdrOnly(
CelClippedDraw(
InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X,
InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1,
pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(
CelDrawLightRed(
InvRect[j + SLOTXY_INV_FIRST].X + SCREEN_X,
InvRect[j + SLOTXY_INV_FIRST].Y + SCREEN_Y - 1,
pCursCels, frame, frame_width, 0, 8, 1);
@ -436,13 +436,13 @@ void DrawInvBelt()
colour = ICOL_BLUE;
if (!plr[myplr].SpdList[i]._iStatFlag)
colour = ICOL_RED;
CelDecodeClr(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8);
CelBlitOutline(colour, InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8);
}
if (plr[myplr].SpdList[i]._iStatFlag)
CelDrawHdrOnly(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8);
CelClippedDraw(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8);
else
CelDrawHdrLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8, 1);
CelDrawLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, pCursCels, frame, frame_width, 0, 8, 1);
if (AllItemsList[plr[myplr].SpdList[i].IDidx].iUsable
&& plr[myplr].SpdList[i]._iStatFlag

2
Source/items.cpp

@ -2908,7 +2908,7 @@ void PrintItemPower(char plidx, ItemStruct *x)
void DrawUTextBack()
{
CelDecodeOnly(88, 487, pSTextBoxCels, 1, 271);
CelDraw(88, 487, pSTextBoxCels, 1, 271);
#define TRANS_RECT_X 27
#define TRANS_RECT_Y 28

2
Source/minitext.cpp

@ -66,7 +66,7 @@ void InitQTextMsg(int m)
void DrawQTextBack()
{
CelDecodeOnly(88, 487, pTextBoxCels, 1, 591);
CelDraw(88, 487, pTextBoxCels, 1, 591);
#define TRANS_RECT_X 27
#define TRANS_RECT_Y 28

6
Source/quests.cpp

@ -714,7 +714,7 @@ void PrintQLString(int x, int y, BOOL cjustflag, char *str, int col)
off += k;
}
if (qline == y) {
CelDecodeOnly(cjustflag ? x + k + 76 : x + 76, s + 205, pSPentSpn2Cels, ALLQUESTS, 12);
CelDraw(cjustflag ? x + k + 76 : x + 76, s + 205, pSPentSpn2Cels, ALLQUESTS, 12);
}
for (i = 0; i < len; i++) {
c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
@ -725,7 +725,7 @@ void PrintQLString(int x, int y, BOOL cjustflag, char *str, int col)
off += fontkern[c] + 1;
}
if (qline == y) {
CelDecodeOnly(cjustflag ? x + k + 100 : 340 - x, s + 205, pSPentSpn2Cels, ALLQUESTS, 12);
CelDraw(cjustflag ? x + k + 100 : 340 - x, s + 205, pSPentSpn2Cels, ALLQUESTS, 12);
}
}
@ -734,7 +734,7 @@ void DrawQuestLog()
int y, i;
PrintQLString(0, 2, TRUE, "Quest Log", 3);
CelDecodeOnly(64, 511, pQLogCel, 1, 320);
CelDraw(64, 511, pQLogCel, 1, 320);
y = qtopline;
for (i = 0; i < numqlines; i++) {
PrintQLString(0, y, TRUE, questlist[qlist[i]]._qlstr, 0);

144
Source/scrollrt.cpp

@ -153,14 +153,14 @@ static void scrollrt_draw_cursor_item()
if (!plr[myplr].HoldItem._iStatFlag) {
col = PAL16_RED + 5;
}
CelDrawHdrClrHL(col, mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
CelBlitOutlineSafe(col, mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
if (col != PAL16_RED + 5) {
Cel2DrawHdrOnly(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
CelClippedDrawSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
} else {
Cel2DrawHdrLightRed(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8, 1);
CelDrawLightRedSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8, 1);
}
} else {
Cel2DrawHdrOnly(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
CelClippedDrawSafe(mx + SCREEN_X, my + cursH + SCREEN_Y - 1, pCursCels, pcurs, cursW, 0, 8);
}
}
@ -192,11 +192,11 @@ void DrawMissile(int x, int y, int sx, int sy, int CelSkip, int CelCap, BOOL pre
mx = sx + m->_mixoff - m->_miAnimWidth2;
my = sy + m->_miyoff;
if (m->_miUniqTrans)
Cl2DecodeFrm3(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
Cl2DrawLightTbl(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
else if (m->_miLightFlag)
Cl2DecodeLightTbl(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2DrawLight(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
else
Cl2DecodeFrm1(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2Draw(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
}
}
} else {
@ -216,11 +216,11 @@ void DrawMissile(int x, int y, int sx, int sy, int CelSkip, int CelCap, BOOL pre
mx = sx + m->_mixoff - m->_miAnimWidth2;
my = sy + m->_miyoff;
if (m->_miUniqTrans)
Cl2DecodeFrm3(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
Cl2DrawLightTbl(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
else if (m->_miLightFlag)
Cl2DecodeLightTbl(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2DrawLight(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
else
Cl2DecodeFrm1(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2Draw(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
}
}
}
@ -253,11 +253,11 @@ void DrawClippedMissile(int x, int y, int sx, int sy, int CelSkip, int CelCap, B
mx = sx + m->_mixoff - m->_miAnimWidth2;
my = sy + m->_miyoff;
if (m->_miUniqTrans)
Cl2DecodeFrm5(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
Cl2DrawLightTblSafe(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
else if (m->_miLightFlag)
Cl2DecodeFrm6(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2DrawLightSafe(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
else
Cl2DecodeFrm4(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2DrawSafe(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
}
}
} else {
@ -277,11 +277,11 @@ void DrawClippedMissile(int x, int y, int sx, int sy, int CelSkip, int CelCap, B
mx = sx + m->_mixoff - m->_miAnimWidth2;
my = sy + m->_miyoff;
if (m->_miUniqTrans)
Cl2DecodeFrm5(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
Cl2DrawLightTblSafe(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap, m->_miUniqTrans + 3);
else if (m->_miLightFlag)
Cl2DecodeFrm6(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2DrawLightSafe(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
else
Cl2DecodeFrm4(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
Cl2DrawSafe(mx, my, m->_miAnimData, m->_miAnimFrame, m->_miAnimWidth, CelSkip, CelCap);
}
}
}
@ -323,7 +323,7 @@ static void DrawMonster(int x, int y, int mx, int my, int m, int CelSkip, int Ce
}
if (!(dFlags[x][y] & BFLAG_LIT)) {
Cl2DecodeFrm3(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, 1);
Cl2DrawLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, 1);
} else {
trans = 0;
if (monster[m]._uniqtype)
@ -333,9 +333,9 @@ static void DrawMonster(int x, int y, int mx, int my, int m, int CelSkip, int Ce
if (plr[myplr]._pInfraFlag && light_table_index > 8)
trans = 1;
if (trans)
Cl2DecodeFrm3(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, trans);
Cl2DrawLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, trans);
else
Cl2DecodeLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap);
Cl2DrawLight(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap);
}
}
@ -376,7 +376,7 @@ static void DrawClippedMonster(int x, int y, int mx, int my, int m, int CelSkip,
}
if (!(dFlags[x][y] & BFLAG_LIT)) {
Cl2DecodeFrm5(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, 1);
Cl2DrawLightTblSafe(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, 1);
} else {
trans = 0;
if (monster[m]._uniqtype)
@ -386,9 +386,9 @@ static void DrawClippedMonster(int x, int y, int mx, int my, int m, int CelSkip,
if (plr[myplr]._pInfraFlag && light_table_index > 8)
trans = 1;
if (trans)
Cl2DecodeFrm5(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, trans);
Cl2DrawLightTblSafe(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap, trans);
else
Cl2DecodeFrm6(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap);
Cl2DrawLightSafe(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap);
}
}
@ -420,11 +420,11 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i
return;
}
if (pnum == pcursplr)
Cl2DecodeFrm2(165, px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
Cl2DrawOutline(165, px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
if (pnum == myplr) {
Cl2DecodeFrm1(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
Cl2Draw(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
if (plr[pnum].pManaShield)
Cl2DecodeFrm1(
Cl2Draw(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
py,
misfiledata[MFILE_MANASHLD].mAnimData[0],
@ -433,9 +433,9 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i
CelSkip,
CelCap);
} else if (!(dFlags[x][y] & BFLAG_LIT) || plr[myplr]._pInfraFlag && light_table_index > 8) {
Cl2DecodeFrm3(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap, 1);
Cl2DrawLightTbl(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap, 1);
if (plr[pnum].pManaShield)
Cl2DecodeFrm3(
Cl2DrawLightTbl(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
py,
misfiledata[MFILE_MANASHLD].mAnimData[0],
@ -450,9 +450,9 @@ static void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i
light_table_index = 0;
else
light_table_index -= 5;
Cl2DecodeLightTbl(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
Cl2DrawLight(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
if (plr[pnum].pManaShield)
Cl2DecodeLightTbl(
Cl2DrawLight(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
py,
misfiledata[MFILE_MANASHLD].mAnimData[0],
@ -493,11 +493,11 @@ static void DrawClippedPlayer(int pnum, int x, int y, int px, int py, BYTE *pCel
return;
}
if (pnum == pcursplr)
Cl2DecodeClrHL(165, px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
Cl2DrawOutlineSafe(165, px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
if (pnum == myplr) {
Cl2DecodeFrm4(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
Cl2DrawSafe(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
if (plr[pnum].pManaShield)
Cl2DecodeFrm4(
Cl2DrawSafe(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
py,
misfiledata[MFILE_MANASHLD].mAnimData[0],
@ -506,9 +506,9 @@ static void DrawClippedPlayer(int pnum, int x, int y, int px, int py, BYTE *pCel
CelSkip,
CelCap);
} else if (!(dFlags[x][y] & BFLAG_LIT) || plr[myplr]._pInfraFlag && light_table_index > 8) {
Cl2DecodeFrm5(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap, 1);
Cl2DrawLightTblSafe(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap, 1);
if (plr[pnum].pManaShield)
Cl2DecodeFrm5(
Cl2DrawLightTblSafe(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
py,
misfiledata[MFILE_MANASHLD].mAnimData[0],
@ -523,9 +523,9 @@ static void DrawClippedPlayer(int pnum, int x, int y, int px, int py, BYTE *pCel
light_table_index = 0;
else
light_table_index -= 5;
Cl2DecodeFrm6(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
Cl2DrawLightSafe(px, py, pCelBuff, nCel, nWidth, CelSkip, CelCap);
if (plr[pnum].pManaShield)
Cl2DecodeFrm6(
Cl2DrawLightSafe(
px + plr[pnum]._pAnimWidth2 - misfiledata[MFILE_MANASHLD].mAnimWidth2[0],
py,
misfiledata[MFILE_MANASHLD].mAnimData[0],
@ -617,13 +617,13 @@ static void DrawObject(int x, int y, int ox, int oy, BOOL pre, int CelSkip, int
}
if (bv == pcursobj)
CelDecodeClr(194, sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
CelBlitOutline(194, sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
if (object[bv]._oLight) {
CelDecodeHdrLightOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
CelClippedDrawLight(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
} else {
/// ASSERT: assert(object[bv]._oAnimData);
if (object[bv]._oAnimData) // BUGFIX: _oAnimData was already checked, this is redundant
CelDrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
CelClippedDraw(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
}
}
@ -670,11 +670,11 @@ static void DrawClippedObject(int x, int y, int ox, int oy, BOOL pre, int CelSki
}
if (bv == pcursobj)
CelDrawHdrClrHL(194, sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
CelBlitOutlineSafe(194, sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
if (object[bv]._oLight)
Cel2DecodeHdrLight(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
CelDrawLightSafe(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
else
Cel2DrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
CelClippedDrawSafe(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
}
static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, int dy, int eflag);
@ -754,7 +754,7 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
negMon = dMonster[sx][sy - 1];
if (visiondebug && bFlag & BFLAG_LIT) {
Cel2DecodeHdrOnly(pBuff, pSquareCel, 1, 64, 0, 8);
CelClippedBlitSafe(pBuff, pSquareCel, 1, 64, 0, 8);
}
if (MissilePreFlag && bFlag & BFLAG_MISSILE) {
DrawClippedMissile(sx, sy, dx, dy, 0, 8, 1);
@ -771,9 +771,9 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
nCel = pDeadGuy->_deadFrame;
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
if (pDeadGuy->_deadtrans != 0) {
Cl2DecodeFrm5(px, dy, pCelBuff, nCel, pDeadGuy->_deadWidth, 0, 8, pDeadGuy->_deadtrans);
Cl2DrawLightTblSafe(px, dy, pCelBuff, nCel, pDeadGuy->_deadWidth, 0, 8, pDeadGuy->_deadtrans);
} else {
Cl2DecodeFrm6(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, 0, 8);
Cl2DrawLightSafe(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, 0, 8);
}
} else {
// app_fatal("Clipped dead sub: frame %d of %d, deadnum==%d", nCel, pFrameTable[0], (bDead & 0x1F) - 1);
@ -796,9 +796,9 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
px = dx - pItem->_iAnimWidth2;
if (bItem - 1 == pcursitem) {
CelDrawHdrClrHL(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, 8);
CelBlitOutlineSafe(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, 8);
}
Cel2DecodeHdrLight(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, 8);
CelDrawLightSafe(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, 8);
} else {
/*
app_fatal(
@ -841,7 +841,7 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
px = dx + pMonster->_mxoff - pMonster->MType->width2;
py = dy + pMonster->_myoff;
if (draw_monster_num == pcursmonst) {
Cl2DecodeClrHL(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, 8);
Cl2DrawOutlineSafe(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, 8);
}
DrawClippedMonster(sx, sy, px, py, draw_monster_num, 0, 8);
if (eflag && pMonster->_meflag) {
@ -884,7 +884,7 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
px = dx + pMonster->_mxoff - pMonster->MType->width2;
py = dy + pMonster->_myoff;
if (draw_monster_num == pcursmonst) {
Cl2DecodeClrHL(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, 8);
Cl2DrawOutlineSafe(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, 8);
}
DrawClippedMonster(sx, sy, px, py, draw_monster_num, 0, 8);
if (eflag && pMonster->_meflag) {
@ -916,9 +916,9 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
px = dx - pItem->_iAnimWidth2;
if (bItem - 1 == pcursitem) {
CelDrawHdrClrHL(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, 8);
CelBlitOutlineSafe(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, 8);
}
Cel2DecodeHdrLight(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, 8);
CelDrawLightSafe(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, 8);
} else {
/*
app_fatal(
@ -937,7 +937,7 @@ static void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, i
}
if (bArch != 0) {
cel_transparency_active = TransList[bMap];
Cel2DecodeLightTrans(pBuff, pSpecialCels, bArch, 64, 0, 8);
CelClippedBlitLightTransSafe(pBuff, pSpecialCels, bArch, 64, 0, 8);
}
}
@ -1186,7 +1186,7 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
negMon = dMonster[sx][sy - 1];
if (visiondebug && bFlag & BFLAG_LIT) {
Cel2DecodeHdrOnly(pBuff, pSquareCel, 1, 64, CelSkip, 8);
CelClippedBlitSafe(pBuff, pSquareCel, 1, 64, CelSkip, 8);
}
if (MissilePreFlag && bFlag & BFLAG_MISSILE) {
DrawClippedMissile(sx, sy, dx, dy, CelSkip, 8, 1);
@ -1203,9 +1203,9 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
nCel = pDeadGuy->_deadFrame;
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
if (pDeadGuy->_deadtrans != 0) {
Cl2DecodeFrm5(px, dy, pCelBuff, nCel, pDeadGuy->_deadWidth, CelSkip, 8, pDeadGuy->_deadtrans);
Cl2DrawLightTblSafe(px, dy, pCelBuff, nCel, pDeadGuy->_deadWidth, CelSkip, 8, pDeadGuy->_deadtrans);
} else {
Cl2DecodeFrm6(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, CelSkip, 8);
Cl2DrawLightSafe(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, CelSkip, 8);
}
} else {
// app_fatal("Clipped dead sub2: frame %d of %d, deadnum==%d", nCel, pFrameTable[0], (bDead & 0x1F) - 1);
@ -1228,9 +1228,9 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
px = dx - pItem->_iAnimWidth2;
if (bItem - 1 == pcursitem) {
CelDrawHdrClrHL(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, CelSkip, 8);
CelBlitOutlineSafe(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, CelSkip, 8);
}
Cel2DecodeHdrLight(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, CelSkip, 8);
CelDrawLightSafe(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, CelSkip, 8);
} else {
/*
app_fatal(
@ -1273,7 +1273,7 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
px = dx + pMonster->_mxoff - pMonster->MType->width2;
py = dy + pMonster->_myoff;
if (draw_monster_num == pcursmonst) {
Cl2DecodeClrHL(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, CelSkip, 8);
Cl2DrawOutlineSafe(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, CelSkip, 8);
}
DrawClippedMonster(sx, sy, px, py, draw_monster_num, CelSkip, 8);
if (eflag && !pMonster->_meflag) {
@ -1316,7 +1316,7 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
px = dx + pMonster->_mxoff - pMonster->MType->width2;
py = dy + pMonster->_myoff;
if (draw_monster_num == pcursmonst) {
Cl2DecodeClrHL(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, CelSkip, 8);
Cl2DrawOutlineSafe(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, CelSkip, 8);
}
DrawClippedMonster(sx, sy, px, py, draw_monster_num, CelSkip, 8);
if (eflag && !pMonster->_meflag) {
@ -1348,9 +1348,9 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
px = dx - pItem->_iAnimWidth2;
if (bItem - 1 == pcursitem) {
CelDrawHdrClrHL(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, CelSkip, 8);
CelBlitOutlineSafe(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, CelSkip, 8);
}
Cel2DecodeHdrLight(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, CelSkip, 8);
CelDrawLightSafe(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, CelSkip, 8);
} else {
/*
app_fatal(
@ -1369,7 +1369,7 @@ static void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int ski
}
if (bArch != 0) {
cel_transparency_active = TransList[bMap];
Cel2DecodeLightTrans(pBuff, pSpecialCels, bArch, 64, CelSkip, 8);
CelClippedBlitLightTransSafe(pBuff, pSpecialCels, bArch, 64, CelSkip, 8);
}
}
@ -1551,7 +1551,7 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
negMon = dMonster[sx][sy - 1];
if (visiondebug && bFlag & BFLAG_LIT) {
CelDecodeHdrOnly(pBuff, pSquareCel, 1, 64, 0, CelCap);
CelClippedBlit(pBuff, pSquareCel, 1, 64, 0, CelCap);
}
tx = dx - 96;
ty = dy - 16;
@ -1572,9 +1572,9 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
nCel = pDeadGuy->_deadFrame;
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
if (pDeadGuy->_deadtrans != 0) {
Cl2DecodeFrm3(px, dy, pCelBuff, nCel, pDeadGuy->_deadWidth, 0, CelCap, pDeadGuy->_deadtrans);
Cl2DrawLightTbl(px, dy, pCelBuff, nCel, pDeadGuy->_deadWidth, 0, CelCap, pDeadGuy->_deadtrans);
} else {
Cl2DecodeLightTbl(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, 0, CelCap);
Cl2DrawLight(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, 0, CelCap);
}
} else {
// app_fatal("Unclipped dead: frame %d of %d, deadnum==%d", nCel, pFrameTable[0], (bDead & 0x1F) - 1);
@ -1597,9 +1597,9 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
px = dx - pItem->_iAnimWidth2;
if (bItem - 1 == pcursitem) {
CelDecodeClr(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, CelCap);
CelBlitOutline(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, CelCap);
}
CelDecodeHdrLightOnly(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, CelCap);
CelClippedDrawLight(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, CelCap);
} else {
// app_fatal("Draw \"%s\" Item 1: frame %d of %d, item type==%d", pItem->_iIName, nCel, pFrameTable[0], pItem->_itype);
}
@ -1635,7 +1635,7 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
px = dx + pMonster->_mxoff - pMonster->MType->width2;
py = dy + pMonster->_myoff;
if (draw_monster_num == pcursmonst) {
Cl2DecodeFrm2(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, CelCap);
Cl2DrawOutline(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, CelCap);
}
DrawMonster(sx, sy, px, py, draw_monster_num, 0, CelCap);
if (eflag && !pMonster->_meflag) {
@ -1678,7 +1678,7 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
px = dx + pMonster->_mxoff - pMonster->MType->width2;
py = dy + pMonster->_myoff;
if (draw_monster_num == pcursmonst) {
Cl2DecodeFrm2(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, CelCap);
Cl2DrawOutline(233, px, py, pMonster->_mAnimData, pMonster->_mAnimFrame, pMonster->MType->width, 0, CelCap);
}
DrawMonster(sx, sy, px, py, draw_monster_num, 0, CelCap);
if (eflag && !pMonster->_meflag) {
@ -1710,9 +1710,9 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
if (nCel >= 1 && pFrameTable[0] <= 50 && nCel <= (int)pFrameTable[0]) {
px = dx - pItem->_iAnimWidth2;
if (bItem - 1 == pcursitem) {
CelDecodeClr(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, CelCap);
CelBlitOutline(181, px, dy, pCelBuff, nCel, pItem->_iAnimWidth, 0, CelCap);
}
CelDecodeHdrLightOnly(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, CelCap);
CelClippedDrawLight(px, dy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth, 0, CelCap);
} else {
// app_fatal("Draw \"%s\" Item 2: frame %d of %d, item type==%d", pItem->_iIName, nCel, pFrameTable[0], pItem->_itype);
}
@ -1724,7 +1724,7 @@ static void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, in
}
if (bArch != 0) {
cel_transparency_active = TransList[bMap];
CelDecodeHdrLightTrans(pBuff, pSpecialCels, bArch, 64, 0, CelCap);
CelClippedBlitLightTrans(pBuff, pSpecialCels, bArch, 64, 0, CelCap);
}
}

18
Source/stores.cpp

@ -130,7 +130,7 @@ void FreeStoreMem()
void DrawSTextBack()
{
CelDecodeOnly(408, 487, pSTextBoxCels, 1, 271);
CelDraw(408, 487, pSTextBoxCels, 1, 271);
#define TRANS_RECT_X 347
#define TRANS_RECT_Y 28
@ -167,7 +167,7 @@ void PrintSString(int x, int y, BOOL cjustflag, char *str, char col, int val)
off += k;
}
if (stextsel == y) {
CelDecodeOnly(cjustflag ? xx + x + k - 20 : xx + x - 20, s + 205, pSPentSpn2Cels, InStoreFlag, 12);
CelDraw(cjustflag ? xx + x + k - 20 : xx + x - 20, s + 205, pSPentSpn2Cels, InStoreFlag, 12);
}
for (i = 0; i < len; i++) {
c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
@ -189,7 +189,7 @@ void PrintSString(int x, int y, BOOL cjustflag, char *str, char col, int val)
}
}
if (stextsel == y) {
CelDecodeOnly(cjustflag ? xx + x + k + 4 : 660 - x, s + 205, pSPentSpn2Cels, InStoreFlag, 12);
CelDraw(cjustflag ? xx + x + k + 4 : 660 - x, s + 205, pSPentSpn2Cels, InStoreFlag, 12);
}
}
@ -248,16 +248,16 @@ void DrawSArrows(int y1, int y2)
yd1 = SStringY[y1] + 204;
yd2 = SStringY[y2] + 204;
if (stextscrlubtn != -1)
CelDecodeOnly(665, yd1, pSTextSlidCels, 12, 12);
CelDraw(665, yd1, pSTextSlidCels, 12, 12);
else
CelDecodeOnly(665, yd1, pSTextSlidCels, 10, 12);
CelDraw(665, yd1, pSTextSlidCels, 10, 12);
if (stextscrldbtn != -1)
CelDecodeOnly(665, yd2, pSTextSlidCels, 11, 12);
CelDraw(665, yd2, pSTextSlidCels, 11, 12);
else
CelDecodeOnly(665, yd2, pSTextSlidCels, 9, 12);
CelDraw(665, yd2, pSTextSlidCels, 9, 12);
yd1 += 12;
for (yd3 = yd1; yd3 < yd2; yd3 += 12) {
CelDecodeOnly(665, yd3, pSTextSlidCels, 14, 12);
CelDraw(665, yd3, pSTextSlidCels, 14, 12);
}
if (stextsel == 22)
yd3 = stextlhold;
@ -267,7 +267,7 @@ void DrawSArrows(int y1, int y2)
yd3 = 1000 * (stextsval + ((yd3 - stextup) >> 2)) / (storenumh - 1) * (SStringY[y2] - SStringY[y1] - 24) / 1000;
else
yd3 = 0;
CelDecodeOnly(665, SStringY[y1 + 1] + 204 + yd3, pSTextSlidCels, 13, 12);
CelDraw(665, SStringY[y1 + 1] + 204 + yd3, pSTextSlidCels, 13, 12);
}
void DrawSTextHelp()

60
Source/town.cpp

@ -399,34 +399,34 @@ void town_draw_clipped_town(BYTE *pBuff, int sx, int sy, int dx, int dy, int efl
bv = dItem[sx][sy] - 1;
px = dx - item[bv]._iAnimWidth2;
if (bv == pcursitem) {
CelDrawHdrClrHL(181, px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, 8);
CelBlitOutlineSafe(181, px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, 8);
}
Cel2DrawHdrOnly(px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, 8);
CelClippedDrawSafe(px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, 8);
}
if (dFlags[sx][sy] & BFLAG_MONSTLR) {
mi = -(dMonster[sx][sy - 1] + 1);
px = dx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst) {
CelDrawHdrClrHL(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
CelBlitOutlineSafe(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
}
Cel2DrawHdrOnly(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
CelClippedDrawSafe(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
}
if (dMonster[sx][sy] > 0) {
mi = dMonster[sx][sy] - 1;
px = dx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst) {
CelDrawHdrClrHL(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
CelBlitOutlineSafe(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
}
Cel2DrawHdrOnly(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
CelClippedDrawSafe(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, 8);
}
if (dFlags[sx][sy] & BFLAG_PLAYERLR) {
bv = -(dPlayer[sx][sy - 1] + 1);
px = dx + plr[bv]._pxoff - plr[bv]._pAnimWidth2;
py = dy + plr[bv]._pyoff;
if (bv == pcursplr) {
Cl2DecodeClrHL(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
Cl2DrawOutlineSafe(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
}
Cl2DecodeFrm4(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
Cl2DrawSafe(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
if (eflag && plr[bv]._peflag) {
town_draw_clipped_e_flag(pBuff - 64, sx - 1, sy + 1, dx - 64, dy);
}
@ -439,9 +439,9 @@ void town_draw_clipped_town(BYTE *pBuff, int sx, int sy, int dx, int dy, int efl
px = dx + plr[bv]._pxoff - plr[bv]._pAnimWidth2;
py = dy + plr[bv]._pyoff;
if (bv == pcursplr) {
Cl2DecodeClrHL(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
Cl2DrawOutlineSafe(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
}
Cl2DecodeFrm4(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
Cl2DrawSafe(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
if (eflag && plr[bv]._peflag) {
town_draw_clipped_e_flag(pBuff - 64, sx - 1, sy + 1, dx - 64, dy);
}
@ -581,34 +581,34 @@ void town_draw_clipped_town_2(BYTE *pBuff, int sx, int sy, int skipChunks, int C
bv = dItem[sx][sy] - 1;
px = dx - item[bv]._iAnimWidth2;
if (bv == pcursitem) {
CelDrawHdrClrHL(181, px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, CelSkip, 8);
CelBlitOutlineSafe(181, px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, CelSkip, 8);
}
Cel2DrawHdrOnly(px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, CelSkip, 8);
CelClippedDrawSafe(px, dy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, CelSkip, 8);
}
if (dFlags[sx][sy] & BFLAG_MONSTLR) {
mi = -(dMonster[sx][sy - 1] + 1);
px = dx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst) {
CelDrawHdrClrHL(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
CelBlitOutlineSafe(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
}
Cel2DrawHdrOnly(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
CelClippedDrawSafe(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
}
if (dMonster[sx][sy] > 0) {
mi = dMonster[sx][sy] - 1;
px = dx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst) {
CelDrawHdrClrHL(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
CelBlitOutlineSafe(166, px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
}
Cel2DrawHdrOnly(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
CelClippedDrawSafe(px, dy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, CelSkip, 8);
}
if (dFlags[sx][sy] & BFLAG_PLAYERLR) {
bv = -(dPlayer[sx][sy - 1] + 1);
px = dx + plr[bv]._pxoff - plr[bv]._pAnimWidth2;
py = dy + plr[bv]._pyoff;
if (bv == pcursplr) {
Cl2DecodeClrHL(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
Cl2DrawOutlineSafe(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
}
Cl2DecodeFrm4(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
Cl2DrawSafe(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
if (eflag && plr[bv]._peflag) {
town_draw_clipped_e_flag_2(pBuff - 64, sx - 1, sy + 1, skipChunks, CelSkip, dx - 64, dy);
}
@ -621,9 +621,9 @@ void town_draw_clipped_town_2(BYTE *pBuff, int sx, int sy, int skipChunks, int C
px = dx + plr[bv]._pxoff - plr[bv]._pAnimWidth2;
py = dy + plr[bv]._pyoff;
if (bv == pcursplr) {
Cl2DecodeClrHL(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
Cl2DrawOutlineSafe(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
}
Cl2DecodeFrm4(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
Cl2DrawSafe(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, CelSkip, 8);
if (eflag && plr[bv]._peflag) {
town_draw_clipped_e_flag_2(pBuff - 64, sx - 1, sy + 1, skipChunks, CelSkip, dx - 64, dy);
}
@ -770,38 +770,38 @@ void town_draw_town_all(BYTE *pBuff, int x, int y, int capChunks, int CelCap, in
bv = dItem[x][y] - 1;
px = sx - item[bv]._iAnimWidth2;
if (bv == pcursitem) {
CelDecodeClr(181, px, sy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, CelCap);
CelBlitOutline(181, px, sy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, CelCap);
}
/// ASSERT: assert(item[bv]._iAnimData);
CelDrawHdrOnly(px, sy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, CelCap);
CelClippedDraw(px, sy, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, CelCap);
}
if (dFlags[x][y] & BFLAG_MONSTLR) {
mi = -(dMonster[x][y - 1] + 1);
px = sx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst) {
CelDecodeClr(166, px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
CelBlitOutline(166, px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
}
/// ASSERT: assert(towner[mi]._tAnimData);
CelDrawHdrOnly(px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
CelClippedDraw(px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
}
if (dMonster[x][y] > 0) {
mi = dMonster[x][y] - 1;
px = sx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst) {
CelDecodeClr(166, px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
CelBlitOutline(166, px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
}
/// ASSERT: assert(towner[mi]._tAnimData);
CelDrawHdrOnly(px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
CelClippedDraw(px, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, CelCap);
}
if (dFlags[x][y] & BFLAG_PLAYERLR) {
bv = -(dPlayer[x][y - 1] + 1);
px = sx + plr[bv]._pxoff - plr[bv]._pAnimWidth2;
py = sy + plr[bv]._pyoff;
if (bv == pcursplr) {
Cl2DecodeFrm2(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
Cl2DrawOutline(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
}
/// ASSERT: assert(plr[bv]._pAnimData);
Cl2DecodeFrm1(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
Cl2Draw(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
if (eflag && plr[bv]._peflag) {
town_draw_e_flag(pBuff - 64, x - 1, y + 1, capChunks, CelCap, sx - 64, sy);
}
@ -814,10 +814,10 @@ void town_draw_town_all(BYTE *pBuff, int x, int y, int capChunks, int CelCap, in
px = sx + plr[bv]._pxoff - plr[bv]._pAnimWidth2;
py = sy + plr[bv]._pyoff;
if (bv == pcursplr) {
Cl2DecodeFrm2(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
Cl2DrawOutline(165, px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
}
/// ASSERT: assert(plr[bv]._pAnimData);
Cl2DecodeFrm1(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
Cl2Draw(px, py, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, CelCap);
if (eflag && plr[bv]._peflag) {
town_draw_e_flag(pBuff - 64, x - 1, y + 1, capChunks, CelCap, sx - 64, sy);
}

72
comparer-config/diablo.toml

@ -1763,112 +1763,112 @@ addr = 0x41618E
size = 0x6E
[[func]]
name = "CelDrawDatOnly"
name = "CelBlit"
addr = 0x41620C
size = 0x68
[[func]]
name = "CelDecodeOnly"
name = "CelDraw"
addr = 0x416274
size = 0x44
[[func]]
name = "CelDecDatOnly"
name = "CelBlitFrame"
addr = 0x4162B8
size = 0x26
[[func]]
name = "CelDrawHdrOnly"
name = "CelClippedDraw"
addr = 0x4162DE
size = 0x7B
[[func]]
name = "CelDecodeHdrOnly"
name = "CelClippedBlit"
addr = 0x416359
size = 0x53
[[func]]
name = "CelDecDatLightOnly"
name = "CelBlitLight"
addr = 0x4163AC
size = 0xDC
[[func]]
name = "CelDecDatLightTrans"
name = "CelBlitLightTrans"
addr = 0x416488
size = 0xDD
[[func]]
name = "CelDecodeLightOnly"
name = "CelDrawLight"
addr = 0x416565
size = 0x58
[[func]]
name = "CelDecodeHdrLightOnly"
name = "CelClippedDrawLight"
addr = 0x4165BD
size = 0x8E
[[func]]
name = "CelDecodeHdrLightTrans"
name = "CelClippedBlitLightTrans"
addr = 0x41664B
size = 0x74
[[func]]
name = "CelDrawHdrLightRed"
name = "CelDrawLightRed"
addr = 0x4166BF
size = 0x11C
[[func]]
name = "Cel2DecDatOnly"
name = "CelBlitSafe"
addr = 0x4167DB
size = 0x7F
[[func]]
name = "Cel2DrawHdrOnly"
name = "CelClippedDrawSafe"
addr = 0x41685A
size = 0x7B
[[func]]
name = "Cel2DecodeHdrOnly"
name = "CelClippedBlitSafe"
addr = 0x4168D5
size = 0x55
[[func]]
name = "Cel2DecDatLightOnly"
name = "CelBlitLightSafe"
addr = 0x41692A
size = 0xF7
[[func]]
name = "Cel2DecDatLightTrans"
name = "CelBlitLightTransSafe"
addr = 0x416A21
size = 0xF8
[[func]]
name = "Cel2DecodeHdrLight"
name = "CelDrawLightSafe"
addr = 0x416B19
size = 0x90
[[func]]
name = "Cel2DecodeLightTrans"
name = "CelClippedBlitLightTransSafe"
addr = 0x416BA9
size = 0x72
[[func]]
name = "Cel2DrawHdrLightRed"
name = "CelDrawLightRedSafe"
addr = 0x416C1B
size = 0x121
[[func]]
name = "CelDecodeRect"
name = "CelBlitWidth"
addr = 0x416D3C
size = 0x8A
[[func]]
name = "CelDecodeClr"
name = "CelBlitOutline"
addr = 0x416DC6
size = 0xFA
[[func]]
name = "CelDrawHdrClrHL"
name = "CelBlitOutlineSafe"
addr = 0x416EC0
size = 0x12F
@ -1933,72 +1933,72 @@ addr = 0x4176D2
size = 0x73
[[func]]
name = "Cl2DecodeFrm1"
name = "Cl2Draw"
addr = 0x417745
size = 0x7A
[[func]]
name = "Cl2DecDatFrm1"
name = "Cl2Blit"
addr = 0x4177BF
size = 0x88
[[func]]
name = "Cl2DecodeFrm2"
name = "Cl2DrawOutline"
addr = 0x417847
size = 0x7E
[[func]]
name = "Cl2DecDatFrm2"
name = "Cl2BlitOutline"
addr = 0x4178C5
size = 0xBC
[[func]]
name = "Cl2DecodeFrm3"
name = "Cl2DrawLightTbl"
addr = 0x417981
size = 0xC3
[[func]]
name = "Cl2DecDatLightTbl1"
name = "Cl2BlitLight"
addr = 0x417A44
size = 0xA5
[[func]]
name = "Cl2DecodeLightTbl"
name = "Cl2DrawLight"
addr = 0x417AE9
size = 0x9A
[[func]]
name = "Cl2DecodeFrm4"
name = "Cl2DrawSafe"
addr = 0x417B83
size = 0x7A
[[func]]
name = "Cl2DecDatFrm4"
name = "Cl2BlitSafe"
addr = 0x417BFD
size = 0x9C
[[func]]
name = "Cl2DecodeClrHL"
name = "Cl2DrawOutlineSafe"
addr = 0x417C99
size = 0x8F
[[func]]
name = "Cl2DecDatClrHL"
name = "Cl2BlitOutlineSafe"
addr = 0x417D28
size = 0xD0
[[func]]
name = "Cl2DecodeFrm5"
name = "Cl2DrawLightTblSafe"
addr = 0x417DF8
size = 0xC3
[[func]]
name = "Cl2DecDatLightTbl2"
name = "Cl2BlitLightSafe"
addr = 0x417EBB
size = 0xBD
[[func]]
name = "Cl2DecodeFrm6"
name = "Cl2DrawLightSafe"
addr = 0x417F78
size = 0x9A

72
comparer-config/spawn.toml

@ -1233,112 +1233,112 @@ addr = 0x40DFFE
size = 0x6E
[[func]]
name = "CelDrawDatOnly"
name = "CelBlit"
addr = 0x40E07C
size = 0x68
[[func]]
name = "CelDecodeOnly"
name = "CelDraw"
addr = 0x40E0E4
size = 0x44
[[func]]
name = "CelDecDatOnly"
name = "CelBlitFrame"
addr = 0x40E128
size = 0x26
[[func]]
name = "CelDrawHdrOnly"
name = "CelClippedDraw"
addr = 0x40E14E
size = 0x7B
[[func]]
name = "CelDecodeHdrOnly"
name = "CelClippedBlit"
addr = 0x40E1C9
size = 0x53
[[func]]
name = "CelDecDatLightOnly"
name = "CelBlitLight"
addr = 0x40E21C
size = 0xDC
[[func]]
name = "CelDecDatLightTrans"
name = "CelBlitLightTrans"
addr = 0x40E2F8
size = 0xDD
[[func]]
name = "CelDecodeLightOnly"
name = "CelDrawLight"
addr = 0x40E3D5
size = 0x58
[[func]]
name = "CelDecodeHdrLightOnly"
name = "CelClippedDrawLight"
addr = 0x40E42D
size = 0x8E
[[func]]
name = "CelDecodeHdrLightTrans"
name = "CelClippedBlitLightTrans"
addr = 0x40E4BB
size = 0x74
[[func]]
name = "CelDrawHdrLightRed"
name = "CelDrawLightRed"
addr = 0x40E52F
size = 0x11C
[[func]]
name = "Cel2DecDatOnly"
name = "CelBlitSafe"
addr = 0x40E64B
size = 0x7F
[[func]]
name = "Cel2DrawHdrOnly"
name = "CelClippedDrawSafe"
addr = 0x40E6CA
size = 0x7B
[[func]]
name = "Cel2DecodeHdrOnly"
name = "CelClippedBlitSafe"
addr = 0x40E745
size = 0x55
[[func]]
name = "Cel2DecDatLightOnly"
name = "CelBlitLightSafe"
addr = 0x40E79A
size = 0xF7
[[func]]
name = "Cel2DecDatLightTrans"
name = "CelBlitLightTransSafe"
addr = 0x40E891
size = 0xF8
[[func]]
name = "Cel2DecodeHdrLight"
name = "CelDrawLightSafe"
addr = 0x40E989
size = 0x90
[[func]]
name = "Cel2DecodeLightTrans"
name = "CelClippedBlitLightTransSafe"
addr = 0x40EA19
size = 0x72
[[func]]
name = "Cel2DrawHdrLightRed"
name = "CelDrawLightRedSafe"
addr = 0x40EA8B
size = 0x121
[[func]]
name = "CelDecodeRect"
name = "CelBlitWidth"
addr = 0x40EBAC
size = 0x8A
[[func]]
name = "CelDecodeClr"
name = "CelBlitOutline"
addr = 0x40EC36
size = 0xFA
[[func]]
name = "CelDrawHdrClrHL"
name = "CelBlitOutlineSafe"
addr = 0x40ED30
size = 0x12F
@ -1403,72 +1403,72 @@ addr = 0x40F542
size = 0x73
[[func]]
name = "Cl2DecodeFrm1"
name = "Cl2Draw"
addr = 0x40F5B5
size = 0x7A
[[func]]
name = "Cl2DecDatFrm1"
name = "Cl2Blit"
addr = 0x40F62F
size = 0x88
[[func]]
name = "Cl2DecodeFrm2"
name = "Cl2DrawOutline"
addr = 0x40F6B7
size = 0x7E
[[func]]
name = "Cl2DecDatFrm2"
name = "Cl2BlitOutline"
addr = 0x40F735
size = 0xBC
[[func]]
name = "Cl2DecodeFrm3"
name = "Cl2DrawLightTbl"
addr = 0x40F7F1
size = 0xC3
[[func]]
name = "Cl2DecDatLightTbl1"
name = "Cl2BlitLight"
addr = 0x40F8B4
size = 0xA5
[[func]]
name = "Cl2DecodeLightTbl"
name = "Cl2DrawLight"
addr = 0x40F959
size = 0x9A
[[func]]
name = "Cl2DecodeFrm4"
name = "Cl2DrawSafe"
addr = 0x40F9F3
size = 0x7A
[[func]]
name = "Cl2DecDatFrm4"
name = "Cl2BlitSafe"
addr = 0x40FA6D
size = 0x9C
[[func]]
name = "Cl2DecodeClrHL"
name = "Cl2DrawOutlineSafe"
addr = 0x40FB09
size = 0x8F
[[func]]
name = "Cl2DecDatClrHL"
name = "Cl2BlitOutlineSafe"
addr = 0x40FB98
size = 0xD0
[[func]]
name = "Cl2DecodeFrm5"
name = "Cl2DrawLightTblSafe"
addr = 0x40FC68
size = 0xC3
[[func]]
name = "Cl2DecDatLightTbl2"
name = "Cl2BlitLightSafe"
addr = 0x40FD2B
size = 0xBD
[[func]]
name = "Cl2DecodeFrm6"
name = "Cl2DrawLightSafe"
addr = 0x40FDE8
size = 0x9A

Loading…
Cancel
Save