Merge branch 'yquake2:master' into ref_gles1

This commit is contained in:
protocultor 2024-08-03 10:15:04 -04:00 committed by GitHub
commit f41cc545c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View file

@ -755,7 +755,7 @@ set_target_properties(q2ded PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release
) )
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
target_link_libraries(q2ded ${yquake2LinkerFlags}) target_link_libraries(q2ded ${yquake2LinkerFlags} ${yquake2ZLibLinkerFlags} ws2_32 winmm)
else() else()
target_link_libraries(q2ded ${yquake2LinkerFlags} ${yquake2ServerLinkerFlags} ${yquake2ZLibLinkerFlags}) target_link_libraries(q2ded ${yquake2LinkerFlags} ${yquake2ServerLinkerFlags} ${yquake2ZLibLinkerFlags})
endif() endif()

View file

@ -1196,9 +1196,9 @@ R_GetBrushesLighting(void)
for (k = 0; k < currentmodel->nummodelsurfaces; k++, surf++) for (k = 0; k < currentmodel->nummodelsurfaces; k++, surf++)
{ {
if (surf->texinfo->flags & (SURF_TRANS33 | SURF_TRANS66 | SURF_WARP) 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 // find which side of the node we are on
@ -1208,6 +1208,7 @@ R_GetBrushesLighting(void)
if (((surf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) || if (((surf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
(!(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]; surf->lightmapchain = gl_lms.lightmap_surfaces[surf->lightmaptexturenum];
gl_lms.lightmap_surfaces[surf->lightmaptexturenum] = surf; gl_lms.lightmap_surfaces[surf->lightmaptexturenum] = surf;
} }

View file

@ -59,6 +59,7 @@ typedef struct msurface_s
glpoly_t *polys; /* multiple if warped */ glpoly_t *polys; /* multiple if warped */
struct msurface_s *texturechain; struct msurface_s *texturechain;
struct msurface_s *lightmapchain; struct msurface_s *lightmapchain;
int lmchain_frame; // avoids adding this surface twice to the lightmap chain
mtexinfo_t *texinfo; mtexinfo_t *texinfo;