From 355dd1c2f5e958bab31da71068e1ab2c53c9f69e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 28 Jul 2014 18:01:01 +0200 Subject: [PATCH] - fixed some issues with setting the vertex dirty state. It was also called from several sector init functions and copy code for Boom deep water. The only case where SetPlaneTexZ should call it is from the interpolation code so this is a special case now. --- src/r_data/r_interpolate.cpp | 6 +++--- src/r_defs.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/r_data/r_interpolate.cpp b/src/r_data/r_interpolate.cpp index 3ca3b557c..29f54c39b 100644 --- a/src/r_data/r_interpolate.cpp +++ b/src/r_data/r_interpolate.cpp @@ -451,12 +451,12 @@ void DSectorPlaneInterpolation::Restore() if (!ceiling) { sector->floorplane.d = bakheight; - sector->SetPlaneTexZ(sector_t::floor, baktexz); + sector->SetPlaneTexZ(sector_t::floor, baktexz, true); } else { sector->ceilingplane.d = bakheight; - sector->SetPlaneTexZ(sector_t::ceiling, baktexz); + sector->SetPlaneTexZ(sector_t::ceiling, baktexz, true); } P_RecalculateAttached3DFloors(sector); } @@ -487,7 +487,7 @@ void DSectorPlaneInterpolation::Interpolate(fixed_t smoothratio) baktexz = sector->GetPlaneTexZ(pos); *pheight = oldheight + FixedMul(bakheight - oldheight, smoothratio); - sector->SetPlaneTexZ(pos, oldtexz + FixedMul(baktexz - oldtexz, smoothratio)); + sector->SetPlaneTexZ(pos, oldtexz + FixedMul(baktexz - oldtexz, smoothratio), true); P_RecalculateAttached3DFloors(sector); } diff --git a/src/r_defs.h b/src/r_defs.h index 2a76510f8..d0d538aa5 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -649,10 +649,10 @@ struct sector_t for (unsigned i = 0; i < e->XFloor.attached.Size(); i++) e->XFloor.attached[i]->SetVerticesDirty(); } - void SetPlaneTexZ(int pos, fixed_t val) + void SetPlaneTexZ(int pos, fixed_t 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; - SetAllVerticesDirty(); + if (dirtify) SetAllVerticesDirty(); } void ChangePlaneTexZ(int pos, fixed_t val)