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:
alexey.lysiuk 2016-12-22 16:10:06 +02:00 committed by Christoph Oelckers
parent de97b753f6
commit 85bb5192b3
2 changed files with 22 additions and 12 deletions

View File

@ -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:

View File

@ -2,25 +2,25 @@
{
// Slightly squash the pillars in the starting room with "stimpacks"
// floating on them so that they can be obtained.
sectorflooroffset 62 -8
setsectoroffset 62 floor -8
setwallyscale 286 front bot 1.090909
setwallyscale 287 front bot 1.090909
setwallyscale 288 front bot 1.090909
setwallyscale 289 front bot 1.090909
sectorflooroffset 63 -8
setsectoroffset 63 floor -8
setwallyscale 290 front bot 1.090909
setwallyscale 291 front bot 1.090909
setwallyscale 292 front bot 1.090909
setwallyscale 293 front bot 1.090909
sectorflooroffset 118 -8
setsectoroffset 118 floor -8
setwallyscale 710 front bot 1.090909
setwallyscale 711 front bot 1.090909
setwallyscale 712 front bot 1.090909
setwallyscale 713 front bot 1.090909
sectorflooroffset 119 -8
setsectoroffset 119 floor -8
setwallyscale 714 front bot 1.090909
setwallyscale 715 front bot 1.090909
setwallyscale 716 front bot 1.090909