diff --git a/Source/automap.cpp b/Source/automap.cpp index 94224c6a1..24953eb63 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -248,7 +248,6 @@ void DrawAutomap() DrawAutomapGame(); } // 4B8968: using guessed type int sbookflag; -// 69BD04: using guessed type int questlog; // 69CF0C: using guessed type int gpBufEnd; void DrawAutomapType(int sx, int sy, WORD automap_type) diff --git a/Source/control.cpp b/Source/control.cpp index da53b7015..a612c7b9f 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1559,7 +1559,7 @@ void CheckBtnUp() if (MouseY >= PanBtnPos[i][1] && MouseY <= PanBtnPos[i][1] + PanBtnPos[i][3]) { switch (i) { case PANBTN_CHARINFO: - questlog = 0; + questlog = FALSE; chrflag = chrflag == 0; break; case PANBTN_QLOG: @@ -1567,7 +1567,7 @@ void CheckBtnUp() if (!questlog) StartQuestlog(); else - questlog = 0; + questlog = FALSE; break; case PANBTN_AUTOMAP: DoAutoMap(); @@ -1618,7 +1618,6 @@ void CheckBtnUp() // 4B8968: using guessed type int sbookflag; // 4B8C90: using guessed type int panbtndown; // 646D00: using guessed type char qtextflag; -// 69BD04: using guessed type int questlog; void FreeControlPan() { @@ -2316,7 +2315,6 @@ void DrawDurIcon() } } // 4B8968: using guessed type int sbookflag; -// 69BD04: using guessed type int questlog; int DrawDurIcon4Item(ItemStruct *pItem, int x, int c) { diff --git a/Source/cursor.cpp b/Source/cursor.cpp index dd032bb6a..88df6b891 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -691,4 +691,3 @@ void CheckCursMove() // 4B8CCC: using guessed type int dword_4B8CCC; // 52569C: using guessed type int zoomflag; // 52575C: using guessed type int doomflag; -// 69BD04: using guessed type int questlog; diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 0d4e7e248..1edb8d671 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -822,7 +822,6 @@ BOOL LeftMouseDown(int wParam) // 525740: using guessed type int PauseMode; // 52575C: using guessed type int doomflag; // 646D00: using guessed type char qtextflag; -// 69BD04: using guessed type int questlog; // 6AA705: using guessed type char stextflag; BOOL LeftMouseCmd(BOOL bShift) @@ -1085,7 +1084,7 @@ void PressKey(int vkey) qtextflag = 0; sfx_stop(); } - questlog = 0; + questlog = FALSE; automapflag = 0; msgdelay = 0; gamemenu_off(); @@ -1203,7 +1202,7 @@ void PressKey(int vkey) qtextflag = 0; sfx_stop(); } - questlog = 0; + questlog = FALSE; automapflag = 0; msgdelay = 0; gamemenu_off(); @@ -1216,7 +1215,6 @@ void PressKey(int vkey) // 525740: using guessed type int PauseMode; // 52B9F0: using guessed type char msgdelay; // 646D00: using guessed type char qtextflag; -// 69BD04: using guessed type int questlog; // 6AA705: using guessed type char stextflag; void diablo_pause_game() @@ -1285,7 +1283,7 @@ void PressChar(int vkey) case 'C': case 'c': if(!stextflag) { - questlog = 0; + questlog = FALSE; chrflag = chrflag == 0; if(!chrflag || invflag) { if(MouseX > 160 && MouseY < 352) { @@ -1305,7 +1303,7 @@ void PressChar(int vkey) if(!questlog) { StartQuestlog(); } else { - questlog = 0; + questlog = FALSE; } } break; @@ -1505,7 +1503,6 @@ void PressChar(int vkey) // 52569C: using guessed type int zoomflag; // 525740: using guessed type int PauseMode; // 52575C: using guessed type int doomflag; -// 69BD04: using guessed type int questlog; // 6AA705: using guessed type char stextflag; void LoadLvlGFX() diff --git a/Source/items.cpp b/Source/items.cpp index 0c4e9ca67..1a664616f 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -3777,7 +3777,6 @@ void DrawUniqueInfo() } } } -// 69BD04: using guessed type int questlog; void PrintItemMisc(ItemStruct *x) { diff --git a/Source/minitext.cpp b/Source/minitext.cpp index 93a519552..c76201309 100644 --- a/Source/minitext.cpp +++ b/Source/minitext.cpp @@ -65,7 +65,7 @@ void InitQuestText() void InitQTextMsg(int m) { if (alltext[m].scrlltxt) { - questlog = 0; + questlog = FALSE; qtextptr = alltext[m].txtstr; qtextflag = TRUE; qtexty = 500; @@ -80,7 +80,6 @@ void InitQTextMsg(int m) // 646D00: using guessed type char qtextflag; // 646D04: using guessed type int scrolltexty; // 646D08: using guessed type int sgLastScroll; -// 69BD04: using guessed type int questlog; void DrawQTextBack() { diff --git a/Source/quests.cpp b/Source/quests.cpp index 92fee6000..d272c2230 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -3,7 +3,7 @@ #include "../types.h" int qtopline; // idb -int questlog; // weak +BOOL questlog; void *pQLogCel; QuestStruct quests[MAXQUESTS]; int qline; // weak @@ -70,7 +70,7 @@ void InitQuests() } initiatedQuests = 0; - questlog = 0; + questlog = FALSE; ALLQUESTS = 1; WaterDone = 0; @@ -127,7 +127,6 @@ void InitQuests() quests[QTYPE_VB]._qvar1 = 2; } // 679660: using guessed type char gbMaxPlayers; -// 69BD04: using guessed type int questlog; // 69BE90: using guessed type int qline; void CheckQuests() @@ -860,34 +859,25 @@ void DrawQuestLog() void StartQuestlog() { - signed int v0; // eax - int v1; // edx - unsigned int v2; // ecx - int v3; // ecx + unsigned int i; - v0 = 0; - v1 = 0; numqlines = 0; - v2 = 0; - do { - if (quests[v2]._qactive == 2 && quests[v2]._qlog) - qlist[v0++] = v1; - ++v2; - ++v1; - } while (v2 < MAXQUESTS); - numqlines = v0; - if (v0 <= 5) - v3 = 8; - else - v3 = 5 - (v0 >> 1); - qtopline = v3; + for (i = 0; i < MAXQUESTS; i++) { + if (quests[i]._qactive == 2 && quests[i]._qlog) { + qlist[numqlines++] = i; + } + } + if (numqlines > 5) { + qtopline = 5 - (numqlines >> 1); + } else { + qtopline = 8; + } qline = 22; - if (v0) - qline = v3; - questlog = 1; + if (numqlines != 0) + qline = qtopline; + questlog = TRUE; ALLQUESTS = 1; } -// 69BD04: using guessed type int questlog; // 69BE90: using guessed type int qline; // 69BED4: using guessed type int numqlines; @@ -928,9 +918,8 @@ void QuestlogEnter() PlaySFX(IS_TITLSLCT); if (numqlines && qline != 22) InitQTextMsg((unsigned char)quests[qlist[(qline - qtopline) >> 1]]._qmsg); - questlog = 0; + questlog = FALSE; } -// 69BD04: using guessed type int questlog; // 69BE90: using guessed type int qline; // 69BED4: using guessed type int numqlines; diff --git a/Source/quests.h b/Source/quests.h index 24605af23..da8967c64 100644 --- a/Source/quests.h +++ b/Source/quests.h @@ -3,7 +3,7 @@ #define __QUESTS_H__ extern int qtopline; // idb -extern int questlog; // weak +extern BOOL questlog; extern void *pQLogCel; extern QuestStruct quests[MAXQUESTS]; extern int qline; // weak diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 9a891364d..69d85e8da 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -431,7 +431,6 @@ void DrawView(int StartX, int StartY) // 525740: using guessed type int PauseMode; // 52B9F1: using guessed type char msgflag; // 646D00: using guessed type char qtextflag; -// 69BD04: using guessed type int questlog; void DrawGame(int x, int y) { @@ -539,7 +538,6 @@ void DrawGame(int x, int y) // 5C2FFC: using guessed type int dword_5C2FFC; // 5C3000: using guessed type int scr_pix_width; // 5C3004: using guessed type int scr_pix_height; -// 69BD04: using guessed type int questlog; // 69CF0C: using guessed type int gpBufEnd; // 69CF20: using guessed type char arch_draw_type; @@ -2192,7 +2190,6 @@ void DrawZoom(int x, int y) // 5C2FFC: using guessed type int dword_5C2FFC; // 5C3000: using guessed type int scr_pix_width; // 5C3004: using guessed type int scr_pix_height; -// 69BD04: using guessed type int questlog; // 69CF0C: using guessed type int gpBufEnd; // 69CF20: using guessed type char arch_draw_type; diff --git a/Source/stores.cpp b/Source/stores.cpp index 7a720b63d..dab2e1c8e 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -1784,7 +1784,7 @@ void StartStore(char s) sbookflag = 0; invflag = 0; chrflag = 0; - questlog = 0; + questlog = FALSE; dropGoldFlag = FALSE; ClearSText(0, 24); ReleaseStoreBtn(); @@ -1876,7 +1876,6 @@ void StartStore(char s) } } // 4B8968: using guessed type int sbookflag; -// 69BD04: using guessed type int questlog; // 69F10C: using guessed type int storenumh; // 6A8A28: using guessed type int stextsel; // 6AA705: using guessed type char stextflag; diff --git a/Source/town.cpp b/Source/town.cpp index 81f0a2596..333774541 100644 --- a/Source/town.cpp +++ b/Source/town.cpp @@ -826,7 +826,6 @@ void T_DrawGame(int x, int y) // 5C2FFC: using guessed type int dword_5C2FFC; // 5C3000: using guessed type int scr_pix_width; // 5C3004: using guessed type int scr_pix_height; -// 69BD04: using guessed type int questlog; // 69CF0C: using guessed type int gpBufEnd; void T_DrawZoom(int x, int y) @@ -1001,7 +1000,6 @@ void T_DrawZoom(int x, int y) // 5C2FFC: using guessed type int dword_5C2FFC; // 5C3000: using guessed type int scr_pix_width; // 5C3004: using guessed type int scr_pix_height; -// 69BD04: using guessed type int questlog; // 69CF0C: using guessed type int gpBufEnd; void T_DrawView(int StartX, int StartY) @@ -1056,7 +1054,6 @@ void T_DrawView(int StartX, int StartY) // 525740: using guessed type int PauseMode; // 52B9F1: using guessed type char msgflag; // 646D00: using guessed type char qtextflag; -// 69BD04: using guessed type int questlog; // 69BEF8: using guessed type int light_table_index; // 69CF94: using guessed type int cel_transparency_active; // 6AA705: using guessed type char stextflag;