make sure all texZ functions update the levelmesh

This commit is contained in:
Ricardo Luís Vaz Silva 2024-08-10 17:34:43 -03:00 committed by Magnus Norddahl
commit 8f79753dc0
4 changed files with 9 additions and 17 deletions

View file

@ -14,6 +14,8 @@ struct NullLevelMeshUpdater : UpdateLevelMesh
virtual void FloorTextureChanged(struct sector_t *sector) {};
virtual void CeilingTextureChanged(struct sector_t *sector) {};
virtual void SectorChangedOther(struct sector_t *sector) {};
virtual void SideTextureChanged(struct side_t *side, int section) {};
};

View file

@ -1004,27 +1004,28 @@ public:
if (val != old)
{
//not sure actually what TexZ does, so changing passing this as "Other"
if(pos)
{
LevelMeshUpdater->FloorHeightChanged(this);
LevelMeshUpdater->SectorChangedOther(this);
}
else
{
LevelMeshUpdater->CeilingHeightChanged(this);
LevelMeshUpdater->SectorChangedOther(this);
}
}
}
void SetPlaneTexZ(int pos, double val, bool dirtify = false) // This mainly gets used by init code. The only place where it must set the vertex to dirty is the interpolation code.
{
planes[pos].TexZ = val;
SetPlaneTexZQuick(pos, val);
if (dirtify) SetAllVerticesDirty();
CheckOverlap();
}
void ChangePlaneTexZ(int pos, double val)
{
planes[pos].TexZ += val;
SetPlaneTexZQuick(pos, planes[pos].TexZ + val);
SetAllVerticesDirty();
CheckOverlap();
}

View file

@ -11,6 +11,8 @@ struct UpdateLevelMesh
virtual void FloorTextureChanged(struct sector_t *sector) = 0;
virtual void CeilingTextureChanged(struct sector_t *sector) = 0;
virtual void SectorChangedOther(struct sector_t *sector) = 0;
virtual void SideTextureChanged(struct side_t *side, int section) = 0;
};

View file

@ -1806,19 +1806,6 @@ DEFINE_ACTION_FUNCTION_NATIVE(_Secplane, isEqual, isPlaneEqual)
ACTION_RETURN_BOOL(*self == *other);
}
static void ChangeHeight(secplane_t *self, double hdiff)
{
self->ChangeHeight(hdiff);
}
DEFINE_ACTION_FUNCTION_NATIVE(_Secplane, ChangeHeight, ChangeHeight)
{
PARAM_SELF_STRUCT_PROLOGUE(secplane_t);
PARAM_FLOAT(hdiff);
self->ChangeHeight(hdiff);
return 0;
}
static double GetChangedHeight(const secplane_t *self, double hdiff)
{
return self->GetChangedHeight(hdiff);