Browse Source

add all.h and use in place of diablo.h (#2005)

Now diablo.h is treated in the same way as all other header files of
Source, as it only contains the declarations of global variables and
functions of diablo.cpp.

Besides consistency, this also enables mods to include diablo.h just
like any other header file without having to include every header file
(and without having to include C++ specific aspects of the now all.h).
pull/615/head
Anders Jenbo 6 years ago committed by GitHub
parent
commit
20621a0642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 86
      Source/all.h
  2. 2
      Source/appfat.cpp
  3. 2
      Source/automap.cpp
  4. 2
      Source/capture.cpp
  5. 2
      Source/codec.cpp
  6. 2
      Source/control.cpp
  7. 2
      Source/cursor.cpp
  8. 2
      Source/dead.cpp
  9. 2
      Source/debug.cpp
  10. 2
      Source/diablo.cpp
  11. 81
      Source/diablo.h
  12. 2
      Source/doom.cpp
  13. 2
      Source/drlg_l1.cpp
  14. 2
      Source/drlg_l2.cpp
  15. 2
      Source/drlg_l3.cpp
  16. 2
      Source/drlg_l4.cpp
  17. 2
      Source/dthread.cpp
  18. 2
      Source/dx.cpp
  19. 2
      Source/effects.cpp
  20. 2
      Source/encrypt.cpp
  21. 2
      Source/engine.cpp
  22. 2
      Source/error.cpp
  23. 2
      Source/fault.cpp
  24. 2
      Source/gamemenu.cpp
  25. 2
      Source/gendung.cpp
  26. 2
      Source/gmenu.cpp
  27. 2
      Source/help.cpp
  28. 2
      Source/init.cpp
  29. 2
      Source/interfac.cpp
  30. 2
      Source/inv.cpp
  31. 2
      Source/itemdat.cpp
  32. 2
      Source/items.cpp
  33. 2
      Source/lighting.cpp
  34. 2
      Source/loadsave.cpp
  35. 2
      Source/logging.cpp
  36. 2
      Source/mainmenu.cpp
  37. 2
      Source/minitext.cpp
  38. 2
      Source/misdat.cpp
  39. 2
      Source/missiles.cpp
  40. 2
      Source/monstdat.cpp
  41. 2
      Source/monster.cpp
  42. 2
      Source/movie.cpp
  43. 2
      Source/mpqapi.cpp
  44. 2
      Source/msg.cpp
  45. 2
      Source/msgcmd.cpp
  46. 2
      Source/multi.cpp
  47. 2
      Source/nthread.cpp
  48. 2
      Source/objdat.cpp
  49. 2
      Source/objects.cpp
  50. 2
      Source/pack.cpp
  51. 2
      Source/palette.cpp
  52. 2
      Source/path.cpp
  53. 2
      Source/pfile.cpp
  54. 2
      Source/player.cpp
  55. 2
      Source/plrmsg.cpp
  56. 2
      Source/portal.cpp
  57. 2
      Source/quests.cpp
  58. 2
      Source/render.cpp
  59. 2
      Source/restrict.cpp
  60. 2
      Source/scrollrt.cpp
  61. 2
      Source/setmaps.cpp
  62. 2
      Source/sha.cpp
  63. 2
      Source/sound.cpp
  64. 2
      Source/spelldat.cpp
  65. 2
      Source/spells.cpp
  66. 2
      Source/stores.cpp
  67. 2
      Source/sync.cpp
  68. 2
      Source/textdat.cpp
  69. 2
      Source/themes.cpp
  70. 2
      Source/tmsg.cpp
  71. 2
      Source/town.cpp
  72. 2
      Source/towners.cpp
  73. 2
      Source/track.cpp
  74. 2
      Source/trigs.cpp
  75. 2
      Source/wave.cpp

86
Source/all.h

@ -0,0 +1,86 @@
#ifndef __ALL_H__
#define __ALL_H__
#include "../types.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "appfat.h"
#include "automap.h"
#include "capture.h"
#include "codec.h"
#include "control.h"
#include "cursor.h"
#include "dead.h"
#include "debug.h"
#include "diablo.h"
#include "doom.h"
#include "drlg_l1.h"
#include "drlg_l2.h"
#include "drlg_l3.h"
#include "drlg_l4.h"
#include "dthread.h"
#include "dx.h"
#include "effects.h"
#include "encrypt.h"
#include "engine.h"
#include "error.h"
#include "fault.h"
#include "gamemenu.h"
#include "gendung.h"
#include "gmenu.h"
#include "help.h"
#include "init.h"
#include "interfac.h"
#include "inv.h"
#include "itemdat.h"
#include "items.h"
#include "lighting.h"
#include "loadsave.h"
#include "logging.h"
#include "mainmenu.h"
#include "minitext.h"
#include "misdat.h"
#include "missiles.h"
#include "monstdat.h"
#include "monster.h"
#include "movie.h"
#include "mpqapi.h"
#include "msg.h"
#include "msgcmd.h"
#include "multi.h"
#include "nthread.h"
#include "objdat.h"
#include "objects.h"
#include "pack.h"
#include "palette.h"
#include "path.h"
#include "pfile.h"
#include "player.h"
#include "plrmsg.h"
#include "portal.h"
#include "quests.h"
#include "restrict.h"
#include "scrollrt.h"
#include "setmaps.h"
#include "sha.h"
#include "sound.h"
#include "spelldat.h"
#include "spells.h"
#include "stores.h"
#include "sync.h"
#include "textdat.h" // check file name
#include "themes.h"
#include "tmsg.h"
#include "town.h"
#include "towners.h"
#include "track.h"
#include "trigs.h"
#include "wave.h"
#include "render.h" // linked last, likely .s/.asm
#ifdef __cplusplus
}
#endif
#endif /* __ALL_H__ */

