Browse Source

Cleaning Engine CEL functions (#652)

* Cleaning Engine CEL functions

* Fix C functions
pull/35/head
galaxyhaxz 7 years ago committed by Robin Eklind
parent
commit
81f3f5daa2
  1. 32
      Source/control.cpp
  2. 2
      Source/doom.cpp
  3. 1633
      Source/engine.cpp
  4. 28
      Source/engine.h
  5. 16
      Source/error.cpp
  6. 12
      Source/gmenu.cpp
  7. 2
      Source/interfac.cpp
  8. 20
      Source/inv.cpp
  9. 2
      Source/items.cpp
  10. 2
      Source/minitext.cpp
  11. 6
      Source/quests.cpp
  12. 14
      Source/scrollrt.cpp
  13. 18
      Source/stores.cpp
  14. 18
      Source/town.cpp

32
Source/control.cpp

@ -1118,19 +1118,19 @@ void __cdecl DrawCtrlPan()
do {
v2 = *v1;
if (panbtn[v0])
CelDecodeOnly(v2 + 64, v1[1] + 178, pPanelButtons, v0 + 1, 71);
CelDecodeOnly(v2 + 64, v1[1] + 178, (BYTE *)pPanelButtons, v0 + 1, 71);
else
DrawPanelBox(v2, v1[1] - 336, 71, 20, v2 + 64, v1[1] + 160);
++v0;
v1 += 5;
} while (v0 < 6);
if (numpanbtns == 8) {
CelDecodeOnly(151, 634, pMultiBtns, panbtn[6] + 1, 33);
CelDecodeOnly(151, 634, (BYTE *)pMultiBtns, panbtn[6] + 1, 33);
if (FriendlyMode)
v3 = panbtn[7] + 3;
else
v3 = panbtn[7] + 5;
CelDecodeOnly(591, 634, pMultiBtns, v3, 33);
CelDecodeOnly(591, 634, (BYTE *)pMultiBtns, v3, 33);
}
}
// 484368: using guessed type int FriendlyMode;
@ -1774,7 +1774,7 @@ void __cdecl DrawChr()
int v30; // [esp+54h] [ebp-8h]
char a5[4]; // [esp+58h] [ebp-4h]
CelDecodeOnly(64, 511, pChrPanel, 1, 320);
CelDecodeOnly(64, 511, (BYTE *)pChrPanel, 1, 320);
ADD_PlrStringXY(20, 32, 151, plr[myplr]._pName, 0);
if (plr[myplr]._pClass == PC_WARRIOR) {
ADD_PlrStringXY(168, 32, 299, "Warrior", 0);
@ -1937,13 +1937,13 @@ void __cdecl DrawChr()
ADD_PlrStringXY(95, 266, 126, a4, 2);
v22 = plr[myplr]._pClass;
if (plr[myplr]._pBaseStr < MaxStats[v22][ATTRIB_STR])
CelDecodeOnly(201, 319, pChrButtons, chrbtn[0] + 2, 41);
CelDecodeOnly(201, 319, (BYTE *)pChrButtons, chrbtn[0] + 2, 41);
if (plr[myplr]._pBaseMag < MaxStats[v22][ATTRIB_MAG])
CelDecodeOnly(201, 347, pChrButtons, chrbtn[1] + 4, 41);
CelDecodeOnly(201, 347, (BYTE *)pChrButtons, chrbtn[1] + 4, 41);
if (plr[myplr]._pBaseDex < MaxStats[v22][ATTRIB_DEX])
CelDecodeOnly(201, 376, pChrButtons, chrbtn[2] + 6, 41);
CelDecodeOnly(201, 376, (BYTE *)pChrButtons, chrbtn[2] + 6, 41);
if (plr[myplr]._pBaseVit < MaxStats[v22][ATTRIB_VIT])
CelDecodeOnly(201, 404, pChrButtons, chrbtn[3] + 8, 41);
CelDecodeOnly(201, 404, (BYTE *)pChrButtons, chrbtn[3] + 8, 41);
}
v23 = plr[myplr]._pMaxHP;
a5[0] = v23 > plr[myplr]._pMaxHPBase;
@ -2079,7 +2079,7 @@ void __cdecl DrawLevelUpIcon()
if (!stextflag) {
v0 = (lvlbtndown != 0) + 2;
ADD_PlrStringXY(0, 303, 120, "Level Up", 0);
CelDecodeOnly(104, 495, pChrButtons, v0, 41);
CelDecodeOnly(104, 495, (BYTE *)pChrButtons, v0, 41);
}
}
// 4B851C: using guessed type int lvlbtndown;
@ -2247,7 +2247,7 @@ int __fastcall DrawDurIcon4Item(ItemStruct *pItem, int x, int c)
LABEL_18:
if (v5 > 2)
v7 += 8;
CelDecodeOnly(v4, 495, pDurIcons, v7, 32);
CelDecodeOnly(v4, 495, (BYTE *)pDurIcons, v7, 32);
return v4 - 40;
}
@ -2339,8 +2339,8 @@ void __cdecl DrawSpellBook()
int v11; // [esp+18h] [ebp-10h]
int v12; // [esp+1Ch] [ebp-Ch]
CelDecodeOnly(384, 511, pSpellBkCel, 1, 320);
CelDecodeOnly(76 * sbooktab + 391, 508, pSBkBtnCel, sbooktab + 1, 76);
CelDecodeOnly(384, 511, (BYTE *)pSpellBkCel, 1, 320);
CelDecodeOnly(76 * sbooktab + 391, 508, (BYTE *)pSBkBtnCel, sbooktab + 1, 76);
v9 = 1;
v8 = 214;
v0 = plr[myplr]._pISpells | plr[myplr]._pMemSpells | plr[myplr]._pAblSpells;
@ -2482,7 +2482,7 @@ void __fastcall DrawGoldSplit(int amount)
screen_x = 0;
v1 = amount;
CelDecodeOnly(415, 338, pGBoxBuff, 1, 261);
CelDecodeOnly(415, 338, (BYTE *)pGBoxBuff, 1, 261);
sprintf(tempstr, "You have %u gold", initialDropGoldValue);
ADD_PlrStringXY(366, 87, 600, tempstr, 3);
v2 = get_pieces_str(initialDropGoldValue);
@ -2501,7 +2501,7 @@ void __fastcall DrawGoldSplit(int amount)
}
screen_xa = screen_x + 452;
}
CelDecodeOnly(screen_xa, 300, pCelBuff, frame_4B8800, 12);
CelDecodeOnly(screen_xa, 300, (BYTE *)pCelBuff, frame_4B8800, 12);
frame_4B8800 = (frame_4B8800 & 7) + 1;
}
@ -2649,7 +2649,7 @@ void __cdecl DrawTalkPan()
} while (v4 < 39);
*v3 = 0;
LABEL_10:
CelDecDatOnly((char *)gpBuffer + a4, (char *)pCelBuff, frame, 12);
CelDecDatOnly((BYTE *)gpBuffer + a4, (BYTE *)pCelBuff, frame, 12);
v5 = 0;
a1 = plr[0]._pName;
v10 = 0;
@ -2677,7 +2677,7 @@ void __cdecl DrawTalkPan()
if (talkbtndown[v5])
v7 = (v5 != 0) + 5;
}
CelDecodeOnly(236, 18 * v5 + 596, pTalkBtns, v7, 61);
CelDecodeOnly(236, 18 * v5 + 596, (BYTE *)pTalkBtns, v7, 61);
goto LABEL_18;
}
}

