mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- moved map loader files to a subdirectory.
This commit is contained in:
parent
017b3f9dc7
commit
2edf02d731
9 changed files with 193 additions and 186 deletions
|
@ -649,6 +649,7 @@ file( GLOB HEADER_FILES
|
|||
g_statusbar/*.h
|
||||
g_inventory/*.h
|
||||
intermission/*.h
|
||||
maploader/*.h
|
||||
menu/*.h
|
||||
sound/adlmidi/*.h*
|
||||
sound/opnmidi/*.h*
|
||||
|
@ -908,7 +909,6 @@ set (PCH_SOURCES
|
|||
doomstat.cpp
|
||||
dsectoreffect.cpp
|
||||
dthinker.cpp
|
||||
edata.cpp
|
||||
f_wipe.cpp
|
||||
files.cpp
|
||||
files_decompress.cpp
|
||||
|
@ -955,7 +955,6 @@ set (PCH_SOURCES
|
|||
p_effect.cpp
|
||||
p_enemy.cpp
|
||||
p_floor.cpp
|
||||
p_glnodes.cpp
|
||||
p_interaction.cpp
|
||||
p_lights.cpp
|
||||
p_linkedsectors.cpp
|
||||
|
@ -972,9 +971,7 @@ set (PCH_SOURCES
|
|||
p_scroll.cpp
|
||||
p_secnodes.cpp
|
||||
p_sectors.cpp
|
||||
p_setup.cpp
|
||||
p_sight.cpp
|
||||
p_slopes.cpp
|
||||
p_spec.cpp
|
||||
p_states.cpp
|
||||
p_switch.cpp
|
||||
|
@ -984,7 +981,6 @@ set (PCH_SOURCES
|
|||
p_things.cpp
|
||||
p_tick.cpp
|
||||
p_trace.cpp
|
||||
p_udmf.cpp
|
||||
p_usdf.cpp
|
||||
p_user.cpp
|
||||
p_xlat.cpp
|
||||
|
@ -1077,7 +1073,11 @@ set (PCH_SOURCES
|
|||
hwrenderer/utility/hw_lighting.cpp
|
||||
hwrenderer/utility/hw_shaderpatcher.cpp
|
||||
hwrenderer/utility/hw_vrmodes.cpp
|
||||
|
||||
maploader/edata.cpp
|
||||
maploader/maploader.cpp
|
||||
maploader/slopes.cpp
|
||||
maploader/glnodes.cpp
|
||||
maploader/udmf.cpp
|
||||
menu/joystickmenu.cpp
|
||||
menu/loadsavemenu.cpp
|
||||
menu/menu.cpp
|
||||
|
@ -1422,7 +1422,7 @@ source_group("External\\RapidJSON" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_D
|
|||
source_group("External\\SFMT" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/sfmt/.+")
|
||||
source_group("FraggleScript" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/fragglescript/.+")
|
||||
source_group("Intermission" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/intermission/.+")
|
||||
source_group("Inventory" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/g_inventory/.+")
|
||||
source_group("Map Loader" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/maploader/.+")
|
||||
source_group("Menu" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/menu/.+")
|
||||
source_group("Hardware Renderer" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/gl/.+")
|
||||
source_group("Hardware Renderer\\Data" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/hwrenderer/data/.+")
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "p_terrain.h"
|
||||
#include "p_acs.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "maploader.h"
|
||||
|
||||
|
||||
struct FEDOptions : public FOptionalMapinfoData
|
|
@ -31,9 +31,6 @@
|
|||
**
|
||||
*/
|
||||
#include <math.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <malloc.h> // for alloca()
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <unistd.h>
|
||||
|
@ -62,6 +59,7 @@
|
|||
#include "cmdlib.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "i_time.h"
|
||||
#include "maploader.h"
|
||||
|
||||
CVAR(Bool, gl_cachenodes, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR(Float, gl_cachetime, 0.6f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
|
@ -103,8 +103,8 @@
|
|||
#include "i_time.h"
|
||||
#include "scripting/vm/vm.h"
|
||||
#include "hwrenderer/data/flatvertices.h"
|
||||
|
||||
#include "fragglescript/t_fs.h"
|
||||
#include "maploader.h"
|
||||
|
||||
sidei_t *sidetemp;
|
||||
TArray<FMapThing> MapThingsConverted;
|
179
src/maploader/maploader.h
Normal file
179
src/maploader/maploader.h
Normal file
|
@ -0,0 +1,179 @@
|
|||
#pragma once
|
||||
|
||||
struct EDMapthing
|
||||
{
|
||||
int recordnum;
|
||||
int tid;
|
||||
int type;
|
||||
double height;
|
||||
int args[5];
|
||||
uint16_t skillfilter;
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
struct EDLinedef
|
||||
{
|
||||
int recordnum;
|
||||
int special;
|
||||
int tag;
|
||||
int id;
|
||||
int args[5];
|
||||
double alpha;
|
||||
uint32_t flags;
|
||||
uint32_t activation;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct EDSector
|
||||
{
|
||||
int recordnum;
|
||||
|
||||
uint32_t flags;
|
||||
uint32_t flagsRemove;
|
||||
uint32_t flagsAdd;
|
||||
|
||||
int damageamount;
|
||||
int damageinterval;
|
||||
FName damagetype;
|
||||
uint8_t leaky;
|
||||
uint8_t leakyadd;
|
||||
uint8_t leakyremove;
|
||||
int floorterrain;
|
||||
int ceilingterrain;
|
||||
|
||||
uint32_t color;
|
||||
|
||||
uint32_t damageflags;
|
||||
uint32_t damageflagsAdd;
|
||||
uint32_t damageflagsRemove;
|
||||
|
||||
bool flagsSet;
|
||||
bool damageflagsSet;
|
||||
bool colorSet;
|
||||
|
||||
// colormaptop//bottom cannot be used because ZDoom has no corresponding properties.
|
||||
double xoffs[2], yoffs[2];
|
||||
DAngle angle[2];
|
||||
uint32_t portalflags[2];
|
||||
double Overlayalpha[2];
|
||||
};
|
||||
|
||||
|
||||
struct FMissingCount
|
||||
{
|
||||
int Count = 0;
|
||||
};
|
||||
|
||||
typedef TMap<FString,FMissingCount> FMissingTextureTracker;
|
||||
struct FLevelLocals;
|
||||
|
||||
class MapLoader
|
||||
{
|
||||
friend class UDMFParser;
|
||||
void *level; // this is to hide the global variable and produce an error for referencing it.
|
||||
FLevelLocals *Level;
|
||||
|
||||
int firstglvertex; // helpers for loading GL nodes from GWA files.
|
||||
bool format5;
|
||||
|
||||
TArray<vertexdata_t> vertexdatas;
|
||||
|
||||
TMap<unsigned, unsigned> MapThingsUserDataIndex; // from mapthing idx -> user data idx
|
||||
TArray<FUDMFKey> MapThingsUserData;
|
||||
int sidecount;
|
||||
TArray<int> linemap;
|
||||
|
||||
TMap<int, EDLinedef> EDLines;
|
||||
TMap<int, EDSector> EDSectors;
|
||||
TMap<int, EDMapthing> EDThings;
|
||||
|
||||
void SlopeLineToPoint(int lineid, const DVector3 &pos, bool slopeCeil);
|
||||
void CopyPlane(int tag, sector_t *dest, bool copyCeil);
|
||||
void CopyPlane(int tag, const DVector2 &pos, bool copyCeil);
|
||||
void SetSlope(secplane_t *plane, bool setCeil, int xyangi, int zangi, const DVector3 &pos);
|
||||
void VavoomSlope(sector_t * sec, int id, const DVector3 &pos, int which);
|
||||
void SetSlopesFromVertexHeights(FMapThing *firstmt, FMapThing *lastmt, const int *oldvertextable);
|
||||
void AlignPlane(sector_t *sec, line_t *line, int which);
|
||||
|
||||
void InitED();
|
||||
void ProcessEDMapthing(FMapThing *mt, int recordnum);
|
||||
void ProcessEDLinedef(line_t *line, int recordnum);
|
||||
void ProcessEDSector(sector_t *sec, int recordnum);
|
||||
|
||||
int checkGLVertex(int num);
|
||||
int checkGLVertex3(int num);
|
||||
int CheckForMissingSegs();
|
||||
bool LoadGLVertexes(FileReader &lump);
|
||||
bool LoadGLSegs(FileReader &lump);
|
||||
bool LoadGLSubsectors(FileReader &lump);
|
||||
bool LoadNodes(FileReader &lump);
|
||||
bool DoLoadGLNodes(FileReader * lumps);
|
||||
void CreateCachedNodes(MapData *map);
|
||||
|
||||
void SetTexture(side_t *side, int position, const char *name, FMissingTextureTracker &track);
|
||||
void SetTexture(sector_t *sector, int index, int position, const char *name, FMissingTextureTracker &track, bool truncate);
|
||||
void SetTexture(side_t *side, int position, uint32_t *blend, const char *name);
|
||||
void SetTextureNoErr(side_t *side, int position, uint32_t *color, const char *name, bool *validcolor, bool isFog);
|
||||
|
||||
void FloodZone(sector_t *sec, int zonenum);
|
||||
void LoadGLZSegs(FileReader &data, int type);
|
||||
void LoadZSegs(FileReader &data);
|
||||
void LoadZNodes(FileReader &data, int glnodes);
|
||||
|
||||
int DetermineTranslucency(int lumpnum);
|
||||
void SetLineID(int i, line_t *ld);
|
||||
void SaveLineSpecial(line_t *ld);
|
||||
void FinishLoadingLineDef(line_t *ld, int alpha);
|
||||
void SetSideNum(side_t **sidenum_p, uint16_t sidenum);
|
||||
void AllocateSideDefs(MapData *map, int count);
|
||||
void ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, intmapsidedef_t *msd, int special, int tag, short *alpha, FMissingTextureTracker &missingtex);
|
||||
void SetMapThingUserData(AActor *actor, unsigned udi);
|
||||
void CreateBlockMap();
|
||||
|
||||
void AddToList(uint8_t *hitlist, FTextureID texid, int bitmask);
|
||||
|
||||
public:
|
||||
void LoadMapinfoACSLump();
|
||||
void ProcessEDSectors();
|
||||
|
||||
void FloodZones();
|
||||
void LoadVertexes(MapData * map);
|
||||
void LoadExtendedNodes(FileReader &dalump, uint32_t id);
|
||||
template<class segtype> void LoadSegs(MapData * map);
|
||||
template<class subsectortype, class segtype> void LoadSubsectors(MapData * map);
|
||||
template<class nodetype, class subsectortype> void LoadNodes(MapData * map);
|
||||
bool LoadGLNodes(MapData * map);
|
||||
bool CheckCachedNodes(MapData *map);
|
||||
bool CheckNodes(MapData * map, bool rebuilt, int buildtime);
|
||||
bool CheckForGLNodes();
|
||||
|
||||
void LoadSectors(MapData *map, FMissingTextureTracker &missingtex);
|
||||
void LoadThings(MapData * map);
|
||||
void LoadThings2(MapData * map);
|
||||
|
||||
void SpawnThings(int position);
|
||||
void FinishLoadingLineDefs();
|
||||
void LoadLineDefs(MapData * map);
|
||||
void LoadLineDefs2(MapData * map);
|
||||
void LoopSidedefs(bool firstloop);
|
||||
void LoadSideDefs2(MapData *map, FMissingTextureTracker &missingtex);
|
||||
void LoadBlockMap(MapData * map);
|
||||
void LoadReject(MapData * map, bool junk);
|
||||
void LoadBehavior(MapData * map);
|
||||
void GetPolySpots(MapData * map, TArray<FNodeBuilder::FPolyStart> &spots, TArray<FNodeBuilder::FPolyStart> &anchors);
|
||||
void GroupLines(bool buildmap);
|
||||
void PrecacheLevel();
|
||||
void ParseTextMap(MapData *map, FMissingTextureTracker &missingtex);
|
||||
void SummarizeMissingTextures(const FMissingTextureTracker &missing);
|
||||
void SetRenderSector();
|
||||
void SpawnSlopeMakers(FMapThing *firstmt, FMapThing *lastmt, const int *oldvertextable);
|
||||
void SetSlopes();
|
||||
void CopySlopes();
|
||||
|
||||
MapLoader(FLevelLocals *lev)
|
||||
{
|
||||
Level = lev;
|
||||
}
|
||||
};
|
||||
|
|
@ -41,6 +41,7 @@
|
|||
#include "g_levellocals.h"
|
||||
#include "actor.h"
|
||||
#include "p_setup.h"
|
||||
#include "maploader.h"
|
||||
|
||||
//===========================================================================
|
||||
//
|
|
@ -49,6 +49,7 @@
|
|||
#include "g_levellocals.h"
|
||||
#include "info.h"
|
||||
#include "vm.h"
|
||||
#include "maploader.h"
|
||||
|
||||
//===========================================================================
|
||||
//
|
176
src/p_setup.h
176
src/p_setup.h
|
@ -169,64 +169,7 @@ void FixMinisegReferences();
|
|||
void FixHoles();
|
||||
void ReportUnpairedMinisegs();
|
||||
|
||||
struct EDMapthing
|
||||
{
|
||||
int recordnum;
|
||||
int tid;
|
||||
int type;
|
||||
double height;
|
||||
int args[5];
|
||||
uint16_t skillfilter;
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
struct EDLinedef
|
||||
{
|
||||
int recordnum;
|
||||
int special;
|
||||
int tag;
|
||||
int id;
|
||||
int args[5];
|
||||
double alpha;
|
||||
uint32_t flags;
|
||||
uint32_t activation;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct EDSector
|
||||
{
|
||||
int recordnum;
|
||||
|
||||
uint32_t flags;
|
||||
uint32_t flagsRemove;
|
||||
uint32_t flagsAdd;
|
||||
|
||||
int damageamount;
|
||||
int damageinterval;
|
||||
FName damagetype;
|
||||
uint8_t leaky;
|
||||
uint8_t leakyadd;
|
||||
uint8_t leakyremove;
|
||||
int floorterrain;
|
||||
int ceilingterrain;
|
||||
|
||||
uint32_t color;
|
||||
|
||||
uint32_t damageflags;
|
||||
uint32_t damageflagsAdd;
|
||||
uint32_t damageflagsRemove;
|
||||
|
||||
bool flagsSet;
|
||||
bool damageflagsSet;
|
||||
bool colorSet;
|
||||
|
||||
// colormaptop//bottom cannot be used because ZDoom has no corresponding properties.
|
||||
double xoffs[2], yoffs[2];
|
||||
DAngle angle[2];
|
||||
uint32_t portalflags[2];
|
||||
double Overlayalpha[2];
|
||||
};
|
||||
// To be moved to maploader later!
|
||||
|
||||
struct sidei_t // [RH] Only keep BOOM sidedef init stuff around for init
|
||||
{
|
||||
|
@ -253,121 +196,4 @@ extern sidei_t *sidetemp;
|
|||
extern TArray<FMapThing> MapThingsConverted;
|
||||
extern bool ForceNodeBuild;
|
||||
|
||||
struct FMissingCount
|
||||
{
|
||||
int Count = 0;
|
||||
};
|
||||
|
||||
typedef TMap<FString,FMissingCount> FMissingTextureTracker;
|
||||
struct FLevelLocals;
|
||||
|
||||
class MapLoader
|
||||
{
|
||||
friend class UDMFParser;
|
||||
void *level; // this is to hide the global variable and produce an error for referencing it.
|
||||
FLevelLocals *Level;
|
||||
|
||||
int firstglvertex; // helpers for loading GL nodes from GWA files.
|
||||
bool format5;
|
||||
|
||||
TArray<vertexdata_t> vertexdatas;
|
||||
|
||||
TMap<unsigned, unsigned> MapThingsUserDataIndex; // from mapthing idx -> user data idx
|
||||
TArray<FUDMFKey> MapThingsUserData;
|
||||
int sidecount;
|
||||
TArray<int> linemap;
|
||||
|
||||
TMap<int, EDLinedef> EDLines;
|
||||
TMap<int, EDSector> EDSectors;
|
||||
TMap<int, EDMapthing> EDThings;
|
||||
|
||||
void SlopeLineToPoint(int lineid, const DVector3 &pos, bool slopeCeil);
|
||||
void CopyPlane(int tag, sector_t *dest, bool copyCeil);
|
||||
void CopyPlane(int tag, const DVector2 &pos, bool copyCeil);
|
||||
void SetSlope(secplane_t *plane, bool setCeil, int xyangi, int zangi, const DVector3 &pos);
|
||||
void VavoomSlope(sector_t * sec, int id, const DVector3 &pos, int which);
|
||||
void SetSlopesFromVertexHeights(FMapThing *firstmt, FMapThing *lastmt, const int *oldvertextable);
|
||||
void AlignPlane(sector_t *sec, line_t *line, int which);
|
||||
|
||||
void InitED();
|
||||
void ProcessEDMapthing(FMapThing *mt, int recordnum);
|
||||
void ProcessEDLinedef(line_t *line, int recordnum);
|
||||
void ProcessEDSector(sector_t *sec, int recordnum);
|
||||
|
||||
int checkGLVertex(int num);
|
||||
int checkGLVertex3(int num);
|
||||
int CheckForMissingSegs();
|
||||
bool LoadGLVertexes(FileReader &lump);
|
||||
bool LoadGLSegs(FileReader &lump);
|
||||
bool LoadGLSubsectors(FileReader &lump);
|
||||
bool LoadNodes(FileReader &lump);
|
||||
bool DoLoadGLNodes(FileReader * lumps);
|
||||
void CreateCachedNodes(MapData *map);
|
||||
|
||||
void SetTexture(side_t *side, int position, const char *name, FMissingTextureTracker &track);
|
||||
void SetTexture(sector_t *sector, int index, int position, const char *name, FMissingTextureTracker &track, bool truncate);
|
||||
void SetTexture(side_t *side, int position, uint32_t *blend, const char *name);
|
||||
void SetTextureNoErr(side_t *side, int position, uint32_t *color, const char *name, bool *validcolor, bool isFog);
|
||||
|
||||
void FloodZone(sector_t *sec, int zonenum);
|
||||
void LoadGLZSegs(FileReader &data, int type);
|
||||
void LoadZSegs(FileReader &data);
|
||||
void LoadZNodes(FileReader &data, int glnodes);
|
||||
|
||||
int DetermineTranslucency(int lumpnum);
|
||||
void SetLineID(int i, line_t *ld);
|
||||
void SaveLineSpecial(line_t *ld);
|
||||
void FinishLoadingLineDef(line_t *ld, int alpha);
|
||||
void SetSideNum(side_t **sidenum_p, uint16_t sidenum);
|
||||
void AllocateSideDefs(MapData *map, int count);
|
||||
void ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, intmapsidedef_t *msd, int special, int tag, short *alpha, FMissingTextureTracker &missingtex);
|
||||
void SetMapThingUserData(AActor *actor, unsigned udi);
|
||||
void CreateBlockMap();
|
||||
|
||||
void AddToList(uint8_t *hitlist, FTextureID texid, int bitmask);
|
||||
|
||||
public:
|
||||
void LoadMapinfoACSLump();
|
||||
void ProcessEDSectors();
|
||||
|
||||
void FloodZones();
|
||||
void LoadVertexes(MapData * map);
|
||||
void LoadExtendedNodes(FileReader &dalump, uint32_t id);
|
||||
template<class segtype> void LoadSegs(MapData * map);
|
||||
template<class subsectortype, class segtype> void LoadSubsectors(MapData * map);
|
||||
template<class nodetype, class subsectortype> void LoadNodes(MapData * map);
|
||||
bool LoadGLNodes(MapData * map);
|
||||
bool CheckCachedNodes(MapData *map);
|
||||
bool CheckNodes(MapData * map, bool rebuilt, int buildtime);
|
||||
bool CheckForGLNodes();
|
||||
|
||||
void LoadSectors(MapData *map, FMissingTextureTracker &missingtex);
|
||||
void LoadThings(MapData * map);
|
||||
void LoadThings2(MapData * map);
|
||||
|
||||
void SpawnThings(int position);
|
||||
void FinishLoadingLineDefs();
|
||||
void LoadLineDefs(MapData * map);
|
||||
void LoadLineDefs2(MapData * map);
|
||||
void LoopSidedefs(bool firstloop);
|
||||
void LoadSideDefs2(MapData *map, FMissingTextureTracker &missingtex);
|
||||
void LoadBlockMap(MapData * map);
|
||||
void LoadReject(MapData * map, bool junk);
|
||||
void LoadBehavior(MapData * map);
|
||||
void GetPolySpots(MapData * map, TArray<FNodeBuilder::FPolyStart> &spots, TArray<FNodeBuilder::FPolyStart> &anchors);
|
||||
void GroupLines(bool buildmap);
|
||||
void PrecacheLevel();
|
||||
void ParseTextMap(MapData *map, FMissingTextureTracker &missingtex);
|
||||
void SummarizeMissingTextures(const FMissingTextureTracker &missing);
|
||||
void SetRenderSector();
|
||||
void SpawnSlopeMakers(FMapThing *firstmt, FMapThing *lastmt, const int *oldvertextable);
|
||||
void SetSlopes();
|
||||
void CopySlopes();
|
||||
|
||||
MapLoader(FLevelLocals *lev)
|
||||
{
|
||||
Level = lev;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
#include "p_setup.h"
|
||||
|
||||
#include "c_console.h"
|
||||
#include "maploader/maploader.h"
|
||||
|
||||
static FRandom pr_playerinspecialsector ("PlayerInSpecialSector");
|
||||
|
||||
|
|
Loading…
Reference in a new issue