2
Source/appfat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
char sz_error_buf[256];

2
Source/automap.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
// BUGFIX: only the first 256 elements are ever read
WORD automaptype[512];

2
Source/capture.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
static BOOL CaptureHdr(HANDLE hFile, short width, short height)
{

2
Source/codec.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
struct CodecSignature {
DWORD checksum;

2
Source/control.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BYTE sgbNextTalkSave;
BYTE sgbTalkSavePos;

2
Source/cursor.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int cursH;
int icursH28;

2
Source/dead.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
// unused, this was probably for blood boil/burn
int spurtndx;

2
Source/debug.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#ifdef _DEBUG
BOOL update_seed_check = FALSE;

2
Source/diablo.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"

81
Source/diablo.h

@ -2,87 +2,6 @@
#ifndef __DIABLO_H__
#define __DIABLO_H__
#include "../types.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "appfat.h"
#include "automap.h"
#include "capture.h"
#include "codec.h"
#include "control.h"
#include "cursor.h"
#include "dead.h"
#include "debug.h"
#include "doom.h"
#include "drlg_l1.h"
#include "drlg_l2.h"
#include "drlg_l3.h"
#include "drlg_l4.h"
#include "dthread.h"
#include "dx.h"
#include "effects.h"
#include "encrypt.h"
#include "engine.h"
#include "error.h"
#include "fault.h"
#include "gamemenu.h"
#include "gendung.h"
#include "gmenu.h"
#include "help.h"
#include "init.h"
#include "interfac.h"
#include "inv.h"
#include "itemdat.h"
#include "items.h"
#include "lighting.h"
#include "loadsave.h"
#include "logging.h"
#include "mainmenu.h"
#include "minitext.h"
#include "misdat.h"
#include "missiles.h"
#include "monstdat.h"
#include "monster.h"
#include "movie.h"
#include "mpqapi.h"
#include "msg.h"
#include "msgcmd.h"
#include "multi.h"
#include "nthread.h"
#include "objdat.h"
#include "objects.h"
#include "pack.h"
#include "palette.h"
#include "path.h"
#include "pfile.h"
#include "player.h"
#include "plrmsg.h"
#include "portal.h"
#include "quests.h"
#include "restrict.h"
#include "scrollrt.h"
#include "setmaps.h"
#include "sha.h"
#include "sound.h"
#include "spelldat.h"
#include "spells.h"
#include "stores.h"
#include "sync.h"
#include "textdat.h" // check file name
#include "themes.h"
#include "tmsg.h"
#include "town.h"
#include "towners.h"
#include "track.h"
#include "trigs.h"
#include "wave.h"
#include "render.h" // linked last, likely .s/.asm
#ifdef __cplusplus
}
#endif
extern HWND ghMainWnd;
extern int glMid1Seed[NUMLEVELS];
extern int glMid2Seed[NUMLEVELS];

2
Source/doom.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int doom_quest_time;
int doom_stars_drawn;

2
Source/drlg_l1.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BYTE L5dungeon[80][80];
BYTE L5dflags[DMAXX][DMAXY];

2
Source/drlg_l2.cpp

@ -1,5 +1,5 @@
#ifndef SPAWN
#include "diablo.h"
#include "all.h"
int nSx1;
int nSx2;

2
Source/drlg_l3.cpp

@ -1,5 +1,5 @@
#ifndef SPAWN
#include "diablo.h"
#include "all.h"
BOOLEAN lavapool;
int abyssx;

2
Source/drlg_l4.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int diabquad1x;
int diabquad1y;

2
Source/dthread.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#ifdef __cplusplus

2
Source/dx.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
BYTE *sgpBackBuf;

2
Source/effects.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
int sfxdelay;

2
Source/encrypt.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/PKWare/pkware.h"
DWORD hashtable[1280];

2
Source/engine.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#ifdef USE_ASM

2
Source/error.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
char msgtable[MAX_SEND_STR_LEN];
char msgdelay;

2
Source/fault.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter;

2
Source/gamemenu.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
TMenuItem sgSingleMenu[6] = {
// clang-format off

2
Source/gendung.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
WORD level_frame_types[MAXTILES];
int themeCount;

2
Source/gmenu.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BYTE *optbar_cel;
BOOLEAN mouseNavigation;

2
Source/help.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int help_select_line;
int dword_634494;

2
Source/init.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"

2
Source/interfac.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
void *sgpBackCel;

2
Source/inv.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BOOL invflag;
BYTE *pInvCels;

2
Source/itemdat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
ItemDataStruct AllItemsList[] = {
// clang-format off

2
Source/items.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int itemactive[MAXITEMS];
BOOL uitemflag;

2
Source/lighting.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
LightListStruct VisionList[MAXVISION];
BYTE lightactive[MAXLIGHTS];

2
Source/loadsave.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BYTE *tbuff;

2
Source/logging.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#ifdef __cplusplus

2
Source/mainmenu.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"

2
Source/minitext.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int qtexty;
char *qtextptr;

2
Source/misdat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
MissileData missiledata[] = {
// clang-format off

2
Source/missiles.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int missileactive[MAXMISSILES];
int missileavail[MAXMISSILES];

2
Source/monstdat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
MonsterData monsterdata[] = {
// clang-format off

2
Source/monster.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
// Tracks which missile files are already loaded

2
Source/movie.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
BYTE movie_playing;

2
Source/mpqapi.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
DWORD sgdwMpqOffset;

2
Source/msg.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"

2
Source/msgcmd.cpp

@ -2,7 +2,7 @@
#include <stddef.h> // for offsetof
#include <typeinfo> // for typeid
#include "diablo.h"
#include "all.h"
#include "list.h"
#define COMMAND_LEN 128

2
Source/multi.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"

2
Source/nthread.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
BYTE sgbNetUpdateRate;

2
Source/objdat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int ObjTypeConv[113] = {
0,

2
Source/objects.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int trapid;
int trapdir;

2
Source/pack.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
static void PackItem(PkItemStruct *id, ItemStruct *is)

2
Source/palette.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
PALETTEENTRY logical_palette[256];

2
Source/path.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
// preallocated nodes, search is terminated after 300 nodes are visited
PATHNODE path_nodes[MAXPATHNODES];

2
Source/pfile.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
#include "../DiabloUI/diabloui.h"

2
Source/player.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
int plr_lframe_size;

2
Source/plrmsg.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
static BYTE plr_msg_slot;
_plrmsg plr_msgs[PMSG_COUNT];

2
Source/portal.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
PortalStruct portal[MAXPORTAL];
int portalindex;

2
Source/quests.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int qtopline;
BOOL questlog;

2
Source/render.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "_asm.cpp"
int WorldBoolFlag = 0;

2
Source/restrict.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BOOL SystemSupported()
{

2
Source/scrollrt.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
int light_table_index;

2
Source/setmaps.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
// BUGFIX: constant data should be const
BYTE SkelKingTrans1[8] = {

2
Source/sha.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
SHA1Context sgSHA1[3];

2
Source/sound.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
LPDIRECTSOUNDBUFFER DSBs[8];

2
Source/spelldat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
SpellData spelldata[MAX_SPELLS] = {
// clang-format off

2
Source/spells.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int GetManaAmount(int id, int sn)
{

2
Source/stores.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int stextup;
int storenumh;

2
Source/sync.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
WORD sync_word_6AA708[MAXMONSTERS];
int sgnMonsters;

2
Source/textdat.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
/* todo: move text out of struct */

2
Source/themes.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
int numthemes;
BOOL armorFlag;

2
Source/tmsg.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
static TMsg *sgpTimedMsgHead;

2
Source/town.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
/**
* Used under building to avoid HOM and outside of level

2
Source/towners.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BOOL storeflag;
int sgnCowMsg;

2
Source/track.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
static BYTE sgbIsScrolling;

2
Source/trigs.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
BOOL townwarps[3];
BOOL trigflag;

2
Source/wave.cpp

@ -1,4 +1,4 @@
#include "diablo.h"
#include "all.h"
#include "../3rdParty/Storm/Source/storm.h"
BOOL WCloseFile(HANDLE file)

Loading…
Cancel
Save