Expose changing sidedef wallpart flags to zscript

This commit is contained in:
azamorapl 2020-10-24 18:29:31 -05:00 committed by Christoph Oelckers
parent eab3289043
commit 7676ed641c
3 changed files with 48 additions and 0 deletions

View file

@ -1320,6 +1320,17 @@ struct side_t
textures[which].yScale *= delta;
}
int GetTextureFlags(int which)
{
return textures[which].flags;
}
void ChangeTextureFlags(int which, int And, int Or)
{
textures[which].flags &= ~And;
textures[which].flags |= Or;
}
void SetSpecialColor(int which, int slot, int r, int g, int b, bool useown = true)
{
textures[which].SpecialColors[slot] = PalEntry(255, r, g, b);

View file

@ -1399,6 +1399,33 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
ACTION_RETURN_POINTER(self->V2());
}
static int GetTextureFlags(side_t* self, int tier)
{
return self->GetTextureFlags(tier);
}
DEFINE_ACTION_FUNCTION_NATIVE(_Side, GetTextureFlags, GetTextureFlags)
{
PARAM_SELF_STRUCT_PROLOGUE(side_t);
PARAM_INT(tier);
ACTION_RETURN_INT(self->GetTextureFlags(tier));
}
static void ChangeTextureFlags(side_t* self, int tier, int And, int Or)
{
self->ChangeTextureFlags(tier, And, Or);
}
DEFINE_ACTION_FUNCTION_NATIVE(_Side, ChangeTextureFlags, ChangeTextureFlags)
{
PARAM_SELF_STRUCT_PROLOGUE(side_t);
PARAM_INT(tier);
PARAM_INT(a);
PARAM_INT(o);
ChangeTextureFlags(self, tier, a, o);
return 0;
}
static void SetSideSpecialColor(side_t *self, int tier, int position, int color, int useown)
{
if (tier >= 0 && tier < 3 && position >= 0 && position < 2)

View file

@ -62,6 +62,14 @@ struct Side native play
WALLF_LIGHT_FOG = 128, // This wall's Light is used even in fog.
};
enum EPartFlags
{
NoGradient = 1,
FlipGradient = 2,
ClampGradient = 4,
UseOwnSpecialColors = 8,
UseOwnAdditiveColor = 16,
};
native readonly Sector sector; // Sector the SideDef is facing.
//DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall
@ -83,6 +91,8 @@ struct Side native play
native void SetTextureYScale(int which, double scale);
native double GetTextureYScale(int which);
native void MultiplyTextureYScale(int which, double delta);
native int GetTextureFlags(int tier);
native void ChangeTextureFlags(int tier, int And, int Or);
native void SetSpecialColor(int tier, int position, Color scolor, bool useowncolor = true);
native Color GetAdditiveColor(int tier);
native void SetAdditiveColor(int tier, Color color);