- implement drawing sides with lightmaps

- misc bug fixes in lump loading and format
This commit is contained in:
nashmuhandes 2021-09-24 17:27:23 +08:00
commit 3f3769afdb
6 changed files with 78 additions and 42 deletions

View file

@ -242,7 +242,7 @@ static int CreateIndexedSectorVerticesLM(FFlatVertexBuffer* fvb, sector_t* sec,
int lindex = lightmap->LightmapNum;
for (unsigned int j = 0; j < sub->numlines; j++)
{
SetFlatVertex(vbo_shadowdata[vi + pos], sub->firstline->v1, plane, luvs[j * 2], luvs[j * 2 + 1], lindex);
SetFlatVertex(vbo_shadowdata[vi + pos], sub->firstline[j].v1, plane, luvs[j * 2], luvs[j * 2 + 1], lindex);
vbo_shadowdata[vi + pos].z += diff;
pos++;
}
@ -251,7 +251,7 @@ static int CreateIndexedSectorVerticesLM(FFlatVertexBuffer* fvb, sector_t* sec,
{
for (unsigned int j = 0; j < sub->numlines; j++)
{
SetFlatVertex(vbo_shadowdata[vi + pos], sub->firstline->v1, plane);
SetFlatVertex(vbo_shadowdata[vi + pos], sub->firstline[j].v1, plane);
vbo_shadowdata[vi + pos].z += diff;
pos++;
}
@ -259,7 +259,7 @@ static int CreateIndexedSectorVerticesLM(FFlatVertexBuffer* fvb, sector_t* sec,
}
// Create the indices for the subsectors
for (int i = 0; i < sec->subsectorcount; i++)
for (i = 0, pos = 0; i < sec->subsectorcount; i++)
{
subsector_t* sub = sec->subsectors[i];
int firstndx = vi + pos;