Skip to content

Commit

Permalink
Correct BOOLS
Browse files Browse the repository at this point in the history
  • Loading branch information
AJenbo committed Jul 21, 2019
1 parent 952d2c2 commit 9d3ce81
Show file tree
Hide file tree
Showing 18 changed files with 111 additions and 110 deletions.
44 changes: 22 additions & 22 deletions Source/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int chrbtn[4];
BYTE *pMultiBtns;
BYTE *pPanelButtons;
BYTE *pChrPanel;
int lvlbtndown;
BOOL lvlbtndown;
char sgszTalkSave[8][80];
int dropGoldValue;
BOOL drawmanaflag;
Expand All @@ -38,17 +38,17 @@ int sbooktab;
int pSplType;
int frame;
int initialDropGoldIndex;
int talkflag;
BOOL talkflag;
BYTE *pSBkIconCels;
int sbookflag;
int chrflag;
BOOL sbookflag;
BOOL chrflag;
BOOL drawbtnflag;
BYTE *pSpellBkCel;
char infostr[MAX_PATH];
int numpanbtns;
BYTE *pStatusPanel;
char panelstr[256];
int panelflag;
BOOL panelflag;
BYTE SplTransTbl[256];
int initialDropGoldValue;
BYTE *pSpellCels;
Expand Down Expand Up @@ -1131,7 +1131,7 @@ void InitControlPan()
CelDecodeRect(pLifeBuff, 0, 87, 88, pStatusPanel, 1, 88);
CelDecodeRect(pManaBuff, 0, 87, 88, pStatusPanel, 2, 88);
MemFreeDbg(pStatusPanel);
talkflag = 0;
talkflag = FALSE;
if (gbMaxPlayers != 1) {
pTalkPanel = LoadFileInMem("CtrlPan\\TalkPanl.CEL", NULL);
CelDecodeRect(pBtmBuff, 0, (PANEL_HEIGHT + 16) * 2 - 1, PANEL_WIDTH, pTalkPanel, 1, PANEL_WIDTH);
Expand All @@ -1145,8 +1145,8 @@ void InitControlPan()
for (i = 0; i < sizeof(talkbtndown) / sizeof(talkbtndown[0]); i++)
talkbtndown[i] = FALSE;
}
panelflag = 0;
lvlbtndown = 0;
panelflag = FALSE;
lvlbtndown = FALSE;
pPanelButtons = LoadFileInMem("CtrlPan\\Panel8bu.CEL", NULL);
for (i = 0; i < sizeof(panbtn) / sizeof(panbtn[0]); i++)
panbtn[i] = 0;
Expand All @@ -1164,13 +1164,13 @@ void InitControlPan()
ClearPanel();
drawhpflag = TRUE;
drawmanaflag = TRUE;
chrflag = 0;
chrflag = FALSE;
spselflag = 0;
pSpellBkCel = LoadFileInMem("Data\\SpellBk.CEL", NULL);
pSBkBtnCel = LoadFileInMem("Data\\SpellBkB.CEL", NULL);
pSBkIconCels = LoadFileInMem("Data\\SpellI2.CEL", NULL);
sbooktab = 0;
sbookflag = 0;
sbookflag = FALSE;
if (plr[myplr]._pClass == PC_WARRIOR) {
SpellPages[0][0] = SPL_REPAIR;
} else if (plr[myplr]._pClass == PC_ROGUE) {
Expand Down Expand Up @@ -1323,7 +1323,7 @@ void CheckPanelInfo()
{
int i, c, v, s;

panelflag = 0;
panelflag = FALSE;
ClearPanel();
for (i = 0; i < numpanbtns; i++) {
if (MouseX >= PanBtnPos[i][0]
Expand All @@ -1343,14 +1343,14 @@ void CheckPanelInfo()
AddPanelString(tempstr, TRUE);
}
infoclr = COL_WHITE;
panelflag = 1;
panelflag = TRUE;
pinfoflag = TRUE;
}
}
if (!spselflag && MouseX >= 565 && MouseX < 621 && MouseY >= 416 && MouseY < 472) {
strcpy(infostr, "Select current spell button");
infoclr = COL_WHITE;
panelflag = 1;
panelflag = TRUE;
pinfoflag = TRUE;
strcpy(tempstr, "Hotkey : 's'");
AddPanelString(tempstr, TRUE);
Expand Down Expand Up @@ -1439,10 +1439,10 @@ void CheckBtnUp()
switch (i) {
case PANBTN_CHARINFO:
questlog = FALSE;
chrflag = chrflag == 0;
chrflag = !chrflag;
break;
case PANBTN_QLOG:
chrflag = 0;
chrflag = FALSE;
if (!questlog)
StartQuestlog();
else
Expand All @@ -1457,7 +1457,7 @@ void CheckBtnUp()
gamemenuOff = 0;
break;
case PANBTN_INVENTORY:
sbookflag = 0;
sbookflag = FALSE;
invflag = invflag == 0;
if (dropGoldFlag) {
dropGoldFlag = FALSE;
Expand All @@ -1470,7 +1470,7 @@ void CheckBtnUp()
dropGoldFlag = FALSE;
dropGoldValue = 0;
}
sbookflag = sbookflag == 0;
sbookflag = !sbookflag;
break;
case PANBTN_SENDMSG:
if (talkflag)
Expand Down Expand Up @@ -1923,14 +1923,14 @@ void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base)
void CheckLvlBtn()
{
if (!lvlbtndown && MouseX >= 40 && MouseX <= 81 && MouseY >= 313 && MouseY <= 335)
lvlbtndown = 1;
lvlbtndown = TRUE;
}

void ReleaseLvlBtn()
{
if (MouseX >= 40 && MouseX <= 81 && MouseY >= 313 && MouseY <= 335)
chrflag = 1;
lvlbtndown = 0;
chrflag = TRUE;
lvlbtndown = FALSE;
}

void DrawLevelUpIcon()
Expand Down Expand Up @@ -2549,7 +2549,7 @@ void control_type_message()
return;
}

talkflag = 1;
talkflag = TRUE;
sgszTalkMsg[0] = 0;
frame = 1;
for (i = 0; i < 3; i++) {
Expand All @@ -2562,7 +2562,7 @@ void control_type_message()

void control_reset_talk()
{
talkflag = 0;
talkflag = FALSE;
sgbPlrTalkTbl = 0;
drawpanflag = 255;
}
Expand Down
10 changes: 5 additions & 5 deletions Source/control.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ extern int chrbtn[4];
extern BYTE *pMultiBtns;
extern BYTE *pPanelButtons;
extern BYTE *pChrPanel;
extern int lvlbtndown;
extern BOOL lvlbtndown;
extern int dropGoldValue;
extern BOOL drawmanaflag;
extern BOOL chrbtnactive;
Expand All @@ -35,17 +35,17 @@ extern int sbooktab;
extern int pSplType;
extern int frame;
extern int initialDropGoldIndex;
extern int talkflag;
extern BOOL talkflag;
extern BYTE *pSBkIconCels;
extern int sbookflag;
extern int chrflag;
extern BOOL sbookflag;
extern BOOL chrflag;
extern BOOL drawbtnflag;
extern BYTE *pSpellBkCel;
extern char infostr[MAX_PATH];
extern int numpanbtns;
extern BYTE *pStatusPanel;
extern char panelstr[256];
extern int panelflag;
extern BOOL panelflag;
extern BYTE SplTransTbl[256];
extern int initialDropGoldValue;
extern BYTE *pSpellCels;
Expand Down
4 changes: 2 additions & 2 deletions Source/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ void CheckCursMove()
}
pcursinvitem = -1;
pcursplr = -1;
uitemflag = 0;
panelflag = 0;
uitemflag = FALSE;
panelflag = FALSE;
trigflag = FALSE;

if (plr[myplr]._pInvincible) {
Expand Down
40 changes: 20 additions & 20 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ int glEndSeed[NUMLEVELS];
BOOL gbLoadGame;
HINSTANCE ghInst;
int DebugMonsters[10];
char cineflag;
BOOLEAN cineflag;
int drawpanflag;
int visiondebug;
int scrollflag; /* unused */
BOOL visiondebug;
BOOL scrollflag; /* unused */
BOOL light4flag;
int leveldebug;
int monstdebug;
int trigdebug; /* unused */
BOOL leveldebug;
BOOL monstdebug;
BOOL trigdebug; /* unused */
int setseed;
int debugmonsttypes;
int PauseMode;
Expand Down Expand Up @@ -370,7 +370,7 @@ void diablo_parse_flags(char *args)
break;
case 'l':
setlevel = FALSE;
leveldebug = 1;
leveldebug = TRUE;
while (isspace(*args)) {
args++;
}
Expand All @@ -392,7 +392,7 @@ void diablo_parse_flags(char *args)
plr[0].plrlevel = i;
break;
case 'm':
monstdebug = 1;
monstdebug = TRUE;
while (isspace(*args)) {
args++;
}
Expand Down Expand Up @@ -432,7 +432,7 @@ void diablo_parse_flags(char *args)
debug_mode_key_s = 1;
break;
case 't':
leveldebug = 1;
leveldebug = TRUE;
setlevel = TRUE;
while (isspace(*args)) {
args++;
Expand All @@ -445,7 +445,7 @@ void diablo_parse_flags(char *args)
setlvlnum = i;
break;
case 'v':
visiondebug = 1;
visiondebug = TRUE;
break;
case 'w':
debug_mode_key_w = 1;
Expand Down Expand Up @@ -1066,11 +1066,11 @@ void PressKey(int vkey)
track_repeat_walk(0);
} else {
invflag = 0;
chrflag = 0;
sbookflag = 0;
chrflag = FALSE;
sbookflag = FALSE;
spselflag = 0;
if (qtextflag && leveltype == DTYPE_TOWN) {
qtextflag = 0;
qtextflag = FALSE;
sfx_stop();
}
questlog = FALSE;
Expand Down Expand Up @@ -1184,11 +1184,11 @@ void PressKey(int vkey)
}
helpflag = 0;
invflag = 0;
chrflag = 0;
sbookflag = 0;
chrflag = FALSE;
sbookflag = FALSE;
spselflag = 0;
if (qtextflag && leveltype == DTYPE_TOWN) {
qtextflag = 0;
qtextflag = FALSE;
sfx_stop();
}
questlog = FALSE;
Expand Down Expand Up @@ -1247,7 +1247,7 @@ void PressChar(int vkey)
case 'I':
case 'i':
if (!stextflag) {
sbookflag = 0;
sbookflag = FALSE;
invflag = invflag == 0;
if (!invflag || chrflag) {
if (MouseX < 480 && MouseY < PANEL_TOP) {
Expand All @@ -1264,7 +1264,7 @@ void PressChar(int vkey)
case 'c':
if (!stextflag) {
questlog = FALSE;
chrflag = chrflag == 0;
chrflag = !chrflag;
if (!chrflag || invflag) {
if (MouseX > 160 && MouseY < PANEL_TOP) {
SetCursorPos(MouseX - 160, MouseY);
Expand All @@ -1279,7 +1279,7 @@ void PressChar(int vkey)
case 'Q':
case 'q':
if (!stextflag) {
chrflag = 0;
chrflag = FALSE;
if (!questlog) {
StartQuestlog();
} else {
Expand Down Expand Up @@ -1307,7 +1307,7 @@ void PressChar(int vkey)
case 'b':
if (!stextflag) {
invflag = 0;
sbookflag = sbookflag == 0;
sbookflag = !sbookflag;
}
return;
case '+':
Expand Down
12 changes: 6 additions & 6 deletions Source/diablo.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ extern int glEndSeed[NUMLEVELS];
extern BOOL gbLoadGame;
extern HINSTANCE ghInst;
extern int DebugMonsters[10];
extern char cineflag;
extern BOOLEAN cineflag;
extern int drawpanflag;
extern int visiondebug;
extern int scrollflag; /* unused */
extern BOOL visiondebug;
extern BOOL scrollflag; /* unused */
extern BOOL light4flag;
extern int leveldebug;
extern int monstdebug;
extern int trigdebug; /* unused */
extern BOOL leveldebug;
extern BOOL monstdebug;
extern BOOL trigdebug; /* unused */
extern int setseed;
extern int debugmonsttypes;
extern int PauseMode;
Expand Down
14 changes: 7 additions & 7 deletions Source/gendung.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

WORD level_frame_types[MAXTILES];
int themeCount;
char nTransTable[2049];
BOOLEAN nTransTable[2049];
//int dword_52D204;
int dMonster[MAXDUNX][MAXDUNY];
BYTE dungeon[DMAXX][DMAXY];
Expand All @@ -29,7 +29,7 @@ char dTransVal[MAXDUNX][MAXDUNY];
BOOLEAN nTrapTable[2049];
BYTE leveltype;
BYTE currlevel;
char TransList[256];
BOOLEAN TransList[256];
BOOLEAN nSolidTable[2049];
int level_frame_count[MAXTILES];
ScrollStruct ScrollInfo;
Expand All @@ -42,13 +42,13 @@ int dword_5C2FFC;
int scr_pix_width;
int scr_pix_height;
char dArch[MAXDUNX][MAXDUNY];
char nBlockTable[2049];
BOOLEAN nBlockTable[2049];
BYTE *pSpecialCels;
char dFlags[MAXDUNX][MAXDUNY];
char dItem[MAXDUNX][MAXDUNY];
BYTE setlvlnum;
int level_frame_sizes[MAXTILES];
char nMissileTable[2049];
BOOLEAN nMissileTable[2049];
char *pSetPiece_2;
char setlvltype;
BOOLEAN setlevel;
Expand Down Expand Up @@ -107,11 +107,11 @@ void FillSolidBlockTbls()
if (bv & 1)
nSolidTable[i] = 1;
if (bv & 2)
nBlockTable[i] = 1;
nBlockTable[i] = TRUE;
if (bv & 4)
nMissileTable[i] = 1;
nMissileTable[i] = TRUE;
if (bv & 8)
nTransTable[i] = 1;
nTransTable[i] = TRUE;
if (bv & 0x80)
nTrapTable[i] = 1;
block_lvid[i] = (bv & 0x70) >> 4; /* beta: (bv >> 4) & 7 */
Expand Down
Loading

0 comments on commit 9d3ce81

Please sign in to comment.