- beginning levelmeshupdater work

This commit is contained in:
Rachael Alexanderson 2024-08-08 00:17:29 -04:00 committed by Magnus Norddahl
commit 1d86d7080d
3 changed files with 22 additions and 0 deletions

View file

@ -30,6 +30,7 @@
#ifndef __R_DEFS_H__
#define __R_DEFS_H__
#include "levelmeshhelper.h"
#include "doomdef.h"
#include "m_bbox.h"
@ -978,6 +979,7 @@ public:
FTextureID old = planes[pos].Texture;
planes[pos].Texture = tex;
if (floorclip && pos == floor && tex != old) AdjustFloorClip();
if (tex != old) LevelMeshUpdater->SectorChanged((void*)this);
}
double GetPlaneTexZ(int pos) const
@ -987,7 +989,9 @@ public:
void SetPlaneTexZQuick(int pos, double val) // For the *FakeFlat functions which do not need to have the overlap checked.
{
auto old = planes[pos].TexZ;
planes[pos].TexZ = val;
if (val != old) LevelMeshUpdater->SectorChanged((void*)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.
@ -1289,7 +1293,9 @@ struct side_t
}
void SetTexture(int which, FTextureID tex)
{
auto old = textures[which].texture;
textures[which].texture = tex;
if (old != tex) LevelMeshUpdater->SideChanged((void*)this);
}
void SetTextureXOffset(int which, double offset)

15
src/levelmeshhelper.h Normal file
View file

@ -0,0 +1,15 @@
// level mesh helper
// this is a minimal include to keep the other source files a little bit leaner
struct UpdateLevelMesh
{
void SectorChanged(void *sector)
{
}
void SideChanged(void *side)
{
}
};
UpdateLevelMesh* LevelMeshUpdater;

View file

@ -7058,6 +7058,7 @@ bool P_ChangeSector(sector_t *sector, int crunch, double amt, int floorOrCeil, b
}
LevelMeshUpdater->SectorChanged((void*)sector); // update levelmesh
return cpos.nofit;
}