2
Source/doom.cpp

@ -95,5 +95,5 @@ void __cdecl doom_draw()
}
}
CelDecodeOnly(64, 511, pDoomCel, 1, 640);
CelDecodeOnly(64, 511, (BYTE *)pDoomCel, 1, 640);
}

1633
Source/engine.cpp

File diff suppressed because it is too large Load Diff

28
Source/engine.h

@ -11,24 +11,22 @@ extern int orgseed; // weak
extern int SeedCount; // weak
extern int dword_52B99C; // bool valid - if x/y are in bounds
void __fastcall CelDrawDatOnly(char *pDecodeTo, char *pRLEBytes, int dwRLESize, int dwRLEWdt);
void __fastcall CelDecodeOnly(int screen_x, int screen_y, void *pCelBuff, int frame, int frame_width);
void __fastcall CelDecDatOnly(char *pBuff, char *pCelBuff, int frame, int frame_width);
void __fastcall CelDrawHdrOnly(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction);
void __fastcall CelDecodeHdrOnly(char *pBuff, char *pCelBuff, int frame, int frame_width, int always_0, int direction);
void __fastcall CelDecDatLightOnly(char *pDecodeTo, char *pRLEBytes, int frame_content_size, int frame_width);
void __fastcall CelDecDatLightEntry(unsigned char n, char *LightIndex, char **pDecodeTo, char **pRLEBytes); /* __usercall a1@<cl> a2@<ebx> a3@<edi> a4@<esi> */
void __fastcall CelDecDatLightTrans(char *pDecodeTo, char *pRLEBytes, int frame_content_size, int frame_width);
void __fastcall CelDecodeLightOnly(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width);
void __fastcall CelDrawDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall CelDecodeOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void __fastcall CelDecDatOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth);
void __fastcall CelDrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall CelDecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall CelDecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall CelDecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall CelDecodeLightOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth);
void __fastcall CelDecodeHdrLightOnly(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction);
void __fastcall CelDecodeHdrLightTrans(char *pBuff, char *pCelBuff, int frame, int frame_width, int always_0, int direction);
void __fastcall CelDrawHdrLightRed(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction, char always_1);
void __fastcall Cel2DecDatOnly(char *pDecodeTo, char *pRLEBytes, int frame_content_size, int frame_width);
void __fastcall Cel2DrawHdrOnly(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int a6, int direction);
void __fastcall Cel2DecodeHdrOnly(char *pBuff, char *pCelBuff, int frame, int frame_width, int a5, int direction);
void __fastcall Cel2DecDatLightOnly(char *pDecodeTo, char *pRLEBytes, int frame_content_size, int frame_width);
void __fastcall Cel2DecDatLightEntry(unsigned char n, char *LightIndex, char **pDecodeTo, char **pRLEBytes); /* __usercall a1@<cl> a2@<ebx> a3@<edi> a4@<esi> */
void __fastcall Cel2DecDatLightTrans(char *pDecodeTo, char *pRLEBytes, int frame_content_size, int frame_width);
void __fastcall Cel2DecDatOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall Cel2DrawHdrOnly(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall Cel2DecodeHdrOnly(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int always_0, int dir);
void __fastcall Cel2DecDatLightOnly(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall Cel2DecDatLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth);
void __fastcall Cel2DecodeHdrLight(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int a6, int direction);
void __fastcall Cel2DecodeLightTrans(char *dst_buf, char *pCelBuff, int frame, int frame_width, int a5, int direction);
void __fastcall Cel2DrawHdrLightRed(int screen_x, int screen_y, char *pCelBuff, int frame, int frame_width, int always_0, int direction, char always_1);

16
Source/error.cpp

@ -98,23 +98,23 @@ void __cdecl DrawDiabloMsg()
signed int v17; // [esp+Ch] [ebp-8h]
signed int screen_x; // [esp+10h] [ebp-4h]
CelDecodeOnly(165, 318, pSTextSlidCels, 1, 12);
CelDecodeOnly(591, 318, pSTextSlidCels, 4, 12);
CelDecodeOnly(165, 366, pSTextSlidCels, 2, 12);
CelDecodeOnly(591, 366, pSTextSlidCels, 3, 12);
CelDecodeOnly(165, 318, (BYTE *)pSTextSlidCels, 1, 12);
CelDecodeOnly(591, 318, (BYTE *)pSTextSlidCels, 4, 12);
CelDecodeOnly(165, 366, (BYTE *)pSTextSlidCels, 2, 12);
CelDecodeOnly(591, 366, (BYTE *)pSTextSlidCels, 3, 12);
screen_x = 173;
v16 = 35;
do {
CelDecodeOnly(screen_x, 318, pSTextSlidCels, 5, 12);
CelDecodeOnly(screen_x, 366, pSTextSlidCels, 7, 12);
CelDecodeOnly(screen_x, 318, (BYTE *)pSTextSlidCels, 5, 12);
CelDecodeOnly(screen_x, 366, (BYTE *)pSTextSlidCels, 7, 12);
screen_x += 12;
--v16;
} while (v16);
v0 = 330;
v1 = 3;
do {
CelDecodeOnly(165, v0, pSTextSlidCels, 6, 12);
CelDecodeOnly(591, v0, pSTextSlidCels, 8, 12);
CelDecodeOnly(165, v0, (BYTE *)pSTextSlidCels, 6, 12);
CelDecodeOnly(591, v0, (BYTE *)pSTextSlidCels, 8, 12);
v0 += 12;
--v1;
} while (v1);

12
Source/gmenu.cpp

@ -65,7 +65,7 @@ void __fastcall gmenu_print_text(int x, int y, char *pszStr)
++v3;
v7 = lfontframe[fontidx[i]];
if (v7)
CelDecodeLightOnly(v5, v4, (char *)BigTGold_cel, v7, 46);
CelDecodeLightOnly(v5, v4, (BYTE *)BigTGold_cel, v7, 46);
v5 += lfontkern[v7] + 2;
}
}
@ -194,7 +194,7 @@ void __cdecl gmenu_draw()
if (dword_634480) {
if (dword_63447C)
dword_63447C();
CelDecodeOnly(236, 262, sgpLogo, 1, 296);
CelDecodeOnly(236, 262, (BYTE *)sgpLogo, 1, 296);
v0 = 320;
for (i = dword_634480; i->fnMenu; v0 += 45) {
gmenu_draw_menu_item(i, v0);
@ -234,7 +234,7 @@ void __fastcall gmenu_draw_menu_item(TMenuItem *pItem, int a2)
v14 = v4;
if (v3->dwFlags & 0x40000000) {
v6 = (v4 >> 1) + 80;
CelDecodeOnly(v6, v2 - 10, optbar_cel, 1, 287);
CelDecodeOnly(v6, v2 - 10, (BYTE *)optbar_cel, 1, 287);
v7 = (v3->dwFlags >> 12) & 0xFFF;
if (v7 < 2)
v7 = 2;
@ -242,7 +242,7 @@ void __fastcall gmenu_draw_menu_item(TMenuItem *pItem, int a2)
v9 = (v5 >> 1) + 82;
v10 = v8;
gmenu_clear_buffer(v9, v2 - 12, v8 + 13, 28);
CelDecodeOnly(v6 + v10 + 2, v2 - 12, option_cel, 1, 27);
CelDecodeOnly(v6 + v10 + 2, v2 - 12, (BYTE *)option_cel, 1, 27);
v5 = v14;
}
v11 = 384 - (v5 >> 1);
@ -252,8 +252,8 @@ void __fastcall gmenu_draw_menu_item(TMenuItem *pItem, int a2)
gmenu_print_text(384 - (v5 >> 1), v2, v3->pszStr);
if (v3 == sgpCurrItem) {
v13 = v2 + 1;
CelDecodeOnly(v11 - 54, v13, PentSpin_cel, (unsigned char)byte_634478, 48);
CelDecodeOnly(v11 + v5 + 4, v13, PentSpin_cel, (unsigned char)byte_634478, 48);
CelDecodeOnly(v11 - 54, v13, (BYTE *)PentSpin_cel, (unsigned char)byte_634478, 48);
CelDecodeOnly(v11 + v5 + 4, v13, (BYTE *)PentSpin_cel, (unsigned char)byte_634478, 48);
}
}
// 634478: using guessed type char byte_634478;

2
Source/interfac.cpp

@ -37,7 +37,7 @@ void __cdecl DrawCutscene()
unsigned int v0; // esi
j_lock_buf_priv(1);
CelDecodeOnly(64, 639, sgpBackCel, 1, 640);
CelDecodeOnly(64, 639, (BYTE *)sgpBackCel, 1, 640);
v0 = 0;
if (sgdwProgress) {
do

20
Source/inv.cpp

@ -150,7 +150,7 @@ void __cdecl DrawInv()
BOOL invtest[40];
int frame, frame_width, colour, screen_x, screen_y, i, j, ii;
CelDecodeOnly(384, 511, pInvCels, 1, 320);
CelDecodeOnly(384, 511, (BYTE *)pInvCels, 1, 320);
if (plr[myplr].InvBody[INVLOC_HEAD]._itype != ITYPE_NONE) {
InvDrawSlotBack(517, 219, 2 * INV_SLOT_SIZE_PX, 2 * INV_SLOT_SIZE_PX);
@ -170,7 +170,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_HEAD]._iStatFlag) {
CelDrawHdrOnly(517, 219, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(517, 219, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(517, 219, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -194,7 +194,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_RING_LEFT]._iStatFlag) {
CelDrawHdrOnly(432, 365, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(432, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(432, 365, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -218,7 +218,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_RING_RIGHT]._iStatFlag) {
CelDrawHdrOnly(633, 365, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(633, 365, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(633, 365, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -242,7 +242,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_AMULET]._iStatFlag) {
CelDrawHdrOnly(589, 220, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(589, 220, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(589, 220, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -269,7 +269,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -309,7 +309,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iStatFlag) {
CelDrawHdrOnly(screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(screen_x, screen_y, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(screen_x, screen_y, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -333,7 +333,7 @@ void __cdecl DrawInv()
}
if (plr[myplr].InvBody[INVLOC_CHEST]._iStatFlag) {
CelDrawHdrOnly(517, 320, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(517, 320, (BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(517, 320, (char *)pCursCels, frame, frame_width, 0, 8, 1);
}
@ -377,7 +377,7 @@ void __cdecl DrawInv()
CelDrawHdrOnly(
InvRect[j + SLOTXY_INV_FIRST].X + 64,
InvRect[j + SLOTXY_INV_FIRST].Y + 159,
(char *)pCursCels, frame, frame_width, 0, 8);
(BYTE *)pCursCels, frame, frame_width, 0, 8);
} else {
CelDrawHdrLightRed(
InvRect[j + SLOTXY_INV_FIRST].X + 64,
@ -422,7 +422,7 @@ void __cdecl DrawInvBelt()
}
if (plr[myplr].SpdList[i]._iStatFlag)
CelDrawHdrOnly(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (char *)pCursCels, frame, frame_width, 0, 8);
CelDrawHdrOnly(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (BYTE *)pCursCels, frame, frame_width, 0, 8);
else
CelDrawHdrLightRed(InvRect[i + 65].X + 64, InvRect[i + 65].Y + 159, (char *)pCursCels, frame, frame_width, 0, 8, 1);

2
Source/items.cpp

@ -3696,7 +3696,7 @@ void __fastcall PrintItemPower(char plidx, ItemStruct *x)
void __cdecl DrawUBack()
{
CelDecodeOnly(88, 487, pSTextBoxCels, 1, 271);
CelDecodeOnly(88, 487, (BYTE *)pSTextBoxCels, 1, 271);
#define TRANS_RECT_X 27
#define TRANS_RECT_Y 28

2
Source/minitext.cpp

@ -85,7 +85,7 @@ void __fastcall InitQTextMsg(int m)
void __cdecl DrawQTextBack()
{
CelDecodeOnly(88, 487, pTextBoxCels, 1, 591);
CelDecodeOnly(88, 487, (BYTE *)pTextBoxCels, 1, 591);
#define TRANS_RECT_X 27
#define TRANS_RECT_Y 28

6
Source/quests.cpp

@ -940,7 +940,7 @@ void __fastcall PrintQLString(int x, int y, unsigned char cjustflag, char *str,
v12 = v8 + v6 + 76;
if (!cjustflag)
v12 = v6 + 76;
CelDecodeOnly(v12, v5 + 205, pCelBuff, ALLQUESTS, 12);
CelDecodeOnly(v12, v5 + 205, (BYTE *)pCelBuff, ALLQUESTS, 12);
}
v13 = 0;
v19 = 0;
@ -963,7 +963,7 @@ void __fastcall PrintQLString(int x, int y, unsigned char cjustflag, char *str,
v16 = v8 + v6 + 100;
else
v16 = 340 - v6;
CelDecodeOnly(v16, v5 + 205, pCelBuff, ALLQUESTS, 12);
CelDecodeOnly(v16, v5 + 205, (BYTE *)pCelBuff, ALLQUESTS, 12);
}
}
// 69BE90: using guessed type int qline;
@ -974,7 +974,7 @@ void __cdecl DrawQuestLog()
int i; // esi
PrintQLString(0, 2, 1u, "Quest Log", 3);
CelDecodeOnly(64, 511, pQLogCel, 1, 320);
CelDecodeOnly(64, 511, (BYTE *)pQLogCel, 1, 320);
v0 = qtopline;
for (i = 0; i < numqlines; ++i) {
PrintQLString(0, v0, 1u, questlist[qlist[i]]._qlstr, 0);

14
Source/scrollrt.cpp

@ -840,7 +840,7 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4,
v40 = *v10;
v41 = *(v10 - 1);
if (visiondebug && v50 & DFLAG_LIT)
Cel2DecodeHdrOnly(dst_buf, (char *)pSquareCel, 1, 64, 0, 8);
Cel2DecodeHdrOnly((BYTE *)dst_buf, (BYTE *)pSquareCel, 1, 64, 0, 8);
if (MissilePreFlag && v50 & DFLAG_MISSILE)
DrawClippedMissile(a1a, sy, a4, a5, 0, 8, TRUE);
if (light_table_index < lightmax) {
@ -1113,7 +1113,7 @@ void __fastcall DrawClippedObject(int x, int y, int ox, int oy, BOOL pre, int a6
if(object[bv]._oLight)
Cel2DecodeHdrLight(sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
else
Cel2DrawHdrOnly(sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
Cel2DrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
}
// 4B8CC1: using guessed type char pcursobj;
@ -1436,7 +1436,7 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int
v43 = *v12;
v44 = *(v12 - 1);
if (visiondebug && v53 & DFLAG_LIT)
Cel2DecodeHdrOnly(dst_buf, (char *)pSquareCel, 1, 64, a5, 8);
Cel2DecodeHdrOnly((BYTE *)dst_buf, (BYTE *)pSquareCel, 1, 64, a5, 8);
if (MissilePreFlag && v53 & DFLAG_MISSILE) {
v13 = sx;
DrawClippedMissile(a1, y, sx, sy, a5, 8, TRUE);
@ -1980,7 +1980,7 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5
v42 = *v12;
v43 = *(v12 - 1);
if (visiondebug && v52 & DFLAG_LIT)
CelDecodeHdrOnly(dst_buf, (char *)pSquareCel, 1, 64, 0, a5);
CelDecodeHdrOnly((BYTE *)dst_buf, (BYTE *)pSquareCel, 1, 64, 0, a5);
if (MissilePreFlag && v52 & DFLAG_MISSILE)
DrawMissile(xa, y, sx, sy, 0, a5, TRUE);
if (light_table_index < lightmax) {
@ -2255,7 +2255,7 @@ void __fastcall DrawObject(int x, int y, int ox, int oy, BOOL pre, int a6, int d
} else {
/// ASSERT: assert(object[bv]._oAnimData);
if(object[bv]._oAnimData) // BUGFIX: _oAnimData was already checked, this is redundant
CelDrawHdrOnly(sx, sy, (char *)object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
CelDrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, a6, dir);
}
}
// 4B8CC1: using guessed type char pcursobj;
@ -2715,7 +2715,7 @@ void __cdecl scrollrt_draw_cursor_item()
v10 = v3 + 1;
gpBufEnd = (unsigned char *)gpBuffer + screen_y_times_768[640] - v0 - 2;
if (pcurs < 12) {
Cel2DrawHdrOnly(v9 + 64, v1 + v10 + 159, (char *)pCursCels, pcurs, v0, 0, 8);
Cel2DrawHdrOnly(v9 + 64, v1 + v10 + 159, (BYTE *)pCursCels, pcurs, v0, 0, 8);
} else {
colour = ICOL_WHITE;
if (plr[myplr].HoldItem._iMagical != ITEM_QUALITY_NORMAL)
@ -2728,7 +2728,7 @@ void __cdecl scrollrt_draw_cursor_item()
if (colour == ICOL_RED)
Cel2DrawHdrLightRed(v12, v13, (char *)pCursCels, pcurs, cursW, 0, 8, 1);
else
Cel2DrawHdrOnly(v12, v13, (char *)pCursCels, pcurs, cursW, 0, 8);
Cel2DrawHdrOnly(v12, v13, (BYTE *)pCursCels, pcurs, cursW, 0, 8);
}
}
}

18
Source/stores.cpp

@ -147,7 +147,7 @@ void __cdecl FreeStoreMem()
void __cdecl DrawSTextBack()
{
CelDecodeOnly(408, 487, pSTextBoxCels, 1, 271);
CelDecodeOnly(408, 487, (BYTE *)pSTextBoxCels, 1, 271);
#define TRANS_RECT_X 347
#define TRANS_RECT_Y 28
@ -214,7 +214,7 @@ void __fastcall PrintSString(int x, int y, unsigned char cjustflag, char *str, i
v14 = v27 + v30 + v8 - 20;
else
v14 = v27 + v8 - 20;
CelDecodeOnly(v14, v6 + 205, pCelBuff, InStoreFlag, 12);
CelDecodeOnly(v14, v6 + 205, (BYTE *)pCelBuff, InStoreFlag, 12);
}
v29 = 0;
if (v28 > 0) {
@ -248,7 +248,7 @@ void __fastcall PrintSString(int x, int y, unsigned char cjustflag, char *str, i
v22 = v27 + v30 + v8 + 4;
else
v22 = 660 - v8;
CelDecodeOnly(v22, v6 + 205, pCelBuff, InStoreFlag, 12);
CelDecodeOnly(v22, v6 + 205, (BYTE *)pCelBuff, InStoreFlag, 12);
}
}
// 6A09E0: using guessed type char stextsize;
@ -309,18 +309,18 @@ void __fastcall DrawSArrows(int y1, int y2)
v4 = SStringY[y1] + 204;
v5 = *v2 + 204;
if (stextscrlubtn == -1)
CelDecodeOnly(665, v4, pSTextSlidCels, 10, 12);
CelDecodeOnly(665, v4, (BYTE *)pSTextSlidCels, 10, 12);
else
CelDecodeOnly(665, v4, pSTextSlidCels, 12, 12);
CelDecodeOnly(665, v4, (BYTE *)pSTextSlidCels, 12, 12);
if (stextscrldbtn == -1)
CelDecodeOnly(665, v5, pSTextSlidCels, 9, 12);
CelDecodeOnly(665, v5, (BYTE *)pSTextSlidCels, 9, 12);
else
CelDecodeOnly(665, v5, pSTextSlidCels, 11, 12);
CelDecodeOnly(665, v5, (BYTE *)pSTextSlidCels, 11, 12);
while (1) {
v4 += 12;
if (v4 >= v5)
break;
CelDecodeOnly(665, v4, pSTextSlidCels, 14, 12);
CelDecodeOnly(665, v4, (BYTE *)pSTextSlidCels, 14, 12);
}
v6 = stextsel;
if (stextsel == 22)
@ -329,7 +329,7 @@ void __fastcall DrawSArrows(int y1, int y2)
v7 = 0;
else
v7 = (*v2 - SStringY[v3] - 24) * (1000 * (stextsval + ((v6 - stextup) >> 2)) / (storenumh - 1)) / 1000;
CelDecodeOnly(665, SStringY[v3 + 1] + v7 + 204, pSTextSlidCels, 13, 12);
CelDecodeOnly(665, SStringY[v3 + 1] + v7 + 204, (BYTE *)pSTextSlidCels, 13, 12);
}
// 69F108: using guessed type int stextup;
// 69F10C: using guessed type int storenumh;

18
Source/town.cpp

@ -151,7 +151,7 @@ void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int s
item[v10]._iAnimWidth,
0,
8);
Cel2DrawHdrOnly(v11, sy, (char *)item[v10]._iAnimData, item[v10]._iAnimFrame, item[v10]._iAnimWidth, 0, 8);
Cel2DrawHdrOnly(v11, sy, item[v10]._iAnimData, item[v10]._iAnimFrame, item[v10]._iAnimWidth, 0, 8);
}
if (dFlags[0][v7] & DFLAG_MONSTER) {
v12 = -1 - dMonster[x][y - 1]; // -1 - *(&dword_52D204 + v7); /* check */
@ -166,7 +166,7 @@ void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int s
towner[v12]._tAnimWidth,
0,
8);
Cel2DrawHdrOnly(v13, sy, (char *)towner[v12]._tAnimData, towner[v12]._tAnimFrame, towner[v12]._tAnimWidth, 0, 8);
Cel2DrawHdrOnly(v13, sy, towner[v12]._tAnimData, towner[v12]._tAnimFrame, towner[v12]._tAnimWidth, 0, 8);
}
v14 = dMonster[0][v7];
if (v14 > 0) {
@ -183,7 +183,7 @@ void __fastcall town_draw_clipped_town(BYTE *buffer, int x, int y, int sx, int s
towner[v16]._tAnimWidth,
0,
8);
Cel2DrawHdrOnly(v17, sy, (char *)towner[v16]._tAnimData, towner[v16]._tAnimFrame, towner[v16]._tAnimWidth, 0, 8);
Cel2DrawHdrOnly(v17, sy, towner[v16]._tAnimData, towner[v16]._tAnimFrame, towner[v16]._tAnimWidth, 0, 8);
}
if (dFlags[0][v7] & DFLAG_PLAYER) {
v18 = -1 - dPlayer[x][y - 1]; // -1 - *((_BYTE *)&themeLoc[49].height + v7 + 3);
@ -411,7 +411,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
item[v12]._iAnimWidth,
a5,
8);
Cel2DrawHdrOnly(v13, sy, (char *)item[v12]._iAnimData, item[v12]._iAnimFrame, item[v12]._iAnimWidth, a5, 8);
Cel2DrawHdrOnly(v13, sy, item[v12]._iAnimData, item[v12]._iAnimFrame, item[v12]._iAnimWidth, a5, 8);
}
if (dFlags[0][v9] & DFLAG_MONSTER) {
v14 = -1 - dMonster[x][y - 1]; // -1 - *(&dword_52D204 + v9); /* check */
@ -426,7 +426,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
towner[v14]._tAnimWidth,
a5,
8);
Cel2DrawHdrOnly(v15, sy, (char *)towner[v14]._tAnimData, towner[v14]._tAnimFrame, towner[v14]._tAnimWidth, a5, 8);
Cel2DrawHdrOnly(v15, sy, towner[v14]._tAnimData, towner[v14]._tAnimFrame, towner[v14]._tAnimWidth, a5, 8);
}
v16 = dMonster[0][v9];
if (v16 > 0) {
@ -443,7 +443,7 @@ void __fastcall town_draw_clipped_town_2(int x, int y, int a3, int a4, int a5, i
towner[v18]._tAnimWidth,
a5,
8);
Cel2DrawHdrOnly(v19, sy, (char *)towner[v18]._tAnimData, towner[v18]._tAnimFrame, towner[v18]._tAnimWidth, a5, 8);
Cel2DrawHdrOnly(v19, sy, towner[v18]._tAnimData, towner[v18]._tAnimFrame, towner[v18]._tAnimWidth, a5, 8);
}
if (dFlags[0][v9] & DFLAG_PLAYER) {
v20 = -1 - dPlayer[x][y - 1]; // -1 - *((_BYTE *)&themeLoc[49].height + v9 + 3);
@ -654,21 +654,21 @@ void __fastcall town_draw_town_all(BYTE *buffer, int x, int y, int a4, int dir,
xx = sx - item[ii]._iAnimWidth2;
if (ii == pcursitem)
CelDecodeClr(ICOL_BLUE, xx, sy, (char *)item[ii]._iAnimData, item[ii]._iAnimFrame, item[ii]._iAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, (char *)item[ii]._iAnimData, item[ii]._iAnimFrame, item[ii]._iAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, item[ii]._iAnimData, item[ii]._iAnimFrame, item[ii]._iAnimWidth, 0, dir);
}
if (dFlags[x][y] & DFLAG_MONSTER) {
mi = -1 - dMonster[x][y - 1];
xx = sx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst)
CelDecodeClr(PAL16_BEIGE + 6, xx, sy, (char *)towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, (char *)towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
}
if (dMonster[x][y] > 0) {
mi = dMonster[x][y] - 1;
xx = sx - towner[mi]._tAnimWidth2;
if (mi == pcursmonst)
CelDecodeClr(PAL16_BEIGE + 6, xx, sy, (char *)towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, (char *)towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
CelDrawHdrOnly(xx, sy, towner[mi]._tAnimData, towner[mi]._tAnimFrame, towner[mi]._tAnimWidth, 0, dir);
}
if (dFlags[x][y] & DFLAG_PLAYER) {
pnum = -1 - dPlayer[x][y - 1];

Loading…
Cancel
Save