add set/get plane reflectivity

This commit is contained in:
Kaelan 2024-10-15 18:51:05 -06:00 committed by Ricardo Luís Vaz Silva
parent fe28defeca
commit 275635adc5
3 changed files with 38 additions and 0 deletions

View file

@ -1029,6 +1029,16 @@ public:
return pos == floor? floorplane:ceilingplane;
}
void SetPlaneReflectivity(int pos, double val)
{
reflect[pos] = val;
}
double GetPlaneReflectivity(int pos)
{
return reflect[pos];
}
bool isSecret() const
{
return !!(Flags & SECF_SECRET);

View file

@ -869,6 +869,32 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetXOffset, SetXOffset)
ACTION_RETURN_INT(self->GetLightLevel());
}
static void SetPlaneReflectivity(sector_t* self, int pos, double val)
{
self->SetPlaneReflectivity(pos, val);
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, SetPlaneReflectivity, SetPlaneReflectivity)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos);
PARAM_FLOAT(val)
self->SetPlaneReflectivity(pos, val);
return 0;
}
static double GetPlaneReflectivity(sector_t* self, int pos)
{
return self->GetPlaneReflectivity(pos);
}
DEFINE_ACTION_FUNCTION_NATIVE(_Sector, GetPlaneReflectivity, GetPlaneReflectivity)
{
PARAM_SELF_STRUCT_PROLOGUE(sector_t);
PARAM_INT(pos);
ACTION_RETURN_FLOAT(self->GetPlaneReflectivity(pos));
}
static int PortalBlocksView(sector_t *self, int pos)
{
return self->PortalBlocksView(pos);

View file

@ -553,6 +553,8 @@ struct Sector native play
native void ChangeLightLevel(int newval);
native void SetLightLevel(int newval);
native clearscope int GetLightLevel() const;
native void SetPlaneReflectivity(int pos, double val);
native clearscope double GetPlaneReflectivity(int pos);
native void AdjustFloorClip();
native clearscope bool IsLinked(Sector other, bool ceiling) const;