Fix sunlight not working

This commit is contained in:
Magnus Norddahl 2024-01-17 19:42:40 +01:00
parent 500ddfebe9
commit 3d1fe65485
2 changed files with 6 additions and 3 deletions

View file

@ -214,7 +214,10 @@ struct IntSector
int group = 0;
FTextureID GetTexture(SecPlaneType plane) { return FNullTextureID(); }
FTextureID GetTexture(SecPlaneType plane)
{
return TexMan.CheckForTexture(GetTextureName(plane), ETextureType::Flat);
}
// Utility functions
inline const char* GetTextureName(int plane) const { return plane != PLANE_FLOOR ? data.ceilingpic : data.floorpic; }

View file

@ -637,9 +637,9 @@ void DoomLevelSubmesh::CreateCeilingSurface(std::map<LightmapTileBinding, int>&
surf.MeshLocation.StartElementIndex = Mesh.Indexes.Size();
for (int j = 2; j < surf.MeshLocation.NumVerts; j++)
{
Mesh.Indexes.Push(startVertIndex);
Mesh.Indexes.Push(startVertIndex + j - 1);
Mesh.Indexes.Push(startVertIndex + j);
Mesh.Indexes.Push(startVertIndex + j - 1);
Mesh.Indexes.Push(startVertIndex);
numElements += 3;
}
surf.MeshLocation.NumElements = numElements;