mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
- fixed fillSimplePoly for indexed data.
On OpenGL this merely caused some visual glitches on the cheat automap - but the bad data in the buffer can make Vulkan abort entirely.
This commit is contained in:
parent
d050627cb0
commit
1818b5d9a0
1 changed files with 3 additions and 2 deletions
|
@ -485,10 +485,10 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
mVertices[poly.mVertIndex+i].Set(points[i].X, points[i].Y, 0, u*uscale, v*vscale, color0);
|
mVertices[poly.mVertIndex+i].Set(points[i].X, points[i].Y, 0, u*uscale, v*vscale, color0);
|
||||||
}
|
}
|
||||||
poly.mIndexIndex = mIndices.Size();
|
poly.mIndexIndex = mIndices.Size();
|
||||||
poly.mIndexCount += (npoints - 2) * 3;
|
|
||||||
|
|
||||||
if (indices == nullptr || indexcount == 0)
|
if (indices == nullptr || indexcount == 0)
|
||||||
{
|
{
|
||||||
|
poly.mIndexCount += (npoints - 2) * 3;
|
||||||
for (int i = 2; i < npoints; ++i)
|
for (int i = 2; i < npoints; ++i)
|
||||||
{
|
{
|
||||||
AddIndices(poly.mVertIndex, 3, 0, i - 1, i);
|
AddIndices(poly.mVertIndex, 3, 0, i - 1, i);
|
||||||
|
@ -496,10 +496,11 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
poly.mIndexCount += (int)indexcount;
|
||||||
int addr = mIndices.Reserve(indexcount);
|
int addr = mIndices.Reserve(indexcount);
|
||||||
for (size_t i = 0; i < indexcount; i++)
|
for (size_t i = 0; i < indexcount; i++)
|
||||||
{
|
{
|
||||||
mIndices[addr + i] = addr + indices[i];
|
mIndices[addr + i] = poly.mVertIndex + indices[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue