mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 05:31:00 +00:00
Added compatibility parameter to set wall textures
This commit is contained in:
parent
cd8aa252ae
commit
de97b753f6
1 changed files with 37 additions and 0 deletions
|
@ -83,6 +83,7 @@ enum
|
|||
CP_SECTORFLOOROFFSET,
|
||||
CP_SETSECTORSPECIAL,
|
||||
CP_SETWALLYSCALE,
|
||||
CP_SETWALLTEXTURE,
|
||||
CP_SETTHINGZ,
|
||||
CP_SETTAG,
|
||||
CP_SETTHINGFLAGS,
|
||||
|
@ -169,6 +170,7 @@ static const char *const WallTiers[] =
|
|||
|
||||
static TArray<int> CompatParams;
|
||||
static int ii_compatparams;
|
||||
static TArray<FString> TexNames;
|
||||
|
||||
// CODE --------------------------------------------------------------------
|
||||
|
||||
|
@ -320,6 +322,26 @@ void ParseCompatibility()
|
|||
sc.MustGetFloat();
|
||||
CompatParams.Push(int(sc.Float*65536.));
|
||||
}
|
||||
else if (sc.Compare("setwalltexture"))
|
||||
{
|
||||
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||
CompatParams.Push(CP_SETWALLTEXTURE);
|
||||
sc.MustGetNumber();
|
||||
CompatParams.Push(sc.Number);
|
||||
sc.MustGetString();
|
||||
CompatParams.Push(sc.MustMatchString(LineSides));
|
||||
sc.MustGetString();
|
||||
CompatParams.Push(sc.MustMatchString(WallTiers));
|
||||
sc.MustGetString();
|
||||
const FString texName = sc.String;
|
||||
const unsigned int texIndex = TexNames.Find(texName);
|
||||
const unsigned int texCount = TexNames.Size();
|
||||
if (texIndex == texCount)
|
||||
{
|
||||
TexNames.Push(texName);
|
||||
}
|
||||
CompatParams.Push(texIndex);
|
||||
}
|
||||
else if (sc.Compare("setthingz"))
|
||||
{
|
||||
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||
|
@ -587,6 +609,21 @@ void SetCompatibilityParams()
|
|||
i += 5;
|
||||
break;
|
||||
}
|
||||
case CP_SETWALLTEXTURE:
|
||||
{
|
||||
if (CompatParams[i + 1] < numlines)
|
||||
{
|
||||
side_t *side = lines[CompatParams[i + 1]].sidedef[CompatParams[i + 2]];
|
||||
if (side != NULL)
|
||||
{
|
||||
assert(TexNames.Size() > (unsigned int)CompatParams[i + 4]);
|
||||
const FTextureID texID = TexMan.GetTexture(TexNames[CompatParams[i + 4]], FTexture::TEX_Any);
|
||||
side->SetTexture(CompatParams[i + 3], texID);
|
||||
}
|
||||
}
|
||||
i += 5;
|
||||
break;
|
||||
}
|
||||
case CP_SETTHINGZ:
|
||||
{
|
||||
// When this is called, the things haven't been spawned yet so we can alter the position inside the MapThings array.
|
||||
|
|
Loading…
Reference in a new issue