diff --git a/Source/appfat.cpp b/Source/appfat.cpp index 8c64ba059..692072b71 100644 --- a/Source/appfat.cpp +++ b/Source/appfat.cpp @@ -5,9 +5,12 @@ // +Infinity after initialization of appfat.cpp. float appfat_cpp_init_value; +#ifndef NO_GLOBALS char sz_error_buf[256]; int terminating; // weak int cleanup_thread_id; // weak +#endif + char empty_string; // appfat_cpp_init initializes the C++ runtime of appfat.cpp. diff --git a/Source/automap.cpp b/Source/automap.cpp index e85f8e83a..50bcf2d7a 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -2,9 +2,12 @@ #include "../types.h" +#ifndef NO_GLOBALS USHORT automaptype[512]; -static int MapX; -static int MapY; +#endif +STATIC int MapX; +STATIC int MapY; +#ifndef NO_GLOBALS bool automapflag; // idb char AMbyte_4B7E4C[32]; char automapview[DMAXX][DMAXY]; @@ -16,6 +19,7 @@ int AutoMapXPos; // weak int AutoMapYPos; // weak int AMPlayerX; // weak int AMPlayerY; // weak +#endif // color used to draw the player's arrow #define COLOR_PLAYER (PAL8_ORANGE+1) diff --git a/Source/control.cpp b/Source/control.cpp index ff6fbdd74..ee89eff6e 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS char sgbNextTalkSave; // weak char sgbTalkSavePos; // weak void *pDurIcons; @@ -56,6 +57,7 @@ void *pSpellCels; int panbtndown; // weak void *pTalkPanel; // idb int spselflag; // weak +#endif const unsigned char fontframe[127] = { diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 9512a1b30..d29fcfc21 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int cursH; // weak int icursH28; // idb int cursW; // idb @@ -20,7 +21,7 @@ int cursmx; int cursmy; int dword_4B8CCC; // weak int pcurs; // idb - +#endif /* rdata */ const int InvItemWidth[180] = diff --git a/Source/dead.cpp b/Source/dead.cpp index 4ea475b7d..e280cf997 100644 --- a/Source/dead.cpp +++ b/Source/dead.cpp @@ -2,9 +2,11 @@ #include "../types.h" +#ifndef NO_GLOBALS int spurtndx; // weak DeadStruct dead[MAXDEAD]; int stonendx; +#endif void __cdecl InitDead() { diff --git a/Source/debug.cpp b/Source/debug.cpp index dda74d6d9..b7e910333 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -2,9 +2,11 @@ #include "../types.h" +#ifndef NO_GLOBALS void *pSquareCel; char dMonsDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; char dFlagDbg[NUMLEVELS][MAXDUNX][MAXDUNY]; +#endif void __cdecl LoadDebugGFX() { diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 08624959b..0eb0fbc55 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -2,7 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS int diablo_cpp_init_value; // weak + HWND ghMainWnd; int glMid1Seed[NUMLEVELS]; int glMid2Seed[NUMLEVELS]; @@ -34,6 +36,7 @@ int PauseMode; // weak int sgnTimeoutCurs; char sgbMouseDown; // weak int color_cycle_timer; // weak +#endif int diablo_inf = 0x7F800000; // weak diff --git a/Source/doom.cpp b/Source/doom.cpp index 8d1a0cab6..d63427bae 100644 --- a/Source/doom.cpp +++ b/Source/doom.cpp @@ -4,8 +4,10 @@ int doom_quest_time; // weak int doom_stars_drawn; // weak +#ifndef NO_GLOBALS void *pDoomCel; int doomflag; // weak +#endif int DoomQuestState; // idb /* diff --git a/Source/drlg_l1.cpp b/Source/drlg_l1.cpp index b71bf2c89..b4ca179c3 100644 --- a/Source/drlg_l1.cpp +++ b/Source/drlg_l1.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS char L5dungeon[80][80]; char mydflags[40][40]; int setloadflag; // weak @@ -12,6 +13,7 @@ int VR1; int VR2; int VR3; void *pSetPiece; // idb +#endif const ShadowStruct SPATS[37] = { diff --git a/Source/drlg_l2.cpp b/Source/drlg_l2.cpp index 00ca033a7..c7ab13700 100644 --- a/Source/drlg_l2.cpp +++ b/Source/drlg_l2.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int nSx1; int nSx2; // weak int nSy1; @@ -10,6 +11,7 @@ int nRoomCnt; char predungeon[40][40]; ROOMNODE RoomList[81]; HALLNODE *pHallList; +#endif int Area_Min = 2; // weak int Room_Max = 10; // weak diff --git a/Source/drlg_l3.cpp b/Source/drlg_l3.cpp index ae2aea7d7..45f6e7f86 100644 --- a/Source/drlg_l3.cpp +++ b/Source/drlg_l3.cpp @@ -2,10 +2,12 @@ #include "../types.h" +#ifndef NO_GLOBALS char lavapool; // weak int abyssx; // weak int lockoutcnt; // weak char lockout[40][40]; +#endif 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 }; diff --git a/Source/drlg_l4.cpp b/Source/drlg_l4.cpp index 607b5d9e0..d0d020b72 100644 --- a/Source/drlg_l4.cpp +++ b/Source/drlg_l4.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int diabquad1x; // weak int diabquad1y; // weak int diabquad3x; // idb @@ -20,6 +21,7 @@ int SP4y2; // weak char L4dungeon[80][80]; char dung[20][20]; //int dword_52A4DC; // weak +#endif const unsigned char L4ConvTbl[16] = { 30u, 6u, 1u, 6u, 2u, 6u, 6u, 6u, 9u, 6u, 1u, 6u, 2u, 6u, 3u, 6u }; const unsigned char L4USTAIRS[42] = diff --git a/Source/dx.cpp b/Source/dx.cpp index b9f046464..0af1e0f41 100644 --- a/Source/dx.cpp +++ b/Source/dx.cpp @@ -2,8 +2,11 @@ #include "../types.h" +#ifndef NO_GLOBALS void *sgpBackBuf; +#endif int dx_cpp_init_value; // weak +#ifndef NO_GLOBALS IDirectDraw *lpDDInterface; IDirectDrawPalette *lpDDPalette; // idb int sgdwLockCount; @@ -14,6 +17,7 @@ static CRITICAL_SECTION sgMemCrit; char gbBackBuf; // weak char gbEmulate; // weak HMODULE ghDiabMod; // idb +#endif int dx_inf = 0x7F800000; // weak diff --git a/Source/effects.cpp b/Source/effects.cpp index 7c8a1c441..95dc34d01 100644 --- a/Source/effects.cpp +++ b/Source/effects.cpp @@ -2,11 +2,14 @@ #include "../types.h" +#ifndef NO_GLOBALS int effects_cpp_init_value; // weak + int sfxdelay; // weak int sfxdnum; void *sfx_stream; TSFX *sfx_data_cur; +#endif const int effects_inf = 0x7F800000; // weak const char monster_action_sounds[] = { 'a', 'h', 'd', 's' }; // idb diff --git a/Source/encrypt.cpp b/Source/encrypt.cpp index 0688ade0b..0038b4ffa 100644 --- a/Source/encrypt.cpp +++ b/Source/encrypt.cpp @@ -2,7 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS int hashtable[1280]; +#endif void __fastcall Decrypt(void *block, int size, int key) { diff --git a/Source/engine.cpp b/Source/engine.cpp index 4c4c43fde..217c954a2 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -2,15 +2,20 @@ #include "../types.h" +#ifndef NO_GLOBALS int engine_cpp_init_value; // weak + char gbPixelCol; // automap pixel color 8-bit (palette entry) int dword_52B970; // bool flip - if y < x int orgseed; // weak int sgnWidth; int sglGameSeed; // weak -static CRITICAL_SECTION sgMemCrit; +#endif +STATIC CRITICAL_SECTION sgMemCrit; +#ifndef NO_GLOBALS int SeedCount; // weak int dword_52B99C; // bool valid - if x/y are in bounds +#endif const int engine_inf = 0x7F800000; // weak const int rand_increment = 1; // unused diff --git a/Source/error.cpp b/Source/error.cpp index aab56c54b..5f775897b 100644 --- a/Source/error.cpp +++ b/Source/error.cpp @@ -2,10 +2,12 @@ #include "../types.h" +#ifndef NO_GLOBALS char msgtable[80]; char msgdelay; // weak char msgflag; // weak char msgcnt; // weak +#endif char *MsgStrings[44] = { diff --git a/Source/gendung.cpp b/Source/gendung.cpp index b6a53fc9a..f5ce07f77 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS short level_frame_types[2048]; int themeCount; char nTransTable[2049]; @@ -68,6 +69,7 @@ char dMissile[MAXDUNX][MAXDUNY]; int dminx; // weak int dminy; // weak short dpiece_defs_map_2[16][MAXDUNX][MAXDUNY]; +#endif void __cdecl FillSolidBlockTbls() { diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index 0672f352f..579b01bf4 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS void *optbar_cel; bool byte_634464; // weak void *PentSpin_cel; @@ -14,6 +15,7 @@ TMenuItem *dword_634480; // idb void *option_cel; void *sgpLogo; int dword_63448C; // weak +#endif const unsigned char lfontframe[127] = { diff --git a/Source/help.cpp b/Source/help.cpp index a53925599..72b81c195 100644 --- a/Source/help.cpp +++ b/Source/help.cpp @@ -2,11 +2,13 @@ #include "../types.h" +#ifndef NO_GLOBALS int help_select_line; // weak int dword_634494; // weak int helpflag; int displayinghelp[22]; /* check, does nothing? */ int HelpTop; // weak +#endif const char gszHelpText[] = { diff --git a/Source/interfac.cpp b/Source/interfac.cpp index 2832448ee..cb82f18f1 100644 --- a/Source/interfac.cpp +++ b/Source/interfac.cpp @@ -2,10 +2,12 @@ #include "../types.h" +#ifndef NO_GLOBALS void *sgpBackCel; float interfac_cpp_init_value; int sgdwProgress; int progress_id; // idb +#endif const int interfac_inf = 0x7F800000; // weak const unsigned char progress_bar_colours[3] = { 138u, 43u, 254u }; diff --git a/Source/inv.cpp b/Source/inv.cpp index dc3e5f8e9..31ac0c892 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -2,10 +2,12 @@ #include "../types.h" +#ifndef NO_GLOBALS BOOL invflag; void *pInvCels; int drawsbarflag; // idb int sgdwLastTime; // check name +#endif const InvXY InvRect[73] = { diff --git a/Source/items.cpp b/Source/items.cpp index 3ad59b2bd..04d033430 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int itemactive[MAXITEMS]; int uitemflag; int itemavail[MAXITEMS]; @@ -13,7 +14,7 @@ unsigned char *Item2Frm[35]; int UniqueItemFlag[128]; int numitems; int gnNumGetRecords; - +#endif const PLStruct PL_Prefix[84] = { diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 580f37897..8f12432c0 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS LightListStruct VisionList[32]; char lightactive[32]; LightListStruct LightList[32]; @@ -15,6 +16,7 @@ char dung_map_rgba[16384]; /* int [64][64] short [64][128] char [64][256] */ int visionid; char *pLightTbl; /* todo: struct? */ BOOL lightflag; +#endif char CrawlTable[2749] = { diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index 35aeb896d..58ee55def 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -2,7 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS void *tbuff; +#endif void __fastcall LoadGame(BOOL firstflag) { diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index 0bbbe3480..8f826e7a6 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -2,8 +2,11 @@ #include "../types.h" +#ifndef NO_GLOBALS int mainmenu_cpp_init_value; // weak + char chr_name_str[16]; +#endif const int mainmenu_inf = 0x7F800000; // weak diff --git a/Source/minitext.cpp b/Source/minitext.cpp index fe55798f0..742e3eaae 100644 --- a/Source/minitext.cpp +++ b/Source/minitext.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int qtexty; // weak char *qtextptr; int qtextSpd; // weak @@ -10,6 +11,7 @@ int scrolltexty; // weak int sgLastScroll; // weak void *pMedTextCels; void *pTextBoxCels; +#endif const unsigned char mfontframe[127] = { diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 244c4c6df..3122b1812 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int missileactive[MAXMISSILES]; int missileavail[MAXMISSILES]; MissileStruct missile[MAXMISSILES]; @@ -10,6 +11,7 @@ int ManashieldFlag; ChainStruct chain[MAXMISSILES]; int MissilePreFlag; // weak int numchains; // weak +#endif MissileData missiledata[68] = { diff --git a/Source/monster.cpp b/Source/monster.cpp index 7f64809a6..45d5d6c3b 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -2,9 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS // Tracks which missile files are already loaded int MissileFileFlag; - int monster_cpp_init_value; // weak int monstkills[MAXMONSTERS]; int monstactive[MAXMONSTERS]; @@ -17,6 +17,7 @@ CMonster Monsters[16]; int monstimgtot; // weak int uniquetrans; int nummtypes; +#endif const int monster_inf = 0x7F800000; // weak const char plr2monst[9] = { 0, 5, 3, 7, 1, 4, 6, 0, 2 }; diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index b7ac94731..0ee45e146 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -2,13 +2,16 @@ #include "../types.h" +#ifndef NO_GLOBALS int mpqapi_cpp_init_value; // weak + int sgdwMpqOffset; // idb char mpq_buf[4096]; _HASHENTRY *sgpHashTbl; bool save_archive_modified; // weak _BLOCKENTRY *sgpBlockTbl; bool save_archive_open; // weak +#endif const int mpqapi_inf = 0x7F800000; // weak @@ -16,7 +19,9 @@ const int mpqapi_inf = 0x7F800000; // weak /* data */ +#ifndef NO_GLOBALS HANDLE sghArchive = (HANDLE)0xFFFFFFFF; // idb +#endif struct mpqapi_cpp_init { diff --git a/Source/msg.cpp b/Source/msg.cpp index f083c98c9..1d55cdf4c 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int sgdwOwnerWait; // weak int msg_cpp_init_value; // weak int sgdwRecvOffset; // idb @@ -20,6 +21,7 @@ int deltaload; // weak char gbBufferMsgs; // weak int dword_676198; // weak int msg_err_timer; // weak +#endif const int msg_inf = 0x7F800000; // weak diff --git a/Source/msgcmd.cpp b/Source/msgcmd.cpp index 9417ea41c..51ba5f246 100644 --- a/Source/msgcmd.cpp +++ b/Source/msgcmd.cpp @@ -4,9 +4,11 @@ /* TODO: decompile and fix, commands are NOT deleted properly */ +#ifndef NO_GLOBALS int msgcmd_cpp_init_value; // weak ChatCmd sgChat_Cmd; int sgdwMsgCmdTimer; +#endif const int msgcmd_inf = 0x7F800000; // weak diff --git a/Source/multi.cpp b/Source/multi.cpp index 0432542ad..a9449b1f4 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS char gbSomebodyWonGameKludge; // weak char pkdata_6761C0[4100]; char szPlayerDescript[128]; @@ -27,6 +28,7 @@ char szPlayerName[128]; char gbDeltaSender; // weak int sgbNetInited; // weak int player_state[MAX_PLRS]; +#endif const int multi_inf = 0x7F800000; // weak const int event_types[3] = diff --git a/Source/objects.cpp b/Source/objects.cpp index bb0101478..79c4ed51d 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int trapid; // weak int trapdir; // weak unsigned char *pObjCels[40]; @@ -13,6 +14,7 @@ int objectavail[MAXOBJECTS]; ObjectStruct object[MAXOBJECTS]; int InitObjFlag; // weak int numobjfiles; // weak +#endif int ObjTypeConv[113] = { diff --git a/Source/palette.cpp b/Source/palette.cpp index 26077e72c..146926527 100644 --- a/Source/palette.cpp +++ b/Source/palette.cpp @@ -2,11 +2,13 @@ #include "../types.h" +#ifndef NO_GLOBALS PALETTEENTRY logical_palette[256]; int palette_cpp_init_value; // weak PALETTEENTRY system_palette[256]; PALETTEENTRY orig_palette[256]; UINT gdwPalEntries; +#endif const int palette_inf = 0x7F800000; // weak diff --git a/Source/path.cpp b/Source/path.cpp index bcfb70ffe..abae6aeff 100644 --- a/Source/path.cpp +++ b/Source/path.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS // preallocated nodes, search is terminated after 300 nodes are visited PATHNODE path_nodes[300]; // size of the pnode_tblptr stack @@ -18,6 +19,7 @@ PATHNODE *pnode_ptr; PATHNODE *pnode_tblptr[300]; // a linked list of the A* frontier, sorted by distance PATHNODE *path_2_nodes; +#endif // for iterating over the 8 possible movement directions const char pathxdir[8] = { -1, -1, 1, 1, -1, 0, 1, 0 }; diff --git a/Source/pfile.cpp b/Source/pfile.cpp index f7f62bc51..255969328 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -5,9 +5,11 @@ #define PASSWORD_SINGLE "xrgyrkj1" #define PASSWORD_MULTI "szqnlsk1" -static int pfile_cpp_init_value; -static char hero_names[MAX_CHARACTERS][PLR_NAME_LEN]; +STATIC int pfile_cpp_init_value; +STATIC char hero_names[MAX_CHARACTERS][PLR_NAME_LEN]; +#ifndef NO_GLOBALS BOOL gbValidSaveFile; // idb +#endif const int pfile_inf = 0x7F800000; // weak diff --git a/Source/player.cpp b/Source/player.cpp index 4ec47cd60..b03c31ac0 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int plr_lframe_size; // idb int plr_wframe_size; // idb UCHAR plr_gfx_flag = 0; @@ -18,6 +19,7 @@ UCHAR plr_gfx_bflag = 0; int plr_sframe_size; // idb int deathdelay; // weak int plr_dframe_size; // idb +#endif const int player_inf = 0x7F800000; // weak const char ArmourChar[4] = { 'L', 'M', 'H', 0 }; diff --git a/Source/plrmsg.cpp b/Source/plrmsg.cpp index be08bf072..04903fdeb 100644 --- a/Source/plrmsg.cpp +++ b/Source/plrmsg.cpp @@ -2,9 +2,11 @@ #include "../types.h" +#ifndef NO_GLOBALS int plrmsg_ticks; // weak char plr_msg_slot; // weak _plrmsg plr_msgs[8]; +#endif const char text_color_from_player_num[5] = { COL_WHITE, COL_WHITE, COL_WHITE, COL_WHITE, COL_GOLD }; diff --git a/Source/portal.cpp b/Source/portal.cpp index 0e4599819..f2db5daa2 100644 --- a/Source/portal.cpp +++ b/Source/portal.cpp @@ -2,8 +2,10 @@ #include "../types.h" +#ifndef NO_GLOBALS PortalStruct portal[MAXPORTAL]; int portalindex; +#endif int WarpDropX[MAXPORTAL] = { 57, 59, 61, 63 }; int WarpDropY[MAXPORTAL] = { 40, 40, 40, 40 }; diff --git a/Source/quests.cpp b/Source/quests.cpp index bab906fef..07f96bb9b 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int qtopline; // idb int questlog; // weak void *pQLogCel; @@ -15,6 +16,7 @@ int ReturnLvlX; // idb int ReturnLvlT; // idb int ALLQUESTS; // idb int ReturnLvl; // idb +#endif QuestData questlist[MAXQUESTS] = { diff --git a/Source/render.cpp b/Source/render.cpp index 248537b21..740785f9d 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -2,12 +2,14 @@ #include "../types.h" +#ifndef NO_GLOBALS int WorldBoolFlag = 0; unsigned int gdwCurrentMask = 0; // char world_4B3264 = 0; unsigned char *gpCelFrame = NULL; unsigned int *gpDrawMask = NULL; // char world_4B326D[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +#endif unsigned int RightMask[32] = { diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 651a25c2a..19b0a5f13 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int light_table_index; // weak int screen_y_times_768[1024]; int scrollrt_cpp_init_value; // weak @@ -22,6 +23,7 @@ int (__fastcall *DrawPlrProc)(int player_num, int x, int y, int screen_x, int sc char sgSaveBack[8192]; int draw_monster_num; // weak int sgdwCursHgtOld; // idb +#endif const int scrollrt_inf = 0x7F800000; // weak diff --git a/Source/sha.cpp b/Source/sha.cpp index cb1a91ef5..0a13d5320 100644 --- a/Source/sha.cpp +++ b/Source/sha.cpp @@ -2,7 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS SHA1Context sgSHA1[3]; +#endif void __cdecl SHA1Clear() { diff --git a/Source/sound.cpp b/Source/sound.cpp index e08c34662..591ff716f 100644 --- a/Source/sound.cpp +++ b/Source/sound.cpp @@ -3,6 +3,8 @@ #include "../types.h" float sound_cpp_init_value; + +#ifndef NO_GLOBALS LPDIRECTSOUNDBUFFER DSBs[8]; LPDIRECTSOUND sglpDS; char gbSndInited; @@ -11,6 +13,7 @@ int sglSoundVolume; HMODULE hDsound_dll; // idb HANDLE sgpMusicTrack; LPDIRECTSOUNDBUFFER sglpDSB; +#endif const int sound_inf = 0x7F800000; // weak diff --git a/Source/stores.cpp b/Source/stores.cpp index 74025e88b..1608574e8 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int stextup; // weak int storenumh; // weak int stextlhold; // weak @@ -35,6 +36,7 @@ ItemStruct smithitem[20]; int stextdown; // weak char stextscrlubtn; // weak char stextflag; // weak +#endif int SStringY[24] = { diff --git a/Source/sync.cpp b/Source/sync.cpp index c1579c7d4..dd7fa6d18 100644 --- a/Source/sync.cpp +++ b/Source/sync.cpp @@ -2,11 +2,13 @@ #include "../types.h" +#ifndef NO_GLOBALS short sync_word_6AA708[MAXMONSTERS]; int syncmonsters; // weak short sync_word_6AA89C[MAXMONSTERS]; int syncitems; int sgnSyncPInv; // weak +#endif int __fastcall sync_all_monsters(TSyncHeader *packet, int size) { diff --git a/Source/themes.cpp b/Source/themes.cpp index 845baf5fd..196c85ee8 100644 --- a/Source/themes.cpp +++ b/Source/themes.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int numthemes; // idb bool armorFlag; // weak int ThemeGoodIn[4]; @@ -18,6 +19,7 @@ ThemeStruct themes[MAXTHEMES]; bool pFountainFlag; // weak bool bFountainFlag; // weak bool bCrossFlag; // weak +#endif int ThemeGood[4] = { THEME_GOATSHRINE, THEME_SHRINE, THEME_SKELROOM, THEME_LIBRARY }; diff --git a/Source/tmsg.cpp b/Source/tmsg.cpp index f15e0cbd7..8595e7413 100644 --- a/Source/tmsg.cpp +++ b/Source/tmsg.cpp @@ -2,7 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS TMsg *sgpTimedMsgHead; +#endif int __fastcall tmsg_get(unsigned char *pbMsg, unsigned int dwMaxLen) { diff --git a/Source/towners.cpp b/Source/towners.cpp index eebddbded..1ca4114fb 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -2,6 +2,7 @@ #include "../types.h" +#ifndef NO_GLOBALS int storeflag; // weak int sgnCowMsg; // weak int numtowners; // idb @@ -10,6 +11,7 @@ int bannerflag; // weak // unused 0x6AAC28 int boyloadflag; // weak void *pCowCels; // idb TownerStruct towner[16]; +#endif const int snSFX[3][3] = diff --git a/Source/track.cpp b/Source/track.cpp index 570a28131..0d5a2553e 100644 --- a/Source/track.cpp +++ b/Source/track.cpp @@ -2,10 +2,12 @@ #include "../types.h" +#ifndef NO_GLOBALS bool sgbIsScrolling; // weak int track_cpp_init_value; // weak int sgdwLastWalk; // weak bool sgbIsWalking; // weak +#endif const int track_inf = 0x7F800000; // weak diff --git a/Source/trigs.cpp b/Source/trigs.cpp index 4a0d6441f..c2fbed034 100644 --- a/Source/trigs.cpp +++ b/Source/trigs.cpp @@ -2,9 +2,11 @@ #include "../types.h" +#ifndef NO_GLOBALS int trigflag[MAXTRIGGERS]; TriggerStruct trigs[MAXTRIGGERS]; int TWarpFrom; // weak +#endif int TownDownList[11] = { 716, 715, 719, 720, 721, 723, 724, 725, 726, 727, -1 }; int TownWarp1List[13] = diff --git a/Source/wave.cpp b/Source/wave.cpp index 084922d0d..0e6bf7de9 100644 --- a/Source/wave.cpp +++ b/Source/wave.cpp @@ -2,7 +2,9 @@ #include "../types.h" +#ifndef NO_GLOBALS int wave_cpp_init_value; // weak +#endif const int wave_inf = 0x7F800000; // weak