]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fix another bug in R_Shadow_PrepareLights_AddSceneLight - it was not increasing r_sha...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 11 Oct 2016 03:03:27 +0000 (03:03 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 11 Oct 2016 03:03:27 +0000 (03:03 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12288 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 91b704c10d78e3263d3c4e4b844fc1ec7ef8e03e..f388ce4a0c68f1445e1127fc6ddc47c001267f79 100644 (file)
@@ -5064,10 +5064,11 @@ void R_Shadow_DrawPrepass(void)
 #define MAX_SCENELIGHTS 65536
 qboolean R_Shadow_PrepareLights_AddSceneLight(rtlight_t *rtlight)
 {
-       if (r_shadow_scenenumlights >= MAX_SCENELIGHTS)
-               return false;
-       if (r_shadow_scenemaxlights <= r_shadow_scenenumlights && r_shadow_scenemaxlights < MAX_SCENELIGHTS)
+       if (r_shadow_scenemaxlights <= r_shadow_scenenumlights)
        {
+               if (r_shadow_scenenumlights >= MAX_SCENELIGHTS)
+                       return false;
+               r_shadow_scenemaxlights *= 2;
                r_shadow_scenemaxlights = bound(1024, r_shadow_scenemaxlights, MAX_SCENELIGHTS);
                r_shadow_scenelightlist = (rtlight_t **)Mem_Realloc(r_main_mempool, r_shadow_scenelightlist, r_shadow_scenemaxlights * sizeof(rtlight_t *));
        }