Commits

Torr_Samaho  committed a749e50

Ported changes from ZDoom revision 1223-1229 and maintenance changes from GZDoom revision 179-180:
- fixed: For Chex Quest some CVars were initialized to Heretic's default.
- Cleaned up some include dependencies.
- More header cleanup.
- Changed compilation for g_doom, g_heretic, g_hexen and g_strife folders so that all files are included by a central one instead of compiling each one separately. This speeds up the compilation process by 25% when doing a complete rebuild in Visual C.
- Cleaned up more header dependencies.
- Moved some more high level sound logic out of FMODSoundRenderer: The rolloff and channel ended callbacks now call functions in s_sound.cpp instead of working on the data itself and GSnd->StopSound has been replaced with S_StopChannel.
- Separated low level sound code from all high level dependencies.
- fixed an uninitialized variable in sound code.

SVN r1967 (latestzdoom)

  • Participants
  • Parent commits 6da8706

Comments (0)

Files changed (369)

File docs/Skulltag Version History.txt

 latestzdoom branch
 ------
 
-*+	- Thoroughly updated Skulltag's ZDoom base to the latest ZDoom SVN repository revision (currently 1222). [Torr Samaho]
-*+	- Upgraded the GZDoom renderer to 1.1.04 (revision 127, maintenance fixes from up to revision 178)! [Torr Samaho]
+*+	- Thoroughly updated Skulltag's ZDoom base to the latest ZDoom SVN repository revision (currently 1229). [Torr Samaho]
+*+	- Upgraded the GZDoom renderer to 1.1.04 (revision 127, maintenance fixes from up to revision 180)! [Torr Samaho]
 *+	- Optimized the monster movement code. Under some circumstances this drastically decreases network traffic. Compare map09 of dr2008v2.zip to see an example, where a lot of bandwidth is saved. Special thanks to SuperGod for finding a way to reproduce the excessive net traffic. Without it, this problem would still silently be wasting net traffic. [Torr Samaho]
 +	- Added new actor flag PUFFGETSOWNER to flags5. If selected, the owner of the puff is set to the player who fired it. [Torr Samaho]
 +	- Converted BFG10K, GrenadeLauncher, RandomPowerup, TeamItem, Flag, Skull, WhiteFlag, FloatyIcon, PathNode, ReturnZone, SpringPadZone, Hissy, MaxHealth, RuneGiver, RedArmor, PowerTerminatorArtifact, PowerPossessionArtifact, various invasion spawner base classes and various Rune classes to DECORATE. [Torr Samaho]

File src/CMakeLists.txt

 	x86.cpp
 	zstrformat.cpp
 	zstring.cpp
-	#fragglescript/t_cmd.cpp
-	#fragglescript/t_fspic.cpp
-	#fragglescript/t_func.cpp
-	#fragglescript/t_load.cpp
-	#fragglescript/t_oper.cpp
-	#fragglescript/t_parse.cpp
-	#fragglescript/t_prepro.cpp
-	#fragglescript/t_script.cpp
-	#fragglescript/t_spec.cpp
-	#fragglescript/t_variable.cpp
-	g_doom/a_arachnotron.cpp
-	g_doom/a_archvile.cpp
-	g_doom/a_bossbrain.cpp
-	g_doom/a_bruiser.cpp
-	g_doom/a_cacodemon.cpp
-	g_doom/a_cyberdemon.cpp
-	g_doom/a_demon.cpp
 	g_doom/a_doomarmor.cpp #ST
 	g_doom/a_doomartifacts.cpp #ST
-	g_doom/a_doomimp.cpp
 	g_doom/a_doommisc.cpp
-	g_doom/a_doomweaps.cpp
-	g_doom/a_fatso.cpp
-	g_doom/a_keen.cpp
-	g_doom/a_lostsoul.cpp
-	g_doom/a_painelemental.cpp
-	g_doom/a_possessed.cpp
-	g_doom/a_revenant.cpp
-	g_doom/a_scriptedmarine.cpp
-	g_doom/a_spidermaster.cpp
 	g_doom/doom_sbar.cpp
