mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- split several texture flags off into a surface type value.
Using the same field in the TexExtInfo struct as Blood's surfType. This frees up a lot of flags for later use.
This commit is contained in:
parent
1a98f9b478
commit
4a306a21dc
30 changed files with 216 additions and 86 deletions
|
@ -525,6 +525,49 @@ void FMapInfoParser::ParseTextureFlags()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void FMapInfoParser::ParseSurfaceTypes()
|
||||
{
|
||||
int num = -1;
|
||||
|
||||
// this block deliberately uses a 'type = texture, texture...' syntax because it is a lot easier to handle than doing the reverse
|
||||
sc.MustGetStringName("{");
|
||||
while (!sc.CheckString("}"))
|
||||
{
|
||||
// Do not use internal lookup here because this code must be able to gracefully skip the definition if the flag constant does not exist.
|
||||
// This also blocks passing in literal numbers which is quite intentional.
|
||||
sc.MustGetString();
|
||||
FName cname(sc.String, true);
|
||||
auto lookup = cname == NAME_None ? nullptr : sc.LookupSymbol(cname);
|
||||
num = 0;
|
||||
if (lookup) num = int(lookup->Number);
|
||||
else
|
||||
sc.ScriptMessage("'%s': Unknown surface type", sc.String);
|
||||
ParseAssign();
|
||||
do
|
||||
{
|
||||
sc.MustGetString();
|
||||
// this must also get null textures and ones not yet loaded.
|
||||
auto tex = TexMan.CheckForTexture(sc.String, ETextureType::Any, FTextureManager::TEXMAN_ReturnAll | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ForceLookup);
|
||||
|
||||
if (!tex.isValid())
|
||||
{
|
||||
sc.ScriptMessage("textureflags:Unknown texture name '%s'", sc.String);
|
||||
}
|
||||
else
|
||||
{
|
||||
AccessExtInfo(tex).surftype = num;
|
||||
}
|
||||
|
||||
} while (sc.CheckString(","));
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FMapInfoParser::ParseCutscene(CutsceneDef& cdef)
|
||||
{
|
||||
FString sound;
|
||||
|
@ -1580,6 +1623,10 @@ void FMapInfoParser::ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord
|
|||
{
|
||||
ParseTextureFlags();
|
||||
}
|
||||
else if (sc.Compare("surfacetypes"))
|
||||
{
|
||||
ParseSurfaceTypes();
|
||||
}
|
||||
else if (sc.Compare("constants"))
|
||||
{
|
||||
ParseConstants();
|
||||
|
|
|
@ -94,6 +94,7 @@ struct FMapInfoParser
|
|||
void ParseBreakWall();
|
||||
void ParseBreakCeiling();
|
||||
void ParseTextureFlags();
|
||||
void ParseSurfaceTypes();
|
||||
void ParseConstants();
|
||||
void ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord &defaultinfo);
|
||||
|
||||
|
|
|
@ -142,3 +142,13 @@ inline const TileOffs* GetHiresOffset(FTextureID tex)
|
|||
else return nullptr;
|
||||
}
|
||||
|
||||
inline const unsigned tileflags(FTextureID texid)
|
||||
{
|
||||
return GetExtInfo(texid).flags;
|
||||
}
|
||||
|
||||
inline const uint8_t tilesurface(FTextureID texid)
|
||||
{
|
||||
return GetExtInfo(texid).surftype;
|
||||
}
|
||||
|
||||
|
|
|
@ -1753,6 +1753,11 @@ void think_d(void)
|
|||
doanimations();
|
||||
tickstat(STAT_FX); //ST 11
|
||||
|
||||
#if 0 // still needs a bit of work.
|
||||
if (numplayers < 2 && thunderon)
|
||||
thunder();
|
||||
#endif
|
||||
|
||||
thinktime.Unclock();
|
||||
}
|
||||
|
||||
|
|
|
@ -477,9 +477,9 @@ void thunder(void)
|
|||
thunder_brightness = brightness;
|
||||
}
|
||||
}
|
||||
if (!winderflash)
|
||||
if (!winderflash && isRR())
|
||||
{
|
||||
auto tex = tileGetTexture(RTILE_RRTILE2562);
|
||||
auto tex = tileGetTexture(RTILE_CATACOMB); // this cannot be easily generalized. :(
|
||||
if (tex->isSeen(true))
|
||||
{
|
||||
if (krand() > 65000)
|
||||
|
|
|
@ -1787,7 +1787,7 @@ static int fallspecial(DDukeActor *actor, int playernum)
|
|||
actor->attackertype = RTILE_SHOTSPARK1;
|
||||
actor->hitextra = 1;
|
||||
}
|
||||
else if (isRRRA() && (actor->sector()->floorpicnum == RTILE_RRTILE7820 || actor->sector()->floorpicnum == RTILE_RRTILE7768))
|
||||
else if (tilesurface(actor->sector()->floortexture()) == TSURF_MAGMA)
|
||||
{
|
||||
if (actor->spr.picnum != RTILE_MINION && actor->spr.pal != 19)
|
||||
{
|
||||
|
@ -1885,7 +1885,7 @@ void destroyit(DDukeActor *actor)
|
|||
destsect->ceilingpal = srcsect->ceilingpal;
|
||||
destsect->ceilingxpan_ = srcsect->ceilingxpan_;
|
||||
destsect->ceilingypan_ = srcsect->ceilingypan_;
|
||||
destsect->floorpicnum = srcsect->floorpicnum;
|
||||
destsect->setfloortexture(srcsect->floortexture());
|
||||
destsect->floorheinum = srcsect->floorheinum;
|
||||
destsect->floorshade = srcsect->floorshade;
|
||||
destsect->floorpal = srcsect->floorpal;
|
||||
|
@ -1943,8 +1943,6 @@ bool spawnweapondebris_r(int picnum)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void thunder(void);
|
||||
|
||||
void think_r(void)
|
||||
{
|
||||
thinktime.Reset();
|
||||
|
|
|
@ -276,7 +276,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
|
||||
case DTILE_WATERBUBBLE:
|
||||
if (t->sectp->floorpicnum == DTILE_FLOORSLIME)
|
||||
if (tilesurface(t->sectp->floortexture()) == TSURF_SLIME)
|
||||
{
|
||||
t->pal = 7;
|
||||
break;
|
||||
|
|
|
@ -325,7 +325,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
|
|||
break;
|
||||
|
||||
case RTILE_WATERBUBBLE:
|
||||
if (t->sectp->floorpicnum == RTILE_FLOORSLIME)
|
||||
if (tilesurface(t->sectp->floortexture()) == TSURF_SLIME)
|
||||
{
|
||||
t->pal = 7;
|
||||
break;
|
||||
|
|
|
@ -417,16 +417,25 @@ enum
|
|||
{
|
||||
TFLAG_WALLSWITCH = 1 << 0,
|
||||
TFLAG_ADULT = 1 << 1,
|
||||
TFLAG_ELECTRIC = 1 << 2,
|
||||
TFLAG_CLEARINVENTORY = 1 << 3, // really dumb Duke stuff...
|
||||
TFLAG_SLIME = 1 << 4,
|
||||
TFLAG_DOORWALL = 1 << 5,
|
||||
TFLAG_BLOCKDOOR = 1 << 6,
|
||||
TFLAG_OUTERSPACE = 1 << 7,
|
||||
TFLAG_NOBLOODSPLAT = 1 << 8,
|
||||
TFLAG_NOCIRCLEREFLECT = 1 << 9,
|
||||
TFLAG_MUDDY = 1 << 10,
|
||||
TFLAG_PURPLELAVA = 1 << 11, // very special kind of terrain type.
|
||||
TFLAG_CLEARINVENTORY = 1 << 2, // really dumb Duke stuff...
|
||||
TFLAG_DOORWALL = 1 << 3,
|
||||
TFLAG_BLOCKDOOR = 1 << 4,
|
||||
TFLAG_NOBLOODSPLAT = 1 << 5,
|
||||
TFLAG_NOCIRCLEREFLECT = 1 << 6,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TSURF_NONE = 0,
|
||||
TSURF_ELECTRIC = 1,
|
||||
TSURF_SLIME = 2,
|
||||
TSURF_OUTERSPACE = 3,
|
||||
TSURF_MUDDY = 4,
|
||||
TSURF_PURPLELAVA = 5, // very special kind of terrain type.
|
||||
TSURF_SCROLLSKY = 6,
|
||||
TSURF_THUNDERSKY = 7,
|
||||
TSURF_PLASMA = 8,
|
||||
TSURF_MAGMA = 9,
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
|
@ -219,6 +219,7 @@ void PlayerColorChanged(void);
|
|||
bool movementBlocked(player_struct *p);
|
||||
void loadcons();
|
||||
void DrawStatusBar();
|
||||
void thunder(void);
|
||||
|
||||
void drawshadows(tspriteArray& tsprites, tspritetype* t, DDukeActor* h);
|
||||
void applyanimations(tspritetype* t, DDukeActor* h, const DVector2& viewVec, DAngle viewang);
|
||||
|
|
|
@ -2296,7 +2296,7 @@ int ParseState::parse(void)
|
|||
parseifelse(ud.coop || numplayers > 2);
|
||||
break;
|
||||
case concmd_ifonmud:
|
||||
parseifelse(abs(g_ac->spr.pos.Z - g_ac->sector()->floorz) < 32 && (tileflags(g_ac->sector()->floortexture()) & TFLAG_MUDDY) != 0);
|
||||
parseifelse(abs(g_ac->spr.pos.Z - g_ac->sector()->floorz) < 32 && (tilesurface(g_ac->sector()->floortexture()) == TSURF_MUDDY) != 0);
|
||||
break;
|
||||
case concmd_ifonwater:
|
||||
parseifelse( abs(g_ac->spr.pos.Z-g_ac->sector()->floorz) < 32 && g_ac->sector()->lotag == ST_1_ABOVE_WATER);
|
||||
|
|
|
@ -120,11 +120,6 @@ inline bool inventory(DDukeActor* S)
|
|||
return actorflag(S, SFLAG_INVENTORY);
|
||||
}
|
||||
|
||||
inline const unsigned& tileflags(FTextureID texid)
|
||||
{
|
||||
return GetExtInfo(texid).flags;
|
||||
}
|
||||
|
||||
inline bool wallswitchcheck(DDukeActor* s)
|
||||
{
|
||||
return !!(tileflags(s->spr.spritetexture()) & TFLAG_WALLSWITCH);
|
||||
|
|
|
@ -767,7 +767,7 @@ x(ORDERING, 2531)
|
|||
x(TEXTSTORY, 2541)
|
||||
x(LOADSCREEN, 2542)
|
||||
y(RRTILE2560, 2560)
|
||||
y(RRTILE2562, 2562)
|
||||
y(CATACOMB, 2562)
|
||||
y(RRTILE2564, 2564)
|
||||
y(RRTILE2573, 2573)
|
||||
y(RRTILE2574, 2574)
|
||||
|
@ -1261,9 +1261,9 @@ y(HOTELSIGN, 7711)
|
|||
y(HOTELSIGNBROKE, 7712)
|
||||
y(RRTILE7716, 7716)
|
||||
y(RRTILE7756, 7756)
|
||||
y(RRTILE7768, 7768)
|
||||
y(MAGMA1, 7768)
|
||||
y(RRTILE7806, 7806)
|
||||
y(RRTILE7820, 7820)
|
||||
y(MAGMA2, 7820)
|
||||
y(RRTILE7859, 7859)
|
||||
y(RRTILE7870, 7870)
|
||||
y(RRTILE7873, 7873)
|
||||
|
|
|
@ -84,7 +84,7 @@ int setpal(player_struct* p)
|
|||
if (p->DrugMode) palette = DRUGPAL;
|
||||
else if (p->heat_on) palette = SLIMEPAL;
|
||||
else if (!p->insector()) palette = BASEPAL; // don't crash if out of range.
|
||||
else if (tileflags(p->cursector->ceilingtexture()) & TFLAG_SLIME) palette = SLIMEPAL;
|
||||
else if (tilesurface(p->cursector->ceilingtexture()) == TSURF_SLIME) palette = SLIMEPAL;
|
||||
else if (p->cursector->lotag == ST_2_UNDERWATER) palette = WATERPAL;
|
||||
else palette = BASEPAL;
|
||||
return palette;
|
||||
|
@ -1003,7 +1003,7 @@ void purplelavacheck(player_struct* p)
|
|||
{
|
||||
auto sect = pact->sector();
|
||||
// one texflag for a single texture again, just to avoid one hard coded check...
|
||||
if ((tileflags(sect->floortexture()) & TFLAG_PURPLELAVA) || (tileflags(sect->ceilingtexture()) & TFLAG_PURPLELAVA))
|
||||
if ((tilesurface(sect->floortexture()) & TSURF_PURPLELAVA) || (tilesurface(sect->ceilingtexture()) & TSURF_PURPLELAVA))
|
||||
{
|
||||
if (p->boot_amount > 0)
|
||||
{
|
||||
|
|
|
@ -1756,7 +1756,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
p->dummyplayersprite = spawn(pact, DTILE_PLAYERONWATER);
|
||||
|
||||
p->footprintcount = 6;
|
||||
if (p->cursector->floorpicnum == DTILE_FLOORSLIME)
|
||||
if (tilesurface(p->cursector->floortexture()) == TSURF_SLIME)
|
||||
p->footprintpal = 8;
|
||||
else p->footprintpal = 0;
|
||||
p->footprintshade = 0;
|
||||
|
@ -2888,14 +2888,13 @@ void processinput_d(int snum)
|
|||
if (p->spritebridge == 0 && pact->insector())
|
||||
{
|
||||
auto sect = pact->sector();
|
||||
|
||||
k = 0;
|
||||
|
||||
if (p->on_ground && truefdist <= gs.playerheight + 16)
|
||||
{
|
||||
int j = sect->floorpicnum;
|
||||
int whichsound = (tileflags(tileGetTextureID(j)) & TFLAG_ELECTRIC) ? 0 : j == DTILE_FLOORSLIME ? 1 : j == DTILE_FLOORPLASMA ? 2 : -1;
|
||||
if (j >= 0) k = makepainsounds(snum, whichsound);
|
||||
int surface = tilesurface(sect->floortexture());
|
||||
int whichsound = surface == TSURF_ELECTRIC? 0 : surface == TSURF_SLIME? 1 : surface == TSURF_PLASMA? 2 : -1;
|
||||
k = makepainsounds(snum, whichsound);
|
||||
}
|
||||
|
||||
if (k)
|
||||
|
|
|
@ -2002,7 +2002,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo
|
|||
p->dummyplayersprite = spawn(pact, RTILE_PLAYERONWATER);
|
||||
|
||||
p->footprintcount = 6;
|
||||
if (p->cursector->floorpicnum == RTILE_FLOORSLIME)
|
||||
if (tilesurface(p->cursector->floortexture()) == TSURF_SLIME)
|
||||
{
|
||||
p->footprintpal = 8;
|
||||
p->footprintshade = 0;
|
||||
|
@ -3498,14 +3498,14 @@ void processinput_r(int snum)
|
|||
|
||||
if (p->spritebridge == 0 && pact->insector())
|
||||
{
|
||||
int j = pact->sector()->floorpicnum;
|
||||
auto sect = pact->sector();
|
||||
k = 0;
|
||||
|
||||
if (p->on_ground && truefdist <= gs.playerheight + 16)
|
||||
{
|
||||
int whichsound = (tileflags(tileGetTextureID(j)) & TFLAG_ELECTRIC) ? 0 : j == RTILE_FLOORSLIME ? 1 : j == RTILE_FLOORPLASMA ? 2 :
|
||||
(isRRRA() && (j == RTILE_RRTILE7768 || j == RTILE_RRTILE7820) ? 3 : -1);
|
||||
if (j >= 0) k = makepainsounds(snum, whichsound);
|
||||
int surface = tilesurface(sect->floortexture());
|
||||
int whichsound = surface == TSURF_ELECTRIC ? 0 : surface == TSURF_SLIME ? 1 : surface == TSURF_PLASMA ? 2 : surface == TSURF_MAGMA ? 3 : -1;
|
||||
k = makepainsounds(snum, whichsound);
|
||||
}
|
||||
|
||||
if (k)
|
||||
|
|
|
@ -123,7 +123,7 @@ void fakedomovethings(void)
|
|||
|
||||
shrunk = (p->GetActor()->s.y_repeat < (isRR()? 8 : 32));
|
||||
|
||||
if( ud.clipping == 0 && ( psect->floorpicnum == MIRROR || psect == nullptr) )
|
||||
if( ud.clipping == 0 && ( psect->floortexture == mirrortex || psect == nullptr) )
|
||||
{
|
||||
mypos.XY() = omypos.XY();
|
||||
}
|
||||
|
|
|
@ -689,7 +689,7 @@ void prelevel_common(int g)
|
|||
|
||||
if (sectp->ceilingstat & CSTAT_SECTOR_SKY)
|
||||
{
|
||||
if (sectp->ceilingpicnum == TILE_CLOUDYSKIES && numclouds < 127)
|
||||
if (tilesurface(sectp->ceilingtexture()) == TSURF_SCROLLSKY && numclouds < 127)
|
||||
clouds[numclouds++] = sectp;
|
||||
|
||||
if (ps[0].one_parallax_sectnum == nullptr)
|
||||
|
@ -868,7 +868,7 @@ static void SpawnPortals()
|
|||
for (unsigned i = 0; i < sector.Size(); i++)
|
||||
{
|
||||
auto sectp = §or[i];
|
||||
if (sectp->floorpicnum == FOF && sectp->portalflags != PORTAL_SECTOR_FLOOR)
|
||||
if (sectp->floortexture() == foftex && sectp->portalflags != PORTAL_SECTOR_FLOOR)
|
||||
{
|
||||
for (auto& pt : allPortals)
|
||||
{
|
||||
|
@ -979,6 +979,12 @@ static int LoadTheMap(MapRecord *mi, player_struct*p, int gamemode)
|
|||
|
||||
auto actorlist = spawnactors(sprites);
|
||||
|
||||
for (auto& sect : sector)
|
||||
{
|
||||
if (tilesurface(sect.ceilingtexture()) == TSURF_THUNDERSKY)
|
||||
thunderon = 1;
|
||||
}
|
||||
|
||||
if (isRR()) prelevel_r(gamemode, actorlist);
|
||||
else prelevel_d(gamemode, actorlist);
|
||||
|
||||
|
|
|
@ -432,8 +432,6 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
|
|||
for (auto§: sector)
|
||||
{
|
||||
auto sectp = §
|
||||
if (sectp->ceilingpicnum == RTILE_RRTHUNDERSKY)
|
||||
thunderon = 1;
|
||||
|
||||
switch (sectp->lotag)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@ static int interptype[] = { Interp_Sect_Floorz, Interp_Sect_Ceilingz, Interp_Wal
|
|||
|
||||
bool ceilingspace(sectortype* sectp)
|
||||
{
|
||||
return (sectp && (sectp->ceilingstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0 && (tileflags(sectp->ceilingtexture()) & TFLAG_OUTERSPACE));
|
||||
return (sectp && (sectp->ceilingstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0 && (tilesurface(sectp->ceilingtexture()) == TSURF_OUTERSPACE));
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ bool ceilingspace(sectortype* sectp)
|
|||
bool floorspace(sectortype* sectp)
|
||||
{
|
||||
// Yes, ceilingpal in this check is correct...
|
||||
return (sectp && (sectp->floorstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0 && (tileflags(sectp->floortexture()) & TFLAG_OUTERSPACE));
|
||||
return (sectp && (sectp->floorstat & CSTAT_SECTOR_SKY) && sectp->ceilingpal == 0 && (tilesurface(sectp->floortexture()) == TSURF_OUTERSPACE));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -1284,6 +1284,18 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, operateactivators, operateactivators)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int duke_floorsurface(sectortype* sector)
|
||||
{
|
||||
return tilesurface(sector->floortexture());
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, floorsurface, duke_floorsurface)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_POINTER(sect, sectortype);
|
||||
ACTION_RETURN_INT(duke_floorsurface(sect));
|
||||
}
|
||||
|
||||
int duke_floorflags(sectortype* sector)
|
||||
{
|
||||
return tileflags(sector->floortexture());
|
||||
|
@ -1308,6 +1320,18 @@ DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, ceilingflags, duke_ceilingflags)
|
|||
ACTION_RETURN_INT(duke_ceilingflags(sect));
|
||||
}
|
||||
|
||||
int duke_ceilingsurface(sectortype* sector)
|
||||
{
|
||||
return tilesurface(sector->ceilingtexture());
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(_DukeLevel, ceilingsurface, duke_ceilingsurface)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_POINTER(sect, sectortype);
|
||||
ACTION_RETURN_INT(duke_ceilingsurface(sect));
|
||||
}
|
||||
|
||||
int duke_wallflags(walltype* wal, int which)
|
||||
{
|
||||
return tileflags(which? wal->overtexture() : wal->walltexture());
|
||||
|
|
|
@ -2,18 +2,25 @@
|
|||
|
||||
constants
|
||||
{
|
||||
// Tile flags.
|
||||
TFLAG_WALLSWITCH = 1
|
||||
TFLAG_ADULT = 2
|
||||
TFLAG_ELECTRIC = 4
|
||||
TFLAG_CLEARINVENTORY = 8
|
||||
TFLAG_SLIME = 16
|
||||
TFLAG_DOORWALL = 32
|
||||
TFLAG_BLOCKDOOR = 64
|
||||
TFLAG_OUTERSPACE = 128
|
||||
TFLAG_NOBLOODSPLAT = 256
|
||||
TFLAG_NOCIRCLEREFLECT = 512
|
||||
TFLAG_MUDDY = 1024
|
||||
TFLAG_PURPLELAVA = 2048
|
||||
// texture flags
|
||||
TFLAG_WALLSWITCH = 1
|
||||
TFLAG_ADULT = 2
|
||||
TFLAG_CLEARINVENTORY = 4 // really dumb Duke stuff...
|
||||
TFLAG_DOORWALL = 8
|
||||
TFLAG_BLOCKDOOR = 16
|
||||
TFLAG_NOBLOODSPLAT = 32
|
||||
TFLAG_NOCIRCLEREFLECT = 64
|
||||
|
||||
// surface (terrain/environment) types
|
||||
TSURF_NONE = 0
|
||||
TSURF_ELECTRIC = 1
|
||||
TSURF_SLIME = 2
|
||||
TSURF_OUTERSPACE = 3
|
||||
TSURF_MUDDY = 4
|
||||
TSURF_PURPLELAVA = 5 // very special kind of terrain type.
|
||||
TSURF_SCROLLSKY = 6
|
||||
TSURF_THUNDERSKY = 7
|
||||
TSURF_PLASMA = 8
|
||||
TSURF_MAGMA = 9
|
||||
}
|
||||
|
||||
|
|
|
@ -127,9 +127,14 @@ textureflags
|
|||
DOORTILE22,
|
||||
DOORTILE23
|
||||
|
||||
// should be made terrain types later
|
||||
TFLAG_ELECTRIC = HURTRAIL
|
||||
TFLAG_SLIME = FLOORSLIME, FLOORSLIME1, FLOORSLIME2
|
||||
TFLAG_OUTERSPACE = MOONSKY1, BIGORBIT1
|
||||
TFLAG_PURPLELAVA = PURPLELAVA
|
||||
}
|
||||
|
||||
surfacetypes
|
||||
{
|
||||
TSURF_ELECTRIC = HURTRAIL
|
||||
TSURF_SLIME = FLOORSLIME, FLOORSLIME1, FLOORSLIME2
|
||||
TSURF_OUTERSPACE = MOONSKY1, BIGORBIT1
|
||||
TSURF_PURPLELAVA = PURPLELAVA
|
||||
TSURF_PLASMA = FLOORPLASMA
|
||||
TSURF_SCROLLSKY = CLOUDYSKIES
|
||||
}
|
|
@ -33,4 +33,8 @@ textureflags
|
|||
RRTILE8565,
|
||||
RRTILE8605
|
||||
}
|
||||
|
||||
|
||||
surfacetypes
|
||||
{
|
||||
TSURF_MAGMA = MAGMA1, MAGMA2
|
||||
}
|
||||
|
|
|
@ -47,11 +47,6 @@ textureflags
|
|||
CHICKENPLANTBUTTON,
|
||||
CHICKENPLANTBUTTONON
|
||||
|
||||
TFLAG_ELECTRIC = HURTRAIL
|
||||
TFLAG_CLEARINVENTORY = HURTRAIL, FLOORSLIME, FLOORPLASMA
|
||||
TFLAG_SLIME = FLOORSLIME, FLOORSLIME1, FLOORSLIME2
|
||||
TFLAG_MUDDY = MUDDY
|
||||
|
||||
TFLAG_DOORWALL =
|
||||
DOORTILE1,
|
||||
DOORTILE2,
|
||||
|
@ -164,4 +159,17 @@ textureflags
|
|||
RRTILE3827,
|
||||
RRTILE3837
|
||||
|
||||
}
|
||||
TFLAG_CLEARINVENTORY = HURTRAIL, FLOORSLIME, FLOORPLASMA
|
||||
}
|
||||
|
||||
|
||||
surfacetypes
|
||||
{
|
||||
TSURF_ELECTRIC = HURTRAIL
|
||||
TSURF_SLIME = FLOORSLIME, FLOORSLIME1, FLOORSLIME2
|
||||
TSURF_OUTERSPACE = MOONSKY1, BIGORBIT1
|
||||
TSURF_PLASMA = FLOORPLASMA
|
||||
TSURF_MUDDY = MUDDY
|
||||
TSURF_THUNDERSKY = RRTHUNDERSKY
|
||||
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class DukeBolt1 : DukeActor
|
|||
|
||||
if (l & 1) self.cstat ^= CSTAT_SPRITE_TRANSLUCENT;
|
||||
|
||||
if (self.spritesetindex == 1 && random(0, 7) == 0 && (dlevel.floorflags(sectp) & Duke.TFLAG_ELECTRIC))
|
||||
if (self.spritesetindex == 1 && random(0, 7) == 0 && (dlevel.floorsurface(sectp) == Duke.TSURF_ELECTRIC))
|
||||
self.PlayActorSound("SHORT_CIRCUIT");
|
||||
|
||||
if (self.spritesetindex & 1)
|
||||
|
@ -132,7 +132,7 @@ class DukeSideBolt1 : DukeBolt1
|
|||
}
|
||||
self.SetSpriteSetImage((self.spritesetindex + 1) % self.GetSpriteSetSize());
|
||||
|
||||
if (random(0, 1) && (dlevel.floorflags(sectp) & Duke.TFLAG_ELECTRIC))
|
||||
if (random(0, 1) && (dlevel.floorsurface(sectp) == Duke.TSURF_ELECTRIC))
|
||||
self.PlayActorSound("SHORT_CIRCUIT");
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class DukeWatersplash : DukeActor
|
|||
self.pos.Z = f;
|
||||
}
|
||||
|
||||
if ((dlevel.floorflags(sectp) & Duke.TFLAG_SLIME) || (dlevel.ceilingflags(sectp) & Duke.TFLAG_SLIME))
|
||||
if ((dlevel.floorsurface(sectp) == Duke.TSURF_SLIME) || (dlevel.ceilingsurface(sectp) & Duke.TSURF_SLIME))
|
||||
self.pal = 7;
|
||||
self.ChangeStat(STAT_MISC);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ class RedneckMudSplash : DukeWatersplash
|
|||
override void Tick()
|
||||
{
|
||||
let sectp = self.sector;
|
||||
DoTick(dlevel.floorflags(sectp) & Duke.TFLAG_MUDDY);
|
||||
DoTick(dlevel.floorsurface(sectp) & Duke.TSURF_MUDDY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -301,7 +301,9 @@ struct DukeLevel
|
|||
native static int check_activator_motion(int lotag);
|
||||
native static void operatemasterswitches(int lotag);
|
||||
native static void operateactivators(int lotag, DukePlayer p);
|
||||
native static int floorsurface(sectortype s);
|
||||
native static int floorflags(sectortype s);
|
||||
native static int ceilingsurface(sectortype s);
|
||||
native static int ceilingflags(sectortype s);
|
||||
native static int wallflags(walltype s, int which);
|
||||
native static void AddCycler(sectortype sector, int lotag, int shade, int shade2, int hitag, int state);
|
||||
|
|
|
@ -68,20 +68,29 @@ struct Duke native
|
|||
CLIPMASK1 = (256 << 16) + 64
|
||||
}
|
||||
|
||||
enum ETextureFlags
|
||||
enum ETexFlags
|
||||
{
|
||||
TFLAG_WALLSWITCH = 1 << 0,
|
||||
TFLAG_ADULT = 1 << 1,
|
||||
TFLAG_ELECTRIC = 1 << 2,
|
||||
TFLAG_CLEARINVENTORY = 1 << 3, // really dumb Duke stuff...
|
||||
TFLAG_SLIME = 1 << 4,
|
||||
TFLAG_DOORWALL = 1 << 5,
|
||||
TFLAG_BLOCKDOOR = 1 << 6,
|
||||
TFLAG_OUTERSPACE = 1 << 7,
|
||||
TFLAG_NOBLOODSPLAT = 1 << 8,
|
||||
TFLAG_NOCIRCLEREFLECT = 1 << 9,
|
||||
TFLAG_MUDDY = 1 << 10,
|
||||
TFLAG_PURPLELAVA = 1 << 11, // very special kind of terrain type.
|
||||
TFLAG_CLEARINVENTORY = 1 << 2, // really dumb Duke stuff...
|
||||
TFLAG_DOORWALL = 1 << 3,
|
||||
TFLAG_BLOCKDOOR = 1 << 4,
|
||||
TFLAG_NOBLOODSPLAT = 1 << 5,
|
||||
TFLAG_NOCIRCLEREFLECT = 1 << 6,
|
||||
};
|
||||
|
||||
enum ETexSurfaces
|
||||
{
|
||||
TSURF_NONE = 0,
|
||||
TSURF_ELECTRIC = 1,
|
||||
TSURF_SLIME = 2,
|
||||
TSURF_OUTERSPACE = 3,
|
||||
TSURF_MUDDY = 4,
|
||||
TSURF_PURPLELAVA = 5, // very special kind of terrain type.
|
||||
TSURF_SCROLLSKY = 6,
|
||||
TSURF_THUNDERSKY = 7,
|
||||
TSURF_PLASMA = 8,
|
||||
TSURF_MAGMA = 9,
|
||||
};
|
||||
|
||||
enum ESoundFlags
|
||||
|
|
|
@ -177,6 +177,8 @@ struct Raze
|
|||
native static void SetReverb(int r);
|
||||
native static void SetReverbDelay(int d);
|
||||
native static Sound FindSoundByResID(int id);
|
||||
|
||||
//native static int tileflags(TextureID tex)
|
||||
|
||||
native static sectortype updatesector(Vector2 pos, sectortype lastsect, double maxdist = 96);
|
||||
native static sectortype, Vector3 clipmove(Vector3 pos, sectortype sect, Vector2 move, double walldist, double ceildist, double flordist, uint cliptype, CollisionData coll, int clipmoveboxtracenum = 3);
|
||||
|
|
Loading…
Reference in a new issue