mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 06:42:08 +00:00
reworked the skewing properties.
The Eternity-based definitions are currently disabled due to unclear semantics and overall unsatisfying design. They can be re-enabled once their precise working has been established. New properties were added to replace them with something that will be clearly specified and is fully ortohonal i.e. they will allow to align an upper tier skew with the floor as well and a lower tier's skew with a ceiling.
This commit is contained in:
parent
f92f6b8de4
commit
b48caddb96
5 changed files with 70 additions and 10 deletions
|
@ -233,6 +233,12 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
|||
lm_sampledist_top = <int>; // ZDRay customizable sampling distance for this sidedef's top part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
|
||||
lm_sampledist_mid = <int>; // ZDRay customizable sampling distance for this sidedef's middle part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
|
||||
lm_sampledist_bot = <int>; // ZDRay customizable sampling distance for this sidedef's bottom part. Defines the map units each lightmap texel covers. Must be in powers of two. Default = 0
|
||||
|
||||
skew_top = <int>; // enables skewing of wall textures, the skewing angle will be aligned to one of the 4 planes touching the floor.
|
||||
skew_middle = <int>; // Vertical texture alignment defines the position at the leftmost point of the wall.
|
||||
skew_bottom = <int>; // Possible values: 0 = no skewing, 1 = align to front floor, 2 = align to front ceiling, 3 = align to back floor, 4 = align to back ceiling.
|
||||
// Front/Back are relative to the sidedef, not the owning linedef. Default = 0.
|
||||
|
||||
}
|
||||
|
||||
sector
|
||||
|
@ -542,6 +548,9 @@ Added/updated ZDRay/lightmap-related properties.
|
|||
1.35 15.09.2023
|
||||
fixed omissions: Blocklandmonsters and Blockfloaters line flags.
|
||||
|
||||
1.36 20.10.2023
|
||||
Sidedef skewing properties
|
||||
|
||||
===============================================================================
|
||||
EOF
|
||||
===============================================================================
|
||||
|
|
|
@ -1197,14 +1197,10 @@ struct side_t
|
|||
enum ESkew
|
||||
{
|
||||
skew_none = 0,
|
||||
skew_front = 1,
|
||||
skew_back = 2,
|
||||
// for mid textures there's 4 options
|
||||
skew_front_floor = 1,
|
||||
skew_front_ceiling = 2,
|
||||
skew_back_floor = 3,
|
||||
skew_back_ceiling = 4
|
||||
|
||||
};
|
||||
|
||||
struct part
|
||||
|
|
|
@ -104,6 +104,7 @@ static char HexenSectorSpecialOk[256]={
|
|||
1,1,1,1,1,
|
||||
};
|
||||
|
||||
#if 0
|
||||
static const char* udmfsolidskewtypes[] =
|
||||
{
|
||||
"none",
|
||||
|
@ -121,6 +122,7 @@ static const char* udmfmaskedskewtypes[] =
|
|||
"back_ceiling",
|
||||
nullptr
|
||||
};
|
||||
#endif
|
||||
|
||||
static inline bool P_IsThingSpecial(int specnum)
|
||||
{
|
||||
|
@ -1516,6 +1518,7 @@ public:
|
|||
CHECK_N(Zd | Zdt)
|
||||
break;
|
||||
|
||||
#if 0 // specs are to rough and too vague - needs to be cleared first how this works.
|
||||
case NAME_skew_top_type:
|
||||
CHECK_N(Zd | Zdt)
|
||||
sd->textures[side_t::top].skew = MatchString(key, udmfsolidskewtypes, 0);
|
||||
|
@ -1530,7 +1533,22 @@ public:
|
|||
CHECK_N(Zd | Zdt)
|
||||
sd->textures[side_t::bottom].skew = MatchString(key, udmfsolidskewtypes, 0);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case NAME_skew_top:
|
||||
CHECK_N(Zd | Zdt)
|
||||
sd->textures[side_t::top].skew = CheckInt(key);
|
||||
break;
|
||||
|
||||
case NAME_skew_middle:
|
||||
CHECK_N(Zd | Zdt)
|
||||
sd->textures[side_t::mid].skew = CheckInt(key);
|
||||
break;
|
||||
|
||||
case NAME_skew_bottom:
|
||||
CHECK_N(Zd | Zdt)
|
||||
sd->textures[side_t::bottom].skew = CheckInt(key);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (strnicmp("user_", key.GetChars(), 5))
|
||||
|
@ -2248,6 +2266,7 @@ public:
|
|||
sides[side].sector = &Level->sectors[intptr_t(sides[side].sector)];
|
||||
lines[line].sidedef[sd] = &sides[side];
|
||||
|
||||
#if 0
|
||||
if (sd == 1)
|
||||
{
|
||||
// fix flags for backside. The definition is linedef relative, not sidedef relative.
|
||||
|
@ -2258,6 +2277,7 @@ public:
|
|||
sides[side].textures[side_t::bottom].skew = swaps[sides[side].textures[side_t::bottom].skew];
|
||||
sides[side].textures[side_t::mid].skew = swapsm[sides[side].textures[side_t::mid].skew];
|
||||
}
|
||||
#endif
|
||||
|
||||
loader->ProcessSideTextures(!isExtended, &sides[side], sides[side].sector, &ParsedSideTextures[mapside],
|
||||
lines[line].special, lines[line].args[0], &tempalpha[sd], missingTex);
|
||||
|
|
|
@ -861,5 +861,8 @@ xx(lm_sampledistance)
|
|||
xx(skew_bottom_type)
|
||||
xx(skew_middle_type)
|
||||
xx(skew_top_type)
|
||||
xx(skew_bottom)
|
||||
xx(skew_middle)
|
||||
xx(skew_top)
|
||||
|
||||
xx(Corona)
|
||||
|
|
|
@ -2280,11 +2280,27 @@ void HWWall::Process(HWWallDispatcher *di, seg_t *seg, sector_t * frontsector, s
|
|||
if (texture && texture->isValid())
|
||||
{
|
||||
int skewflag = seg->sidedef->textures[side_t::top].skew;
|
||||
float skew;
|
||||
if (skewflag == 0) skewflag = topskew;
|
||||
float skew =
|
||||
skewflag == side_t::skew_front ? fch2 - fch1 :
|
||||
skewflag == side_t::skew_back ? bch2 - bch1 : 0.;
|
||||
|
||||
switch (skewflag)
|
||||
{
|
||||
default:
|
||||
skew = 0;
|
||||
break;
|
||||
case side_t::skew_front_ceiling:
|
||||
skew = fch2 - fch1;
|
||||
break;
|
||||
case side_t::skew_back_ceiling:
|
||||
skew = bch2 - bch1;
|
||||
break;
|
||||
case side_t::skew_front_floor:
|
||||
skew = bfh2 - bfh1;
|
||||
break;
|
||||
case side_t::skew_back_floor:
|
||||
skew = ffh2 - ffh1;
|
||||
break;
|
||||
}
|
||||
DoTexture(di, RENDERWALL_TOP, seg, (seg->linedef->flags & (ML_DONTPEGTOP)) == 0,
|
||||
crefz, realback->GetPlaneTexZ(sector_t::ceiling),
|
||||
fch1, fch2, bch1a, bch2a, 0, skew);
|
||||
|
@ -2407,9 +2423,25 @@ void HWWall::Process(HWWallDispatcher *di, seg_t *seg, sector_t * frontsector, s
|
|||
{
|
||||
int skewflag = seg->sidedef->textures[side_t::bottom].skew;
|
||||
if (skewflag == 0) skewflag = bottomskew;
|
||||
float skew =
|
||||
skewflag == side_t::skew_back ? bfh2a - bfh1a :
|
||||
skewflag == side_t::skew_front ? ffh2 - ffh1 : 0.;
|
||||
float skew;
|
||||
switch (skewflag)
|
||||
{
|
||||
default:
|
||||
skew = 0;
|
||||
break;
|
||||
case side_t::skew_front_ceiling:
|
||||
skew = fch2 - fch1;
|
||||
break;
|
||||
case side_t::skew_back_ceiling:
|
||||
skew = bch2 - bch1;
|
||||
break;
|
||||
case side_t::skew_front_floor:
|
||||
skew = bfh2a - bfh1a;
|
||||
break;
|
||||
case side_t::skew_back_floor:
|
||||
skew = ffh2 - ffh1;
|
||||
break;
|
||||
}
|
||||
|
||||
DoTexture(di, RENDERWALL_BOTTOM, seg, (seg->linedef->flags & ML_DONTPEGBOTTOM) > 0,
|
||||
realback->GetPlaneTexZ(sector_t::floor), frefz,
|
||||
|
|
Loading…
Reference in a new issue