diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index c18dbf24d..e11f6b2d5 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -18,29 +18,29 @@ const BYTE L3TITE8[20] = { 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 52, 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] = { 2u, 1u, 9u, 7u, 68u, 0u }; -const BYTE L3TITE13[6] = { 1u, 2u, 10u, 7u, 69u, 0u }; -const BYTE L3CREV1[6] = { 2u, 1u, 8u, 7u, 84u, 85u }; -const BYTE L3CREV2[6] = { 2u, 1u, 8u, 11u, 86u, 87u }; -const BYTE L3CREV3[6] = { 1u, 2u, 8u, 10u, 89u, 88u }; -const BYTE L3CREV4[6] = { 2u, 1u, 8u, 7u, 90u, 91u }; -const BYTE L3CREV5[6] = { 1u, 2u, 8u, 11u, 92u, 93u }; -const BYTE L3CREV6[6] = { 1u, 2u, 8u, 10u, 95u, 94u }; -const BYTE L3CREV7[6] = { 2u, 1u, 8u, 7u, 96u, 101u }; -const BYTE L3CREV8[6] = { 1u, 2u, 2u, 8u, 102u, 97u }; -const BYTE L3CREV9[6] = { 2u, 1u, 3u, 8u, 103u, 98u }; -const BYTE L3CREV10[6] = { 2u, 1u, 4u, 8u, 104u, 99u }; -const BYTE L3CREV11[6] = { 1u, 2u, 6u, 8u, 105u, 100u }; -const BYTE L3ISLE1[14] = { 2u, 3u, 5u, 14u, 4u, 9u, 13u, 12u, 7u, 7u, 7u, 7u, 7u, 7u }; -const BYTE L3ISLE2[14] = { 3u, 2u, 5u, 2u, 14u, 13u, 10u, 12u, 7u, 7u, 7u, 7u, 7u, 7u }; -const BYTE L3ISLE3[14] = { 2u, 3u, 5u, 14u, 4u, 9u, 13u, 12u, 29u, 30u, 25u, 28u, 31u, 32u }; -const BYTE L3ISLE4[14] = { 3u, 2u, 5u, 2u, 14u, 13u, 10u, 12u, 29u, 26u, 30u, 31u, 27u, 32u }; -const BYTE L3ISLE5[10] = { 2u, 2u, 5u, 14u, 13u, 12u, 7u, 7u, 7u, 7u }; -const BYTE L3XTRA1[4] = { 1u, 1u, 7u, 106u }; -const BYTE L3XTRA2[4] = { 1u, 1u, 7u, 107u }; -const BYTE L3XTRA3[4] = { 1u, 1u, 7u, 108u }; -const BYTE L3XTRA4[4] = { 1u, 1u, 9u, 109u }; -const BYTE L3XTRA5[4] = { 1u, 1u, 10u, 110u }; +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, diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 5ab19f2a4..a23ff8e81 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -940,7 +940,6 @@ void MakeLightTable() } } } -// 525728: using guessed type int light4flag; #ifdef _DEBUG void ToggleLighting_2() @@ -1136,7 +1135,6 @@ void ProcessLightList() dolighting = FALSE; } -// 642A18: using guessed type int dolighting; void SavePreLighting() { @@ -1193,7 +1191,6 @@ void ChangeVisionRadius(int id, int r) } } } -// 642A0C: using guessed type int dovision; void ChangeVisionXY(int id, int x, int y) { @@ -1211,7 +1208,6 @@ void ChangeVisionXY(int id, int x, int y) } } } -// 642A0C: using guessed type int dovision; void ProcessVisionList() { @@ -1257,8 +1253,6 @@ void ProcessVisionList() dovision = FALSE; } -// 5A5590: using guessed type char TransVal; -// 642A0C: using guessed type int dovision; void lighting_color_cycling() { @@ -1285,4 +1279,3 @@ void lighting_color_cycling() tbl += 224; } } -// 525728: using guessed type int light4flag; diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 4b615a3cf..96e1c3a04 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -1,25 +1,25 @@ #include "diablo.h" #include "../3rdParty/Storm/Source/storm.h" -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 */ @@ -296,9 +296,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) { @@ -372,8 +369,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) { @@ -431,12 +426,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) { @@ -539,13 +528,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) { @@ -695,11 +677,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) { @@ -914,13 +891,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) { @@ -974,7 +944,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) { @@ -1025,7 +994,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) { @@ -1074,11 +1042,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) { @@ -1178,10 +1141,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) { @@ -1396,13 +1355,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) { @@ -1471,10 +1423,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) { @@ -1621,11 +1569,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) { @@ -1826,13 +1769,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) { @@ -1886,7 +1822,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) { @@ -1940,7 +1875,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) { @@ -1990,11 +1924,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) { @@ -2152,13 +2081,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() { @@ -2304,7 +2226,6 @@ void scrollrt_draw_game_screen(BOOL draw_cursor) unlock_buf(0); } } -// 52571C: using guessed type int drawpanflag; void scrollrt_draw_cursor_back_buffer() { @@ -2403,8 +2324,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) { @@ -2524,24 +2443,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) @@ -2725,5 +2641,3 @@ void DrawAndBlit() drawbtnflag = FALSE; drawsbarflag = FALSE; } -// 4B8960: using guessed type int talkflag; -// 52571C: using guessed type int drawpanflag; diff --git a/Source/scrollrt.h b/Source/scrollrt.h index b403e1fb9..baeac29ba 100644 --- a/Source/scrollrt.h +++ b/Source/scrollrt.h @@ -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);