mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-27 06:02:18 +00:00
- removed all skybox class types from code in preparation for exporting these classes.
- moved SectorPortal struct to FLevelLocals and exported it.
This commit is contained in:
parent
96777273c4
commit
a9ef73528d
15 changed files with 135 additions and 107 deletions
|
@ -480,11 +480,11 @@ size_t DObject::StaticPointerSubstitution (DObject *old, DObject *notOld, bool s
|
|||
changed += players[i].FixPointers (old, notOld);
|
||||
}
|
||||
|
||||
for (auto &s : sectorPortals)
|
||||
for (auto &s : level.sectorPortals)
|
||||
{
|
||||
if (s.mSkybox == old)
|
||||
{
|
||||
s.mSkybox = static_cast<ASkyViewpoint*>(notOld);
|
||||
s.mSkybox = static_cast<AActor*>(notOld);
|
||||
changed++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -329,7 +329,7 @@ static void MarkRoot()
|
|||
DThinker::MarkRoots();
|
||||
FCanvasTextureInfo::Mark();
|
||||
Mark(DACSThinker::ActiveThinker);
|
||||
for (auto &s : sectorPortals)
|
||||
for (auto &s : level.sectorPortals)
|
||||
{
|
||||
Mark(s.mSkybox);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,9 @@ struct FLevelLocals
|
|||
TStaticArray<line_t> lines;
|
||||
TStaticArray<side_t> sides;
|
||||
|
||||
TArray<FSectorPortal> sectorPortals;
|
||||
|
||||
|
||||
DWORD flags;
|
||||
DWORD flags2;
|
||||
DWORD flags3;
|
||||
|
@ -95,7 +98,37 @@ inline int line_t::Index() const
|
|||
return int(this - &level.lines[0]);
|
||||
}
|
||||
|
||||
inline FSectorPortal *line_t::GetTransferredPortal()
|
||||
{
|
||||
return portaltransferred >= level.sectorPortals.Size() ? (FSectorPortal*)nullptr : &level.sectorPortals[portaltransferred];
|
||||
}
|
||||
|
||||
inline int sector_t::Index() const
|
||||
{
|
||||
return int(this - &level.sectors[0]);
|
||||
}
|
||||
|
||||
inline FSectorPortal *sector_t::GetPortal(int plane)
|
||||
{
|
||||
return &level.sectorPortals[Portals[plane]];
|
||||
}
|
||||
|
||||
inline double sector_t::GetPortalPlaneZ(int plane)
|
||||
{
|
||||
return level.sectorPortals[Portals[plane]].mPlaneZ;
|
||||
}
|
||||
|
||||
inline DVector2 sector_t::GetPortalDisplacement(int plane)
|
||||
{
|
||||
return level.sectorPortals[Portals[plane]].mDisplacement;
|
||||
}
|
||||
|
||||
inline int sector_t::GetPortalType(int plane)
|
||||
{
|
||||
return level.sectorPortals[Portals[plane]].mType;
|
||||
}
|
||||
|
||||
inline int sector_t::GetOppositePortalGroup(int plane)
|
||||
{
|
||||
return level.sectorPortals[Portals[plane]].mDestination->PortalGroup;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "r_sky.h"
|
||||
#include "r_state.h"
|
||||
#include "portal.h"
|
||||
#include "g_levellocals.h"
|
||||
|
||||
// arg0 = Visibility*4 for this skybox
|
||||
|
||||
|
@ -49,17 +50,17 @@ void ASkyViewpoint::BeginPlay ()
|
|||
{
|
||||
Super::BeginPlay ();
|
||||
|
||||
if (tid == 0 && sectorPortals[0].mSkybox == nullptr)
|
||||
if (tid == 0 && level.sectorPortals[0].mSkybox == nullptr)
|
||||
{
|
||||
sectorPortals[0].mSkybox = this;
|
||||
sectorPortals[0].mDestination = Sector;
|
||||
level.sectorPortals[0].mSkybox = this;
|
||||
level.sectorPortals[0].mDestination = Sector;
|
||||
}
|
||||
}
|
||||
|
||||
void ASkyViewpoint::OnDestroy ()
|
||||
{
|
||||
// remove all sector references to ourselves.
|
||||
for (auto &s : sectorPortals)
|
||||
for (auto &s : level.sectorPortals)
|
||||
{
|
||||
if (s.mSkybox == this)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,6 @@ inline int getExtraLight()
|
|||
void gl_RecalcVertexHeights(vertex_t * v);
|
||||
FTextureID gl_GetSpriteFrame(unsigned sprite, int frame, int rot, angle_t ang, bool *mirror);
|
||||
|
||||
class AStackPoint;
|
||||
struct GLSectorStackPortal;
|
||||
|
||||
struct FPortal
|
||||
|
|
|
@ -43,9 +43,6 @@
|
|||
#include "gl/utility/gl_templates.h"
|
||||
#include "gl/data/gl_data.h"
|
||||
|
||||
class ASkyViewpoint;
|
||||
|
||||
|
||||
struct GLHorizonInfo
|
||||
{
|
||||
GLSectorPlane plane;
|
||||
|
|
|
@ -964,7 +964,7 @@ void G_SerializeLevel(FSerializer &arc, bool hubload)
|
|||
arc.Array("sectors", &level.sectors[0], &loadsectors[0], level.sectors.Size());
|
||||
arc("zones", Zones);
|
||||
arc("lineportals", linePortals);
|
||||
arc("sectorportals", sectorPortals);
|
||||
arc("sectorportals", level.sectorPortals);
|
||||
if (arc.isReading()) P_CollectLinkedPortals();
|
||||
|
||||
DThinker::SerializeThinkers(arc, !hubload);
|
||||
|
|
|
@ -845,12 +845,12 @@ void DWallLightTransfer::DoTransfer (short lightlevel, int target, BYTE flags)
|
|||
//---------------------------------------------------------------------------
|
||||
// Upper stacks go in the top sector. Lower stacks go in the bottom sector.
|
||||
|
||||
static void SetupFloorPortal (AStackPoint *point)
|
||||
static void SetupFloorPortal (AActor *point)
|
||||
{
|
||||
NActorIterator it (NAME_LowerStackLookOnly, point->tid);
|
||||
sector_t *Sector = point->Sector;
|
||||
ASkyViewpoint *skyv = static_cast<ASkyViewpoint*>(it.Next());
|
||||
if (skyv != NULL)
|
||||
auto skyv = it.Next();
|
||||
if (skyv != nullptr)
|
||||
{
|
||||
skyv->target = point;
|
||||
if (Sector->GetAlpha(sector_t::floor) == 1.)
|
||||
|
@ -860,12 +860,12 @@ static void SetupFloorPortal (AStackPoint *point)
|
|||
}
|
||||
}
|
||||
|
||||
static void SetupCeilingPortal (AStackPoint *point)
|
||||
static void SetupCeilingPortal (AActor *point)
|
||||
{
|
||||
NActorIterator it (NAME_UpperStackLookOnly, point->tid);
|
||||
sector_t *Sector = point->Sector;
|
||||
ASkyViewpoint *skyv = static_cast<ASkyViewpoint*>(it.Next());
|
||||
if (skyv != NULL)
|
||||
auto skyv = it.Next();
|
||||
if (skyv != nullptr)
|
||||
{
|
||||
skyv->target = point;
|
||||
if (Sector->GetAlpha(sector_t::ceiling) == 1.)
|
||||
|
@ -877,9 +877,9 @@ static void SetupCeilingPortal (AStackPoint *point)
|
|||
|
||||
void P_SetupPortals()
|
||||
{
|
||||
TThinkerIterator<AStackPoint> it;
|
||||
AStackPoint *pt;
|
||||
TArray<AStackPoint *> points;
|
||||
TThinkerIterator<AActor> it("StackPoint");
|
||||
AActor *pt;
|
||||
TArray<AActor *> points;
|
||||
|
||||
while ((pt = it.Next()))
|
||||
{
|
||||
|
@ -897,21 +897,21 @@ void P_SetupPortals()
|
|||
}
|
||||
// the semantics here are incredibly lax so the final setup can only be done once all portals have been created,
|
||||
// because later stackpoints will happily overwrite info in older ones, if there are multiple links.
|
||||
for (auto &s : sectorPortals)
|
||||
for (auto &s : level.sectorPortals)
|
||||
{
|
||||
if (s.mType == PORTS_STACKEDSECTORTHING && s.mSkybox)
|
||||
{
|
||||
for (auto &ss : sectorPortals)
|
||||
for (auto &ss : level.sectorPortals)
|
||||
{
|
||||
if (ss.mType == PORTS_STACKEDSECTORTHING && ss.mSkybox == s.mSkybox->target)
|
||||
{
|
||||
s.mPartner = unsigned((&ss) - §orPortals[0]);
|
||||
s.mPartner = unsigned((&ss) - &level.sectorPortals[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Now we can finally set the displacement and delete the stackpoint reference.
|
||||
for (auto &s : sectorPortals)
|
||||
for (auto &s : level.sectorPortals)
|
||||
{
|
||||
if (s.mType == PORTS_STACKEDSECTORTHING && s.mSkybox)
|
||||
{
|
||||
|
@ -932,7 +932,7 @@ static void SetPortal(sector_t *sector, int plane, unsigned pnum, double alpha)
|
|||
if (sector->GetAlpha(sector_t::ceiling) == 1.)
|
||||
sector->SetAlpha(sector_t::ceiling, alpha);
|
||||
|
||||
if (sectorPortals[pnum].mFlags & PORTSF_SKYFLATONLY)
|
||||
if (level.sectorPortals[pnum].mFlags & PORTSF_SKYFLATONLY)
|
||||
sector->SetTexture(sector_t::ceiling, skyflatnum);
|
||||
}
|
||||
}
|
||||
|
@ -945,7 +945,7 @@ static void SetPortal(sector_t *sector, int plane, unsigned pnum, double alpha)
|
|||
if (sector->GetAlpha(sector_t::floor) == 1.)
|
||||
sector->SetAlpha(sector_t::floor, alpha);
|
||||
|
||||
if (sectorPortals[pnum].mFlags & PORTSF_SKYFLATONLY)
|
||||
if (level.sectorPortals[pnum].mFlags & PORTSF_SKYFLATONLY)
|
||||
sector->SetTexture(sector_t::floor, skyflatnum);
|
||||
}
|
||||
}
|
||||
|
@ -1027,7 +1027,7 @@ void P_SpawnPortal(line_t *line, int sectortag, int plane, int bytealpha, int li
|
|||
|
||||
// This searches the viewpoint's sector
|
||||
// for a skybox line special, gets its tag and transfers the skybox to all tagged sectors.
|
||||
void P_SpawnSkybox(ASkyViewpoint *origin)
|
||||
void P_SpawnSkybox(AActor *origin)
|
||||
{
|
||||
sector_t *Sector = origin->Sector;
|
||||
if (Sector == NULL)
|
||||
|
@ -1260,8 +1260,8 @@ void P_SpawnSpecials (void)
|
|||
P_SpawnFriction(); // phares 3/12/98: New friction model using linedefs
|
||||
P_SpawnPushers(); // phares 3/20/98: New pusher model using linedefs
|
||||
|
||||
TThinkerIterator<ASkyCamCompat> it2;
|
||||
ASkyCamCompat *pt2;
|
||||
TThinkerIterator<AActor> it2("SkyCamCompat");
|
||||
AActor *pt2;
|
||||
while ((pt2 = it2.Next()))
|
||||
{
|
||||
P_SpawnSkybox(pt2);
|
||||
|
|
|
@ -62,7 +62,16 @@ FPortalBlockmap PortalBlockmap;
|
|||
TArray<FLinePortal> linePortals;
|
||||
TArray<FLinePortal*> linkedPortals; // only the linked portals, this is used to speed up looking for them in P_CollectConnectedGroups.
|
||||
|
||||
TArray<FSectorPortal> sectorPortals;
|
||||
|
||||
DEFINE_FIELD(FSectorPortal, mType);
|
||||
DEFINE_FIELD(FSectorPortal, mFlags);
|
||||
DEFINE_FIELD(FSectorPortal, mPartner);
|
||||
DEFINE_FIELD(FSectorPortal, mPlane);
|
||||
DEFINE_FIELD(FSectorPortal, mOrigin);
|
||||
DEFINE_FIELD(FSectorPortal, mDestination);
|
||||
DEFINE_FIELD(FSectorPortal, mDisplacement);
|
||||
DEFINE_FIELD(FSectorPortal, mPlaneZ);
|
||||
DEFINE_FIELD(FSectorPortal, mSkybox);
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
|
@ -490,15 +499,15 @@ void P_ClearPortals()
|
|||
Displacements.Create(1);
|
||||
linePortals.Clear();
|
||||
linkedPortals.Clear();
|
||||
sectorPortals.Resize(2);
|
||||
level.sectorPortals.Resize(2);
|
||||
// The first entry must always be the default skybox. This is what every sector gets by default.
|
||||
memset(§orPortals[0], 0, sizeof(sectorPortals[0]));
|
||||
sectorPortals[0].mType = PORTS_SKYVIEWPOINT;
|
||||
sectorPortals[0].mFlags = PORTSF_SKYFLATONLY;
|
||||
memset(&level.sectorPortals[0], 0, sizeof(level.sectorPortals[0]));
|
||||
level.sectorPortals[0].mType = PORTS_SKYVIEWPOINT;
|
||||
level.sectorPortals[0].mFlags = PORTSF_SKYFLATONLY;
|
||||
// The second entry will be the default sky. This is for forcing a regular sky through the skybox picker
|
||||
memset(§orPortals[1], 0, sizeof(sectorPortals[0]));
|
||||
sectorPortals[1].mType = PORTS_SKYVIEWPOINT;
|
||||
sectorPortals[1].mFlags = PORTSF_SKYFLATONLY;
|
||||
memset(&level.sectorPortals[1], 0, sizeof(level.sectorPortals[0]));
|
||||
level.sectorPortals[1].mType = PORTS_SKYVIEWPOINT;
|
||||
level.sectorPortals[1].mFlags = PORTSF_SKYFLATONLY;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
@ -651,19 +660,19 @@ void P_TranslatePortalZ(line_t* src, double& z)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
unsigned P_GetSkyboxPortal(ASkyViewpoint *actor)
|
||||
unsigned P_GetSkyboxPortal(AActor *actor)
|
||||
{
|
||||
if (actor == NULL) return 1; // this means a regular sky.
|
||||
for (unsigned i = 0;i<sectorPortals.Size();i++)
|
||||
for (unsigned i = 0;i<level.sectorPortals.Size();i++)
|
||||
{
|
||||
if (sectorPortals[i].mSkybox == actor) return i;
|
||||
if (level.sectorPortals[i].mSkybox == actor) return i;
|
||||
}
|
||||
unsigned i = sectorPortals.Reserve(1);
|
||||
memset(§orPortals[i], 0, sizeof(sectorPortals[i]));
|
||||
sectorPortals[i].mType = PORTS_SKYVIEWPOINT;
|
||||
sectorPortals[i].mFlags = actor->GetClass()->IsDescendantOf(RUNTIME_CLASS(ASkyCamCompat)) ? 0 : PORTSF_SKYFLATONLY;
|
||||
sectorPortals[i].mSkybox = actor;
|
||||
sectorPortals[i].mDestination = actor->Sector;
|
||||
unsigned i = level.sectorPortals.Reserve(1);
|
||||
memset(&level.sectorPortals[i], 0, sizeof(level.sectorPortals[i]));
|
||||
level.sectorPortals[i].mType = PORTS_SKYVIEWPOINT;
|
||||
level.sectorPortals[i].mFlags = actor->GetClass()->IsDescendantOf(PClass::FindActor("SkyCamCompat")) ? 0 : PORTSF_SKYFLATONLY;
|
||||
level.sectorPortals[i].mSkybox = actor;
|
||||
level.sectorPortals[i].mDestination = actor->Sector;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -677,14 +686,14 @@ unsigned P_GetSkyboxPortal(ASkyViewpoint *actor)
|
|||
|
||||
unsigned P_GetPortal(int type, int plane, sector_t *from, sector_t *to, const DVector2 &displacement)
|
||||
{
|
||||
unsigned i = sectorPortals.Reserve(1);
|
||||
memset(§orPortals[i], 0, sizeof(sectorPortals[i]));
|
||||
sectorPortals[i].mType = type;
|
||||
sectorPortals[i].mPlane = plane;
|
||||
sectorPortals[i].mOrigin = from;
|
||||
sectorPortals[i].mDestination = to;
|
||||
sectorPortals[i].mDisplacement = displacement;
|
||||
sectorPortals[i].mPlaneZ = type == PORTS_LINKEDPORTAL? from->GetPlaneTexZ(plane) : FLT_MAX;
|
||||
unsigned i = level.sectorPortals.Reserve(1);
|
||||
memset(&level.sectorPortals[i], 0, sizeof(level.sectorPortals[i]));
|
||||
level.sectorPortals[i].mType = type;
|
||||
level.sectorPortals[i].mPlane = plane;
|
||||
level.sectorPortals[i].mOrigin = from;
|
||||
level.sectorPortals[i].mDestination = to;
|
||||
level.sectorPortals[i].mDisplacement = displacement;
|
||||
level.sectorPortals[i].mPlaneZ = type == PORTS_LINKEDPORTAL? from->GetPlaneTexZ(plane) : FLT_MAX;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -698,14 +707,14 @@ unsigned P_GetPortal(int type, int plane, sector_t *from, sector_t *to, const DV
|
|||
|
||||
unsigned P_GetStackPortal(AActor *point, int plane)
|
||||
{
|
||||
unsigned i = sectorPortals.Reserve(1);
|
||||
memset(§orPortals[i], 0, sizeof(sectorPortals[i]));
|
||||
sectorPortals[i].mType = PORTS_STACKEDSECTORTHING;
|
||||
sectorPortals[i].mPlane = plane;
|
||||
sectorPortals[i].mOrigin = point->target->Sector;
|
||||
sectorPortals[i].mDestination = point->Sector;
|
||||
sectorPortals[i].mPlaneZ = FLT_MAX;
|
||||
sectorPortals[i].mSkybox = point;
|
||||
unsigned i = level.sectorPortals.Reserve(1);
|
||||
memset(&level.sectorPortals[i], 0, sizeof(level.sectorPortals[i]));
|
||||
level.sectorPortals[i].mType = PORTS_STACKEDSECTORTHING;
|
||||
level.sectorPortals[i].mPlane = plane;
|
||||
level.sectorPortals[i].mOrigin = point->target->Sector;
|
||||
level.sectorPortals[i].mDestination = point->Sector;
|
||||
level.sectorPortals[i].mPlaneZ = FLT_MAX;
|
||||
level.sectorPortals[i].mSkybox = point;
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -971,7 +980,7 @@ void P_CreateLinkedPortals()
|
|||
int id = 1;
|
||||
bool bogus = false;
|
||||
|
||||
for(auto &s : sectorPortals)
|
||||
for(auto &s : level.sectorPortals)
|
||||
{
|
||||
if (s.mType == PORTS_LINKEDPORTAL)
|
||||
{
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "m_bbox.h"
|
||||
|
||||
struct FPortalGroupArray;
|
||||
class ASkyViewpoint;
|
||||
struct portnode_t;
|
||||
//============================================================================
|
||||
//
|
||||
|
@ -237,8 +236,6 @@ struct FSectorPortal
|
|||
}
|
||||
};
|
||||
|
||||
extern TArray<FSectorPortal> sectorPortals;
|
||||
|
||||
//============================================================================
|
||||
//
|
||||
// Functions
|
||||
|
@ -256,7 +253,7 @@ inline int P_NumPortalGroups()
|
|||
{
|
||||
return Displacements.size;
|
||||
}
|
||||
unsigned P_GetSkyboxPortal(ASkyViewpoint *actor);
|
||||
unsigned P_GetSkyboxPortal(AActor *actor);
|
||||
unsigned P_GetPortal(int type, int plane, sector_t *orgsec, sector_t *destsec, const DVector2 &displacement);
|
||||
unsigned P_GetStackPortal(AActor *point, int plane);
|
||||
|
||||
|
|
36
src/r_defs.h
36
src/r_defs.h
|
@ -292,8 +292,6 @@ protected:
|
|||
bool CheckTrigger(AActor *triggerer) const;
|
||||
};
|
||||
|
||||
class ASkyViewpoint;
|
||||
|
||||
struct secplane_t
|
||||
{
|
||||
// the plane is defined as a*x + b*y + c*z + d = 0
|
||||
|
@ -925,30 +923,11 @@ public:
|
|||
portals[plane] = nullptr;
|
||||
}
|
||||
|
||||
FSectorPortal *GetPortal(int plane)
|
||||
{
|
||||
return §orPortals[Portals[plane]];
|
||||
}
|
||||
|
||||
double GetPortalPlaneZ(int plane)
|
||||
{
|
||||
return sectorPortals[Portals[plane]].mPlaneZ;
|
||||
}
|
||||
|
||||
DVector2 GetPortalDisplacement(int plane)
|
||||
{
|
||||
return sectorPortals[Portals[plane]].mDisplacement;
|
||||
}
|
||||
|
||||
int GetPortalType(int plane)
|
||||
{
|
||||
return sectorPortals[Portals[plane]].mType;
|
||||
}
|
||||
|
||||
int GetOppositePortalGroup(int plane)
|
||||
{
|
||||
return sectorPortals[Portals[plane]].mDestination->PortalGroup;
|
||||
}
|
||||
FSectorPortal *GetPortal(int plane);
|
||||
double GetPortalPlaneZ(int plane);
|
||||
DVector2 GetPortalDisplacement(int plane);
|
||||
int GetPortalType(int plane);
|
||||
int GetOppositePortalGroup(int plane);
|
||||
|
||||
void SetVerticesDirty()
|
||||
{
|
||||
|
@ -1312,10 +1291,7 @@ struct line_t
|
|||
alpha = a;
|
||||
}
|
||||
|
||||
FSectorPortal *GetTransferredPortal()
|
||||
{
|
||||
return portaltransferred >= sectorPortals.Size() ? (FSectorPortal*)NULL : §orPortals[portaltransferred];
|
||||
}
|
||||
FSectorPortal *GetTransferredPortal();
|
||||
|
||||
FLinePortal *getPortal() const
|
||||
{
|
||||
|
|
|
@ -1136,7 +1136,7 @@ void R_DrawPortals ()
|
|||
case PORTS_SKYVIEWPOINT:
|
||||
{
|
||||
// Don't let gun flashes brighten the sky box
|
||||
ASkyViewpoint *sky = barrier_cast<ASkyViewpoint*>(port->mSkybox);
|
||||
AActor *sky = port->mSkybox;
|
||||
extralight = 0;
|
||||
R_SetVisibility(sky->args[0] * 0.25f);
|
||||
|
||||
|
@ -1171,7 +1171,7 @@ void R_DrawPortals ()
|
|||
}
|
||||
|
||||
port->mFlags |= PORTSF_INSKYBOX;
|
||||
if (port->mPartner > 0) sectorPortals[port->mPartner].mFlags |= PORTSF_INSKYBOX;
|
||||
if (port->mPartner > 0) level.sectorPortals[port->mPartner].mFlags |= PORTSF_INSKYBOX;
|
||||
camera = NULL;
|
||||
viewsector = port->mDestination;
|
||||
assert(viewsector != NULL);
|
||||
|
@ -1234,7 +1234,7 @@ void R_DrawPortals ()
|
|||
R_DrawPlanes ();
|
||||
|
||||
port->mFlags &= ~PORTSF_INSKYBOX;
|
||||
if (port->mPartner > 0) sectorPortals[port->mPartner].mFlags &= ~PORTSF_INSKYBOX;
|
||||
if (port->mPartner > 0) level.sectorPortals[port->mPartner].mFlags &= ~PORTSF_INSKYBOX;
|
||||
}
|
||||
|
||||
// Draw all the masked textures in a second pass, in the reverse order they
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
class ASkyViewpoint;
|
||||
|
||||
namespace swrenderer
|
||||
{
|
||||
|
||||
|
|
|
@ -738,6 +738,9 @@ void InitThingdef()
|
|||
vertstruct->Size = sizeof(vertex_t);
|
||||
vertstruct->Align = alignof(vertex_t);
|
||||
|
||||
auto sectorportalstruct = NewNativeStruct("SectorPortal", nullptr);
|
||||
sectorportalstruct->Size = sizeof(FSectorPortal);
|
||||
sectorportalstruct->Align = alignof(FSectorPortal);
|
||||
|
||||
// set up the lines array in the sector struct. This is a bit messy because the type system is not prepared to handle a pointer to an array of pointers to a native struct even remotely well...
|
||||
// As a result, the size has to be set to something large and arbritrary because it can change between maps. This will need some serious improvement when things get cleaned up.
|
||||
|
@ -762,11 +765,12 @@ void InitThingdef()
|
|||
PField *levelf = new PField("level", lstruct, VARF_Native | VARF_Static, (intptr_t)&level);
|
||||
GlobalSymbols.AddSymbol(levelf);
|
||||
|
||||
// Add the sector array to LevelLocals.
|
||||
// Add the game data arrays to LevelLocals.
|
||||
lstruct->AddNativeField("sectors", NewPointer(NewResizableArray(sectorstruct), false), myoffsetof(FLevelLocals, sectors), VARF_Native);
|
||||
lstruct->AddNativeField("lines", NewPointer(NewResizableArray(linestruct), false), myoffsetof(FLevelLocals, lines), VARF_Native);
|
||||
lstruct->AddNativeField("sides", NewPointer(NewResizableArray(sidestruct), false), myoffsetof(FLevelLocals, sides), VARF_Native);
|
||||
lstruct->AddNativeField("vertexes", NewPointer(NewResizableArray(vertstruct), false), myoffsetof(FLevelLocals, vertexes), VARF_Native|VARF_ReadOnly);
|
||||
lstruct->AddNativeField("sectorportals", NewPointer(NewResizableArray(sectorportalstruct), false), myoffsetof(FLevelLocals, sectorPortals), VARF_Native);
|
||||
|
||||
// set up a variable for the DEH data
|
||||
PStruct *dstruct = NewNativeStruct("DehInfo", nullptr);
|
||||
|
|
|
@ -1,10 +1,24 @@
|
|||
|
||||
struct SectorPortal native
|
||||
{
|
||||
native int mType;
|
||||
native int mFlags;
|
||||
native uint mPartner;
|
||||
native int mPlane;
|
||||
native Sector mOrigin;
|
||||
native Sector mDestination;
|
||||
native Vector2 mDisplacement;
|
||||
native double mPlaneZ;
|
||||
native Actor mSkybox;
|
||||
};
|
||||
|
||||
|
||||
struct Vertex native
|
||||
{
|
||||
native readonly Vector2 p;
|
||||
}
|
||||
|
||||
struct Side
|
||||
struct Side native
|
||||
{
|
||||
enum ETexpart
|
||||
{
|
||||
|
@ -97,7 +111,7 @@ struct Line native
|
|||
native int special;
|
||||
native int args[5]; // <--- hexen-style arguments (expanded to ZDoom's full width)
|
||||
native double alpha; // <--- translucency (0=invisibile, FRACUNIT=opaque)
|
||||
//native Side sidedef[2];
|
||||
native Side sidedef[2];
|
||||
native readonly double bbox[4]; // bounding box, for the extent of the LineDef.
|
||||
native readonly Sector frontsector, backsector;
|
||||
native int validcount; // if == validcount, already checked
|
||||
|
|
Loading…
Reference in a new issue