mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 11:50:49 +00:00
- fixed texture coordinate generation for sloped planes.
Since these depend on the slope, the sector's ceiling and floorz need to be the same as for the mesh when creating them.
This commit is contained in:
parent
7bea8ad6ba
commit
4cc0afe587
1 changed files with 7 additions and 4 deletions
|
@ -225,6 +225,9 @@ void SectorGeometry::MakeVertices(unsigned int secnum, int plane)
|
|||
polygon.resize(1);
|
||||
curPoly = &polygon.back();
|
||||
|
||||
int fz = sec->floorz, cz = sec->ceilingz;
|
||||
sec->floorz = sec->ceilingz = 0;
|
||||
|
||||
for (int i = 0; i < numvertices; i++)
|
||||
{
|
||||
auto wal = &wall[sec->wallptr + i];
|
||||
|
@ -268,13 +271,9 @@ void SectorGeometry::MakeVertices(unsigned int secnum, int plane)
|
|||
for (auto& pt : polygon[a])
|
||||
{
|
||||
float planez;
|
||||
int fz = sec->floorz, cz = sec->ceilingz;
|
||||
sec->floorz = sec->ceilingz = 0;
|
||||
PlanesAtPoint(sec, (pt.first * 16), (pt.second * -16), plane ? &planez : nullptr, !plane ? &planez : nullptr);
|
||||
FVector3 point = { pt.first, pt.second, planez };
|
||||
points[p++] = point;
|
||||
sec->floorz = fz;
|
||||
sec->ceilingz = cz;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -293,6 +292,10 @@ void SectorGeometry::MakeVertices(unsigned int secnum, int plane)
|
|||
entry.vertices[i] = pt;
|
||||
entry.texcoords[i] = uvcalc.GetUV(int(pt.X * 16), int(pt.Y * -16), pt.Z);
|
||||
}
|
||||
|
||||
sec->floorz = fz;
|
||||
sec->ceilingz = cz;
|
||||
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
Loading…
Reference in a new issue