Somehow fix lightmaps being corrupted in debug build
This commit is contained in:
parent
6f44e2b5d4
commit
9ef93da6de
5 changed files with 46 additions and 47 deletions
|
|
@ -369,8 +369,6 @@ void DoomLevelMesh::BindLightmapSurfacesToGeometry(FLevelLocals& doomMap)
|
|||
{
|
||||
surface.TexCoords = (float*)&LightmapUvs[surface.startUvIndex];
|
||||
|
||||
surface.LightmapNum = surface.atlasPageIndex;
|
||||
|
||||
if (surface.Type == ST_FLOOR || surface.Type == ST_CEILING)
|
||||
{
|
||||
surface.Subsector = &doomMap.subsectors[surface.typeIndex];
|
||||
|
|
|
|||
|
|
@ -16,10 +16,9 @@ struct FLevelLocals;
|
|||
|
||||
struct DoomLevelMeshSurface : public LevelMeshSurface
|
||||
{
|
||||
subsector_t* Subsector;
|
||||
side_t* Side;
|
||||
sector_t* ControlSector;
|
||||
uint32_t LightmapNum; // To do: same as atlasPageIndex. Delete one of them!
|
||||
subsector_t* Subsector = nullptr;
|
||||
side_t* Side = nullptr;
|
||||
sector_t* ControlSector = nullptr;
|
||||
float* TexCoords;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ static int CreateIndexedSectorVerticesLM(FRenderState& renderstate, sector_t* se
|
|||
if (lightmap && lightmap->Type != ST_UNKNOWN) // lightmap may be missing if the subsector is degenerate triangle
|
||||
{
|
||||
float* luvs = lightmap->TexCoords;
|
||||
int lindex = lightmap->LightmapNum;
|
||||
int lindex = lightmap->atlasPageIndex;
|
||||
for (unsigned int j = 0; j < sub->numlines; j++)
|
||||
{
|
||||
SetFlatVertex(vbo_shadowdata[vi + pos], sub->firstline[j].v1, plane, luvs[j * 2], luvs[j * 2 + 1], lindex);
|
||||
|
|
|
|||
|
|
@ -1019,7 +1019,7 @@ bool HWWall::SetWallCoordinates(seg_t * seg, FTexCoordInfo *tci, float textureto
|
|||
if (lightmap && lightmap->Type != ST_UNKNOWN)
|
||||
{
|
||||
srclightuv = (texcoord*)lightmap->TexCoords;
|
||||
lindex = (float)lightmap->LightmapNum;
|
||||
lindex = (float)lightmap->atlasPageIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1725,7 +1725,7 @@ void HWWall::BuildFFBlock(HWDrawInfo *di, FRenderState& state, seg_t * seg, F3DF
|
|||
if (lightmap && lightmap->Type != ST_UNKNOWN)
|
||||
{
|
||||
srclightuv = (texcoord*)lightmap->TexCoords;
|
||||
lindex = (float)lightmap->LightmapNum;
|
||||
lindex = (float)lightmap->atlasPageIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue