mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-17 00:11:05 +00:00
Made plane normal changes trigger the VBO update as well
This commit is contained in:
parent
928d0b2778
commit
4815d5a835
2 changed files with 18 additions and 9 deletions
|
@ -397,7 +397,9 @@ void FFlatVertexBuffer::CreateFlatVBO()
|
|||
{
|
||||
for(auto &sec : level.sectors)
|
||||
{
|
||||
CreateVertices(h, &sec, sec.GetSecPlane(h), h == sector_t::floor);
|
||||
secplane_t& plane = sec.GetSecPlane(h);
|
||||
CreateVertices(h, &sec, plane, h == sector_t::floor);
|
||||
plane.vbonormal = plane.normal;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -464,15 +466,21 @@ void FFlatVertexBuffer::CreateVBO()
|
|||
|
||||
void FFlatVertexBuffer::CheckPlanes(sector_t *sector)
|
||||
{
|
||||
if (sector->GetPlaneTexZ(sector_t::ceiling) != sector->vboheight[sector_t::ceiling])
|
||||
for (int i = sector_t::floor; i <= sector_t::ceiling; i++)
|
||||
{
|
||||
UpdatePlaneVertices(sector, sector_t::ceiling);
|
||||
sector->vboheight[sector_t::ceiling] = sector->GetPlaneTexZ(sector_t::ceiling);
|
||||
}
|
||||
if (sector->GetPlaneTexZ(sector_t::floor) != sector->vboheight[sector_t::floor])
|
||||
{
|
||||
UpdatePlaneVertices(sector, sector_t::floor);
|
||||
sector->vboheight[sector_t::floor] = sector->GetPlaneTexZ(sector_t::floor);
|
||||
if (sector->GetPlaneTexZ(i) != sector->vboheight[i])
|
||||
{
|
||||
UpdatePlaneVertices(sector, i);
|
||||
sector->vboheight[i] = sector->GetPlaneTexZ(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
secplane_t &splane = sector->GetSecPlane(i);
|
||||
if (splane.normal != splane.vbonormal)
|
||||
{
|
||||
UpdatePlaneVertices(sector, i);
|
||||
splane.vbonormal = splane.normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -300,6 +300,7 @@ struct secplane_t
|
|||
//private:
|
||||
DVector3 normal;
|
||||
double D, negiC; // negative iC because that also saves a negation in all methods using this.
|
||||
DVector3 vbonormal; // [ZZ] for opengl update. it's critical that this member is the last one, so that {{x,y,z},...} works properly
|
||||
public:
|
||||
friend FSerializer &Serialize(FSerializer &arc, const char *key, secplane_t &p, secplane_t *def);
|
||||
|
||||
|
|
Loading…
Reference in a new issue