Skip to content

Commit

Permalink
Simplify GL_RebuildLighting().
Browse files Browse the repository at this point in the history
It's more correct to call LM_BeginBuilding() if toggling
lightmaps off, because it will reset nummaps/maxmaps.
  • Loading branch information
skullernet committed Dec 7, 2023
1 parent 9ff231d commit d6fb3da
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/refresh/surf.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,13 +947,7 @@ void GL_RebuildLighting(void)
if (!gl_static.world.cache)
return;

// if doing vertex lighting, rebuild all surfaces
if (no_lightmaps()) {
upload_world_surfaces();
return;
}

// if did vertex lighting previously, rebuild all surfaces and lightmaps
// rebuild all surfaces if toggling lightmaps off/on
if (gl_fullbright->modified || gl_vertexlight->modified) {
LM_BeginBuilding();
upload_world_surfaces();
Expand Down

0 comments on commit d6fb3da

Please sign in to comment.