Fix surface index passed to glsl
This commit is contained in:
parent
3386b6ad1a
commit
6ccb92ef60
8 changed files with 67 additions and 30 deletions
|
|
@ -194,7 +194,11 @@ void HWFlat::DrawSubsectors(HWDrawInfo *di, FRenderState &state)
|
|||
|
||||
for (auto& subsector : section->subsectors)
|
||||
{
|
||||
state.PushVisibleSurface(subsector->lightmap[ceiling ? 1 : 0][0]);
|
||||
auto lightmap = subsector->lightmap[ceiling ? 1 : 0][0];
|
||||
if (lightmap)
|
||||
{
|
||||
state.PushVisibleSurface(lightmap - &subsector->sector->Level->levelMesh->Surfaces[0], lightmap);
|
||||
}
|
||||
}
|
||||
|
||||
state.DrawIndexed(DT_Triangles, iboindex + section->vertexindex, section->vertexcount);
|
||||
|
|
|
|||
|
|
@ -347,7 +347,11 @@ void HWWall::DrawWall(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
MakeVertices(di, state, !!(flags & HWWall::HWF_TRANSLUCENT));
|
||||
}
|
||||
|
||||
state.PushVisibleSurface(lightmap);
|
||||
if (lightmap)
|
||||
{
|
||||
state.PushVisibleSurface(lightmap - &seg->Subsector->sector->Level->levelMesh->Surfaces[0], lightmap);
|
||||
}
|
||||
|
||||
state.SetNormal(glseg.Normal());
|
||||
if (!translucent)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue