Replaced sectorflooroffset with more generic compatibility parameter
New parameter setsectoroffset can set offset of floor or ceiling # Conflicts: # src/compatibility.cpp
This commit is contained in:
parent
de97b753f6
commit
85bb5192b3
2 changed files with 22 additions and 12 deletions
|
|
@ -80,7 +80,7 @@ enum
|
|||
CP_SETSPECIAL,
|
||||
CP_CLEARSPECIAL,
|
||||
CP_SETACTIVATION,
|
||||
CP_SECTORFLOOROFFSET,
|
||||
CP_SETSECTOROFFSET,
|
||||
CP_SETSECTORSPECIAL,
|
||||
CP_SETWALLYSCALE,
|
||||
CP_SETWALLTEXTURE,
|
||||
|
|
@ -168,6 +168,11 @@ static const char *const WallTiers[] =
|
|||
"Top", "Mid", "Bot", NULL
|
||||
};
|
||||
|
||||
static const char *const SectorPlanes[] =
|
||||
{
|
||||
"floor", "ceil", NULL
|
||||
};
|
||||
|
||||
static TArray<int> CompatParams;
|
||||
static int ii_compatparams;
|
||||
static TArray<FString> TexNames;
|
||||
|
|
@ -291,12 +296,14 @@ void ParseCompatibility()
|
|||
sc.MustGetNumber();
|
||||
CompatParams.Push(sc.Number);
|
||||
}
|
||||
else if (sc.Compare("sectorflooroffset"))
|
||||
else if (sc.Compare("setsectoroffset"))
|
||||
{
|
||||
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||
CompatParams.Push(CP_SECTORFLOOROFFSET);
|
||||
CompatParams.Push(CP_SETSECTOROFFSET);
|
||||
sc.MustGetNumber();
|
||||
CompatParams.Push(sc.Number);
|
||||
sc.MustGetString();
|
||||
CompatParams.Push(sc.MustMatchString(SectorPlanes));
|
||||
sc.MustGetFloat();
|
||||
CompatParams.Push(int(sc.Float*65536.));
|
||||
}
|
||||
|
|
@ -574,16 +581,19 @@ void SetCompatibilityParams()
|
|||
i += 3;
|
||||
break;
|
||||
}
|
||||
case CP_SECTORFLOOROFFSET:
|
||||
case CP_SETSECTOROFFSET:
|
||||
{
|
||||
if ((unsigned)CompatParams[i+1] < level.sectors.Size())
|
||||
{
|
||||
sector_t *sec = &level.sectors[CompatParams[i+1]];
|
||||
const double delta = CompatParams[i + 2] / 65536.0;
|
||||
sec->floorplane.ChangeHeight(delta);
|
||||
sec->ChangePlaneTexZ(sector_t::floor, delta);
|
||||
const double delta = CompatParams[i + 3] / 65536.0;
|
||||
secplane_t& plane = sector_t::floor == CompatParams[i + 2]
|
||||
? sec->floorplane
|
||||
: sec->ceilingplane;
|
||||
plane.ChangeHeight(delta);
|
||||
sec->ChangePlaneTexZ(CompatParams[i + 2], delta);
|
||||
}
|
||||
i += 3;
|
||||
i += 4;
|
||||
break;
|
||||
}
|
||||
case CP_SETSECTORSPECIAL:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue