diff --git a/.gitignore b/.gitignore index f38b57ee93..422957e23c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,5 @@ /lzma/x64/ /zlib/x64/ /build_vc2015 +/build_vc2015-32 +/build_vc2015-64 diff --git a/src/actor.h b/src/actor.h index 579656ae06..1dcd35b90e 100644 --- a/src/actor.h +++ b/src/actor.h @@ -43,6 +43,7 @@ struct subsector_t; class PClassAmmo; +struct FBlockNode; // // NOTES: AActor @@ -530,21 +531,6 @@ enum EThingSpecialActivationType THINGSPEC_Switch = 1<<10, // The thing is alternatively activated and deactivated when triggered }; -// [RH] Like msecnode_t, but for the blockmap -struct FBlockNode -{ - AActor *Me; // actor this node references - int BlockIndex; // index into blocklinks for the block this node is in - FBlockNode **PrevActor; // previous actor in this block - FBlockNode *NextActor; // next actor in this block - FBlockNode **PrevBlock; // previous block this actor is in - FBlockNode *NextBlock; // next block this actor is in - - static FBlockNode *Create (AActor *who, int x, int y); - void Release (); - - static FBlockNode *FreeBlocks; -}; class FDecalBase; class AInventory; @@ -569,16 +555,6 @@ struct line_t; struct secplane_t; struct FStrifeDialogueNode; -struct fixedvec3 -{ - fixed_t x, y, z; -}; - -struct fixedvec2 -{ - fixed_t x, y; -}; - class DDropItem : public DObject { DECLARE_CLASS(DDropItem, DObject) @@ -1407,6 +1383,7 @@ inline fixedvec3 PosRelative(const fixedvec3 &pos, line_t *line, sector_t *refse } void PrintMiscActorInfo(AActor * query); +AActor *P_LinePickActor(AActor *t1, angle_t angle, fixed_t distance, int pitch, ActorFlags actorMask, DWORD wallMask); #define S_FREETARGMOBJ 1 diff --git a/src/am_map.cpp b/src/am_map.cpp index df464e59dc..b0ae28a13b 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -42,6 +42,8 @@ #include "r_renderer.h" #include "r_sky.h" #include "sbar.h" +#include "d_player.h" +#include "p_blockmap.h" #include "m_cheat.h" #include "i_system.h" @@ -58,6 +60,7 @@ // State. #include "doomstat.h" #include "r_state.h" +#include "r_utility.h" // Data. #include "gstrings.h" diff --git a/src/b_bot.cpp b/src/b_bot.cpp index aa52629299..ee954a206c 100644 --- a/src/b_bot.cpp +++ b/src/b_bot.cpp @@ -13,6 +13,7 @@ #include "teaminfo.h" #include "d_net.h" #include "farchive.h" +#include "d_player.h" IMPLEMENT_POINTY_CLASS(DBot) DECLARE_POINTER(dest) diff --git a/src/b_func.cpp b/src/b_func.cpp index 3edc560b0b..3b8ada882d 100644 --- a/src/b_func.cpp +++ b/src/b_func.cpp @@ -11,6 +11,7 @@ #include "doomdef.h" #include "doomstat.h" #include "p_local.h" +#include "p_maputl.h" #include "b_bot.h" #include "g_game.h" #include "m_random.h" @@ -20,6 +21,8 @@ #include "i_system.h" #include "s_sound.h" #include "d_event.h" +#include "d_player.h" +#include "p_spec.h" static FRandom pr_botdofire ("BotDoFire"); diff --git a/src/b_game.cpp b/src/b_game.cpp index 44545f73dc..b896878e73 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -59,6 +59,7 @@ Everything that is changed is marked (maybe commented) with "Added by MC" #include "i_system.h" #include "d_net.h" #include "d_netinf.h" +#include "d_player.h" static FRandom pr_botspawn ("BotSpawn"); diff --git a/src/b_move.cpp b/src/b_move.cpp index cee409265e..7bd31a2011 100644 --- a/src/b_move.cpp +++ b/src/b_move.cpp @@ -18,6 +18,8 @@ #include "a_keys.h" #include "d_event.h" #include "p_enemy.h" +#include "d_player.h" +#include "p_spec.h" static FRandom pr_botopendoor ("BotOpenDoor"); static FRandom pr_bottrywalk ("BotTryWalk"); diff --git a/src/b_think.cpp b/src/b_think.cpp index a2b169f56d..94d8e7ea2c 100644 --- a/src/b_think.cpp +++ b/src/b_think.cpp @@ -19,6 +19,7 @@ #include "statnums.h" #include "d_net.h" #include "d_event.h" +#include "d_player.h" static FRandom pr_botmove ("BotMove"); diff --git a/src/basictypes.h b/src/basictypes.h index 3aa4f46351..0ae68f39b6 100644 --- a/src/basictypes.h +++ b/src/basictypes.h @@ -81,6 +81,17 @@ union QWORD_UNION typedef SDWORD fixed_t; typedef DWORD dsfixed_t; // fixedpt used by span drawer +struct fixedvec3 +{ + fixed_t x, y, z; +}; + +struct fixedvec2 +{ + fixed_t x, y; +}; + + #define FIXED_MAX (signed)(0x7fffffff) #define FIXED_MIN (signed)(0x80000000) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index 1d16af31f6..ca9ddaf6ea 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -69,6 +69,8 @@ #include "v_text.h" #include "p_lnspec.h" #include "v_video.h" +#include "r_utility.h" +#include "r_data/r_interpolate.h" extern FILE *Logfile; extern bool insave; diff --git a/src/d_net.cpp b/src/d_net.cpp index 00361053a7..88b4372fb8 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -60,6 +60,7 @@ #include "v_video.h" #include "p_spec.h" #include "hardware.h" +#include "r_utility.h" #include "intermission/intermission.h" EXTERN_CVAR (Int, disableautosave) diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index efc6d310e3..d9c977670f 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -73,6 +73,8 @@ #include "po_man.h" #include "autosegs.h" #include "v_video.h" +#include "textures.h" +#include "r_utility.h" #include "menu/menu.h" #include "intermission/intermission.h" diff --git a/src/doomtype.h b/src/doomtype.h index 92717e4c86..30fc1b65a8 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -197,6 +197,41 @@ struct PalEntry #endif }; +class FArchive; +class PClassInventory; + +class FTextureID +{ + friend class FTextureManager; + friend FArchive &operator<< (FArchive &arc, FTextureID &tex); + friend FTextureID GetHUDIcon(PClassInventory *cls); + friend void R_InitSpriteDefs(); + +public: + FTextureID() throw() {} + bool isNull() const { return texnum == 0; } + bool isValid() const { return texnum > 0; } + bool Exists() const { return texnum >= 0; } + void SetInvalid() { texnum = -1; } + void SetNull() { texnum = 0; } + bool operator ==(const FTextureID &other) const { return texnum == other.texnum; } + bool operator !=(const FTextureID &other) const { return texnum != other.texnum; } + FTextureID operator +(int offset) throw(); + int GetIndex() const { return texnum; } // Use this only if you absolutely need the index! + + // The switch list needs these to sort the switches by texture index + int operator -(FTextureID other) const { return texnum - other.texnum; } + bool operator < (FTextureID other) const { return texnum < other.texnum; } + bool operator > (FTextureID other) const { return texnum > other.texnum; } + +protected: + FTextureID(int num) { texnum = num; } +private: + int texnum; +}; + + + // Screenshot buffer image data types enum ESSType { diff --git a/src/dsectoreffect.cpp b/src/dsectoreffect.cpp index 7bc9fc400e..5a27608134 100644 --- a/src/dsectoreffect.cpp +++ b/src/dsectoreffect.cpp @@ -29,6 +29,7 @@ #include "r_data/r_interpolate.h" #include "statnums.h" #include "farchive.h" +#include "doomstat.h" IMPLEMENT_CLASS (DSectorEffect) diff --git a/src/dthinker.cpp b/src/dthinker.cpp index c186bb7ccd..03f103ca60 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -39,6 +39,7 @@ #include "i_system.h" #include "doomerrors.h" #include "farchive.h" +#include "d_player.h" static cycle_t ThinkCycles; diff --git a/src/fragglescript/t_cmd.cpp b/src/fragglescript/t_cmd.cpp index 74f3663579..0e621119c8 100644 --- a/src/fragglescript/t_cmd.cpp +++ b/src/fragglescript/t_cmd.cpp @@ -47,6 +47,7 @@ #include "sc_man.h" #include "g_level.h" #include "r_renderer.h" +#include "d_player.h" //========================================================================== // diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 6d64bc6b6c..8819270b0b 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -1,6 +1,7 @@ #include "actor.h" #include "info.h" #include "p_local.h" +#include "p_spec.h" #include "a_sharedglobal.h" #include "m_random.h" #include "gi.h" @@ -15,6 +16,9 @@ #include "m_bbox.h" #include "farchive.h" #include "portal.h" +#include "d_player.h" +#include "p_maputl.h" +#include "g_shared/a_pickups.h" // Include all the other Doom stuff here to reduce compile time #include "a_arachnotron.cpp" diff --git a/src/g_game.cpp b/src/g_game.cpp index 865e50c23f..5f30af97bf 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -80,6 +80,9 @@ #include "m_joy.h" #include "farchive.h" #include "r_renderer.h" +#include "r_utility.h" +#include "a_morph.h" +#include "p_spec.h" #include "r_data/colormaps.h" #include diff --git a/src/g_heretic/a_hereticmisc.cpp b/src/g_heretic/a_hereticmisc.cpp index 91499bd68b..ebcb957e58 100644 --- a/src/g_heretic/a_hereticmisc.cpp +++ b/src/g_heretic/a_hereticmisc.cpp @@ -15,6 +15,8 @@ #include "r_data/r_translate.h" #include "doomstat.h" #include "farchive.h" +#include "d_player.h" +#include "a_morph.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 1141f381f9..70bc3fb1e2 100644 --- a/src/g_hexen/a_hexenmisc.cpp +++ b/src/g_hexen/a_hexenmisc.cpp @@ -20,6 +20,10 @@ #include "farchive.h" #include "v_palette.h" #include "g_game.h" +#include "p_blockmap.h" +#include "r_utility.h" +#include "p_maputl.h" +#include "p_spec.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 e8bf160041..5f305e5df1 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -83,6 +83,8 @@ #include "r_data/colormaps.h" #include "farchive.h" #include "r_renderer.h" +#include "r_utility.h" +#include "p_spec.h" #include "gi.h" diff --git a/src/g_raven/a_artitele.cpp b/src/g_raven/a_artitele.cpp index da71c31c84..7ae32b5736 100644 --- a/src/g_raven/a_artitele.cpp +++ b/src/g_raven/a_artitele.cpp @@ -3,11 +3,14 @@ #include "a_artifacts.h" #include "gstrings.h" #include "p_local.h" +#include "p_spec.h" #include "gi.h" #include "s_sound.h" #include "m_random.h" #include "doomstat.h" #include "g_game.h" +#include "d_player.h" +#include "a_morph.h" static FRandom pr_tele ("TeleportSelf"); diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 14757c43b6..0388782040 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -12,6 +12,8 @@ #include "g_level.h" #include "doomstat.h" #include "farchive.h" +#include "a_pickups.h" +#include "d_player.h" #define MAULATORTICS (25*35) diff --git a/src/g_shared/a_artifacts.cpp b/src/g_shared/a_artifacts.cpp index 992e97cefc..997f685799 100644 --- a/src/g_shared/a_artifacts.cpp +++ b/src/g_shared/a_artifacts.cpp @@ -20,6 +20,8 @@ #include "doomstat.h" #include "v_palette.h" #include "farchive.h" +#include "r_utility.h" + #include "r_data/colormaps.h" static FRandom pr_torch ("Torch"); diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index 4f103be57f..5ecec1827f 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -4,6 +4,7 @@ #include "g_level.h" #include "r_sky.h" #include "p_lnspec.h" +#include "b_bot.h" IMPLEMENT_CLASS(AFastProjectile) diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index 2aa52ae4ff..eb9f2e300c 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -13,6 +13,7 @@ #include "g_level.h" #include "farchive.h" #include "p_enemy.h" +#include "d_player.h" static FRandom pr_morphmonst ("MorphMonster"); diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 4a73212aaa..32a4167bbe 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -19,6 +19,8 @@ #include "g_game.h" #include "doomstat.h" #include "farchive.h" +#include "d_player.h" +#include "p_spec.h" static FRandom pr_restore ("RestorePos"); diff --git a/src/g_shared/a_quake.cpp b/src/g_shared/a_quake.cpp index 94a375d3e0..eac736f8bb 100644 --- a/src/g_shared/a_quake.cpp +++ b/src/g_shared/a_quake.cpp @@ -9,6 +9,8 @@ #include "a_sharedglobal.h" #include "statnums.h" #include "farchive.h" +#include "d_player.h" +#include "r_utility.h" static FRandom pr_quake ("Quake"); diff --git a/src/g_shared/a_randomspawner.cpp b/src/g_shared/a_randomspawner.cpp index acadbe6dab..42eccacca6 100644 --- a/src/g_shared/a_randomspawner.cpp +++ b/src/g_shared/a_randomspawner.cpp @@ -16,6 +16,8 @@ #include "a_action.h" #include "thingdef/thingdef.h" #include "v_text.h" +#include "doomstat.h" +#include "doomdata.h" #define MAX_RANDOMSPAWNERS_RECURSION 32 // Should be largely more than enough, honestly. static FRandom pr_randomspawn("RandomSpawn"); diff --git a/src/g_shared/a_specialspot.cpp b/src/g_shared/a_specialspot.cpp index 2a97949f3a..de72787a34 100644 --- a/src/g_shared/a_specialspot.cpp +++ b/src/g_shared/a_specialspot.cpp @@ -40,6 +40,7 @@ #include "thingdef/thingdef.h" #include "doomstat.h" #include "farchive.h" +#include "a_pickups.h" static FRandom pr_spot ("SpecialSpot"); static FRandom pr_spawnmace ("SpawnMace"); diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 349c1e9c5e..97204cc637 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -50,6 +50,8 @@ #include "doomstat.h" #include "g_level.h" #include "d_net.h" +#include "d_player.h" +#include "r_utility.h" #include diff --git a/src/info.cpp b/src/info.cpp index d827cd7a0a..0f3da5d787 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -35,6 +35,7 @@ */ +#include "doomstat.h" #include "info.h" #include "m_fixed.h" #include "c_dispatch.h" @@ -51,6 +52,8 @@ #include "cmdlib.h" #include "g_level.h" #include "stats.h" +#include "thingdef.h" +#include "d_player.h" extern void LoadActors (); extern void InitBotStuff(); diff --git a/src/m_bbox.cpp b/src/m_bbox.cpp index c73f47bc46..f7827ef725 100644 --- a/src/m_bbox.cpp +++ b/src/m_bbox.cpp @@ -26,6 +26,7 @@ #include "m_bbox.h" #include "p_local.h" +#include "p_maputl.h" //========================================================================== // diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index c6bb677b53..aa539f96bf 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -46,6 +46,8 @@ #include "d_dehacked.h" #include "gi.h" #include "farchive.h" +#include "r_utility.h" +#include "a_morph.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/p_3dfloors.cpp b/src/p_3dfloors.cpp index 0df3b2ebd3..61c4564b91 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -38,10 +38,14 @@ #include "templates.h" #include "p_local.h" #include "p_lnspec.h" +#include "p_maputl.h" #include "w_wad.h" #include "sc_man.h" #include "g_level.h" #include "p_terrain.h" +#include "d_player.h" +#include "r_utility.h" +#include "p_spec.h" #include "r_data/colormaps.h" //========================================================================== diff --git a/src/p_3dmidtex.cpp b/src/p_3dmidtex.cpp index 5d5ba56d82..1c4ba7b7ca 100644 --- a/src/p_3dmidtex.cpp +++ b/src/p_3dmidtex.cpp @@ -38,6 +38,8 @@ #include "templates.h" #include "p_local.h" #include "p_terrain.h" +#include "p_maputl.h" +#include "p_spec.h" //============================================================================ diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 070111d7b3..7155c98e64 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -40,6 +40,7 @@ #include "templates.h" #include "doomdef.h" #include "p_local.h" +#include "d_player.h" #include "p_spec.h" #include "g_level.h" #include "s_sound.h" @@ -79,6 +80,8 @@ #include "p_terrain.h" #include "version.h" #include "p_effect.h" +#include "r_utility.h" +#include "a_morph.h" #include "g_shared/a_pickups.h" diff --git a/src/p_blockmap.h b/src/p_blockmap.h new file mode 100644 index 0000000000..0380b9da7e --- /dev/null +++ b/src/p_blockmap.h @@ -0,0 +1,33 @@ +#ifndef __P_BLOCKMAP_H +#define __P_BLOCKMAP_H + +#include "doomtype.h" + +class AActor; + +// [RH] Like msecnode_t, but for the blockmap +struct FBlockNode +{ + AActor *Me; // actor this node references + int BlockIndex; // index into blocklinks for the block this node is in + FBlockNode **PrevActor; // previous actor in this block + FBlockNode *NextActor; // next actor in this block + FBlockNode **PrevBlock; // previous block this actor is in + FBlockNode *NextBlock; // next block this actor is in + + static FBlockNode *Create (AActor *who, int x, int y); + void Release (); + + static FBlockNode *FreeBlocks; +}; + +extern int* blockmaplump; // offsets in blockmap are from here + +extern int* blockmap; +extern int bmapwidth; +extern int bmapheight; // in mapblocks +extern fixed_t bmaporgx; +extern fixed_t bmaporgy; // origin of block map +extern FBlockNode** blocklinks; // for thing chains + +#endif diff --git a/src/p_doors.cpp b/src/p_doors.cpp index 7ed607e19f..16d12be9d3 100644 --- a/src/p_doors.cpp +++ b/src/p_doors.cpp @@ -36,6 +36,8 @@ #include "sc_man.h" #include "cmdlib.h" #include "farchive.h" +#include "d_player.h" +#include "p_spec.h" //============================================================================ // diff --git a/src/p_effect.cpp b/src/p_effect.cpp index c02e3a97bf..ffd1f303c7 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -51,6 +51,8 @@ #include "gi.h" #include "v_palette.h" #include "colormatcher.h" +#include "d_player.h" +#include "r_utility.h" CVAR (Int, cl_rockettrails, 1, CVAR_ARCHIVE); CVAR (Bool, r_rail_smartspiral, 0, CVAR_ARCHIVE); diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index eaf7297717..16f6324092 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -31,6 +31,8 @@ #include "i_system.h" #include "doomdef.h" #include "p_local.h" +#include "p_maputl.h" +#include "d_player.h" #include "m_bbox.h" #include "p_lnspec.h" #include "s_sound.h" @@ -44,8 +46,11 @@ #include "thingdef/thingdef.h" #include "d_dehacked.h" #include "g_level.h" +#include "r_utility.h" +#include "p_blockmap.h" #include "r_data/r_translate.h" #include "teaminfo.h" +#include "p_spec.h" #include "gi.h" diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index b8e3eb5c60..ea39844e01 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -65,6 +65,8 @@ #include "version.h" #include "md5.h" #include "m_misc.h" +#include "r_utility.h" +#include "cmdlib.h" void P_GetPolySpots (MapData * lump, TArray &spots, TArray &anchors); diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index dba66ca9b7..98d08832ee 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -58,6 +58,7 @@ #include "g_level.h" #include "d_net.h" #include "d_netinf.h" +#include "a_morph.h" static FRandom pr_obituary ("Obituary"); static FRandom pr_botrespawn ("BotRespawn"); diff --git a/src/p_lights.cpp b/src/p_lights.cpp index 656b861124..9c5202cdf7 100644 --- a/src/p_lights.cpp +++ b/src/p_lights.cpp @@ -27,8 +27,10 @@ #include "doomdef.h" #include "p_local.h" +#include "p_spec.h" #include "p_lnspec.h" +#include "doomstat.h" // State. #include "r_state.h" diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 0061fd5dc7..1e45c0fe51 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -58,8 +58,12 @@ #include "d_event.h" #include "gstrings.h" #include "portal.h" +#include "po_man.h" +#include "d_player.h" +#include "r_utility.h" #include "r_data/colormaps.h" #include "fragglescript/t_fs.h" +#include "p_spec.h" // Remaps EE sector change types to Generic_Floor values. According to the Eternity Wiki: /* diff --git a/src/p_local.h b/src/p_local.h index 9030a07364..5a173ea410 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -24,13 +24,19 @@ #define __P_LOCAL__ #include "doomtype.h" -#include "doomdef.h" #include "tables.h" -#include "r_state.h" -#include "r_utility.h" -#include "d_player.h" -#include "a_morph.h" +class player_t; +class AActor; +struct FPlayerStart; +class PClassActor; +struct fixedvec3; +class APlayerPawn; +struct line_t; +struct sector_t; +struct msecnode_t; +struct secplane_t; + #include @@ -119,7 +125,7 @@ void P_PredictionLerpReset(); #define SPF_TEMPPLAYER 1 // spawning a short-lived dummy player #define SPF_WEAPONFULLYUP 2 // spawn with weapon already raised -APlayerPawn *P_SpawnPlayer (struct FPlayerStart *mthing, int playernum, int flags=0); +APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags=0); void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move); int P_FaceMobj (AActor *source, AActor *target, angle_t *delta); @@ -221,200 +227,6 @@ enum WARPF -// -// P_MAPUTL -// -struct divline_t -{ - fixed_t x; - fixed_t y; - fixed_t dx; - fixed_t dy; - -}; - -struct intercept_t -{ - fixed_t frac; // along trace line - bool isaline; - bool done; - union { - AActor *thing; - line_t *line; - } d; -}; - -typedef bool (*traverser_t) (intercept_t *in); - -fixed_t P_AproxDistance (fixed_t dx, fixed_t dy); - -//========================================================================== -// -// P_PointOnLineSide -// -// Returns 0 (front/on) or 1 (back) -// [RH] inlined, stripped down, and made more precise -// -//========================================================================== - -inline int P_PointOnLineSide (fixed_t x, fixed_t y, const line_t *line) -{ - extern int P_VanillaPointOnLineSide(fixed_t x, fixed_t y, const line_t* line); - - return i_compatflags2 & COMPATF2_POINTONLINE - ? P_VanillaPointOnLineSide(x, y, line) - : DMulScale32 (y-line->v1->y, line->dx, line->v1->x-x, line->dy) > 0; -} - -inline int P_PointOnLineSidePrecise (fixed_t x, fixed_t y, const line_t *line) -{ - return DMulScale32 (y-line->v1->y, line->dx, line->v1->x-x, line->dy) > 0; -} - - -//========================================================================== -// -// P_PointOnDivlineSide -// -// Same as P_PointOnLineSide except it uses divlines -// [RH] inlined, stripped down, and made more precise -// -//========================================================================== - -inline int P_PointOnDivlineSide (fixed_t x, fixed_t y, const divline_t *line) -{ - extern int P_VanillaPointOnDivlineSide(fixed_t x, fixed_t y, const divline_t* line); - - return (i_compatflags2 & COMPATF2_POINTONLINE) - ? P_VanillaPointOnDivlineSide(x, y, line) - : (DMulScale32 (y-line->y, line->dx, line->x-x, line->dy) > 0); -} - -inline int P_PointOnDivlineSidePrecise (fixed_t x, fixed_t y, const divline_t *line) -{ - return DMulScale32 (y-line->y, line->dx, line->x-x, line->dy) > 0; -} - - -//========================================================================== -// -// P_MakeDivline -// -//========================================================================== - -inline void P_MakeDivline (const line_t *li, divline_t *dl) -{ - dl->x = li->v1->x; - dl->y = li->v1->y; - dl->dx = li->dx; - dl->dy = li->dy; -} - -fixed_t P_InterceptVector (const divline_t *v2, const divline_t *v1); - -struct FLineOpening -{ - fixed_t top; - fixed_t bottom; - fixed_t range; - fixed_t lowfloor; - sector_t *bottomsec; - sector_t *topsec; - FTextureID ceilingpic; - FTextureID floorpic; - int floorterrain; - bool touchmidtex; - bool abovemidtex; -}; - -void P_LineOpening (FLineOpening &open, AActor *thing, const line_t *linedef, fixed_t x, fixed_t y, fixed_t refx=FIXED_MIN, fixed_t refy=0, int flags=0); - -class FBoundingBox; -struct polyblock_t; - -class FBlockLinesIterator -{ - int minx, maxx; - int miny, maxy; - - int curx, cury; - polyblock_t *polyLink; - int polyIndex; - int *list; - - void StartBlock(int x, int y); - -public: - FBlockLinesIterator(int minx, int miny, int maxx, int maxy, bool keepvalidcount = false); - FBlockLinesIterator(const FBoundingBox &box); - line_t *Next(); - void Reset() { StartBlock(minx, miny); } -}; - -class FBlockThingsIterator -{ - int minx, maxx; - int miny, maxy; - - int curx, cury; - - FBlockNode *block; - - int Buckets[32]; - - struct HashEntry - { - AActor *Actor; - int Next; - }; - HashEntry FixedHash[10]; - int NumFixedHash; - TArray DynHash; - - HashEntry *GetHashEntry(int i) { return i < (int)countof(FixedHash) ? &FixedHash[i] : &DynHash[i - countof(FixedHash)]; } - - void StartBlock(int x, int y); - void SwitchBlock(int x, int y); - void ClearHash(); - - // The following is only for use in the path traverser - // and therefore declared private. - FBlockThingsIterator(); - - friend class FPathTraverse; - -public: - FBlockThingsIterator(int minx, int miny, int maxx, int maxy); - FBlockThingsIterator(const FBoundingBox &box); - AActor *Next(bool centeronly = false); - void Reset() { StartBlock(minx, miny); } -}; - -class FPathTraverse -{ - static TArray intercepts; - - divline_t trace; - unsigned int intercept_index; - unsigned int intercept_count; - unsigned int count; - - void AddLineIntercepts(int bx, int by); - void AddThingIntercepts(int bx, int by, FBlockThingsIterator &it, bool compatible); -public: - - intercept_t *Next(); - - FPathTraverse(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, int flags); - ~FPathTraverse(); - const divline_t &Trace() const { return trace; } -}; - - -#define PT_ADDLINES 1 -#define PT_ADDTHINGS 2 -#define PT_COMPATIBLE 4 -#define PT_DELTA 8 // x2,y2 is passed as a delta, not as an endpoint AActor *P_BlockmapSearch (AActor *mo, int distance, AActor *(*check)(AActor*, int, void *), void *params = NULL); AActor *P_RoughMonsterSearch (AActor *mo, int distance, bool onlyseekable=false); @@ -451,6 +263,8 @@ struct FCheckPosition // ripping damage once per tic instead of once per move. bool DoRipping; TMap LastRipped; + + //FPortalGroupTable Groups; int PushTime; FCheckPosition(bool rip=false) @@ -539,7 +353,6 @@ enum // P_LineAttack flags AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, PClassActor *pufftype, int flags = 0, AActor **victim = NULL, int *actualdamage = NULL); AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, FName pufftype, int flags = 0, AActor **victim = NULL, int *actualdamage = NULL); -AActor *P_LinePickActor (AActor *t1, angle_t angle, fixed_t distance, int pitch, ActorFlags actorMask, DWORD wallMask); void P_TraceBleed (int damage, fixed_t x, fixed_t y, fixed_t z, AActor *target, angle_t angle, int pitch); void P_TraceBleed (int damage, AActor *target, angle_t angle, int pitch); void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version @@ -587,31 +400,10 @@ bool Check_Sides(AActor *, int, int); // phares // [RH] const secplane_t * P_CheckSlopeWalk (AActor *actor, fixed_t &xmove, fixed_t &ymove); -//---------------------------------------------------------------------------------- -// -// Added so that in the source there's a clear distinction between -// game engine and renderer specific calls. -// (For ZDoom itself this doesn't make any difference here but for GZDoom it does.) -// -//---------------------------------------------------------------------------------- -subsector_t *P_PointInSubsector (fixed_t x, fixed_t y); -inline sector_t *P_PointInSector(fixed_t x, fixed_t y) -{ - return P_PointInSubsector(x,y)->sector; -} - // // P_SETUP // extern BYTE* rejectmatrix; // for fast sight rejection -extern int* blockmaplump; // offsets in blockmap are from here - -extern int* blockmap; -extern int bmapwidth; -extern int bmapheight; // in mapblocks -extern fixed_t bmaporgx; -extern fixed_t bmaporgy; // origin of block map -extern FBlockNode** blocklinks; // for thing chains @@ -639,46 +431,9 @@ enum EDmgFlags }; -// ===== PO_MAN ===== - -typedef enum -{ - PODOOR_NONE, - PODOOR_SLIDE, - PODOOR_SWING, -} podoortype_t; - -bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide); -bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle, fixed_t dist, bool overRide); -bool EV_MovePolyTo (line_t *line, int polyNum, int speed, fixed_t x, fixed_t y, bool overRide); -bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle, int delay, int distance, podoortype_t type); -bool EV_StopPoly (int polyNum); - - -// [RH] Data structure for P_SpawnMapThing() to keep track -// of polyobject-related things. -struct polyspawns_t -{ - polyspawns_t *next; - fixed_t x; - fixed_t y; - short angle; - short type; -}; - -extern int po_NumPolyobjs; -extern polyspawns_t *polyspawns; // [RH] list of polyobject things to spawn - - -void PO_Init (); -bool PO_Busy (int polyobj); -FPolyObj *PO_GetPolyobj(int polyNum); - // // P_SPEC // -#include "p_spec.h" - bool P_AlignFlat (int linenum, int side, int fc); #endif // __P_LOCAL__ diff --git a/src/p_map.cpp b/src/p_map.cpp index 0e3cb6617c..8e958cf8b8 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -34,10 +34,14 @@ #include "doomdef.h" #include "p_local.h" +#include "p_spec.h" +#include "d_player.h" +#include "p_maputl.h" #include "p_lnspec.h" #include "p_effect.h" #include "p_terrain.h" #include "p_trace.h" +#include "r_utility.h" #include "s_sound.h" #include "decallib.h" diff --git a/src/p_maputl.cpp b/src/p_maputl.cpp index e5bb2bea27..7df43f1c82 100644 --- a/src/p_maputl.cpp +++ b/src/p_maputl.cpp @@ -32,9 +32,13 @@ #include "m_bbox.h" #include "doomdef.h" +#include "doomdata.h" #include "doomstat.h" #include "p_local.h" +#include "p_maputl.h" #include "p_3dmidtex.h" +#include "p_blockmap.h" +#include "r_utility.h" // State. #include "r_state.h" diff --git a/src/p_maputl.h b/src/p_maputl.h new file mode 100644 index 0000000000..dbc4eaf9af --- /dev/null +++ b/src/p_maputl.h @@ -0,0 +1,208 @@ +#ifndef __P_MAPUTL_H +#define __P_MAPUTL_H + +#include "r_defs.h" +#include "doomstat.h" + +extern int validcount; + +struct divline_t +{ + fixed_t x; + fixed_t y; + fixed_t dx; + fixed_t dy; +}; + +struct intercept_t +{ + fixed_t frac; // along trace line + bool isaline; + bool done; + union { + AActor *thing; + line_t *line; + } d; +}; + + +//========================================================================== +// +// P_PointOnLineSide +// +// Returns 0 (front/on) or 1 (back) +// [RH] inlined, stripped down, and made more precise +// +//========================================================================== + +inline int P_PointOnLineSide (fixed_t x, fixed_t y, const line_t *line) +{ + extern int P_VanillaPointOnLineSide(fixed_t x, fixed_t y, const line_t* line); + + return i_compatflags2 & COMPATF2_POINTONLINE + ? P_VanillaPointOnLineSide(x, y, line) + : DMulScale32 (y-line->v1->y, line->dx, line->v1->x-x, line->dy) > 0; +} + +inline int P_PointOnLineSidePrecise (fixed_t x, fixed_t y, const line_t *line) +{ + return DMulScale32 (y-line->v1->y, line->dx, line->v1->x-x, line->dy) > 0; +} + + +//========================================================================== +// +// P_PointOnDivlineSide +// +// Same as P_PointOnLineSide except it uses divlines +// [RH] inlined, stripped down, and made more precise +// +//========================================================================== + +inline int P_PointOnDivlineSide (fixed_t x, fixed_t y, const divline_t *line) +{ + extern int P_VanillaPointOnDivlineSide(fixed_t x, fixed_t y, const divline_t* line); + + return (i_compatflags2 & COMPATF2_POINTONLINE) + ? P_VanillaPointOnDivlineSide(x, y, line) + : (DMulScale32 (y-line->y, line->dx, line->x-x, line->dy) > 0); +} + +inline int P_PointOnDivlineSidePrecise (fixed_t x, fixed_t y, const divline_t *line) +{ + return DMulScale32 (y-line->y, line->dx, line->x-x, line->dy) > 0; +} + + +//========================================================================== +// +// P_MakeDivline +// +//========================================================================== + +inline void P_MakeDivline (const line_t *li, divline_t *dl) +{ + dl->x = li->v1->x; + dl->y = li->v1->y; + dl->dx = li->dx; + dl->dy = li->dy; +} + +struct FLineOpening +{ + fixed_t top; + fixed_t bottom; + fixed_t range; + fixed_t lowfloor; + sector_t *bottomsec; + sector_t *topsec; + FTextureID ceilingpic; + FTextureID floorpic; + int floorterrain; + bool touchmidtex; + bool abovemidtex; +}; + +void P_LineOpening (FLineOpening &open, AActor *thing, const line_t *linedef, fixed_t x, fixed_t y, fixed_t refx=FIXED_MIN, fixed_t refy=0, int flags=0); + +class FBoundingBox; +struct polyblock_t; + +class FBlockLinesIterator +{ + int minx, maxx; + int miny, maxy; + + int curx, cury; + polyblock_t *polyLink; + int polyIndex; + int *list; + + void StartBlock(int x, int y); + +public: + FBlockLinesIterator(int minx, int miny, int maxx, int maxy, bool keepvalidcount = false); + FBlockLinesIterator(const FBoundingBox &box); + line_t *Next(); + void Reset() { StartBlock(minx, miny); } +}; + +class FBlockThingsIterator +{ + int minx, maxx; + int miny, maxy; + + int curx, cury; + + FBlockNode *block; + + int Buckets[32]; + + struct HashEntry + { + AActor *Actor; + int Next; + }; + HashEntry FixedHash[10]; + int NumFixedHash; + TArray DynHash; + + HashEntry *GetHashEntry(int i) { return i < (int)countof(FixedHash) ? &FixedHash[i] : &DynHash[i - countof(FixedHash)]; } + + void StartBlock(int x, int y); + void SwitchBlock(int x, int y); + void ClearHash(); + + // The following is only for use in the path traverser + // and therefore declared private. + FBlockThingsIterator(); + + friend class FPathTraverse; + +public: + FBlockThingsIterator(int minx, int miny, int maxx, int maxy); + FBlockThingsIterator(const FBoundingBox &box); + AActor *Next(bool centeronly = false); + void Reset() { StartBlock(minx, miny); } +}; + +class FPathTraverse +{ + static TArray intercepts; + + divline_t trace; + unsigned int intercept_index; + unsigned int intercept_count; + unsigned int count; + + void AddLineIntercepts(int bx, int by); + void AddThingIntercepts(int bx, int by, FBlockThingsIterator &it, bool compatible); +public: + + intercept_t *Next(); + + FPathTraverse(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, int flags); + ~FPathTraverse(); + const divline_t &Trace() const { return trace; } +}; + + + +// +// P_MAPUTL +// + +typedef bool(*traverser_t) (intercept_t *in); + +fixed_t P_AproxDistance (fixed_t dx, fixed_t dy); + + +fixed_t P_InterceptVector (const divline_t *v2, const divline_t *v1); + +#define PT_ADDLINES 1 +#define PT_ADDTHINGS 2 +#define PT_COMPATIBLE 4 +#define PT_DELTA 8 // x2,y2 is passed as a delta, not as an endpoint + + +#endif \ No newline at end of file diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 658fcbc69c..0910ac719a 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -29,6 +29,7 @@ #include "m_random.h" #include "doomdef.h" #include "p_local.h" +#include "p_maputl.h" #include "p_lnspec.h" #include "p_effect.h" #include "p_terrain.h" @@ -66,6 +67,8 @@ #include "farchive.h" #include "r_data/colormaps.h" #include "r_renderer.h" +#include "po_man.h" +#include "p_spec.h" // MACROS ------------------------------------------------------------------ diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index e7b32bb233..a72c9d8974 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -34,8 +34,10 @@ #include "i_system.h" #include "p_local.h" +#include "p_spec.h" // State. +#include "d_player.h" #include "dobject.h" #include "doomstat.h" #include "r_state.h" diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 746e50e40c..c5780e912f 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -29,6 +29,7 @@ #endif #include "templates.h" +#include "d_player.h" #include "m_argv.h" #include "m_swap.h" #include "m_bbox.h" @@ -69,6 +70,9 @@ #include "r_renderer.h" #include "r_data/colormaps.h" #include "portal.h" +#include "p_blockmap.h" +#include "r_utility.h" +#include "p_spec.h" #ifndef NO_EDATA #include "edata.h" #endif diff --git a/src/p_sight.cpp b/src/p_sight.cpp index b007410c84..e92380058c 100644 --- a/src/p_sight.cpp +++ b/src/p_sight.cpp @@ -14,11 +14,16 @@ #include "doomdef.h" #include "i_system.h" #include "p_local.h" +#include "p_maputl.h" +#include "p_blockmap.h" #include "m_random.h" #include "m_bbox.h" #include "p_lnspec.h" #include "g_level.h" #include "po_man.h" +#include "r_utility.h" +#include "b_bot.h" +#include "p_spec.h" // State. #include "r_state.h" diff --git a/src/p_slopes.cpp b/src/p_slopes.cpp index 3e402f73a1..bf6f1738c7 100644 --- a/src/p_slopes.cpp +++ b/src/p_slopes.cpp @@ -36,6 +36,8 @@ #include "p_local.h" #include "cmdlib.h" #include "p_lnspec.h" +#include "p_maputl.h" +#include "p_spec.h" //=========================================================================== // diff --git a/src/p_spec.cpp b/src/p_spec.cpp index b010165b1e..45ed51be2e 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -46,6 +46,8 @@ #include "w_wad.h" #include "p_local.h" +#include "p_spec.h" +#include "p_blockmap.h" #include "p_lnspec.h" #include "p_terrain.h" #include "p_acs.h" @@ -64,7 +66,10 @@ #include "a_keys.h" #include "c_dispatch.h" #include "r_sky.h" +#include "d_player.h" #include "portal.h" +#include "p_maputl.h" +#include "p_blockmap.h" #ifndef NO_EDATA #include "edata.h" #endif diff --git a/src/p_switch.cpp b/src/p_switch.cpp index 1ae0c43ea5..0c9d37ccc7 100644 --- a/src/p_switch.cpp +++ b/src/p_switch.cpp @@ -47,6 +47,8 @@ #include "tarray.h" #include "cmdlib.h" #include "farchive.h" +#include "p_maputl.h" +#include "p_spec.h" #include "gi.h" diff --git a/src/p_teleport.cpp b/src/p_teleport.cpp index a6dcbf7f3d..b7f9c4fd55 100644 --- a/src/p_teleport.cpp +++ b/src/p_teleport.cpp @@ -34,6 +34,10 @@ #include "m_random.h" #include "i_system.h" #include "doomstat.h" +#include "d_player.h" +#include "p_maputl.h" +#include "r_utility.h" +#include "p_spec.h" #define FUDGEFACTOR 10 diff --git a/src/p_things.cpp b/src/p_things.cpp index 14ca85aa35..1c8a4a46dc 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -47,6 +47,9 @@ #include "g_level.h" #include "v_text.h" #include "i_system.h" +#include "d_player.h" +#include "r_utility.h" +#include "p_spec.h" // Set of spawnable things for the Thing_Spawn and Thing_Projectile specials. FClassMap SpawnableThings; diff --git a/src/p_tick.cpp b/src/p_tick.cpp index 44fe881100..29b2cd4ade 100644 --- a/src/p_tick.cpp +++ b/src/p_tick.cpp @@ -31,7 +31,10 @@ #include "sbar.h" #include "r_data/r_interpolate.h" #include "i_sound.h" +#include "d_player.h" #include "g_level.h" +#include "r_utility.h" +#include "p_spec.h" extern gamestate_t wipegamestate; diff --git a/src/p_trace.cpp b/src/p_trace.cpp index 619a613619..929f284b1b 100644 --- a/src/p_trace.cpp +++ b/src/p_trace.cpp @@ -37,6 +37,9 @@ #include "i_system.h" #include "r_sky.h" #include "doomstat.h" +#include "p_maputl.h" +#include "r_defs.h" +#include "p_spec.h" struct FTraceInfo { diff --git a/src/p_user.cpp b/src/p_user.cpp index d5f89576bd..5294203476 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -54,6 +54,11 @@ #include "gstrings.h" #include "farchive.h" #include "r_renderer.h" +#include "d_player.h" +#include "r_utility.h" +#include "p_blockmap.h" +#include "a_morph.h" +#include "p_spec.h" static FRandom pr_skullpop ("SkullPop"); diff --git a/src/p_writemap.cpp b/src/p_writemap.cpp index 8f1a4edfa5..c442fc0d95 100644 --- a/src/p_writemap.cpp +++ b/src/p_writemap.cpp @@ -5,6 +5,8 @@ #include "r_defs.h" #include "m_swap.h" #include "doomstat.h" +#include "d_player.h" +#include "p_spec.h" static int WriteTHINGS (FILE *file); static int WriteLINEDEFS (FILE *file); diff --git a/src/po_man.cpp b/src/po_man.cpp index a0cc4487b0..7cfa3cf1ba 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -29,6 +29,9 @@ #include "p_setup.h" #include "vectors.h" #include "farchive.h" +#include "p_blockmap.h" +#include "p_maputl.h" +#include "r_utility.h" // MACROS ------------------------------------------------------------------ diff --git a/src/po_man.h b/src/po_man.h index 9e81cc2666..08ac465e3f 100644 --- a/src/po_man.h +++ b/src/po_man.h @@ -107,4 +107,40 @@ FArchive &operator<< (FArchive &arc, FPolyObj *&poly); FArchive &operator<< (FArchive &arc, const FPolyObj *&poly); +// ===== PO_MAN ===== + +typedef enum +{ + PODOOR_NONE, + PODOOR_SLIDE, + PODOOR_SWING, +} podoortype_t; + +bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide); +bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle, fixed_t dist, bool overRide); +bool EV_MovePolyTo (line_t *line, int polyNum, int speed, fixed_t x, fixed_t y, bool overRide); +bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle, int delay, int distance, podoortype_t type); +bool EV_StopPoly (int polyNum); + + +// [RH] Data structure for P_SpawnMapThing() to keep track +// of polyobject-related things. +struct polyspawns_t +{ + polyspawns_t *next; + fixed_t x; + fixed_t y; + short angle; + short type; +}; + +extern int po_NumPolyobjs; +extern polyspawns_t *polyspawns; // [RH] list of polyobject things to spawn + + +void PO_Init (); +bool PO_Busy (int polyobj); +FPolyObj *PO_GetPolyobj(int polyNum); + + #endif \ No newline at end of file diff --git a/src/portal.cpp b/src/portal.cpp index 1ce6a630d7..e24e045ebd 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -11,6 +11,8 @@ #include "a_sharedglobal.h" #include "i_system.h" #include "c_dispatch.h" +#include "p_maputl.h" +#include "p_spec.h" // simulation recurions maximum CVAR(Int, sv_portal_recursions, 4, CVAR_ARCHIVE|CVAR_SERVERINFO) diff --git a/src/r_defs.h b/src/r_defs.h index 7339b26ae2..6913d868ba 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -1153,4 +1153,17 @@ struct visstyle_t }; +//---------------------------------------------------------------------------------- +// +// The playsim can use different nodes than the renderer so this is +// not the same as R_PointInSubsector +// +//---------------------------------------------------------------------------------- +subsector_t *P_PointInSubsector(fixed_t x, fixed_t y); +inline sector_t *P_PointInSector(fixed_t x, fixed_t y) +{ + return P_PointInSubsector(x, y)->sector; +} + + #endif diff --git a/src/r_things.cpp b/src/r_things.cpp index 1179c7291a..1fb4c845be 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -63,6 +63,7 @@ #include "r_data/colormaps.h" #include "r_data/voxels.h" #include "p_local.h" +#include "p_maputl.h" // [RH] A c-buffer. Used for keeping track of offscreen voxel spans. diff --git a/src/r_utility.cpp b/src/r_utility.cpp index 794c30d4ce..bcba624e13 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -55,6 +55,8 @@ #include "r_renderer.h" #include "r_data/colormaps.h" #include "farchive.h" +#include "r_utility.h" +#include "d_player.h" // EXTERNAL DATA DECLARATIONS ---------------------------------------------- diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index cf2957885c..4a5bfa25ec 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -28,6 +28,7 @@ #include "c_dispatch.h" #include "g_level.h" #include "farchive.h" +#include "d_player.h" // MACROS ------------------------------------------------------------------ diff --git a/src/s_sound.cpp b/src/s_sound.cpp index dabed23f6e..e61a0f7010 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -51,6 +51,7 @@ #include "g_level.h" #include "po_man.h" #include "farchive.h" +#include "d_player.h" // MACROS ------------------------------------------------------------------ diff --git a/src/textures/textures.h b/src/textures/textures.h index 157f8555fe..b5f3364cd3 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -14,36 +14,6 @@ class FArchive; class FTextureManager; class FTerrainTypeArray; -class FTextureID -{ - friend class FTextureManager; - friend FArchive &operator<< (FArchive &arc, FTextureID &tex); - friend FTextureID GetHUDIcon(PClassInventory *cls); - friend void R_InitSpriteDefs (); - -public: - FTextureID() throw() {} - bool isNull() const { return texnum == 0; } - bool isValid() const { return texnum > 0; } - bool Exists() const { return texnum >= 0; } - void SetInvalid() { texnum = -1; } - void SetNull() { texnum = 0; } - bool operator ==(const FTextureID &other) const { return texnum == other.texnum; } - bool operator !=(const FTextureID &other) const { return texnum != other.texnum; } - FTextureID operator +(int offset) throw(); - int GetIndex() const { return texnum; } // Use this only if you absolutely need the index! - - // The switch list needs these to sort the switches by texture index - int operator -(FTextureID other) const { return texnum - other.texnum; } - bool operator < (FTextureID other) const { return texnum < other.texnum; } - bool operator > (FTextureID other) const { return texnum > other.texnum; } - -protected: - FTextureID(int num) { texnum = num; } -private: - int texnum; -}; - class FNullTextureID : public FTextureID { public: diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e4744c8b48..4b9bb77de9 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -73,6 +73,9 @@ #include "p_trace.h" #include "p_setup.h" #include "gstrings.h" +#include "d_player.h" +#include "p_maputl.h" +#include "p_spec.h" AActor *SingleActorFromTID(int tid, AActor *defactor);