-	g_heretic/a_chicken.cpp
-	g_heretic/a_dsparil.cpp
-	g_heretic/a_hereticartifacts.cpp
-	g_heretic/a_hereticimp.cpp
 	g_heretic/a_hereticmisc.cpp
-	g_heretic/a_hereticweaps.cpp
-	g_heretic/a_ironlich.cpp
-	g_heretic/a_knight.cpp
-	g_heretic/a_wizard.cpp
 	g_heretic/heretic_sbar.cpp
-	g_hexen/a_bats.cpp
-	g_hexen/a_bishop.cpp
-	g_hexen/a_blastradius.cpp
-	g_hexen/a_boostarmor.cpp
-	g_hexen/a_centaur.cpp
-	g_hexen/a_clericflame.cpp
-	g_hexen/a_clericholy.cpp
-	g_hexen/a_clericmace.cpp
-	g_hexen/a_clericstaff.cpp
-	g_hexen/a_dragon.cpp
-	g_hexen/a_fighteraxe.cpp
-	g_hexen/a_fighterhammer.cpp
-	g_hexen/a_fighterplayer.cpp
-	g_hexen/a_fighterquietus.cpp
-	g_hexen/a_firedemon.cpp
-	g_hexen/a_flechette.cpp
-	g_hexen/a_fog.cpp
-	g_hexen/a_healingradius.cpp
-	g_hexen/a_heresiarch.cpp
-	g_hexen/a_hexenspecialdecs.cpp
-	g_hexen/a_iceguy.cpp
-	g_hexen/a_korax.cpp
-	g_hexen/a_magecone.cpp
-	g_hexen/a_magelightning.cpp
-	g_hexen/a_magestaff.cpp
-	g_hexen/a_magewand.cpp
-	g_hexen/a_pig.cpp
-	g_hexen/a_serpent.cpp
-	g_hexen/a_spike.cpp
-	g_hexen/a_summon.cpp
-	g_hexen/a_teleportother.cpp
-	g_hexen/a_wraith.cpp
+	g_hexen/a_hexenmisc.cpp
 	g_hexen/hexen_sbar.cpp
 	g_raven/a_artitele.cpp
 	g_raven/a_minotaur.cpp
-	g_strife/a_acolyte.cpp
-	g_strife/a_alienspectres.cpp
-	g_strife/a_coin.cpp
-	g_strife/a_crusader.cpp
-	g_strife/a_entityboss.cpp
-	g_strife/a_inquisitor.cpp
-	g_strife/a_loremaster.cpp
-	g_strife/a_macil.cpp
-	g_strife/a_oracle.cpp
-	g_strife/a_programmer.cpp
-	g_strife/a_reaver.cpp
-	g_strife/a_rebels.cpp
-	g_strife/a_sentinel.cpp
-	g_strife/a_spectral.cpp
-	g_strife/a_stalker.cpp
-	g_strife/a_strifeitems.cpp
 	g_strife/a_strifestuff.cpp
-	g_strife/a_strifeweapons.cpp
-	g_strife/a_templar.cpp
-	g_strife/a_thingstoblowup.cpp
 	g_strife/strife_sbar.cpp
 	g_shared/a_action.cpp
 	g_shared/a_armor.cpp
 
 // 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.

File src/am_map.cpp

 #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"
+#include "d_netinf.h"
 
 // Needs access to LFB.
 #include "v_video.h"
+#include "v_palette.h"
 
 #include "v_text.h"
 

File src/am_map.h

 #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);

File src/announcer.cpp

 #include "c_cvars.h"
 #include "c_dispatch.h"
 #include "cmdlib.h"
+#include "doomstat.h"
 #include "d_player.h"
 #include "deathmatch.h"
 #include "doomtype.h"

File src/astar.cpp

 #include <stdlib.h>
 
 #include "astar.h"
+#include "doomstat.h"
 #include "gi.h"
 #include "m_random.h"
 #include "p_lnspec.h"

File src/basictypes.h

+#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 <stdint.h>
+
+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
+
+// [BC] New additions.
+typedef	unsigned short			USHORT;
+typedef	short					SHORT;
+#ifdef __WINE__
+typedef unsigned int ULONG;
+typedef int LONG;
+#else
+typedef	unsigned long			ULONG;
+typedef	long					LONG;
+#endif
+typedef unsigned int			UINT;
+typedef	int						INT;
+
+// 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<<FRACBITS)
+
+typedef SDWORD							fixed_t;
+typedef DWORD							dsfixed_t;				// fixedpt used by span drawer
+
+#define FIXED_MAX						(signed)(0x7fffffff)
+#define FIXED_MIN						(signed)(0x80000000)
+
+#define DWORD_MIN						((uint32)0)
+#define DWORD_MAX						((uint32)0xffffffff)
+
+
+#ifdef __GNUC__
+#define GCCPRINTF(stri,firstargi)		__attribute__((format(printf,stri,firstargi)))
+#define GCCFORMAT(stri)					__attribute__((format(printf,stri,0)))
+#define GCCNOWARN						__attribute__((unused))
+#else
+#define GCCPRINTF(a,b)
+#define GCCFORMAT(a)
+#define GCCNOWARN
+#endif
+
+
+#endif

File src/botcommands.cpp

 #include "cmdlib.h"
 #include "cooperative.h"
 #include "deathmatch.h"
+#include "doomstat.h"
 #include "duel.h"
 #include "g_game.h"
+#include "g_level.h"
 #include "gamemode.h"
 #include "gi.h"
 #include "joinqueue.h"

File src/bots.cpp

 #include "deathmatch.h"
 #include "doomdef.h"
 #include "doomstat.h"
+#include "d_event.h"
 #include "d_netinf.h"
 #include "g_game.h"
+#include "g_level.h"
 #include "gi.h"
 #include "i_system.h"
 #include "joinqueue.h"

File src/c_bind.cpp

 #include "gi.h"
 #include "configfile.h"
 #include "i_system.h"
+#include "d_event.h"
 // [BC] New #includes.
 #include "chat.h"
 #include "p_local.h"

File src/c_bind.h

 #ifndef __C_BINDINGS_H__
 #define __C_BINDINGS_H__
 
-#include "doomtype.h"
-#include "d_event.h"
-#include <stdio.h>
 
+struct event_t;
 class FConfigFile;
 
 bool C_DoKey (event_t *ev);

File src/c_cmds.cpp

 #include "p_local.h"
 #include "r_sky.h"
 #include "p_setup.h"
+#include "cmdlib.h"
+#include "d_net.h"
 // [BC] New #includes.
 #include "deathmatch.h"
 #include "cl_demo.h"

File src/c_console.cpp

 **
 */
 
-#include "m_alloc.h"
 #include "templates.h"
 #include "p_setup.h"
 #include <stdarg.h>
 #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"
 // [BC] New #includes.
 #include "chat.h"
 #include "cl_demo.h"

File src/c_console.h

 #ifndef __C_CONSOLE__
 #define __C_CONSOLE__
 
-#include <stdio.h>
 #include <stdarg.h>
+#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;
 

File src/c_cvars.cpp

 #include "configfile.h"
 #include "c_console.h"
 #include "c_dispatch.h"
-#include "m_alloc.h"
 
 #include "doomstat.h"
 #include "c_cvars.h"
 #include "i_system.h"
 #include "v_palette.h"
 #include "v_video.h"
+#include "colormatcher.h"
+// [BB] New #includes.
 #include "v_text.h"
 #include "deathmatch.h"
 #include "duel.h"

File src/c_dispatch.cpp

 #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"
 // [BC] new #includes.
 #include "p_local.h"
 #include "p_acs.h"

File src/c_dispatch.h

 #ifndef __C_DISPATCH_H__
 #define __C_DISPATCH_H__
 
-#include "dobject.h"
+#include "doomtype.h"
 
 class FConfigFile;
 class APlayerPawn;

File src/callvote.cpp

 #include "cl_demo.h"
 #include "cl_main.h"
 #include "callvote.h"
+#include "doomstat.h"
 #include "network.h"
 #include "templates.h"
 #include "sbar.h"

File src/campaign.cpp

 #include "campaign.h"
 #include "cl_demo.h"
 #include "deathmatch.h"
+#include "doomstat.h"
 #include "i_system.h"
 #include "network.h"
 #include "sc_man.h"

File src/chat.cpp

 #include "cl_commands.h"
 #include "cl_main.h"
 #include "chat.h"
+#include "doomstat.h"
 #include "d_gui.h"
+#include "d_net.h"
 #include "deathmatch.h"
 #include "gi.h"
 #include "gamemode.h"

File src/cl_commands.cpp

 #include "cl_commands.h"
 #include "cl_demo.h"
 #include "cl_main.h"
+#include "doomstat.h"
+#include "d_event.h"
 #include "gi.h"
 #include "network.h"
 #include "r_state.h"

File src/cl_demo.cpp

 #include "cl_demo.h"
 #include "cl_main.h"
 #include "cmdlib.h"
+#include "d_event.h"
 #include "d_netinf.h"
 #include "d_protocol.h"
+#include "doomstat.h"
 #include "doomtype.h"
 #include "i_system.h"
 #include "m_misc.h"

File src/cl_main.cpp

 #include "p_acs.h"
 #include "p_enemy.h"
 #include "survival.h"
+#include "v_palette.h"
 #include "v_video.h"
 #include "w_wad.h"
 #include "deathmatch.h"

File src/cmdlib.cpp

 #include <sys/stat.h>
 #include <time.h>
 
-#include "m_alloc.h"
-
 /*
 progdir will hold the path up to the game directory, including the slash
 

File src/cmdlib.h

 #endif
 
 #include "doomtype.h"
-#include "zstring.h"
 
 #include <stdio.h>
 #include <string.h>

File src/colormatcher.h

 	const PalEntry *Pal;
 };
 
+extern FColorMatcher ColorMatcher;
+
+
 #endif //__COLORMATCHER_H__

File src/d_dehacked.cpp

 #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"
 #include "v_palette.h"
 #include "a_sharedglobal.h"
 #include "thingdef/thingdef.h"
-#include "dobject.h"
 #include "r_translate.h"
 // [BC] New #includes.
 #include "cl_demo.h"

File src/d_event.h

 #define __D_EVENT_H__
 
 
-#include "doomtype.h"
+#include "basictypes.h"
 
 
 //

File src/d_main.cpp

 #include "doomerrors.h"
 
 #include "d_gui.h"
-#include "m_alloc.h"
 #include "m_random.h"
 #include "doomdef.h"
 #include "doomstat.h"
 #include "v_text.h"
 #include "gi.h"
 #include "stats.h"
-#include "a_doomglobal.h"
 #include "gameconfigfile.h"
 #include "sbar.h"
 #include "decallib.h"
 #include "teaminfo.h"
 #include "hardware.h"
 #include "sbarinfo.h"
+#include "d_net.h"
+#include "g_level.h"
+#include "d_event.h"
+#include "d_netinf.h"
+#include "v_palette.h"
 
 #include "win32/g15/g15.h"
 EXTERN_CVAR(Bool, hud_althud)

File src/d_main.h

 #ifndef __D_MAIN__
 #define __D_MAIN__
 
-#include "d_event.h"
+#include "doomtype.h"
+
+struct event_t;
 
 //
 // D_DoomMain()

File src/d_net.cpp

 #include <stddef.h>
 
 #include "version.h"
-#include "m_alloc.h"
 #include "m_menu.h"
 #include "m_random.h"
 #include "i_system.h"
 #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"
 #include "st_start.h"
 #include "teaminfo.h"
 #include "p_conversation.h"
+#include "g_level.h"
+#include "d_event.h"
+#include "m_argv.h"
 // [BC] New #includes.
 #include "cl_demo.h"
 #include "cooperative.h"
 #define __D_NET__
 
 #include "doomtype.h"
+#include "doomdef.h"
+#include "d_ticcmd.h"
 
 
 //
 
 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

File src/d_netinf.h

 
 EXTERN_CVAR (Float, autoaim)
 
-// [BC] Allow longer names since we can now colorize them and stuff.
-#define MAXPLAYERNAME	31
-
-enum
-{
-	GENDER_MALE,
-	GENDER_FEMALE,
-	GENDER_NEUTER
-};
-
 int D_GenderToInt (const char *gender);
 extern const char *GenderNames[3];
 
 int D_PlayerClassToInt (const char *classname);
 
-struct userinfo_s
-{
-	char		netname[MAXPLAYERNAME+1];
-	BYTE		team;
-	int			aimdist;
-	int			color;
-	int			skin;
-	int			gender;
-	int			switchonpickup;
-	fixed_t		MoveBob, StillBob;
-	int			PlayerClass;
-
-	// [BC] New Skulltag userinfo settings.
-	LONG		lRailgunTrailColor;
-	LONG		lHandicap;
-};
-typedef struct userinfo_s userinfo_t;
-
-FArchive &operator<< (FArchive &arc, userinfo_t &info);
-
 void D_SetupUserInfo (void);
 
 void D_UserInfoChanged (FBaseCVar *info);

File src/d_player.h

 
 #define WP_NOCHANGE ((AWeapon*)~0)
 
+
+// [BC] Allow longer names since we can now colorize them and stuff.
+#define MAXPLAYERNAME	31
+
+enum
+{
+	GENDER_MALE,
+	GENDER_FEMALE,
+	GENDER_NEUTER
+};
+
+struct userinfo_t
+{
+	char		netname[MAXPLAYERNAME+1];
+	BYTE		team;
+	int			aimdist;
+	int			color;
+	int			skin;
+	int			gender;
+	int			switchonpickup;
+	fixed_t		MoveBob, StillBob;
+	int			PlayerClass;
+
+	// [BC] New Skulltag userinfo settings.
+	LONG		lRailgunTrailColor;
+	LONG		lHandicap;
+};
+
+FArchive &operator<< (FArchive &arc, userinfo_t &info);
+
+
 //
 // Extended player object info: player_t
 //

File src/d_protocol.cpp

 **
 */
 
-#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)
 	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];

File src/d_protocol.h

 #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.
 };
 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

File src/d_ticcmd.h

 #ifndef __D_TICCMD_H__
 #define __D_TICCMD_H__
 
-#include "doomtype.h"
 #include "d_protocol.h"
 
 // The data sampled per tick (single player)
 };
 
 
-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__

File src/deathmatch.cpp

 #include "cl_main.h"
 #include "cooperative.h"
 #include "deathmatch.h"
+#include "doomstat.h"
 #include "g_game.h"
 #include "gamemode.h"
 #include "network.h"

File src/decallib.cpp

 #include "a_sharedglobal.h"
 #include "r_translate.h"
 #include "gi.h"
+#include "g_level.h"
+#include "colormatcher.h"
 // [BC] New #includes.
 #include "g_game.h"
 

File src/decallib.h

 #include <string.h>
 
 #include "doomtype.h"
-#include "tarray.h"
-#include "name.h"
-#include "actor.h"
+#include "r_blend.h"
+#include "textures/textures.h"
 
 class FScanner;
 class FDecalTemplate;

File src/dobject.cpp

 #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.
 #include "a_sharedglobal.h"
 #include "dsectoreffect.h"
 
-#include "autosegs.h"
-
 PClass DObject::_StaticType;
 ClassReg DObject::RegistrationInfo =
 {

File src/dobject.h

 #define __DOBJECT_H__
 
 #include <stdlib.h>
-#include "tarray.h"
 #include "doomtype.h"
-#include "m_alloc.h"
 #ifndef _MSC_VER
 #include "autosegs.h"
 #endif

File src/dobjgc.cpp

 #include "p_acs.h"
 #include "s_sndseq.h"
 #include "r_interpolate.h"
+#include "doomstat.h"
+#include "m_argv.h"
 
 // MACROS ------------------------------------------------------------------
 

File src/dobjtype.cpp

 #include "dobject.h"
 #include "i_system.h"
 #include "actor.h"
+#include "templates.h"
 #include "autosegs.h"
-#include "templates.h"
 
 TArray<PClass *> PClass::m_RuntimeActors;
 TArray<PClass *> PClass::m_Types;

File src/domination.cpp

 #include "doomtype.h"
 #include "doomstat.h"
 #include "v_font.h"
+#include "v_palette.h"
 #include "v_video.h"
 #include "v_text.h"
 #include "chat.h"

File src/doomdata.h

 
 // Some global defines, that configure the game.
 #include "doomdef.h"
-#include "m_swap.h"
-
-
 
 //
 // Map level types.
 	STF_ALTSHADOW		= 0x0200,
 };
 
+// Player spawn spots for deathmatch.
+extern TArray<FMapThing> deathmatchstarts;
+
+// [BC] Temporary team spawn spots.
+extern	TArray<FMapThing>	TemporaryTeamStarts;
+
+// [RC] Possession starts
+extern	TArray<FMapThing>	PossessionStarts;
+
+// [RC] Terminator starts
+extern	TArray<FMapThing>	TerminatorStarts;
+
+// [BC] Generic invasion spawn spots.
+extern	TArray<FMapThing>	GenericInvasionStarts;
+
+// Player spawn spots.
+extern	FMapThing		playerstarts[MAXPLAYERS];
+
 
 #endif					// __DOOMDATA__

File src/doomdef.h

 	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;
 

File src/doomstat.cpp

 #include "i_system.h"
 #include "g_level.h"
 #include "p_local.h"
-#include "p_acs.h"
 
 int SaveVersion;
 
 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)

File src/doomstat.h

 #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"
 
 // -----------------------
 // -----------------------------------------------------
 // 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.
 
 // [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.
 // Quit after playing a demo from cmdline.
 extern	bool			singledemo; 	
 
-
-
-
-extern	gamestate_t 	gamestate;
-
 extern	int				SaveVersion;
 
 
 
 
 // Alive? Disconnected?
-extern	bool	 		playeringame[MAXPLAYERS];
-
-
-// Player spawn spots for deathmatch.
-extern TArray<FMapThing> deathmatchstarts;
-
-// [BC] Temporary team spawn spots.
-extern	TArray<FMapThing>	TemporaryTeamStarts;
-
-// [RC] Possession starts
-extern	TArray<FMapThing>	PossessionStarts;
-
-// [RC] Terminator starts
-extern	TArray<FMapThing>	TerminatorStarts;
-
-// [BC] Generic invasion spawn spots.
-extern	TArray<FMapThing>	GenericInvasionStarts;
-
-// Player spawn spots.
-extern	FMapThing		playerstarts[MAXPLAYERS];
-
-// Intermission stats.
-// Parameters for world map / intermission.
-extern	struct wbstartstruct_s wminfo; 
-
-
-
-
-
+extern	bool	 		playeringame[/*MAXPLAYERS*/];
 
 
 //-----------------------------------------
 //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;
 
 
 
 
-// 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)
 

File src/doomtype.h

 #endif
 
 #include <limits.h>
+#include "tarray.h"
+#include "name.h"
 #include "zstring.h"
-#include "name.h"
 #include "vectors.h"
 
 // Since this file is included by everything, it seems an appropriate place
 #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 <stdint.h>
+#include "basictypes.h"
 
-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
-
-// [BC] New additions.
-typedef	unsigned short			USHORT;
-typedef	short					SHORT;
-#ifdef __WINE__
-typedef unsigned int ULONG;
-typedef int LONG;
-#else
-typedef	unsigned long			ULONG;
-typedef	long					LONG;
-#endif
-typedef unsigned int			UINT;
-typedef	int						INT;
-
-// 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
-	};
-};
 
 // Bounding box coordinate storage.
 enum
 };		// bbox coordinates
 
 
-//
-// Fixed point, 32bit as 16.16.
-//
-#define FRACBITS						16
-#define FRACUNIT						(1<<FRACBITS)
-
-typedef SDWORD							fixed_t;
-typedef DWORD							dsfixed_t;				// fixedpt used by span drawer
-
-#define FIXED_MAX						(signed)(0x7fffffff)
-#define FIXED_MIN						(signed)(0x80000000)
-
-#define DWORD_MIN						((uint32)0)
-#define DWORD_MAX						((uint32)0xffffffff)
-
-
-#ifdef __GNUC__
-#define GCCPRINTF(stri,firstargi)		__attribute__((format(printf,stri,firstargi)))
-#define GCCFORMAT(stri)					__attribute__((format(printf,stri,0)))
-#define GCCNOWARN						__attribute__((unused))
-#else
-#define GCCPRINTF(a,b)
-#define GCCFORMAT(a)
-#define GCCNOWARN
-#endif
-
-
 // [RH] This gets used all over; define it here:
 int STACK_ARGS Printf (int printlevel, const char *, ...) GCCPRINTF(2,3);
 int STACK_ARGS Printf (const char *, ...) GCCPRINTF(1,2);

File src/dsectoreffect.h

 #ifndef __DSECTOREFFECT_H__
 #define __DSECTOREFFECT_H__
 
-#include "dobject.h"
 #include "dthinker.h"
 #include "r_defs.h"
 

File src/dthinker.cpp

 #include "statnums.h"
 #include "i_system.h"
 #include "doomerrors.h"
+// [BB] New #includes.
 #include "cl_demo.h"
+#include "doomstat.h"
 
 
 static cycle_t ThinkCycles;

File src/duel.cpp

 #include "cl_demo.h"
 #include "cl_main.h"
 #include "deathmatch.h"
+#include "doomstat.h"
 #include "duel.h"
 #include "g_game.h"
+#include "g_level.h"
 #include "gstrings.h"
 #include "network.h"
 #include "p_effect.h"

File src/f_finale.cpp

 #include "templates.h"
 #include "c_bind.h"
 #include "r_translate.h"
+#include "g_level.h"
+#include "d_event.h"
+#include "v_palette.h"
+// [BB] New #includes.
 #include "network.h"
 
 static void FadePic ();

File src/f_finale.h

 #ifndef __F_FINALE__
 #define __F_FINALE__
 
-#include "doomtype.h"
-#include "d_event.h"
+#include "basictypes.h"
+
+struct event_t;
+
+
 //
 // FINALE
 //

File src/f_wipe.cpp

 #include "i_video.h"
 #include "v_video.h"
 #include "m_random.h"
-#include "m_alloc.h"
 #include "doomdef.h"
 #include "f_wipe.h"
 #include "c_cvars.h"

File src/farchive.cpp

 
 #include "doomtype.h"
 #include "farchive.h"
-#include "m_alloc.h"
 #include "m_swap.h"
 #include "m_crc32.h"
 #include "cmdlib.h"

File src/farchive.h

 #define __FARCHIVE_H__
 
 #include <stdio.h>
-#include "doomtype.h"
 #include "dobject.h"
-#include "tarray.h"
-#include "name.h"
 
 class FFile
 {
 	return arc << p.a << p.r << p.g << p.b;
 }
 
-#include "dobject.h"
-
 template<class T>
 inline FArchive &operator<< (FArchive &arc, T* &object)
 {
 
 FArchive &operator<< (FArchive &arc, const PClass * &info);
 
+class FFont;
+FArchive &SerializeFFontPtr (FArchive &arc, FFont* &font);
+template<> inline FArchive &operator<< <FFont> (FArchive &arc, FFont* &font)
+{
+	return SerializeFFontPtr (arc, font);
+}
+
+
 template<class T,class TT>
 inline FArchive &operator<< (FArchive &arc, TArray<T,TT> &self)
 {

File src/g_doom/a_arachnotron.cpp

+/*
 #include "actor.h"
 #include "s_sound.h"
 #include "p_local.h"
 #include "p_enemy.h"
-#include "a_doomglobal.h"
 #include "a_action.h"
 #include "thingdef/thingdef.h"
+*/
 
 DEFINE_ACTION_FUNCTION(AActor, A_BspiAttack)
 {		

File src/g_doom/a_archvile.cpp

+/*
 #include "actor.h"
 #include "info.h"
 #include "p_local.h"
 #include "s_sound.h"
 #include "p_enemy.h"
-#include "a_doomglobal.h"
 #include "gstrings.h"
 #include "a_action.h"
 #include "thingdef/thingdef.h"
-// [BB] New #includes.
-#include "cl_demo.h"
+*/
 
 //
 // PIT_VileCheck

File src/g_doom/a_bossbrain.cpp

+/*
 #include "actor.h"
 #include "info.h"
 #include "m_random.h"
 #include "p_local.h"
 #include "p_enemy.h"
 #include "s_sound.h"
-#include "a_doomglobal.h"
 #include "statnums.h"
 #include "a_specialspot.h"
 #include "thingdef/thingdef.h"
-// [BB] New #includes.
-#include "cl_demo.h"
-#include "deathmatch.h"
-#include "team.h"
+#include "doomstat.h"
+#include "g_level.h"
+*/
 
 static FRandom pr_brainscream ("BrainScream");
 static FRandom pr_brainexplode ("BrainExplode");

File src/g_doom/a_bruiser.cpp

-#include "actor.h"
-#include "info.h"
-#include "m_random.h"
-#include "s_sound.h"
-#include "p_local.h"
-#include "p_enemy.h"
-#include "doomstat.h"
-#include "gstrings.h"
-#include "a_action.h"
-#include "thingdef/thingdef.h"
-// [BB] New #includes.
-#include "sv_commands.h"
-#include "network.h"
+
 
 static FRandom pr_bruisattack ("BruisAttack");
 

File src/g_doom/a_cacodemon.cpp

+/*
 #include "actor.h"
 #include "info.h"
 #include "m_random.h"
 #include "a_action.h"
 #include "s_sound.h"
 #include "thingdef/thingdef.h"
-// [BB] New #includes.
-#include "deathmatch.h"
-#include "sv_commands.h"
-#include "network.h"
+*/
 
 static FRandom pr_headattack ("HeadAttack");
 

File src/g_doom/a_cyberdemon.cpp

+/*
 #include "actor.h"
 #include "p_local.h"
 #include "s_sound.h"
 #include "p_enemy.h"
-#include "a_doomglobal.h"
 #include "a_action.h"
 #include "thingdef/thingdef.h"
+*/
 
 DEFINE_ACTION_FUNCTION(AActor, A_CyberAttack)
 {

File src/g_doom/a_demon.cpp

+/*
 #include "actor.h"
 #include "info.h"
 #include "m_random.h"
 #include "gstrings.h"
 #include "a_action.h"
 #include "thingdef/thingdef.h"
+*/
 
 static FRandom pr_sargattack ("SargAttack");
 

File src/g_doom/a_doomartifacts.cpp

 #include "info.h"
 #include "a_pickups.h"
+#include "doomstat.h"
 #include "d_player.h"
 #include "p_local.h"
 #include "gi.h"

File src/g_doom/a_doomglobal.h

 #ifndef __A_DOOMGLOBAL_H__
 #define __A_DOOMGLOBAL_H__
 
-#include "dobject.h"
 #include "info.h"
-#include "d_player.h"
 // [BB] New #includes.
 #include "gstrings.h"
 #include "network.h"

File src/g_doom/a_doomimp.cpp

+/*
 #include "actor.h"
 #include "info.h"
 #include "m_random.h"
 #include "gstrings.h"
 #include "a_action.h"
 #include "thingdef/thingdef.h"
-// [BB] New #includes.
-#include "sv_commands.h"
-#include "network.h"
+*/
 
 static FRandom pr_troopattack ("TroopAttack");
 

File src/g_doom/a_doommisc.cpp

 #include "actor.h"
 #include "info.h"
-#include "p_enemy.h"
 #include "p_local.h"
-#include "a_doomglobal.h"
 #include "a_sharedglobal.h"
 #include "m_random.h"
 #include "gi.h"
 #include "doomstat.h"
 #include "gstrings.h"
 #include "thingdef/thingdef.h"
+#include "g_level.h"
+#include "p_enemy.h"
+#include "a_doomglobal.h"
+#include "a_specialspot.h"
+#include "templates.h"
+#include "m_bbox.h"
 // [BC] New #includes.
 #include "cl_demo.h"
 #include "gamemode.h"
 #include "deathmatch.h"
+#include "team.h"
+
+// Include all the other Doom stuff here to reduce compile time
+#include "a_arachnotron.cpp"
+#include "a_archvile.cpp"
+#include "a_bossbrain.cpp"
+#include "a_bruiser.cpp"
+#include "a_cacodemon.cpp"