mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Merge pull request #1133 from protocultor/lightmapchain_fix
Infinite loop in R_GetBrushesLighting() function, hangs the game
This commit is contained in:
commit
3aa051c6d2
2 changed files with 4 additions and 2 deletions
|
@ -1143,9 +1143,9 @@ R_GetBrushesLighting(void)
|
|||
for (k = 0; k < currentmodel->nummodelsurfaces; k++, surf++)
|
||||
{
|
||||
if (surf->texinfo->flags & (SURF_TRANS33 | SURF_TRANS66 | SURF_WARP)
|
||||
|| surf->flags & SURF_DRAWTURB)
|
||||
|| surf->flags & SURF_DRAWTURB || surf->lmchain_frame == r_framecount)
|
||||
{
|
||||
continue;
|
||||
continue; // either not affected by light, or already in the chain
|
||||
}
|
||||
|
||||
// find which side of the node we are on
|
||||
|
@ -1155,6 +1155,7 @@ R_GetBrushesLighting(void)
|
|||
if (((surf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
|
||||
(!(surf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))
|
||||
{
|
||||
surf->lmchain_frame = r_framecount; // don't add this twice to the chain
|
||||
surf->lightmapchain = gl_lms.lightmap_surfaces[surf->lightmaptexturenum];
|
||||
gl_lms.lightmap_surfaces[surf->lightmaptexturenum] = surf;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ typedef struct msurface_s
|
|||
glpoly_t *polys; /* multiple if warped */
|
||||
struct msurface_s *texturechain;
|
||||
struct msurface_s *lightmapchain;
|
||||
int lmchain_frame; // avoids adding this surface twice to the lightmap chain
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
|
|
Loading…
Reference in a new issue