exported the game specific sector/wall properties.

This commit is contained in:
Christoph Oelckers 2023-10-01 18:54:10 +02:00
parent 30d259f8b4
commit 5a26989d06
4 changed files with 39 additions and 21 deletions

View file

@ -210,7 +210,20 @@ DEFINE_FIELD_X(sectortype, sectortype, exflags)
DEFINE_FIELD_X(sectortype, sectortype, floorz)
DEFINE_FIELD_X(sectortype, sectortype, ceilingz)
//Duke specific
DEFINE_FIELD_X(sectortype, sectortype, lockinfo)
DEFINE_FIELD_X(sectortype, sectortype, shadedsector)
DEFINE_FIELD_X(sectortype, sectortype, hitagactor)
// Blood specific
DEFINE_FIELD_NAMED_X(sectortype, sectortype, _xs, x)
DEFINE_FIELD_X(sectortype, sectortype, upperLink)
DEFINE_FIELD_X(sectortype, sectortype, lowerLink)
DEFINE_FIELD_X(sectortype, sectortype, baseFloor)
DEFINE_FIELD_X(sectortype, sectortype, baseCeil)
DEFINE_FIELD_X(sectortype, sectortype, velFloor)
DEFINE_FIELD_X(sectortype, sectortype, velCeil)
DEFINE_FIELD_X(sectortype, sectortype, slopewallofs)
DEFINE_FIELD_NAMED_X(walltype, walltype, xpan_, xpan)
DEFINE_FIELD_NAMED_X(walltype, walltype, ypan_, ypan)
@ -230,6 +243,7 @@ DEFINE_FIELD_X(walltype, walltype, shade)
DEFINE_FIELD_X(walltype, walltype, pal)
DEFINE_FIELD_NAMED_X(walltype, walltype, xrepeat, xrepeat)
DEFINE_FIELD_NAMED_X(walltype, walltype, yrepeat, yrepeat)
DEFINE_FIELD_NAMED_X(walltype, walltype, _xw, x)
DEFINE_FIELD_NAMED_X(tspritetype, tspritetype, sectp, sector)
DEFINE_FIELD_X(tspritetype, tspritetype, cstat)

View file

@ -552,6 +552,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, XSECTOR& w, XSECTO
if (arc.BeginObject(keyname))
{
arc("flags", w.flags, def->flags)
("flags2", w.flags2, def->flags2)
("busy", w.busy, def->busy)
("data", w.data, def->data)
("txid", w.txID, def->txID)

View file

@ -140,7 +140,7 @@ struct XSECTOR {
union
{
uint64_t flags;
uint32_t flags;
struct {
unsigned int state : 1; // State
unsigned int triggerOn : 1; // Send at ON
@ -173,13 +173,19 @@ struct XSECTOR {
unsigned int Crush : 1; // Crush
unsigned int locked : 1; // Locked
unsigned int windAlways : 1; // Wind always
};
};
union
{
int32_t flags2;
struct
{
unsigned int dudeLockout : 1;
unsigned int bobAlways : 1; // Motion always
unsigned int bobFloor : 1; // Motion bob floor
unsigned int bobCeiling : 1; // Motion bob ceiling
unsigned int bobRotate : 1; // Motion rotate
unsigned int unused1 : 1; // (new) pause motion
};
};
DBloodActor* marker0;

View file

@ -170,31 +170,26 @@ struct sectortype native
// new additions not from the binary map format.
native uint8 exflags;
// TODO: Later this must hide the parts unrelated to the current game because these variables occupy the same space! The compiler cannot do that right now.
// Duke
native uint8 lockinfo; // This was originally the repurposed filler byte.
native uint8 shadedsector;
DukeActor hitagactor; // we need this because Duke stores an actor in the hitag field. Is really a DDukeActor, but cannot be declared here safely.
//native XSECTOR x;
native BloodActor upperLink;
native BloodActor lowerLink;
native double baseFloor;
native double baseCeil;
native double velFloor;
native double velCeil;
/*
// Game specific extensions. Only export what's really needed.
union
{
struct // DukeRR
{
uint8_t keyinfo; // This was originally the repurposed filler byte.
uint8_t shadedsector;
TObjPtr<DCoreActor*> hitagactor; // we need this because Duke stores an actor in the hitag field. Is really a DDukeActor, but cannot be declared here safely.
}
struct // Blood
{
BLD_NS::XSECTOR* _xs;
TObjPtr<DCoreActor*> upperLink;
TObjPtr<DCoreActor*> lowerLink;
double baseFloor;
double baseCeil;
double velFloor;
double velCeil;
uint8_t slopewallofs; // This was originally the repurposed filler byte.
}
struct // Exhumed
{
sectortype* pSoundSect;
@ -283,8 +278,10 @@ struct walltype native
native int8 shade;
native uint8 pal;
//native uint8 xrepeat;
//native uint8 xrepeat; // these are still bytes, do not export unless floatified
//native uint8 yrepeat;
//native XWALL x;
native void setxpan(double add);