From db5723997ce1ec5a66b6b87510d2ce24fddc0fc3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Sep 2008 23:54:38 +0000 Subject: [PATCH] - Cleaned up some include dependencies. SVN r1224 (trunk) --- docs/rh-log.txt | 1 + src/actor.h | 4 - src/am_map.cpp | 2 + src/am_map.h | 3 +- src/b_bot.cpp | 1 + src/b_func.cpp | 1 + src/b_game.cpp | 1 + src/b_move.cpp | 1 + src/b_think.cpp | 2 + src/basictypes.h | 98 ++++++ src/bbannouncer.cpp | 2 + src/c_bind.cpp | 1 + src/c_bind.h | 4 +- src/c_cmds.cpp | 2 + src/c_console.cpp | 5 +- src/c_console.h | 14 +- src/c_cvars.cpp | 2 +- src/c_dispatch.cpp | 2 +- src/c_dispatch.h | 2 +- src/cmdlib.cpp | 2 - src/cmdlib.h | 1 - src/colormatcher.h | 3 + src/ct_chat.cpp | 4 +- src/d_dehacked.cpp | 1 - src/d_event.h | 2 +- src/d_main.cpp | 4 +- src/d_main.h | 4 +- src/d_net.cpp | 4 +- src/d_net.h | 17 + src/d_protocol.cpp | 8 +- src/d_protocol.h | 6 +- src/d_ticcmd.h | 6 +- src/decallib.cpp | 2 + src/decallib.h | 5 +- src/dobject.cpp | 3 - src/dobject.h | 2 - src/dobjgc.cpp | 1 + src/dobjtype.cpp | 2 +- src/doomdata.h | 9 +- src/doomdef.h | 6 + src/doomstat.cpp | 4 +- src/doomstat.h | 57 +--- src/doomtype.h | 97 +----- src/f_finale.cpp | 2 + src/f_finale.h | 7 +- src/f_wipe.cpp | 1 - src/farchive.cpp | 1 - src/farchive.h | 4 - src/g_doom/a_bossbrain.cpp | 2 + src/g_doom/a_doomweaps.cpp | 1 + src/g_doom/a_painelemental.cpp | 1 + src/g_doom/a_revenant.cpp | 1 + src/g_doom/a_scriptedmarine.cpp | 1 + src/g_doom/doom_sbar.cpp | 1 + src/g_game.cpp | 4 +- src/g_game.h | 5 +- src/g_heretic/a_dsparil.cpp | 1 + src/g_heretic/a_hereticweaps.cpp | 1 + src/g_heretic/a_ironlich.cpp | 1 + src/g_heretic/heretic_sbar.cpp | 1 + src/g_hexen/a_clericholy.cpp | 2 + src/g_hexen/a_flechette.cpp | 1 + src/g_hexen/a_healingradius.cpp | 1 + src/g_hexen/a_heresiarch.cpp | 1 + src/g_hexen/a_hexenspecialdecs.cpp | 2 + src/g_hexen/a_korax.cpp | 1 + src/g_hexen/a_magelightning.cpp | 1 + src/g_hexen/a_magestaff.cpp | 1 + src/g_hexen/a_summon.cpp | 1 + src/g_hexen/a_teleportother.cpp | 2 + src/g_hub.cpp | 4 +- src/g_hub.h | 9 +- src/g_level.cpp | 3 +- src/g_level.h | 6 +- src/g_raven/a_artitele.cpp | 1 + src/g_raven/a_minotaur.cpp | 2 + src/g_shared/a_artifacts.cpp | 2 + src/g_shared/a_debris.cpp | 1 + src/g_shared/a_decals.cpp | 2 + src/g_shared/a_fountain.cpp | 1 + src/g_shared/a_hatetarget.cpp | 1 + src/g_shared/a_keys.cpp | 28 +- src/g_shared/a_lightning.cpp | 1 + src/g_shared/a_morph.cpp | 2 + src/g_shared/a_movingcamera.cpp | 1 + src/g_shared/a_pickups.cpp | 2 + src/g_shared/a_puzzleitems.cpp | 1 + src/g_shared/a_secrettrigger.cpp | 1 + src/g_shared/a_specialspot.cpp | 1 + src/g_shared/a_weapons.cpp | 2 + src/g_shared/hudmessages.cpp | 1 + src/g_shared/sbar.h | 1 - src/g_shared/sbarinfo_display.cpp | 1 + src/g_shared/sbarinfo_parser.cpp | 1 + src/g_shared/shared_hud.cpp | 3 + src/g_shared/shared_sbar.cpp | 4 + src/g_strife/a_acolyte.cpp | 1 + src/g_strife/a_alienspectres.cpp | 1 + src/g_strife/a_entityboss.cpp | 1 + src/g_strife/a_programmer.cpp | 2 + src/g_strife/a_rebels.cpp | 1 + src/g_strife/a_strifeitems.cpp | 2 + src/g_strife/a_strifestuff.cpp | 2 + src/g_strife/a_strifeweapons.cpp | 1 + src/g_strife/a_thingstoblowup.cpp | 1 + src/g_strife/strife_sbar.cpp | 2 + src/gi.h | 2 +- src/hu_scores.cpp | 4 +- src/hu_stuff.h | 5 +- src/i_net.cpp | 1 - src/i_video.h | 4 +- src/info.cpp | 2 +- src/info.h | 2 - src/m_alloc.cpp | 1 + src/m_bbox.h | 1 - src/m_cheat.cpp | 2 + src/m_crc32.h | 2 +- src/m_menu.cpp | 13 +- src/m_menu.h | 3 +- src/m_misc.cpp | 2 - src/m_misc.h | 2 +- src/m_options.cpp | 3 +- src/m_png.h | 9 +- src/m_random.h | 2 +- src/name.cpp | 1 - src/nodebuild.cpp | 2 +- src/oplsynth/mlopl.cpp | 1 + src/oplsynth/muslib.h | 3 +- src/oplsynth/opl_mus_player.h | 1 - src/p_acs.cpp | 3 +- src/p_buildmap.cpp | 1 + src/p_ceiling.cpp | 1 - src/p_conversation.cpp | 3 + src/p_doors.cpp | 1 + src/p_effect.cpp | 1 + src/p_enemy.cpp | 2 +- src/p_enemy_a_lookex.cpp | 2 +- src/p_interaction.cpp | 4 +- src/p_lnspec.cpp | 2 + src/p_local.h | 2 + src/p_map.cpp | 2 +- src/p_mobj.cpp | 4 +- src/p_plats.cpp | 1 - src/p_pspr.cpp | 1 + src/p_pspr.h | 1 - src/p_saveg.cpp | 1 + src/p_sectors.cpp | 1 + src/p_setup.cpp | 3 +- src/p_sight.cpp | 1 + src/p_spec.cpp | 13 +- src/p_spec.h | 2 + src/p_teleport.cpp | 1 + src/p_terrain.h | 3 - src/p_things.cpp | 1 + src/p_tick.cpp | 1 + src/p_trace.cpp | 1 + src/p_udmf.cpp | 1 + src/p_user.cpp | 2 + src/p_writemap.cpp | 1 + src/r_anim.cpp | 2 + src/r_blend.h | 9 +- src/r_bsp.cpp | 2 +- src/r_data.cpp | 2 +- src/r_draw.cpp | 7 +- src/r_jpeg.h | 3 +- src/r_main.cpp | 1 - src/r_plane.cpp | 4 +- src/r_polymost.cpp | 1 + src/r_segs.cpp | 4 +- src/r_things.cpp | 5 +- src/r_translate.cpp | 2 +- src/s_sndseq.cpp | 2 +- src/s_sndseq.h | 1 - src/s_sound.cpp | 3 +- src/s_sound.h | 3 +- src/sdl/i_main.cpp | 2 - src/sdl/i_system.cpp | 1 - src/sdl/i_video.h | 4 +- src/sound/i_music.h | 3 +- src/sound/i_sound.cpp | 1 - src/sound/music_dumb.cpp | 1 - src/st_stuff.cpp | 3 + src/st_stuff.h | 2 +- src/stringtable.cpp | 1 - src/tables.h | 2 +- src/teaminfo.h | 2 + src/textures/multipatchtexture.cpp | 1 + src/textures/pcxtexture.cpp | 1 + src/textures/texture.cpp | 9 + src/textures/texturemanager.cpp | 1 + src/textures/textures.h | 13 +- src/textures/tgatexture.cpp | 1 + src/thingdef/thingdef.cpp | 1 - src/thingdef/thingdef_codeptr.cpp | 3 +- src/thingdef/thingdef_properties.cpp | 2 +- src/thingdef/thingdef_states.cpp | 3 +- src/timidity/common.cpp | 1 - src/timidity/timidity.cpp | 1 - src/timidity/timidity.h | 1 - src/v_draw.cpp | 3 + src/v_font.cpp | 1 + src/v_palette.cpp | 2 +- src/v_video.cpp | 5 +- src/v_video.h | 3 - src/w_wad.cpp | 1 - src/weightedlist.h | 3 +- src/wi_stuff.cpp | 6 +- src/wi_stuff.h | 15 +- src/win32/fb_d3d9.cpp | 1 + src/win32/hardware.cpp | 1 + src/win32/i_input.cpp | 2 + src/win32/i_main.cpp | 5 +- src/win32/i_system.cpp | 1 + src/win32/i_system.h | 7 +- src/win32/st_start.cpp | 1 - src/win32/win32iface.h | 1 - zdoom.vcproj | 454 ++++++++++++++------------- 217 files changed, 709 insertions(+), 587 deletions(-) create mode 100644 src/basictypes.h diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a778feae5b..a978e93e7a 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ September 14, 2008 (Changes by Graf Zahl) +- Cleaned up some include dependencies. - fixed: For Chex Quest some CVars were initialized to Heretic's default. - fixed pickup message for LargeZorchPack. diff --git a/src/actor.h b/src/actor.h index b6c0eb02db..acf1b857f3 100644 --- a/src/actor.h +++ b/src/actor.h @@ -25,14 +25,10 @@ // Basics. #include "tables.h" -#include "m_fixed.h" // We need the thinker_t stuff. #include "dthinker.h" -// We need the WAD data structure for Map things, -// from the THINGS lump. -#include "doomdata.h" // States are tied to finite states are // tied to animation frames. diff --git a/src/am_map.cpp b/src/am_map.cpp index 83cdf3a1cf..45d08e616a 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -34,10 +34,12 @@ #include "a_sharedglobal.h" #include "statnums.h" #include "r_translate.h" +#include "d_event.h" #include "m_cheat.h" #include "i_system.h" #include "c_dispatch.h" +#include "colormatcher.h" // Needs access to LFB. #include "v_video.h" diff --git a/src/am_map.h b/src/am_map.h index 6e4f757bc1..afacdd178b 100644 --- a/src/am_map.h +++ b/src/am_map.h @@ -22,7 +22,8 @@ #ifndef __AMMAP_H__ #define __AMMAP_H__ -#include "d_event.h" +struct event_t; +class FArchive; // Called by main loop. bool AM_Responder (event_t* ev); diff --git a/src/b_bot.cpp b/src/b_bot.cpp index a7b0e1ffa4..be43f2b18a 100644 --- a/src/b_bot.cpp +++ b/src/b_bot.cpp @@ -11,6 +11,7 @@ #include "p_local.h" #include "cmdlib.h" #include "teaminfo.h" +#include "d_net.h" CVAR (Int, bot_next_color, 11, 0) CVAR (Bool, bot_observer, false, 0) diff --git a/src/b_func.cpp b/src/b_func.cpp index 88663174bb..0d6bf52a55 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -21,6 +21,7 @@ #include "i_system.h" #include "s_sound.h" #include "a_doomglobal.h" +#include "d_event.h" static FRandom pr_botdofire ("BotDoFire"); diff --git a/src/b_game.cpp b/src/b_game.cpp index 3e2ed7ec36..8844ce6357 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -58,6 +58,7 @@ Everything that is changed is marked (maybe commented) with "Added by MC" #include "p_acs.h" #include "teaminfo.h" #include "i_system.h" +#include "d_net.h" static FRandom pr_botspawn ("BotSpawn"); diff --git a/src/b_move.cpp b/src/b_move.cpp index c1803b5a80..896ce93429 100644 --- a/src/b_move.cpp +++ b/src/b_move.cpp @@ -17,6 +17,7 @@ #include "p_lnspec.h" #include "gi.h" #include "a_keys.h" +#include "d_event.h" enum dirtype_t { diff --git a/src/b_think.cpp b/src/b_think.cpp index 3ee4b21774..08d5145217 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -18,6 +18,8 @@ #include "stats.h" #include "a_pickups.h" #include "statnums.h" +#include "d_net.h" +#include "d_event.h" static FRandom pr_botmove ("BotMove"); diff --git a/src/basictypes.h b/src/basictypes.h new file mode 100644 index 0000000000..317878e11f --- /dev/null +++ b/src/basictypes.h @@ -0,0 +1,98 @@ +#ifndef __BASICTYPES_H +#define __BASICTYPES_H + +#ifdef _MSC_VER +typedef __int8 SBYTE; +typedef unsigned __int8 BYTE; +typedef __int16 SWORD; +typedef unsigned __int16 WORD; +typedef __int32 SDWORD; +typedef unsigned __int32 uint32; +typedef __int64 SQWORD; +typedef unsigned __int64 QWORD; +#else +#include + +typedef int8_t SBYTE; +typedef uint8_t BYTE; +typedef int16_t SWORD; +typedef uint16_t WORD; +typedef int32_t SDWORD; +typedef uint32_t uint32; +typedef int64_t SQWORD; +typedef uint64_t QWORD; +#endif + +// windef.h, included by windows.h, has its own incompatible definition +// of DWORD as a long. In files that mix Doom and Windows code, you +// must define USE_WINDOWS_DWORD before including doomtype.h so that +// you are aware that those files have a different DWORD than the rest +// of the source. + +#ifndef USE_WINDOWS_DWORD +typedef uint32 DWORD; +#endif +typedef uint32 BITFIELD; +typedef int INTBOOL; + +// a 64-bit constant +#ifdef __GNUC__ +#define CONST64(v) (v##LL) +#define UCONST64(v) (v##ULL) +#else +#define CONST64(v) ((SQWORD)(v)) +#define UCONST64(v) ((QWORD)(v)) +#endif + +#if !defined(GUID_DEFINED) +#define GUID_DEFINED +typedef struct _GUID +{ + DWORD Data1; + WORD Data2; + WORD Data3; + BYTE Data4[8]; +} GUID; +#endif + +union QWORD_UNION +{ + QWORD AsOne; + struct + { +#ifdef WORDS_BIG_ENDIAN + unsigned int Hi, Lo; +#else + unsigned int Lo, Hi; +#endif + }; +}; + +// +// Fixed point, 32bit as 16.16. +// +#define FRACBITS 16 +#define FRACUNIT (1< #include diff --git a/src/c_bind.h b/src/c_bind.h index 161a66e962..2b46118cf3 100644 --- a/src/c_bind.h +++ b/src/c_bind.h @@ -34,10 +34,8 @@ #ifndef __C_BINDINGS_H__ #define __C_BINDINGS_H__ -#include "doomtype.h" -#include "d_event.h" -#include +struct event_t; class FConfigFile; bool C_DoKey (event_t *ev); diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index 33d10d4ae8..ca208e475a 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -66,6 +66,8 @@ #include "p_local.h" #include "r_sky.h" #include "p_setup.h" +#include "cmdlib.h" +#include "d_net.h" extern FILE *Logfile; extern bool insave; diff --git a/src/c_console.cpp b/src/c_console.cpp index 7a92f7ee8c..2cd6eadd75 100644 --- a/src/c_console.cpp +++ b/src/c_console.cpp @@ -32,7 +32,6 @@ ** */ -#include "m_alloc.h" #include "templates.h" #include "p_setup.h" #include @@ -62,6 +61,10 @@ #include "doomstat.h" #include "d_gui.h" #include "v_video.h" +#include "cmdlib.h" +#include "d_net.h" +#include "g_level.h" +#include "d_event.h" #include "gi.h" diff --git a/src/c_console.h b/src/c_console.h index 9071b478ca..49eafb030e 100644 --- a/src/c_console.h +++ b/src/c_console.h @@ -34,19 +34,19 @@ #ifndef __C_CONSOLE__ #define __C_CONSOLE__ -#include #include +#include "basictypes.h" -#include "doomtype.h" -#include "doomdef.h" -#include "d_event.h" -#include "cmdlib.h" +struct event_t; #define C_BLINKRATE (TICRATE/2) -typedef enum cstate_t { +typedef enum cstate_t +{ c_up=0, c_down=1, c_falling=2, c_rising=3 -} constate_e; +} +constate_e; + extern constate_e ConsoleState; extern int ConBottom; diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 04f8e2aa8e..7459ba0b32 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -40,7 +40,6 @@ #include "configfile.h" #include "c_console.h" #include "c_dispatch.h" -#include "m_alloc.h" #include "doomstat.h" #include "c_cvars.h" @@ -51,6 +50,7 @@ #include "i_system.h" #include "v_palette.h" #include "v_video.h" +#include "colormatcher.h" struct FLatchedValue { diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index f9c1b6c0f1..3d9720d416 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -47,11 +47,11 @@ #include "c_dispatch.h" #include "m_argv.h" #include "doomstat.h" -#include "m_alloc.h" #include "d_player.h" #include "configfile.h" #include "m_crc32.h" #include "v_text.h" +#include "d_net.h" // MACROS ------------------------------------------------------------------ diff --git a/src/c_dispatch.h b/src/c_dispatch.h index c297a75140..52ca088014 100644 --- a/src/c_dispatch.h +++ b/src/c_dispatch.h @@ -34,7 +34,7 @@ #ifndef __C_DISPATCH_H__ #define __C_DISPATCH_H__ -#include "dobject.h" +#include "doomtype.h" class FConfigFile; class APlayerPawn; diff --git a/src/cmdlib.cpp b/src/cmdlib.cpp index 7da893a8f2..84be27bea0 100644 --- a/src/cmdlib.cpp +++ b/src/cmdlib.cpp @@ -10,8 +10,6 @@ #include #include -#include "m_alloc.h" - /* progdir will hold the path up to the game directory, including the slash diff --git a/src/cmdlib.h b/src/cmdlib.h index c308092ed8..cf9242af01 100644 --- a/src/cmdlib.h +++ b/src/cmdlib.h @@ -13,7 +13,6 @@ #endif #include "doomtype.h" -#include "zstring.h" #include #include diff --git a/src/colormatcher.h b/src/colormatcher.h index e166da0e11..ca7992d6dc 100644 --- a/src/colormatcher.h +++ b/src/colormatcher.h @@ -49,4 +49,7 @@ private: const PalEntry *Pal; }; +extern FColorMatcher ColorMatcher; + + #endif //__COLORMATCHER_H__ diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index c025624eb5..f728995acd 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -28,6 +28,8 @@ #include "d_gui.h" #include "i_input.h" #include "templates.h" +#include "d_net.h" +#include "d_event.h" #define QUEUESIZE 128 #define MESSAGESIZE 128 @@ -170,7 +172,7 @@ bool CT_Responder (event_t *ev) } else { - CT_AddChar (ev->data1); + CT_AddChar (char(ev->data1)); } return true; } diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 78651f93c7..c0af9e814b 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -52,7 +52,6 @@ #include "g_level.h" #include "cmdlib.h" #include "gstrings.h" -#include "m_alloc.h" #include "m_misc.h" #include "w_wad.h" #include "d_player.h" diff --git a/src/d_event.h b/src/d_event.h index 6a164138aa..34790aa25e 100644 --- a/src/d_event.h +++ b/src/d_event.h @@ -24,7 +24,7 @@ #define __D_EVENT_H__ -#include "doomtype.h" +#include "basictypes.h" // diff --git a/src/d_main.cpp b/src/d_main.cpp index 0f0ae1bd8e..8a46f23ba9 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -49,7 +49,6 @@ #include "doomerrors.h" #include "d_gui.h" -#include "m_alloc.h" #include "m_random.h" #include "doomdef.h" #include "doomstat.h" @@ -96,6 +95,9 @@ #include "teaminfo.h" #include "hardware.h" #include "sbarinfo.h" +#include "d_net.h" +#include "g_level.h" +#include "d_event.h" EXTERN_CVAR(Bool, hud_althud) void DrawHUD(); diff --git a/src/d_main.h b/src/d_main.h index 3a3094dcc0..a743d5ab6a 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -25,7 +25,9 @@ #ifndef __D_MAIN__ #define __D_MAIN__ -#include "d_event.h" +#include "doomtype.h" + +struct event_t; // // D_DoomMain() diff --git a/src/d_net.cpp b/src/d_net.cpp index ecea095fac..376c709962 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -25,7 +25,6 @@ #include #include "version.h" -#include "m_alloc.h" #include "m_menu.h" #include "m_random.h" #include "i_system.h" @@ -36,6 +35,7 @@ #include "doomstat.h" #include "c_console.h" #include "d_netinf.h" +#include "d_net.h" #include "cmdlib.h" #include "s_sound.h" #include "m_cheat.h" @@ -54,6 +54,8 @@ #include "st_start.h" #include "teaminfo.h" #include "p_conversation.h" +#include "g_level.h" +#include "d_event.h" int P_StartScript (AActor *who, line_t *where, int script, char *map, bool backSide, int arg0, int arg1, int arg2, int always, bool wantResultCode, bool net); diff --git a/src/d_net.h b/src/d_net.h index c102382829..43be497102 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -24,6 +24,8 @@ #define __D_NET__ #include "doomtype.h" +#include "doomdef.h" +#include "d_ticcmd.h" // @@ -127,4 +129,19 @@ void Net_SkipCommand (int type, BYTE **stream); void Net_ClearBuffers (); + +// Netgame stuff (buffers and pointers, i.e. indices). + +// This is the interface to the packet driver, a separate program +// in DOS, but just an abstraction here. +extern doomcom_t doomcom; + +extern struct ticcmd_t localcmds[LOCALCMDTICS]; + +extern int maketic; +extern int nettics[MAXNETNODES]; + +extern ticcmd_t netcmds[MAXPLAYERS][BACKUPTICS]; +extern int ticdup; + #endif diff --git a/src/d_protocol.cpp b/src/d_protocol.cpp index f59c89f4bf..0508157c18 100644 --- a/src/d_protocol.cpp +++ b/src/d_protocol.cpp @@ -32,14 +32,13 @@ ** */ -#include "m_alloc.h" #include "i_system.h" -#include "d_protocol.h" #include "d_ticcmd.h" #include "d_net.h" #include "doomdef.h" #include "doomstat.h" #include "cmdlib.h" +#include "farchive.h" char *ReadString (BYTE **stream) @@ -281,6 +280,11 @@ int PackUserCmd (const usercmd_t *ucmd, const usercmd_t *basis, BYTE **stream) return *stream - start; } +FArchive &operator<< (FArchive &arc, ticcmd_t &cmd) +{ + return arc << cmd.consistancy << cmd.ucmd; +} + FArchive &operator<< (FArchive &arc, usercmd_t &cmd) { BYTE bytes[256]; diff --git a/src/d_protocol.h b/src/d_protocol.h index 0bd28b4a23..73be4583a7 100644 --- a/src/d_protocol.h +++ b/src/d_protocol.h @@ -34,11 +34,7 @@ #ifndef __D_PROTOCOL_H__ #define __D_PROTOCOL_H__ -#include "doomstat.h" #include "doomtype.h" -#include "doomdef.h" -#include "m_fixed.h" -#include "farchive.h" // The IFF routines here all work with big-endian IDs, even if the host // system is little-endian. @@ -79,6 +75,8 @@ struct usercmd_s }; typedef struct usercmd_s usercmd_t; +class FArchive; + FArchive &operator<< (FArchive &arc, usercmd_t &cmd); // When transmitted, the above message is preceded by a byte diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 7828d2f509..bad770fdcd 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -23,7 +23,6 @@ #ifndef __D_TICCMD_H__ #define __D_TICCMD_H__ -#include "doomtype.h" #include "d_protocol.h" // The data sampled per tick (single player) @@ -37,9 +36,6 @@ struct ticcmd_t }; -inline FArchive &operator<< (FArchive &arc, ticcmd_t &cmd) -{ - return arc << cmd.consistancy << cmd.ucmd; -} +FArchive &operator<< (FArchive &arc, ticcmd_t &cmd); #endif // __D_TICCMD_H__ diff --git a/src/decallib.cpp b/src/decallib.cpp index 8bfce1fab8..d20adc921a 100644 --- a/src/decallib.cpp +++ b/src/decallib.cpp @@ -46,6 +46,8 @@ #include "a_sharedglobal.h" #include "r_translate.h" #include "gi.h" +#include "g_level.h" +#include "colormatcher.h" FDecalLib DecalLibrary; diff --git a/src/decallib.h b/src/decallib.h index c16cef760c..70804b0e50 100644 --- a/src/decallib.h +++ b/src/decallib.h @@ -37,9 +37,8 @@ #include #include "doomtype.h" -#include "tarray.h" -#include "name.h" -#include "actor.h" +#include "r_blend.h" +#include "textures/textures.h" class FScanner; class FDecalTemplate; diff --git a/src/dobject.cpp b/src/dobject.cpp index fbaf60c6b1..d71f87ed7f 100644 --- a/src/dobject.cpp +++ b/src/dobject.cpp @@ -38,7 +38,6 @@ #include "cmdlib.h" #include "actor.h" #include "dobject.h" -#include "m_alloc.h" #include "doomstat.h" // Ideally, DObjects can be used independant of Doom. #include "d_player.h" // See p_user.cpp to find out why this doesn't work. #include "g_game.h" // Needed for bodyque. @@ -49,8 +48,6 @@ #include "a_sharedglobal.h" #include "dsectoreffect.h" -#include "autosegs.h" - PClass DObject::_StaticType; ClassReg DObject::RegistrationInfo = { diff --git a/src/dobject.h b/src/dobject.h index 708648e290..62c5ee3ba5 100644 --- a/src/dobject.h +++ b/src/dobject.h @@ -35,9 +35,7 @@ #define __DOBJECT_H__ #include -#include "tarray.h" #include "doomtype.h" -#include "m_alloc.h" #ifndef _MSC_VER #include "autosegs.h" #endif diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index fedd5076d3..e8520a9570 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -69,6 +69,7 @@ #include "p_acs.h" #include "s_sndseq.h" #include "r_interpolate.h" +#include "doomstat.h" // MACROS ------------------------------------------------------------------ diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 8be76f0d62..73c66da968 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -35,8 +35,8 @@ #include "dobject.h" #include "i_system.h" #include "actor.h" -#include "autosegs.h" #include "templates.h" +#include "autosegs.h" TArray PClass::m_RuntimeActors; TArray PClass::m_Types; diff --git a/src/doomdata.h b/src/doomdata.h index ef3e793fd6..700c21ae03 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -29,9 +29,6 @@ // Some global defines, that configure the game. #include "doomdef.h" -#include "m_swap.h" - - // // Map level types. @@ -350,5 +347,11 @@ enum EMapThingFlags STF_ALTSHADOW = 0x0200, }; +// Player spawn spots for deathmatch. +extern TArray deathmatchstarts; + +// Player spawn spots. +extern FMapThing playerstarts[MAXPLAYERS]; + #endif // __DOOMDATA__ diff --git a/src/doomdef.h b/src/doomdef.h index cb4f962aa8..f43164710c 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -88,6 +88,12 @@ typedef enum GS_FORCEWIPEFADE = -2 } gamestate_t; +extern gamestate_t gamestate; + +// wipegamestate can be set to -1 +// to force a wipe on the next draw +extern gamestate_t wipegamestate; + typedef float skill_t; diff --git a/src/doomstat.cpp b/src/doomstat.cpp index 64491e143c..4018b7e437 100644 --- a/src/doomstat.cpp +++ b/src/doomstat.cpp @@ -40,8 +40,8 @@ FStringTable GStrings; EGameSpeed GameSpeed = SPEED_Normal; // Game Mode - identify IWAD as shareware, retail etc. -GameMode_t gamemode = undetermined; -GameMission_t gamemission = doom; +int gamemode = undetermined; +int gamemission = doom; // Show developer messages if true. CVAR (Bool, developer, false, 0) diff --git a/src/doomstat.h b/src/doomstat.h index 948e357f11..37c5db7c6f 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -28,16 +28,6 @@ #ifndef __D_STATE__ #define __D_STATE__ -// We need globally shared data structures, -// for defining the global state variables. -// We need the player data structure as well. -//#include "d_player.h" - -#include "doomdata.h" -#include "d_net.h" -#include "g_level.h" - -// We also need the definition of a cvar #include "c_cvars.h" // ----------------------- @@ -61,8 +51,8 @@ extern bool devparm; // DEBUG: launched with -devparm // ----------------------------------------------------- // Game Mode - identify IWAD as shareware, retail etc. // -extern GameMode_t gamemode; -extern GameMission_t gamemission; +extern int gamemode; +extern int gamemission; // ------------------------------------------- // Selected skill type, map etc. @@ -96,7 +86,7 @@ EXTERN_CVAR (Float, teamdamage) // [RH] The class the player will spawn as in single player, // in case using a random class with Hexen. -extern int SinglePlayerClass[MAXPLAYERS]; +extern int SinglePlayerClass[/*MAXPLAYERS*/]; // ------------------------- // Internal parameters for sound rendering. @@ -158,11 +148,6 @@ extern int demover; // Quit after playing a demo from cmdline. extern bool singledemo; - - - -extern gamestate_t gamestate; - extern int SaveVersion; @@ -180,23 +165,7 @@ extern int gametic; // Alive? Disconnected? -extern bool playeringame[MAXPLAYERS]; - - -// Player spawn spots for deathmatch. -extern TArray deathmatchstarts; - -// Player spawn spots. -extern FMapThing playerstarts[MAXPLAYERS]; - -// Intermission stats. -// Parameters for world map / intermission. -extern struct wbstartstruct_s wminfo; - - - - - +extern bool playeringame[/*MAXPLAYERS*/]; //----------------------------------------- @@ -214,9 +183,6 @@ extern bool precache; //REFRESH //------- -// wipegamestate can be set to -1 -// to force a wipe on the next draw -extern gamestate_t wipegamestate; extern bool setsizeneeded; extern bool setmodeneeded; @@ -239,21 +205,6 @@ extern int bodyqueslot; -// Netgame stuff (buffers and pointers, i.e. indices). - -// This is the interface to the packet driver, a separate program -// in DOS, but just an abstraction here. -extern doomcom_t doomcom; - -extern struct ticcmd_t localcmds[LOCALCMDTICS]; - -extern int maketic; -extern int nettics[MAXNETNODES]; - -extern ticcmd_t netcmds[MAXPLAYERS][BACKUPTICS]; -extern int ticdup; - - // ---- [RH] ---- EXTERN_CVAR (Bool, developer) diff --git a/src/doomtype.h b/src/doomtype.h index 5db90b419e..d7ea6ec78e 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -37,8 +37,9 @@ #endif #include -#include "zstring.h" +#include "tarray.h" #include "name.h" +#include "zstring.h" #include "vectors.h" // Since this file is included by everything, it seems an appropriate place @@ -111,72 +112,7 @@ #define NOVTABLE #endif -#ifdef _MSC_VER -typedef __int8 SBYTE; -typedef unsigned __int8 BYTE; -typedef __int16 SWORD; -typedef unsigned __int16 WORD; -typedef __int32 SDWORD; -typedef unsigned __int32 uint32; -typedef __int64 SQWORD; -typedef unsigned __int64 QWORD; -#else -#include - -typedef int8_t SBYTE; -typedef uint8_t BYTE; -typedef int16_t SWORD; -typedef uint16_t WORD; -typedef int32_t SDWORD; -typedef uint32_t uint32; -typedef int64_t SQWORD; -typedef uint64_t QWORD; -#endif - -// windef.h, included by windows.h, has its own incompatible definition -// of DWORD as a long. In files that mix Doom and Windows code, you -// must define USE_WINDOWS_DWORD before including doomtype.h so that -// you are aware that those files have a different DWORD than the rest -// of the source. - -#ifndef USE_WINDOWS_DWORD -typedef uint32 DWORD; -#endif -typedef uint32 BITFIELD; -typedef int INTBOOL; - -// a 64-bit constant -#ifdef __GNUC__ -#define CONST64(v) (v##LL) -#define UCONST64(v) (v##ULL) -#else -#define CONST64(v) ((SQWORD)(v)) -#define UCONST64(v) ((QWORD)(v)) -#endif - -#if !defined(GUID_DEFINED) -#define GUID_DEFINED -typedef struct _GUID -{ - DWORD Data1; - WORD Data2; - WORD Data3; - BYTE Data4[8]; -} GUID; -#endif - -union QWORD_UNION -{ - QWORD AsOne; - struct - { -#ifdef WORDS_BIG_ENDIAN - unsigned int Hi, Lo; -#else - unsigned int Lo, Hi; -#endif - }; -}; +#include "basictypes.h" // Bounding box coordinate storage. enum @@ -188,33 +124,6 @@ enum }; // bbox coordinates -// -// Fixed point, 32bit as 16.16. -// -#define FRACBITS 16 -#define FRACUNIT (1< #include "doomtype.h" #include "dobject.h" -#include "tarray.h" -#include "name.h" class FFile { @@ -278,8 +276,6 @@ inline FArchive &operator<< (FArchive &arc, PalEntry &p) return arc << p.a << p.r << p.g << p.b; } -#include "dobject.h" - template inline FArchive &operator<< (FArchive &arc, T* &object) { diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index 4840c89070..d93ec4cda6 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -8,6 +8,8 @@ #include "statnums.h" #include "a_specialspot.h" #include "thingdef/thingdef.h" +#include "doomstat.h" +#include "g_level.h" static FRandom pr_brainscream ("BrainScream"); static FRandom pr_brainexplode ("BrainExplode"); diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 5b168ecfb7..2af6149194 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -12,6 +12,7 @@ #include "gi.h" #include "templates.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_punch ("Punch"); static FRandom pr_saw ("Saw"); diff --git a/src/g_doom/a_painelemental.cpp b/src/g_doom/a_painelemental.cpp index fb8147d495..33ed98694d 100644 --- a/src/g_doom/a_painelemental.cpp +++ b/src/g_doom/a_painelemental.cpp @@ -7,6 +7,7 @@ #include "templates.h" #include "m_bbox.h" #include "thingdef/thingdef.h" +#include "doomstat.h" DECLARE_ACTION(A_SkullAttack) diff --git a/src/g_doom/a_revenant.cpp b/src/g_doom/a_revenant.cpp index 74fdc511a4..d34e123e71 100644 --- a/src/g_doom/a_revenant.cpp +++ b/src/g_doom/a_revenant.cpp @@ -9,6 +9,7 @@ #include "a_action.h" #include "a_doomglobal.h" #include "thingdef/thingdef.h" +#include "g_level.h" static FRandom pr_tracer ("Tracer"); static FRandom pr_skelfist ("SkelFist"); diff --git a/src/g_doom/a_scriptedmarine.cpp b/src/g_doom/a_scriptedmarine.cpp index e7fd0dc687..a43f4f637a 100644 --- a/src/g_doom/a_scriptedmarine.cpp +++ b/src/g_doom/a_scriptedmarine.cpp @@ -8,6 +8,7 @@ #include "s_sound.h" #include "r_translate.h" #include "thingdef/thingdef.h" +#include "g_level.h" #define MARINE_PAIN_CHANCE 160 diff --git a/src/g_doom/doom_sbar.cpp b/src/g_doom/doom_sbar.cpp index e52f11343c..fb11dd16f5 100644 --- a/src/g_doom/doom_sbar.cpp +++ b/src/g_doom/doom_sbar.cpp @@ -15,6 +15,7 @@ #include "i_system.h" #include "r_translate.h" #include "sbarinfo.h" +#include "g_level.h" #define ST_EVILGRINCOUNT (2*TICRATE) diff --git a/src/g_game.cpp b/src/g_game.cpp index 616d487155..31f29ebb67 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -30,7 +30,6 @@ #include "templates.h" #include "version.h" -#include "m_alloc.h" #include "doomdef.h" #include "doomstat.h" #include "d_protocol.h" @@ -73,6 +72,9 @@ #include "a_keys.h" #include "a_artifacts.h" #include "r_translate.h" +#include "cmdlib.h" +#include "d_net.h" +#include "d_event.h" #include diff --git a/src/g_game.h b/src/g_game.h index f60018eb5d..72afcd3c56 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -23,9 +23,8 @@ #ifndef __G_GAME__ #define __G_GAME__ -#include "doomdef.h" -#include "d_event.h" - +struct event_t; +struct PNGHandle; // diff --git a/src/g_heretic/a_dsparil.cpp b/src/g_heretic/a_dsparil.cpp index 7fe12b5c17..a51ac56141 100644 --- a/src/g_heretic/a_dsparil.cpp +++ b/src/g_heretic/a_dsparil.cpp @@ -9,6 +9,7 @@ #include "gstrings.h" #include "a_specialspot.h" #include "thingdef/thingdef.h" +#include "g_level.h" static FRandom pr_s2fx1 ("S2FX1"); static FRandom pr_scrc1atk ("Srcr1Attack"); diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 889059a232..3c2b09e254 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -14,6 +14,7 @@ #include "gi.h" #include "r_translate.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_sap ("StaffAtkPL1"); static FRandom pr_sap2 ("StaffAtkPL2"); diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index ac0285090e..b77fdf4eb1 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -7,6 +7,7 @@ #include "a_action.h" #include "gstrings.h" #include "thingdef/thingdef.h" +#include "g_level.h" static FRandom pr_foo ("WhirlwindDamage"); static FRandom pr_atk ("LichAttack"); diff --git a/src/g_heretic/heretic_sbar.cpp b/src/g_heretic/heretic_sbar.cpp index 058779c94d..d4ed61aafb 100644 --- a/src/g_heretic/heretic_sbar.cpp +++ b/src/g_heretic/heretic_sbar.cpp @@ -14,6 +14,7 @@ #include "templates.h" #include "a_keys.h" #include "r_translate.h" +#include "g_level.h" static FRandom pr_chainwiggle; diff --git a/src/g_hexen/a_clericholy.cpp b/src/g_hexen/a_clericholy.cpp index a77c4befac..d76f5b031f 100644 --- a/src/g_hexen/a_clericholy.cpp +++ b/src/g_hexen/a_clericholy.cpp @@ -8,6 +8,8 @@ #include "gstrings.h" #include "a_weaponpiece.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" #define BLAST_FULLSTRENGTH 255 diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index 8497f8b8b8..a1ea8339b6 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -11,6 +11,7 @@ #include "a_hexenglobal.h" #include "w_wad.h" #include "thingdef/thingdef.h" +#include "g_level.h" static FRandom pr_poisonbag ("PoisonBag"); static FRandom pr_poisoncloud ("PoisonCloud"); diff --git a/src/g_hexen/a_healingradius.cpp b/src/g_hexen/a_healingradius.cpp index e5fcca8357..8a8ad17bc8 100644 --- a/src/g_hexen/a_healingradius.cpp +++ b/src/g_hexen/a_healingradius.cpp @@ -9,6 +9,7 @@ #include "a_action.h" #include "a_hexenglobal.h" #include "gi.h" +#include "doomstat.h" #define HEAL_RADIUS_DIST 255*FRACUNIT diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index 349584a6ae..e4274a126e 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -9,6 +9,7 @@ #include "i_system.h" #include "p_acs.h" #include "thingdef/thingdef.h" +#include "g_level.h" //============================================================================ // diff --git a/src/g_hexen/a_hexenspecialdecs.cpp b/src/g_hexen/a_hexenspecialdecs.cpp index 19c9f7d4e3..8c65ba34f1 100644 --- a/src/g_hexen/a_hexenspecialdecs.cpp +++ b/src/g_hexen/a_hexenspecialdecs.cpp @@ -12,6 +12,8 @@ #include "p_lnspec.h" #include "a_hexenglobal.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" static FRandom pr_pottery ("PotteryExplode"); static FRandom pr_bit ("PotteryChooseBit"); diff --git a/src/g_hexen/a_korax.cpp b/src/g_hexen/a_korax.cpp index c1d70ab44b..9a30850c50 100644 --- a/src/g_hexen/a_korax.cpp +++ b/src/g_hexen/a_korax.cpp @@ -26,6 +26,7 @@ #include "m_random.h" #include "i_system.h" #include "thingdef/thingdef.h" +#include "g_level.h" const int KORAX_SPIRIT_LIFETIME = 5*TICRATE/5; // 5 seconds const int KORAX_COMMAND_HEIGHT = 120; diff --git a/src/g_hexen/a_magelightning.cpp b/src/g_hexen/a_magelightning.cpp index 8bfa56d84a..df369798db 100644 --- a/src/g_hexen/a_magelightning.cpp +++ b/src/g_hexen/a_magelightning.cpp @@ -11,6 +11,7 @@ #include "gstrings.h" #include "a_hexenglobal.h" #include "thingdef/thingdef.h" +#include "g_level.h" #define ZAGSPEED FRACUNIT diff --git a/src/g_hexen/a_magestaff.cpp b/src/g_hexen/a_magestaff.cpp index 2e9ae8b3b0..00072210b9 100644 --- a/src/g_hexen/a_magestaff.cpp +++ b/src/g_hexen/a_magestaff.cpp @@ -8,6 +8,7 @@ #include "gstrings.h" #include "a_weaponpiece.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_mstafftrack ("MStaffTrack"); static FRandom pr_bloodscourgedrop ("BloodScourgeDrop"); diff --git a/src/g_hexen/a_summon.cpp b/src/g_hexen/a_summon.cpp index ae6c85a6f0..74644d27c0 100644 --- a/src/g_hexen/a_summon.cpp +++ b/src/g_hexen/a_summon.cpp @@ -7,6 +7,7 @@ #include "s_sound.h" #include "ravenshared.h" #include "thingdef/thingdef.h" +#include "g_level.h" void A_Summon (AActor *); diff --git a/src/g_hexen/a_teleportother.cpp b/src/g_hexen/a_teleportother.cpp index 6af109eea2..887887a833 100644 --- a/src/g_hexen/a_teleportother.cpp +++ b/src/g_hexen/a_teleportother.cpp @@ -8,6 +8,8 @@ #include "p_lnspec.h" #include "m_random.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" #define TELEPORT_LIFE 1 diff --git a/src/g_hub.cpp b/src/g_hub.cpp index 0afe0d1abd..f533825019 100644 --- a/src/g_hub.cpp +++ b/src/g_hub.cpp @@ -42,6 +42,8 @@ #include "files.h" #include "m_png.h" #include "gstrings.h" +#include "wi_stuff.h" +#include "farchive.h" //========================================================================== @@ -59,7 +61,7 @@ struct FHubInfo int maxsecret; int maxfrags; - wbplayerstruct_s plyr[MAXPLAYERS]; + wbplayerstruct_t plyr[MAXPLAYERS]; FHubInfo &operator=(const wbstartstruct_t &wbs) { diff --git a/src/g_hub.h b/src/g_hub.h index 8a7355f8be..f7638b5c2f 100644 --- a/src/g_hub.h +++ b/src/g_hub.h @@ -2,13 +2,14 @@ #define __G_HUB_H #include -//#include -#include "g_level.h" -#include "wi_stuff.h" + +struct PNGHandle; +struct cluster_info_t; +struct wbstartstruct_t; void G_WriteHubInfo (FILE *file); void G_ReadHubInfo (PNGHandle *png); -void G_LeavingHub(int mode, cluster_info_t * cluster, struct wbstartstruct_s * wbs); +void G_LeavingHub(int mode, cluster_info_t * cluster, struct wbstartstruct_t * wbs); #endif diff --git a/src/g_level.cpp b/src/g_level.cpp index 591bc3b07f..8fcae13b82 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -35,7 +35,6 @@ #include #include "templates.h" #include "d_main.h" -#include "m_alloc.h" #include "g_level.h" #include "g_game.h" #include "s_sound.h" @@ -75,6 +74,8 @@ #include "r_translate.h" #include "p_lnspec.h" #include "r_interpolate.h" +#include "cmdlib.h" +#include "d_net.h" #include "gi.h" diff --git a/src/g_level.h b/src/g_level.h index 28486df6cd..39feead28b 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -36,9 +36,6 @@ #include "doomtype.h" #include "doomdef.h" -#include "m_fixed.h" -#include "tarray.h" -#include "name.h" #define NUM_WORLDVARS 256 #define NUM_GLOBALVARS 64 @@ -312,7 +309,7 @@ struct EndSequence extern TArray EndSequences; -struct cluster_info_s +struct cluster_info_t { int cluster; char finaleflat[9]; @@ -325,7 +322,6 @@ struct cluster_info_s char *clustername; unsigned int cdid; }; -typedef struct cluster_info_s cluster_info_t; // Cluster flags #define CLUSTER_HUB 0x00000001 // Cluster uses hub behavior diff --git a/src/g_raven/a_artitele.cpp b/src/g_raven/a_artitele.cpp index 60eeef728b..11350338ed 100644 --- a/src/g_raven/a_artitele.cpp +++ b/src/g_raven/a_artitele.cpp @@ -6,6 +6,7 @@ #include "gi.h" #include "s_sound.h" #include "m_random.h" +#include "doomstat.h" static FRandom pr_tele ("TeleportSelf"); diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index c91800ba2a..d6a199ec5a 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -9,6 +9,8 @@ #include "gi.h" #include "w_wad.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" #define MAULATORTICS (25*35) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 1ab1af8f00..b791629703 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -17,6 +17,8 @@ #include "v_video.h" #include "templates.h" #include "a_morph.h" +#include "g_level.h" +#include "doomstat.h" static FRandom pr_torch ("Torch"); diff --git a/src/g_shared/a_debris.cpp b/src/g_shared/a_debris.cpp index 249903ddcb..6f9a4299d2 100644 --- a/src/g_shared/a_debris.cpp +++ b/src/g_shared/a_debris.cpp @@ -1,6 +1,7 @@ #include "actor.h" #include "info.h" #include "m_random.h" +#include "m_fixed.h" static FRandom pr_dirt ("SpawnDirt"); diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index 3e54f25d07..d6f56a1bd8 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -41,6 +41,8 @@ #include "decallib.h" #include "statnums.h" #include "c_dispatch.h" +#include "d_net.h" +#include "colormatcher.h" static fixed_t DecalWidth, DecalLeft, DecalRight; static fixed_t SpreadZ; diff --git a/src/g_shared/a_fountain.cpp b/src/g_shared/a_fountain.cpp index e6274f993a..96f08fcd1a 100644 --- a/src/g_shared/a_fountain.cpp +++ b/src/g_shared/a_fountain.cpp @@ -35,6 +35,7 @@ #include "actor.h" #include "info.h" #include "p_effect.h" +#include "doomdata.h" class AParticleFountain : public AActor { diff --git a/src/g_shared/a_hatetarget.cpp b/src/g_shared/a_hatetarget.cpp index ff22f1f27f..71c254bad8 100644 --- a/src/g_shared/a_hatetarget.cpp +++ b/src/g_shared/a_hatetarget.cpp @@ -34,6 +34,7 @@ #include "actor.h" #include "info.h" +#include "m_fixed.h" // Hate Target -------------------------------------------------------------- diff --git a/src/g_shared/a_keys.cpp b/src/g_shared/a_keys.cpp index d62688a987..33988becc4 100644 --- a/src/g_shared/a_keys.cpp +++ b/src/g_shared/a_keys.cpp @@ -8,12 +8,13 @@ #include "sc_man.h" #include "v_palette.h" #include "w_wad.h" +#include "doomstat.h" struct OneKey { - const PClass * key; + const PClass *key; int count; bool check(AActor * owner) @@ -26,7 +27,7 @@ struct Keygroup { TArray anykeylist; - bool check(AActor * owner) + bool check(AActor *owner) { for(unsigned int i=0;i keylist; - char * message; - char * remotemsg; + FString Message; + FString RemoteMsg; FSoundID locksound; int rgb; Lock() { - message=remotemsg=NULL; rgb=0; } @@ -54,8 +54,6 @@ struct Lock { for(unsigned int i=0;imessage = copystring(sc.String); + lock->Message = sc.String; break; case 2: // remotemsg sc.MustGetString(); - lock->remotemsg = copystring(sc.String); + lock->RemoteMsg = sc.String; break; case 3: // mapcolor @@ -289,13 +287,13 @@ static void ParseLock(FScanner &sc) } } // copy the messages if the other one does not exist - if (!lock->remotemsg && lock->message) + if (lock->RemoteMsg.IsEmpty() && lock->Message.IsNotEmpty()) { - lock->remotemsg = copystring(lock->message); + lock->RemoteMsg = lock->Message; } - if (!lock->message && lock->remotemsg) + if (!lock->Message.IsEmpty() && lock->RemoteMsg.IsNotEmpty()) { - lock->message = copystring(lock->remotemsg); + lock->Message = lock->RemoteMsg; } lock->keylist.ShrinkToFit(); } @@ -412,7 +410,7 @@ bool P_CheckKeys (AActor *owner, int keynum, bool remote) else { if (locks[keynum]->check(owner)) return true; - failtext = remote? locks[keynum]->remotemsg : locks[keynum]->message; + failtext = remote? locks[keynum]->RemoteMsg : locks[keynum]->Message; failsound = locks[keynum]->locksound; } diff --git a/src/g_shared/a_lightning.cpp b/src/g_shared/a_lightning.cpp index 315bc757da..1d0cbadd25 100644 --- a/src/g_shared/a_lightning.cpp +++ b/src/g_shared/a_lightning.cpp @@ -7,6 +7,7 @@ #include "s_sound.h" #include "p_acs.h" #include "r_sky.h" +#include "g_level.h" static FRandom pr_lightning ("Lightning"); diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index d02ea2f416..24e466a387 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -10,6 +10,8 @@ #include "a_sharedglobal.h" #include "sbar.h" #include "a_morph.h" +#include "doomstat.h" +#include "g_level.h" static FRandom pr_morphmonst ("MorphMonster"); diff --git a/src/g_shared/a_movingcamera.cpp b/src/g_shared/a_movingcamera.cpp index 16171bd6e0..0e704c95a6 100644 --- a/src/g_shared/a_movingcamera.cpp +++ b/src/g_shared/a_movingcamera.cpp @@ -36,6 +36,7 @@ #include "info.h" #include "p_local.h" #include "p_lnspec.h" +#include "doomstat.h" /* == InterpolationPoint: node along a camera's path diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index e1531a6aef..e652a0a7ba 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -15,6 +15,8 @@ #include "a_morph.h" #include "a_specialspot.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" static FRandom pr_restore ("RestorePos"); diff --git a/src/g_shared/a_puzzleitems.cpp b/src/g_shared/a_puzzleitems.cpp index a0f4084a5a..b7ab3bc1af 100644 --- a/src/g_shared/a_puzzleitems.cpp +++ b/src/g_shared/a_puzzleitems.cpp @@ -6,6 +6,7 @@ #include "p_enemy.h" #include "s_sound.h" #include "c_console.h" +#include "doomstat.h" IMPLEMENT_CLASS (APuzzleItem) diff --git a/src/g_shared/a_secrettrigger.cpp b/src/g_shared/a_secrettrigger.cpp index 2c301ea06f..353ae87397 100644 --- a/src/g_shared/a_secrettrigger.cpp +++ b/src/g_shared/a_secrettrigger.cpp @@ -38,6 +38,7 @@ #include "info.h" #include "s_sound.h" #include "d_player.h" +#include "doomstat.h" EXTERN_CVAR(String, secretmessage) diff --git a/src/g_shared/a_specialspot.cpp b/src/g_shared/a_specialspot.cpp index 08b6678c34..5064b04864 100644 --- a/src/g_shared/a_specialspot.cpp +++ b/src/g_shared/a_specialspot.cpp @@ -38,6 +38,7 @@ #include "statnums.h" #include "i_system.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_spot ("SpecialSpot"); static FRandom pr_spawnmace ("SpawnMace"); diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index bd7488111e..a9b490249d 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -14,6 +14,8 @@ #include "templates.h" #include "sbar.h" #include "thingdef/thingdef.h" +#include "doomstat.h" +#include "g_level.h" #define BONUSADD 6 diff --git a/src/g_shared/hudmessages.cpp b/src/g_shared/hudmessages.cpp index 5bb9be2b87..1660acc29d 100644 --- a/src/g_shared/hudmessages.cpp +++ b/src/g_shared/hudmessages.cpp @@ -38,6 +38,7 @@ #include "c_cvars.h" #include "v_video.h" #include "cmdlib.h" +#include "doomstat.h" EXTERN_CVAR (Int, con_scaletext) diff --git a/src/g_shared/sbar.h b/src/g_shared/sbar.h index 4beff1bcc1..99453cddea 100644 --- a/src/g_shared/sbar.h +++ b/src/g_shared/sbar.h @@ -33,7 +33,6 @@ */ #include "dobject.h" -#include "m_fixed.h" #include "v_collection.h" #include "v_text.h" diff --git a/src/g_shared/sbarinfo_display.cpp b/src/g_shared/sbarinfo_display.cpp index fc5e598ac4..66e58ec50c 100644 --- a/src/g_shared/sbarinfo_display.cpp +++ b/src/g_shared/sbarinfo_display.cpp @@ -54,6 +54,7 @@ #include "r_main.h" #include "a_weaponpiece.h" #include "a_strifeglobal.h" +#include "g_level.h" static FRandom pr_chainwiggle; //use the same method of chain wiggling as heretic. diff --git a/src/g_shared/sbarinfo_parser.cpp b/src/g_shared/sbarinfo_parser.cpp index 2f3ef877ee..15a770024f 100644 --- a/src/g_shared/sbarinfo_parser.cpp +++ b/src/g_shared/sbarinfo_parser.cpp @@ -45,6 +45,7 @@ #include "m_random.h" #include "gi.h" #include "i_system.h" +#include "g_level.h" SBarInfo *SBarInfoScript; diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index e321797d93..5e217ad2e7 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -46,6 +46,9 @@ #include "sc_man.h" #include "templates.h" #include "p_local.h" +#include "doomstat.h" +#include "g_level.h" + #define HUMETA_AltIcon 0x10f000 diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index e3064790a7..c019d4150e 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -47,6 +47,10 @@ #include "s_sound.h" #include "gi.h" #include "p_effect.h" +#include "doomstat.h" +#include "g_level.h" +#include "d_net.h" +#include "colormatcher.h" #include "../version.h" #define XHAIRSHRINKSIZE (FRACUNIT/18) diff --git a/src/g_strife/a_acolyte.cpp b/src/g_strife/a_acolyte.cpp index cd3ea4eb30..f46109dfec 100644 --- a/src/g_strife/a_acolyte.cpp +++ b/src/g_strife/a_acolyte.cpp @@ -7,6 +7,7 @@ #include "a_strifeglobal.h" #include "doomdata.h" #include "thingdef/thingdef.h" +#include "doomstat.h" //============================================================================ // diff --git a/src/g_strife/a_alienspectres.cpp b/src/g_strife/a_alienspectres.cpp index 44aaa3d6fb..d77a99065c 100644 --- a/src/g_strife/a_alienspectres.cpp +++ b/src/g_strife/a_alienspectres.cpp @@ -9,6 +9,7 @@ #include "c_console.h" #include "gstrings.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_spectrespawn ("AlienSpectreSpawn"); static FRandom pr_spectrechunk ("212e4"); diff --git a/src/g_strife/a_entityboss.cpp b/src/g_strife/a_entityboss.cpp index fb3dfdfb50..0d6156248c 100644 --- a/src/g_strife/a_entityboss.cpp +++ b/src/g_strife/a_entityboss.cpp @@ -6,6 +6,7 @@ #include "s_sound.h" #include "a_strifeglobal.h" #include "thingdef/thingdef.h" +#include "g_level.h" static FRandom pr_entity ("Entity"); diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index 4f368fdbed..2eee0aa8da 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -7,6 +7,8 @@ #include "a_strifeglobal.h" #include "f_finale.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" static FRandom pr_prog ("Programmer"); diff --git a/src/g_strife/a_rebels.cpp b/src/g_strife/a_rebels.cpp index 102f29a217..4519b26cf2 100644 --- a/src/g_strife/a_rebels.cpp +++ b/src/g_strife/a_rebels.cpp @@ -8,6 +8,7 @@ #include "a_sharedglobal.h" #include "a_strifeglobal.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_shootgun ("ShootGun"); diff --git a/src/g_strife/a_strifeitems.cpp b/src/g_strife/a_strifeitems.cpp index 0481dca03f..9e65dbfee8 100644 --- a/src/g_strife/a_strifeitems.cpp +++ b/src/g_strife/a_strifeitems.cpp @@ -13,6 +13,8 @@ #include "c_console.h" #include "templates.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "doomstat.h" // Degnin Ore --------------------------------------------------------------- diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index 890eb203b9..06d99a69d3 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -1,4 +1,5 @@ #include "actor.h" +#include "g_level.h" #include "gi.h" #include "m_random.h" #include "s_sound.h" @@ -11,6 +12,7 @@ #include "p_lnspec.h" #include "c_console.h" #include "thingdef/thingdef.h" +#include "doomstat.h" // Notes so I don't forget them: // Strife does some extra stuff in A_Explode if a player caused the explosion. (probably NoiseAlert) diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 8623adf689..c9382fa28c 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -6,6 +6,7 @@ #include "p_enemy.h" #include "templates.h" #include "thingdef/thingdef.h" +#include "doomstat.h" // Note: Strife missiles do 1-4 times their damage amount. // Doom missiles do 1-8 times their damage amount, so to diff --git a/src/g_strife/a_thingstoblowup.cpp b/src/g_strife/a_thingstoblowup.cpp index a6e2847fdf..be167e3837 100644 --- a/src/g_strife/a_thingstoblowup.cpp +++ b/src/g_strife/a_thingstoblowup.cpp @@ -7,6 +7,7 @@ #include "gstrings.h" #include "thingdef/thingdef.h" #include "thingdef/thingdef.h" +#include "doomstat.h" static FRandom pr_bang4cloud ("Bang4Cloud"); static FRandom pr_lightout ("LightOut"); diff --git a/src/g_strife/strife_sbar.cpp b/src/g_strife/strife_sbar.cpp index e73ce1c1cd..d0fd3ad27d 100644 --- a/src/g_strife/strife_sbar.cpp +++ b/src/g_strife/strife_sbar.cpp @@ -14,6 +14,8 @@ #include "a_keys.h" #include "a_strifeglobal.h" #include "gi.h" +#include "g_level.h" +#include "colormatcher.h" // Number of tics to move the popscreen up and down. #define POP_TIME (TICRATE/8) diff --git a/src/gi.h b/src/gi.h index 9c65a64746..26514d2c66 100644 --- a/src/gi.h +++ b/src/gi.h @@ -34,7 +34,7 @@ #ifndef __GI_H__ #define __GI_H__ -#include "doomtype.h" +#include "basictypes.h" #define GI_MAPxx 0x00000001 #define GI_PAGESARERAW 0x00000002 diff --git a/src/hu_scores.cpp b/src/hu_scores.cpp index ee22e9ba55..5580073413 100644 --- a/src/hu_scores.cpp +++ b/src/hu_scores.cpp @@ -40,6 +40,8 @@ #include "teaminfo.h" #include "templates.h" #include "v_video.h" +#include "doomstat.h" +#include "g_level.h" // MACROS ------------------------------------------------------------------ @@ -298,7 +300,7 @@ static void HU_DrawPlayer (player_t *player, bool highlight, int x, int y, int h int color; char str[80]; - D_GetPlayerColor (player - players, &h, &s, &v); + D_GetPlayerColor (int(player - players), &h, &s, &v); HSVtoRGB (&r, &g, &b, h, s, v); screen->Clear (SCREENWIDTH / 24, y, SCREENWIDTH / 24 + 24*CleanXfac, y + height, -1, diff --git a/src/hu_stuff.h b/src/hu_stuff.h index b2b8559a68..d45d7fdbe5 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -21,8 +21,8 @@ #ifndef __HU_STUFF_H__ #define __HU_STUFF_H__ -#include "d_event.h" - +struct event_t; +class player_t; // // Globally visible constants. @@ -45,7 +45,6 @@ extern int chatmodeon; // [RH] Draw deathmatch scores -class player_t; void HU_DrawScores (player_t *me); #endif diff --git a/src/i_net.cpp b/src/i_net.cpp index 905f3cdae6..e9945d2a5c 100644 --- a/src/i_net.cpp +++ b/src/i_net.cpp @@ -53,7 +53,6 @@ #include "d_event.h" #include "d_net.h" #include "m_argv.h" -#include "m_alloc.h" #include "m_swap.h" #include "m_crc32.h" #include "d_player.h" diff --git a/src/i_video.h b/src/i_video.h index 1d26c6fba9..1ec8717b72 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -23,8 +23,8 @@ #ifndef __I_VIDEO_H__ #define __I_VIDEO_H__ -#include "doomtype.h" -#include "v_video.h" + +class DFrameBuffer; // [RH] Set the display mode diff --git a/src/info.cpp b/src/info.cpp index 857598385b..61eb767f32 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -38,7 +38,7 @@ #include "info.h" #include "m_fixed.h" #include "c_dispatch.h" -#include "autosegs.h" +#include "d_net.h" #include "gi.h" diff --git a/src/info.h b/src/info.h index 47273cf130..8ed3f95add 100644 --- a/src/info.h +++ b/src/info.h @@ -76,8 +76,6 @@ #include "dthinker.h" #include "farchive.h" #include "doomdef.h" -#include "name.h" -#include "tarray.h" const BYTE SF_FULLBRIGHT = 0x40; diff --git a/src/m_alloc.cpp b/src/m_alloc.cpp index 1c14f3de0d..611ed0bbe1 100644 --- a/src/m_alloc.cpp +++ b/src/m_alloc.cpp @@ -34,6 +34,7 @@ #include #include "i_system.h" +#include "dobject.h" #ifndef _MSC_VER #define _NORMAL_BLOCK 0 diff --git a/src/m_bbox.h b/src/m_bbox.h index 43683a58a1..bfc9bd7d75 100644 --- a/src/m_bbox.h +++ b/src/m_bbox.h @@ -23,7 +23,6 @@ #define __M_BBOX_H__ #include "doomtype.h" -#include "m_fixed.h" struct line_t; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 793eb152cf..b427cdd082 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -43,6 +43,8 @@ #include "p_lnspec.h" #include "c_console.h" #include "r_translate.h" +#include "g_level.h" +#include "d_net.h" // [RH] Actually handle the cheat. The cheat code in st_stuff.c now just // writes some bytes to the network data stream, and the network code diff --git a/src/m_crc32.h b/src/m_crc32.h index d8a42c0ed6..a6ba05a431 100644 --- a/src/m_crc32.h +++ b/src/m_crc32.h @@ -33,7 +33,7 @@ */ #include -#include "doomtype.h" +#include "basictypes.h" // zlib includes some CRC32 stuff, so just use that diff --git a/src/m_menu.cpp b/src/m_menu.cpp index 7261f396bc..6a5e43408a 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -67,6 +67,9 @@ #include "st_start.h" #include "teaminfo.h" #include "r_translate.h" +#include "g_level.h" +#include "d_event.h" +#include "colormatcher.h" // MACROS ------------------------------------------------------------------ @@ -651,7 +654,7 @@ CCMD (bumpgamma) // on the fly for *any* gamma level. // Q: What are reasonable limits to use here? - float newgamma = Gamma + 0.1; + float newgamma = Gamma + 0.1f; if (newgamma > 3.0) newgamma = 1.0; @@ -2084,7 +2087,7 @@ static void M_PlayerSetupTicker (void) PlayerState = GetDefaultByType (PlayerClass->Type)->SeeState; PlayerTics = PlayerState->GetTics(); - PlayerSkin = R_FindSkin (skins[PlayerSkin].name, PlayerClass - &PlayerClasses[0]); + PlayerSkin = R_FindSkin (skins[PlayerSkin].name, int(PlayerClass - &PlayerClasses[0])); R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]); } @@ -2231,9 +2234,9 @@ static void M_PlayerSetupDrawer () x = SmallFont->StringWidth ("Green") + 8 + PSetupDef.x; color = players[consoleplayer].userinfo.color; - M_DrawSlider (x, PSetupDef.y + LINEHEIGHT*2+yo, 0.0f, 255.0f, RPART(color)); - M_DrawSlider (x, PSetupDef.y + LINEHEIGHT*3+yo, 0.0f, 255.0f, GPART(color)); - M_DrawSlider (x, PSetupDef.y + LINEHEIGHT*4+yo, 0.0f, 255.0f, BPART(color)); + M_DrawSlider (x, PSetupDef.y + LINEHEIGHT*2+yo, 0.0f, 255.0f, float(RPART(color))); + M_DrawSlider (x, PSetupDef.y + LINEHEIGHT*3+yo, 0.0f, 255.0f, float(GPART(color))); + M_DrawSlider (x, PSetupDef.y + LINEHEIGHT*4+yo, 0.0f, 255.0f, float(BPART(color))); // [GRB] Draw class setting int pclass = players[consoleplayer].userinfo.PlayerClass; diff --git a/src/m_menu.h b/src/m_menu.h index 2126e1a6d8..2d8d72d319 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -23,9 +23,10 @@ #ifndef __M_MENU_H__ #define __M_MENU_H__ -#include "d_event.h" #include "c_cvars.h" +struct event_t; +struct menu_t; // // MENUS // diff --git a/src/m_misc.cpp b/src/m_misc.cpp index 0f5f1416fb..5a96560041 100644 --- a/src/m_misc.cpp +++ b/src/m_misc.cpp @@ -43,8 +43,6 @@ #include -#include "m_alloc.h" - #include "doomdef.h" #include "m_swap.h" diff --git a/src/m_misc.h b/src/m_misc.h index 2ced7e74d7..7f9b185b87 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -23,7 +23,7 @@ #ifndef __M_MISC__ #define __M_MISC__ -#include "doomtype.h" +#include "basictypes.h" class FConfigFile; class FGameConfigFile; diff --git a/src/m_options.cpp b/src/m_options.cpp index 56ee844cf4..82d84b178c 100644 --- a/src/m_options.cpp +++ b/src/m_options.cpp @@ -36,7 +36,6 @@ ** taglists to describe each menu item. We'll see... (Probably not.) */ -#include "m_alloc.h" #include "templates.h" #include "doomdef.h" @@ -77,6 +76,8 @@ #include "m_misc.h" #include "hardware.h" #include "sc_man.h" +#include "cmdlib.h" +#include "d_event.h" // Data. #include "m_menu.h" diff --git a/src/m_png.h b/src/m_png.h index 56b73f6509..8dd7c01a5c 100644 --- a/src/m_png.h +++ b/src/m_png.h @@ -1,3 +1,5 @@ +#ifndef __M_PNG_H +#define __M_PNG_H /* ** m_png.h ** @@ -31,7 +33,10 @@ ** */ -#include "v_video.h" +#include +#include "doomtype.h" + +enum ESSType; // PNG Writing -------------------------------------------------------------- @@ -110,3 +115,5 @@ bool M_ReadIDAT (FileReader *file, BYTE *buffer, int width, int height, int pitc class FTexture; FTexture *PNGTexture_CreateFromFile(PNGHandle *png, const FString &filename); + +#endif \ No newline at end of file diff --git a/src/m_random.h b/src/m_random.h index 4c58e6d91d..ea806510a6 100644 --- a/src/m_random.h +++ b/src/m_random.h @@ -25,7 +25,7 @@ #define __M_RANDOM__ #include -#include "doomtype.h" +#include "basictypes.h" // killough 1/19/98: rewritten to use a better random number generator // in the new engine, although the old one is available for compatibility. diff --git a/src/name.cpp b/src/name.cpp index eeb30420b8..c0d14b51e3 100644 --- a/src/name.cpp +++ b/src/name.cpp @@ -35,7 +35,6 @@ #include #include "name.h" #include "c_dispatch.h" -#include "m_alloc.h" // MACROS ------------------------------------------------------------------ diff --git a/src/nodebuild.cpp b/src/nodebuild.cpp index 303c28c027..b988059592 100644 --- a/src/nodebuild.cpp +++ b/src/nodebuild.cpp @@ -200,7 +200,7 @@ void FNodeBuilder::CreateSubsectorsForReal () // Convert seg pointers into indices for (unsigned int i = sub.firstline; i < SegList.Size(); ++i) { - SegList[i].SegNum = SegList[i].SegPtr - &Segs[0]; + SegList[i].SegNum = DWORD(SegList[i].SegPtr - &Segs[0]); } Subsectors.Push (sub); } diff --git a/src/oplsynth/mlopl.cpp b/src/oplsynth/mlopl.cpp index 0fe1715974..d5b51018f1 100644 --- a/src/oplsynth/mlopl.cpp +++ b/src/oplsynth/mlopl.cpp @@ -49,6 +49,7 @@ #include #endif #include "muslib.h" +#include "files.h" #include "c_cvars.h" diff --git a/src/oplsynth/muslib.h b/src/oplsynth/muslib.h index f8576ec385..c3166ae377 100644 --- a/src/oplsynth/muslib.h +++ b/src/oplsynth/muslib.h @@ -78,7 +78,8 @@ Voice-mail (Czech language only, not recommended; weekends only): #ifndef __DEFTYPES_H_ #include "deftypes.h" #endif -#include "files.h" + +class FileReader; /* Global Definitions */ diff --git a/src/oplsynth/opl_mus_player.h b/src/oplsynth/opl_mus_player.h index ceb44fc0b6..cd2b9c4144 100644 --- a/src/oplsynth/opl_mus_player.h +++ b/src/oplsynth/opl_mus_player.h @@ -1,6 +1,5 @@ #include "critsec.h" #include "muslib.h" -#include "files.h" class OPLmusicBlock : public musicBlock { diff --git a/src/p_acs.cpp b/src/p_acs.cpp index dab1dbd1f3..11c86b6c6a 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -67,6 +67,7 @@ #include "info.h" #include "r_translate.h" #include "sbarinfo.h" +#include "cmdlib.h" extern FILE *Logfile; @@ -862,7 +863,7 @@ FBehavior::FBehavior (int lumpnum, FileReader * fr, int len) BYTE *strings = FindChunk (MAKE_ID('S','T','R','L')); if (strings != NULL) { - StringTable = strings - Data + 8; + StringTable = DWORD(strings - Data + 8); } else { diff --git a/src/p_buildmap.cpp b/src/p_buildmap.cpp index 1ef6de6a72..21b6b37060 100644 --- a/src/p_buildmap.cpp +++ b/src/p_buildmap.cpp @@ -16,6 +16,7 @@ #include "r_main.h" #include "r_defs.h" #include "p_setup.h" +#include "g_level.h" // MACROS ------------------------------------------------------------------ diff --git a/src/p_ceiling.cpp b/src/p_ceiling.cpp index 26d5538ee6..4da11fd045 100644 --- a/src/p_ceiling.cpp +++ b/src/p_ceiling.cpp @@ -22,7 +22,6 @@ -#include "m_alloc.h" #include "doomdef.h" #include "p_local.h" #include "s_sound.h" diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index 3470ebf14d..447dd428dc 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -52,6 +52,9 @@ #include "gstrings.h" #include "sound/i_music.h" #include "p_setup.h" +#include "d_net.h" +#include "g_level.h" +#include "d_event.h" // The conversations as they exist inside a SCRIPTxx lump. struct Response diff --git a/src/p_doors.cpp b/src/p_doors.cpp index cf02ac5b0a..6179c5aa95 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -34,6 +34,7 @@ #include "a_keys.h" #include "i_system.h" #include "sc_man.h" +#include "cmdlib.h" IMPLEMENT_CLASS (DDoor) diff --git a/src/p_effect.cpp b/src/p_effect.cpp index d2fbf81963..535f1877eb 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -48,6 +48,7 @@ #include "s_sound.h" #include "templates.h" #include "gi.h" +#include "colormatcher.h" CVAR (Int, cl_rockettrails, 1, CVAR_ARCHIVE); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 720a0643c6..756f61af23 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -28,7 +28,6 @@ #include "templates.h" #include "m_random.h" -#include "m_alloc.h" #include "i_system.h" #include "doomdef.h" #include "p_local.h" @@ -46,6 +45,7 @@ #include "a_action.h" #include "thingdef/thingdef.h" #include "d_dehacked.h" +#include "g_level.h" #include "gi.h" diff --git a/src/p_enemy_a_lookex.cpp b/src/p_enemy_a_lookex.cpp index 89be42e717..d4bb528316 100644 --- a/src/p_enemy_a_lookex.cpp +++ b/src/p_enemy_a_lookex.cpp @@ -2,7 +2,6 @@ #include "templates.h" #include "m_random.h" -#include "m_alloc.h" #include "i_system.h" #include "doomdef.h" #include "p_local.h" @@ -18,6 +17,7 @@ #include "a_doomglobal.h" #include "a_action.h" #include "thingdef/thingdef.h" +#include "g_level.h" #include "gi.h" diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 4185dfe10f..a4f598f9d4 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -56,6 +56,8 @@ #include "templates.h" #include "sbar.h" #include "s_sound.h" +#include "g_level.h" +#include "d_net.h" static FRandom pr_obituary ("Obituary"); static FRandom pr_botrespawn ("BotRespawn"); @@ -357,7 +359,7 @@ void AActor::Die (AActor *source, AActor *inflictor) if (debugfile && this->player) { static int dieticks[MAXPLAYERS]; - int pnum = this->player-players; + int pnum = int(this->player-players); if (dieticks[pnum] == gametic) gametic=gametic; dieticks[pnum] = gametic; diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 667b71b338..961c0e078c 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -54,6 +54,8 @@ #include "a_strifeglobal.h" #include "r_translate.h" #include "p_3dmidtex.h" +#include "d_net.h" +#include "d_event.h" #define FUNC(a) static int a (line_t *ln, AActor *it, bool backSide, \ int arg0, int arg1, int arg2, int arg3, int arg4) diff --git a/src/p_local.h b/src/p_local.h index 72cadd7009..37c08f4102 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -87,6 +87,8 @@ void P_UnPredictPlayer (); extern fixed_t FloatBobOffsets[64]; +struct FMapThing; + APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer=false); void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move); diff --git a/src/p_map.cpp b/src/p_map.cpp index 445c6c7ae3..2e4e702803 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -27,7 +27,6 @@ #include "templates.h" -#include "m_alloc.h" #include "m_bbox.h" #include "m_random.h" #include "i_system.h" @@ -53,6 +52,7 @@ #include "a_doomglobal.h" #include "p_conversation.h" #include "r_translate.h" +#include "g_level.h" #define WATER_SINK_FACTOR 3 #define WATER_SINK_SMALL_FACTOR 4 diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 833e762e28..7c0b6f3ed7 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -24,7 +24,6 @@ // HEADER FILES ------------------------------------------------------------ #include "templates.h" -#include "m_alloc.h" #include "i_system.h" #include "m_random.h" #include "doomdef.h" @@ -57,6 +56,9 @@ #include "teaminfo.h" #include "r_translate.h" #include "r_sky.h" +#include "g_level.h" +#include "d_event.h" +#include "colormatcher.h" // MACROS ------------------------------------------------------------------ diff --git a/src/p_plats.cpp b/src/p_plats.cpp index cc03ed7cdd..48247843b5 100644 --- a/src/p_plats.cpp +++ b/src/p_plats.cpp @@ -21,7 +21,6 @@ // //----------------------------------------------------------------------------- -#include "m_alloc.h" #include "i_system.h" #include "m_random.h" #include "doomdef.h" diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 49c3c0ff43..7ceca60308 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -27,6 +27,7 @@ #include "a_doomglobal.h" #include "templates.h" #include "thingdef/thingdef.h" +#include "g_level.h" // MACROS ------------------------------------------------------------------ diff --git a/src/p_pspr.h b/src/p_pspr.h index af8deead10..531f427c33 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -25,7 +25,6 @@ // Basic data types. // Needs fixed point, and BAM angles. -#include "m_fixed.h" #include "tables.h" #include "thingdef/thingdef.h" diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index ad355ed9f3..cb19684e1a 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -46,6 +46,7 @@ #include "v_palette.h" #include "a_sharedglobal.h" #include "r_interpolate.h" +#include "g_level.h" static void CopyPlayer (player_t *dst, player_t *src, const char *name); static void ReadOnePlayer (FArchive &arc, bool skipload); diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index 7f420a7cd5..b7cefb4e3a 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -24,6 +24,7 @@ #include "r_data.h" #include "p_spec.h" #include "c_cvars.h" +#include "doomstat.h" // [RH] diff --git a/src/p_setup.cpp b/src/p_setup.cpp index c42dc4b8ef..bf3cdd14da 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -29,7 +29,6 @@ #endif #include "templates.h" -#include "m_alloc.h" #include "m_argv.h" #include "m_swap.h" #include "m_bbox.h" @@ -62,6 +61,8 @@ #include "r_translate.h" #include "r_interpolate.h" #include "r_sky.h" +#include "cmdlib.h" +#include "g_level.h" void P_SpawnSlopeMakers (FMapThing *firstmt, FMapThing *lastmt); void P_SetSlopes (); diff --git a/src/p_sight.cpp b/src/p_sight.cpp index e3551f6776..534d8300ce 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -17,6 +17,7 @@ #include "m_random.h" #include "m_bbox.h" #include "p_lnspec.h" +#include "g_level.h" // State. #include "r_state.h" diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 316174d26e..e6b73f6690 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -31,8 +31,6 @@ //----------------------------------------------------------------------------- -#include "m_alloc.h" - #include #include "templates.h" @@ -59,6 +57,7 @@ #include "sc_man.h" #include "gi.h" #include "statnums.h" +#include "g_level.h" // State. #include "r_state.h" @@ -922,7 +921,7 @@ void P_SpawnSpecials (void) case dScroll_EastLavaDamage: new DScroller (DScroller::sc_floor, (-FRACUNIT/2)<<3, - 0, -1, sector-sectors, 0); + 0, -1, int(sector-sectors), 0); break; default: @@ -944,7 +943,7 @@ void P_SpawnSpecials (void) int i = (sector->special & 0xff) - Scroll_North_Slow; fixed_t dx = hexenScrollies[i][0] * (FRACUNIT/2); fixed_t dy = hexenScrollies[i][1] * (FRACUNIT/2); - new DScroller (DScroller::sc_floor, dx, dy, -1, sector-sectors, 0); + new DScroller (DScroller::sc_floor, dx, dy, -1, int(sector-sectors), 0); } else if ((sector->special & 0xff) >= Carry_East5 && (sector->special & 0xff) <= Carry_East35) @@ -952,7 +951,7 @@ void P_SpawnSpecials (void) // Only east scrollers also scroll the texture new DScroller (DScroller::sc_floor, (-FRACUNIT/2)<<((sector->special & 0xff) - Carry_East5), - 0, -1, sector-sectors, 0); + 0, -1, int(sector-sectors), 0); } break; } @@ -1338,7 +1337,7 @@ static void P_SpawnScrollers(void) { // if 1, then displacement // if 2, then accelerative (also if 3) - control = sides[*l->sidenum].sector - sectors; + control = int(sides[*l->sidenum].sector - sectors); if (l->args[1] & 2) accel = 1; } @@ -1871,7 +1870,7 @@ static void P_SpawnPushers () thing->GetClass()->TypeName == NAME_PointPuller) { new DPusher (DPusher::p_push, l->args[3] ? l : NULL, l->args[2], - 0, thing, thing->Sector - sectors); + 0, thing, int(thing->Sector - sectors)); } } } diff --git a/src/p_spec.h b/src/p_spec.h index 8b5910627e..e79bd0306e 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -26,8 +26,10 @@ #define __P_SPEC__ #include "dsectoreffect.h" +#include "doomdata.h" class FScanner; +struct level_info_t; //jff 2/23/98 identify the special classes that can share sectors diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index 2bd7b1c90a..c1b3bb3574 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -33,6 +33,7 @@ #include "a_sharedglobal.h" #include "m_random.h" #include "i_system.h" +#include "doomstat.h" static FRandom pr_teleport ("Teleport"); diff --git a/src/p_terrain.h b/src/p_terrain.h index ce425f2069..336c2a632a 100644 --- a/src/p_terrain.h +++ b/src/p_terrain.h @@ -35,9 +35,6 @@ #define __P_TERRAIN_H__ #include "dobject.h" -#include "m_fixed.h" -#include "tarray.h" -#include "name.h" #include "s_sound.h" #include "textures/textures.h" diff --git a/src/p_things.cpp b/src/p_things.cpp index 3d38d87194..30e08ebf1b 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -45,6 +45,7 @@ #include "a_sharedglobal.h" #include "gi.h" #include "templates.h" +#include "g_level.h" // List of spawnable things for the Thing_Spawn and Thing_Projectile specials. const PClass *SpawnableThings[MAX_SPAWNABLES]; diff --git a/src/p_tick.cpp b/src/p_tick.cpp index 5f1552965e..5561caebd1 100644 --- a/src/p_tick.cpp +++ b/src/p_tick.cpp @@ -32,6 +32,7 @@ #include "sbar.h" #include "r_interpolate.h" #include "i_sound.h" +#include "g_level.h" extern gamestate_t wipegamestate; diff --git a/src/p_trace.cpp b/src/p_trace.cpp index 0f71bc8f1d..d1989c0583 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -36,6 +36,7 @@ #include "p_local.h" #include "i_system.h" #include "r_sky.h" +#include "doomstat.h" struct FTraceInfo { diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 407fdedb5a..2f8232f74b 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -41,6 +41,7 @@ #include "i_system.h" #include "gi.h" #include "r_sky.h" +#include "g_level.h" //=========================================================================== // diff --git a/src/p_user.cpp b/src/p_user.cpp index 73411ed7a3..434a771884 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -51,6 +51,8 @@ #include "c_dispatch.h" #include "tarray.h" #include "thingdef/thingdef.h" +#include "g_level.h" +#include "d_net.h" static FRandom pr_skullpop ("SkullPop"); diff --git a/src/p_writemap.cpp b/src/p_writemap.cpp index b2038ccae3..47af3b37e3 100644 --- a/src/p_writemap.cpp +++ b/src/p_writemap.cpp @@ -4,6 +4,7 @@ #include "w_wad.h" #include "r_defs.h" #include "m_swap.h" +#include "doomstat.h" static int WriteTHINGS (FILE *file); static int WriteLINEDEFS (FILE *file); diff --git a/src/r_anim.cpp b/src/r_anim.cpp index 62b16963e1..b20f1cd8d9 100644 --- a/src/r_anim.cpp +++ b/src/r_anim.cpp @@ -32,6 +32,7 @@ ** */ +#include "doomtype.h" #include "cmdlib.h" #include "i_system.h" #include "r_local.h" @@ -42,6 +43,7 @@ #include "sc_man.h" #include "templates.h" #include "w_wad.h" +#include "g_level.h" // MACROS ------------------------------------------------------------------ diff --git a/src/r_blend.h b/src/r_blend.h index 08e31c5390..a7c9e49d37 100644 --- a/src/r_blend.h +++ b/src/r_blend.h @@ -140,10 +140,9 @@ inline FRenderStyle &FRenderStyle::operator= (ERenderStyle legacy) *this = LegacyRenderStyles[legacy]; return *this; } -inline FArchive &operator<< (FArchive &arc, FRenderStyle &style) -{ - arc << style.BlendOp << style.SrcAlpha << style.DestAlpha << style.Flags; - return arc; -} + +class FArchive; + +FArchive &operator<< (FArchive &arc, FRenderStyle &style); #endif diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 9a9a2e244c..f2891f10be 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -29,7 +29,6 @@ #include #include "templates.h" -#include "m_alloc.h" #include "doomdef.h" @@ -43,6 +42,7 @@ #include "r_draw.h" #include "r_things.h" #include "a_sharedglobal.h" +#include "g_level.h" // State. #include "doomstat.h" diff --git a/src/r_data.cpp b/src/r_data.cpp index a4bfa0feda..6d4a6feadd 100644 --- a/src/r_data.cpp +++ b/src/r_data.cpp @@ -33,7 +33,6 @@ */ #include "i_system.h" -#include "m_alloc.h" #include "w_wad.h" #include "doomdef.h" #include "r_local.h" @@ -43,6 +42,7 @@ #include "sc_man.h" #include "v_text.h" #include "st_start.h" +#include "doomstat.h" static int R_CountGroup (const char *start, const char *end); diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 88a081fddd..764d543385 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -26,7 +26,6 @@ #include #include "templates.h" -#include "m_alloc.h" #include "doomdef.h" #include "i_system.h" #include "w_wad.h" @@ -139,6 +138,12 @@ const FRenderStyle LegacyRenderStyles[STYLE_Count] = /* STYLE_TranslucentStencil */{{ STYLEOP_Add, STYLEALPHA_Src, STYLEALPHA_InvSrc, STYLEF_ColorIsFixed }}, }; +FArchive &operator<< (FArchive &arc, FRenderStyle &style) +{ + arc << style.BlendOp << style.SrcAlpha << style.DestAlpha << style.Flags; + return arc; +} + EXTERN_CVAR (Int, r_columnmethod) /************************************/ diff --git a/src/r_jpeg.h b/src/r_jpeg.h index a40b725b02..0df98ddd31 100644 --- a/src/r_jpeg.h +++ b/src/r_jpeg.h @@ -5,7 +5,8 @@ extern "C" { #include } -#include "files.h" + +class FileReader; struct FLumpSourceMgr : public jpeg_source_mgr diff --git a/src/r_main.cpp b/src/r_main.cpp index 288056ca67..3f673513de 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -29,7 +29,6 @@ #include #include "templates.h" -#include "m_alloc.h" #include "doomdef.h" #include "d_net.h" #include "doomstat.h" diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 9650c299a4..cc465ca394 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -46,10 +46,12 @@ #include "r_sky.h" #include "stats.h" -#include "m_alloc.h" #include "v_video.h" #include "a_sharedglobal.h" #include "c_console.h" +#include "cmdlib.h" +#include "d_net.h" +#include "g_level.h" //EXTERN_CVAR (Int, tx) //EXTERN_CVAR (Int, ty) diff --git a/src/r_polymost.cpp b/src/r_polymost.cpp index ecf049750d..0c55773e3b 100644 --- a/src/r_polymost.cpp +++ b/src/r_polymost.cpp @@ -77,6 +77,7 @@ Low priority: #include "r_draw.h" #include "templates.h" #include "r_sky.h" +#include "g_level.h" EXTERN_CVAR (Int, r_polymost) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 8ef9900a0c..e7f40d7ab5 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -25,7 +25,6 @@ // //----------------------------------------------------------------------------- -#include "m_alloc.h" #include #include @@ -34,6 +33,7 @@ #include "doomdef.h" #include "doomstat.h" +#include "doomdata.h" #include "p_lnspec.h" #include "r_local.h" @@ -44,6 +44,8 @@ #include "w_wad.h" #include "stats.h" #include "a_sharedglobal.h" +#include "d_net.h" +#include "g_level.h" #define WALLYREPEAT 8 diff --git a/src/r_things.cpp b/src/r_things.cpp index 36fe76dcea..52216314b1 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -26,7 +26,6 @@ #include #include "templates.h" -#include "m_alloc.h" #include "doomdef.h" #include "m_swap.h" #include "m_argv.h" @@ -44,6 +43,10 @@ #include "sbar.h" #include "gi.h" #include "r_sky.h" +#include "cmdlib.h" +#include "g_level.h" +#include "d_net.h" +#include "colormatcher.h" extern FTexture *CrosshairImage; extern fixed_t globaluclip, globaldclip; diff --git a/src/r_translate.cpp b/src/r_translate.cpp index 10f058997a..f5ace0f877 100644 --- a/src/r_translate.cpp +++ b/src/r_translate.cpp @@ -35,11 +35,11 @@ #include #include "templates.h" -#include "m_alloc.h" #include "r_draw.h" #include "r_translate.h" #include "v_video.h" #include "g_game.h" +#include "colormatcher.h" #include "gi.h" #include "stats.h" diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index 4c636a2a4c..5f7c169ad9 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -15,7 +15,6 @@ #include "doomtype.h" #include "doomstat.h" #include "sc_man.h" -#include "m_alloc.h" #include "m_random.h" #include "s_sound.h" #include "s_sndseq.h" @@ -26,6 +25,7 @@ #include "gi.h" #include "templates.h" #include "c_dispatch.h" +#include "g_level.h" // MACROS ------------------------------------------------------------------ diff --git a/src/s_sndseq.h b/src/s_sndseq.h index fdc76c8356..35d4074132 100644 --- a/src/s_sndseq.h +++ b/src/s_sndseq.h @@ -5,7 +5,6 @@ //#include "actor.h" #include "s_sound.h" #include "r_defs.h" -#include "name.h" typedef enum { SEQ_PLATFORM, diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 9174b9375b..37f70c05f1 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -26,7 +26,6 @@ #include #endif #include -#include "m_alloc.h" #include "i_system.h" #include "i_sound.h" @@ -48,8 +47,8 @@ #include "gstrings.h" #include "gi.h" #include "templates.h" -#include "zstring.h" #include "timidity/timidity.h" +#include "g_level.h" // MACROS ------------------------------------------------------------------ diff --git a/src/s_sound.h b/src/s_sound.h index 8d6bb7bd5c..7637c560c7 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -21,8 +21,7 @@ #ifndef __S_SOUND__ #define __S_SOUND__ -#include "m_fixed.h" -#include "tarray.h" +#include "doomtype.h" class AActor; class FScanner; diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index af4b5403e4..f49c9bbd16 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -196,8 +196,6 @@ static int DoomSpecificInfo (char *buffer, char *end) return p; } -#include "zstring.h" - int main (int argc, char **argv) { printf(GAMENAME" v%s - SVN revision %s - SDL version\nCompiled on %s\n\n", diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 418c1147de..9fb8641427 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -59,7 +59,6 @@ #include "stats.h" #include "hardware.h" -#include "zstring.h" #include "gameconfigfile.h" EXTERN_CVAR (String, language) diff --git a/src/sdl/i_video.h b/src/sdl/i_video.h index 02f5b1aeda..2865df02f8 100644 --- a/src/sdl/i_video.h +++ b/src/sdl/i_video.h @@ -23,9 +23,9 @@ #ifndef __I_VIDEO_H__ #define __I_VIDEO_H__ -#include "doomtype.h" -#include "v_video.h" +#include "basictypes.h" +class DCanvas; // [RH] Set the display mode void I_SetMode (int &width, int &height, int &bits); diff --git a/src/sound/i_music.h b/src/sound/i_music.h index 4c4dc42185..d5a9eeae0d 100644 --- a/src/sound/i_music.h +++ b/src/sound/i_music.h @@ -36,7 +36,8 @@ #include "doomdef.h" #include "doomstat.h" -#include "files.h" + +class FileReader; // // MUSIC I/O diff --git a/src/sound/i_sound.cpp b/src/sound/i_sound.cpp index 3b65e718c3..7d55997692 100644 --- a/src/sound/i_sound.cpp +++ b/src/sound/i_sound.cpp @@ -50,7 +50,6 @@ extern HINSTANCE g_hInst; #include #include "doomtype.h" -#include "m_alloc.h" #include #include "fmodsound.h" diff --git a/src/sound/music_dumb.cpp b/src/sound/music_dumb.cpp index 9382f80bb9..e2002ba9ab 100644 --- a/src/sound/music_dumb.cpp +++ b/src/sound/music_dumb.cpp @@ -27,7 +27,6 @@ #include "doomdef.h" #include "m_swap.h" #include "m_fixed.h" -#include "zstring.h" #include "c_cvars.h" #include "i_sound.h" #include "i_system.h" diff --git a/src/st_stuff.cpp b/src/st_stuff.cpp index f106fd2ca5..af72878797 100644 --- a/src/st_stuff.cpp +++ b/src/st_stuff.cpp @@ -27,6 +27,9 @@ #include "c_dispatch.h" #include "d_event.h" #include "gi.h" +#include "d_net.h" +#include "doomstat.h" +#include "g_level.h" EXTERN_CVAR (Bool, ticker); EXTERN_CVAR (Bool, noisedebug); diff --git a/src/st_stuff.h b/src/st_stuff.h index bd48238591..bd42c9eda5 100644 --- a/src/st_stuff.h +++ b/src/st_stuff.h @@ -24,7 +24,7 @@ #ifndef __STSTUFF_H__ #define __STSTUFF_H__ -#include "d_event.h" +struct event_t; extern int ST_X; extern int ST_Y; diff --git a/src/stringtable.cpp b/src/stringtable.cpp index 79b55da9f1..6b0dd91f58 100644 --- a/src/stringtable.cpp +++ b/src/stringtable.cpp @@ -41,7 +41,6 @@ #include "w_wad.h" #include "i_system.h" #include "sc_man.h" -#include "zstring.h" #include "c_dispatch.h" #include "v_text.h" diff --git a/src/tables.h b/src/tables.h index 2f5008b4d1..826333a1a1 100644 --- a/src/tables.h +++ b/src/tables.h @@ -37,13 +37,13 @@ #define __TABLES_H__ #include +#include "basictypes.h" #ifndef PI #define PI 3.14159265358979323846 // matches value in gcc v2 math.h #endif -#include "m_fixed.h" #define FINEANGLES 8192 #define FINEMASK (FINEANGLES-1) diff --git a/src/teaminfo.h b/src/teaminfo.h index 737112f262..cacf69fdc4 100644 --- a/src/teaminfo.h +++ b/src/teaminfo.h @@ -37,6 +37,8 @@ #define TEAM_None 255 +#include "doomtype.h" + struct TEAMINFO { FString name; diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 9b0d14520d..09a70bc170 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -45,6 +45,7 @@ #include "templates.h" #include "r_translate.h" #include "bitmap.h" +#include "colormatcher.h" // On the Alpha, accessing the shorts directly if they aren't aligned on a // 4-byte boundary causes unaligned access warnings. Why it does this at diff --git a/src/textures/pcxtexture.cpp b/src/textures/pcxtexture.cpp index dfe04df3bf..85b43bf509 100644 --- a/src/textures/pcxtexture.cpp +++ b/src/textures/pcxtexture.cpp @@ -40,6 +40,7 @@ #include "w_wad.h" #include "templates.h" #include "bitmap.h" +#include "colormatcher.h" //========================================================================== // diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index d6c9249a62..aeafa65818 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -41,6 +41,7 @@ #include "i_system.h" #include "r_translate.h" #include "bitmap.h" +#include "colormatcher.h" typedef bool (*CheckFunc)(FileReader & file); typedef FTexture * (*CreateFunc)(FileReader & file, int lumpnum); @@ -520,6 +521,14 @@ FTexture *FTexture::GetRedirect(bool wantwarped) return this; } +void FTexture::SetScaledSize(int fitwidth, int fitheight) +{ + xScale = DivScale16(Width, fitwidth); + yScale = DivScale16(Height,fitheight); + // compensate for roundoff errors + if (MulScale16(xScale, fitwidth) != Width) xScale++; + if (MulScale16(yScale, fitheight) != Height) yScale++; +} FDummyTexture::FDummyTexture () diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 1bec330d92..69828593b4 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -46,6 +46,7 @@ #include "gi.h" #include "st_start.h" #include "cmdlib.h" +#include "g_level.h" extern void R_InitBuildTiles(); diff --git a/src/textures/textures.h b/src/textures/textures.h index 84777da39b..6275c11889 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -1,13 +1,13 @@ #ifndef __TEXTURES_H #define __TEXTURES_H -#include "doomtype.h" -#include "m_fixed.h" +#include "basictypes.h" class FBitmap; struct FRemapTable; struct FCopyInfo; class FScanner; +struct PClass; // Texture IDs class FTextureManager; @@ -201,14 +201,7 @@ public: WidthMask = (1 << WidthBits) - 1; } - void SetScaledSize(int fitwidth, int fitheight) - { - xScale = DivScale16(Width, fitwidth); - yScale = DivScale16(Height,fitheight); - // compensate for roundoff errors - if (MulScale16(xScale, fitwidth) != Width) xScale++; - if (MulScale16(yScale, fitheight) != Height) yScale++; - } + void SetScaledSize(int fitwidth, int fitheight); virtual void HackHack (int newheight); // called by FMultipatchTexture to discover corrupt patches. diff --git a/src/textures/tgatexture.cpp b/src/textures/tgatexture.cpp index 0758075ad4..608f641889 100644 --- a/src/textures/tgatexture.cpp +++ b/src/textures/tgatexture.cpp @@ -39,6 +39,7 @@ #include "w_wad.h" #include "templates.h" #include "bitmap.h" +#include "colormatcher.h" //========================================================================== diff --git a/src/thingdef/thingdef.cpp b/src/thingdef/thingdef.cpp index d585e25c19..79bca2be1b 100644 --- a/src/thingdef/thingdef.cpp +++ b/src/thingdef/thingdef.cpp @@ -55,7 +55,6 @@ #include "a_action.h" #include "decallib.h" #include "m_random.h" -#include "autosegs.h" #include "i_system.h" #include "p_local.h" #include "p_effect.h" diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index fd0b3413e7..4a9d5b18ed 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -39,6 +39,7 @@ */ #include "gi.h" +#include "g_level.h" #include "actor.h" #include "info.h" #include "sc_man.h" @@ -55,7 +56,6 @@ #include "a_action.h" #include "decallib.h" #include "m_random.h" -#include "autosegs.h" #include "i_system.h" #include "p_local.h" #include "c_console.h" @@ -64,6 +64,7 @@ #include "a_doomglobal.h" #include "thingdef/thingdef.h" #include "v_video.h" +#include "doomstat.h" static FRandom pr_camissile ("CustomActorfire"); diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 4d88de35c6..f5ebb5b977 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -55,7 +55,6 @@ #include "a_action.h" #include "decallib.h" #include "m_random.h" -#include "autosegs.h" #include "i_system.h" #include "p_local.h" #include "p_effect.h" @@ -70,6 +69,7 @@ #include "a_sharedglobal.h" #include "r_translate.h" #include "a_morph.h" +#include "colormatcher.h" //========================================================================== // diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 585f142f3b..66e8f7d3d1 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -39,6 +39,7 @@ */ #include "actor.h" +#include "autosegs.h" #include "info.h" #include "sc_man.h" #include "tarray.h" @@ -54,7 +55,7 @@ #include "a_sharedglobal.h" #include "s_sound.h" #include "i_system.h" -#include "autosegs.h" +#include "colormatcher.h" TArray StateParameters; TArray JumpParameters; diff --git a/src/timidity/common.cpp b/src/timidity/common.cpp index 83e334b539..92d9b009a1 100644 --- a/src/timidity/common.cpp +++ b/src/timidity/common.cpp @@ -26,7 +26,6 @@ #include #include #include "timidity.h" -#include "zstring.h" #include "tarray.h" #include "i_system.h" #include "w_wad.h" diff --git a/src/timidity/timidity.cpp b/src/timidity/timidity.cpp index e6f8dbbe42..521097ef1e 100644 --- a/src/timidity/timidity.cpp +++ b/src/timidity/timidity.cpp @@ -25,7 +25,6 @@ #include "timidity.h" #include "templates.h" -#include "m_alloc.h" #include "cmdlib.h" #include "c_cvars.h" #include "c_dispatch.h" diff --git a/src/timidity/timidity.h b/src/timidity/timidity.h index ed5a2b2f83..e704b6b782 100644 --- a/src/timidity/timidity.h +++ b/src/timidity/timidity.h @@ -21,7 +21,6 @@ #define TIMIDITY_H #include "doomtype.h" -#include "zstring.h" class FileReader; diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 0638bb38f3..62d8a12eef 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -42,10 +42,13 @@ #include "r_draw.h" #include "r_things.h" #include "r_translate.h" +#include "doomstat.h" #include "i_system.h" #include "i_video.h" #include "templates.h" +#include "d_net.h" +#include "colormatcher.h" // [RH] Stretch values to make a 320x200 image best fit the screen // without using fractional steppings diff --git a/src/v_font.cpp b/src/v_font.cpp index 428538edae..1aa07bb66c 100644 --- a/src/v_font.cpp +++ b/src/v_font.cpp @@ -93,6 +93,7 @@ The FON2 header is followed by variable length data: #include "hu_stuff.h" #include "r_draw.h" #include "r_translate.h" +#include "colormatcher.h" // MACROS ------------------------------------------------------------------ diff --git a/src/v_palette.cpp b/src/v_palette.cpp index c2889bf2e8..dd0141aeac 100644 --- a/src/v_palette.cpp +++ b/src/v_palette.cpp @@ -45,7 +45,6 @@ #include "templates.h" #include "v_video.h" -#include "m_alloc.h" #include "i_system.h" #include "r_main.h" // For lighting constants #include "w_wad.h" @@ -55,6 +54,7 @@ #include "st_stuff.h" #include "gi.h" #include "x86.h" +#include "colormatcher.h" extern "C" { FDynamicColormap NormalLight; diff --git a/src/v_video.cpp b/src/v_video.cpp index 6045f4b954..955aa0606e 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -25,9 +25,7 @@ #include -#include "m_alloc.h" - -#include "i_system.h" +#include "i_system.h" #include "x86.h" #include "i_video.h" #include "r_local.h" @@ -63,6 +61,7 @@ #include "r_translate.h" #include "f_wipe.h" #include "m_png.h" +#include "colormatcher.h" IMPLEMENT_ABSTRACT_CLASS (DCanvas) IMPLEMENT_ABSTRACT_CLASS (DFrameBuffer) diff --git a/src/v_video.h b/src/v_video.h index 3d0d30c513..a84fc9c7d1 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -38,7 +38,6 @@ #include "v_palette.h" #include "v_font.h" -#include "colormatcher.h" #include "doomdef.h" @@ -397,8 +396,6 @@ private: }; -extern FColorMatcher ColorMatcher; - // This is the screen updated by I_FinishUpdate. extern DFrameBuffer *screen; diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 74189a44eb..06d9684a58 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -18,7 +18,6 @@ #include #include -#include "m_alloc.h" #include "doomtype.h" #include "m_argv.h" #include "i_system.h" diff --git a/src/weightedlist.h b/src/weightedlist.h index 0e4294e842..056a871f83 100644 --- a/src/weightedlist.h +++ b/src/weightedlist.h @@ -35,7 +35,8 @@ #include #include "doomtype.h" -#include "m_random.h" + +class FRandom; template class TWeightedList diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 0808cdbd5e..d51dc0429d 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -1263,11 +1263,7 @@ void WI_updateDeathmatchStats () if (acceleratestage) { S_Sound (CHAN_VOICE | CHAN_UI, "players/male/gibbed", 1, ATTN_NONE); - - if (gamemode == commercial) - WI_initNoState(); - else - WI_initShowNextLoc(); + WI_initShowNextLoc(); } } else if (dm_state & 1) diff --git a/src/wi_stuff.h b/src/wi_stuff.h index a3a0e07e91..266fe166cb 100644 --- a/src/wi_stuff.h +++ b/src/wi_stuff.h @@ -28,7 +28,7 @@ // INTERMISSION // Structure passed e.g. to WI_Start(wb) // -typedef struct wbplayerstruct_s +struct wbplayerstruct_t { bool in; // whether the player is in game @@ -40,9 +40,9 @@ typedef struct wbplayerstruct_s int frags[MAXPLAYERS]; int fragcount; // [RH] Cumulative frags for this player -} wbplayerstruct_t; +}; -typedef struct wbstartstruct_s +struct wbstartstruct_t { int finished_ep; int next_ep; @@ -68,8 +68,13 @@ typedef struct wbstartstruct_s // index of this player in game int pnum; - wbplayerstruct_s plyr[MAXPLAYERS]; -} wbstartstruct_t; + wbplayerstruct_t plyr[MAXPLAYERS]; +}; + +// Intermission stats. +// Parameters for world map / intermission. +extern wbstartstruct_t wminfo; + // Called by main loop, animate the intermission. void WI_Ticker (); diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index e41506da5e..aa61b8c444 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -66,6 +66,7 @@ #include "f_wipe.h" #include "st_stuff.h" #include "win32iface.h" +#include "doomstat.h" // MACROS ------------------------------------------------------------------ diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index bca4700fbc..06804006d7 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -44,6 +44,7 @@ #include "c_cvars.h" #include "c_dispatch.h" #include "v_text.h" +#include "doomstat.h" EXTERN_CVAR (Bool, ticker) EXTERN_CVAR (Bool, fullscreen) diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index debe7efbe5..cfc668b282 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -95,6 +95,8 @@ #include "gameconfigfile.h" #include "win32iface.h" #include "templates.h" +#include "cmdlib.h" +#include "d_event.h" #define DINPUT_BUFFERSIZE 32 diff --git a/src/win32/i_main.cpp b/src/win32/i_main.cpp index 7adef07793..f16dfcfd3f 100644 --- a/src/win32/i_main.cpp +++ b/src/win32/i_main.cpp @@ -46,7 +46,6 @@ #define NOTIFY_FOR_THIS_SESSION 0 #include -#include "m_alloc.h" #ifdef _MSC_VER #include #include @@ -71,9 +70,11 @@ #include "i_video.h" #include "i_sound.h" #include "i_input.h" -#include "autosegs.h" #include "w_wad.h" #include "templates.h" +#include "cmdlib.h" +#include "g_level.h" +#include "doomstat.h" #include "stats.h" #include "st_start.h" diff --git a/src/win32/i_system.cpp b/src/win32/i_system.cpp index 0612d901f0..d46467a4eb 100644 --- a/src/win32/i_system.cpp +++ b/src/win32/i_system.cpp @@ -64,6 +64,7 @@ #include "templates.h" #include "gameconfigfile.h" #include "v_font.h" +#include "g_level.h" #include "stats.h" diff --git a/src/win32/i_system.h b/src/win32/i_system.h index 32b757e426..0c53b3981c 100644 --- a/src/win32/i_system.h +++ b/src/win32/i_system.h @@ -23,9 +23,10 @@ #ifndef __I_SYSTEM__ #define __I_SYSTEM__ -#include "d_main.h" -#include "d_ticcmd.h" -#include "d_event.h" +#include "doomtype.h" + +struct ticcmd_t; +struct WadStuff; // Index values into the LanguageIDs array enum diff --git a/src/win32/st_start.cpp b/src/win32/st_start.cpp index bf44922dd2..d2f2d04162 100644 --- a/src/win32/st_start.cpp +++ b/src/win32/st_start.cpp @@ -51,7 +51,6 @@ #include "gi.h" #include "w_wad.h" #include "s_sound.h" -#include "m_alloc.h" // MACROS ------------------------------------------------------------------ diff --git a/src/win32/win32iface.h b/src/win32/win32iface.h index 6e1bd7f5fa..e3f9df5234 100644 --- a/src/win32/win32iface.h +++ b/src/win32/win32iface.h @@ -47,7 +47,6 @@ #include #include "hardware.h" -#include "v_video.h" #define SAFE_RELEASE(x) { if (x != NULL) { x->Release(); x = NULL; } } diff --git a/zdoom.vcproj b/zdoom.vcproj index a143100be4..223218810d 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - @@ -950,6 +940,16 @@ Outputs=""src/$(InputName).h"" /> + + + @@ -1106,6 +1106,10 @@ RelativePath=".\src\basicinlines.h" > + + @@ -1547,6 +1551,16 @@ Outputs="$(IntDir)\$(InputName).obj" /> + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + @@ -1789,14 +1801,6 @@ Outputs="$(IntDir)/$(InputName).obj" /> - - - @@ -1962,14 +1966,6 @@ Outputs="$(IntDir)\$(InputName).obj" /> - - - @@ -1980,6 +1976,14 @@ Outputs="$(IntDir)\$(InputName).obj" /> + + + - - - @@ -2866,6 +2862,14 @@ AdditionalIncludeDirectories="src\win32;$(NoInherit)" /> + + + @@ -3140,7 +3144,7 @@ />