commit
23e7737c75
65 changed files with 1354 additions and 2022 deletions
|
|
@ -473,7 +473,7 @@ void __cdecl app_fatal(const char *pszFmt, ...)
|
|||
|
||||
void MsgBox(const char *pszFmt, va_list va)
|
||||
{
|
||||
char Text[256]; // [esp+0h] [ebp-100h]
|
||||
char Text[256];
|
||||
|
||||
wvsprintf(Text, pszFmt, va);
|
||||
if (ghMainWnd)
|
||||
|
|
@ -502,8 +502,8 @@ void FreeDlg()
|
|||
|
||||
void __cdecl DrawDlg(char *pszFmt, ...)
|
||||
{
|
||||
char text[256]; // [esp+0h] [ebp-100h]
|
||||
va_list arglist; // [esp+10Ch] [ebp+Ch]
|
||||
char text[256];
|
||||
va_list arglist;
|
||||
|
||||
va_start(arglist, pszFmt);
|
||||
wvsprintf(text, pszFmt, arglist);
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@ DEVILUTION_BEGIN_NAMESPACE
|
|||
WORD automaptype[512];
|
||||
static int MapX;
|
||||
static int MapY;
|
||||
BOOL automapflag; // idb
|
||||
BOOL automapflag;
|
||||
char AmShiftTab[32]; // [31]?
|
||||
unsigned char automapview[DMAXX][DMAXY];
|
||||
int AutoMapScale; // idb
|
||||
int AutoMapXOfs; // weak
|
||||
int AutoMapYOfs; // weak
|
||||
int AutoMapPosBits; // weak
|
||||
int AutoMapXPos; // weak
|
||||
int AutoMapYPos; // weak
|
||||
int AMPlayerX; // weak
|
||||
int AMPlayerY; // weak
|
||||
int AutoMapScale;
|
||||
int AutoMapXOfs;
|
||||
int AutoMapYOfs;
|
||||
int AutoMapPosBits;
|
||||
int AutoMapXPos;
|
||||
int AutoMapYPos;
|
||||
int AMPlayerX;
|
||||
int AMPlayerY;
|
||||
|
||||
// color used to draw the player's arrow
|
||||
#define COLOR_PLAYER (PAL8_ORANGE + 1)
|
||||
|
|
@ -49,10 +49,10 @@ void InitAutomapOnce()
|
|||
|
||||
void InitAutomap()
|
||||
{
|
||||
unsigned char b1, b2;
|
||||
unsigned int dwTiles;
|
||||
BYTE b1, b2;
|
||||
DWORD dwTiles;
|
||||
int x, y;
|
||||
unsigned char *pAFile, *pTmp;
|
||||
BYTE *pAFile, *pTmp;
|
||||
int i, j;
|
||||
int d;
|
||||
|
||||
|
|
@ -117,26 +117,26 @@ void StartAutomap()
|
|||
|
||||
void AutomapUp()
|
||||
{
|
||||
--AutoMapXOfs;
|
||||
--AutoMapYOfs;
|
||||
AutoMapXOfs--;
|
||||
AutoMapYOfs--;
|
||||
}
|
||||
|
||||
void AutomapDown()
|
||||
{
|
||||
++AutoMapXOfs;
|
||||
++AutoMapYOfs;
|
||||
AutoMapXOfs++;
|
||||
AutoMapYOfs++;
|
||||
}
|
||||
|
||||
void AutomapLeft()
|
||||
{
|
||||
--AutoMapXOfs;
|
||||
++AutoMapYOfs;
|
||||
AutoMapXOfs--;
|
||||
AutoMapYOfs++;
|
||||
}
|
||||
|
||||
void AutomapRight()
|
||||
{
|
||||
++AutoMapXOfs;
|
||||
--AutoMapYOfs;
|
||||
AutoMapXOfs++;
|
||||
AutoMapYOfs--;
|
||||
}
|
||||
|
||||
void AutomapZoomIn()
|
||||
|
|
@ -247,8 +247,6 @@ void DrawAutomap()
|
|||
DrawAutomapPlr();
|
||||
DrawAutomapGame();
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
void DrawAutomapType(int sx, int sy, WORD automap_type)
|
||||
{
|
||||
|
|
@ -538,8 +536,8 @@ WORD GetAutomapType(int x, int y, BOOL view)
|
|||
|
||||
rv = automaptype[(BYTE)dungeon[x][y]];
|
||||
if (rv == 7
|
||||
&& GetAutomapType(x - 1, y, FALSE) & (MAPFLAG_HORZARCH << 8)
|
||||
&& GetAutomapType(x, y - 1, FALSE) & (MAPFLAG_VERTARCH << 8)) {
|
||||
&& GetAutomapType(x - 1, y, FALSE) & (MAPFLAG_HORZARCH << 8)
|
||||
&& GetAutomapType(x, y - 1, FALSE) & (MAPFLAG_VERTARCH << 8)) {
|
||||
rv = 1;
|
||||
}
|
||||
return rv;
|
||||
|
|
|
|||
|
|
@ -3,17 +3,17 @@
|
|||
#define __AUTOMAP_H__
|
||||
|
||||
extern WORD automaptype[512];
|
||||
extern BOOL automapflag; // idb
|
||||
extern BOOL automapflag;
|
||||
extern char AmShiftTab[32];
|
||||
extern unsigned char automapview[DMAXX][DMAXY];
|
||||
extern int AutoMapScale; // idb
|
||||
extern int AutoMapXOfs; // weak
|
||||
extern int AutoMapYOfs; // weak
|
||||
extern int AutoMapPosBits; // weak
|
||||
extern int AutoMapXPos; // weak
|
||||
extern int AutoMapYPos; // weak
|
||||
extern int AMPlayerX; // weak
|
||||
extern int AMPlayerY; // weak
|
||||
extern int AutoMapScale;
|
||||
extern int AutoMapXOfs;
|
||||
extern int AutoMapYOfs;
|
||||
extern int AutoMapPosBits;
|
||||
extern int AutoMapXPos;
|
||||
extern int AutoMapYPos;
|
||||
extern int AMPlayerX;
|
||||
extern int AMPlayerY;
|
||||
|
||||
void InitAutomapOnce();
|
||||
void InitAutomap();
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@
|
|||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
char sgbNextTalkSave; // weak
|
||||
char sgbTalkSavePos; // weak
|
||||
void *pDurIcons;
|
||||
void *pChrButtons;
|
||||
BYTE sgbTalkSavePos;
|
||||
BYTE *pDurIcons;
|
||||
BYTE *pChrButtons;
|
||||
BOOL drawhpflag; // idb
|
||||
BOOL dropGoldFlag;
|
||||
int panbtn[8];
|
||||
int chrbtn[4];
|
||||
void *pMultiBtns;
|
||||
void *pPanelButtons;
|
||||
void *pChrPanel;
|
||||
BYTE *pMultiBtns;
|
||||
BYTE *pPanelButtons;
|
||||
BYTE *pChrPanel;
|
||||
int lvlbtndown; // weak
|
||||
char sgszTalkSave[8][80];
|
||||
int dropGoldValue; // idb
|
||||
|
|
@ -23,7 +23,7 @@ BYTE *pPanelText;
|
|||
int nGoldFrame;
|
||||
BYTE *pLifeBuff;
|
||||
BYTE *pBtmBuff;
|
||||
void *pTalkBtns;
|
||||
BYTE *pTalkBtns;
|
||||
int pstrjust[4];
|
||||
int pnumlines; // idb
|
||||
BOOL pinfoflag;
|
||||
|
|
@ -32,40 +32,40 @@ int pSpell; // weak
|
|||
BYTE *pManaBuff;
|
||||
char infoclr; // weak
|
||||
int sgbPlrTalkTbl; // weak // should be char [4]
|
||||
void *pGBoxBuff;
|
||||
void *pSBkBtnCel;
|
||||
BYTE *pGBoxBuff;
|
||||
BYTE *pSBkBtnCel;
|
||||
char tempstr[256];
|
||||
char byte_4B894C[4];
|
||||
BOOLEAN whisper[MAX_PLRS];
|
||||
int sbooktab; // weak
|
||||
int pSplType; // weak
|
||||
int frame; // idb
|
||||
int initialDropGoldIndex; // idb
|
||||
int talkflag; // weak
|
||||
void *pSBkIconCels;
|
||||
BYTE *pSBkIconCels;
|
||||
int sbookflag; // weak
|
||||
int chrflag;
|
||||
BOOL drawbtnflag;
|
||||
void *pSpellBkCel;
|
||||
BYTE *pSpellBkCel;
|
||||
char infostr[MAX_PATH];
|
||||
int numpanbtns; // weak
|
||||
void *pStatusPanel;
|
||||
BYTE *pStatusPanel;
|
||||
char panelstr[256];
|
||||
int panelflag; // weak
|
||||
unsigned char SplTransTbl[256];
|
||||
int initialDropGoldValue; // idb
|
||||
void *pSpellCels;
|
||||
BYTE *pSpellCels;
|
||||
BOOL panbtndown;
|
||||
void *pTalkPanel; // idb
|
||||
int spselflag; // weak
|
||||
BYTE *pTalkPanel;
|
||||
int spselflag; // weak
|
||||
|
||||
const unsigned char fontframe[128] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 54, 44, 57, 58, 56, 55, 47, 40, 41, 59, 39, 50, 37, 51, 52,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 54, 44, 57, 58, 56, 55, 47, 40, 41, 59, 39, 50, 37, 51, 52,
|
||||
36, 27, 28, 29, 30, 31, 32, 33, 34, 35, 48, 49, 60, 38, 61, 53,
|
||||
62, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
62, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 42, 63, 43, 64, 65,
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 40, 66, 41, 67, 0
|
||||
};
|
||||
const unsigned char fontkern[68] = {
|
||||
|
|
@ -371,9 +371,9 @@ void DrawSpell()
|
|||
st = RSPLTYPE_INVALID;
|
||||
SetSpellTrans(st);
|
||||
if (spl != SPL_INVALID)
|
||||
DrawSpellCel(629, 631, (BYTE *)pSpellCels, SpellITbl[spl], 56);
|
||||
DrawSpellCel(629, 631, pSpellCels, SpellITbl[spl], 56);
|
||||
else
|
||||
DrawSpellCel(629, 631, (BYTE *)pSpellCels, 27, 56);
|
||||
DrawSpellCel(629, 631, pSpellCels, 27, 56);
|
||||
}
|
||||
|
||||
void DrawSpellList()
|
||||
|
|
@ -460,11 +460,11 @@ void DrawSpellList()
|
|||
}
|
||||
if (!currlevel && !*v20)
|
||||
SetSpellTrans(RSPLTYPE_INVALID);
|
||||
DrawSpellCel(v17, xp, (BYTE *)pSpellCels, SpellITbl[v4], 56);
|
||||
DrawSpellCel(v17, xp, pSpellCels, SpellITbl[v4], 56);
|
||||
if (MouseX >= v17 - 64 && MouseX < v17 - 64 + 56 && MouseY >= v22 && MouseY < v22 + 56) {
|
||||
pSpell = v4;
|
||||
pSplType = v1;
|
||||
DrawSpellCel(v17, xp, (BYTE *)pSpellCels, yp, 56);
|
||||
DrawSpellCel(v17, xp, pSpellCels, yp, 56);
|
||||
if (v1) {
|
||||
switch (v1) {
|
||||
case RSPLTYPE_SPELL:
|
||||
|
|
@ -530,7 +530,7 @@ void DrawSpellList()
|
|||
v16 = 0;
|
||||
do {
|
||||
if (plr[v0]._pSplHotKey[v16] == pSpell && plr[v0]._pSplTHotKey[v16] == pSplType) {
|
||||
DrawSpellCel(v17, xp, (BYTE *)pSpellCels, v16 + 48, 56);
|
||||
DrawSpellCel(v17, xp, pSpellCels, v16 + 48, 56);
|
||||
sprintf(tempstr, "Spell Hot Key #F%i", v16 + 5);
|
||||
AddPanelString(tempstr, 1);
|
||||
v0 = myplr;
|
||||
|
|
@ -1197,23 +1197,23 @@ void InitControlPan()
|
|||
pSpellCels = LoadFileInMem("CtrlPan\\SpelIcon.CEL", 0);
|
||||
SetSpellTrans(RSPLTYPE_SKILL);
|
||||
pStatusPanel = LoadFileInMem("CtrlPan\\Panel8.CEL", 0);
|
||||
CelDecodeRect((BYTE *)pBtmBuff, 0, 143, 640, (BYTE *)pStatusPanel, 1, 640);
|
||||
CelDecodeRect(pBtmBuff, 0, 143, 640, pStatusPanel, 1, 640);
|
||||
MemFreeDbg(pStatusPanel);
|
||||
pStatusPanel = LoadFileInMem("CtrlPan\\P8Bulbs.CEL", 0);
|
||||
CelDecodeRect((BYTE *)pLifeBuff, 0, 87, 88, (BYTE *)pStatusPanel, 1, 88);
|
||||
CelDecodeRect((BYTE *)pManaBuff, 0, 87, 88, (BYTE *)pStatusPanel, 2, 88);
|
||||
CelDecodeRect(pLifeBuff, 0, 87, 88, pStatusPanel, 1, 88);
|
||||
CelDecodeRect(pManaBuff, 0, 87, 88, pStatusPanel, 2, 88);
|
||||
MemFreeDbg(pStatusPanel);
|
||||
talkflag = 0;
|
||||
if (gbMaxPlayers != 1) {
|
||||
pTalkPanel = LoadFileInMem("CtrlPan\\TalkPanl.CEL", 0);
|
||||
CelDecodeRect((BYTE *)pBtmBuff, 0, 287, 640, (BYTE *)pTalkPanel, 1, 640);
|
||||
CelDecodeRect(pBtmBuff, 0, 287, 640, pTalkPanel, 1, 640);
|
||||
MemFreeDbg(pTalkPanel);
|
||||
pMultiBtns = LoadFileInMem("CtrlPan\\P8But2.CEL", 0);
|
||||
pTalkBtns = LoadFileInMem("CtrlPan\\TalkButt.CEL", 0);
|
||||
sgbPlrTalkTbl = 0;
|
||||
sgszTalkMsg[0] = 0;
|
||||
for (i = 0; i < sizeof(byte_4B894C); i++)
|
||||
byte_4B894C[i] = 1;
|
||||
for (i = 0; i < MAX_PLRS; i++)
|
||||
whisper[i] = TRUE;
|
||||
for (i = 0; i < sizeof(talkbtndown) / sizeof(talkbtndown[0]); i++)
|
||||
talkbtndown[i] = FALSE;
|
||||
}
|
||||
|
|
@ -1274,14 +1274,14 @@ void DrawCtrlPan()
|
|||
if (!panbtn[i])
|
||||
DrawPanelBox(PanBtnPos[i][0], PanBtnPos[i][1] - 336, 71, 20, PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 160);
|
||||
else
|
||||
CelDecodeOnly(PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 178, (BYTE *)pPanelButtons, i + 1, 71);
|
||||
CelDecodeOnly(PanBtnPos[i][0] + 64, PanBtnPos[i][1] + 178, pPanelButtons, i + 1, 71);
|
||||
}
|
||||
if (numpanbtns == 8) {
|
||||
CelDecodeOnly(151, 634, (BYTE *)pMultiBtns, panbtn[6] + 1, 33);
|
||||
CelDecodeOnly(151, 634, pMultiBtns, panbtn[6] + 1, 33);
|
||||
if (FriendlyMode)
|
||||
CelDecodeOnly(591, 634, (BYTE *)pMultiBtns, panbtn[7] + 3, 33);
|
||||
CelDecodeOnly(591, 634, pMultiBtns, panbtn[7] + 3, 33);
|
||||
else
|
||||
CelDecodeOnly(591, 634, (BYTE *)pMultiBtns, panbtn[7] + 5, 33);
|
||||
CelDecodeOnly(591, 634, pMultiBtns, panbtn[7] + 5, 33);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1797,19 +1797,16 @@ void control_print_info_str(int y, char *str, BOOLEAN center, int lines)
|
|||
|
||||
void PrintGameStr(int x, int y, char *str, int color)
|
||||
{
|
||||
char *v4; // edi
|
||||
int v5; // esi
|
||||
unsigned char i; // al
|
||||
unsigned char v7; // bl
|
||||
|
||||
v4 = str;
|
||||
v5 = PitchTbl[y + 160] + x + 64;
|
||||
for (i = *str; *v4; i = *v4) {
|
||||
++v4;
|
||||
v7 = fontframe[gbFontTransTbl[i]];
|
||||
if (v7)
|
||||
CPrintString(v5, v7, color);
|
||||
v5 += fontkern[v7] + 1;
|
||||
BYTE c;
|
||||
int off;
|
||||
off = PitchTbl[y + 160] + x + 64;
|
||||
while (*str) {
|
||||
c = gbFontTransTbl[(BYTE)*str];
|
||||
str++;
|
||||
c = fontframe[c];
|
||||
if (c)
|
||||
CPrintString(off, c, color);
|
||||
off += fontkern[c] + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1847,7 +1844,7 @@ void DrawChr()
|
|||
int v30; // [esp+54h] [ebp-8h]
|
||||
char a5[4]; // [esp+58h] [ebp-4h]
|
||||
|
||||
CelDecodeOnly(64, 511, (BYTE *)pChrPanel, 1, 320);
|
||||
CelDecodeOnly(64, 511, 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);
|
||||
|
|
@ -2010,13 +2007,13 @@ void DrawChr()
|
|||
ADD_PlrStringXY(95, 266, 126, a4, 2);
|
||||
v22 = plr[myplr]._pClass;
|
||||
if (plr[myplr]._pBaseStr < MaxStats[v22][ATTRIB_STR])
|
||||
CelDecodeOnly(201, 319, (BYTE *)pChrButtons, chrbtn[0] + 2, 41);
|
||||
CelDecodeOnly(201, 319, pChrButtons, chrbtn[0] + 2, 41);
|
||||
if (plr[myplr]._pBaseMag < MaxStats[v22][ATTRIB_MAG])
|
||||
CelDecodeOnly(201, 347, (BYTE *)pChrButtons, chrbtn[1] + 4, 41);
|
||||
CelDecodeOnly(201, 347, pChrButtons, chrbtn[1] + 4, 41);
|
||||
if (plr[myplr]._pBaseDex < MaxStats[v22][ATTRIB_DEX])
|
||||
CelDecodeOnly(201, 376, (BYTE *)pChrButtons, chrbtn[2] + 6, 41);
|
||||
CelDecodeOnly(201, 376, pChrButtons, chrbtn[2] + 6, 41);
|
||||
if (plr[myplr]._pBaseVit < MaxStats[v22][ATTRIB_VIT])
|
||||
CelDecodeOnly(201, 404, (BYTE *)pChrButtons, chrbtn[3] + 8, 41);
|
||||
CelDecodeOnly(201, 404, pChrButtons, chrbtn[3] + 8, 41);
|
||||
}
|
||||
v23 = plr[myplr]._pMaxHP;
|
||||
a5[0] = v23 > plr[myplr]._pMaxHPBase;
|
||||
|
|
@ -2135,7 +2132,6 @@ void CheckLvlBtn()
|
|||
if (!lvlbtndown && MouseX >= 40 && MouseX <= 81 && MouseY >= 313 && MouseY <= 335)
|
||||
lvlbtndown = 1;
|
||||
}
|
||||
// 4B851C: using guessed type int lvlbtndown;
|
||||
|
||||
void ReleaseLvlBtn()
|
||||
{
|
||||
|
|
@ -2143,20 +2139,17 @@ void ReleaseLvlBtn()
|
|||
chrflag = 1;
|
||||
lvlbtndown = 0;
|
||||
}
|
||||
// 4B851C: using guessed type int lvlbtndown;
|
||||
|
||||
void DrawLevelUpIcon()
|
||||
{
|
||||
int v0; // esi
|
||||
int nCel;
|
||||
|
||||
if (!stextflag) {
|
||||
v0 = (lvlbtndown != 0) + 2;
|
||||
nCel = lvlbtndown ? 3 : 2;
|
||||
ADD_PlrStringXY(0, 303, 120, "Level Up", 0);
|
||||
CelDecodeOnly(104, 495, (BYTE *)pChrButtons, v0, 41);
|
||||
CelDecodeOnly(104, 495, pChrButtons, nCel, 41);
|
||||
}
|
||||
}
|
||||
// 4B851C: using guessed type int lvlbtndown;
|
||||
// 6AA705: using guessed type char stextflag;
|
||||
|
||||
void CheckChrBtns()
|
||||
{
|
||||
|
|
@ -2233,24 +2226,20 @@ void ReleaseChrBtns()
|
|||
|
||||
void DrawDurIcon()
|
||||
{
|
||||
int v0; // edx
|
||||
PlayerStruct *v1; // esi
|
||||
int v2; // eax
|
||||
int v3; // eax
|
||||
int v4; // eax
|
||||
PlayerStruct *p;
|
||||
int x1, x2, x3, x4;
|
||||
|
||||
if (!chrflag && !questlog || !invflag && !sbookflag) {
|
||||
v0 = 656;
|
||||
x1 = 656;
|
||||
if (invflag || sbookflag)
|
||||
v0 = 336;
|
||||
v1 = &plr[myplr];
|
||||
v2 = DrawDurIcon4Item(v1->InvBody, v0, 4);
|
||||
v3 = DrawDurIcon4Item(&v1->InvBody[INVLOC_CHEST], v2, 3);
|
||||
v4 = DrawDurIcon4Item(&v1->InvBody[INVLOC_HAND_LEFT], v3, 0);
|
||||
DrawDurIcon4Item(&v1->InvBody[INVLOC_HAND_RIGHT], v4, 0);
|
||||
x1 = 336;
|
||||
p = &plr[myplr];
|
||||
x2 = DrawDurIcon4Item(&p->InvBody[INVLOC_HEAD], x1, 4);
|
||||
x3 = DrawDurIcon4Item(&p->InvBody[INVLOC_CHEST], x2, 3);
|
||||
x4 = DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_LEFT], x3, 0);
|
||||
DrawDurIcon4Item(&p->InvBody[INVLOC_HAND_RIGHT], x4, 0);
|
||||
}
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
|
||||
int DrawDurIcon4Item(ItemStruct *item, int x, int frame)
|
||||
{
|
||||
|
|
@ -2285,7 +2274,7 @@ int DrawDurIcon4Item(ItemStruct *item, int x, int frame)
|
|||
}
|
||||
if (item->_iDurability > 2)
|
||||
frame += 8;
|
||||
CelDecodeOnly(x, 495, (BYTE *)pDurIcons, frame, 32);
|
||||
CelDecodeOnly(x, 495, pDurIcons, frame, 32);
|
||||
return x - 40;
|
||||
}
|
||||
|
||||
|
|
@ -2364,28 +2353,27 @@ void RedBack()
|
|||
}
|
||||
#endif
|
||||
}
|
||||
// 525728: using guessed type int light4flag;
|
||||
|
||||
char GetSBookTrans(int ii, BOOL townok)
|
||||
{
|
||||
char st;
|
||||
|
||||
st = RSPLTYPE_SPELL;
|
||||
if(plr[myplr]._pISpells & (__int64)1 << (ii - 1)) {
|
||||
if (plr[myplr]._pISpells & (__int64)1 << (ii - 1)) {
|
||||
st = RSPLTYPE_CHARGES;
|
||||
}
|
||||
if(plr[myplr]._pAblSpells & 1 << (ii - 1)) { /// BUGFIX: missing (__int64)
|
||||
if (plr[myplr]._pAblSpells & 1 << (ii - 1)) { /// BUGFIX: missing (__int64)
|
||||
st = RSPLTYPE_SKILL;
|
||||
}
|
||||
if(st == RSPLTYPE_SPELL) {
|
||||
if(!CheckSpell(myplr, ii, RSPLTYPE_SPELL, TRUE)) {
|
||||
if (st == RSPLTYPE_SPELL) {
|
||||
if (!CheckSpell(myplr, ii, RSPLTYPE_SPELL, TRUE)) {
|
||||
st = RSPLTYPE_INVALID;
|
||||
}
|
||||
if((char)(plr[myplr]._pSplLvl[ii] + plr[myplr]._pISplLvlAdd) <= 0) {
|
||||
if ((char)(plr[myplr]._pSplLvl[ii] + plr[myplr]._pISplLvlAdd) <= 0) {
|
||||
st = RSPLTYPE_INVALID;
|
||||
}
|
||||
}
|
||||
if(townok && currlevel == 0 && st != RSPLTYPE_INVALID && !spelldata[ii].sTownSpell) {
|
||||
if (townok && currlevel == 0 && st != RSPLTYPE_INVALID && !spelldata[ii].sTownSpell) {
|
||||
st = RSPLTYPE_INVALID;
|
||||
}
|
||||
|
||||
|
|
@ -2398,24 +2386,24 @@ void DrawSpellBook()
|
|||
char st;
|
||||
unsigned __int64 spl;
|
||||
|
||||
CelDecodeOnly(384, 511, (BYTE *)pSpellBkCel, 1, 320);
|
||||
CelDecodeOnly(76 * sbooktab + 391, 508, (BYTE *)pSBkBtnCel, sbooktab + 1, 76);
|
||||
CelDecodeOnly(384, 511, pSpellBkCel, 1, 320);
|
||||
CelDecodeOnly(76 * sbooktab + 391, 508, pSBkBtnCel, sbooktab + 1, 76);
|
||||
|
||||
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
|
||||
|
||||
yp = 215;
|
||||
for(i = 1; i < 8; i++) {
|
||||
for (i = 1; i < 8; i++) {
|
||||
sn = SpellPages[sbooktab][i - 1];
|
||||
if(sn != -1 && spl & (__int64)1 << (sn - 1)) {
|
||||
if (sn != -1 && spl & (__int64)1 << (sn - 1)) {
|
||||
st = GetSBookTrans(sn, TRUE);
|
||||
SetSpellTrans(st);
|
||||
DrawSpellCel(395, yp, (BYTE *)pSBkIconCels, SpellITbl[sn], 37);
|
||||
if(sn == plr[myplr]._pRSpell && st == plr[myplr]._pRSplType) {
|
||||
DrawSpellCel(395, yp, pSBkIconCels, SpellITbl[sn], 37);
|
||||
if (sn == plr[myplr]._pRSpell && st == plr[myplr]._pRSplType) {
|
||||
SetSpellTrans(RSPLTYPE_SKILL);
|
||||
DrawSpellCel(395, yp, (BYTE *)pSBkIconCels, 43, 37);
|
||||
DrawSpellCel(395, yp, pSBkIconCels, 43, 37);
|
||||
}
|
||||
PrintSBookStr(10, yp - 23, FALSE, spelldata[sn].sNameText, COL_WHITE);
|
||||
switch(GetSBookTrans(sn, FALSE)) {
|
||||
switch (GetSBookTrans(sn, FALSE)) {
|
||||
case RSPLTYPE_SKILL:
|
||||
strcpy(tempstr, "Skill");
|
||||
break;
|
||||
|
|
@ -2425,20 +2413,20 @@ void DrawSpellBook()
|
|||
default:
|
||||
mana = GetManaAmount(myplr, sn) >> 6;
|
||||
GetDamageAmt(sn, &min, &max);
|
||||
if(min != -1) {
|
||||
if (min != -1) {
|
||||
sprintf(tempstr, "Mana: %i Dam: %i - %i", mana, min, max);
|
||||
} else {
|
||||
sprintf(tempstr, "Mana: %i Dam: n/a", mana);
|
||||
}
|
||||
if(sn == SPL_BONESPIRIT) {
|
||||
if (sn == SPL_BONESPIRIT) {
|
||||
sprintf(tempstr, "Mana: %i Dam: 1/3 tgt hp", mana);
|
||||
}
|
||||
PrintSBookStr(10, yp - 1, FALSE, tempstr, COL_WHITE);
|
||||
lvl = plr[myplr]._pSplLvl[sn] + plr[myplr]._pISplLvlAdd;
|
||||
if(lvl < 0) {
|
||||
if (lvl < 0) {
|
||||
lvl = 0;
|
||||
}
|
||||
if(lvl == 0) {
|
||||
if (lvl == 0) {
|
||||
sprintf(tempstr, "Spell Level 0 - Unusable");
|
||||
} else {
|
||||
sprintf(tempstr, "Spell Level %i", lvl);
|
||||
|
|
@ -2450,52 +2438,37 @@ void DrawSpellBook()
|
|||
yp += 43;
|
||||
}
|
||||
}
|
||||
// 4B8950: using guessed type int sbooktab;
|
||||
|
||||
void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col)
|
||||
{
|
||||
char *v5; // ebx
|
||||
signed int v6; // eax
|
||||
int v7; // edi
|
||||
unsigned char v8; // cl
|
||||
char *v9; // esi
|
||||
unsigned char v10; // al
|
||||
int v11; // esi
|
||||
unsigned char v12; // al
|
||||
int width; // [esp+Ch] [ebp-4h]
|
||||
BYTE nCel;
|
||||
char *tmp;
|
||||
int screen_x, line, width;
|
||||
|
||||
v5 = pszStr;
|
||||
width = PitchTbl[y] + x + 440;
|
||||
v6 = 0;
|
||||
v7 = 0;
|
||||
line = 0;
|
||||
if (cjustflag) {
|
||||
v8 = *pszStr;
|
||||
v9 = pszStr;
|
||||
if (!*pszStr)
|
||||
goto LABEL_14;
|
||||
do {
|
||||
++v9;
|
||||
v6 += fontkern[fontframe[gbFontTransTbl[v8]]] + 1;
|
||||
v8 = *v9;
|
||||
} while (*v9);
|
||||
if (v6 < 222)
|
||||
LABEL_14:
|
||||
v7 = (222 - v6) >> 1;
|
||||
width += v7;
|
||||
}
|
||||
while (1) {
|
||||
v12 = *v5;
|
||||
if (!*v5)
|
||||
break;
|
||||
++v5;
|
||||
v10 = fontframe[gbFontTransTbl[v12]];
|
||||
v11 = v10;
|
||||
v7 += fontkern[v10] + 1;
|
||||
if (v10) {
|
||||
if (v7 <= 222)
|
||||
CPrintString(width, v10, col);
|
||||
screen_x = 0;
|
||||
tmp = pszStr;
|
||||
while (*tmp) {
|
||||
nCel = gbFontTransTbl[(BYTE)*tmp];
|
||||
tmp++;
|
||||
screen_x += fontkern[fontframe[nCel]] + 1;
|
||||
}
|
||||
width += fontkern[v11] + 1;
|
||||
if (screen_x < 222)
|
||||
line = (222 - screen_x) >> 1;
|
||||
width += line;
|
||||
}
|
||||
while (*pszStr) {
|
||||
nCel = gbFontTransTbl[(BYTE)*pszStr];
|
||||
pszStr++;
|
||||
nCel = fontframe[nCel];
|
||||
line += fontkern[nCel] + 1;
|
||||
if (nCel) {
|
||||
if (line <= 222)
|
||||
CPrintString(width, nCel, col);
|
||||
}
|
||||
width += fontkern[nCel] + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2505,15 +2478,15 @@ void CheckSBook()
|
|||
char st;
|
||||
unsigned __int64 spl;
|
||||
|
||||
if(MouseX >= 331 && MouseX < 368 && MouseY >= 18 && MouseY < 314) {
|
||||
if (MouseX >= 331 && MouseX < 368 && MouseY >= 18 && MouseY < 314) {
|
||||
spl = plr[myplr]._pMemSpells | plr[myplr]._pISpells | plr[myplr]._pAblSpells;
|
||||
sn = SpellPages[sbooktab][(MouseY - 18) / 43];
|
||||
if(sn != -1 && spl & (__int64)1 << (sn - 1)) {
|
||||
if (sn != -1 && spl & (__int64)1 << (sn - 1)) {
|
||||
st = RSPLTYPE_SPELL;
|
||||
if(plr[myplr]._pISpells & (__int64)1 << (sn - 1)) {
|
||||
if (plr[myplr]._pISpells & (__int64)1 << (sn - 1)) {
|
||||
st = RSPLTYPE_CHARGES;
|
||||
}
|
||||
if(plr[myplr]._pAblSpells & (__int64)1 << (sn - 1)) {
|
||||
if (plr[myplr]._pAblSpells & (__int64)1 << (sn - 1)) {
|
||||
st = RSPLTYPE_SKILL;
|
||||
}
|
||||
plr[myplr]._pRSpell = sn;
|
||||
|
|
@ -2521,16 +2494,14 @@ void CheckSBook()
|
|||
drawpanflag = 255;
|
||||
}
|
||||
}
|
||||
if(MouseX >= 327 && MouseX < 633 && MouseY >= 320 && MouseY < 349) { /// BUGFIX: change `< 633` to `< 631`
|
||||
if (MouseX >= 327 && MouseX < 633 && MouseY >= 320 && MouseY < 349) { /// BUGFIX: change `< 633` to `< 631`
|
||||
sbooktab = (MouseX - 327) / 76;
|
||||
}
|
||||
}
|
||||
// 4B8950: using guessed type int sbooktab;
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
char *get_pieces_str(int nGold)
|
||||
{
|
||||
char *result; // eax
|
||||
char *result;
|
||||
|
||||
result = "piece";
|
||||
if (nGold != 1)
|
||||
|
|
@ -2540,137 +2511,102 @@ char *get_pieces_str(int nGold)
|
|||
|
||||
void DrawGoldSplit(int amount)
|
||||
{
|
||||
int v1; // ebp
|
||||
char *v2; // eax
|
||||
char v3; // cl
|
||||
signed int i; // eax
|
||||
int screen_x; // [esp+10h] [ebp-4h]
|
||||
int screen_xa; // [esp+10h] [ebp-4h]
|
||||
int screen_x, i;
|
||||
|
||||
screen_x = 0;
|
||||
v1 = amount;
|
||||
CelDecodeOnly(415, 338, (BYTE *)pGBoxBuff, 1, 261);
|
||||
CelDecodeOnly(415, 338, pGBoxBuff, 1, 261);
|
||||
sprintf(tempstr, "You have %u gold", initialDropGoldValue);
|
||||
ADD_PlrStringXY(366, 87, 600, tempstr, 3);
|
||||
v2 = get_pieces_str(initialDropGoldValue);
|
||||
sprintf(tempstr, "%s. How many do", v2);
|
||||
sprintf(tempstr, "%s. How many do", get_pieces_str(initialDropGoldValue));
|
||||
ADD_PlrStringXY(366, 103, 600, tempstr, 3);
|
||||
ADD_PlrStringXY(366, 121, 600, "you want to remove?", 3);
|
||||
if (v1 <= 0) {
|
||||
screen_xa = 450;
|
||||
} else {
|
||||
sprintf(tempstr, "%u", v1);
|
||||
if (amount > 0) {
|
||||
sprintf(tempstr, "%u", amount);
|
||||
PrintGameStr(388, 140, tempstr, 0);
|
||||
v3 = tempstr[0];
|
||||
for (i = 0; i < v3; v3 = tempstr[i]) {
|
||||
++i;
|
||||
screen_x += fontkern[fontframe[gbFontTransTbl[(unsigned char)v3]]] + 1;
|
||||
for (i = 0; i < tempstr[i]; i++) {
|
||||
screen_x += fontkern[fontframe[gbFontTransTbl[(BYTE)tempstr[i]]]] + 1;
|
||||
}
|
||||
screen_xa = screen_x + 452;
|
||||
screen_x += 452;
|
||||
} else {
|
||||
screen_x = 450;
|
||||
}
|
||||
CelDecodeOnly(screen_xa, 300, (BYTE *)pCelBuff, nGoldFrame, 12);
|
||||
CelDecodeOnly(screen_x, 300, pCelBuff, nGoldFrame, 12);
|
||||
nGoldFrame = (nGoldFrame & 7) + 1;
|
||||
}
|
||||
|
||||
void control_drop_gold(char vkey)
|
||||
{
|
||||
char v1; // bl
|
||||
int v2; // eax
|
||||
int v3; // eax
|
||||
size_t v4; // esi
|
||||
char v6[6]; // [esp+8h] [ebp-8h]
|
||||
char input[6];
|
||||
|
||||
v1 = vkey;
|
||||
if (plr[myplr]._pHitPoints >> 6 <= 0) {
|
||||
dropGoldFlag = FALSE;
|
||||
dropGoldValue = 0;
|
||||
return;
|
||||
}
|
||||
memset(v6, 0, sizeof(v6));
|
||||
_itoa(dropGoldValue, v6, 10);
|
||||
if (v1 != VK_RETURN) {
|
||||
if (v1 == VK_ESCAPE) {
|
||||
dropGoldFlag = FALSE;
|
||||
dropGoldValue = 0;
|
||||
return;
|
||||
}
|
||||
if (v1 == VK_BACK) {
|
||||
v6[strlen(v6) - 1] = '\0';
|
||||
v2 = atoi(v6);
|
||||
} else {
|
||||
v3 = v1 - '0';
|
||||
if (v3 < 0 || v3 > 9)
|
||||
|
||||
memset(input, 0, sizeof(input));
|
||||
_itoa(dropGoldValue, input, 10);
|
||||
if (vkey == VK_RETURN) {
|
||||
if (dropGoldValue > 0)
|
||||
control_remove_gold(myplr, initialDropGoldIndex);
|
||||
dropGoldFlag = 0;
|
||||
} else if (vkey == VK_ESCAPE) {
|
||||
dropGoldFlag = 0;
|
||||
dropGoldValue = 0;
|
||||
} else if (vkey == VK_BACK) {
|
||||
input[strlen(input) - 1] = '\0';
|
||||
dropGoldValue = atoi(input);
|
||||
} else if (vkey - '0' >= 0 && vkey - '0' <= 9) {
|
||||
if (dropGoldValue || atoi(input) <= initialDropGoldValue) {
|
||||
input[strlen(input)] = vkey;
|
||||
if (atoi(input) > initialDropGoldValue)
|
||||
return;
|
||||
if (dropGoldValue || atoi(v6) <= initialDropGoldValue) {
|
||||
v6[strlen(v6)] = v1;
|
||||
if (atoi(v6) > initialDropGoldValue)
|
||||
return;
|
||||
v4 = strlen(v6);
|
||||
if (v4 > strlen(v6))
|
||||
return;
|
||||
} else {
|
||||
v6[0] = v1;
|
||||
}
|
||||
v2 = atoi(v6);
|
||||
if (strlen(input) > strlen(input))
|
||||
return;
|
||||
} else {
|
||||
input[0] = vkey;
|
||||
}
|
||||
dropGoldValue = v2;
|
||||
return;
|
||||
dropGoldValue = atoi(input);
|
||||
}
|
||||
if (dropGoldValue > 0)
|
||||
control_remove_gold(myplr, initialDropGoldIndex);
|
||||
dropGoldFlag = FALSE;
|
||||
}
|
||||
// 406C40: using guessed type char var_8[8];
|
||||
|
||||
void control_remove_gold(int pnum, int gold_index)
|
||||
{
|
||||
int v2; // edi
|
||||
int v3; // esi
|
||||
int v4; // edx
|
||||
_DWORD *v5; // eax
|
||||
int v6; // edx
|
||||
_DWORD *v7; // eax
|
||||
int v8; // eax
|
||||
int gi;
|
||||
|
||||
v2 = pnum;
|
||||
v3 = pnum;
|
||||
if (gold_index > 46) {
|
||||
v6 = gold_index - 47;
|
||||
v7 = (unsigned int *)((char *)&plr[v3].SpdList[v6]._ivalue);
|
||||
*v7 -= dropGoldValue;
|
||||
if (*v7 <= 0)
|
||||
RemoveSpdBarItem(pnum, v6);
|
||||
gi = gold_index - 47;
|
||||
plr[pnum].SpdList[gi]._ivalue -= dropGoldValue;
|
||||
if (plr[pnum].SpdList[gi]._ivalue > 0)
|
||||
SetSpdbarGoldCurs(pnum, gi);
|
||||
else
|
||||
SetSpdbarGoldCurs(pnum, v6);
|
||||
RemoveSpdBarItem(pnum, gi);
|
||||
} else {
|
||||
v4 = gold_index - 7;
|
||||
v5 = (unsigned int *)((char *)&plr[v3].InvList[v4]._ivalue);
|
||||
*v5 -= dropGoldValue;
|
||||
if (*v5 <= 0)
|
||||
RemoveInvItem(pnum, v4);
|
||||
gi = gold_index - 7;
|
||||
plr[pnum].InvList[gi]._ivalue -= dropGoldValue;
|
||||
if (plr[pnum].InvList[gi]._ivalue > 0)
|
||||
SetGoldCurs(pnum, gi);
|
||||
else
|
||||
SetGoldCurs(pnum, v4);
|
||||
RemoveInvItem(pnum, gi);
|
||||
}
|
||||
SetPlrHandItem(&plr[v3].HoldItem, IDI_GOLD);
|
||||
GetGoldSeed(v2, &plr[v3].HoldItem);
|
||||
plr[v3].HoldItem._ivalue = dropGoldValue;
|
||||
plr[v3].HoldItem._iStatFlag = 1;
|
||||
control_set_gold_curs(v2);
|
||||
v8 = CalculateGold(v2);
|
||||
SetPlrHandItem(&plr[pnum].HoldItem, IDI_GOLD);
|
||||
GetGoldSeed(pnum, &plr[pnum].HoldItem);
|
||||
plr[pnum].HoldItem._ivalue = dropGoldValue;
|
||||
plr[pnum].HoldItem._iStatFlag = 1;
|
||||
control_set_gold_curs(pnum);
|
||||
plr[pnum]._pGold = CalculateGold(pnum);
|
||||
dropGoldValue = 0;
|
||||
plr[v3]._pGold = v8;
|
||||
}
|
||||
|
||||
void control_set_gold_curs(int pnum)
|
||||
{
|
||||
if (plr[pnum].HoldItem._ivalue >= 2500) {
|
||||
if (plr[pnum].HoldItem._ivalue >= 2500)
|
||||
plr[pnum].HoldItem._iCurs = ICURS_GOLD_LARGE;
|
||||
} else {
|
||||
if (plr[pnum].HoldItem._ivalue <= 1000)
|
||||
plr[pnum].HoldItem._iCurs = ICURS_GOLD_SMALL;
|
||||
else
|
||||
plr[pnum].HoldItem._iCurs = ICURS_GOLD_MEDIUM;
|
||||
}
|
||||
else if (plr[pnum].HoldItem._ivalue <= 1000)
|
||||
plr[pnum].HoldItem._iCurs = ICURS_GOLD_SMALL;
|
||||
else
|
||||
plr[pnum].HoldItem._iCurs = ICURS_GOLD_MEDIUM;
|
||||
|
||||
SetCursor_(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM);
|
||||
}
|
||||
|
||||
|
|
@ -2715,7 +2651,7 @@ void DrawTalkPan()
|
|||
} while (v4 < 39);
|
||||
*v3 = 0;
|
||||
LABEL_10:
|
||||
CelDecDatOnly((BYTE *)gpBuffer + a4, (BYTE *)pCelBuff, frame, 12);
|
||||
CelDecDatOnly(gpBuffer + a4, pCelBuff, frame, 12);
|
||||
v5 = 0;
|
||||
a1 = plr[0]._pName;
|
||||
v10 = 0;
|
||||
|
|
@ -2727,7 +2663,7 @@ void DrawTalkPan()
|
|||
if ((INT_PTR)a1 >= (INT_PTR)&plr[4]._pName)
|
||||
return;
|
||||
}
|
||||
if (byte_4B894C[v10]) {
|
||||
if (whisper[v10]) {
|
||||
v6 = 3;
|
||||
if (!talkbtndown[v5]) {
|
||||
LABEL_18:
|
||||
|
|
@ -2743,7 +2679,7 @@ void DrawTalkPan()
|
|||
if (talkbtndown[v5])
|
||||
v7 = (v5 != 0) + 5;
|
||||
}
|
||||
CelDecodeOnly(236, 18 * v5 + 596, (BYTE *)pTalkBtns, v7, 61);
|
||||
CelDecodeOnly(236, 18 * v5 + 596, pTalkBtns, v7, 61);
|
||||
goto LABEL_18;
|
||||
}
|
||||
}
|
||||
|
|
@ -2785,71 +2721,63 @@ char *control_print_talk_msg(char *msg, int x, int y, int *a4, int just)
|
|||
return v6;
|
||||
}
|
||||
|
||||
int control_check_talk_btn()
|
||||
BOOL control_check_talk_btn()
|
||||
{
|
||||
int v0; // ecx
|
||||
int result; // eax
|
||||
int i;
|
||||
|
||||
if (!talkflag)
|
||||
return 0;
|
||||
return FALSE;
|
||||
|
||||
if (MouseX < 172)
|
||||
return 0;
|
||||
v0 = MouseY;
|
||||
if (MouseY < 421 || MouseX > 233)
|
||||
return 0;
|
||||
result = 0;
|
||||
if (MouseY <= 475) {
|
||||
talkbtndown[0] = FALSE;
|
||||
talkbtndown[1] = FALSE;
|
||||
talkbtndown[2] = FALSE;
|
||||
talkbtndown[(v0 - 421) / 18] = TRUE;
|
||||
result = 1;
|
||||
return FALSE;
|
||||
if (MouseY < 421)
|
||||
return FALSE;
|
||||
if (MouseX > 233)
|
||||
return FALSE;
|
||||
if (MouseY > 475)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < sizeof(talkbtndown) / sizeof(talkbtndown[0]); i++) {
|
||||
talkbtndown[i] = FALSE;
|
||||
}
|
||||
return result;
|
||||
|
||||
talkbtndown[(MouseY - 421) / 18] = TRUE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
// 4B8960: using guessed type int talkflag;
|
||||
|
||||
void control_release_talk_btn()
|
||||
{
|
||||
signed int v0; // ecx
|
||||
int v1; // eax
|
||||
signed int v2; // ecx
|
||||
int i, p, off;
|
||||
|
||||
if (talkflag) {
|
||||
v0 = MouseX;
|
||||
talkbtndown[0] = FALSE;
|
||||
talkbtndown[1] = FALSE;
|
||||
talkbtndown[2] = FALSE;
|
||||
if (v0 >= 172 && MouseY >= 421 && v0 <= 233 && MouseY <= 475) {
|
||||
v1 = (MouseY - 421) / 18;
|
||||
v2 = 0;
|
||||
do {
|
||||
if (v1 == -1)
|
||||
break;
|
||||
if (v2 != myplr)
|
||||
--v1;
|
||||
++v2;
|
||||
} while (v2 < 4);
|
||||
if (v2 <= 4)
|
||||
byte_4B894C[v2 - 1] = byte_4B894C[v2 - 1] == 0;
|
||||
for (i = 0; i < sizeof(talkbtndown) / sizeof(talkbtndown[0]); i++)
|
||||
talkbtndown[i] = FALSE;
|
||||
if (MouseX >= 172 && MouseY >= 421 && MouseX <= 233 && MouseY <= 475) {
|
||||
off = (MouseY - 421) / 18;
|
||||
|
||||
for (p = 0; p < MAX_PLRS && off != -1; p++) {
|
||||
if (p != myplr)
|
||||
off--;
|
||||
}
|
||||
if (p <= MAX_PLRS)
|
||||
whisper[p - 1] = !whisper[p - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
// 4B8960: using guessed type int talkflag;
|
||||
|
||||
void control_reset_talk_msg()
|
||||
{
|
||||
signed int v1; // ecx
|
||||
int i, pmask;
|
||||
pmask = 0;
|
||||
|
||||
for (i = 0; i < MAX_PLRS; i++) {
|
||||
if (whisper[i])
|
||||
pmask |= 1 << i;
|
||||
}
|
||||
|
||||
BOOL v0 = FALSE;
|
||||
v1 = 0;
|
||||
do {
|
||||
if (byte_4B894C[v1])
|
||||
v0 |= 1 << v1;
|
||||
++v1;
|
||||
} while (v1 < 4);
|
||||
if (!msgcmd_add_server_cmd_W(sgszTalkMsg))
|
||||
NetSendCmdString(v0, sgszTalkMsg);
|
||||
NetSendCmdString(pmask, sgszTalkMsg);
|
||||
}
|
||||
|
||||
void control_type_message()
|
||||
|
|
@ -2866,12 +2794,6 @@ void control_type_message()
|
|||
sgbTalkSavePos = sgbNextTalkSave;
|
||||
}
|
||||
}
|
||||
// 4B84CC: using guessed type char sgbNextTalkSave;
|
||||
// 4B84CD: using guessed type char sgbTalkSavePos;
|
||||
// 4B8840: using guessed type int sgbPlrTalkTbl;
|
||||
// 4B8960: using guessed type int talkflag;
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void control_reset_talk()
|
||||
{
|
||||
|
|
@ -2879,9 +2801,6 @@ void control_reset_talk()
|
|||
sgbPlrTalkTbl = 0;
|
||||
drawpanflag = 255;
|
||||
}
|
||||
// 4B8840: using guessed type int sgbPlrTalkTbl;
|
||||
// 4B8960: using guessed type int talkflag;
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
BOOL control_talk_last_key(int vkey)
|
||||
{
|
||||
|
|
@ -2979,23 +2898,21 @@ void control_press_enter()
|
|||
// 4B84CC: using guessed type char sgbNextTalkSave;
|
||||
// 4B84CD: using guessed type char sgbTalkSavePos;
|
||||
|
||||
void control_up_down(char a1)
|
||||
void control_up_down(int v)
|
||||
{
|
||||
unsigned char v1; // al
|
||||
int v2; // esi
|
||||
int i;
|
||||
|
||||
v1 = sgbTalkSavePos;
|
||||
v2 = 0;
|
||||
i = 0;
|
||||
while (1) {
|
||||
v1 = (a1 + v1) & 7;
|
||||
sgbTalkSavePos = v1;
|
||||
if (sgszTalkSave[v1][0])
|
||||
sgbTalkSavePos = (v + sgbTalkSavePos) & 7;
|
||||
if (sgszTalkSave[sgbTalkSavePos][0])
|
||||
break;
|
||||
if (++v2 >= 8)
|
||||
i++;
|
||||
if (i >= 8) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
strcpy(sgszTalkMsg, sgszTalkSave[v1]);
|
||||
strcpy(sgszTalkMsg, sgszTalkSave[sgbTalkSavePos]);
|
||||
}
|
||||
// 4B84CD: using guessed type char sgbTalkSavePos;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
#ifndef __CONTROL_H__
|
||||
#define __CONTROL_H__
|
||||
|
||||
extern void *pDurIcons;
|
||||
extern void *pChrButtons;
|
||||
extern BOOL drawhpflag; // idb
|
||||
extern BYTE *pDurIcons;
|
||||
extern BYTE *pChrButtons;
|
||||
extern BOOL drawhpflag; // idb
|
||||
extern BOOL dropGoldFlag;
|
||||
extern int panbtn[8];
|
||||
extern int chrbtn[4];
|
||||
extern void *pMultiBtns;
|
||||
extern void *pPanelButtons;
|
||||
extern void *pChrPanel;
|
||||
extern BYTE *pMultiBtns;
|
||||
extern BYTE *pPanelButtons;
|
||||
extern BYTE *pChrPanel;
|
||||
extern int lvlbtndown; // weak
|
||||
extern int dropGoldValue; // idb
|
||||
extern BOOL drawmanaflag; // idb
|
||||
|
|
@ -19,7 +19,7 @@ extern BYTE *pPanelText;
|
|||
extern int nGoldFrame;
|
||||
extern BYTE *pLifeBuff;
|
||||
extern BYTE *pBtmBuff;
|
||||
extern void *pTalkBtns;
|
||||
extern BYTE *pTalkBtns;
|
||||
extern int pstrjust[4];
|
||||
extern int pnumlines; // idb
|
||||
extern BOOL pinfoflag;
|
||||
|
|
@ -27,31 +27,31 @@ extern BOOL talkbtndown[3];
|
|||
extern int pSpell; // weak
|
||||
extern BYTE *pManaBuff;
|
||||
extern char infoclr; // weak
|
||||
extern void *pGBoxBuff;
|
||||
extern void *pSBkBtnCel;
|
||||
extern BYTE *pGBoxBuff;
|
||||
extern BYTE *pSBkBtnCel;
|
||||
extern char tempstr[256];
|
||||
extern char byte_4B894C[4];
|
||||
extern BOOLEAN whisper[MAX_PLRS];
|
||||
extern int sbooktab; // weak
|
||||
extern int pSplType; // weak
|
||||
extern int frame; // idb
|
||||
extern int initialDropGoldIndex; // idb
|
||||
extern int talkflag; // weak
|
||||
extern void *pSBkIconCels;
|
||||
extern BYTE *pSBkIconCels;
|
||||
extern int sbookflag; // weak
|
||||
extern int chrflag;
|
||||
extern BOOL drawbtnflag;
|
||||
extern void *pSpellBkCel;
|
||||
extern BYTE *pSpellBkCel;
|
||||
extern char infostr[MAX_PATH];
|
||||
extern int numpanbtns; // weak
|
||||
extern void *pStatusPanel;
|
||||
extern BYTE *pStatusPanel;
|
||||
extern char panelstr[256];
|
||||
extern int panelflag; // weak
|
||||
extern unsigned char SplTransTbl[256];
|
||||
extern int initialDropGoldValue; // idb
|
||||
extern void *pSpellCels;
|
||||
extern BYTE *pSpellCels;
|
||||
extern BOOL panbtndown;
|
||||
extern void *pTalkPanel; // idb
|
||||
extern int spselflag; // weak
|
||||
extern BYTE *pTalkPanel;
|
||||
extern int spselflag; // weak
|
||||
|
||||
void DrawSpellCel(int xp, int yp, BYTE *Trans, int nCel, int w);
|
||||
void SetSpellTrans(char t);
|
||||
|
|
@ -109,7 +109,7 @@ void control_remove_gold(int pnum, int gold_index);
|
|||
void control_set_gold_curs(int pnum);
|
||||
void DrawTalkPan();
|
||||
char *control_print_talk_msg(char *msg, int x, int y, int *a4, int just);
|
||||
int control_check_talk_btn();
|
||||
BOOL control_check_talk_btn();
|
||||
void control_release_talk_btn();
|
||||
void control_reset_talk_msg();
|
||||
void control_type_message();
|
||||
|
|
@ -117,7 +117,7 @@ void control_reset_talk();
|
|||
BOOL control_talk_last_key(int vkey);
|
||||
int control_presskeys(int a1);
|
||||
void control_press_enter();
|
||||
void control_up_down(char a1);
|
||||
void control_up_down(int v);
|
||||
|
||||
/* rdata */
|
||||
extern const unsigned char fontframe[128];
|
||||
|
|
|
|||
|
|
@ -88,8 +88,6 @@ void SetICursor(int i)
|
|||
icursW28 = icursW / 28;
|
||||
icursH28 = icursH / 28;
|
||||
}
|
||||
// 4B8CB4: using guessed type int icursH;
|
||||
// 4B8CBC: using guessed type int icursW;
|
||||
|
||||
void SetCursor_(int i)
|
||||
{
|
||||
|
|
@ -98,7 +96,6 @@ void SetCursor_(int i)
|
|||
cursH = InvItemHeight[i];
|
||||
SetICursor(i);
|
||||
}
|
||||
// 4B8C9C: using guessed type int cursH;
|
||||
|
||||
void NewCursor(int i)
|
||||
{
|
||||
|
|
@ -117,10 +114,6 @@ void InitLevelCursor()
|
|||
pcursplr = -1;
|
||||
ClearCursor();
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 4B8CC1: using guessed type char pcursobj;
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
// 4B8CCC: using guessed type int pcurstemp;
|
||||
|
||||
void CheckTown()
|
||||
{
|
||||
|
|
@ -176,7 +169,6 @@ void CheckRportal()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void CheckCursMove()
|
||||
{
|
||||
|
|
@ -604,15 +596,5 @@ void CheckCursMove()
|
|||
pcursmonst = -1;
|
||||
}
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 4B8B84: using guessed type int panelflag;
|
||||
// 4B8C98: using guessed type int spselflag;
|
||||
// 4B8CB8: using guessed type char pcursinvitem;
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 4B8CC1: using guessed type char pcursobj;
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
// 4B8CCC: using guessed type int pcurstemp;
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
// 52575C: using guessed type int doomflag;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ void LoadDebugGFX()
|
|||
if (visiondebug)
|
||||
pSquareCel = LoadFileInMem("Data\\Square.CEL", 0);
|
||||
}
|
||||
// 525720: using guessed type int visiondebug;
|
||||
|
||||
void FreeDebugGFX()
|
||||
{
|
||||
|
|
@ -20,8 +19,7 @@ void FreeDebugGFX()
|
|||
|
||||
void CheckDungeonClear()
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int i, j;
|
||||
|
||||
for (j = 0; j < MAXDUNY; j++) {
|
||||
for (i = 0; i < MAXDUNX; i++) {
|
||||
|
|
@ -39,8 +37,7 @@ void CheckDungeonClear()
|
|||
#ifdef _DEBUG
|
||||
void GiveGoldCheat()
|
||||
{
|
||||
int i; // esi
|
||||
int ni; // ebp
|
||||
int i, ni;
|
||||
|
||||
for (i = 0; i < 40; i++) {
|
||||
if (!plr[myplr].InvGrid[i]) {
|
||||
|
|
@ -57,7 +54,7 @@ void GiveGoldCheat()
|
|||
|
||||
void StoresCheat()
|
||||
{
|
||||
int i; // eax
|
||||
int i;
|
||||
|
||||
numpremium = 0;
|
||||
|
||||
|
|
@ -74,8 +71,8 @@ void StoresCheat()
|
|||
|
||||
void TakeGoldCheat()
|
||||
{
|
||||
int i; // esi
|
||||
char ig; // cl
|
||||
int i;
|
||||
char ig;
|
||||
|
||||
for (i = 0; i < 40; i++) {
|
||||
ig = plr[myplr].InvGrid[i];
|
||||
|
|
@ -135,9 +132,9 @@ void SetAllSpellsCheat()
|
|||
SetSpellLevelCheat(SPL_BONESPIRIT, 1);
|
||||
}
|
||||
|
||||
void PrintDebugPlayer(BOOLEAN bNextPlayer)
|
||||
void PrintDebugPlayer(BOOL bNextPlayer)
|
||||
{
|
||||
char dstr[128]; // [esp+Ch] [ebp-80h]
|
||||
char dstr[128];
|
||||
|
||||
if (bNextPlayer)
|
||||
dbgplr = ((_BYTE)dbgplr + 1) & 3;
|
||||
|
|
@ -161,19 +158,21 @@ void PrintDebugPlayer(BOOLEAN bNextPlayer)
|
|||
|
||||
void PrintDebugQuest()
|
||||
{
|
||||
char dstr[128]; // [esp+0h] [ebp-80h]
|
||||
char dstr[128];
|
||||
|
||||
sprintf(dstr, "Quest %i : Active = %i, Var1 = %i", dbgqst, quests[dbgqst]._qactive, quests[dbgqst]._qvar1);
|
||||
NetSendCmdString(1 << myplr, dstr);
|
||||
if (++dbgqst == MAXQUESTS)
|
||||
|
||||
dbgqst++;
|
||||
if (dbgqst == MAXQUESTS)
|
||||
dbgqst = 0;
|
||||
}
|
||||
|
||||
void PrintDebugMonster(int m)
|
||||
{
|
||||
BOOLEAN bActive; // ecx
|
||||
int i; // eax
|
||||
char dstr[128]; // [esp+Ch] [ebp-80h]
|
||||
BOOL bActive;
|
||||
int i;
|
||||
char dstr[128];
|
||||
|
||||
sprintf(dstr, "Monster %i = %s", m, monster[m].mName);
|
||||
NetSendCmdString(1 << myplr, dstr);
|
||||
|
|
@ -197,26 +196,25 @@ void PrintDebugMonster(int m)
|
|||
|
||||
void GetDebugMonster()
|
||||
{
|
||||
int v0; // ecx
|
||||
int v1; // eax
|
||||
int mi1, mi2;
|
||||
|
||||
v0 = pcursmonst;
|
||||
if (pcursmonst == -1) {
|
||||
v1 = dMonster[cursmx][cursmy];
|
||||
if (v1) {
|
||||
v0 = v1 - 1;
|
||||
if (v1 <= 0)
|
||||
v0 = -1 - v1;
|
||||
mi1 = pcursmonst;
|
||||
if (mi1 == -1) {
|
||||
mi2 = dMonster[cursmx][cursmy];
|
||||
if (mi2) {
|
||||
mi1 = mi2 - 1;
|
||||
if (mi2 <= 0)
|
||||
mi1 = -1 - mi2;
|
||||
} else {
|
||||
v0 = dbgmon;
|
||||
mi1 = dbgmon;
|
||||
}
|
||||
}
|
||||
PrintDebugMonster(v0);
|
||||
PrintDebugMonster(mi1);
|
||||
}
|
||||
|
||||
void NextDebugMonster()
|
||||
{
|
||||
char dstr[128]; // [esp+0h] [ebp-80h]
|
||||
char dstr[128];
|
||||
|
||||
if (dbgmon++ == MAXMONSTERS)
|
||||
dbgmon = 0;
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@ extern char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY];
|
|||
void LoadDebugGFX();
|
||||
void FreeDebugGFX();
|
||||
void CheckDungeonClear();
|
||||
//#ifdef _DEBUG // SpawnHealer is only bin exact with the following defined
|
||||
#ifdef _DEBUG
|
||||
void GiveGoldCheat();
|
||||
void StoresCheat();
|
||||
void TakeGoldCheat();
|
||||
void MaxSpellsCheat();
|
||||
void SetSpellLevelCheat(char spl, int spllvl);
|
||||
void SetAllSpellsCheat();
|
||||
void PrintDebugPlayer(BOOLEAN bNextPlayer);
|
||||
void PrintDebugPlayer(BOOL bNextPlayer);
|
||||
void PrintDebugQuest();
|
||||
void PrintDebugMonster(int m);
|
||||
void GetDebugMonster();
|
||||
void NextDebugMonster();
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
#endif /* __DEBUG_H__ */
|
||||
|
|
|
|||
|
|
@ -509,80 +509,87 @@ BOOL diablo_find_window(LPCSTR lpClassName)
|
|||
return 1;
|
||||
}
|
||||
|
||||
void diablo_reload_process(HMODULE hModule)
|
||||
void diablo_reload_process(HINSTANCE hInstance)
|
||||
{
|
||||
char *i; // eax
|
||||
DWORD dwSize; // esi
|
||||
BOOL v3; // edi
|
||||
_DWORD *v4; // eax
|
||||
_DWORD *v5; // esi
|
||||
HWND v6; // eax
|
||||
char Name[276]; // [esp+Ch] [ebp-29Ch]
|
||||
char Filename[MAX_PATH]; // [esp+120h] [ebp-188h]
|
||||
STARTUPINFOA si; // [esp+224h] [ebp-84h]
|
||||
SYSTEM_INFO sinf; // [esp+268h] [ebp-40h]
|
||||
PROCESS_INFORMATION pi; // [esp+28Ch] [ebp-1Ch]
|
||||
DWORD dwProcessId; // [esp+29Ch] [ebp-Ch]
|
||||
HANDLE hMap; // [esp+2A0h] [ebp-8h]
|
||||
HWND hWnd; // [esp+2A4h] [ebp-4h]
|
||||
DWORD dwSize, dwProcessId;
|
||||
BOOL bNoExist;
|
||||
char *s;
|
||||
long *plMap;
|
||||
HWND hWnd, hPrev;
|
||||
HANDLE hMap;
|
||||
STARTUPINFO si;
|
||||
SYSTEM_INFO sinf;
|
||||
PROCESS_INFORMATION pi;
|
||||
char szReload[MAX_PATH + 16];
|
||||
char szFileName[MAX_PATH] = "";
|
||||
|
||||
//*Filename = empty_string;
|
||||
memset(Filename, 0, sizeof(Filename));
|
||||
// *(_WORD *)&Filename[257] = 0;
|
||||
// Filename[259] = 0;
|
||||
GetModuleFileName(hModule, Filename, sizeof(Filename));
|
||||
wsprintf(Name, "Reload-%s", Filename);
|
||||
for (i = Name; *i; ++i) {
|
||||
if (*i == '\\')
|
||||
*i = '/';
|
||||
GetModuleFileName(hInstance, szFileName, sizeof(szFileName));
|
||||
wsprintf(szReload, "Reload-%s", szFileName);
|
||||
for(s = szReload; *s != '\0'; s++) {
|
||||
if(*s == '\\') {
|
||||
*s = '/';
|
||||
}
|
||||
}
|
||||
|
||||
GetSystemInfo(&sinf);
|
||||
dwSize = sinf.dwPageSize;
|
||||
if (sinf.dwPageSize < 4096)
|
||||
if(dwSize < 4096) {
|
||||
dwSize = 4096;
|
||||
hMap = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, SEC_COMMIT | PAGE_READWRITE, 0, dwSize, Name);
|
||||
v3 = GetLastError() != ERROR_ALREADY_EXISTS;
|
||||
if (hMap) {
|
||||
v4 = (unsigned int *)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, dwSize);
|
||||
v5 = v4;
|
||||
if (v4) {
|
||||
if (v3) {
|
||||
*v4 = -1;
|
||||
v4[1] = 0;
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
CreateProcess(Filename, NULL, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP, NULL, NULL, &si, &pi);
|
||||
WaitForInputIdle(pi.hProcess, 0xFFFFFFFF);
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
while (*v5 < 0)
|
||||
Sleep(1000);
|
||||
UnmapViewOfFile(v5);
|
||||
CloseHandle(hMap);
|
||||
ExitProcess(0);
|
||||
}
|
||||
if (InterlockedIncrement((LPLONG)v4)) {
|
||||
v6 = GetForegroundWindow();
|
||||
do {
|
||||
hWnd = v6;
|
||||
v6 = GetWindow(v6, 3u);
|
||||
} while (v6);
|
||||
while (1) {
|
||||
GetWindowThreadProcessId(hWnd, &dwProcessId);
|
||||
if (dwProcessId == v5[1])
|
||||
break;
|
||||
hWnd = GetWindow(hWnd, 2u);
|
||||
if (!hWnd)
|
||||
goto LABEL_23;
|
||||
}
|
||||
SetForegroundWindow(hWnd);
|
||||
LABEL_23:
|
||||
UnmapViewOfFile(v5);
|
||||
CloseHandle(hMap);
|
||||
ExitProcess(0);
|
||||
}
|
||||
v5[1] = GetCurrentProcessId();
|
||||
}
|
||||
|
||||
hMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, SEC_COMMIT | PAGE_READWRITE, 0, dwSize, szReload);
|
||||
bNoExist = GetLastError() != ERROR_ALREADY_EXISTS;
|
||||
if(hMap == NULL) {
|
||||
return;
|
||||
}
|
||||
plMap = (long *)MapViewOfFile(hMap, FILE_MAP_ALL_ACCESS, 0, 0, dwSize);
|
||||
if(plMap == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(bNoExist) {
|
||||
plMap[0] = -1;
|
||||
plMap[1] = 0;
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
CreateProcess(szFileName, NULL, NULL, NULL, FALSE, CREATE_NEW_PROCESS_GROUP, NULL, NULL, &si, &pi);
|
||||
WaitForInputIdle(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
while(plMap[0] < 0) {
|
||||
Sleep(1000);
|
||||
}
|
||||
UnmapViewOfFile(plMap);
|
||||
CloseHandle(hMap);
|
||||
ExitProcess(0);
|
||||
}
|
||||
|
||||
if(InterlockedIncrement(plMap) == 0) {
|
||||
plMap[1] = GetCurrentProcessId();
|
||||
} else {
|
||||
hPrev = GetForegroundWindow();
|
||||
hWnd = hPrev;
|
||||
while(1) {
|
||||
hPrev = GetWindow(hPrev, GW_HWNDPREV);
|
||||
if(hPrev == NULL) {
|
||||
break;
|
||||
}
|
||||
hWnd = hPrev;
|
||||
}
|
||||
while(1) {
|
||||
GetWindowThreadProcessId(hWnd, &dwProcessId);
|
||||
if(dwProcessId == plMap[1]) {
|
||||
SetForegroundWindow(hWnd);
|
||||
break;
|
||||
}
|
||||
hWnd = GetWindow(hWnd, GW_HWNDNEXT);
|
||||
if(hWnd == NULL) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
UnmapViewOfFile(plMap);
|
||||
CloseHandle(hMap);
|
||||
ExitProcess(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1492,10 +1499,10 @@ void PressChar(int vkey)
|
|||
}
|
||||
break;
|
||||
case 'D':
|
||||
PrintDebugPlayer(1);
|
||||
PrintDebugPlayer(TRUE);
|
||||
break;
|
||||
case 'd':
|
||||
PrintDebugPlayer(0);
|
||||
PrintDebugPlayer(FALSE);
|
||||
break;
|
||||
case 'e':
|
||||
if(debug_mode_key_d) {
|
||||
|
|
@ -1608,7 +1615,7 @@ void LoadAllGFX()
|
|||
|
||||
void CreateLevel(int lvldir)
|
||||
{
|
||||
switch((unsigned char)leveltype) {
|
||||
switch(leveltype) {
|
||||
case DTYPE_TOWN:
|
||||
CreateTown(lvldir);
|
||||
InitTownTriggers();
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
|
|||
void diablo_parse_flags(char *args);
|
||||
void diablo_init_screen();
|
||||
BOOL diablo_find_window(LPCSTR lpClassName);
|
||||
void diablo_reload_process(HMODULE hModule);
|
||||
void diablo_reload_process(HINSTANCE hInstance);
|
||||
BOOL PressEscKey();
|
||||
LRESULT CALLBACK DisableInputWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
|
@ -156,7 +156,7 @@ extern int diablo_inf; // weak
|
|||
/* rdata */
|
||||
|
||||
extern BOOL fullscreen;
|
||||
//#ifdef _DEBUG // SpawnHealer is only bin exact with the following defined
|
||||
#ifdef _DEBUG
|
||||
extern int showintrodebug;
|
||||
extern int questdebug;
|
||||
extern int debug_mode_key_s;
|
||||
|
|
@ -173,7 +173,7 @@ extern int frameflag;
|
|||
extern int frameend;
|
||||
extern int framerate;
|
||||
extern int framestart;
|
||||
//#endif
|
||||
#endif
|
||||
extern BOOL FriendlyMode;
|
||||
extern char *spszMsgTbl[4]; // weak
|
||||
extern char *spszMsgKeyTbl[4]; // weak
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
char L5dungeon[80][80];
|
||||
unsigned char L5dflags[DMAXX][DMAXY];
|
||||
int setloadflag; // weak
|
||||
BYTE L5dflags[DMAXX][DMAXY];
|
||||
BOOL setloadflag;
|
||||
int HR1;
|
||||
int HR2;
|
||||
int HR3;
|
||||
int VR1;
|
||||
int VR2;
|
||||
int VR3;
|
||||
void *pSetPiece; // idb
|
||||
BYTE *pSetPiece;
|
||||
|
||||
const ShadowStruct SPATS[37] = {
|
||||
// clang-format off
|
||||
|
|
@ -55,7 +55,7 @@ const ShadowStruct SPATS[37] = {
|
|||
{ 3, 13, 11, 12, 150, 0, 0 }
|
||||
// clang-format on
|
||||
};
|
||||
const unsigned char BSTYPES[206] = {
|
||||
const BYTE BSTYPES[206] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 0, 0,
|
||||
0, 0, 0, 0, 0, 1, 2, 10, 4, 5,
|
||||
|
|
@ -78,7 +78,7 @@ const unsigned char BSTYPES[206] = {
|
|||
28, 1, 2, 25, 26, 22, 22, 25, 26, 0,
|
||||
0, 0, 0, 0, 0, 0
|
||||
};
|
||||
const unsigned char L5BTYPES[206] = {
|
||||
const BYTE L5BTYPES[206] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
10, 11, 12, 13, 14, 15, 16, 17, 0, 0,
|
||||
0, 0, 0, 0, 0, 25, 26, 0, 28, 0,
|
||||
|
|
@ -101,14 +101,14 @@ const unsigned char L5BTYPES[206] = {
|
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0
|
||||
};
|
||||
const unsigned char STAIRSUP[] = { 4, 4, 13, 13, 13, 13, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 0, 66, 6, 0, 63, 64, 65, 0, 0, 67, 68, 0, 0, 0, 0, 0 };
|
||||
const unsigned char L5STAIRSUP[] = { 4, 4, 22, 22, 22, 22, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 0, 66, 23, 0, 63, 64, 65, 0, 0, 67, 68, 0, 0, 0, 0, 0 };
|
||||
const unsigned char STAIRSDOWN[] = { 4, 3, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 62, 57, 58, 0, 61, 59, 60, 0, 0, 0, 0, 0 };
|
||||
const unsigned char LAMPS[] = { 2, 2, 13, 0, 13, 13, 129, 0, 130, 128 };
|
||||
const unsigned char PWATERIN[] = { 6, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, 202, 200, 200, 84, 0, 0, 199, 203, 203, 83, 0, 0, 85, 206, 80, 81, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
const BYTE STAIRSUP[] = { 4, 4, 13, 13, 13, 13, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 0, 66, 6, 0, 63, 64, 65, 0, 0, 67, 68, 0, 0, 0, 0, 0 };
|
||||
const BYTE L5STAIRSUP[] = { 4, 4, 22, 22, 22, 22, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, 0, 66, 23, 0, 63, 64, 65, 0, 0, 67, 68, 0, 0, 0, 0, 0 };
|
||||
const BYTE STAIRSDOWN[] = { 4, 3, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 62, 57, 58, 0, 61, 59, 60, 0, 0, 0, 0, 0 };
|
||||
const BYTE LAMPS[] = { 2, 2, 13, 0, 13, 13, 129, 0, 130, 128 };
|
||||
const BYTE PWATERIN[] = { 6, 6, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, 202, 200, 200, 84, 0, 0, 199, 203, 203, 83, 0, 0, 85, 206, 80, 81, 0, 0, 0, 134, 135, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/* data */
|
||||
unsigned char L5ConvTbl[16] = { 22u, 13u, 1u, 13u, 2u, 13u, 13u, 13u, 4u, 13u, 1u, 13u, 2u, 13u, 16u, 13u };
|
||||
BYTE L5ConvTbl[16] = { 22u, 13u, 1u, 13u, 2u, 13u, 13u, 13u, 4u, 13u, 1u, 13u, 2u, 13u, 16u, 13u };
|
||||
|
||||
void DRLG_Init_Globals()
|
||||
{
|
||||
|
|
@ -128,8 +128,6 @@ void DRLG_Init_Globals()
|
|||
c = 0;
|
||||
memset(dLight, c, sizeof(dLight));
|
||||
}
|
||||
// 525728: using guessed type int light4flag;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void LoadL1Dungeon(char *sFileName, int vx, int vy)
|
||||
{
|
||||
|
|
@ -179,10 +177,6 @@ void LoadL1Dungeon(char *sFileName, int vx, int vy)
|
|||
SetMapObjects(pLevelMap, 0, 0);
|
||||
mem_free_dbg(pLevelMap);
|
||||
}
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
|
||||
void DRLG_L1Floor()
|
||||
{
|
||||
|
|
@ -251,7 +245,7 @@ void DRLG_L1Pass3()
|
|||
for (j = 0; j < DMAXY; j++) {
|
||||
xx = 16;
|
||||
for (i = 0; i < DMAXX; i++) {
|
||||
lv = (unsigned char)dungeon[i][j] - 1;
|
||||
lv = dungeon[i][j] - 1;
|
||||
/// ASSERT: assert(lv >= 0);
|
||||
#ifdef USE_ASM
|
||||
__asm {
|
||||
|
|
@ -378,10 +372,6 @@ void LoadPreL1Dungeon(char *sFileName, int vx, int vy)
|
|||
|
||||
mem_free_dbg(pLevelMap);
|
||||
}
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
|
||||
void CreateL5Dungeon(int rseed, int entry)
|
||||
{
|
||||
|
|
@ -401,29 +391,23 @@ void CreateL5Dungeon(int rseed, int entry)
|
|||
DRLG_InitL1Vals();
|
||||
DRLG_SetPC();
|
||||
}
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
|
||||
void DRLG_LoadL1SP()
|
||||
{
|
||||
setloadflag = 0;
|
||||
setloadflag = FALSE;
|
||||
if (QuestStatus(QTYPE_BUTCH)) {
|
||||
pSetPiece = LoadFileInMem("Levels\\L1Data\\rnd6.DUN", 0);
|
||||
setloadflag = 1;
|
||||
setloadflag = TRUE;
|
||||
}
|
||||
if (QuestStatus(QTYPE_KING) && gbMaxPlayers == 1) {
|
||||
pSetPiece = LoadFileInMem("Levels\\L1Data\\SKngDO.DUN", 0);
|
||||
setloadflag = 1;
|
||||
setloadflag = TRUE;
|
||||
}
|
||||
if (QuestStatus(QTYPE_BOL)) {
|
||||
pSetPiece = LoadFileInMem("Levels\\L1Data\\Banner2.DUN", 0);
|
||||
setloadflag = 1;
|
||||
setloadflag = TRUE;
|
||||
}
|
||||
}
|
||||
// 5276A4: using guessed type int setloadflag;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void DRLG_FreeL1SP()
|
||||
{
|
||||
|
|
@ -544,9 +528,9 @@ void DRLG_L5(int entry)
|
|||
|
||||
void DRLG_PlaceDoor(int x, int y)
|
||||
{
|
||||
if ((L5dflags[x][y] & 0x80) == 0) { /* todo: unsigned */
|
||||
unsigned char df = L5dflags[x][y] & 0x7F;
|
||||
unsigned char c = dungeon[x][y];
|
||||
if ((L5dflags[x][y] & 0x80) == 0) {
|
||||
BYTE df = L5dflags[x][y] & 0x7F;
|
||||
BYTE c = dungeon[x][y];
|
||||
|
||||
if (df == 1) {
|
||||
if (y != 1 && c == 2)
|
||||
|
|
@ -604,16 +588,16 @@ void DRLG_PlaceDoor(int x, int y)
|
|||
void DRLG_L1Shadows()
|
||||
{
|
||||
int x, y, i;
|
||||
unsigned char sd[2][2];
|
||||
unsigned char tnv3;
|
||||
BYTE sd[2][2];
|
||||
BYTE tnv3;
|
||||
BOOL patflag;
|
||||
|
||||
for (y = 1; y < DMAXY; y++) {
|
||||
for (x = 1; x < DMAXX; x++) {
|
||||
sd[0][0] = BSTYPES[(unsigned char)dungeon[x][y]];
|
||||
sd[1][0] = BSTYPES[(unsigned char)dungeon[x - 1][y]];
|
||||
sd[0][1] = BSTYPES[(unsigned char)dungeon[x][y - 1]];
|
||||
sd[1][1] = BSTYPES[(unsigned char)dungeon[x - 1][y - 1]];
|
||||
sd[0][0] = BSTYPES[dungeon[x][y]];
|
||||
sd[1][0] = BSTYPES[dungeon[x - 1][y]];
|
||||
sd[0][1] = BSTYPES[dungeon[x][y - 1]];
|
||||
sd[1][1] = BSTYPES[dungeon[x - 1][y - 1]];
|
||||
|
||||
for (i = 0; i < 37; i++) {
|
||||
if (SPATS[i].strig == sd[0][0]) {
|
||||
|
|
@ -641,7 +625,7 @@ void DRLG_L1Shadows()
|
|||
|
||||
for (y = 1; y < DMAXY; y++) {
|
||||
for (x = 1; x < DMAXX; x++) {
|
||||
if ((unsigned char)dungeon[x - 1][y] == 139 && !L5dflags[x - 1][y]) {
|
||||
if (dungeon[x - 1][y] == 139 && !L5dflags[x - 1][y]) {
|
||||
tnv3 = 139;
|
||||
if (dungeon[x][y] == 29)
|
||||
tnv3 = 141;
|
||||
|
|
@ -657,7 +641,7 @@ void DRLG_L1Shadows()
|
|||
tnv3 = 141;
|
||||
dungeon[x - 1][y] = tnv3;
|
||||
}
|
||||
if ((unsigned char)dungeon[x - 1][y] == 149 && !L5dflags[x - 1][y]) {
|
||||
if (dungeon[x - 1][y] == 149 && !L5dflags[x - 1][y]) {
|
||||
tnv3 = 149;
|
||||
if (dungeon[x][y] == 29)
|
||||
tnv3 = 153;
|
||||
|
|
@ -673,7 +657,7 @@ void DRLG_L1Shadows()
|
|||
tnv3 = 153;
|
||||
dungeon[x - 1][y] = tnv3;
|
||||
}
|
||||
if ((unsigned char)dungeon[x - 1][y] == 148 && !L5dflags[x - 1][y]) {
|
||||
if (dungeon[x - 1][y] == 148 && !L5dflags[x - 1][y]) {
|
||||
tnv3 = 148;
|
||||
if (dungeon[x][y] == 29)
|
||||
tnv3 = 154;
|
||||
|
|
@ -693,7 +677,7 @@ void DRLG_L1Shadows()
|
|||
}
|
||||
}
|
||||
|
||||
int DRLG_PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int noquad, int ldir)
|
||||
int DRLG_PlaceMiniSet(const BYTE *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int noquad, int ldir)
|
||||
{
|
||||
int xx, yy, sx, sy;
|
||||
int ii, i, t, found;
|
||||
|
|
@ -748,7 +732,7 @@ int DRLG_PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int cx,
|
|||
|
||||
for (yy = 0; yy < sh && abort == TRUE; yy++) {
|
||||
for (xx = 0; xx < sw && abort == TRUE; xx++) {
|
||||
if (miniset[ii] && (unsigned char)dungeon[xx + sx][sy + yy] != miniset[ii])
|
||||
if (miniset[ii] && dungeon[xx + sx][sy + yy] != miniset[ii])
|
||||
abort = FALSE;
|
||||
if (L5dflags[xx + sx][sy + yy])
|
||||
abort = FALSE;
|
||||
|
|
@ -807,9 +791,6 @@ int DRLG_PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int cx,
|
|||
else
|
||||
return 3;
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
// 5CF320: using guessed type int LvlViewY;
|
||||
// 5CF324: using guessed type int LvlViewX;
|
||||
|
||||
void InitL5Dungeon()
|
||||
{
|
||||
|
|
@ -1116,9 +1097,9 @@ int L5HWallOk(int i, int j)
|
|||
}
|
||||
|
||||
wallok = FALSE;
|
||||
if ((unsigned char)dungeon[i + x][j] >= 3 && (unsigned char)dungeon[i + x][j] <= 7) /* todo: unsigned */
|
||||
if (dungeon[i + x][j] >= 3 && dungeon[i + x][j] <= 7)
|
||||
wallok = TRUE;
|
||||
if ((unsigned char)dungeon[i + x][j] >= 16 && (unsigned char)dungeon[i + x][j] <= 24)
|
||||
if (dungeon[i + x][j] >= 16 && dungeon[i + x][j] <= 24)
|
||||
wallok = TRUE;
|
||||
if (dungeon[i + x][j] == 22)
|
||||
wallok = FALSE;
|
||||
|
|
@ -1142,9 +1123,9 @@ int L5VWallOk(int i, int j)
|
|||
}
|
||||
|
||||
wallok = FALSE;
|
||||
if ((unsigned char)dungeon[i][j + y] >= 3 && (unsigned char)dungeon[i][j + y] <= 7) /* todo: unsigned */
|
||||
if (dungeon[i][j + y] >= 3 && dungeon[i][j + y] <= 7)
|
||||
wallok = TRUE;
|
||||
if ((unsigned char)dungeon[i][j + y] >= 16 && (unsigned char)dungeon[i][j + y] <= 24)
|
||||
if (dungeon[i][j + y] >= 16 && dungeon[i][j + y] <= 24)
|
||||
wallok = TRUE;
|
||||
if (dungeon[i][j + y] == 22)
|
||||
wallok = FALSE;
|
||||
|
|
@ -1370,7 +1351,7 @@ void DRLG_L5Subs()
|
|||
for (y = 0; y < DMAXY; y++) {
|
||||
for (x = 0; x < DMAXX; x++) {
|
||||
if (!random(0, 4)) {
|
||||
unsigned char c = L5BTYPES[(unsigned char)dungeon[x][y]]; /* todo: changed to unsigned */
|
||||
BYTE c = L5BTYPES[dungeon[x][y]];
|
||||
|
||||
if (c && !L5dflags[x][y]) {
|
||||
rv = random(0, 16);
|
||||
|
|
@ -1384,13 +1365,13 @@ void DRLG_L5Subs()
|
|||
}
|
||||
|
||||
if (i == 89) {
|
||||
if (L5BTYPES[(unsigned char)dungeon[x][y - 1]] != 79 || L5dflags[x][y - 1])
|
||||
if (L5BTYPES[dungeon[x][y - 1]] != 79 || L5dflags[x][y - 1])
|
||||
i = 79;
|
||||
else
|
||||
dungeon[x][y - 1] = 90;
|
||||
}
|
||||
if (i == 91) {
|
||||
if (L5BTYPES[(unsigned char)dungeon[x + 1][y]] != 80 || L5dflags[x + 1][y])
|
||||
if (L5BTYPES[dungeon[x + 1][y]] != 80 || L5dflags[x + 1][y])
|
||||
i = 80;
|
||||
else
|
||||
dungeon[x + 1][y] = 92;
|
||||
|
|
@ -1511,7 +1492,6 @@ void L5FillChambers()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5276A4: using guessed type int setloadflag;
|
||||
|
||||
void DRLG_L5GChamber(int sx, int sy, BOOL topflag, BOOL bottomflag, BOOL leftflag, BOOL rightflag)
|
||||
{
|
||||
|
|
@ -1591,17 +1571,17 @@ void DRLG_L5GHall(int x1, int y1, int x2, int y2)
|
|||
void DRLG_L5SetRoom(int rx1, int ry1)
|
||||
{
|
||||
int rw, rh, i, j;
|
||||
unsigned char *sp;
|
||||
BYTE *sp;
|
||||
|
||||
rw = *(unsigned char *)pSetPiece; /* todo: BYTE */
|
||||
rh = *((unsigned char *)pSetPiece + 2);
|
||||
rw = *pSetPiece;
|
||||
rh = *(pSetPiece + 2);
|
||||
|
||||
setpc_x = rx1;
|
||||
setpc_y = ry1;
|
||||
setpc_w = rw;
|
||||
setpc_h = rh;
|
||||
|
||||
sp = (unsigned char *)pSetPiece + 4;
|
||||
sp = pSetPiece + 4;
|
||||
|
||||
for (j = 0; j < rh; j++) {
|
||||
for (i = 0; i < rw; i++) {
|
||||
|
|
@ -1615,8 +1595,6 @@ void DRLG_L5SetRoom(int rx1, int ry1)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5CF330: using guessed type int setpc_h;
|
||||
// 5CF334: using guessed type int setpc_w;
|
||||
|
||||
void DRLG_L5FloodTVal()
|
||||
{
|
||||
|
|
@ -1637,7 +1615,6 @@ void DRLG_L5FloodTVal()
|
|||
yy += 2;
|
||||
}
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
|
||||
void DRLG_L5FTVR(int i, int j, int x, int y, int d)
|
||||
{
|
||||
|
|
@ -1681,7 +1658,6 @@ void DRLG_L5FTVR(int i, int j, int x, int y, int d)
|
|||
DRLG_L5FTVR(i + 1, j + 1, x + 2, y + 2, 8);
|
||||
}
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
|
||||
void DRLG_L5TransFix()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
#define __DRLG_L1_H__
|
||||
|
||||
extern char L5dungeon[80][80];
|
||||
extern unsigned char L5dflags[40][40];
|
||||
extern int setloadflag; // weak
|
||||
extern BYTE L5dflags[40][40];
|
||||
extern BOOL setloadflag;
|
||||
extern int HR1;
|
||||
extern int HR2;
|
||||
extern int HR3;
|
||||
extern int VR1;
|
||||
extern int VR2;
|
||||
extern int VR3;
|
||||
extern void *pSetPiece; // idb
|
||||
extern BYTE *pSetPiece;
|
||||
|
||||
void DRLG_Init_Globals();
|
||||
void LoadL1Dungeon(char *sFileName, int vx, int vy);
|
||||
|
|
@ -25,7 +25,7 @@ void DRLG_FreeL1SP();
|
|||
void DRLG_L5(int entry);
|
||||
void DRLG_PlaceDoor(int x, int y);
|
||||
void DRLG_L1Shadows();
|
||||
int DRLG_PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int noquad, int ldir);
|
||||
int DRLG_PlaceMiniSet(const BYTE *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int noquad, int ldir);
|
||||
void InitL5Dungeon();
|
||||
void L5ClearFlags();
|
||||
void L5firstRoom();
|
||||
|
|
@ -54,15 +54,15 @@ void DRLG_L5CornerFix();
|
|||
|
||||
/* rdata */
|
||||
extern const ShadowStruct SPATS[37];
|
||||
extern const unsigned char BSTYPES[206];
|
||||
extern const unsigned char L5BTYPES[206];
|
||||
extern const unsigned char STAIRSUP[];
|
||||
extern const unsigned char L5STAIRSUP[];
|
||||
extern const unsigned char STAIRSDOWN[];
|
||||
extern const unsigned char LAMPS[];
|
||||
extern const unsigned char PWATERIN[];
|
||||
extern const BYTE BSTYPES[206];
|
||||
extern const BYTE L5BTYPES[206];
|
||||
extern const BYTE STAIRSUP[];
|
||||
extern const BYTE L5STAIRSUP[];
|
||||
extern const BYTE STAIRSDOWN[];
|
||||
extern const BYTE LAMPS[];
|
||||
extern const BYTE PWATERIN[];
|
||||
|
||||
/* data */
|
||||
extern unsigned char L5ConvTbl[16];
|
||||
extern BYTE L5ConvTbl[16];
|
||||
|
||||
#endif /* __DRLG_L1_H__ */
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ void DRLG_L2Pass3()
|
|||
for (j = 0; j < DMAXY; j++) {
|
||||
xx = 16;
|
||||
for (i = 0; i < DMAXX; i++) {
|
||||
lv = (unsigned char)dungeon[i][j] - 1;
|
||||
lv = dungeon[i][j] - 1;
|
||||
#ifdef USE_ASM
|
||||
__asm {
|
||||
mov esi, pMegaTiles
|
||||
|
|
|
|||
|
|
@ -2,48 +2,48 @@
|
|||
|
||||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
char lavapool; // weak
|
||||
int abyssx; // weak
|
||||
int lockoutcnt; // weak
|
||||
BOOLEAN lavapool;
|
||||
int abyssx;
|
||||
int lockoutcnt;
|
||||
BOOLEAN lockout[40][40];
|
||||
|
||||
const unsigned char L3ConvTbl[16] = { 8, 11, 3, 10, 1, 9, 12, 12, 6, 13, 4, 13, 2, 14, 5, 7 };
|
||||
const unsigned char L3UP[20] = { 3, 3, 8, 8, 0, 10, 10, 0, 7, 7, 0, 51, 50, 0, 48, 49, 0, 0, 0, 0 };
|
||||
const unsigned char L3DOWN[20] = { 3, 3, 8, 9, 7, 8, 9, 7, 0, 0, 0, 0, 47, 0, 0, 46, 0, 0, 0, 0 };
|
||||
const unsigned char L3HOLDWARP[20] = { 3, 3, 8, 8, 0, 10, 10, 0, 7, 7, 0, 125, 125, 0, 125, 125, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE1[34] = { 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 57, 58, 0, 0, 56, 55, 0, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE2[34] = { 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 61, 62, 0, 0, 60, 59, 0, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE3[34] = { 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 65, 66, 0, 0, 64, 63, 0, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE6[42] = { 5, 4, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 77, 78, 0, 0, 0, 76, 74, 75, 0, 0, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE7[42] = { 4, 5, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 83, 0, 0, 0, 82, 80, 0, 0, 81, 79, 0, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE8[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 52, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE9[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 53, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE10[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 54, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE11[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 67, 0, 0, 0, 0 };
|
||||
const unsigned char L3TITE12[6] = { 2u, 1u, 9u, 7u, 68u, 0u };
|
||||
const unsigned char L3TITE13[6] = { 1u, 2u, 10u, 7u, 69u, 0u };
|
||||
const unsigned char L3CREV1[6] = { 2u, 1u, 8u, 7u, 84u, 85u };
|
||||
const unsigned char L3CREV2[6] = { 2u, 1u, 8u, 11u, 86u, 87u };
|
||||
const unsigned char L3CREV3[6] = { 1u, 2u, 8u, 10u, 89u, 88u };
|
||||
const unsigned char L3CREV4[6] = { 2u, 1u, 8u, 7u, 90u, 91u };
|
||||
const unsigned char L3CREV5[6] = { 1u, 2u, 8u, 11u, 92u, 93u };
|
||||
const unsigned char L3CREV6[6] = { 1u, 2u, 8u, 10u, 95u, 94u };
|
||||
const unsigned char L3CREV7[6] = { 2u, 1u, 8u, 7u, 96u, 101u };
|
||||
const unsigned char L3CREV8[6] = { 1u, 2u, 2u, 8u, 102u, 97u };
|
||||
const unsigned char L3CREV9[6] = { 2u, 1u, 3u, 8u, 103u, 98u };
|
||||
const unsigned char L3CREV10[6] = { 2u, 1u, 4u, 8u, 104u, 99u };
|
||||
const unsigned char L3CREV11[6] = { 1u, 2u, 6u, 8u, 105u, 100u };
|
||||
const unsigned char L3ISLE1[14] = { 2u, 3u, 5u, 14u, 4u, 9u, 13u, 12u, 7u, 7u, 7u, 7u, 7u, 7u };
|
||||
const unsigned char L3ISLE2[14] = { 3u, 2u, 5u, 2u, 14u, 13u, 10u, 12u, 7u, 7u, 7u, 7u, 7u, 7u };
|
||||
const unsigned char L3ISLE3[14] = { 2u, 3u, 5u, 14u, 4u, 9u, 13u, 12u, 29u, 30u, 25u, 28u, 31u, 32u };
|
||||
const unsigned char L3ISLE4[14] = { 3u, 2u, 5u, 2u, 14u, 13u, 10u, 12u, 29u, 26u, 30u, 31u, 27u, 32u };
|
||||
const unsigned char L3ISLE5[10] = { 2u, 2u, 5u, 14u, 13u, 12u, 7u, 7u, 7u, 7u };
|
||||
const unsigned char L3XTRA1[4] = { 1u, 1u, 7u, 106u };
|
||||
const unsigned char L3XTRA2[4] = { 1u, 1u, 7u, 107u };
|
||||
const unsigned char L3XTRA3[4] = { 1u, 1u, 7u, 108u };
|
||||
const unsigned char L3XTRA4[4] = { 1u, 1u, 9u, 109u };
|
||||
const unsigned char L3XTRA5[4] = { 1u, 1u, 10u, 110u };
|
||||
const unsigned char L3ANVIL[244] = {
|
||||
const BYTE L3ConvTbl[16] = { 8, 11, 3, 10, 1, 9, 12, 12, 6, 13, 4, 13, 2, 14, 5, 7 };
|
||||
const BYTE L3UP[20] = { 3, 3, 8, 8, 0, 10, 10, 0, 7, 7, 0, 51, 50, 0, 48, 49, 0, 0, 0, 0 };
|
||||
const BYTE L3DOWN[20] = { 3, 3, 8, 9, 7, 8, 9, 7, 0, 0, 0, 0, 47, 0, 0, 46, 0, 0, 0, 0 };
|
||||
const BYTE L3HOLDWARP[20] = { 3, 3, 8, 8, 0, 10, 10, 0, 7, 7, 0, 125, 125, 0, 125, 125, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE1[34] = { 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 57, 58, 0, 0, 56, 55, 0, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE2[34] = { 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 61, 62, 0, 0, 60, 59, 0, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE3[34] = { 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 65, 66, 0, 0, 64, 63, 0, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE6[42] = { 5, 4, 7, 7, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 0, 77, 78, 0, 0, 0, 76, 74, 75, 0, 0, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE7[42] = { 4, 5, 7, 7, 7, 7, 7, 7, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, 83, 0, 0, 0, 82, 80, 0, 0, 81, 79, 0, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE8[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 52, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE9[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 53, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE10[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 54, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE11[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 67, 0, 0, 0, 0 };
|
||||
const BYTE L3TITE12[6] = { 2, 1, 9, 7, 68, 0 };
|
||||
const BYTE L3TITE13[6] = { 1, 2, 10, 7, 69, 0 };
|
||||
const BYTE L3CREV1[6] = { 2, 1, 8, 7, 84, 85 };
|
||||
const BYTE L3CREV2[6] = { 2, 1, 8, 11, 86, 87 };
|
||||
const BYTE L3CREV3[6] = { 1, 2, 8, 10, 89, 88 };
|
||||
const BYTE L3CREV4[6] = { 2, 1, 8, 7, 90, 91 };
|
||||
const BYTE L3CREV5[6] = { 1, 2, 8, 11, 92, 93 };
|
||||
const BYTE L3CREV6[6] = { 1, 2, 8, 10, 95, 94 };
|
||||
const BYTE L3CREV7[6] = { 2, 1, 8, 7, 96, 101 };
|
||||
const BYTE L3CREV8[6] = { 1, 2, 2, 8, 102, 97 };
|
||||
const BYTE L3CREV9[6] = { 2, 1, 3, 8, 103, 98 };
|
||||
const BYTE L3CREV10[6] = { 2, 1, 4, 8, 104, 99 };
|
||||
const BYTE L3CREV11[6] = { 1, 2, 6, 8, 105, 100 };
|
||||
const BYTE L3ISLE1[14] = { 2, 3, 5, 14, 4, 9, 13, 12, 7, 7, 7, 7, 7, 7 };
|
||||
const BYTE L3ISLE2[14] = { 3, 2, 5, 2, 14, 13, 10, 12, 7, 7, 7, 7, 7, 7 };
|
||||
const BYTE L3ISLE3[14] = { 2, 3, 5, 14, 4, 9, 13, 12, 29, 30, 25, 28, 31, 32 };
|
||||
const BYTE L3ISLE4[14] = { 3, 2, 5, 2, 14, 13, 10, 12, 29, 26, 30, 31, 27, 32 };
|
||||
const BYTE L3ISLE5[10] = { 2, 2, 5, 14, 13, 12, 7, 7, 7, 7 };
|
||||
const BYTE L3XTRA1[4] = { 1, 1, 7, 106 };
|
||||
const BYTE L3XTRA2[4] = { 1, 1, 7, 107 };
|
||||
const BYTE L3XTRA3[4] = { 1, 1, 7, 108 };
|
||||
const BYTE L3XTRA4[4] = { 1, 1, 9, 109 };
|
||||
const BYTE L3XTRA5[4] = { 1, 1, 10, 110 };
|
||||
const BYTE L3ANVIL[244] = {
|
||||
11, 11, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
|
||||
|
|
@ -203,8 +203,6 @@ BOOL DRLG_L3Anvil()
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
// 5CF330: using guessed type int setpc_h;
|
||||
// 5CF334: using guessed type int setpc_w;
|
||||
|
||||
void FixL3Warp()
|
||||
{
|
||||
|
|
@ -266,7 +264,6 @@ void DRLG_L3LockRec(int x, int y)
|
|||
DRLG_L3LockRec(x - 1, y);
|
||||
DRLG_L3LockRec(x + 1, y);
|
||||
}
|
||||
// 528380: using guessed type int lockoutcnt;
|
||||
|
||||
BOOL DRLG_L3Lockout()
|
||||
{
|
||||
|
|
@ -291,9 +288,8 @@ BOOL DRLG_L3Lockout()
|
|||
|
||||
return t == lockoutcnt;
|
||||
}
|
||||
// 528380: using guessed type int lockoutcnt;
|
||||
|
||||
void CreateL3Dungeon(unsigned int rseed, int entry)
|
||||
void CreateL3Dungeon(int rseed, int entry)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
|
|
@ -323,10 +319,6 @@ void CreateL3Dungeon(unsigned int rseed, int entry)
|
|||
|
||||
DRLG_SetPC();
|
||||
}
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
|
||||
void DRLG_L3(int entry)
|
||||
{
|
||||
|
|
@ -460,7 +452,6 @@ void DRLG_L3(int entry)
|
|||
|
||||
DRLG_Init_Globals();
|
||||
}
|
||||
// 528378: using guessed type char lavapool;
|
||||
|
||||
void InitL3Dungeon()
|
||||
{
|
||||
|
|
@ -1034,8 +1025,8 @@ void DRLG_L3Pool()
|
|||
{
|
||||
int i, j, dunx, duny, totarea, poolchance;
|
||||
BOOL found;
|
||||
unsigned char k;
|
||||
static unsigned char poolsub[15] = { 0, 35, 26, 36, 25, 29, 34, 7, 33, 28, 27, 37, 32, 31, 30 };
|
||||
BYTE k;
|
||||
static BYTE poolsub[15] = { 0, 35, 26, 36, 25, 29, 34, 7, 33, 28, 27, 37, 32, 31, 30 };
|
||||
|
||||
for(duny = 0; duny < 40; duny++) {
|
||||
for(dunx = 0; dunx < 40; dunx++) {
|
||||
|
|
@ -1074,7 +1065,7 @@ void DRLG_L3Pool()
|
|||
if(k != 0 && k <= 37) {
|
||||
dungeon[i][j] = k;
|
||||
}
|
||||
lavapool = 1;
|
||||
lavapool = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1082,12 +1073,11 @@ void DRLG_L3Pool()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 528378: using guessed type char lavapool;
|
||||
|
||||
BOOL DRLG_L3SpawnEdge(int x, int y, int *totarea)
|
||||
{
|
||||
unsigned char i;
|
||||
static unsigned char spawntable[15] = { 0, 10, 3, 5, 12, 6, 9, 0, 0, 12, 3, 6, 9, 10, 5 };
|
||||
BYTE i;
|
||||
static BYTE spawntable[15] = { 0, 10, 3, 5, 12, 6, 9, 0, 0, 12, 3, 6, 9, 10, 5 };
|
||||
|
||||
if(*totarea > 40) {
|
||||
return TRUE;
|
||||
|
|
@ -1139,8 +1129,8 @@ BOOL DRLG_L3SpawnEdge(int x, int y, int *totarea)
|
|||
|
||||
BOOL DRLG_L3Spawn(int x, int y, int *totarea)
|
||||
{
|
||||
unsigned char i;
|
||||
static unsigned char spawntable[15] = { 0, 10, 67, 5, 44, 6, 9, 0, 0, 28, 131, 6, 9, 10, 5 };
|
||||
BYTE i;
|
||||
static BYTE spawntable[15] = { 0, 10, 67, 5, 44, 6, 9, 0, 0, 28, 131, 6, 9, 10, 5 };
|
||||
|
||||
if(*totarea > 40) {
|
||||
return TRUE;
|
||||
|
|
@ -1209,7 +1199,7 @@ void DRLG_L3PoolFix()
|
|||
}
|
||||
}
|
||||
|
||||
BOOL DRLG_L3PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int ldir)
|
||||
BOOL DRLG_L3PlaceMiniSet(const BYTE *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int ldir)
|
||||
{
|
||||
int sx, sy, sw, sh, xx, yy, i, ii, numt, trys;
|
||||
BOOL found;
|
||||
|
|
@ -1289,10 +1279,8 @@ BOOL DRLG_L3PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int c
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
// 5CF320: using guessed type int LvlViewY;
|
||||
// 5CF324: using guessed type int LvlViewX;
|
||||
|
||||
void DRLG_L3PlaceRndSet(const unsigned char *miniset, int rndper)
|
||||
void DRLG_L3PlaceRndSet(const BYTE *miniset, int rndper)
|
||||
{
|
||||
int sx, sy, sw, sh, xx, yy, ii, kk;
|
||||
BOOL found;
|
||||
|
|
@ -1680,7 +1668,7 @@ void DRLG_L3Pass3()
|
|||
for (j = 0; j < DMAXY; j++) {
|
||||
xx = 16;
|
||||
for (i = 0; i < DMAXX; i++) {
|
||||
lv = (unsigned char)dungeon[i][j] - 1;
|
||||
lv = dungeon[i][j] - 1;
|
||||
#ifdef USE_ASM
|
||||
if (lv >= 0) {
|
||||
__asm {
|
||||
|
|
@ -1792,11 +1780,6 @@ void LoadL3Dungeon(char *sFileName, int vx, int vy)
|
|||
|
||||
mem_free_dbg(pLevelMap);
|
||||
}
|
||||
// 52837C: using guessed type int abyssx;
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
|
||||
void LoadPreL3Dungeon(char *sFileName, int vx, int vy)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
#ifndef __DRLG_L3_H__
|
||||
#define __DRLG_L3_H__
|
||||
|
||||
extern char lavapool; // weak
|
||||
extern int abyssx; // weak
|
||||
extern int lockoutcnt; // weak
|
||||
extern BOOLEAN lavapool;
|
||||
extern int abyssx;
|
||||
extern int lockoutcnt;
|
||||
extern BOOLEAN lockout[40][40];
|
||||
|
||||
void AddFenceDoors();
|
||||
|
|
@ -14,7 +14,7 @@ void FixL3Warp();
|
|||
void FixL3HallofHeroes();
|
||||
void DRLG_L3LockRec(int x, int y);
|
||||
BOOL DRLG_L3Lockout();
|
||||
void CreateL3Dungeon(unsigned int rseed, int entry);
|
||||
void CreateL3Dungeon( int rseed, int entry);
|
||||
void DRLG_L3(int entry);
|
||||
void InitL3Dungeon();
|
||||
BOOL DRLG_L3FillRoom(int x1, int y1, int x2, int y2);
|
||||
|
|
@ -31,8 +31,8 @@ void DRLG_L3Pool();
|
|||
BOOL DRLG_L3SpawnEdge(int x, int y, int *totarea);
|
||||
BOOL DRLG_L3Spawn(int x, int y, int *totarea);
|
||||
void DRLG_L3PoolFix();
|
||||
BOOL DRLG_L3PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int ldir);
|
||||
void DRLG_L3PlaceRndSet(const unsigned char *miniset, int rndper);
|
||||
BOOL DRLG_L3PlaceMiniSet(const BYTE *miniset, int tmin, int tmax, int cx, int cy, BOOL setview, int ldir);
|
||||
void DRLG_L3PlaceRndSet(const BYTE *miniset, int rndper);
|
||||
void DRLG_L3Wood();
|
||||
BOOL WoodVertU(int i, int y);
|
||||
BOOL WoodVertD(int i, int y);
|
||||
|
|
@ -43,42 +43,42 @@ void LoadL3Dungeon(char *sFileName, int vx, int vy);
|
|||
void LoadPreL3Dungeon(char *sFileName, int vx, int vy);
|
||||
|
||||
/* rdata */
|
||||
extern const unsigned char L3ConvTbl[16];
|
||||
extern const unsigned char L3UP[20];
|
||||
extern const unsigned char L3DOWN[20];
|
||||
extern const unsigned char L3HOLDWARP[20];
|
||||
extern const unsigned char L3TITE1[34];
|
||||
extern const unsigned char L3TITE2[34];
|
||||
extern const unsigned char L3TITE3[34];
|
||||
extern const unsigned char L3TITE6[42];
|
||||
extern const unsigned char L3TITE7[42];
|
||||
extern const unsigned char L3TITE8[20];
|
||||
extern const unsigned char L3TITE9[20];
|
||||
extern const unsigned char L3TITE10[20];
|
||||
extern const unsigned char L3TITE11[20];
|
||||
extern const unsigned char L3TITE12[6];
|
||||
extern const unsigned char L3TITE13[6];
|
||||
extern const unsigned char L3CREV1[6];
|
||||
extern const unsigned char L3CREV2[6];
|
||||
extern const unsigned char L3CREV3[6];
|
||||
extern const unsigned char L3CREV4[6];
|
||||
extern const unsigned char L3CREV5[6];
|
||||
extern const unsigned char L3CREV6[6];
|
||||
extern const unsigned char L3CREV7[6];
|
||||
extern const unsigned char L3CREV8[6];
|
||||
extern const unsigned char L3CREV9[6];
|
||||
extern const unsigned char L3CREV10[6];
|
||||
extern const unsigned char L3CREV11[6];
|
||||
extern const unsigned char L3ISLE1[14];
|
||||
extern const unsigned char L3ISLE2[14];
|
||||
extern const unsigned char L3ISLE3[14];
|
||||
extern const unsigned char L3ISLE4[14];
|
||||
extern const unsigned char L3ISLE5[10];
|
||||
extern const unsigned char L3XTRA1[4];
|
||||
extern const unsigned char L3XTRA2[4];
|
||||
extern const unsigned char L3XTRA3[4];
|
||||
extern const unsigned char L3XTRA4[4];
|
||||
extern const unsigned char L3XTRA5[4];
|
||||
extern const unsigned char L3ANVIL[244];
|
||||
extern const BYTE L3ConvTbl[16];
|
||||
extern const BYTE L3UP[20];
|
||||
extern const BYTE L3DOWN[20];
|
||||
extern const BYTE L3HOLDWARP[20];
|
||||
extern const BYTE L3TITE1[34];
|
||||
extern const BYTE L3TITE2[34];
|
||||
extern const BYTE L3TITE3[34];
|
||||
extern const BYTE L3TITE6[42];
|
||||
extern const BYTE L3TITE7[42];
|
||||
extern const BYTE L3TITE8[20];
|
||||
extern const BYTE L3TITE9[20];
|
||||
extern const BYTE L3TITE10[20];
|
||||
extern const BYTE L3TITE11[20];
|
||||
extern const BYTE L3TITE12[6];
|
||||
extern const BYTE L3TITE13[6];
|
||||
extern const BYTE L3CREV1[6];
|
||||
extern const BYTE L3CREV2[6];
|
||||
extern const BYTE L3CREV3[6];
|
||||
extern const BYTE L3CREV4[6];
|
||||
extern const BYTE L3CREV5[6];
|
||||
extern const BYTE L3CREV6[6];
|
||||
extern const BYTE L3CREV7[6];
|
||||
extern const BYTE L3CREV8[6];
|
||||
extern const BYTE L3CREV9[6];
|
||||
extern const BYTE L3CREV10[6];
|
||||
extern const BYTE L3CREV11[6];
|
||||
extern const BYTE L3ISLE1[14];
|
||||
extern const BYTE L3ISLE2[14];
|
||||
extern const BYTE L3ISLE3[14];
|
||||
extern const BYTE L3ISLE4[14];
|
||||
extern const BYTE L3ISLE5[10];
|
||||
extern const BYTE L3XTRA1[4];
|
||||
extern const BYTE L3XTRA2[4];
|
||||
extern const BYTE L3XTRA3[4];
|
||||
extern const BYTE L3XTRA4[4];
|
||||
extern const BYTE L3XTRA5[4];
|
||||
extern const BYTE L3ANVIL[244];
|
||||
|
||||
#endif /* __DRLG_L3_H__ */
|
||||
|
|
|
|||
|
|
@ -386,10 +386,10 @@ void L4SaveQuads()
|
|||
// 528A34: using guessed type int l4holdx;
|
||||
// 528A38: using guessed type int l4holdy;
|
||||
|
||||
void DRLG_L4SetRoom(unsigned char *pSetPiece, int rx1, int ry1)
|
||||
void DRLG_L4SetRoom(BYTE *pSetPiece, int rx1, int ry1)
|
||||
{
|
||||
int rw, rh, i, j;
|
||||
unsigned char *sp;
|
||||
BYTE *sp;
|
||||
|
||||
rw = pSetPiece[0];
|
||||
rh = pSetPiece[2];
|
||||
|
|
@ -448,10 +448,6 @@ void DRLG_LoadDiabQuads(BOOL preflag)
|
|||
DRLG_L4SetRoom(lpSetPiece, diabquad4x, diabquad4y);
|
||||
mem_free_dbg(lpSetPiece);
|
||||
}
|
||||
// 5289C4: using guessed type int diabquad1x;
|
||||
// 5289C8: using guessed type int diabquad1y;
|
||||
// 528A34: using guessed type int l4holdx;
|
||||
// 528A38: using guessed type int l4holdy;
|
||||
|
||||
BOOL IsDURWall(char d)
|
||||
{
|
||||
|
|
@ -494,7 +490,6 @@ void L4FixRim()
|
|||
dung[0][j] = 0;
|
||||
}
|
||||
}
|
||||
// 52A4DC: using guessed type int dword_52A4DC;
|
||||
|
||||
void DRLG_L4GeneralFix()
|
||||
{
|
||||
|
|
@ -528,10 +523,6 @@ void CreateL4Dungeon(unsigned int rseed, int entry)
|
|||
DRLG_FreeL4SP();
|
||||
DRLG_SetPC();
|
||||
}
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
|
||||
void DRLG_L4(int entry)
|
||||
{
|
||||
|
|
@ -685,10 +676,6 @@ void DRLG_L4(int entry)
|
|||
DRLG_LoadDiabQuads(FALSE);
|
||||
}
|
||||
}
|
||||
// 528A40: using guessed type int SP4x2;
|
||||
// 528A48: using guessed type int SP4y2;
|
||||
// 5B50D8: using guessed type int setloadflag_2;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void DRLG_L4Shadows()
|
||||
{
|
||||
|
|
@ -1401,7 +1388,7 @@ void L4tileFix()
|
|||
void DRLG_L4Subs()
|
||||
{
|
||||
int x, y, i, rv;
|
||||
unsigned char c;
|
||||
BYTE c;
|
||||
|
||||
for(y = 0; y < 40; y++) {
|
||||
for(x = 0; x < 40; x++) {
|
||||
|
|
@ -1638,11 +1625,6 @@ void L4firstRoom()
|
|||
L4drawRoom(x, y, w, h);
|
||||
L4roomGen(x, y, w, h, random(0, 2));
|
||||
}
|
||||
// 528A34: using guessed type int l4holdx;
|
||||
// 528A38: using guessed type int l4holdy;
|
||||
// 528A40: using guessed type int SP4x2;
|
||||
// 528A48: using guessed type int SP4y2;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void L4drawRoom(int x, int y, int width, int height)
|
||||
{
|
||||
|
|
@ -1820,10 +1802,6 @@ BOOL DRLG_L4PlaceMiniSet(const unsigned char *miniset, int tmin, int tmax, int c
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
// 528A40: using guessed type int SP4x2;
|
||||
// 528A48: using guessed type int SP4y2;
|
||||
// 5CF320: using guessed type int LvlViewY;
|
||||
// 5CF324: using guessed type int LvlViewX;
|
||||
|
||||
void DRLG_L4FloodTVal()
|
||||
{
|
||||
|
|
@ -1842,7 +1820,6 @@ void DRLG_L4FloodTVal()
|
|||
yy += 2;
|
||||
}
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
|
||||
void DRLG_L4FTVR(int i, int j, int x, int y, int d)
|
||||
{
|
||||
|
|
@ -1890,7 +1867,6 @@ void DRLG_L4FTVR(int i, int j, int x, int y, int d)
|
|||
DRLG_L4FTVR(i + 1, j + 1, x + 2, y + 2, 8);
|
||||
}
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
|
||||
void DRLG_L4TransFix()
|
||||
{
|
||||
|
|
@ -2000,7 +1976,7 @@ void DRLG_L4Pass3()
|
|||
for (j = 0; j < DMAXY; j++) {
|
||||
xx = 16;
|
||||
for (i = 0; i < DMAXX; i++) {
|
||||
lv = (unsigned char)dungeon[i][j] - 1;
|
||||
lv = dungeon[i][j] - 1;
|
||||
#ifdef USE_ASM
|
||||
if (lv >= 0) {
|
||||
__asm {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ DEVILUTION_BEGIN_NAMESPACE
|
|||
#ifdef __cplusplus
|
||||
static CCritSect sgMemCrit;
|
||||
#endif
|
||||
unsigned int glpDThreadId; // idb
|
||||
TMegaPkt *sgpInfoHead; /* may not be right struct */
|
||||
unsigned int glpDThreadId;
|
||||
TMegaPkt *sgpInfoHead; /* may not be right struct */
|
||||
BOOLEAN dthread_running;
|
||||
HANDLE sghWorkToDoEvent;
|
||||
|
||||
|
|
@ -124,7 +124,6 @@ unsigned int __stdcall dthread_handler(void *unused)
|
|||
|
||||
return 0;
|
||||
}
|
||||
// 679730: using guessed type int gdwDeltaBytesSec;
|
||||
|
||||
void dthread_cleanup()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#ifndef __DTHREAD_H__
|
||||
#define __DTHREAD_H__
|
||||
|
||||
extern unsigned int glpDThreadId; // idb
|
||||
extern unsigned int glpDThreadId;
|
||||
extern BOOLEAN dthread_running;
|
||||
|
||||
void dthread_remove_player(int pnum);
|
||||
|
|
|
|||
|
|
@ -2090,6 +2090,9 @@ void engine_draw_pixel(int sx, int sy)
|
|||
// 52B99C: using guessed type int gbNotInView;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
/*
|
||||
* Xiaolin Wu's anti-aliased line algorithm
|
||||
*/
|
||||
void DrawLine(int x0, int y0, int x1, int y1, BYTE col)
|
||||
{
|
||||
int i, sx, sy, dx, dy, nx, ny, xlen, ylen, pixels, remain, xy_same, line_dir, mult_2, mult_4;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ char *color_cycling_toggle_names[] = { "Color Cycling Off", "Color Cycling On" }
|
|||
|
||||
void gamemenu_previous()
|
||||
{
|
||||
void(* proc)(TMenuItem *);
|
||||
void (*proc)(TMenuItem *);
|
||||
TMenuItem *item;
|
||||
|
||||
if (gbMaxPlayers == 1) {
|
||||
|
|
@ -54,7 +54,7 @@ void gamemenu_previous()
|
|||
PressEscKey();
|
||||
}
|
||||
|
||||
void gamemenu_enable_single(TMenuItem *a1)
|
||||
void gamemenu_enable_single(TMenuItem *pMenuItems)
|
||||
{
|
||||
BOOL enable;
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ void gamemenu_enable_single(TMenuItem *a1)
|
|||
gmenu_enable(sgSingleMenu, enable);
|
||||
}
|
||||
|
||||
void gamemenu_enable_multi(TMenuItem *a1)
|
||||
void gamemenu_enable_multi(TMenuItem *pMenuItems)
|
||||
{
|
||||
gmenu_enable(&sgMultiMenu[2], deathflag);
|
||||
}
|
||||
|
|
@ -85,12 +85,12 @@ void gamemenu_handle_previous()
|
|||
gamemenu_previous();
|
||||
}
|
||||
|
||||
void j_gamemenu_previous(BOOL a1)
|
||||
void j_gamemenu_previous(BOOL bActivate)
|
||||
{
|
||||
gamemenu_previous();
|
||||
}
|
||||
|
||||
void gamemenu_new_game(BOOL a1)
|
||||
void gamemenu_new_game(BOOL bActivate)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -105,15 +105,14 @@ void gamemenu_new_game(BOOL a1)
|
|||
gbRunGame = FALSE;
|
||||
gamemenu_off();
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void gamemenu_quit_game(BOOL a1)
|
||||
void gamemenu_quit_game(BOOL bActivate)
|
||||
{
|
||||
gamemenu_new_game(a1);
|
||||
gamemenu_new_game(bActivate);
|
||||
gbRunGameResult = FALSE;
|
||||
}
|
||||
|
||||
void gamemenu_load_game(BOOL a1)
|
||||
void gamemenu_load_game(BOOL bActivate)
|
||||
{
|
||||
WNDPROC saveProc = SetWindowProc(DisableInputWndProc);
|
||||
gamemenu_off();
|
||||
|
|
@ -132,37 +131,38 @@ void gamemenu_load_game(BOOL a1)
|
|||
interface_msg_pump();
|
||||
SetWindowProc(saveProc);
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void gamemenu_save_game(BOOL a1)
|
||||
void gamemenu_save_game(BOOL bActivate)
|
||||
{
|
||||
if (pcurs == CURSOR_HAND) {
|
||||
if (plr[myplr]._pmode == PM_DEATH || deathflag) {
|
||||
gamemenu_off();
|
||||
} else {
|
||||
WNDPROC saveProc = SetWindowProc(DisableInputWndProc);
|
||||
SetCursor_(CURSOR_NONE);
|
||||
gamemenu_off();
|
||||
InitDiabloMsg(EMSG_SAVING);
|
||||
drawpanflag = 255;
|
||||
DrawAndBlit();
|
||||
SaveGame();
|
||||
ClrDiabloMsg();
|
||||
drawpanflag = 255;
|
||||
SetCursor_(CURSOR_HAND);
|
||||
interface_msg_pump();
|
||||
SetWindowProc(saveProc);
|
||||
}
|
||||
if (pcurs != CURSOR_HAND) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void gamemenu_restart_town(BOOL a1)
|
||||
if (plr[myplr]._pmode == PM_DEATH || deathflag) {
|
||||
gamemenu_off();
|
||||
return;
|
||||
}
|
||||
|
||||
WNDPROC saveProc = SetWindowProc(DisableInputWndProc);
|
||||
SetCursor_(CURSOR_NONE);
|
||||
gamemenu_off();
|
||||
InitDiabloMsg(EMSG_SAVING);
|
||||
drawpanflag = 255;
|
||||
DrawAndBlit();
|
||||
SaveGame();
|
||||
ClrDiabloMsg();
|
||||
drawpanflag = 255;
|
||||
SetCursor_(CURSOR_HAND);
|
||||
interface_msg_pump();
|
||||
SetWindowProc(saveProc);
|
||||
}
|
||||
|
||||
void gamemenu_restart_town(BOOL bActivate)
|
||||
{
|
||||
NetSendCmd(TRUE, CMD_RETOWN);
|
||||
}
|
||||
|
||||
void gamemenu_options(BOOL a1)
|
||||
void gamemenu_options(BOOL bActivate)
|
||||
{
|
||||
gamemenu_get_music();
|
||||
gamemenu_get_sound();
|
||||
|
|
@ -183,10 +183,11 @@ void gamemenu_sound_music_toggle(char **names, TMenuItem *menu_item, int volume)
|
|||
menu_item->pszStr = *names;
|
||||
gmenu_slider_3(menu_item, 17);
|
||||
gmenu_slider_1(menu_item, VOLUME_MIN, VOLUME_MAX, volume);
|
||||
} else {
|
||||
menu_item->dwFlags &= 0x3FFFFFFF;
|
||||
menu_item->pszStr = names[1];
|
||||
return;
|
||||
}
|
||||
|
||||
menu_item->dwFlags &= 0x3FFFFFFF;
|
||||
menu_item->pszStr = names[1];
|
||||
}
|
||||
|
||||
void gamemenu_get_sound()
|
||||
|
|
@ -205,10 +206,10 @@ void gamemenu_get_gamma()
|
|||
gmenu_slider_1(&sgOptionMenu[2], 30, 100, UpdateGamma(0));
|
||||
}
|
||||
|
||||
void gamemenu_music_volume(BOOL a1)
|
||||
void gamemenu_music_volume(BOOL bActivate)
|
||||
{
|
||||
int volume;
|
||||
if (a1) {
|
||||
if (bActivate) {
|
||||
if (gbMusicOn) {
|
||||
gbMusicOn = FALSE;
|
||||
music_stop();
|
||||
|
|
@ -252,10 +253,10 @@ int gamemenu_slider_music_sound(TMenuItem *menu_item)
|
|||
return gmenu_slider_get(menu_item, VOLUME_MIN, VOLUME_MAX);
|
||||
}
|
||||
|
||||
void gamemenu_sound_volume(BOOL a1)
|
||||
void gamemenu_sound_volume(BOOL bActivate)
|
||||
{
|
||||
int volume;
|
||||
if (a1) {
|
||||
if (bActivate) {
|
||||
if (gbSoundOn) {
|
||||
gbSoundOn = FALSE;
|
||||
FreeMonsterSnd();
|
||||
|
|
@ -280,10 +281,10 @@ void gamemenu_sound_volume(BOOL a1)
|
|||
gamemenu_get_sound();
|
||||
}
|
||||
|
||||
void gamemenu_gamma(BOOL a1)
|
||||
void gamemenu_gamma(BOOL bActivate)
|
||||
{
|
||||
int gamma;
|
||||
if (a1) {
|
||||
if (bActivate) {
|
||||
if (UpdateGamma(0) == 30)
|
||||
gamma = 100;
|
||||
else
|
||||
|
|
@ -301,7 +302,7 @@ int gamemenu_slider_gamma()
|
|||
return gmenu_slider_get(&sgOptionMenu[2], 30, 100);
|
||||
}
|
||||
|
||||
void gamemenu_color_cycling(BOOL a1)
|
||||
void gamemenu_color_cycling(BOOL bActivate)
|
||||
{
|
||||
BOOL color_cycling;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ int themeCount;
|
|||
char nTransTable[2049];
|
||||
//int dword_52D204;
|
||||
int dMonster[MAXDUNX][MAXDUNY];
|
||||
unsigned char dungeon[40][40];
|
||||
BYTE dungeon[40][40];
|
||||
char dObject[MAXDUNX][MAXDUNY];
|
||||
BYTE *pSpeedCels;
|
||||
int nlevel_frames; // weak
|
||||
|
|
@ -711,7 +711,7 @@ BOOL DRLG_WillThemeRoomFit(int floor, int x, int y, int minSize, int maxSize, in
|
|||
for (ii = 0; ii < maxSize; ii++) {
|
||||
if (xFlag) {
|
||||
for (xx = x; xx < x + maxSize; xx++) {
|
||||
if ((unsigned char)dungeon[xx][y + ii] != floor) {
|
||||
if (dungeon[xx][y + ii] != floor) {
|
||||
if (xx >= minSize) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -727,7 +727,7 @@ BOOL DRLG_WillThemeRoomFit(int floor, int x, int y, int minSize, int maxSize, in
|
|||
}
|
||||
if (yFlag) {
|
||||
for (yy = y; yy < y + maxSize; yy++) {
|
||||
if ((unsigned char)dungeon[x + ii][yy] != floor) {
|
||||
if (dungeon[x + ii][yy] != floor) {
|
||||
if (yy >= minSize) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ extern int themeCount;
|
|||
extern char nTransTable[2049];
|
||||
//int dword_52D204;
|
||||
extern int dMonster[MAXDUNX][MAXDUNY];
|
||||
extern unsigned char dungeon[40][40];
|
||||
extern BYTE dungeon[40][40];
|
||||
extern char dObject[MAXDUNX][MAXDUNY];
|
||||
extern BYTE *pSpeedCels;
|
||||
extern int nlevel_frames; // weak
|
||||
|
|
|
|||
140
Source/gmenu.cpp
140
Source/gmenu.cpp
|
|
@ -3,17 +3,17 @@
|
|||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
void *optbar_cel;
|
||||
BOOLEAN byte_634464; // weak
|
||||
BOOLEAN mouseNavigation; // weak
|
||||
void *PentSpin_cel;
|
||||
TMenuItem *sgpCurrItem;
|
||||
void *BigTGold_cel;
|
||||
int dword_634474; // weak
|
||||
char byte_634478; // weak
|
||||
void(*dword_63447C)(TMenuItem *);
|
||||
TMenuItem *dword_634480; // idb
|
||||
TMenuItem *sgpCurrentMenu; // idb
|
||||
void *option_cel;
|
||||
void *sgpLogo;
|
||||
int dword_63448C; // weak
|
||||
int sgCurrentMenuIdx; // weak
|
||||
|
||||
const unsigned char lfontframe[127] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
|
@ -43,7 +43,7 @@ void gmenu_draw_pause()
|
|||
{
|
||||
if (currlevel)
|
||||
RedBack();
|
||||
if (!dword_634480) {
|
||||
if (!sgpCurrentMenu) {
|
||||
light_table_index = 0;
|
||||
gmenu_print_text(316, 336, "Pause");
|
||||
}
|
||||
|
|
@ -82,24 +82,24 @@ void FreeGMenu()
|
|||
void gmenu_init_menu()
|
||||
{
|
||||
byte_634478 = 1;
|
||||
dword_634480 = 0;
|
||||
sgpCurrentMenu = 0;
|
||||
sgpCurrItem = 0;
|
||||
dword_63447C = 0;
|
||||
dword_63448C = 0;
|
||||
byte_634464 = 0;
|
||||
sgCurrentMenuIdx = 0;
|
||||
mouseNavigation = 0;
|
||||
sgpLogo = LoadFileInMem("Data\\Diabsmal.CEL", 0);
|
||||
BigTGold_cel = LoadFileInMem("Data\\BigTGold.CEL", 0);
|
||||
PentSpin_cel = LoadFileInMem("Data\\PentSpin.CEL", 0);
|
||||
option_cel = LoadFileInMem("Data\\option.CEL", 0);
|
||||
optbar_cel = LoadFileInMem("Data\\optbar.CEL", 0);
|
||||
}
|
||||
// 634464: using guessed type char byte_634464;
|
||||
// 634464: using guessed type char mouseNavigation;
|
||||
// 634478: using guessed type char byte_634478;
|
||||
// 63448C: using guessed type int dword_63448C;
|
||||
// 63448C: using guessed type int sgCurrentMenuIdx;
|
||||
|
||||
BOOL gmenu_exception()
|
||||
{
|
||||
return dword_634480 != 0;
|
||||
return sgpCurrentMenu != 0;
|
||||
}
|
||||
|
||||
void gmenu_call_proc(TMenuItem *pItem, void(*gmFunc)(TMenuItem *))
|
||||
|
|
@ -109,65 +109,62 @@ void gmenu_call_proc(TMenuItem *pItem, void(*gmFunc)(TMenuItem *))
|
|||
void(* *v4)(BOOL); // edx
|
||||
|
||||
PauseMode = 0;
|
||||
byte_634464 = 0;
|
||||
mouseNavigation = 0;
|
||||
v2 = pItem;
|
||||
dword_63447C = gmFunc;
|
||||
dword_634480 = pItem;
|
||||
sgpCurrentMenu = pItem;
|
||||
if (gmFunc) {
|
||||
gmFunc(dword_634480);
|
||||
v2 = dword_634480;
|
||||
gmFunc(sgpCurrentMenu);
|
||||
v2 = sgpCurrentMenu;
|
||||
}
|
||||
v3 = 0;
|
||||
dword_63448C = 0;
|
||||
sgCurrentMenuIdx = 0;
|
||||
if (v2) {
|
||||
v4 = &v2->fnMenu;
|
||||
while (*v4) {
|
||||
++v3;
|
||||
v4 += 3;
|
||||
dword_63448C = v3;
|
||||
sgCurrentMenuIdx = v3;
|
||||
}
|
||||
}
|
||||
sgpCurrItem = &v2[v3 - 1];
|
||||
gmenu_up_down(1);
|
||||
gmenu_up_down(TRUE);
|
||||
}
|
||||
// 525740: using guessed type int PauseMode;
|
||||
// 634464: using guessed type char byte_634464;
|
||||
// 63448C: using guessed type int dword_63448C;
|
||||
// 634464: using guessed type char mouseNavigation;
|
||||
// 63448C: using guessed type int sgCurrentMenuIdx;
|
||||
|
||||
void gmenu_up_down(int a1)
|
||||
void gmenu_up_down(BOOL isDown)
|
||||
{
|
||||
TMenuItem *v1; // eax
|
||||
int v2; // edi
|
||||
int i;
|
||||
|
||||
v1 = sgpCurrItem;
|
||||
if (sgpCurrItem) {
|
||||
byte_634464 = 0;
|
||||
v2 = dword_63448C;
|
||||
while (v2) {
|
||||
--v2;
|
||||
if (a1) {
|
||||
++v1;
|
||||
sgpCurrItem = v1;
|
||||
if (v1->fnMenu)
|
||||
goto LABEL_10;
|
||||
v1 = dword_634480;
|
||||
if (!sgpCurrItem) {
|
||||
return;
|
||||
}
|
||||
mouseNavigation = FALSE;
|
||||
i = sgCurrentMenuIdx;
|
||||
if (sgCurrentMenuIdx) {
|
||||
while (i) {
|
||||
i--;
|
||||
if (isDown) {
|
||||
sgpCurrItem++;
|
||||
if (!sgpCurrItem->fnMenu)
|
||||
sgpCurrItem = &sgpCurrentMenu[0];
|
||||
} else {
|
||||
if (v1 == dword_634480)
|
||||
v1 = &dword_634480[dword_63448C];
|
||||
--v1;
|
||||
if (sgpCurrItem == sgpCurrentMenu)
|
||||
sgpCurrItem = &sgpCurrentMenu[sgCurrentMenuIdx];
|
||||
sgpCurrItem--;
|
||||
}
|
||||
sgpCurrItem = v1;
|
||||
LABEL_10:
|
||||
if ((v1->dwFlags & 0x80000000) != 0) {
|
||||
if (v2)
|
||||
if ((sgpCurrItem->dwFlags & 0x80000000) != 0) {
|
||||
if (i)
|
||||
PlaySFX(IS_TITLEMOV);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 634464: using guessed type char byte_634464;
|
||||
// 63448C: using guessed type int dword_63448C;
|
||||
// 634464: using guessed type char mouseNavigation;
|
||||
// 63448C: using guessed type int sgCurrentMenuIdx;
|
||||
|
||||
void gmenu_draw()
|
||||
{
|
||||
|
|
@ -175,12 +172,12 @@ void gmenu_draw()
|
|||
TMenuItem *i; // esi
|
||||
DWORD v2; // eax
|
||||
|
||||
if (dword_634480) {
|
||||
if (sgpCurrentMenu) {
|
||||
if (dword_63447C)
|
||||
dword_63447C(dword_634480);
|
||||
dword_63447C(sgpCurrentMenu);
|
||||
CelDecodeOnly(236, 262, (BYTE *)sgpLogo, 1, 296);
|
||||
v0 = 320;
|
||||
for (i = dword_634480; i->fnMenu; v0 += 45) {
|
||||
for (i = sgpCurrentMenu; i->fnMenu; v0 += 45) {
|
||||
gmenu_draw_menu_item(i, v0);
|
||||
++i;
|
||||
}
|
||||
|
|
@ -245,37 +242,34 @@ void gmenu_draw_menu_item(TMenuItem *pItem, int a2)
|
|||
|
||||
void gmenu_clear_buffer(int x, int y, int width, int height)
|
||||
{
|
||||
int v4; // edi
|
||||
char *i; // esi
|
||||
BYTE *i;
|
||||
|
||||
v4 = height;
|
||||
for (i = (char *)gpBuffer + PitchTbl[y] + x; v4; --v4) {
|
||||
for (i = gpBuffer + PitchTbl[y] + x; height; height--) {
|
||||
memset(i, 205, width);
|
||||
i -= 768;
|
||||
i -= BUFFER_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
int gmenu_get_lfont(TMenuItem *pItem)
|
||||
{
|
||||
char *v2; // eax
|
||||
int i; // edx
|
||||
unsigned char v4; // cl
|
||||
char *text;
|
||||
int i;
|
||||
BYTE c;
|
||||
|
||||
if (pItem->dwFlags & 0x40000000)
|
||||
return 490;
|
||||
v2 = pItem->pszStr;
|
||||
for (i = 0;; i += lfontkern[lfontframe[gbFontTransTbl[v4]]] + 2) {
|
||||
v4 = *v2;
|
||||
if (!*v2)
|
||||
break;
|
||||
++v2;
|
||||
text = pItem->pszStr;
|
||||
i = 0;
|
||||
while (*text) {
|
||||
c = gbFontTransTbl[(BYTE)*text++];
|
||||
i += lfontkern[lfontframe[c]] + 2;
|
||||
}
|
||||
return i - 2;
|
||||
}
|
||||
|
||||
BOOL gmenu_presskeys(int a1)
|
||||
{
|
||||
if (!dword_634480)
|
||||
if (!sgpCurrentMenu)
|
||||
return 0;
|
||||
switch (a1) {
|
||||
case VK_RETURN:
|
||||
|
|
@ -297,10 +291,10 @@ BOOL gmenu_presskeys(int a1)
|
|||
gmenu_left_right(TRUE);
|
||||
break;
|
||||
case VK_UP:
|
||||
gmenu_up_down(0);
|
||||
gmenu_up_down(FALSE);
|
||||
break;
|
||||
case VK_DOWN:
|
||||
gmenu_up_down(1);
|
||||
gmenu_up_down(TRUE);
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
@ -331,7 +325,7 @@ BOOL gmenu_on_mouse_move()
|
|||
{
|
||||
int plOffset, v;
|
||||
|
||||
if (!byte_634464)
|
||||
if (!mouseNavigation)
|
||||
return FALSE;
|
||||
gmenu_valid_mouse_pos(&plOffset);
|
||||
v = (sgpCurrItem->dwFlags & 0xFFF000);
|
||||
|
|
@ -371,20 +365,20 @@ int gmenu_left_mouse(int a1)
|
|||
int a1a; // [esp+4h] [ebp-4h]
|
||||
|
||||
if (a1) {
|
||||
if (!dword_634480 || MouseY >= 352)
|
||||
if (!sgpCurrentMenu || MouseY >= 352)
|
||||
return 0;
|
||||
if (MouseY - 117 >= 0) {
|
||||
v2 = (MouseY - 117) / 45;
|
||||
if (v2 < dword_63448C) {
|
||||
if (v2 < sgCurrentMenuIdx) {
|
||||
v3 = v2;
|
||||
v4 = &dword_634480[v3];
|
||||
v4 = &sgpCurrentMenu[v3];
|
||||
if ((v4->dwFlags & 0x80000000) != 0) {
|
||||
v5 = (unsigned int)gmenu_get_lfont(&dword_634480[v3]) >> 1;
|
||||
v5 = (unsigned int)gmenu_get_lfont(&sgpCurrentMenu[v3]) >> 1;
|
||||
if (MouseX >= 320 - v5 && MouseX <= v5 + 320) {
|
||||
sgpCurrItem = v4;
|
||||
PlaySFX(IS_TITLEMOV);
|
||||
if (v4->dwFlags & 0x40000000) {
|
||||
byte_634464 = gmenu_valid_mouse_pos(&a1a);
|
||||
mouseNavigation = gmenu_valid_mouse_pos(&a1a);
|
||||
gmenu_on_mouse_move();
|
||||
} else {
|
||||
sgpCurrItem->fnMenu(TRUE);
|
||||
|
|
@ -395,14 +389,14 @@ int gmenu_left_mouse(int a1)
|
|||
}
|
||||
} else {
|
||||
result = 0;
|
||||
if (!byte_634464)
|
||||
if (!mouseNavigation)
|
||||
return result;
|
||||
byte_634464 = 0;
|
||||
mouseNavigation = 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
// 634464: using guessed type char byte_634464;
|
||||
// 63448C: using guessed type int dword_63448C;
|
||||
// 634464: using guessed type char mouseNavigation;
|
||||
// 63448C: using guessed type int sgCurrentMenuIdx;
|
||||
|
||||
void gmenu_enable(TMenuItem *pMenuItem, BOOL enable)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
#define __GMENU_H__
|
||||
|
||||
extern void *optbar_cel;
|
||||
extern BOOLEAN byte_634464; // weak
|
||||
extern BOOLEAN mouseNavigation; // weak
|
||||
extern void *PentSpin_cel;
|
||||
extern void *BigTGold_cel;
|
||||
extern int dword_634474; // weak
|
||||
extern char byte_634478; // weak
|
||||
extern void(*dword_63447C)(TMenuItem *);
|
||||
extern TMenuItem *dword_634480; // idb
|
||||
extern TMenuItem *sgpCurrentMenu; // idb
|
||||
extern void *option_cel;
|
||||
extern int dword_63448C; // weak
|
||||
extern int sgCurrentMenuIdx; // weak
|
||||
|
||||
void gmenu_draw_pause();
|
||||
void gmenu_print_text(int x, int y, char *pszStr);
|
||||
|
|
@ -19,7 +19,7 @@ void FreeGMenu();
|
|||
void gmenu_init_menu();
|
||||
BOOL gmenu_exception();
|
||||
void gmenu_call_proc(TMenuItem *pItem, void(*gmFunc)(TMenuItem *));
|
||||
void gmenu_up_down(int a1);
|
||||
void gmenu_up_down(BOOL isDown);
|
||||
void gmenu_draw();
|
||||
void gmenu_draw_menu_item(TMenuItem *pItem, int a2);
|
||||
void gmenu_clear_buffer(int x, int y, int width, int height);
|
||||
|
|
|
|||
|
|
@ -178,24 +178,21 @@ void DrawHelp()
|
|||
|
||||
void DrawHelpLine(int always_0, int help_line_nr, char *text, char color)
|
||||
{
|
||||
signed int v4; // ebx
|
||||
int v5; // edi
|
||||
unsigned char i; // al
|
||||
unsigned char v7; // al
|
||||
int v8; // esi
|
||||
int off, width;
|
||||
BYTE c;
|
||||
|
||||
v4 = 0;
|
||||
v5 = PitchTbl[SStringY[help_line_nr] + 204] + always_0 + 96;
|
||||
for (i = *text; *text; i = *text) {
|
||||
++text;
|
||||
v7 = fontframe[gbFontTransTbl[i]];
|
||||
v8 = v7;
|
||||
v4 += fontkern[v7] + 1;
|
||||
if (v7) {
|
||||
if (v4 <= 577)
|
||||
CPrintString(v5, v7, color);
|
||||
width = 0;
|
||||
off = PitchTbl[SStringY[help_line_nr] + 204] + always_0 + 96;
|
||||
while (*text) {
|
||||
c = gbFontTransTbl[(BYTE)*text];
|
||||
text++;
|
||||
c = fontframe[c];
|
||||
width += fontkern[c] + 1;
|
||||
if (c) {
|
||||
if (width <= 577)
|
||||
CPrintString(off, c, color);
|
||||
}
|
||||
v5 += fontkern[v8] + 1;
|
||||
off += fontkern[c] + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ DEVILUTION_BEGIN_NAMESPACE
|
|||
|
||||
void *sgpBackCel;
|
||||
int sgdwProgress;
|
||||
int progress_id; // idb
|
||||
int progress_id;
|
||||
|
||||
const unsigned char progress_bar_colours[3] = { 138u, 43u, 254u };
|
||||
const BYTE progress_bar_colours[3] = { 138, 43, 254 };
|
||||
const int progress_bar_screen_pos[3][2] = { { 53, 37 }, { 53, 421 }, { 53, 37 } };
|
||||
|
||||
void interface_msg_pump()
|
||||
{
|
||||
MSG Msg; // [esp+8h] [ebp-1Ch]
|
||||
MSG Msg;
|
||||
|
||||
while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) {
|
||||
if (Msg.message != WM_QUIT) {
|
||||
|
|
@ -26,11 +26,11 @@ BOOL IncProgress()
|
|||
{
|
||||
interface_msg_pump();
|
||||
sgdwProgress += 15;
|
||||
if ((unsigned int)sgdwProgress > 0x216)
|
||||
if ((DWORD)sgdwProgress > 534)
|
||||
sgdwProgress = 534;
|
||||
if (sgpBackCel)
|
||||
DrawCutscene();
|
||||
return (unsigned int)sgdwProgress >= 0x216;
|
||||
return (DWORD)sgdwProgress >= 534;
|
||||
}
|
||||
|
||||
void DrawCutscene()
|
||||
|
|
@ -51,20 +51,17 @@ void DrawCutscene()
|
|||
drawpanflag = 255;
|
||||
scrollrt_draw_game_screen(0);
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void DrawProgress(int screen_x, int screen_y, int progress_id)
|
||||
{
|
||||
_BYTE *v3; // eax
|
||||
signed int v4; // ecx
|
||||
BYTE *dst;
|
||||
int i;
|
||||
|
||||
v3 = (unsigned char *)gpBuffer + PitchTbl[screen_y] + screen_x;
|
||||
v4 = 22;
|
||||
do {
|
||||
*v3 = progress_bar_colours[progress_id];
|
||||
v3 += 768;
|
||||
--v4;
|
||||
} while (v4);
|
||||
dst = &gpBuffer[screen_x + PitchTbl[screen_y]];
|
||||
for (i = 0; i < 22; i++) {
|
||||
*dst = progress_bar_colours[progress_id];
|
||||
dst += BUFFER_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowProgress(unsigned int uMsg)
|
||||
|
|
@ -238,10 +235,6 @@ void ShowProgress(unsigned int uMsg)
|
|||
|
||||
gbSomebodyWonGameKludge = FALSE;
|
||||
}
|
||||
// 5CF31C: using guessed type char setlvltype;
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
// 6761B8: using guessed type char gbSomebodyWonGameKludge;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void FreeInterface()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#ifndef __INTERFAC_H__
|
||||
#define __INTERFAC_H__
|
||||
|
||||
extern int progress_id; // idb
|
||||
extern int progress_id;
|
||||
|
||||
void interface_msg_pump();
|
||||
BOOL IncProgress();
|
||||
|
|
|
|||
|
|
@ -1861,17 +1861,17 @@ BOOL CanPut(int x, int y)
|
|||
}
|
||||
|
||||
oi = dObject[x + 1][y + 1];
|
||||
if (oi > 0 && object[oi - 1]._oSelFlag) {
|
||||
if (oi > 0 && object[oi - 1]._oSelFlag != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if (oi < 0 && object[-(oi + 1)]._oSelFlag) {
|
||||
if (oi < 0 && object[-(oi + 1)]._oSelFlag != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
oi = dObject[x + 1][y];
|
||||
if (oi > 0) {
|
||||
oi2 = dObject[x][y + 1];
|
||||
if (oi2 > 0 && object[oi - 1]._oSelFlag && object[oi2 - 1]._oSelFlag)
|
||||
if (oi2 > 0 && object[oi - 1]._oSelFlag != 0 && object[oi2 - 1]._oSelFlag != 0)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -970,16 +970,16 @@ BOOL ItemSpaceOk(int i, int j)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
if (dObject[i + 1][j + 1] > 0 && object[dObject[i + 1][j + 1] - 1]._oSelFlag)
|
||||
if (dObject[i + 1][j + 1] > 0 && object[dObject[i + 1][j + 1] - 1]._oSelFlag != 0)
|
||||
return FALSE;
|
||||
|
||||
if (dObject[i + 1][j + 1] < 0 && object[-(dObject[i + 1][j + 1] + 1)]._oSelFlag)
|
||||
if (dObject[i + 1][j + 1] < 0 && object[-(dObject[i + 1][j + 1] + 1)]._oSelFlag != 0)
|
||||
return FALSE;
|
||||
|
||||
if (dObject[i + 1][j] > 0
|
||||
&& dObject[i][j + 1] > 0
|
||||
&& object[dObject[i + 1][j] - 1]._oSelFlag
|
||||
&& object[dObject[i][j + 1] - 1]._oSelFlag) {
|
||||
&& object[dObject[i + 1][j] - 1]._oSelFlag != 0
|
||||
&& object[dObject[i][j + 1] - 1]._oSelFlag != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ unsigned char lightactive[MAXLIGHTS];
|
|||
LightListStruct LightList[MAXLIGHTS];
|
||||
int numlights;
|
||||
BYTE lightradius[16][128];
|
||||
int dovision; // weak
|
||||
BOOL dovision;
|
||||
int numvision;
|
||||
char lightmax; // weak
|
||||
int dolighting; // weak
|
||||
char lightmax;
|
||||
BOOL dolighting;
|
||||
BYTE lightblock[8][8][16][16];
|
||||
int visionid;
|
||||
BYTE *pLightTbl;
|
||||
|
|
@ -942,7 +942,6 @@ void MakeLightTable()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 525728: using guessed type int light4flag;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void ToggleLighting_2()
|
||||
|
|
@ -988,23 +987,19 @@ void InitLightMax()
|
|||
lightmax = 15;
|
||||
}
|
||||
}
|
||||
// 525728: using guessed type int light4flag;
|
||||
// 642A14: using guessed type char lightmax;
|
||||
|
||||
void InitLighting()
|
||||
{
|
||||
int i;
|
||||
|
||||
numlights = 0;
|
||||
dolighting = 0;
|
||||
lightflag = 0;
|
||||
dolighting = FALSE;
|
||||
lightflag = FALSE;
|
||||
|
||||
for (i = 0; i < MAXLIGHTS; i++) {
|
||||
lightactive[i] = i;
|
||||
}
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
int AddLight(int x, int y, int r)
|
||||
{
|
||||
|
|
@ -1025,13 +1020,11 @@ int AddLight(int x, int y, int r)
|
|||
LightList[lid]._yoff = 0;
|
||||
LightList[lid]._ldel = 0;
|
||||
LightList[lid]._lunflag = 0;
|
||||
dolighting = 1;
|
||||
dolighting = TRUE;
|
||||
}
|
||||
|
||||
return lid;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void AddUnLight(int i)
|
||||
{
|
||||
|
|
@ -1040,10 +1033,8 @@ void AddUnLight(int i)
|
|||
}
|
||||
|
||||
LightList[i]._ldel = 1;
|
||||
dolighting = 1;
|
||||
dolighting = TRUE;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void ChangeLightRadius(int i, int r)
|
||||
{
|
||||
|
|
@ -1056,10 +1047,8 @@ void ChangeLightRadius(int i, int r)
|
|||
LightList[i]._luny = LightList[i]._ly;
|
||||
LightList[i]._lunr = LightList[i]._lradius;
|
||||
LightList[i]._lradius = r;
|
||||
dolighting = 1;
|
||||
dolighting = TRUE;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void ChangeLightXY(int i, int x, int y)
|
||||
{
|
||||
|
|
@ -1073,10 +1062,8 @@ void ChangeLightXY(int i, int x, int y)
|
|||
LightList[i]._lunr = LightList[i]._lradius;
|
||||
LightList[i]._lx = x;
|
||||
LightList[i]._ly = y;
|
||||
dolighting = 1;
|
||||
dolighting = TRUE;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void ChangeLightOff(int i, int x, int y)
|
||||
{
|
||||
|
|
@ -1090,10 +1077,8 @@ void ChangeLightOff(int i, int x, int y)
|
|||
LightList[i]._lunr = LightList[i]._lradius;
|
||||
LightList[i]._xoff = x;
|
||||
LightList[i]._yoff = y;
|
||||
dolighting = 1;
|
||||
dolighting = TRUE;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void ChangeLight(int i, int x, int y, int r)
|
||||
{
|
||||
|
|
@ -1108,10 +1093,8 @@ void ChangeLight(int i, int x, int y, int r)
|
|||
LightList[i]._lx = x;
|
||||
LightList[i]._ly = y;
|
||||
LightList[i]._lradius = r;
|
||||
dolighting = 1;
|
||||
dolighting = TRUE;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void ProcessLightList()
|
||||
{
|
||||
|
|
@ -1152,10 +1135,8 @@ void ProcessLightList()
|
|||
}
|
||||
}
|
||||
|
||||
dolighting = 0;
|
||||
dolighting = FALSE;
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
// 646A28: using guessed type int lightflag;
|
||||
|
||||
void SavePreLighting()
|
||||
{
|
||||
|
|
@ -1167,15 +1148,13 @@ void InitVision()
|
|||
int i;
|
||||
|
||||
numvision = 0;
|
||||
dovision = 0;
|
||||
dovision = FALSE;
|
||||
visionid = 1;
|
||||
|
||||
for (i = 0; i < TransVal; i++) {
|
||||
TransList[i] = 0;
|
||||
}
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
// 642A0C: using guessed type int dovision;
|
||||
|
||||
int AddVision(int x, int y, int r, BOOL mine)
|
||||
{
|
||||
|
|
@ -1193,12 +1172,11 @@ int AddVision(int x, int y, int r, BOOL mine)
|
|||
VisionList[numvision]._lunflag = 0;
|
||||
VisionList[numvision]._lflags = mine != 0;
|
||||
numvision++;
|
||||
dovision = 1;
|
||||
dovision = TRUE;
|
||||
}
|
||||
|
||||
return vid;
|
||||
}
|
||||
// 642A0C: using guessed type int dovision;
|
||||
|
||||
void ChangeVisionRadius(int id, int r)
|
||||
{
|
||||
|
|
@ -1211,11 +1189,10 @@ void ChangeVisionRadius(int id, int r)
|
|||
VisionList[i]._luny = VisionList[i]._ly;
|
||||
VisionList[i]._lunr = VisionList[i]._lradius;
|
||||
VisionList[i]._lradius = r;
|
||||
dovision = 1;
|
||||
dovision = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 642A0C: using guessed type int dovision;
|
||||
|
||||
void ChangeVisionXY(int id, int x, int y)
|
||||
{
|
||||
|
|
@ -1229,11 +1206,10 @@ void ChangeVisionXY(int id, int x, int y)
|
|||
VisionList[i]._lunr = VisionList[i]._lradius;
|
||||
VisionList[i]._lx = x;
|
||||
VisionList[i]._ly = y;
|
||||
dovision = 1;
|
||||
dovision = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 642A0C: using guessed type int dovision;
|
||||
|
||||
void ProcessVisionList()
|
||||
{
|
||||
|
|
@ -1277,10 +1253,8 @@ void ProcessVisionList()
|
|||
} while (delflag);
|
||||
}
|
||||
|
||||
dovision = 0;
|
||||
dovision = FALSE;
|
||||
}
|
||||
// 5A5590: using guessed type char TransVal;
|
||||
// 642A0C: using guessed type int dovision;
|
||||
|
||||
void lighting_color_cycling()
|
||||
{
|
||||
|
|
@ -1307,6 +1281,5 @@ void lighting_color_cycling()
|
|||
tbl += 224;
|
||||
}
|
||||
}
|
||||
// 525728: using guessed type int light4flag;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ extern unsigned char lightactive[MAXLIGHTS];
|
|||
extern LightListStruct LightList[MAXLIGHTS];
|
||||
extern int numlights;
|
||||
extern BYTE lightradius[16][128];
|
||||
extern int dovision; // weak
|
||||
extern BOOL dovision;
|
||||
extern int numvision;
|
||||
extern char lightmax; // weak
|
||||
extern int dolighting; // weak
|
||||
extern char lightmax;
|
||||
extern BOOL dolighting;
|
||||
extern BYTE lightblock[8][8][16][16];
|
||||
extern int visionid;
|
||||
extern BYTE *pLightTbl;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
unsigned char *tbuff;
|
||||
BYTE *tbuff;
|
||||
|
||||
void LoadGame(BOOL firstflag)
|
||||
{
|
||||
|
|
@ -173,7 +173,6 @@ void LoadGame(BOOL firstflag)
|
|||
SetCursor_(CURSOR_HAND);
|
||||
gbProcessPlayers = TRUE;
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
char BLoad()
|
||||
{
|
||||
|
|
@ -417,7 +416,6 @@ void SaveGame()
|
|||
pfile_rename_temp_to_perm();
|
||||
pfile_write_hero();
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void BSave(char v)
|
||||
{
|
||||
|
|
@ -604,7 +602,6 @@ void SaveLevel()
|
|||
else
|
||||
plr[myplr]._pSLvlVisited[setlvlnum] = 1;
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void LoadLevel()
|
||||
{
|
||||
|
|
@ -699,6 +696,5 @@ void LoadLevel()
|
|||
|
||||
mem_free_dbg(LoadBuff);
|
||||
}
|
||||
// 642A18: using guessed type int dolighting;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#ifndef __LOADSAVE_H__
|
||||
#define __LOADSAVE_H__
|
||||
|
||||
extern unsigned char *tbuff;
|
||||
extern BYTE *tbuff;
|
||||
|
||||
void LoadGame(BOOL firstflag);
|
||||
char BLoad();
|
||||
|
|
|
|||
|
|
@ -121,14 +121,12 @@ void mainmenu_loop()
|
|||
|
||||
music_stop();
|
||||
}
|
||||
// 634980: using guessed type int gbActive;
|
||||
|
||||
BOOL mainmenu_single_player()
|
||||
{
|
||||
gbMaxPlayers = 1;
|
||||
return mainmenu_init_menu(1);
|
||||
}
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
BOOL mainmenu_init_menu(int type)
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -92,7 +92,7 @@ BOOL M_CallWalk(int i, int md);
|
|||
BOOL M_PathWalk(int i);
|
||||
BOOL M_CallWalk2(int i, int md);
|
||||
BOOL M_DumbWalk(int i, int md);
|
||||
BOOLEAN M_RoundWalk(int i, int md, int *dir);
|
||||
BOOL M_RoundWalk(int i, int md, int *dir);
|
||||
void MAI_Zombie(int i);
|
||||
void MAI_SkelSd(int i);
|
||||
BOOL MAI_Path(int i);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ void play_movie(char *pszMovie, BOOL user_can_close)
|
|||
SetWindowProc(saveProc);
|
||||
sound_disable_music(FALSE);
|
||||
}
|
||||
// 634980: using guessed type int gbActive;
|
||||
|
||||
LRESULT __stdcall MovieWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -433,9 +433,8 @@ void DeltaAddItem(int ii)
|
|||
if (gbMaxPlayers == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXITEMS; i++) {
|
||||
pD = &sgLevels[currlevel].item[i];
|
||||
pD = sgLevels[currlevel].item;
|
||||
for (i = 0; i < MAXITEMS; i++,pD++) {
|
||||
if (pD->bCmd != 0xFF
|
||||
&& pD->wIndx == item[ii].IDidx
|
||||
&& pD->wCI == item[ii]._iCreateInfo
|
||||
|
|
@ -445,8 +444,8 @@ void DeltaAddItem(int ii)
|
|||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXITEMS; i++) {
|
||||
pD = &sgLevels[currlevel].item[i];
|
||||
pD = sgLevels[currlevel].item;
|
||||
for (i = 0; i < MAXITEMS; i++, pD++) {
|
||||
if (pD->bCmd == 0xFF) {
|
||||
pD->bCmd = CMD_STAND;
|
||||
sgbDeltaChanged = TRUE;
|
||||
|
|
@ -465,7 +464,6 @@ void DeltaAddItem(int ii)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void DeltaSaveLevel()
|
||||
{
|
||||
|
|
@ -1626,34 +1624,34 @@ void delta_put_item(TCmdPItem *pI, int x, int y, BYTE bLevel)
|
|||
int i;
|
||||
TCmdPItem *pD;
|
||||
|
||||
if (gbMaxPlayers != 1) {
|
||||
for (i = 0; i < MAXITEMS; i++) {
|
||||
pD = &sgLevels[bLevel].item[i];
|
||||
if (pD->bCmd != CMD_WALKXY
|
||||
&& pD->bCmd != 0xFF
|
||||
&& pD->wIndx == pI->wIndx
|
||||
&& pD->wCI == pI->wCI
|
||||
&& pD->dwSeed == pI->dwSeed) {
|
||||
if (pD->bCmd == CMD_ACK_PLRINFO)
|
||||
return;
|
||||
app_fatal("Trying to drop a floor item?");
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXITEMS; i++) {
|
||||
pD = &sgLevels[bLevel].item[i];
|
||||
if (pD->bCmd == 0xFF) {
|
||||
sgbDeltaChanged = TRUE;
|
||||
memcpy(pD, pI, sizeof(TCmdPItem));
|
||||
pD->bCmd = CMD_ACK_PLRINFO;
|
||||
pD->x = x;
|
||||
pD->y = y;
|
||||
if (gbMaxPlayers == 1) {
|
||||
return;
|
||||
}
|
||||
pD = sgLevels[bLevel].item;
|
||||
for (i = 0; i < MAXITEMS; i++, pD++) {
|
||||
if (pD->bCmd != CMD_WALKXY
|
||||
&& pD->bCmd != 0xFF
|
||||
&& pD->wIndx == pI->wIndx
|
||||
&& pD->wCI == pI->wCI
|
||||
&& pD->dwSeed == pI->dwSeed) {
|
||||
if (pD->bCmd == CMD_ACK_PLRINFO)
|
||||
return;
|
||||
}
|
||||
app_fatal("Trying to drop a floor item?");
|
||||
}
|
||||
}
|
||||
|
||||
pD = sgLevels[bLevel].item;
|
||||
for (i = 0; i < MAXITEMS; i++, pD++) {
|
||||
if (pD->bCmd == 0xFF) {
|
||||
sgbDeltaChanged = TRUE;
|
||||
memcpy(pD, pI, sizeof(TCmdPItem));
|
||||
pD->bCmd = CMD_ACK_PLRINFO;
|
||||
pD->x = x;
|
||||
pD->y = y;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void check_update_plr(int pnum)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -113,8 +113,6 @@ void InitObjectGFX()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 67D7C4: using guessed type int numobjfiles;
|
||||
// 44121D: using guessed type char fileload[56];
|
||||
|
||||
void FreeObjectGFX()
|
||||
{
|
||||
|
|
@ -125,7 +123,6 @@ void FreeObjectGFX()
|
|||
}
|
||||
numobjfiles = 0;
|
||||
}
|
||||
// 67D7C4: using guessed type int numobjfiles;
|
||||
|
||||
BOOL RndLocOk(int xp, int yp)
|
||||
{
|
||||
|
|
@ -253,8 +250,6 @@ void ClrAllObjects()
|
|||
trapid = 1;
|
||||
leverid = 1;
|
||||
}
|
||||
// 679768: using guessed type int trapid;
|
||||
// 67976C: using guessed type int trapdir;
|
||||
|
||||
void AddTortures()
|
||||
{
|
||||
|
|
@ -542,7 +537,7 @@ void AddChestTraps()
|
|||
}
|
||||
}
|
||||
|
||||
void LoadMapObjects(unsigned char *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx)
|
||||
void LoadMapObjects(BYTE *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx)
|
||||
{
|
||||
int rw, rh, i, j, oi;
|
||||
BYTE *lm;
|
||||
|
|
@ -572,11 +567,11 @@ void LoadMapObjects(unsigned char *pMap, int startx, int starty, int x1, int y1,
|
|||
InitObjFlag = FALSE;
|
||||
}
|
||||
|
||||
void LoadMapObjs(unsigned char *pMap, int startx, int starty)
|
||||
void LoadMapObjs(BYTE *pMap, int startx, int starty)
|
||||
{
|
||||
int rw, rh;
|
||||
int i, j;
|
||||
unsigned char *lm;
|
||||
BYTE *lm;
|
||||
long mapoff;
|
||||
|
||||
InitObjFlag = TRUE;
|
||||
|
|
@ -603,7 +598,7 @@ void LoadMapObjs(unsigned char *pMap, int startx, int starty)
|
|||
|
||||
void AddDiabObjs()
|
||||
{
|
||||
unsigned char *lpSetPiece; // esi
|
||||
BYTE *lpSetPiece;
|
||||
|
||||
lpSetPiece = LoadFileInMem("Levels\\L4Data\\diab1.DUN", 0);
|
||||
LoadMapObjects(lpSetPiece, 2 * diabquad1x, 2 * diabquad1y, diabquad2x, diabquad2y, 11, 12, 1);
|
||||
|
|
@ -615,8 +610,6 @@ void AddDiabObjs()
|
|||
LoadMapObjects(lpSetPiece, 2 * diabquad3x, 2 * diabquad3y, diabquad4x, diabquad4y, 9, 9, 3);
|
||||
mem_free_dbg(lpSetPiece);
|
||||
}
|
||||
// 5289C4: using guessed type int diabquad1x;
|
||||
// 5289C8: using guessed type int diabquad1y;
|
||||
|
||||
void AddStoryBooks()
|
||||
{
|
||||
|
|
@ -747,7 +740,7 @@ void AddLazStand()
|
|||
void InitObjects()
|
||||
{
|
||||
int sp_id;
|
||||
unsigned char *mem;
|
||||
BYTE *mem;
|
||||
|
||||
ClrAllObjects();
|
||||
if (currlevel == 16) {
|
||||
|
|
@ -845,9 +838,6 @@ void InitObjects()
|
|||
InitObjFlag = FALSE;
|
||||
}
|
||||
}
|
||||
// 5CF330: using guessed type int setpc_h;
|
||||
// 5CF334: using guessed type int setpc_w;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void SetMapObjects(unsigned char *pMap, int startx, int starty)
|
||||
{
|
||||
|
|
@ -999,8 +989,6 @@ void AddSCambBook(int i)
|
|||
object[i]._oVar4 = setpc_h + setpc_y + 1;
|
||||
object[i]._oVar6 = object[i]._oAnimFrame + 1;
|
||||
}
|
||||
// 5CF330: using guessed type int setpc_h;
|
||||
// 5CF334: using guessed type int setpc_w;
|
||||
|
||||
void AddChest(int i, int t)
|
||||
{
|
||||
|
|
@ -1035,32 +1023,25 @@ void AddChest(int i, int t)
|
|||
}
|
||||
object[i]._oVar2 = random(147, 8);
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void AddL2Door(int i, int x, int y, int ot)
|
||||
{
|
||||
int v4; // esi
|
||||
|
||||
v4 = i;
|
||||
object[i]._oDoorFlag = TRUE;
|
||||
if (ot == OBJ_L2LDOOR)
|
||||
ObjSetMicro(x, y, 538);
|
||||
else
|
||||
ObjSetMicro(x, y, 540);
|
||||
object[v4]._oVar4 = 0;
|
||||
object[i]._oVar4 = 0;
|
||||
}
|
||||
|
||||
void AddL3Door(int i, int x, int y, int ot)
|
||||
{
|
||||
int v4; // esi
|
||||
|
||||
v4 = i;
|
||||
object[i]._oDoorFlag = TRUE;
|
||||
if (ot == OBJ_L3LDOOR)
|
||||
ObjSetMicro(x, y, 531);
|
||||
else
|
||||
ObjSetMicro(x, y, 534);
|
||||
object[v4]._oVar4 = 0;
|
||||
object[i]._oVar4 = 0;
|
||||
}
|
||||
|
||||
void AddSarc(int i)
|
||||
|
|
@ -1079,15 +1060,12 @@ void AddFlameTrap(int i)
|
|||
object[i]._oVar3 = trapdir;
|
||||
object[i]._oVar4 = 0;
|
||||
}
|
||||
// 679768: using guessed type int trapid;
|
||||
// 67976C: using guessed type int trapdir;
|
||||
|
||||
void AddFlameLvr(int i)
|
||||
{
|
||||
object[i]._oVar1 = trapid;
|
||||
object[i]._oVar2 = 49;
|
||||
}
|
||||
// 679768: using guessed type int trapid;
|
||||
|
||||
void AddTrap(int i, int t)
|
||||
{
|
||||
|
|
@ -1159,8 +1137,6 @@ void AddShrine(int i)
|
|||
object[i]._oAnimLen = 22;
|
||||
}
|
||||
}
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
// 442E0F: using guessed type int var_68[26];
|
||||
|
||||
void AddBookcase(int i)
|
||||
{
|
||||
|
|
@ -1236,12 +1212,10 @@ void AddDecap(int i)
|
|||
|
||||
void AddVilebook(int i)
|
||||
{
|
||||
if (setlevel) {
|
||||
if (setlvlnum == SL_VILEBETRAYER)
|
||||
object[i]._oAnimFrame = 4;
|
||||
if (setlevel && setlvlnum == SL_VILEBETRAYER) {
|
||||
object[i]._oAnimFrame = 4;
|
||||
}
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void AddMagicCircle(int i)
|
||||
{
|
||||
|
|
@ -1327,9 +1301,8 @@ void GetRndObjLoc(int randarea, int *xx, int *yy)
|
|||
|
||||
void AddMushPatch()
|
||||
{
|
||||
int i; // bl
|
||||
int y; // [esp+0h] [ebp-8h]
|
||||
int x; // [esp+4h] [ebp-4h]
|
||||
int i;
|
||||
int y, x;
|
||||
|
||||
if (nobjects < MAXOBJECTS) {
|
||||
i = objectavail[0];
|
||||
|
|
@ -1343,8 +1316,7 @@ void AddMushPatch()
|
|||
|
||||
void AddSlainHero()
|
||||
{
|
||||
int x; // [esp+0h] [ebp-8h]
|
||||
int y; // [esp+4h] [ebp-4h]
|
||||
int x, y;
|
||||
|
||||
GetRndObjLoc(5, &x, &y);
|
||||
AddObject(OBJ_SLAINHERO, x + 2, y + 2);
|
||||
|
|
@ -1525,8 +1497,7 @@ void Obj_Light(int i, int lr)
|
|||
|
||||
void Obj_Circle(int i)
|
||||
{
|
||||
int ox;
|
||||
int oy;
|
||||
int ox, oy;
|
||||
|
||||
ox = object[i]._ox;
|
||||
oy = object[i]._oy;
|
||||
|
|
@ -1563,7 +1534,6 @@ void Obj_Circle(int i)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 525748: using guessed type char sgbMouseDown;
|
||||
|
||||
void Obj_StopAnim(int i)
|
||||
{
|
||||
|
|
@ -1683,7 +1653,7 @@ void Obj_Trap(int i)
|
|||
case OBJ_CHEST3:
|
||||
case OBJ_SWITCHSKL:
|
||||
case OBJ_SARC:
|
||||
if (!object[oti]._oSelFlag)
|
||||
if (object[oti]._oSelFlag == 0)
|
||||
otrig = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1710,7 +1680,6 @@ void Obj_Trap(int i)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void Obj_BCrossDamage(int i)
|
||||
{
|
||||
|
|
@ -2106,7 +2075,6 @@ void OperateL1RDoor(int pnum, int oi, BOOL sendflag)
|
|||
object[oi]._oVar4 = 2;
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
|
||||
{
|
||||
|
|
@ -2163,7 +2131,6 @@ void OperateL1LDoor(int pnum, int oi, BOOL sendflag)
|
|||
object[oi]._oVar4 = 2;
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateL2RDoor(int pnum, int oi, BOOL sendflag)
|
||||
{
|
||||
|
|
@ -2205,7 +2172,6 @@ void OperateL2RDoor(int pnum, int oi, BOOL sendflag)
|
|||
object[oi]._oVar4 = 2;
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateL2LDoor(int pnum, int oi, BOOL sendflag)
|
||||
{
|
||||
|
|
@ -2248,7 +2214,6 @@ void OperateL2LDoor(int pnum, int oi, BOOL sendflag)
|
|||
object[oi]._oVar4 = 2;
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateL3RDoor(int pnum, int oi, BOOL sendflag)
|
||||
{
|
||||
|
|
@ -2291,7 +2256,6 @@ void OperateL3RDoor(int pnum, int oi, BOOL sendflag)
|
|||
object[oi]._oVar4 = 2;
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateL3LDoor(int pnum, int oi, BOOL sendflag)
|
||||
{
|
||||
|
|
@ -2334,7 +2298,6 @@ void OperateL3LDoor(int pnum, int oi, BOOL sendflag)
|
|||
object[oi]._oVar4 = 2;
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void MonstCheckDoors(int m)
|
||||
{
|
||||
|
|
@ -2387,7 +2350,7 @@ void ObjChangeMap(int x1, int y1, int x2, int y2)
|
|||
|
||||
for (j = y1; j <= y2; j++) {
|
||||
for (i = x1; i <= x2; i++) {
|
||||
ObjSetMini(i, j, (unsigned char)pdungeon[i][j]);
|
||||
ObjSetMini(i, j, (BYTE)pdungeon[i][j]);
|
||||
dungeon[i][j] = pdungeon[i][j];
|
||||
}
|
||||
}
|
||||
|
|
@ -2433,56 +2396,39 @@ void OperateL1Door(int pnum, int i, unsigned char sendflag)
|
|||
|
||||
void OperateLever(int pnum, int i)
|
||||
{
|
||||
int v2; // esi
|
||||
int *v3; // edi
|
||||
signed int v4; // edi
|
||||
int v5; // ecx
|
||||
int v6; // eax
|
||||
short param1; // [esp+8h] [ebp-8h]
|
||||
int v8; // [esp+Ch] [ebp-4h]
|
||||
int j, oi;
|
||||
BOOL mapflag;
|
||||
|
||||
param1 = i;
|
||||
v2 = i;
|
||||
v3 = (int *)&object[i]._oSelFlag;
|
||||
v8 = pnum;
|
||||
if (*(_BYTE *)v3) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_LEVER, object[v2]._ox, object[v2]._oy);
|
||||
*(_BYTE *)v3 = 0;
|
||||
++object[v2]._oAnimFrame;
|
||||
v4 = 1;
|
||||
if (currlevel != 16)
|
||||
goto LABEL_17;
|
||||
v5 = 0;
|
||||
if (nobjects <= 0)
|
||||
goto LABEL_17;
|
||||
do {
|
||||
v6 = objectactive[v5];
|
||||
if (object[v6]._otype == OBJ_SWITCHSKL
|
||||
&& object[v2]._oVar8 == object[v6]._oVar8
|
||||
&& object[v6]._oSelFlag) {
|
||||
v4 = 0;
|
||||
PlaySfxLoc(IS_LEVER, object[i]._ox, object[i]._oy);
|
||||
object[i]._oSelFlag = 0;
|
||||
object[i]._oAnimFrame++;
|
||||
mapflag = TRUE;
|
||||
if (currlevel == 16) {
|
||||
for (j = 0; j < nobjects; j++) {
|
||||
oi = objectactive[j];
|
||||
if (object[oi]._otype == OBJ_SWITCHSKL
|
||||
&& object[i]._oVar8 == object[oi]._oVar8
|
||||
&& object[oi]._oSelFlag != 0) {
|
||||
mapflag = FALSE;
|
||||
}
|
||||
}
|
||||
++v5;
|
||||
} while (v5 < nobjects);
|
||||
if (v4)
|
||||
LABEL_17:
|
||||
ObjChangeMap(object[v2]._oVar1, object[v2]._oVar2, object[v2]._oVar3, object[v2]._oVar4);
|
||||
if (v8 == myplr)
|
||||
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, param1);
|
||||
}
|
||||
if (mapflag)
|
||||
ObjChangeMap(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
|
||||
if (pnum == myplr)
|
||||
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateBook(int pnum, int i)
|
||||
{
|
||||
BOOL do_add_missile;
|
||||
int oi;
|
||||
int j;
|
||||
BOOL missile_added;
|
||||
int j, oi;
|
||||
int dx, dy;
|
||||
BOOL do_add_missile, missile_added;
|
||||
|
||||
if (!object[i]._oSelFlag)
|
||||
if (object[i]._oSelFlag == 0)
|
||||
return;
|
||||
if (setlevel && setlvlnum == SL_VILEBETRAYER) {
|
||||
do_add_missile = FALSE;
|
||||
|
|
@ -2548,8 +2494,6 @@ void OperateBook(int pnum, int i)
|
|||
SyncObjectAnim(objectactive[j]);
|
||||
}
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateBookLever(int pnum, int i)
|
||||
{
|
||||
|
|
@ -2557,7 +2501,7 @@ void OperateBookLever(int pnum, int i)
|
|||
|
||||
x = 2 * setpc_x + 16;
|
||||
y = 2 * setpc_y + 16;
|
||||
if (object[i]._oSelFlag && !qtextflag) {
|
||||
if (object[i]._oSelFlag != 0 && !qtextflag) {
|
||||
if (object[i]._otype == OBJ_BLINDBOOK && !quests[QTYPE_BLIND]._qvar1) {
|
||||
quests[QTYPE_BLIND]._qactive = 2;
|
||||
quests[QTYPE_BLIND]._qlog = 1;
|
||||
|
|
@ -2599,7 +2543,7 @@ void OperateSChambBk(int pnum, int i)
|
|||
{
|
||||
int j, textdef;
|
||||
|
||||
if (object[i]._oSelFlag && !qtextflag) {
|
||||
if (object[i]._oSelFlag != 0 && !qtextflag) {
|
||||
if (object[i]._oAnimFrame != object[i]._oVar6) {
|
||||
ObjChangeMapResync(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
|
||||
for (j = 0; j < nobjects; j++)
|
||||
|
|
@ -2626,7 +2570,7 @@ void OperateChest(int pnum, int i, BOOL sendmsg)
|
|||
{
|
||||
int j, mdir, mtype;
|
||||
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_CHEST, object[i]._ox, object[i]._oy);
|
||||
object[i]._oAnimFrame += 2;
|
||||
|
|
@ -2667,8 +2611,6 @@ void OperateChest(int pnum, int i, BOOL sendmsg)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateMushPatch(int pnum, int i)
|
||||
{
|
||||
|
|
@ -2685,7 +2627,7 @@ void OperateMushPatch(int pnum, int i)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_CHEST, object[i]._ox, object[i]._oy);
|
||||
object[i]._oAnimFrame++;
|
||||
|
|
@ -2714,7 +2656,7 @@ void OperateInnSignChest(int pnum, int i)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_CHEST, object[i]._ox, object[i]._oy);
|
||||
object[i]._oAnimFrame += 2;
|
||||
|
|
@ -2726,11 +2668,10 @@ void OperateInnSignChest(int pnum, int i)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateSlainHero(int pnum, int i, BOOL sendmsg)
|
||||
{
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
object[i]._oSelFlag = 0;
|
||||
if (!deltaload) {
|
||||
if (plr[pnum]._pClass == PC_WARRIOR) {
|
||||
|
|
@ -2748,13 +2689,10 @@ void OperateSlainHero(int pnum, int i, BOOL sendmsg)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateTrapLvr(int i)
|
||||
{
|
||||
int frame;
|
||||
int j;
|
||||
int oi;
|
||||
int frame, j, oi;
|
||||
|
||||
frame = object[i]._oAnimFrame;
|
||||
j = 0;
|
||||
|
|
@ -2784,7 +2722,7 @@ void OperateTrapLvr(int i)
|
|||
|
||||
void OperateSarc(int pnum, int i, BOOL sendmsg)
|
||||
{
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_SARC, object[i]._ox, object[i]._oy);
|
||||
object[i]._oSelFlag = 0;
|
||||
|
|
@ -2803,7 +2741,6 @@ void OperateSarc(int pnum, int i, BOOL sendmsg)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateL2Door(int pnum, int i, unsigned char sendflag)
|
||||
{
|
||||
|
|
@ -2831,7 +2768,7 @@ void OperateL3Door(int pnum, int i, unsigned char sendflag)
|
|||
|
||||
void OperatePedistal(int pnum, int i)
|
||||
{
|
||||
unsigned char *mem;
|
||||
BYTE *mem;
|
||||
int iv;
|
||||
|
||||
if (object[i]._oVar6 != 3) {
|
||||
|
|
@ -2862,8 +2799,6 @@ void OperatePedistal(int pnum, int i)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5CF334: using guessed type int setpc_w;
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void TryDisarm(int pnum, int i)
|
||||
{
|
||||
|
|
@ -2899,7 +2834,9 @@ int ItemMiscIdIdx(int imiscid)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; AllItemsList[i].iRnd == 0 || AllItemsList[i].iMiscId != imiscid; i++) {
|
||||
i = 0;
|
||||
while (AllItemsList[i].iRnd == 0 || AllItemsList[i].iMiscId != imiscid) {
|
||||
i++;
|
||||
}
|
||||
|
||||
return i;
|
||||
|
|
@ -3173,7 +3110,7 @@ void OperateShrine(int pnum, int i, int sType)
|
|||
if ((object[v1]._otype == OBJ_CHEST1
|
||||
|| object[v1]._otype == OBJ_CHEST2
|
||||
|| object[v1]._otype == OBJ_CHEST3)
|
||||
&& !object[v1]._oSelFlag) {
|
||||
&& object[v1]._oSelFlag == 0) {
|
||||
object[v1]._oRndSeed = GetRndSeed();
|
||||
object[v1]._oAnimFrame -= 2;
|
||||
object[v1]._oSelFlag = 1;
|
||||
|
|
@ -3513,7 +3450,7 @@ void OperateShrine(int pnum, int i, int sType)
|
|||
|
||||
void OperateSkelBook(int pnum, int i, BOOL sendmsg)
|
||||
{
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_ISCROL, object[i]._ox, object[i]._oy);
|
||||
object[i]._oAnimFrame += 2;
|
||||
|
|
@ -3532,7 +3469,7 @@ void OperateSkelBook(int pnum, int i, BOOL sendmsg)
|
|||
|
||||
void OperateBookCase(int pnum, int i, BOOL sendmsg)
|
||||
{
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(IS_ISCROL, object[i]._ox, object[i]._oy);
|
||||
object[i]._oAnimFrame -= 2;
|
||||
|
|
@ -3554,11 +3491,10 @@ void OperateBookCase(int pnum, int i, BOOL sendmsg)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateDecap(int pnum, int i, BOOL sendmsg)
|
||||
{
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
object[i]._oSelFlag = 0;
|
||||
if (!deltaload) {
|
||||
SetRndSeed(object[i]._oRndSeed);
|
||||
|
|
@ -3573,7 +3509,7 @@ void OperateArmorStand(int pnum, int i, BOOL sendmsg)
|
|||
{
|
||||
int uniqueRnd;
|
||||
|
||||
if (object[i]._oSelFlag) {
|
||||
if (object[i]._oSelFlag != 0) {
|
||||
object[i]._oAnimFrame++;
|
||||
object[i]._oSelFlag = 0;
|
||||
if (!deltaload) {
|
||||
|
|
@ -3621,7 +3557,6 @@ int FindValidShrine(int i)
|
|||
|
||||
return rv;
|
||||
}
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void OperateGoatShrine(int pnum, int i, int sType)
|
||||
{
|
||||
|
|
@ -3631,7 +3566,6 @@ void OperateGoatShrine(int pnum, int i, int sType)
|
|||
object[i]._oAnimDelay = 2;
|
||||
drawpanflag = 255;
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void OperateCauldron(int pnum, int i, int sType)
|
||||
{
|
||||
|
|
@ -3642,16 +3576,11 @@ void OperateCauldron(int pnum, int i, int sType)
|
|||
object[i]._oAnimFrame = 3;
|
||||
drawpanflag = 255;
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
BOOL OperateFountains(int pnum, int i)
|
||||
{
|
||||
BOOL applied;
|
||||
int prev;
|
||||
int add;
|
||||
int rnd;
|
||||
int cnt;
|
||||
BOOL done;
|
||||
int prev, add, rnd, cnt;
|
||||
BOOL applied, done;
|
||||
|
||||
applied = FALSE;
|
||||
SetRndSeed(object[i]._oRndSeed);
|
||||
|
|
@ -3695,7 +3624,7 @@ BOOL OperateFountains(int pnum, int i)
|
|||
PlaySfxLoc(LS_FOUNTAIN, object[i]._ox, object[i]._oy);
|
||||
break;
|
||||
case OBJ_MURKYFTN:
|
||||
if (!object[i]._oSelFlag)
|
||||
if (object[i]._oSelFlag == 0)
|
||||
break;
|
||||
if (!deltaload)
|
||||
PlaySfxLoc(LS_FOUNTAIN, object[i]._ox, object[i]._oy);
|
||||
|
|
@ -3718,7 +3647,7 @@ BOOL OperateFountains(int pnum, int i)
|
|||
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
|
||||
break;
|
||||
case OBJ_TEARFTN:
|
||||
if (!object[i]._oSelFlag)
|
||||
if (object[i]._oSelFlag == 0)
|
||||
break;
|
||||
prev = -1;
|
||||
add = -1;
|
||||
|
|
@ -3766,14 +3695,12 @@ BOOL OperateFountains(int pnum, int i)
|
|||
drawpanflag = 255;
|
||||
return applied;
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateWeaponRack(int pnum, int i, BOOL sendmsg)
|
||||
{
|
||||
int weaponType;
|
||||
|
||||
if (!object[i]._oSelFlag)
|
||||
if (object[i]._oSelFlag == 0)
|
||||
return;
|
||||
SetRndSeed(object[i]._oRndSeed);
|
||||
|
||||
|
|
@ -3804,33 +3731,28 @@ void OperateWeaponRack(int pnum, int i, BOOL sendmsg)
|
|||
if (pnum == myplr)
|
||||
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateStoryBook(int pnum, int i)
|
||||
{
|
||||
if (object[i]._oSelFlag && !deltaload && !qtextflag && pnum == myplr) {
|
||||
if (object[i]._oSelFlag != 0 && !deltaload && !qtextflag && pnum == myplr) {
|
||||
object[i]._oAnimFrame = object[i]._oVar4;
|
||||
PlaySfxLoc(IS_ISCROL, object[i]._ox, object[i]._oy);
|
||||
InitQTextMsg(object[i]._oVar2);
|
||||
NetSendCmdParam1(FALSE, CMD_OPERATEOBJ, i);
|
||||
}
|
||||
}
|
||||
// 646D00: using guessed type char qtextflag;
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateLazStand(int pnum, int i)
|
||||
{
|
||||
int xx, yy;
|
||||
|
||||
if (object[i]._oSelFlag && !deltaload && !qtextflag && pnum == myplr) {
|
||||
if (object[i]._oSelFlag != 0 && !deltaload && !qtextflag && pnum == myplr) {
|
||||
object[i]._oAnimFrame++;
|
||||
object[i]._oSelFlag = 0;
|
||||
GetSuperItemLoc(object[i]._ox, object[i]._oy, &xx, &yy);
|
||||
SpawnQuestItem(33, xx, yy, 0, 0);
|
||||
}
|
||||
}
|
||||
// 646D00: using guessed type char qtextflag;
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void OperateObject(int pnum, int i, BOOL TeleFlag)
|
||||
{
|
||||
|
|
@ -4141,14 +4063,13 @@ void BreakCrux(int i)
|
|||
PlaySfxLoc(IS_LEVER, object[i]._ox, object[i]._oy);
|
||||
ObjChangeMap(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void BreakBarrel(int pnum, int i, int dam, BOOL forcebreak, int sendmsg)
|
||||
{
|
||||
int oi;
|
||||
int xp, yp;
|
||||
|
||||
if (!object[i]._oSelFlag)
|
||||
if (object[i]._oSelFlag == 0)
|
||||
return;
|
||||
if (forcebreak) {
|
||||
object[i]._oVar1 = 0;
|
||||
|
|
@ -4211,7 +4132,6 @@ void BreakBarrel(int pnum, int i, int dam, BOOL forcebreak, int sendmsg)
|
|||
if (pnum == myplr)
|
||||
NetSendCmdParam2(FALSE, CMD_BREAKOBJ, pnum, i);
|
||||
}
|
||||
// 676190: using guessed type int deltaload;
|
||||
|
||||
void BreakObject(int pnum, int oi)
|
||||
{
|
||||
|
|
@ -4295,7 +4215,7 @@ void SyncCrux(int i)
|
|||
|
||||
void SyncLever(int i)
|
||||
{
|
||||
if (!object[i]._oSelFlag)
|
||||
if (object[i]._oSelFlag == 0)
|
||||
ObjChangeMap(object[i]._oVar1, object[i]._oVar2, object[i]._oVar3, object[i]._oVar4);
|
||||
}
|
||||
|
||||
|
|
@ -4331,7 +4251,6 @@ void SyncPedistal(int i)
|
|||
mem_free_dbg(setp);
|
||||
}
|
||||
}
|
||||
// 5CF334: using guessed type int setpc_w;
|
||||
|
||||
void SyncL2Doors(int i)
|
||||
{
|
||||
|
|
@ -4579,7 +4498,5 @@ void GetObjectStr(int i)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 4B883C: using guessed type int infoclr;
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ void AddL2Torches();
|
|||
BOOL TorchLocOK(int xp, int yp);
|
||||
void AddObjTraps();
|
||||
void AddChestTraps();
|
||||
void LoadMapObjects(unsigned char *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx);
|
||||
void LoadMapObjs(unsigned char *pMap, int startx, int starty);
|
||||
void LoadMapObjects(BYTE *pMap, int startx, int starty, int x1, int y1, int w, int h, int leveridx);
|
||||
void LoadMapObjs(BYTE *pMap, int startx, int starty);
|
||||
void AddDiabObjs();
|
||||
void AddStoryBooks();
|
||||
void AddHookedBodies(int freq);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ int gdwPalEntries;
|
|||
|
||||
/* data */
|
||||
|
||||
int gamma_correction = 100; // idb
|
||||
int gamma_correction = 100;
|
||||
BOOL color_cycling_enabled = TRUE;
|
||||
BOOLEAN sgbFadedIn = TRUE;
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ BOOL palette_set_color_cycling(BOOL enabled);
|
|||
|
||||
/* data */
|
||||
|
||||
extern int gamma_correction; // idb
|
||||
extern int gamma_correction;
|
||||
extern BOOL color_cycling_enabled;
|
||||
|
||||
#endif /* __PALETTE_H__ */
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void pfile_check_available_space(char *pszDir)
|
|||
|
||||
void pfile_write_hero()
|
||||
{
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
PkPlayerStruct pkplr;
|
||||
|
||||
save_num = pfile_get_save_num_from_name(plr[myplr]._pName);
|
||||
|
|
@ -68,9 +68,9 @@ void pfile_write_hero()
|
|||
}
|
||||
}
|
||||
|
||||
unsigned int pfile_get_save_num_from_name(const char *name)
|
||||
DWORD pfile_get_save_num_from_name(const char *name)
|
||||
{
|
||||
unsigned int i;
|
||||
DWORD i;
|
||||
|
||||
for (i = 0; i < MAX_CHARACTERS; i++) {
|
||||
if (!_strcmpi(hero_names[i], name))
|
||||
|
|
@ -97,7 +97,7 @@ void pfile_encode_hero(const PkPlayerStruct *pPack)
|
|||
mem_free_dbg(packed);
|
||||
}
|
||||
|
||||
BOOL pfile_open_archive(BOOL a1, unsigned int save_num)
|
||||
BOOL pfile_open_archive(BOOL a1, DWORD save_num)
|
||||
{
|
||||
char FileName[MAX_PATH];
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ BOOL pfile_open_archive(BOOL a1, unsigned int save_num)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void pfile_get_save_path(char *pszBuf, DWORD dwBufSize, unsigned int save_num)
|
||||
void pfile_get_save_path(char *pszBuf, DWORD dwBufSize, DWORD save_num)
|
||||
{
|
||||
DWORD plen;
|
||||
char *s;
|
||||
|
|
@ -134,7 +134,7 @@ void pfile_get_save_path(char *pszBuf, DWORD dwBufSize, unsigned int save_num)
|
|||
_strlwr(pszBuf);
|
||||
}
|
||||
|
||||
void pfile_flush(BOOL is_single_player, unsigned int save_num)
|
||||
void pfile_flush(BOOL is_single_player, DWORD save_num)
|
||||
{
|
||||
char FileName[MAX_PATH];
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ void pfile_flush(BOOL is_single_player, unsigned int save_num)
|
|||
mpqapi_flush_and_close(FileName, is_single_player, save_num);
|
||||
}
|
||||
|
||||
BOOL pfile_create_player_description(char *dst, unsigned int len)
|
||||
BOOL pfile_create_player_description(char *dst, DWORD len)
|
||||
{
|
||||
char desc[128];
|
||||
_uiheroinfo uihero;
|
||||
|
|
@ -163,7 +163,7 @@ BOOL pfile_create_player_description(char *dst, unsigned int len)
|
|||
BOOL pfile_create_save_file(const char *name_1, const char *name_2)
|
||||
{
|
||||
int i;
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
_uiheroinfo uihero;
|
||||
BOOL found = FALSE;
|
||||
|
||||
|
|
@ -229,10 +229,10 @@ unsigned char game_2_ui_class(const PlayerStruct *p)
|
|||
|
||||
BOOL __stdcall pfile_ui_set_hero_infos(BOOL(__stdcall *ui_add_hero_info)(_uiheroinfo *))
|
||||
{
|
||||
unsigned int i, save_num;
|
||||
DWORD i, save_num;
|
||||
char FileName[MAX_PATH];
|
||||
char NewFileName[MAX_PATH];
|
||||
int a1;
|
||||
BOOL showFixedMsg;
|
||||
|
||||
memset(hero_names, 0, sizeof(hero_names));
|
||||
if (gbMaxPlayers > 1) {
|
||||
|
|
@ -266,10 +266,10 @@ BOOL __stdcall pfile_ui_set_hero_infos(BOOL(__stdcall *ui_add_hero_info)(_uihero
|
|||
}
|
||||
}
|
||||
|
||||
a1 = 1;
|
||||
showFixedMsg = TRUE;
|
||||
for (i = 0; i < MAX_CHARACTERS; i++) {
|
||||
PkPlayerStruct pkplr;
|
||||
HANDLE archive = pfile_open_save_archive(&a1, i);
|
||||
HANDLE archive = pfile_open_save_archive(&showFixedMsg, i);
|
||||
if (archive) {
|
||||
if (pfile_read_hero(archive, &pkplr)) {
|
||||
_uiheroinfo uihero;
|
||||
|
|
@ -285,7 +285,7 @@ BOOL __stdcall pfile_ui_set_hero_infos(BOOL(__stdcall *ui_add_hero_info)(_uihero
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
char *GetSaveDirectory(char *dst, int dst_size, unsigned int save_num)
|
||||
char *GetSaveDirectory(char *dst, int dst_size, DWORD save_num)
|
||||
{
|
||||
DWORD dirLen;
|
||||
char FileName[MAX_PATH];
|
||||
|
|
@ -317,11 +317,11 @@ BOOL pfile_read_hero(HANDLE archive, PkPlayerStruct *pPack)
|
|||
HANDLE file;
|
||||
BOOL decoded;
|
||||
DWORD dwlen, nSize;
|
||||
unsigned char *buf;
|
||||
BYTE *buf;
|
||||
|
||||
if (!SFileOpenFileEx(archive, "hero", 0, &file))
|
||||
if (!SFileOpenFileEx(archive, "hero", 0, &file)) {
|
||||
return FALSE;
|
||||
else {
|
||||
} else {
|
||||
BOOL ret = FALSE;
|
||||
char password[16] = PASSWORD_SINGLE;
|
||||
nSize = 16;
|
||||
|
|
@ -356,7 +356,10 @@ BOOL pfile_read_hero(HANDLE archive, PkPlayerStruct *pPack)
|
|||
}
|
||||
}
|
||||
|
||||
HANDLE pfile_open_save_archive(int *unused, unsigned int save_num)
|
||||
/**
|
||||
* @param showFixedMsg Display a dialog if a save file was corrected (deprecated)
|
||||
*/
|
||||
HANDLE pfile_open_save_archive(BOOL *showFixedMsg, DWORD save_num)
|
||||
{
|
||||
char SrcStr[MAX_PATH];
|
||||
HANDLE archive;
|
||||
|
|
@ -372,7 +375,7 @@ void pfile_SFileCloseArchive(HANDLE hsArchive)
|
|||
SFileCloseArchive(hsArchive);
|
||||
}
|
||||
|
||||
BOOL pfile_archive_contains_game(HANDLE hsArchive, unsigned int save_num)
|
||||
BOOL pfile_archive_contains_game(HANDLE hsArchive, DWORD save_num)
|
||||
{
|
||||
HANDLE file;
|
||||
|
||||
|
|
@ -413,7 +416,7 @@ char pfile_get_player_class(unsigned int player_class_nr)
|
|||
|
||||
BOOL __stdcall pfile_ui_save_create(_uiheroinfo *heroinfo)
|
||||
{
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
char cl;
|
||||
PkPlayerStruct pkplr;
|
||||
|
||||
|
|
@ -469,7 +472,7 @@ BOOL __stdcall pfile_get_file_name(DWORD lvl, char *dst)
|
|||
|
||||
BOOL __stdcall pfile_delete_save(_uiheroinfo *hero_info)
|
||||
{
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
char FileName[MAX_PATH];
|
||||
|
||||
save_num = pfile_get_save_num_from_name(hero_info->name);
|
||||
|
|
@ -484,7 +487,7 @@ BOOL __stdcall pfile_delete_save(_uiheroinfo *hero_info)
|
|||
void pfile_read_player_from_save()
|
||||
{
|
||||
HANDLE archive;
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
PkPlayerStruct pkplr;
|
||||
|
||||
save_num = pfile_get_save_num_from_name(gszHero);
|
||||
|
|
@ -511,7 +514,7 @@ void GetTempLevelNames(char *szTemp)
|
|||
|
||||
void GetPermLevelNames(char *szPerm)
|
||||
{
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
BOOL has_file;
|
||||
|
||||
save_num = pfile_get_save_num_from_name(plr[myplr]._pName);
|
||||
|
|
@ -539,7 +542,7 @@ void pfile_get_game_name(char *dst)
|
|||
void pfile_remove_temp_files()
|
||||
{
|
||||
if (gbMaxPlayers <= 1) {
|
||||
unsigned int save_num = pfile_get_save_num_from_name(plr[myplr]._pName);
|
||||
DWORD save_num = pfile_get_save_num_from_name(plr[myplr]._pName);
|
||||
if (!pfile_open_archive(FALSE, save_num))
|
||||
app_fatal("Unable to write to save file archive");
|
||||
mpqapi_remove_hash_entries(GetTempSaveNames);
|
||||
|
|
@ -565,8 +568,7 @@ BOOL __stdcall GetTempSaveNames(DWORD dwIndex, char *szTemp)
|
|||
|
||||
void pfile_rename_temp_to_perm()
|
||||
{
|
||||
unsigned int save_num;
|
||||
unsigned int i;
|
||||
DWORD save_num, i;
|
||||
char TempName[MAX_PATH];
|
||||
char PermName[MAX_PATH];
|
||||
|
||||
|
|
@ -606,7 +608,7 @@ BOOL __stdcall GetPermSaveNames(DWORD dwIndex, char *szPerm)
|
|||
|
||||
void pfile_write_save_file(const char *pszName, BYTE *pbData, DWORD dwLen, DWORD qwLen)
|
||||
{
|
||||
unsigned int save_num;
|
||||
DWORD save_num;
|
||||
char FileName[MAX_PATH];
|
||||
|
||||
pfile_strcpy(FileName, pszName);
|
||||
|
|
@ -631,11 +633,10 @@ void pfile_strcpy(char *dst, const char *src)
|
|||
|
||||
BYTE *pfile_read(const char *pszName, DWORD *pdwLen)
|
||||
{
|
||||
unsigned int save_num;
|
||||
DWORD save_num, nread;
|
||||
char FileName[MAX_PATH];
|
||||
HANDLE archive, save;
|
||||
BYTE *buf;
|
||||
DWORD nread;
|
||||
|
||||
pfile_strcpy(FileName, pszName);
|
||||
save_num = pfile_get_save_num_from_name(plr[myplr]._pName);
|
||||
|
|
|
|||
|
|
@ -7,22 +7,22 @@ extern BOOL gbValidSaveFile; // idb
|
|||
void pfile_init_save_directory();
|
||||
void pfile_check_available_space(char *pszDir);
|
||||
void pfile_write_hero();
|
||||
unsigned int pfile_get_save_num_from_name(const char *name);
|
||||
DWORD pfile_get_save_num_from_name(const char *name);
|
||||
void pfile_encode_hero(const PkPlayerStruct *pPack);
|
||||
BOOL pfile_open_archive(BOOL a1, unsigned int save_num);
|
||||
void pfile_get_save_path(char *pszBuf, DWORD dwBufSize, unsigned int save_num);
|
||||
void pfile_flush(BOOL is_single_player, unsigned int save_num);
|
||||
BOOL pfile_create_player_description(char *dst, unsigned int len);
|
||||
BOOL pfile_open_archive(BOOL a1, DWORD save_num);
|
||||
void pfile_get_save_path(char *pszBuf, DWORD dwBufSize, DWORD save_num);
|
||||
void pfile_flush(BOOL is_single_player, DWORD save_num);
|
||||
BOOL pfile_create_player_description(char *dst, DWORD len);
|
||||
BOOL pfile_create_save_file(const char *name_1, const char *name_2);
|
||||
void pfile_flush_W();
|
||||
void game_2_ui_player(const PlayerStruct *p, _uiheroinfo *heroinfo, BOOL bHasSaveFile);
|
||||
unsigned char game_2_ui_class(const PlayerStruct *p);
|
||||
BOOL __stdcall pfile_ui_set_hero_infos(BOOL(__stdcall *ui_add_hero_info)(_uiheroinfo *));
|
||||
char *GetSaveDirectory(char *dst, int dst_size, unsigned int save_num);
|
||||
char *GetSaveDirectory(char *dst, int dst_size, DWORD save_num);
|
||||
BOOL pfile_read_hero(HANDLE archive, PkPlayerStruct *pPack);
|
||||
HANDLE pfile_open_save_archive(int *unused, unsigned int save_num);
|
||||
HANDLE pfile_open_save_archive(BOOL *showFixedMsg, DWORD save_num);
|
||||
void pfile_SFileCloseArchive(HANDLE hsArchive);
|
||||
BOOL pfile_archive_contains_game(HANDLE hsArchive, unsigned int save_num);
|
||||
BOOL pfile_archive_contains_game(HANDLE hsArchive, DWORD save_num);
|
||||
BOOL __stdcall pfile_ui_set_class_stats(unsigned int player_class_nr, _uidefaultstats *class_stats);
|
||||
char pfile_get_player_class(unsigned int player_class_nr);
|
||||
BOOL __stdcall pfile_ui_save_create(_uiheroinfo *heroinfo);
|
||||
|
|
|
|||
|
|
@ -501,7 +501,9 @@ void ClearPlrRVars(PlayerStruct *p)
|
|||
p->dwReserved[6] = 0;
|
||||
}
|
||||
|
||||
// c: plr_classes value
|
||||
/**
|
||||
* @param c plr_classes value
|
||||
*/
|
||||
void CreatePlayer(int pnum, char c)
|
||||
{
|
||||
char val;
|
||||
|
|
@ -639,7 +641,7 @@ void CreatePlayer(int pnum, char c)
|
|||
}
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
plr[pnum]._pSLvlVisited[i] = 0; // TODO double check size of _pSLvlVisited
|
||||
plr[pnum]._pSLvlVisited[i] = 0;
|
||||
}
|
||||
|
||||
plr[pnum]._pLvlChanging = 0;
|
||||
|
|
@ -911,7 +913,6 @@ void InitPlayer(int pnum, BOOL FirstTime)
|
|||
ScrollInfo._sdir = SDIR_NONE;
|
||||
}
|
||||
}
|
||||
// 52572C: using guessed type int leveldebug;
|
||||
|
||||
void InitMultiView()
|
||||
{
|
||||
|
|
@ -1261,7 +1262,6 @@ void StartWalk(int pnum, int xvel, int yvel, int xadd, int yadd, int EndDir, int
|
|||
ScrollInfo._sdir = sdir;
|
||||
}
|
||||
}
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
|
||||
void StartWalk2(int pnum, int xvel, int yvel, int xoff, int yoff, int xadd, int yadd, int EndDir, int sdir)
|
||||
{
|
||||
|
|
@ -1341,7 +1341,6 @@ void StartWalk2(int pnum, int xvel, int yvel, int xoff, int yoff, int xadd, int
|
|||
ScrollInfo._sdir = sdir;
|
||||
}
|
||||
}
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
|
||||
void StartWalk3(int pnum, int xvel, int yvel, int xoff, int yoff, int xadd, int yadd, int mapx, int mapy, int EndDir, int sdir)
|
||||
{
|
||||
|
|
@ -1422,7 +1421,6 @@ void StartWalk3(int pnum, int xvel, int yvel, int xoff, int yoff, int xadd, int
|
|||
ScrollInfo._sdir = sdir;
|
||||
}
|
||||
}
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
|
||||
void StartAttack(int pnum, int d)
|
||||
{
|
||||
|
|
@ -1906,7 +1904,6 @@ void DropHalfPlayersGold(int pnum)
|
|||
}
|
||||
plr[pnum]._pGold = CalculateGold(pnum);
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void SyncPlrKill(int pnum, int earflag)
|
||||
{
|
||||
|
|
@ -1984,7 +1981,6 @@ void InitLevelChange(int pnum)
|
|||
plr[pnum].pLvlLoad = 10;
|
||||
}
|
||||
}
|
||||
// 646D00: using guessed type char qtextflag;
|
||||
|
||||
void StartNewLvl(int pnum, int fom, int lvl)
|
||||
{
|
||||
|
|
@ -2808,7 +2804,7 @@ BOOL PM_DoSpell(int pnum)
|
|||
plr[pnum].WorldY,
|
||||
plr[pnum]._pVar1,
|
||||
plr[pnum]._pVar2,
|
||||
FALSE,
|
||||
0,
|
||||
plr[pnum]._pVar4);
|
||||
|
||||
if (!plr[pnum]._pSplFrom) {
|
||||
|
|
@ -2848,7 +2844,6 @@ BOOL PM_DoSpell(int pnum)
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
BOOL PM_DoGotHit(int pnum)
|
||||
{
|
||||
|
|
@ -2960,7 +2955,6 @@ BOOL PM_DoDeath(int pnum)
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
// 69B7C4: using guessed type int deathdelay;
|
||||
|
||||
BOOL PM_DoNewLvl(int pnum)
|
||||
{
|
||||
|
|
@ -3456,7 +3450,6 @@ void ProcessPlayers()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 52A554: using guessed type int sfxdelay;
|
||||
|
||||
void CheckCheatStats(int pnum)
|
||||
{
|
||||
|
|
@ -3690,7 +3683,6 @@ void CheckPlrSpell()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
|
||||
void SyncPlrAnim(int pnum)
|
||||
{
|
||||
|
|
@ -4137,6 +4129,5 @@ void PlayDungMsgs()
|
|||
sfxdelay = 0;
|
||||
}
|
||||
}
|
||||
// 52A554: using guessed type int sfxdelay;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ void SyncPortals()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void AddInTownPortal(int i)
|
||||
{
|
||||
|
|
@ -147,7 +146,6 @@ void GetPortalLevel()
|
|||
}
|
||||
}
|
||||
}
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
|
||||
void GetPortalLvlPos()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -128,76 +128,72 @@ void InitQuests()
|
|||
|
||||
void CheckQuests()
|
||||
{
|
||||
//int v0; // eax
|
||||
unsigned char *v1; // esi
|
||||
unsigned char v2; // cl
|
||||
int i, rportx, rporty;
|
||||
|
||||
//_LOBYTE(v0) = QuestStatus(QTYPE_VB);
|
||||
if (QuestStatus(QTYPE_VB)) {
|
||||
if (gbMaxPlayers == 1)
|
||||
goto LABEL_6;
|
||||
if (quests[QTYPE_VB]._qvar1 == 2) {
|
||||
AddObject(OBJ_ALTBOY, 2 * setpc_x + 20, 2 * setpc_y + 22);
|
||||
quests[QTYPE_VB]._qvar1 = 3;
|
||||
NetSendCmdQuest(TRUE, 0xFu);
|
||||
}
|
||||
if(QuestStatus(QTYPE_VB) && gbMaxPlayers != 1 && quests[QTYPE_VB]._qvar1 == 2) {
|
||||
AddObject(OBJ_ALTBOY, 2 * setpc_x + 20, 2 * setpc_y + 22);
|
||||
quests[QTYPE_VB]._qvar1 = 3;
|
||||
NetSendCmdQuest(TRUE, QTYPE_VB);
|
||||
}
|
||||
if (gbMaxPlayers != 1)
|
||||
|
||||
if(gbMaxPlayers != 1) {
|
||||
return;
|
||||
LABEL_6:
|
||||
if (currlevel == quests[QTYPE_VB]._qlevel && !setlevel && quests[QTYPE_VB]._qvar1 >= 2u) {
|
||||
if (quests[QTYPE_VB]._qactive != 2 && quests[QTYPE_VB]._qactive != 3)
|
||||
goto LABEL_29;
|
||||
if (!quests[QTYPE_VB]._qvar2 || quests[QTYPE_VB]._qvar2 == 2) {
|
||||
quests[QTYPE_VB]._qtx = 2 * quests[QTYPE_VB]._qtx + 16;
|
||||
quests[QTYPE_VB]._qty = 2 * quests[QTYPE_VB]._qty + 16;
|
||||
AddMissile(quests[QTYPE_VB]._qtx, quests[QTYPE_VB]._qty, quests[QTYPE_VB]._qtx, quests[QTYPE_VB]._qty, 0, MIS_RPORTAL, 0, myplr, 0, 0);
|
||||
quests[QTYPE_VB]._qvar2 = 1;
|
||||
if (quests[QTYPE_VB]._qactive == 2)
|
||||
quests[QTYPE_VB]._qvar1 = 3;
|
||||
}
|
||||
|
||||
if(currlevel == quests[QTYPE_VB]._qlevel
|
||||
&& !setlevel
|
||||
&& quests[QTYPE_VB]._qvar1 >= 2
|
||||
&& (quests[QTYPE_VB]._qactive == 2 || quests[QTYPE_VB]._qactive == 3)
|
||||
&& (quests[QTYPE_VB]._qvar2 == 0 || quests[QTYPE_VB]._qvar2 == 2)) {
|
||||
quests[QTYPE_VB]._qtx = 2 * quests[QTYPE_VB]._qtx + 16;
|
||||
quests[QTYPE_VB]._qty = 2 * quests[QTYPE_VB]._qty + 16;
|
||||
rportx = quests[QTYPE_VB]._qtx;
|
||||
rporty = quests[QTYPE_VB]._qty;
|
||||
AddMissile(rportx, rporty, rportx, rporty, 0, MIS_RPORTAL, 0, myplr, 0, 0);
|
||||
quests[QTYPE_VB]._qvar2 = 1;
|
||||
if(quests[QTYPE_VB]._qactive == 2) {
|
||||
quests[QTYPE_VB]._qvar1 = 3;
|
||||
}
|
||||
}
|
||||
if (quests[QTYPE_VB]._qactive == 3) {
|
||||
if (!setlevel)
|
||||
goto LABEL_29;
|
||||
if (setlvlnum == SL_VILEBETRAYER && quests[QTYPE_VB]._qvar2 == 4) {
|
||||
AddMissile(35, 32, 35, 32, 0, MIS_RPORTAL, 0, myplr, 0, 0);
|
||||
quests[QTYPE_VB]._qvar2 = 3;
|
||||
}
|
||||
|
||||
if(quests[QTYPE_VB]._qactive == 3
|
||||
&& setlevel
|
||||
&& setlvlnum == SL_VILEBETRAYER
|
||||
&& quests[QTYPE_VB]._qvar2 == 4) {
|
||||
rportx = 35;
|
||||
rporty = 32;
|
||||
AddMissile(rportx, rporty, rportx, rporty, 0, MIS_RPORTAL, 0, myplr, 0, 0);
|
||||
quests[QTYPE_VB]._qvar2 = 3;
|
||||
}
|
||||
if (setlevel) {
|
||||
if (setlvlnum == quests[QTYPE_PW]._qslvl
|
||||
&& quests[QTYPE_PW]._qactive != 1
|
||||
&& leveltype == quests[QTYPE_PW]._qlvltype
|
||||
&& nummonsters == 4
|
||||
&& quests[QTYPE_PW]._qactive != 3) {
|
||||
|
||||
if(setlevel) {
|
||||
if(setlvlnum == quests[QTYPE_PW]._qslvl
|
||||
&& quests[QTYPE_PW]._qactive != 1
|
||||
&& leveltype == quests[QTYPE_PW]._qlvltype
|
||||
&& nummonsters == 4
|
||||
&& quests[QTYPE_PW]._qactive != 3) {
|
||||
quests[QTYPE_PW]._qactive = 3;
|
||||
PlaySfxLoc(IS_QUESTDN, plr[myplr].WorldX, plr[myplr].WorldY);
|
||||
LoadPalette("Levels\\L3Data\\L3pwater.pal");
|
||||
WaterDone = 32;
|
||||
}
|
||||
if (WaterDone > 0) {
|
||||
if(WaterDone > 0) {
|
||||
palette_update_quest_palette(WaterDone);
|
||||
--WaterDone;
|
||||
WaterDone--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
LABEL_29:
|
||||
if (plr[myplr]._pmode == PM_STAND) {
|
||||
v1 = &quests[0]._qactive;
|
||||
do {
|
||||
if (currlevel == *(v1 - 2)) {
|
||||
v2 = v1[10];
|
||||
if (v2) {
|
||||
if (*v1 && plr[myplr].WorldX == *(_DWORD *)(v1 + 2) && plr[myplr].WorldY == *(_DWORD *)(v1 + 6)) {
|
||||
if (v1[1] != -1)
|
||||
setlvltype = v1[1];
|
||||
StartNewLvl(myplr, WM_DIABSETLVL, v2);
|
||||
}
|
||||
} else if(plr[myplr]._pmode == PM_STAND) {
|
||||
for(i = 0; i < MAXQUESTS; i++) {
|
||||
if(currlevel == quests[i]._qlevel
|
||||
&& quests[i]._qslvl != 0
|
||||
&& quests[i]._qactive != 0
|
||||
&& plr[myplr].WorldX == quests[i]._qtx
|
||||
&& plr[myplr].WorldY == quests[i]._qty) {
|
||||
if(quests[i]._qlvltype != 255) {
|
||||
setlvltype = quests[i]._qlvltype;
|
||||
}
|
||||
StartNewLvl(myplr, WM_DIABSETLVL, quests[i]._qslvl);
|
||||
}
|
||||
v1 += 24;
|
||||
} while ((signed int)v1 < (signed int)&quests[MAXQUESTS]._qactive);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 5BB1ED: using guessed type char leveltype;
|
||||
|
|
@ -711,7 +707,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, (BYTE *)pCelBuff, ALLQUESTS, 12);
|
||||
CelDecodeOnly(cjustflag ? x + k + 76 : x + 76, s + 205, pCelBuff, ALLQUESTS, 12);
|
||||
}
|
||||
for (i = 0; i < len; i++) {
|
||||
c = fontframe[gbFontTransTbl[(BYTE)str[i]]];
|
||||
|
|
@ -722,7 +718,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, (BYTE *)pCelBuff, ALLQUESTS, 12);
|
||||
CelDecodeOnly(cjustflag ? x + k + 100 : 340 - x, s + 205, pCelBuff, ALLQUESTS, 12);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,25 +3,25 @@
|
|||
|
||||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
int light_table_index; // weak
|
||||
int light_table_index;
|
||||
int PitchTbl[1024];
|
||||
DWORD sgdwCursWdtOld; // idb
|
||||
DWORD sgdwCursX; // idb
|
||||
DWORD sgdwCursY; // idb
|
||||
unsigned char *gpBufEnd; // weak
|
||||
DWORD sgdwCursWdtOld;
|
||||
DWORD sgdwCursX;
|
||||
DWORD sgdwCursY;
|
||||
BYTE *gpBufEnd;
|
||||
DWORD sgdwCursHgt;
|
||||
DWORD level_cel_block; // weak
|
||||
DWORD sgdwCursXOld; // idb
|
||||
DWORD sgdwCursYOld; // idb
|
||||
char arch_draw_type; // weak
|
||||
DWORD level_cel_block;
|
||||
DWORD sgdwCursXOld;
|
||||
DWORD sgdwCursYOld;
|
||||
char arch_draw_type;
|
||||
DDSURFACEDESC DDS_desc;
|
||||
int cel_transparency_active; // weak
|
||||
int level_piece_id; // weak
|
||||
int level_piece_id;
|
||||
DWORD sgdwCursWdt;
|
||||
void(*DrawPlrProc)(int, int, int, int, int, BYTE *, int, int, int, int);
|
||||
BYTE sgSaveBack[8192];
|
||||
int draw_monster_num; // weak
|
||||
DWORD sgdwCursHgtOld; // idb
|
||||
int draw_monster_num;
|
||||
DWORD sgdwCursHgtOld;
|
||||
|
||||
/* data */
|
||||
|
||||
|
|
@ -298,9 +298,6 @@ void DrawPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, int nCel
|
|||
}
|
||||
}
|
||||
}
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
// 5CF31D: using guessed type char setlevel;
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
|
||||
void DrawClippedPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int CelCap)
|
||||
{
|
||||
|
|
@ -374,8 +371,6 @@ void DrawClippedPlayer(int pnum, int x, int y, int px, int py, BYTE *pCelBuff, i
|
|||
}
|
||||
}
|
||||
}
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
|
||||
void DrawView(int StartX, int StartY)
|
||||
{
|
||||
|
|
@ -433,12 +428,6 @@ void DrawView(int StartX, int StartY)
|
|||
DrawLifeFlask();
|
||||
DrawManaFlask();
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 4B8C98: using guessed type int spselflag;
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
// 525740: using guessed type int PauseMode;
|
||||
// 52B9F1: using guessed type char msgflag;
|
||||
// 646D00: using guessed type char qtextflag;
|
||||
|
||||
void DrawGame(int x, int y)
|
||||
{
|
||||
|
|
@ -541,13 +530,6 @@ void DrawGame(int x, int y)
|
|||
sy += 16;
|
||||
}
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 5C2FF8: using guessed type int dword_5C2FF8;
|
||||
// 5C2FFC: using guessed type int dword_5C2FFC;
|
||||
// 5C3000: using guessed type int scr_pix_width;
|
||||
// 5C3004: using guessed type int scr_pix_height;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
// 69CF20: using guessed type char arch_draw_type;
|
||||
|
||||
void scrollrt_draw_lower(int x, int y, int sx, int sy, int chunks, int eflag)
|
||||
{
|
||||
|
|
@ -697,11 +679,6 @@ void scrollrt_draw_lower(int x, int y, int sx, int sy, int chunks, int eflag)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
// 69CF20: using guessed type char arch_draw_type;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69CF98: using guessed type int level_piece_id;
|
||||
|
||||
void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, int dy, int eflag)
|
||||
{
|
||||
|
|
@ -916,13 +893,6 @@ void scrollrt_draw_clipped_dungeon(BYTE *pBuff, int sx, int sy, int dx, int dy,
|
|||
Cel2DecodeLightTrans(pBuff, (BYTE *)level_special_cel, bArch, 64, 0, 8);
|
||||
}
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 525720: using guessed type int visiondebug;
|
||||
// 642A14: using guessed type char lightmax;
|
||||
// 64CCD4: using guessed type int MissilePreFlag;
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69EFA4: using guessed type int draw_monster_num;
|
||||
|
||||
void DrawClippedMonster(int x, int y, int mx, int my, int m, int CelSkip, int CelCap)
|
||||
{
|
||||
|
|
@ -976,7 +946,6 @@ void DrawClippedMonster(int x, int y, int mx, int my, int m, int CelSkip, int Ce
|
|||
Cl2DecodeFrm6(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap);
|
||||
}
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
|
||||
void DrawClippedObject(int x, int y, int ox, int oy, BOOL pre, int CelSkip, int CelCap)
|
||||
{
|
||||
|
|
@ -1027,7 +996,6 @@ void DrawClippedObject(int x, int y, int ox, int oy, BOOL pre, int CelSkip, int
|
|||
else
|
||||
Cel2DrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
|
||||
}
|
||||
// 4B8CC1: using guessed type char pcursobj;
|
||||
|
||||
void scrollrt_draw_clipped_e_flag(BYTE *pBuff, int x, int y, int a4, int a5)
|
||||
{
|
||||
|
|
@ -1076,11 +1044,6 @@ void scrollrt_draw_clipped_e_flag(BYTE *pBuff, int x, int y, int a4, int a5)
|
|||
cel_transparency_active = cta_old;
|
||||
level_piece_id = lpi_old;
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
// 69CF20: using guessed type char arch_draw_type;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69CF98: using guessed type int level_piece_id;
|
||||
|
||||
void scrollrt_draw_lower_2(int x, int y, int sx, int sy, int chunks, int skipChunks, int eflag)
|
||||
{
|
||||
|
|
@ -1180,10 +1143,6 @@ void scrollrt_draw_lower_2(int x, int y, int sx, int sy, int chunks, int skipChu
|
|||
}
|
||||
}
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69CF98: using guessed type int level_piece_id;
|
||||
|
||||
void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int skipChunks, int CelSkip, int dx, int dy, int eflag)
|
||||
{
|
||||
|
|
@ -1398,13 +1357,6 @@ void scrollrt_draw_clipped_dungeon_2(BYTE *pBuff, int sx, int sy, int skipChunks
|
|||
Cel2DecodeLightTrans(pBuff, (BYTE *)level_special_cel, bArch, 64, CelSkip, 8);
|
||||
}
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 525720: using guessed type int visiondebug;
|
||||
// 642A14: using guessed type char lightmax;
|
||||
// 64CCD4: using guessed type int MissilePreFlag;
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69EFA4: using guessed type int draw_monster_num;
|
||||
|
||||
void scrollrt_draw_clipped_e_flag_2(BYTE *pBuff, int x, int y, int skipChunks, signed int CelSkip, int sx, int sy)
|
||||
{
|
||||
|
|
@ -1473,10 +1425,6 @@ void scrollrt_draw_clipped_e_flag_2(BYTE *pBuff, int x, int y, int skipChunks, s
|
|||
cel_transparency_active = cta_old;
|
||||
level_piece_id = lpi_old;
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69CF98: using guessed type int level_piece_id;
|
||||
|
||||
void scrollrt_draw_upper(int x, int y, int sx, int sy, int chunks, int capChunks, int eflag)
|
||||
{
|
||||
|
|
@ -1623,11 +1571,6 @@ void scrollrt_draw_upper(int x, int y, int sx, int sy, int chunks, int capChunks
|
|||
}
|
||||
}
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
// 69CF20: using guessed type char arch_draw_type;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69CF98: using guessed type int level_piece_id;
|
||||
|
||||
void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, int CelCap, int dx, int dy, int eflag)
|
||||
{
|
||||
|
|
@ -1828,13 +1771,6 @@ void scrollrt_draw_dungeon(BYTE *pBuff, int sx, int sy, int capChunks, int CelCa
|
|||
CelDecodeHdrLightTrans(pBuff, (BYTE *)level_special_cel, bArch, 64, 0, CelCap);
|
||||
}
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 525720: using guessed type int visiondebug;
|
||||
// 642A14: using guessed type char lightmax;
|
||||
// 64CCD4: using guessed type int MissilePreFlag;
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69EFA4: using guessed type int draw_monster_num;
|
||||
|
||||
void DrawMonster(int x, int y, int mx, int my, int m, int CelSkip, int CelCap)
|
||||
{
|
||||
|
|
@ -1888,7 +1824,6 @@ void DrawMonster(int x, int y, int mx, int my, int m, int CelSkip, int CelCap)
|
|||
Cl2DecodeLightTbl(mx, my, monster[m]._mAnimData, monster[m]._mAnimFrame, monster[m].MType->width, CelSkip, CelCap);
|
||||
}
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
|
||||
void DrawObject(int x, int y, int ox, int oy, BOOL pre, int CelSkip, int CelCap)
|
||||
{
|
||||
|
|
@ -1942,7 +1877,6 @@ void DrawObject(int x, int y, int ox, int oy, BOOL pre, int CelSkip, int CelCap)
|
|||
CelDrawHdrOnly(sx, sy, object[bv]._oAnimData, object[bv]._oAnimFrame, object[bv]._oAnimWidth, CelSkip, CelCap);
|
||||
}
|
||||
}
|
||||
// 4B8CC1: using guessed type char pcursobj;
|
||||
|
||||
void scrollrt_draw_e_flag(BYTE *pBuff, int x, int y, int capChunks, int CelCap, int sx, int sy)
|
||||
{
|
||||
|
|
@ -1992,11 +1926,6 @@ void scrollrt_draw_e_flag(BYTE *pBuff, int x, int y, int capChunks, int CelCap,
|
|||
cel_transparency_active = cta_old;
|
||||
level_piece_id = lpi_old;
|
||||
}
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
// 69CF20: using guessed type char arch_draw_type;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 69CF98: using guessed type int level_piece_id;
|
||||
|
||||
void DrawZoom(int x, int y)
|
||||
{
|
||||
|
|
@ -2154,13 +2083,6 @@ void DrawZoom(int x, int y)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 5C2FF8: using guessed type int dword_5C2FF8;
|
||||
// 5C2FFC: using guessed type int dword_5C2FFC;
|
||||
// 5C3000: using guessed type int scr_pix_width;
|
||||
// 5C3004: using guessed type int scr_pix_height;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
// 69CF20: using guessed type char arch_draw_type;
|
||||
|
||||
void ClearScreenBuffer()
|
||||
{
|
||||
|
|
@ -2306,7 +2228,6 @@ void scrollrt_draw_game_screen(BOOL draw_cursor)
|
|||
unlock_buf(0);
|
||||
}
|
||||
}
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
void scrollrt_draw_cursor_back_buffer()
|
||||
{
|
||||
|
|
@ -2405,8 +2326,6 @@ void scrollrt_draw_cursor_item()
|
|||
Cel2DrawHdrOnly(mx + 64, my + cursH + 160 - 1, (BYTE *)pCursCels, pcurs, cursW, 0, 8);
|
||||
}
|
||||
}
|
||||
// 4B8C9C: using guessed type int cursH;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
void DrawMain(int dwHgt, BOOL draw_desc, BOOL draw_hp, BOOL draw_mana, BOOL draw_sbar, BOOL draw_btn)
|
||||
{
|
||||
|
|
@ -2526,24 +2445,21 @@ void DrawMain(int dwHgt, BOOL draw_desc, BOOL draw_hp, BOOL draw_mana, BOOL draw
|
|||
DrawFPS();
|
||||
#endif
|
||||
}
|
||||
// 634980: using guessed type int gbActive;
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void DrawFPS()
|
||||
{
|
||||
DWORD v0; // eax
|
||||
int v1; // esi
|
||||
char String[12]; // [esp+8h] [ebp-10h]
|
||||
HDC hdc; // [esp+14h] [ebp-4h]
|
||||
DWORD tc, frames;
|
||||
char String[12];
|
||||
HDC hdc;
|
||||
|
||||
if (frameflag && gbActive) {
|
||||
++frameend;
|
||||
v0 = GetTickCount();
|
||||
v1 = v0 - framestart;
|
||||
if (v0 - framestart >= 1000) {
|
||||
framestart = v0;
|
||||
framerate = 1000 * frameend / v1;
|
||||
frameend++;
|
||||
tc = GetTickCount();
|
||||
frames = tc - framestart;
|
||||
if (tc - framestart >= 1000) {
|
||||
framestart = tc;
|
||||
framerate = 1000 * frameend / frames;
|
||||
frameend = 0;
|
||||
}
|
||||
if (framerate > 99)
|
||||
|
|
@ -2727,7 +2643,5 @@ void DrawAndBlit()
|
|||
drawbtnflag = FALSE;
|
||||
drawsbarflag = FALSE;
|
||||
}
|
||||
// 4B8960: using guessed type int talkflag;
|
||||
// 52571C: using guessed type int drawpanflag;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
#ifndef __SCROLLRT_H__
|
||||
#define __SCROLLRT_H__
|
||||
|
||||
extern int light_table_index; // weak
|
||||
extern int light_table_index;
|
||||
extern int PitchTbl[1024];
|
||||
extern unsigned char *gpBufEnd; // weak
|
||||
extern DWORD level_cel_block; // weak
|
||||
extern char arch_draw_type; // weak
|
||||
extern BYTE *gpBufEnd;
|
||||
extern DWORD level_cel_block;
|
||||
extern char arch_draw_type;
|
||||
extern DDSURFACEDESC DDS_desc;
|
||||
extern int cel_transparency_active; // weak
|
||||
extern int level_piece_id; // weak
|
||||
extern int level_piece_id;
|
||||
extern void (*DrawPlrProc)(int, int, int, int, int, BYTE *, int, int, int, int);
|
||||
extern int draw_monster_num; // weak
|
||||
extern int draw_monster_num;
|
||||
|
||||
void ClearCursor();
|
||||
void DrawMissile(int x, int y, int sx, int sy, int CelSkip, int capChunks, BOOL pre);
|
||||
|
|
|
|||
|
|
@ -50,8 +50,7 @@ void SHA1Input(SHA1Context *context, const char *message_array, int len)
|
|||
|
||||
void SHA1ProcessMessageBlock(SHA1Context *context)
|
||||
{
|
||||
int i;
|
||||
int temp;
|
||||
int i, temp;
|
||||
int W[80];
|
||||
int A, B, C, D, E;
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,6 @@ TSnd *sound_file_load(char *path)
|
|||
|
||||
return pSnd;
|
||||
}
|
||||
// 456F07: could not find valid save-restore pair for esi
|
||||
|
||||
void sound_CreateSoundBuffer(TSnd *sound_file)
|
||||
{
|
||||
|
|
@ -391,7 +390,6 @@ void sound_create_primary_buffer(HANDLE music_track)
|
|||
#endif
|
||||
}
|
||||
}
|
||||
// 69F100: using guessed type int sglpDSB;
|
||||
|
||||
HRESULT sound_DirectSoundCreate(LPGUID lpGuid, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,8 +27,7 @@ int GetManaAmount(int id, int sn)
|
|||
adj = sl * (spelldata[SPL_RESURRECT].sManaCost / 8);
|
||||
}
|
||||
|
||||
if (spelldata[sn].sManaCost == 255) // TODO: check sign
|
||||
{
|
||||
if (spelldata[sn].sManaCost == 255) {
|
||||
i = (BYTE)plr[id]._pMaxManaBase;
|
||||
} else {
|
||||
i = spelldata[sn].sManaCost;
|
||||
|
|
@ -107,17 +106,16 @@ BOOL CheckSpell(int id, int sn, BYTE st, BOOL manaonly)
|
|||
return result;
|
||||
}
|
||||
|
||||
void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, BOOL caster, int spllvl)
|
||||
void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int spllvl)
|
||||
{
|
||||
int i;
|
||||
int dir; // missile direction
|
||||
|
||||
// ugly switch, but generates the right code
|
||||
switch (caster) {
|
||||
case TRUE:
|
||||
case 1:
|
||||
dir = monster[id]._mdir;
|
||||
break;
|
||||
case FALSE:
|
||||
case 0:
|
||||
// caster must be 0 already in this case, but oh well,
|
||||
// it's needed to generate the right code
|
||||
caster = 0;
|
||||
|
|
@ -145,8 +143,10 @@ void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, BOOL caster, int
|
|||
}
|
||||
}
|
||||
|
||||
// pnum: player index
|
||||
// rid: target player index
|
||||
/**
|
||||
* @param pnum player index
|
||||
* @param rid target player index
|
||||
*/
|
||||
void DoResurrect(int pnum, int rid)
|
||||
{
|
||||
int hp;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
int GetManaAmount(int id, int sn);
|
||||
void UseMana(int id, int sn);
|
||||
BOOL CheckSpell(int id, int sn, BYTE st, BOOL manaonly);
|
||||
void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, BOOL caster, int spllvl);
|
||||
void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int spllvl);
|
||||
void DoResurrect(int pnum, int rid);
|
||||
void PlacePlayer(int pnum);
|
||||
void DoHealOther(int pnum, int rid);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ int stextvhold; // weak
|
|||
int stextsel; // weak
|
||||
char stextscrldbtn; // weak
|
||||
int gossipend; // weak
|
||||
void *pCelBuff;
|
||||
BYTE *pCelBuff;
|
||||
int stextsval; // idb
|
||||
int boylevel; // weak
|
||||
ItemStruct smithitem[20];
|
||||
|
|
@ -199,7 +199,7 @@ void PrintSString(int x, int y, unsigned char cjustflag, char *str, int col, int
|
|||
v14 = v27 + v30 + v8 - 20;
|
||||
else
|
||||
v14 = v27 + v8 - 20;
|
||||
CelDecodeOnly(v14, v6 + 205, (BYTE *)pCelBuff, InStoreFlag, 12);
|
||||
CelDecodeOnly(v14, v6 + 205, pCelBuff, InStoreFlag, 12);
|
||||
}
|
||||
v29 = 0;
|
||||
if (v28 > 0) {
|
||||
|
|
@ -233,7 +233,7 @@ void PrintSString(int x, int y, unsigned char cjustflag, char *str, int col, int
|
|||
v22 = v27 + v30 + v8 + 4;
|
||||
else
|
||||
v22 = 660 - v8;
|
||||
CelDecodeOnly(v22, v6 + 205, (BYTE *)pCelBuff, InStoreFlag, 12);
|
||||
CelDecodeOnly(v22, v6 + 205, pCelBuff, InStoreFlag, 12);
|
||||
}
|
||||
}
|
||||
// 6A8A28: using guessed type int stextsel;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ extern int stextvhold; // weak
|
|||
extern int stextsel; // weak
|
||||
extern char stextscrldbtn; // weak
|
||||
extern int gossipend; // weak
|
||||
extern void *pCelBuff;
|
||||
extern BYTE *pCelBuff;
|
||||
extern int stextsval; // idb
|
||||
extern int boylevel; // weak
|
||||
extern ItemStruct smithitem[20];
|
||||
|
|
|
|||
|
|
@ -221,7 +221,6 @@ DWORD sync_update(int pnum, const BYTE *pbBuf)
|
|||
|
||||
return pHdr->wLen + sizeof(*pHdr);
|
||||
}
|
||||
// 676194: using guessed type char gbBufferMsgs;
|
||||
|
||||
void sync_monster(int pnum, const TSyncMonster *p)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
DEVILUTION_BEGIN_NAMESPACE
|
||||
|
||||
int numthemes; // idb
|
||||
int numthemes;
|
||||
BOOL armorFlag;
|
||||
BOOL ThemeGoodIn[4];
|
||||
BOOL weaponFlag;
|
||||
|
|
@ -11,9 +11,9 @@ BOOL mFountainFlag;
|
|||
BOOL cauldronFlag;
|
||||
BOOL tFountainFlag;
|
||||
int zharlib;
|
||||
int themex; // idb
|
||||
int themey; // idb
|
||||
int themeVar1; // idb
|
||||
int themex;
|
||||
int themey;
|
||||
int themeVar1;
|
||||
ThemeStruct themes[MAXTHEMES];
|
||||
BOOL pFountainFlag;
|
||||
BOOL bFountainFlag;
|
||||
|
|
@ -264,11 +264,6 @@ BOOL CheckThemeReqs(int t)
|
|||
|
||||
return rv;
|
||||
}
|
||||
// 6AAA58: using guessed type int mFountainFlag;
|
||||
// 6AAA5C: using guessed type int cauldronFlag;
|
||||
// 6AAA60: using guessed type int tFountainFlag;
|
||||
// 6AAC08: using guessed type int pFountainFlag;
|
||||
// 6AAC0C: using guessed type int bFountainFlag;
|
||||
|
||||
BOOL SpecialThemeFit(int i, int t)
|
||||
{
|
||||
|
|
@ -364,7 +359,7 @@ BOOL CheckThemeRoom(int tv)
|
|||
tarea = 0;
|
||||
for (j = 0; j < MAXDUNY; j++) {
|
||||
for (i = 0; i < MAXDUNX; i++) {
|
||||
if (dTransVal[i][j] == tv)
|
||||
if (dTransVal[i][j] != tv)
|
||||
continue;
|
||||
if (dFlags[i][j] & DFLAG_POPULATED)
|
||||
return FALSE;
|
||||
|
|
@ -457,12 +452,6 @@ void InitThemes()
|
|||
numthemes += themeCount;
|
||||
}
|
||||
}
|
||||
// 6AAA54: using guessed type int treasureFlag;
|
||||
// 6AAA58: using guessed type int mFountainFlag;
|
||||
// 6AAA5C: using guessed type int cauldronFlag;
|
||||
// 6AAA60: using guessed type int tFountainFlag;
|
||||
// 6AAC08: using guessed type int pFountainFlag;
|
||||
// 6AAC0C: using guessed type int bFountainFlag;
|
||||
|
||||
// HoldThemeRooms marks theme rooms as populated.
|
||||
void HoldThemeRooms()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#ifndef __THEMES_H__
|
||||
#define __THEMES_H__
|
||||
|
||||
extern int numthemes; // idb
|
||||
extern int numthemes;
|
||||
extern BOOL armorFlag;
|
||||
extern BOOL ThemeGoodIn[4];
|
||||
extern BOOL weaponFlag;
|
||||
|
|
@ -11,9 +11,9 @@ extern BOOL mFountainFlag;
|
|||
extern BOOL cauldronFlag;
|
||||
extern BOOL tFountainFlag;
|
||||
extern int zharlib;
|
||||
extern int themex; // idb
|
||||
extern int themey; // idb
|
||||
extern int themeVar1; // idb
|
||||
extern int themex;
|
||||
extern int themey;
|
||||
extern int themeVar1;
|
||||
extern ThemeStruct themes[MAXTHEMES];
|
||||
extern BOOL pFountainFlag;
|
||||
extern BOOL bFountainFlag;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ void town_clear_upper_buf(BYTE *pBuff)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
void town_clear_low_buf(BYTE *pBuff)
|
||||
{
|
||||
|
|
@ -140,7 +139,6 @@ void town_clear_low_buf(BYTE *pBuff)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
void town_draw_clipped_e_flag(BYTE *pBuff, int x, int y, int sx, int sy)
|
||||
{
|
||||
|
|
@ -165,7 +163,6 @@ void town_draw_clipped_e_flag(BYTE *pBuff, int x, int y, int sx, int sy)
|
|||
|
||||
town_draw_clipped_town(pBuff, x, y, sx, sy, 0);
|
||||
}
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
|
||||
void town_draw_clipped_town(BYTE *pBuff, int x, int y, int sx, int sy, BOOL some_flag)
|
||||
{
|
||||
|
|
@ -231,8 +228,6 @@ void town_draw_clipped_town(BYTE *pBuff, int x, int y, int sx, int sy, BOOL some
|
|||
DrawClippedMissile(x, y, sx, sy, 0, 8, 0);
|
||||
}
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
|
||||
void town_draw_lower(int x, int y, int sx, int sy, int a5, int some_flag)
|
||||
{
|
||||
|
|
@ -318,7 +313,6 @@ void town_draw_lower(int x, int y, int sx, int sy, int a5, int some_flag)
|
|||
}
|
||||
}
|
||||
}
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
|
||||
void town_draw_clipped_e_flag_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy)
|
||||
{
|
||||
|
|
@ -352,7 +346,6 @@ void town_draw_clipped_e_flag_2(BYTE *pBuff, int x, int y, int a4, int a5, int s
|
|||
town_draw_clipped_town_2(pBuff, x, y, a4, a5, sx, sy, 0);
|
||||
}
|
||||
}
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
|
||||
void town_draw_clipped_town_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx, int sy, BOOL some_flag)
|
||||
{
|
||||
|
|
@ -414,8 +407,6 @@ void town_draw_clipped_town_2(BYTE *pBuff, int x, int y, int a4, int a5, int sx,
|
|||
DrawClippedMissile(x, y, sx, sy, a5, 8, 0);
|
||||
}
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
|
||||
void town_draw_lower_2(int x, int y, int sx, int sy, int a5, int a6, int some_flag)
|
||||
{
|
||||
|
|
@ -515,7 +506,6 @@ void town_draw_lower_2(int x, int y, int sx, int sy, int a5, int a6, int some_fl
|
|||
}
|
||||
}
|
||||
}
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
|
||||
void town_draw_e_flag(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy)
|
||||
{
|
||||
|
|
@ -542,7 +532,6 @@ void town_draw_e_flag(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy
|
|||
|
||||
town_draw_town_all(pBuff, x, y, a4, dir, sx, sy, 0);
|
||||
}
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
|
||||
void town_draw_town_all(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int sy, BOOL some_flag)
|
||||
{
|
||||
|
|
@ -609,8 +598,6 @@ void town_draw_town_all(BYTE *pBuff, int x, int y, int a4, int dir, int sx, int
|
|||
DrawMissile(x, y, sx, sy, 0, dir, 0);
|
||||
}
|
||||
}
|
||||
// 4B8CC0: using guessed type char pcursitem;
|
||||
// 4B8CC2: using guessed type char pcursplr;
|
||||
|
||||
void town_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag)
|
||||
{
|
||||
|
|
@ -707,7 +694,6 @@ void town_draw_upper(int x, int y, int sx, int sy, int a5, int a6, int some_flag
|
|||
}
|
||||
}
|
||||
}
|
||||
// 69CF14: using guessed type int level_cel_block;
|
||||
|
||||
void T_DrawGame(int x, int y)
|
||||
{
|
||||
|
|
@ -821,12 +807,6 @@ void T_DrawGame(int x, int y)
|
|||
sy += 16;
|
||||
}
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 5C2FF8: using guessed type int dword_5C2FF8;
|
||||
// 5C2FFC: using guessed type int dword_5C2FFC;
|
||||
// 5C3000: using guessed type int scr_pix_width;
|
||||
// 5C3004: using guessed type int scr_pix_height;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
void T_DrawZoom(int x, int y)
|
||||
{
|
||||
|
|
@ -995,12 +975,6 @@ void T_DrawZoom(int x, int y)
|
|||
}
|
||||
#endif
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 5C2FF8: using guessed type int dword_5C2FF8;
|
||||
// 5C2FFC: using guessed type int dword_5C2FFC;
|
||||
// 5C3000: using guessed type int scr_pix_width;
|
||||
// 5C3004: using guessed type int scr_pix_height;
|
||||
// 69CF0C: using guessed type int gpBufEnd;
|
||||
|
||||
void T_DrawView(int StartX, int StartY)
|
||||
{
|
||||
|
|
@ -1048,15 +1022,6 @@ void T_DrawView(int StartX, int StartY)
|
|||
DrawLifeFlask();
|
||||
DrawManaFlask();
|
||||
}
|
||||
// 4B8968: using guessed type int sbookflag;
|
||||
// 4B8C98: using guessed type int spselflag;
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
// 525740: using guessed type int PauseMode;
|
||||
// 52B9F1: using guessed type char msgflag;
|
||||
// 646D00: using guessed type char qtextflag;
|
||||
// 69BEF8: using guessed type int light_table_index;
|
||||
// 69CF94: using guessed type int cel_transparency_active;
|
||||
// 6AA705: using guessed type char stextflag;
|
||||
|
||||
void SetTownMicros()
|
||||
{
|
||||
|
|
@ -1094,11 +1059,6 @@ void SetTownMicros()
|
|||
dword_5C2FFC = 7;
|
||||
}
|
||||
}
|
||||
// 52569C: using guessed type int zoomflag;
|
||||
// 5C2FF8: using guessed type int dword_5C2FF8;
|
||||
// 5C2FFC: using guessed type int dword_5C2FFC;
|
||||
// 5C3000: using guessed type int scr_pix_width;
|
||||
// 5C3004: using guessed type int scr_pix_height;
|
||||
|
||||
void T_FillSector(unsigned char *P3Tiles, unsigned char *pSector, int xi, int yi, int w, int h)
|
||||
{
|
||||
|
|
@ -1268,8 +1228,6 @@ void T_Pass3()
|
|||
|
||||
mem_free_dbg(P3Tiles);
|
||||
}
|
||||
// 45FDE6: could not find valid save-restore pair for edi
|
||||
// 679660: using guessed type char gbMaxPlayers;
|
||||
|
||||
void CreateTown(int entry)
|
||||
{
|
||||
|
|
@ -1348,10 +1306,5 @@ void CreateTown(int entry)
|
|||
|
||||
SetTownMicros();
|
||||
}
|
||||
// 5CF328: using guessed type int dmaxx;
|
||||
// 5CF32C: using guessed type int dmaxy;
|
||||
// 5D2458: using guessed type int dminx;
|
||||
// 5D245C: using guessed type int dminy;
|
||||
// 6ABB30: using guessed type int TWarpFrom;
|
||||
|
||||
DEVILUTION_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ BOOL WCloseFile(HANDLE file)
|
|||
|
||||
LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh)
|
||||
{
|
||||
unsigned int retry = 0;
|
||||
DWORD retry = 0;
|
||||
LONG ret;
|
||||
|
||||
while ((ret = SFileGetFileSize(hsFile, lpFileSizeHigh)) == 0)
|
||||
|
|
@ -19,7 +19,7 @@ LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void WGetFileArchive(HANDLE hsFile, unsigned int *retries, const char *FileName)
|
||||
void WGetFileArchive(HANDLE hsFile, DWORD *retries, const char *FileName)
|
||||
{
|
||||
HANDLE archive;
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ void WGetFileArchive(HANDLE hsFile, unsigned int *retries, const char *FileName)
|
|||
|
||||
BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist)
|
||||
{
|
||||
unsigned int retry = 0;
|
||||
DWORD retry = 0;
|
||||
|
||||
while (1) {
|
||||
if (SFileOpenFile(FileName, phsFile))
|
||||
|
|
@ -49,7 +49,7 @@ BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist)
|
|||
|
||||
void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read)
|
||||
{
|
||||
unsigned int retry = 0;
|
||||
DWORD retry = 0;
|
||||
DWORD readed;
|
||||
int initial_pos = WSetFilePointer(hsFile, 0, NULL, FILE_CURRENT);
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read)
|
|||
|
||||
int WSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence)
|
||||
{
|
||||
unsigned int retry = 0;
|
||||
DWORD retry = 0;
|
||||
int result;
|
||||
|
||||
while (1) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
BOOL WCloseFile(HANDLE file);
|
||||
LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh);
|
||||
void WGetFileArchive(HANDLE hsFile, unsigned int *retry, const char *FileName);
|
||||
void WGetFileArchive(HANDLE hsFile, DWORD *retry, const char *FileName);
|
||||
BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist);
|
||||
void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read);
|
||||
int WSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence);
|
||||
|
|
|
|||
|
|
@ -477,7 +477,11 @@ typedef struct _PROCESS_INFORMATION {
|
|||
DWORD dwThreadId;
|
||||
} PROCESS_INFORMATION, *PPROCESS_INFORMATION, *LPPROCESS_INFORMATION;
|
||||
|
||||
typedef void *LPSTARTUPINFOA;
|
||||
typedef struct {
|
||||
DWORD cb;
|
||||
} STARTUPINFOA, *LPSTARTUPINFOA;
|
||||
typedef STARTUPINFOA STARTUPINFO;
|
||||
|
||||
WINBOOL WINAPI CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes,
|
||||
LPSECURITY_ATTRIBUTES lpThreadAttributes, WINBOOL bInheritHandles, DWORD dwCreationFlags,
|
||||
LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo,
|
||||
|
|
@ -653,10 +657,6 @@ typedef struct _MEMORY_BASIC_INFORMATION {
|
|||
typedef struct {
|
||||
} SOCKADDR, GUID, *LPGUID;
|
||||
|
||||
typedef struct {
|
||||
DWORD cb;
|
||||
} STARTUPINFOA;
|
||||
|
||||
BOOL IsBadReadPtr(const void *lp, UINT_PTR ucb);
|
||||
BOOL IsBadWritePtr(LPVOID lp, UINT_PTR ucb);
|
||||
SIZE_T VirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define InterlockedIncrement(x) __sync_add_and_fetch(x, 1)
|
||||
#endif
|
||||
|
||||
#define INFINITE DVL_INFINITE;
|
||||
#define INFINITE DVL_INFINITE
|
||||
|
||||
#define MAKEFOURCC(x, y, z, w) \
|
||||
(((uint32_t)((uint8_t)x)) \
|
||||
|
|
@ -329,3 +329,8 @@
|
|||
#define MB_TASKMODAL DVL_MB_TASKMODAL
|
||||
#define MB_ICONHAND DVL_MB_ICONHAND
|
||||
#define MB_ICONEXCLAMATION DVL_MB_ICONEXCLAMATION
|
||||
|
||||
/*
|
||||
* GetWindow() Constants
|
||||
*/
|
||||
#define GW_HWNDPREV 3
|
||||
|
|
|
|||
2
defs.h
2
defs.h
|
|
@ -101,7 +101,7 @@
|
|||
#define BUFFER_HEIGHT (160 + SCREEN_HEIGHT + 16)
|
||||
#define TILE_SIZE 32
|
||||
|
||||
#define SCREENXY(x, y) ((x) + 64 + (((y) + 160) * 768))
|
||||
#define SCREENXY(x, y) ((x) + 64 + (((y) + 160) * BUFFER_WIDTH))
|
||||
|
||||
#define MemFreeDbg(p) \
|
||||
{ \
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ typedef struct MonsterStruct { // note: missing field _mAFNum
|
|||
int _mAnimCnt;
|
||||
int _mAnimLen;
|
||||
int _mAnimFrame;
|
||||
int _meflag;
|
||||
BOOL _meflag;
|
||||
BOOL _mDelFlag;
|
||||
int _mVar1;
|
||||
int _mVar2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue