From 163301dcd5b7e83a6ce1a1751a8430b352fef933 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 6 Jul 2011 14:20:54 +0000 Subject: [PATCH] - took all includes of farchive.h out of headers. This file will have to be included explicitly in each source file that needs it. SVN r3259 (trunk) --- src/am_map.cpp | 1 + src/b_bot.cpp | 1 + src/c_dispatch.cpp | 1 + src/d_dehacked.cpp | 1 + src/d_netinfo.cpp | 2 + src/d_player.h | 5 +-- src/decallib.cpp | 1 + src/dobject.cpp | 1 + src/dsectoreffect.cpp | 1 + src/dthinker.cpp | 1 + src/farchive.cpp | 25 ++++++++++++ src/farchive.h | 14 +++++++ src/fragglescript/t_func.cpp | 1 + src/fragglescript/t_script.cpp | 1 + src/g_doom/a_doommisc.cpp | 1 + src/g_heretic/a_hereticmisc.cpp | 1 + src/g_hexen/a_hexenmisc.cpp | 1 + src/g_level.cpp | 1 + src/g_raven/a_minotaur.cpp | 1 + src/g_shared/a_action.cpp | 1 + src/g_shared/a_armor.cpp | 1 + src/g_shared/a_artifacts.cpp | 1 + src/g_shared/a_camera.cpp | 1 + src/g_shared/a_decals.cpp | 1 + src/g_shared/a_flashfader.cpp | 1 + src/g_shared/a_lightning.cpp | 2 + src/g_shared/a_morph.cpp | 1 + src/g_shared/a_movingcamera.cpp | 1 + src/g_shared/a_pickups.cpp | 1 + src/g_shared/a_puzzleitems.cpp | 1 + src/g_shared/a_quake.cpp | 1 + src/g_shared/a_skies.cpp | 1 + src/g_shared/a_specialspot.cpp | 1 + src/g_shared/a_weapons.cpp | 1 + src/g_shared/hudmessages.cpp | 1 + src/g_shared/shared_sbar.cpp | 1 + src/g_strife/a_strifestuff.cpp | 3 +- src/p_acs.cpp | 9 +++++ src/p_acs.h | 9 ----- src/p_ceiling.cpp | 15 +++++++ src/p_doors.cpp | 9 +++++ src/p_floor.cpp | 23 +++++++++++ src/p_lights.cpp | 1 + src/p_mobj.cpp | 1 + src/p_pillar.cpp | 9 +++++ src/p_plats.cpp | 16 ++++++++ src/p_pspr.cpp | 2 + src/p_saveg.cpp | 6 +++ src/p_sectors.cpp | 11 ++++++ src/p_spec.cpp | 17 ++++++++ src/p_spec.h | 70 --------------------------------- src/p_switch.cpp | 1 + src/p_udmf.cpp | 1 + src/p_user.cpp | 6 +++ src/po_man.cpp | 11 ++++++ src/po_man.h | 12 +----- src/r_data/r_interpolate.cpp | 1 + src/r_data/r_translate.cpp | 1 + src/r_defs.h | 14 ++----- src/r_main.cpp | 1 + src/r_state.h | 35 +---------------- src/s_advsound.cpp | 1 + src/s_sndseq.cpp | 1 + src/s_sound.cpp | 1 + src/statistics.cpp | 1 + src/textures/anim_switches.cpp | 2 + src/textures/animations.cpp | 1 + 67 files changed, 232 insertions(+), 138 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index a411fb570..026fec2e8 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -39,6 +39,7 @@ #include "r_bsp.h" #include "p_setup.h" #include "c_bind.h" +#include "farchive.h" #include "m_cheat.h" #include "i_system.h" diff --git a/src/b_bot.cpp b/src/b_bot.cpp index eaa71c0e1..f5235e1cc 100644 --- a/src/b_bot.cpp +++ b/src/b_bot.cpp @@ -12,6 +12,7 @@ #include "cmdlib.h" #include "teaminfo.h" #include "d_net.h" +#include "farchive.h" CVAR (Int, bot_next_color, 11, 0) CVAR (Bool, bot_observer, false, 0) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 1a2b31588..83c6ae37d 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -53,6 +53,7 @@ #include "v_text.h" #include "d_net.h" #include "d_main.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------ diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 931c656cf..16dc5b516 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -71,6 +71,7 @@ #include "i_system.h" #include "doomerrors.h" #include "p_effect.h" +#include "farchive.h" // [SO] Just the way Randy said to do it :) // [RH] Made this CVAR_SERVERINFO diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 45ae686c6..a05500169 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -43,6 +43,7 @@ #include "d_netinf.h" #include "d_net.h" #include "d_protocol.h" +#include "d_player.h" #include "c_dispatch.h" #include "v_palette.h" #include "v_video.h" @@ -55,6 +56,7 @@ #include "r_data/r_translate.h" #include "templates.h" #include "cmdlib.h" +#include "farchive.h" static FRandom pr_pickteam ("PickRandomTeam"); diff --git a/src/d_player.h b/src/d_player.h index 74a3b8a24..d3f2feb95 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -413,10 +413,7 @@ public: // Bookkeeping on players - state. extern player_t players[MAXPLAYERS]; -inline FArchive &operator<< (FArchive &arc, player_t *&p) -{ - return arc.SerializePointer (players, (BYTE **)&p, sizeof(*players)); -} +FArchive &operator<< (FArchive &arc, player_t *&p); void P_CheckPlayerSprites(); diff --git a/src/decallib.cpp b/src/decallib.cpp index 2ebc35577..f4af8dc1f 100644 --- a/src/decallib.cpp +++ b/src/decallib.cpp @@ -48,6 +48,7 @@ #include "g_level.h" #include "colormatcher.h" #include "b_bot.h" +#include "farchive.h" FDecalLib DecalLibrary; diff --git a/src/dobject.cpp b/src/dobject.cpp index 0440b7694..9f749aeaa 100644 --- a/src/dobject.cpp +++ b/src/dobject.cpp @@ -47,6 +47,7 @@ #include "stats.h" #include "a_sharedglobal.h" #include "dsectoreffect.h" +#include "farchive.h" PClass DObject::_StaticType; ClassReg DObject::RegistrationInfo = diff --git a/src/dsectoreffect.cpp b/src/dsectoreffect.cpp index d678ac379..e474bb841 100644 --- a/src/dsectoreffect.cpp +++ b/src/dsectoreffect.cpp @@ -28,6 +28,7 @@ #include "p_3dmidtex.h" #include "r_data/r_interpolate.h" #include "statnums.h" +#include "farchive.h" IMPLEMENT_CLASS (DSectorEffect) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index 3074aca99..a4f4db27e 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -38,6 +38,7 @@ #include "statnums.h" #include "i_system.h" #include "doomerrors.h" +#include "farchive.h" static cycle_t ThinkCycles; diff --git a/src/farchive.cpp b/src/farchive.cpp index 6b9ba2790..42e1105fc 100644 --- a/src/farchive.cpp +++ b/src/farchive.cpp @@ -1539,3 +1539,28 @@ FArchive &operator<< (FArchive &arc, const PClass * &info) } return arc; } + +FArchive &operator<< (FArchive &arc, sector_t *&sec) +{ + return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors)); +} + +FArchive &operator<< (FArchive &arc, const sector_t *&sec) +{ + return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors)); +} + +FArchive &operator<< (FArchive &arc, line_t *&line) +{ + return arc.SerializePointer (lines, (BYTE **)&line, sizeof(*lines)); +} + +FArchive &operator<< (FArchive &arc, vertex_t *&vert) +{ + return arc.SerializePointer (vertexes, (BYTE **)&vert, sizeof(*vertexes)); +} + +FArchive &operator<< (FArchive &arc, side_t *&side) +{ + return arc.SerializePointer (sides, (BYTE **)&side, sizeof(*sides)); +} diff --git a/src/farchive.h b/src/farchive.h index 7ee05fdcd..5062b7ba7 100644 --- a/src/farchive.h +++ b/src/farchive.h @@ -36,6 +36,7 @@ #include #include "dobject.h" +#include "r_state.h" class FFile { @@ -318,4 +319,17 @@ inline FArchive &operator<< (FArchive &arc, TArray &self) return arc; } +struct sector_t; +struct line_t; +struct vertex_t; +struct side_t; + +FArchive &operator<< (FArchive &arc, sector_t *&sec); +FArchive &operator<< (FArchive &arc, const sector_t *&sec); +FArchive &operator<< (FArchive &arc, line_t *&line); +FArchive &operator<< (FArchive &arc, vertex_t *&vert); +FArchive &operator<< (FArchive &arc, side_t *&side); + + + #endif //__FARCHIVE_H__ diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index d592f9f50..1837a5e9c 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -66,6 +66,7 @@ #include "v_palette.h" #include "v_font.h" #include "r_data/colormaps.h" +#include "farchive.h" static FRandom pr_script("FScript"); diff --git a/src/fragglescript/t_script.cpp b/src/fragglescript/t_script.cpp index c02958758..88749ba29 100644 --- a/src/fragglescript/t_script.cpp +++ b/src/fragglescript/t_script.cpp @@ -55,6 +55,7 @@ #include "i_system.h" #include "doomerrors.h" #include "doomstat.h" +#include "farchive.h" //========================================================================== // diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 898068d66..730fe1831 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -13,6 +13,7 @@ #include "a_specialspot.h" #include "templates.h" #include "m_bbox.h" +#include "farchive.h" // Include all the other Doom stuff here to reduce compile time #include "a_arachnotron.cpp" diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index 4304b8207..972d2dc7f 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -14,6 +14,7 @@ #include "templates.h" #include "r_data/r_translate.h" #include "doomstat.h" +#include "farchive.h" // Include all the other Heretic stuff here to reduce compile time #include "a_chicken.cpp" diff --git a/src/g_hexen/a_hexenmisc.cpp b/src/g_hexen/a_hexenmisc.cpp index 387e9fcc6..2fdee3ee1 100644 --- a/src/g_hexen/a_hexenmisc.cpp +++ b/src/g_hexen/a_hexenmisc.cpp @@ -17,6 +17,7 @@ #include "p_terrain.h" #include "m_bbox.h" #include "ravenshared.h" +#include "farchive.h" // Include all the Hexen stuff here to reduce compile time #include "a_bats.cpp" diff --git a/src/g_level.cpp b/src/g_level.cpp index bfa7ef1d9..4a6287be8 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -79,6 +79,7 @@ #include "menu/menu.h" #include "a_strifeglobal.h" #include "r_data/colormaps.h" +#include "farchive.h" #include "gi.h" diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index eb5444147..e721c0cee 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -11,6 +11,7 @@ #include "thingdef/thingdef.h" #include "g_level.h" #include "doomstat.h" +#include "farchive.h" #define MAULATORTICS (25*35) diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index ddac7a400..1a7c83b89 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -11,6 +11,7 @@ #include "p_enemy.h" #include "statnums.h" #include "templates.h" +#include "farchive.h" #include "r_data/r_translate.h" static FRandom pr_freezedeath ("FreezeDeath"); diff --git a/src/g_shared/a_armor.cpp b/src/g_shared/a_armor.cpp index 62a9e5af7..8b6f28953 100644 --- a/src/g_shared/a_armor.cpp +++ b/src/g_shared/a_armor.cpp @@ -6,6 +6,7 @@ #include "templates.h" #include "g_level.h" #include "d_player.h" +#include "farchive.h" IMPLEMENT_CLASS (AArmor) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index dc6cf685d..a97fc0acb 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -19,6 +19,7 @@ #include "g_level.h" #include "doomstat.h" #include "v_palette.h" +#include "farchive.h" #include "r_data/colormaps.h" static FRandom pr_torch ("Torch"); diff --git a/src/g_shared/a_camera.cpp b/src/g_shared/a_camera.cpp index c75ccbe80..77ba0e8de 100644 --- a/src/g_shared/a_camera.cpp +++ b/src/g_shared/a_camera.cpp @@ -37,6 +37,7 @@ #include "a_sharedglobal.h" #include "r_main.h" #include "p_local.h" +#include "farchive.h" /* == SecurityCamera diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index 1c15bd914..22f53eefa 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -44,6 +44,7 @@ #include "d_net.h" #include "colormatcher.h" #include "v_palette.h" +#include "farchive.h" static fixed_t DecalWidth, DecalLeft, DecalRight; static fixed_t SpreadZ; diff --git a/src/g_shared/a_flashfader.cpp b/src/g_shared/a_flashfader.cpp index 29f0964d2..07b11ea59 100644 --- a/src/g_shared/a_flashfader.cpp +++ b/src/g_shared/a_flashfader.cpp @@ -1,6 +1,7 @@ #include "a_sharedglobal.h" #include "g_level.h" #include "d_player.h" +#include "farchive.h" IMPLEMENT_POINTY_CLASS (DFlashFader) DECLARE_POINTER (ForWho) diff --git a/src/g_shared/a_lightning.cpp b/src/g_shared/a_lightning.cpp index 98049bb3f..e7c598d3e 100644 --- a/src/g_shared/a_lightning.cpp +++ b/src/g_shared/a_lightning.cpp @@ -1,4 +1,5 @@ #include "a_lightning.h" +#include "doomstat.h" #include "p_lnspec.h" #include "statnums.h" #include "m_random.h" @@ -8,6 +9,7 @@ #include "r_sky.h" #include "g_level.h" #include "r_state.h" +#include "farchive.h" static FRandom pr_lightning ("Lightning"); diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index 2fa69b03e..e8042ac85 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -11,6 +11,7 @@ #include "a_morph.h" #include "doomstat.h" #include "g_level.h" +#include "farchive.h" static FRandom pr_morphmonst ("MorphMonster"); diff --git a/src/g_shared/a_movingcamera.cpp b/src/g_shared/a_movingcamera.cpp index 17f6b626c..e3db71ff3 100644 --- a/src/g_shared/a_movingcamera.cpp +++ b/src/g_shared/a_movingcamera.cpp @@ -37,6 +37,7 @@ #include "p_local.h" #include "p_lnspec.h" #include "doomstat.h" +#include "farchive.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 dbcbf8494..d37869a68 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -18,6 +18,7 @@ #include "g_level.h" #include "g_game.h" #include "doomstat.h" +#include "farchive.h" static FRandom pr_restore ("RestorePos"); diff --git a/src/g_shared/a_puzzleitems.cpp b/src/g_shared/a_puzzleitems.cpp index 0cbc7cc33..4bd73ce6a 100644 --- a/src/g_shared/a_puzzleitems.cpp +++ b/src/g_shared/a_puzzleitems.cpp @@ -7,6 +7,7 @@ #include "c_console.h" #include "doomstat.h" #include "v_font.h" +#include "farchive.h" IMPLEMENT_CLASS (APuzzleItem) diff --git a/src/g_shared/a_quake.cpp b/src/g_shared/a_quake.cpp index 725f12048..c3a227b36 100644 --- a/src/g_shared/a_quake.cpp +++ b/src/g_shared/a_quake.cpp @@ -8,6 +8,7 @@ #include "s_sound.h" #include "a_sharedglobal.h" #include "statnums.h" +#include "farchive.h" static FRandom pr_quake ("Quake"); diff --git a/src/g_shared/a_skies.cpp b/src/g_shared/a_skies.cpp index bb13eac01..5e894002d 100644 --- a/src/g_shared/a_skies.cpp +++ b/src/g_shared/a_skies.cpp @@ -36,6 +36,7 @@ #include "a_sharedglobal.h" #include "p_local.h" #include "p_lnspec.h" +#include "farchive.h" // arg0 = Visibility*4 for this skybox diff --git a/src/g_shared/a_specialspot.cpp b/src/g_shared/a_specialspot.cpp index 44ee6b848..fbfbbf550 100644 --- a/src/g_shared/a_specialspot.cpp +++ b/src/g_shared/a_specialspot.cpp @@ -39,6 +39,7 @@ #include "i_system.h" #include "thingdef/thingdef.h" #include "doomstat.h" +#include "farchive.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 ecfa75d0d..068756869 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -17,6 +17,7 @@ #include "doomstat.h" #include "g_level.h" #include "d_net.h" +#include "farchive.h" #define BONUSADD 6 diff --git a/src/g_shared/hudmessages.cpp b/src/g_shared/hudmessages.cpp index a27b4191f..25c372581 100644 --- a/src/g_shared/hudmessages.cpp +++ b/src/g_shared/hudmessages.cpp @@ -39,6 +39,7 @@ #include "v_video.h" #include "cmdlib.h" #include "doomstat.h" +#include "farchive.h" EXTERN_CVAR (Int, con_scaletext) diff --git a/src/g_shared/shared_sbar.cpp b/src/g_shared/shared_sbar.cpp index 0a8badb80..b66c865af 100644 --- a/src/g_shared/shared_sbar.cpp +++ b/src/g_shared/shared_sbar.cpp @@ -51,6 +51,7 @@ #include "colormatcher.h" #include "v_palette.h" #include "d_player.h" +#include "farchive.h" #include "../version.h" diff --git a/src/g_strife/a_strifestuff.cpp b/src/g_strife/a_strifestuff.cpp index eef693d0e..0e528a704 100644 --- a/src/g_strife/a_strifestuff.cpp +++ b/src/g_strife/a_strifestuff.cpp @@ -18,6 +18,7 @@ #include "templates.h" #include "d_event.h" #include "v_font.h" +#include "farchive.h" // Include all the other Strife stuff here to reduce compile time #include "a_acolyte.cpp" @@ -177,7 +178,7 @@ 117 Blood 118 TeleportFog 119 ItemFog - 120 --- Doomednum is 14, which makes it a teleport destination. Don't know why it's in the mobjinfo table. + 120 teleport destination 121 KlaxonWarningLight 122 CeilingTurret 123 Piston diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 653a309f7..cc2a5630d 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -72,6 +72,7 @@ #include "p_setup.h" #include "po_man.h" #include "actorptrselect.h" +#include "farchive.h" #include "g_shared/a_pickups.h" @@ -1961,6 +1962,14 @@ IMPLEMENT_POINTY_CLASS (DLevelScript) DECLARE_POINTER(activator) END_POINTERS +inline FArchive &operator<< (FArchive &arc, DLevelScript::EScriptState &state) +{ + BYTE val = (BYTE)state; + arc << val; + state = (DLevelScript::EScriptState)val; + return arc; +} + void DLevelScript::Serialize (FArchive &arc) { DWORD i; diff --git a/src/p_acs.h b/src/p_acs.h index fb53dd414..245d90c40 100644 --- a/src/p_acs.h +++ b/src/p_acs.h @@ -38,7 +38,6 @@ #include "dobject.h" #include "dthinker.h" #include "doomtype.h" -#include "farchive.h" #define LOCAL_SIZE 20 #define NUM_MAPVARS 128 @@ -737,14 +736,6 @@ private: friend class DACSThinker; }; -inline FArchive &operator<< (FArchive &arc, DLevelScript::EScriptState &state) -{ - BYTE val = (BYTE)state; - arc << val; - state = (DLevelScript::EScriptState)val; - return arc; -} - class DACSThinker : public DThinker { DECLARE_CLASS (DACSThinker, DThinker) diff --git a/src/p_ceiling.cpp b/src/p_ceiling.cpp index 3cb60bcbb..fdac779ac 100644 --- a/src/p_ceiling.cpp +++ b/src/p_ceiling.cpp @@ -29,6 +29,21 @@ #include "doomstat.h" #include "r_state.h" #include "gi.h" +#include "farchive.h" + +//============================================================================ +// +// +// +//============================================================================ + +inline FArchive &operator<< (FArchive &arc, DCeiling::ECeiling &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DCeiling::ECeiling)val; + return arc; +} //============================================================================ // diff --git a/src/p_doors.cpp b/src/p_doors.cpp index c01abab6a..7ccfa54b1 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -35,6 +35,7 @@ #include "i_system.h" #include "sc_man.h" #include "cmdlib.h" +#include "farchive.h" //============================================================================ // @@ -44,6 +45,14 @@ IMPLEMENT_CLASS (DDoor) +inline FArchive &operator<< (FArchive &arc, DDoor::EVlDoor &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DDoor::EVlDoor)val; + return arc; +} + DDoor::DDoor () { } diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 4d7a6c13e..d18a908b6 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -29,6 +29,7 @@ #include "doomstat.h" #include "r_state.h" #include "tables.h" +#include "farchive.h" #include "p_3dmidtex.h" #include "r_data/r_interpolate.h" @@ -38,6 +39,20 @@ // //========================================================================== +inline FArchive &operator<< (FArchive &arc, DFloor::EFloor &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DFloor::EFloor)val; + return arc; +} + +//========================================================================== +// +// +// +//========================================================================== + static void StartFloorSound (sector_t *sec) { if (sec->seqType >= 0) @@ -870,6 +885,14 @@ IMPLEMENT_POINTY_CLASS (DElevator) DECLARE_POINTER(m_Interp_Ceiling) END_POINTERS +inline FArchive &operator<< (FArchive &arc, DElevator::EElevator &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DElevator::EElevator)val; + return arc; +} + DElevator::DElevator () { } diff --git a/src/p_lights.cpp b/src/p_lights.cpp index ba5bdf1a8..878b1f5c3 100644 --- a/src/p_lights.cpp +++ b/src/p_lights.cpp @@ -33,6 +33,7 @@ // State. #include "r_state.h" #include "statnums.h" +#include "farchive.h" static FRandom pr_flicker ("Flicker"); static FRandom pr_lightflash ("LightFlash"); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index adaef861d..eb22dc6c0 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -61,6 +61,7 @@ #include "v_palette.h" #include "p_enemy.h" #include "gstrings.h" +#include "farchive.h" #include "r_data/colormaps.h" // MACROS ------------------------------------------------------------------ diff --git a/src/p_pillar.cpp b/src/p_pillar.cpp index 2f2c15516..1f77c7c7b 100644 --- a/src/p_pillar.cpp +++ b/src/p_pillar.cpp @@ -37,6 +37,7 @@ #include "p_spec.h" #include "g_level.h" #include "s_sndseq.h" +#include "farchive.h" #include "r_data/r_interpolate.h" IMPLEMENT_POINTY_CLASS (DPillar) @@ -44,6 +45,14 @@ IMPLEMENT_POINTY_CLASS (DPillar) DECLARE_POINTER(m_Interp_Ceiling) END_POINTERS +inline FArchive &operator<< (FArchive &arc, DPillar::EPillar &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DPillar::EPillar)val; + return arc; +} + DPillar::DPillar () { } diff --git a/src/p_plats.cpp b/src/p_plats.cpp index 9e57f4baf..d87c30991 100644 --- a/src/p_plats.cpp +++ b/src/p_plats.cpp @@ -30,11 +30,27 @@ #include "doomstat.h" #include "r_state.h" #include "gi.h" +#include "farchive.h" static FRandom pr_doplat ("DoPlat"); IMPLEMENT_CLASS (DPlat) +inline FArchive &operator<< (FArchive &arc, DPlat::EPlatType &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DPlat::EPlatType)val; + return arc; +} +inline FArchive &operator<< (FArchive &arc, DPlat::EPlatState &state) +{ + BYTE val = (BYTE)state; + arc << val; + state = (DPlat::EPlatState)val; + return arc; +} + DPlat::DPlat () { } diff --git a/src/p_pspr.cpp b/src/p_pspr.cpp index 31eb1ac7e..2bd844788 100644 --- a/src/p_pspr.cpp +++ b/src/p_pspr.cpp @@ -27,6 +27,8 @@ #include "templates.h" #include "thingdef/thingdef.h" #include "g_level.h" +#include "farchive.h" + // MACROS ------------------------------------------------------------------ diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index 3564f580b..741887cab 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -49,12 +49,18 @@ #include "po_man.h" #include "p_setup.h" #include "r_data/colormaps.h" +#include "farchive.h" static void CopyPlayer (player_t *dst, player_t *src, const char *name); static void ReadOnePlayer (FArchive &arc, bool skipload); static void ReadMultiplePlayers (FArchive &arc, int numPlayers, int numPlayersNow, bool skipload); static void SpawnExtraPlayers (); +inline FArchive &operator<< (FArchive &arc, FLinkedSector &link) +{ + arc << link.Sector << link.Type; + return arc; +} // // P_ArchivePlayers diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index a54033b0d..963c7ca08 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -28,6 +28,7 @@ #include "r_main.h" #include "nodebuild.h" #include "po_man.h" +#include "farchive.h" #include "r_data/colormaps.h" @@ -831,6 +832,16 @@ bool secplane_t::CopyPlaneIfValid (secplane_t *dest, const secplane_t *opp) cons return copy; } +FArchive &operator<< (FArchive &arc, secplane_t &plane) +{ + arc << plane.a << plane.b << plane.c << plane.d; + //if (plane.c != 0) + { // plane.c should always be non-0. Otherwise, the plane + // would be perfectly vertical. + plane.ic = DivScale32 (1, plane.c); + } + return arc; +} //========================================================================== // diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 7cf24b981..bb516fb44 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -60,6 +60,7 @@ #include "g_level.h" #include "v_font.h" #include "a_sharedglobal.h" +#include "farchive.h" // State. #include "r_state.h" @@ -85,6 +86,14 @@ IMPLEMENT_POINTY_CLASS (DPusher) DECLARE_POINTER (m_Source) END_POINTERS +inline FArchive &operator<< (FArchive &arc, DScroller::EScrollType &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DScroller::EScrollType)val; + return arc; +} + DScroller::DScroller () { } @@ -109,6 +118,14 @@ DPusher::DPusher () { } +inline FArchive &operator<< (FArchive &arc, DPusher::EPusher &type) +{ + BYTE val = (BYTE)type; + arc << val; + type = (DPusher::EPusher)val; + return arc; +} + void DPusher::Serialize (FArchive &arc) { Super::Serialize (arc); diff --git a/src/p_spec.h b/src/p_spec.h index 2db74fcd9..19de4ce8a 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -97,14 +97,6 @@ private: // (This is so scrolling floors and objects on them can move at same speed.) enum { CARRYFACTOR = ((fixed_t)(FRACUNIT*.09375)) }; -inline FArchive &operator<< (FArchive &arc, DScroller::EScrollType &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DScroller::EScrollType)val; - return arc; -} - // phares 3/20/98: added new model of Pushers for push/pull effects class DPusher : public DThinker @@ -150,14 +142,6 @@ protected: bool PIT_PushThing (AActor *thing); -inline FArchive &operator<< (FArchive &arc, DPusher::EPusher &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DPusher::EPusher)val; - return arc; -} - // Define values for map objects #define MO_TELEPORTMAN 14 @@ -466,21 +450,6 @@ bool EV_DoPlat (int tag, line_t *line, DPlat::EPlatType type, void EV_StopPlat (int tag); void P_ActivateInStasis (int tag); -inline FArchive &operator<< (FArchive &arc, DPlat::EPlatType &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DPlat::EPlatType)val; - return arc; -} -inline FArchive &operator<< (FArchive &arc, DPlat::EPlatState &state) -{ - BYTE val = (BYTE)state; - arc << val; - state = (DPlat::EPlatState)val; - return arc; -} - // // [RH] // P_PILLAR @@ -520,14 +489,6 @@ private: DPillar (); }; -inline FArchive &operator<< (FArchive &arc, DPillar::EPillar &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DPillar::EPillar)val; - return arc; -} - bool EV_DoPillar (DPillar::EPillar type, int tag, fixed_t speed, fixed_t height, fixed_t height2, int crush, bool hexencrush); @@ -588,14 +549,6 @@ bool EV_DoDoor (DDoor::EVlDoor type, line_t *line, AActor *thing, void P_SpawnDoorCloseIn30 (sector_t *sec); void P_SpawnDoorRaiseIn5Mins (sector_t *sec); -inline FArchive &operator<< (FArchive &arc, DDoor::EVlDoor &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DDoor::EVlDoor)val; - return arc; -} - class DAnimatedDoor : public DMovingCeiling { DECLARE_CLASS (DAnimatedDoor, DMovingCeiling) @@ -717,13 +670,6 @@ bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line, bool EV_CeilingCrushStop (int tag); void P_ActivateInStasisCeiling (int tag); -inline FArchive &operator<< (FArchive &arc, DCeiling::ECeiling &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DCeiling::ECeiling)val; - return arc; -} // @@ -824,14 +770,6 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, bool EV_FloorCrushStop (int tag); bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed); -inline FArchive &operator<< (FArchive &arc, DFloor::EFloor &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DFloor::EFloor)val; - return arc; -} - class DElevator : public DMover { DECLARE_CLASS (DElevator, DMover) @@ -873,14 +811,6 @@ private: bool EV_DoElevator (line_t *line, DElevator::EElevator type, fixed_t speed, fixed_t height, int tag); -inline FArchive &operator<< (FArchive &arc, DElevator::EElevator &type) -{ - BYTE val = (BYTE)type; - arc << val; - type = (DElevator::EElevator)val; - return arc; -} - class DWaggleBase : public DMover { DECLARE_CLASS (DWaggleBase, DMover) diff --git a/src/p_switch.cpp b/src/p_switch.cpp index 6e468e41d..c1c1ffb41 100644 --- a/src/p_switch.cpp +++ b/src/p_switch.cpp @@ -46,6 +46,7 @@ #include "w_wad.h" #include "tarray.h" #include "cmdlib.h" +#include "farchive.h" #include "gi.h" diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 53922ab61..97e537531 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -33,6 +33,7 @@ ** */ +#include "doomstat.h" #include "p_setup.h" #include "p_lnspec.h" #include "templates.h" diff --git a/src/p_user.cpp b/src/p_user.cpp index c8b615d04..bbf4be3a5 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -52,6 +52,7 @@ #include "g_level.h" #include "d_net.h" #include "gstrings.h" +#include "farchive.h" static FRandom pr_skullpop ("SkullPop"); @@ -210,6 +211,11 @@ CCMD (playerclasses) bool onground; +FArchive &operator<< (FArchive &arc, player_t *&p) +{ + return arc.SerializePointer (players, (BYTE **)&p, sizeof(*players)); +} + // The player_t constructor. Since LogText is not a POD, we cannot just // memset it all to 0. player_t::player_t() diff --git a/src/po_man.cpp b/src/po_man.cpp index 0afe9538d..59928ed1d 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -29,6 +29,7 @@ #include "po_man.h" #include "p_setup.h" #include "vectors.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------ @@ -47,6 +48,16 @@ inline vertex_t *side_t::V2() const } +FArchive &operator<< (FArchive &arc, FPolyObj *&poly) +{ + return arc.SerializePointer (polyobjs, (BYTE **)&poly, sizeof(FPolyObj)); +} + +FArchive &operator<< (FArchive &arc, const FPolyObj *&poly) +{ + return arc.SerializePointer (polyobjs, (BYTE **)&poly, sizeof(FPolyObj)); +} + inline FArchive &operator<< (FArchive &arc, podoortype_t &type) { BYTE val = (BYTE)type; diff --git a/src/po_man.h b/src/po_man.h index 074426d88..5603095d5 100644 --- a/src/po_man.h +++ b/src/po_man.h @@ -92,16 +92,6 @@ private: }; extern FPolyObj *polyobjs; // list of all poly-objects on the level -inline FArchive &operator<< (FArchive &arc, FPolyObj *&poly) -{ - return arc.SerializePointer (polyobjs, (BYTE **)&poly, sizeof(FPolyObj)); -} - -inline FArchive &operator<< (FArchive &arc, const FPolyObj *&poly) -{ - return arc.SerializePointer (polyobjs, (BYTE **)&poly, sizeof(FPolyObj)); -} - struct polyblock_t { FPolyObj *polyobj; @@ -111,6 +101,8 @@ struct polyblock_t void PO_LinkToSubsectors(); +FArchive &operator<< (FArchive &arc, FPolyObj *&poly); +FArchive &operator<< (FArchive &arc, const FPolyObj *&poly); #endif \ No newline at end of file diff --git a/src/r_data/r_interpolate.cpp b/src/r_data/r_interpolate.cpp index 1e0c0a3b9..5655adf20 100644 --- a/src/r_data/r_interpolate.cpp +++ b/src/r_data/r_interpolate.cpp @@ -39,6 +39,7 @@ #include "p_local.h" #include "i_system.h" #include "po_man.h" +#include "farchive.h" //========================================================================== // diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 81b840604..8cdbac7e9 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -47,6 +47,7 @@ #include "i_system.h" #include "w_wad.h" #include "r_data/colormaps.h" +#include "farchive.h" #include "gi.h" #include "stats.h" diff --git a/src/r_defs.h b/src/r_defs.h index f37fd965e..7af5eabde 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -37,7 +37,6 @@ #include "actor.h" #include "dthinker.h" -#include "farchive.h" #define MAXWIDTH 2560 #define MAXHEIGHT 1600 @@ -101,6 +100,7 @@ class FScanner; class FBitmap; struct FCopyInfo; class DInterpolation; +class FArchive; enum { @@ -309,16 +309,8 @@ struct secplane_t }; -inline FArchive &operator<< (FArchive &arc, secplane_t &plane) -{ - arc << plane.a << plane.b << plane.c << plane.d; - //if (plane.c != 0) - { // plane.c should always be non-0. Otherwise, the plane - // would be perfectly vertical. - plane.ic = DivScale32 (1, plane.c); - } - return arc; -} +FArchive &operator<< (FArchive &arc, secplane_t &plane); + #include "p_3dfloors.h" // Ceiling/floor flags diff --git a/src/r_main.cpp b/src/r_main.cpp index 7643e890c..1ed4ab5e9 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -55,6 +55,7 @@ #include "st_start.h" #include "v_font.h" #include "r_data/colormaps.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------ diff --git a/src/r_state.h b/src/r_state.h index 9c77ffc8d..6e4c45f63 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -24,7 +24,8 @@ #define __R_STATE_H__ // Need data structure definitions. -#include "d_player.h" +#include "doomtype.h" +#include "r_defs.h" #include "r_data/sprites.h" // @@ -74,38 +75,6 @@ extern subsector_t * gamesubsectors; extern int numgamesubsectors; -inline FArchive &operator<< (FArchive &arc, sector_t *&sec) -{ - return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors)); -} - -inline FArchive &operator<< (FArchive &arc, const sector_t *&sec) -{ - return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors)); -} - -inline FArchive &operator<< (FArchive &arc, line_t *&line) -{ - return arc.SerializePointer (lines, (BYTE **)&line, sizeof(*lines)); -} - -inline FArchive &operator<< (FArchive &arc, vertex_t *&vert) -{ - return arc.SerializePointer (vertexes, (BYTE **)&vert, sizeof(*vertexes)); -} - -inline FArchive &operator<< (FArchive &arc, side_t *&side) -{ - return arc.SerializePointer (sides, (BYTE **)&side, sizeof(*sides)); -} - -inline FArchive &operator<< (FArchive &arc, FLinkedSector &link) -{ - arc << link.Sector << link.Type; - return arc; -} - - // // POV data. // diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index 250ebbf96..2dd815f1b 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -50,6 +50,7 @@ #include "d_netinf.h" #include "i_system.h" #include "d_player.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------ diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index 2a1924684..0df036662 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -27,6 +27,7 @@ #include "templates.h" #include "c_dispatch.h" #include "g_level.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------ diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 052d04952..5c171af0d 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -50,6 +50,7 @@ #include "timidity/timidity.h" #include "g_level.h" #include "po_man.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------ diff --git a/src/statistics.cpp b/src/statistics.cpp index fe72f7667..aa8d9afc1 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -70,6 +70,7 @@ #include "r_sky.h" #include "p_lnspec.h" #include "m_crc32.h" +#include "farchive.h" CVAR(Int, savestatistics, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(String, statfile, "zdoomstat.txt", CVAR_ARCHIVE|CVAR_GLOBALCONFIG) diff --git a/src/textures/anim_switches.cpp b/src/textures/anim_switches.cpp index 014e879f8..137d9cbb3 100644 --- a/src/textures/anim_switches.cpp +++ b/src/textures/anim_switches.cpp @@ -43,6 +43,8 @@ #include "cmdlib.h" #include "sc_man.h" #include "gi.h" +#include "farchive.h" + static int STACK_ARGS SortSwitchDefs (const void *a, const void *b) { diff --git a/src/textures/animations.cpp b/src/textures/animations.cpp index 65405e5c8..efd813519 100644 --- a/src/textures/animations.cpp +++ b/src/textures/animations.cpp @@ -44,6 +44,7 @@ #include "templates.h" #include "w_wad.h" #include "g_level.h" +#include "farchive.h" // MACROS ------------------------------------------------------------------