- hole filling subsectors must also be explicitly triangulated for the automap because they may be non-convex.

This commit is contained in:
Christoph Oelckers 2018-11-10 08:04:03 +01:00
commit cfe51f0c30
6 changed files with 62 additions and 25 deletions

View file

@ -419,7 +419,8 @@ void F2DDrawer::AddShape( FTexture *img, DShape2D *shape, DrawParms &parms )
void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
double originx, double originy, double scalex, double scaley,
DAngle rotation, const FColormap &colormap, PalEntry flatcolor, int lightlevel)
DAngle rotation, const FColormap &colormap, PalEntry flatcolor, int lightlevel,
uint32_t *indices, size_t indexcount)
{
// Use an equation similar to player sprites to determine shade
@ -487,9 +488,20 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
poly.mIndexIndex = mIndices.Size();
poly.mIndexCount += (npoints - 2) * 3;
for (int i = 2; i < npoints; ++i)
if (indices == nullptr || indexcount == 0)
{
AddIndices(poly.mVertIndex, 3, 0, i - 1, i);
for (int i = 2; i < npoints; ++i)
{
AddIndices(poly.mVertIndex, 3, 0, i - 1, i);
}
}
else
{
int addr = mIndices.Reserve(indexcount);
for (size_t i = 0; i < indexcount; i++)
{
mIndices[addr + i] = addr + indices[i];
}
}
AddCommand(&poly);