diff --git a/.travis.yml b/.travis.yml index 69e1eac24..e5a6d762e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ os: - linux - osx -osx_image: xcode10.3 +osx_image: xcode11.3 notifications: email: @@ -17,8 +17,6 @@ addons: homebrew: packages: - mingw-w64 - update: true - env: - MAKE_BUILD=make - MAKE_BUILD=debug diff --git a/Source/control.cpp b/Source/control.cpp index 7da806e18..20add690a 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -11,8 +11,8 @@ BYTE *pDurIcons; BYTE *pChrButtons; BOOL drawhpflag; BOOL dropGoldFlag; -int panbtn[8]; -int chrbtn[4]; +BOOL panbtn[8]; +BOOL chrbtn[4]; BYTE *pMultiBtns; BYTE *pPanelButtons; BYTE *pChrPanel; @@ -1345,7 +1345,7 @@ void InitControlPan() lvlbtndown = FALSE; pPanelButtons = LoadFileInMem("CtrlPan\\Panel8bu.CEL", NULL); for (i = 0; i < sizeof(panbtn) / sizeof(panbtn[0]); i++) - panbtn[i] = 0; + panbtn[i] = FALSE; panbtndown = FALSE; if (gbMaxPlayers == 1) numpanbtns = 6; @@ -1353,7 +1353,7 @@ void InitControlPan() numpanbtns = 8; pChrButtons = LoadFileInMem("Data\\CharBut.CEL", NULL); for (i = 0; i < sizeof(chrbtn) / sizeof(chrbtn[0]); i++) - chrbtn[i] = 0; + chrbtn[i] = FALSE; chrbtnactive = FALSE; pDurIcons = LoadFileInMem("Items\\DurIcons.CEL", NULL); strcpy(infostr, ""); @@ -1411,7 +1411,7 @@ void DrawCtrlBtns() if (!panbtn[i]) DrawPanelBox(PanBtnPos[i][0] - PANEL_LEFT, PanBtnPos[i][1] - (PANEL_TOP - 16), 71, 20, PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y); else - CelDraw(PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + (PANEL_Y - 334), pPanelButtons, i + 1, 71); + CelDraw(PanBtnPos[i][0] + SCREEN_X, PanBtnPos[i][1] + SCREEN_Y + 18, pPanelButtons, i + 1, 71); } if (numpanbtns == 8) { CelDraw(87 + PANEL_X, 122 + PANEL_Y, pMultiBtns, panbtn[6] + 1, 33); @@ -2217,7 +2217,7 @@ void CheckChrBtns() && MouseX <= ChrBtnsRect[i].x + ChrBtnsRect[i].w && MouseY >= ChrBtnsRect[i].y && MouseY <= ChrBtnsRect[i].y + ChrBtnsRect[i].h) { - chrbtn[i] = 1; + chrbtn[i] = TRUE; chrbtnactive = TRUE; } } @@ -2231,7 +2231,7 @@ void ReleaseChrBtns() chrbtnactive = FALSE; for (i = 0; i < 4; ++i) { if (chrbtn[i]) { - chrbtn[i] = 0; + chrbtn[i] = FALSE; if (MouseX >= ChrBtnsRect[i].x && MouseX <= ChrBtnsRect[i].x + ChrBtnsRect[i].w && MouseY >= ChrBtnsRect[i].y diff --git a/Source/control.h b/Source/control.h index 7acced9be..a43fe4768 100644 --- a/Source/control.h +++ b/Source/control.h @@ -10,8 +10,8 @@ extern BYTE *pDurIcons; extern BYTE *pChrButtons; extern BOOL drawhpflag; extern BOOL dropGoldFlag; -extern int panbtn[8]; -extern int chrbtn[4]; +extern BOOL panbtn[8]; +extern BOOL chrbtn[4]; extern BYTE *pMultiBtns; extern BYTE *pPanelButtons; extern BYTE *pChrPanel; diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 03a719725..2830000ac 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1094,7 +1094,7 @@ void RightMouseDown() || (!sbookflag || MouseX <= RIGHT_PANEL) && !TryIconCurs() && (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem))) { - if (pcurs == 1) { + if (pcurs == CURSOR_HAND) { if (pcursinvitem == -1 || !UseInvItem(myplr, pcursinvitem)) CheckPlrSpell(); } else if (pcurs > CURSOR_HAND && pcurs < CURSOR_FIRSTITEM) { diff --git a/Source/inv.cpp b/Source/inv.cpp index dec305923..acfb188b1 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -2777,7 +2777,7 @@ BOOL UseInvItem(int pnum, int cii) if (plr[pnum]._pInvincible && !plr[pnum]._pHitPoints && pnum == myplr) return TRUE; - if (pcurs != 1) + if (pcurs != CURSOR_HAND) return TRUE; if (stextflag) return TRUE; diff --git a/Source/objdat.cpp b/Source/objdat.cpp index d2d8b7ed3..3fd9cd1d6 100644 --- a/Source/objdat.cpp +++ b/Source/objdat.cpp @@ -219,7 +219,7 @@ ObjDataStruct AllObjects[99] = { { 2, OFILE_LZSTAND, 0, 0, DTYPE_TOWN, THEME_NONE, Q_BETRAYER, 0, 1, 0, 128, TRUE, FALSE, TRUE, 0, 3, FALSE }, { 1, OFILE_DECAP, 9, 9, DTYPE_CAVES, THEME_NONE, -1, 0, 2, 0, 96, TRUE, TRUE, TRUE, 0, 1, FALSE }, { 2, OFILE_CHEST3, 0, 0, DTYPE_TOWN, THEME_NONE, -1, 0, 1, 0, 96, TRUE, TRUE, TRUE, 0, 1, TRUE }, - { -1, 0, 0, 0, DTYPE_NONE, THEME_NONE, -1, 0, 0, 0, 0, FALSE, FALSE, FALSE, 0, 0, FALSE } + { -1, 0, 0, 0, -1, THEME_NONE, -1, 0, 0, 0, 0, FALSE, FALSE, FALSE, 0, 0, FALSE } // clang-format on }; diff --git a/Source/player.cpp b/Source/player.cpp index 30f3e3587..3c7c3fa88 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -3515,7 +3515,7 @@ void CheckNewPath(int pnum) i = plr[pnum].destParam1; x = abs(plr[pnum].WorldX - item[i]._ix); y = abs(plr[pnum].WorldY - item[i]._iy); - if (x <= 1 && y <= 1 && pcurs == 1 && !item[i]._iRequest) { + if (x <= 1 && y <= 1 && pcurs == CURSOR_HAND && !item[i]._iRequest) { NetSendCmdGItem(TRUE, CMD_REQUESTGITEM, myplr, myplr, i); item[i]._iRequest = TRUE; } @@ -3526,7 +3526,7 @@ void CheckNewPath(int pnum) i = plr[pnum].destParam1; x = abs(plr[pnum].WorldX - item[i]._ix); y = abs(plr[pnum].WorldY - item[i]._iy); - if (x <= 1 && y <= 1 && pcurs == 1) { + if (x <= 1 && y <= 1 && pcurs == CURSOR_HAND) { NetSendCmdGItem(TRUE, CMD_REQUESTAGITEM, myplr, myplr, i); } } diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index bc116a318..faf6e882b 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -142,7 +142,7 @@ static void scrollrt_draw_cursor_item() /// ASSERT: assert(! sgdwCursWdt); - if (pcurs <= 0 || cursW == 0 || cursH == 0) { + if (pcurs <= CURSOR_NONE || cursW == 0 || cursH == 0) { return; } diff --git a/Source/spells.cpp b/Source/spells.cpp index 372501ee5..65b4acdd0 100644 --- a/Source/spells.cpp +++ b/Source/spells.cpp @@ -99,7 +99,7 @@ BOOL CheckSpell(int id, int sn, char st, BOOL manaonly) #endif result = TRUE; - if (!manaonly && pcurs != 1) { + if (!manaonly && pcurs != CURSOR_HAND) { result = FALSE; } else { if (st != RSPLTYPE_SKILL) { diff --git a/Source/stores.cpp b/Source/stores.cpp index a16f46096..22e21d3a0 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -11,6 +11,7 @@ int premiumlevel; int talker; STextStruct stext[24]; char stextsize; + int stextsmax; int InStoreFlag; /** current frame # for the pentagram selector */ ItemStruct storehold[48]; @@ -91,7 +92,7 @@ void InitStores() #endif stextflag = STORE_NONE; InStoreFlag = 1; - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; numpremium = 0; premiumlevel = 1; @@ -211,7 +212,7 @@ void DrawSLine(int y) int xy, yy, width, line, sy; sy = SStringY[y]; - if (stextsize == 1) { + if (stextsize) { xy = SCREENXY(PANEL_LEFT + 26, 25); yy = PitchTbl[sy + 198] + 26 + PANEL_X; width = 586 / 4; @@ -286,7 +287,7 @@ void DrawSSlider(int y1, int y2) void DrawSTextHelp() { stextsel = -1; - stextsize = 1; + stextsize = TRUE; } void ClearSText(int s, int e) @@ -297,10 +298,10 @@ void ClearSText(int s, int e) stext[i]._sx = 0; stext[i]._syoff = 0; stext[i]._sstr[0] = 0; - stext[i]._sjust = 0; - stext[i]._sclr = 0; + stext[i]._sjust = FALSE; + stext[i]._sclr = COL_WHITE; stext[i]._sline = 0; - stext[i]._ssel = 0; + stext[i]._ssel = FALSE; stext[i]._sval = -1; } } @@ -323,7 +324,7 @@ void OffsetSTextY(int y, int yo) stext[y]._syoff = yo; } -void AddSText(int x, int y, int j, char *str, char clr, int sel) +void AddSText(int x, int y, BOOL j, char *str, char clr, BOOL sel) { stext[y]._sx = x; stext[y]._syoff = 0; @@ -408,17 +409,17 @@ void StoreAutoPlace() void S_StartSmith() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 1, 1, "Welcome to the", COL_GOLD, 0); - AddSText(0, 3, 1, "Blacksmith's shop", COL_GOLD, 0); - AddSText(0, 7, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 10, 1, "Talk to Griswold", COL_BLUE, 1); - AddSText(0, 12, 1, "Buy basic items", COL_WHITE, 1); - AddSText(0, 14, 1, "Buy premium items", COL_WHITE, 1); - AddSText(0, 16, 1, "Sell items", COL_WHITE, 1); - AddSText(0, 18, 1, "Repair items", COL_WHITE, 1); - AddSText(0, 20, 1, "Leave the shop", COL_WHITE, 1); + AddSText(0, 1, TRUE, "Welcome to the", COL_GOLD, FALSE); + AddSText(0, 3, TRUE, "Blacksmith's shop", COL_GOLD, FALSE); + AddSText(0, 7, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 10, TRUE, "Talk to Griswold", COL_BLUE, TRUE); + AddSText(0, 12, TRUE, "Buy basic items", COL_WHITE, TRUE); + AddSText(0, 14, TRUE, "Buy premium items", COL_WHITE, TRUE); + AddSText(0, 16, TRUE, "Sell items", COL_WHITE, TRUE); + AddSText(0, 18, TRUE, "Repair items", COL_WHITE, TRUE); + AddSText(0, 20, TRUE, "Leave the shop", COL_WHITE, TRUE); AddSLine(5); storenumh = 20; } @@ -444,9 +445,9 @@ void S_ScrollSBuy(int idx) } if (smithitem[ls]._iMagical) { - AddSText(20, l, 0, smithitem[ls]._iIName, iclr, 1); + AddSText(20, l, FALSE, smithitem[ls]._iIName, iclr, TRUE); } else { - AddSText(20, l, 0, smithitem[ls]._iName, iclr, 1); + AddSText(20, l, FALSE, smithitem[ls]._iName, iclr, TRUE); } AddSTextVal(l, smithitem[ls]._iIvalue); @@ -488,7 +489,7 @@ void PrintStoreItem(ItemStruct *x, int l, char iclr) strcat(sstr, tempstr); } if (sstr[0]) { - AddSText(40, l, 0, sstr, iclr, 0); + AddSText(40, l, FALSE, sstr, iclr, FALSE); l++; } sstr[0] = '\0'; @@ -519,10 +520,10 @@ void PrintStoreItem(ItemStruct *x, int l, char iclr) sprintf(tempstr, "%s %i Dex", tempstr, x->_iMinDex); strcat(sstr, tempstr); } - AddSText(40, l++, 0, sstr, iclr, 0); + AddSText(40, l++, FALSE, sstr, iclr, FALSE); if (x->_iMagical == ITEM_QUALITY_UNIQUE) { if (x->_iIdentified) - AddSText(40, l, 0, "Unique Item", iclr, 0); + AddSText(40, l, FALSE, "Unique Item", iclr, FALSE); } } @@ -530,15 +531,15 @@ void S_StartSBuy() { int i; - stextsize = 1; + stextsize = TRUE; stextscrl = TRUE; stextsval = 0; sprintf(tempstr, "I have these items for sale : Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollSBuy(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 0); + AddSText(0, 22, TRUE, "Back", COL_WHITE, FALSE); OffsetSTextY(22, 6); storenumh = 0; for (i = 0; smithitem[i]._itype != ITYPE_NONE; i++) { @@ -571,7 +572,7 @@ void S_ScrollSPBuy(int idx) iclr = COL_BLUE; if (!premiumitem[idx]._iStatFlag) iclr = COL_RED; - AddSText(20, l, 0, premiumitem[idx]._iIName, iclr, 1); + AddSText(20, l, FALSE, premiumitem[idx]._iIName, iclr, TRUE); AddSTextVal(l, premiumitem[idx]._iIvalue); PrintStoreItem(&premiumitem[idx], l + 1, iclr); stextdown = l; @@ -599,15 +600,15 @@ BOOL S_StartSPBuy() return FALSE; } - stextsize = 1; + stextsize = TRUE; stextscrl = TRUE; stextsval = 0; sprintf(tempstr, "I have these premium items for sale : Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); - AddSText(0, 22, 1, "Back", COL_WHITE, 0); + AddSText(0, 22, TRUE, "Back", COL_WHITE, FALSE); OffsetSTextY(22, 6); stextsmax = storenumh - 4; @@ -659,10 +660,10 @@ void S_ScrollSSell(int idx) } if (storehold[idx]._iMagical && storehold[idx]._iIdentified) { - AddSText(20, l, 0, storehold[idx]._iIName, iclr, 1); + AddSText(20, l, FALSE, storehold[idx]._iIName, iclr, TRUE); AddSTextVal(l, storehold[idx]._iIvalue); } else { - AddSText(20, l, 0, storehold[idx]._iName, iclr, 1); + AddSText(20, l, FALSE, storehold[idx]._iName, iclr, TRUE); AddSTextVal(l, storehold[idx]._ivalue); } @@ -682,7 +683,7 @@ void S_StartSSell() int i; BOOL sellok; - stextsize = 1; + stextsize = TRUE; sellok = FALSE; storenumh = 0; @@ -732,21 +733,21 @@ void S_StartSSell() if (!sellok) { stextscrl = FALSE; sprintf(tempstr, "You have nothing I want. Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } else { stextscrl = TRUE; stextsval = 0; stextsmax = plr[myplr]._pNumInv; sprintf(tempstr, "Which item is for sale? Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollSSell(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } } @@ -772,7 +773,7 @@ void S_StartSRepair() BOOL repairok; int i; - stextsize = 1; + stextsize = TRUE; repairok = FALSE; storenumh = 0; for (i = 0; i < 48; i++) @@ -806,10 +807,10 @@ void S_StartSRepair() if (!repairok) { stextscrl = FALSE; sprintf(tempstr, "You have nothing to repair. Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, 3, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); - AddSText(0, 22, 1, "Back", 0, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); return; } @@ -818,11 +819,11 @@ void S_StartSRepair() stextsval = 0; stextsmax = plr[myplr]._pNumInv; sprintf(tempstr, "Repair which item? Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, 3, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollSSell(stextsval); - AddSText(0, 22, 1, "Back", 0, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } @@ -851,15 +852,15 @@ void AddStoreHoldRepair(ItemStruct *itm, int i) void S_StartWitch() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 2, 1, "Witch's shack", COL_GOLD, 0); - AddSText(0, 9, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 12, 1, "Talk to Adria", COL_BLUE, 1); - AddSText(0, 14, 1, "Buy items", COL_WHITE, 1); - AddSText(0, 16, 1, "Sell items", COL_WHITE, 1); - AddSText(0, 18, 1, "Recharge staves", COL_WHITE, 1); - AddSText(0, 20, 1, "Leave the shack", COL_WHITE, 1); + AddSText(0, 2, TRUE, "Witch's shack", COL_GOLD, FALSE); + AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 12, TRUE, "Talk to Adria", COL_BLUE, TRUE); + AddSText(0, 14, TRUE, "Buy items", COL_WHITE, TRUE); + AddSText(0, 16, TRUE, "Sell items", COL_WHITE, TRUE); + AddSText(0, 18, TRUE, "Recharge staves", COL_WHITE, TRUE); + AddSText(0, 20, TRUE, "Leave the shack", COL_WHITE, TRUE); AddSLine(5); storenumh = 20; } @@ -885,9 +886,9 @@ void S_ScrollWBuy(int idx) } if (witchitem[ls]._iMagical) { - AddSText(20, l, 0, witchitem[ls]._iIName, iclr, 1); + AddSText(20, l, FALSE, witchitem[ls]._iIName, iclr, TRUE); } else { - AddSText(20, l, 0, witchitem[ls]._iName, iclr, 1); + AddSText(20, l, FALSE, witchitem[ls]._iName, iclr, TRUE); } AddSTextVal(l, witchitem[ls]._iIvalue); @@ -905,16 +906,16 @@ void S_StartWBuy() { int i; - stextsize = 1; + stextsize = TRUE; stextscrl = TRUE; stextsval = 0; stextsmax = 20; sprintf(tempstr, "I have these items for sale : Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollWBuy(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 0); + AddSText(0, 22, TRUE, "Back", COL_WHITE, FALSE); OffsetSTextY(22, 6); storenumh = 0; @@ -954,7 +955,7 @@ void S_StartWSell() int i; BOOL sellok; - stextsize = 1; + stextsize = TRUE; sellok = FALSE; storenumh = 0; @@ -1004,21 +1005,21 @@ void S_StartWSell() if (!sellok) { stextscrl = FALSE; sprintf(tempstr, "You have nothing I want. Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } else { stextscrl = TRUE; stextsval = 0; stextsmax = plr[myplr]._pNumInv; sprintf(tempstr, "Which item is for sale? Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollSSell(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } } @@ -1050,7 +1051,7 @@ void S_StartWRecharge() int i; BOOL rechargeok; - stextsize = 1; + stextsize = TRUE; rechargeok = FALSE; storenumh = 0; @@ -1082,21 +1083,21 @@ void S_StartWRecharge() if (!rechargeok) { stextscrl = FALSE; sprintf(tempstr, "You have nothing to recharge. Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } else { stextscrl = TRUE; stextsval = 0; stextsmax = plr[myplr]._pNumInv; sprintf(tempstr, "Recharge which item? Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollSSell(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } } @@ -1105,9 +1106,9 @@ void S_StartNoMoney() { StartStore(stextshold); stextscrl = FALSE; - stextsize = 1; + stextsize = TRUE; ClearSText(5, 23); - AddSText(0, 14, 1, "You do not have enough gold", COL_WHITE, 1); + AddSText(0, 14, TRUE, "You do not have enough gold", COL_WHITE, TRUE); } void S_StartNoRoom() @@ -1115,7 +1116,7 @@ void S_StartNoRoom() StartStore(stextshold); stextscrl = FALSE; ClearSText(5, 23); - AddSText(0, 14, 1, "You do not have enough room in inventory", COL_WHITE, 1); + AddSText(0, 14, TRUE, "You do not have enough room in inventory", COL_WHITE, TRUE); } void S_StartConfirm() @@ -1148,9 +1149,9 @@ void S_StartConfirm() idprint = FALSE; } if (idprint) - AddSText(20, 8, 0, plr[myplr].HoldItem._iIName, iclr, 0); + AddSText(20, 8, FALSE, plr[myplr].HoldItem._iIName, iclr, FALSE); else - AddSText(20, 8, 0, plr[myplr].HoldItem._iName, iclr, 0); + AddSText(20, 8, FALSE, plr[myplr].HoldItem._iName, iclr, FALSE); AddSTextVal(8, plr[myplr].HoldItem._iIvalue); PrintStoreItem(&plr[myplr].HoldItem, 9, iclr); @@ -1179,27 +1180,27 @@ void S_StartConfirm() strcpy(tempstr, "Are you sure you want to repair this item?"); break; } - AddSText(0, 15, 1, tempstr, COL_WHITE, 0); - AddSText(0, 18, 1, "Yes", COL_WHITE, 1); - AddSText(0, 20, 1, "No", COL_WHITE, 1); + AddSText(0, 15, TRUE, tempstr, COL_WHITE, FALSE); + AddSText(0, 18, TRUE, "Yes", COL_WHITE, TRUE); + AddSText(0, 20, TRUE, "No", COL_WHITE, TRUE); } void S_StartBoy() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 2, 1, "Wirt the Peg-legged boy", COL_GOLD, 0); + AddSText(0, 2, TRUE, "Wirt the Peg-legged boy", COL_GOLD, FALSE); AddSLine(5); if (boyitem._itype != ITYPE_NONE) { - AddSText(0, 8, 1, "Talk to Wirt", COL_BLUE, 1); - AddSText(0, 12, 1, "I have something for sale,", COL_GOLD, 0); - AddSText(0, 14, 1, "but it will cost 50 gold", COL_GOLD, 0); - AddSText(0, 16, 1, "just to take a look. ", COL_GOLD, 0); - AddSText(0, 18, 1, "What have you got?", COL_WHITE, 1); - AddSText(0, 20, 1, "Say goodbye", COL_WHITE, 1); + AddSText(0, 8, TRUE, "Talk to Wirt", COL_BLUE, TRUE); + AddSText(0, 12, TRUE, "I have something for sale,", COL_GOLD, FALSE); + AddSText(0, 14, TRUE, "but it will cost 50 gold", COL_GOLD, FALSE); + AddSText(0, 16, TRUE, "just to take a look. ", COL_GOLD, FALSE); + AddSText(0, 18, TRUE, "What have you got?", COL_WHITE, TRUE); + AddSText(0, 20, TRUE, "Say goodbye", COL_WHITE, TRUE); } else { - AddSText(0, 12, 1, "Talk to Wirt", COL_BLUE, 1); - AddSText(0, 18, 1, "Say goodbye", COL_WHITE, 1); + AddSText(0, 12, TRUE, "Talk to Wirt", COL_BLUE, TRUE); + AddSText(0, 18, TRUE, "Say goodbye", COL_WHITE, TRUE); } } @@ -1207,10 +1208,10 @@ void S_StartBBoy() { int iclr; - stextsize = 1; + stextsize = TRUE; stextscrl = FALSE; sprintf(tempstr, "I have this item for sale : Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); iclr = COL_WHITE; @@ -1220,9 +1221,9 @@ void S_StartBBoy() if (!boyitem._iStatFlag) iclr = COL_RED; if (boyitem._iMagical != ITEM_QUALITY_NORMAL) - AddSText(20, 10, 0, boyitem._iIName, iclr, 1); + AddSText(20, 10, FALSE, boyitem._iIName, iclr, TRUE); else - AddSText(20, 10, 0, boyitem._iName, iclr, 1); + AddSText(20, 10, FALSE, boyitem._iName, iclr, TRUE); #ifdef HELLFIRE AddSTextVal(10, boyitem._iIvalue - (boyitem._iIvalue >> 2)); @@ -1230,7 +1231,7 @@ void S_StartBBoy() AddSTextVal(10, boyitem._iIvalue + (boyitem._iIvalue >> 1)); #endif PrintStoreItem(&boyitem, 11, iclr); - AddSText(0, 22, 1, "Leave", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Leave", COL_WHITE, TRUE); OffsetSTextY(22, 6); } @@ -1244,19 +1245,19 @@ void S_StartHealer() plr[myplr]._pHPBase = plr[myplr]._pMaxHPBase; drawhpflag = TRUE; #endif - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 1, 1, "Welcome to the", COL_GOLD, 0); - AddSText(0, 3, 1, "Healer's home", COL_GOLD, 0); - AddSText(0, 9, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 12, 1, "Talk to Pepin", COL_BLUE, 1); + AddSText(0, 1, TRUE, "Welcome to the", COL_GOLD, FALSE); + AddSText(0, 3, TRUE, "Healer's home", COL_GOLD, FALSE); + AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 12, TRUE, "Talk to Pepin", COL_BLUE, TRUE); #ifdef HELLFIRE - AddSText(0, 14, 1, "Buy items", COL_WHITE, 1); - AddSText(0, 16, 1, "Leave Healer's home", COL_WHITE, 1); + AddSText(0, 14, TRUE, "Buy items", COL_WHITE, TRUE); + AddSText(0, 16, TRUE, "Leave Healer's home", COL_WHITE, TRUE); #else - AddSText(0, 14, 1, "Receive healing", COL_WHITE, 1); - AddSText(0, 16, 1, "Buy items", COL_WHITE, 1); - AddSText(0, 18, 1, "Leave Healer's home", COL_WHITE, 1); + AddSText(0, 14, TRUE, "Receive healing", COL_WHITE, TRUE); + AddSText(0, 16, TRUE, "Buy items", COL_WHITE, TRUE); + AddSText(0, 18, TRUE, "Leave Healer's home", COL_WHITE, TRUE); #endif AddSLine(5); storenumh = 20; @@ -1276,7 +1277,7 @@ void S_ScrollHBuy(int idx) iclr = COL_RED; } - AddSText(20, l, 0, healitem[idx]._iName, iclr, 1); + AddSText(20, l, FALSE, healitem[idx]._iName, iclr, TRUE); AddSTextVal(l, healitem[idx]._iIvalue); PrintStoreItem(&healitem[idx], l + 1, iclr); stextdown = l; @@ -1292,15 +1293,15 @@ void S_StartHBuy() { int i; - stextsize = 1; + stextsize = TRUE; stextscrl = TRUE; stextsval = 0; sprintf(tempstr, "I have these items for sale : Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollHBuy(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 0); + AddSText(0, 22, TRUE, "Back", COL_WHITE, FALSE); OffsetSTextY(22, 6); storenumh = 0; @@ -1314,13 +1315,13 @@ void S_StartHBuy() void S_StartStory() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 2, 1, "The Town Elder", COL_GOLD, 0); - AddSText(0, 9, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 12, 1, "Talk to Cain", COL_BLUE, 1); - AddSText(0, 14, 1, "Identify an item", COL_WHITE, 1); - AddSText(0, 18, 1, "Say goodbye", COL_WHITE, 1); + AddSText(0, 2, TRUE, "The Town Elder", COL_GOLD, FALSE); + AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 12, TRUE, "Talk to Cain", COL_BLUE, TRUE); + AddSText(0, 14, TRUE, "Identify an item", COL_WHITE, TRUE); + AddSText(0, 18, TRUE, "Say goodbye", COL_WHITE, TRUE); AddSLine(5); } @@ -1350,7 +1351,7 @@ void S_StartSIdentify() int i; idok = FALSE; - stextsize = 1; + stextsize = TRUE; storenumh = 0; for (i = 0; i < 48; i++) @@ -1399,21 +1400,21 @@ void S_StartSIdentify() if (!idok) { stextscrl = FALSE; sprintf(tempstr, "You have nothing to identify. Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } else { stextscrl = TRUE; stextsval = 0; stextsmax = plr[myplr]._pNumInv; sprintf(tempstr, "Identify which item? Your gold : %i", plr[myplr]._pGold); - AddSText(0, 1, 1, tempstr, COL_GOLD, 0); + AddSText(0, 1, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(3); AddSLine(21); S_ScrollSSell(stextsval); - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); OffsetSTextY(22, 6); } } @@ -1432,27 +1433,27 @@ void S_StartIdShow() if (!plr[myplr].HoldItem._iStatFlag) iclr = COL_RED; - AddSText(0, 7, 1, "This item is:", COL_WHITE, 0); - AddSText(20, 11, 0, plr[myplr].HoldItem._iIName, iclr, 0); + AddSText(0, 7, TRUE, "This item is:", COL_WHITE, FALSE); + AddSText(20, 11, FALSE, plr[myplr].HoldItem._iIName, iclr, FALSE); PrintStoreItem(&plr[myplr].HoldItem, 12, iclr); - AddSText(0, 18, 1, "Done", COL_WHITE, 1); + AddSText(0, 18, TRUE, "Done", COL_WHITE, TRUE); } void S_StartTalk() { int i, sn, sn2, la; - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; sprintf(tempstr, "Talk to %s", talkname[talker]); - AddSText(0, 2, 1, tempstr, COL_GOLD, 0); + AddSText(0, 2, TRUE, tempstr, COL_GOLD, FALSE); AddSLine(5); #ifdef SPAWN sprintf(tempstr, "Talking to %s", talkname[talker]); - AddSText(0, 10, 1, tempstr, COL_WHITE, 0); - AddSText(0, 12, 1, "is not available", COL_WHITE, 0); - AddSText(0, 14, 1, "in the shareware", COL_WHITE, 0); - AddSText(0, 16, 1, "version", COL_WHITE, 0); + AddSText(0, 10, TRUE, tempstr, COL_WHITE, FALSE); + AddSText(0, 12, TRUE, "is not available", COL_WHITE, FALSE); + AddSText(0, 14, TRUE, "in the shareware", COL_WHITE, FALSE); + AddSText(0, 16, TRUE, "version", COL_WHITE, FALSE); #else sn = 0; for (i = 0; i < MAXQUESTS; i++) { @@ -1472,48 +1473,48 @@ void S_StartTalk() for (i = 0; i < MAXQUESTS; i++) { if (quests[i]._qactive == QUEST_ACTIVE && ((DWORD *)&Qtalklist[talker])[i] != -1 && quests[i]._qlog) { - AddSText(0, sn, 1, questlist[i]._qlstr, COL_WHITE, 1); + AddSText(0, sn, TRUE, questlist[i]._qlstr, COL_WHITE, TRUE); sn += la; } } - AddSText(0, sn2, 1, "Gossip", COL_BLUE, 1); + AddSText(0, sn2, TRUE, "Gossip", COL_BLUE, TRUE); #endif - AddSText(0, 22, 1, "Back", COL_WHITE, 1); + AddSText(0, 22, TRUE, "Back", COL_WHITE, TRUE); } void S_StartTavern() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 1, 1, "Welcome to the", COL_GOLD, 0); - AddSText(0, 3, 1, "Rising Sun", COL_GOLD, 0); - AddSText(0, 9, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 12, 1, "Talk to Ogden", COL_BLUE, 1); - AddSText(0, 18, 1, "Leave the tavern", COL_WHITE, 1); + AddSText(0, 1, TRUE, "Welcome to the", COL_GOLD, FALSE); + AddSText(0, 3, TRUE, "Rising Sun", COL_GOLD, FALSE); + AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 12, TRUE, "Talk to Ogden", COL_BLUE, TRUE); + AddSText(0, 18, TRUE, "Leave the tavern", COL_WHITE, TRUE); AddSLine(5); storenumh = 20; } void S_StartBarMaid() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 2, 1, "Gillian", COL_GOLD, 0); - AddSText(0, 9, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 12, 1, "Talk to Gillian", COL_BLUE, 1); - AddSText(0, 18, 1, "Say goodbye", COL_WHITE, 1); + AddSText(0, 2, TRUE, "Gillian", COL_GOLD, FALSE); + AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 12, TRUE, "Talk to Gillian", COL_BLUE, TRUE); + AddSText(0, 18, TRUE, "Say goodbye", COL_WHITE, TRUE); AddSLine(5); storenumh = 20; } void S_StartDrunk() { - stextsize = 0; + stextsize = FALSE; stextscrl = FALSE; - AddSText(0, 2, 1, "Farnham the Drunk", COL_GOLD, 0); - AddSText(0, 9, 1, "Would you like to:", COL_GOLD, 0); - AddSText(0, 12, 1, "Talk to Farnham", COL_BLUE, 1); - AddSText(0, 18, 1, "Say Goodbye", COL_WHITE, 1); + AddSText(0, 2, TRUE, "Farnham the Drunk", COL_GOLD, FALSE); + AddSText(0, 9, TRUE, "Would you like to:", COL_GOLD, FALSE); + AddSText(0, 12, TRUE, "Talk to Farnham", COL_BLUE, TRUE); + AddSText(0, 18, TRUE, "Say Goodbye", COL_WHITE, TRUE); AddSLine(5); storenumh = 20; } diff --git a/Source/stores.h b/Source/stores.h index d17ea9f17..897ef76a5 100644 --- a/Source/stores.h +++ b/Source/stores.h @@ -52,7 +52,7 @@ void ClearSText(int s, int e); void AddSLine(int y); void AddSTextVal(int y, int val); void OffsetSTextY(int y, int yo); -void AddSText(int x, int y, int j, char *str, char clr, int sel); +void AddSText(int x, int y, BOOL j, char *str, char clr, BOOL sel); void StoreAutoPlace(); void S_StartSmith(); void S_ScrollSBuy(int idx); diff --git a/structs.h b/structs.h index c5b4ad901..d06247270 100644 --- a/structs.h +++ b/structs.h @@ -1602,7 +1602,7 @@ typedef struct STextStruct { BOOL _sjust; char _sclr; int _sline; - int _ssel; + BOOL _ssel; int _sval; } STextStruct;