]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
some added structures in in preparation for another protocol version bump (to add...
[xonotic/darkplaces.git] / gl_rmain.c
index fe0052d2830c1a4ae443dd2b3b7ae59a41123781..448d40542463a9b9bae689719ae477776e38aa5a 100644 (file)
@@ -551,7 +551,7 @@ static void R_MarkEntities (void)
                R_LerpAnimation(ent);
                R_UpdateEntLights(ent);
                if ((chase_active.integer || !(ent->flags & RENDER_EXTERIORMODEL))
-                && !VIS_CullSphere(ent->origin, ent->model->radius * ent->scale)
+                && !VIS_CullSphere(ent->origin, (ent->model != NULL ? ent->model->radius : 16) * ent->scale)
                 && !VIS_CullBox(ent->mins, ent->maxs))
                {
                        ent->visframe = r_framecount;
@@ -982,20 +982,26 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                        VectorScale(lightcolor, f, lightcolor);
                }
 
-               if (!visiblevolumes)
-                       R_Shadow_Stage_ShadowVolumes();
-               ent = &cl_entities[0].render;
-               if (wl->shadowvolume && r_shadow_staticworldlights.integer)
-                       R_Shadow_DrawWorldLightShadowVolume(&ent->matrix, wl);
-               else
-                       R_TestAndDrawShadowVolume(ent, wl->origin, cullradius, lightradius, wl->mins, wl->maxs, clipmins, clipmaxs);
-               if (r_drawentities.integer)
-                       for (i = 0;i < r_refdef.numentities;i++)
-                               R_TestAndDrawShadowVolume(r_refdef.entities[i], wl->origin, cullradius, lightradius, wl->mins, wl->maxs, clipmins, clipmaxs);
+               if (wl->castshadows)
+               {
+                       if (!visiblevolumes)
+                               R_Shadow_Stage_ShadowVolumes();
+                       ent = &cl_entities[0].render;
+                       if (wl->shadowvolume && r_shadow_staticworldlights.integer)
+                               R_Shadow_DrawWorldLightShadowVolume(&ent->matrix, wl);
+                       else
+                               R_TestAndDrawShadowVolume(ent, wl->origin, cullradius, lightradius, wl->mins, wl->maxs, clipmins, clipmaxs);
+                       if (r_drawentities.integer)
+                               for (i = 0;i < r_refdef.numentities;i++)
+                                       R_TestAndDrawShadowVolume(r_refdef.entities[i], wl->origin, cullradius, lightradius, wl->mins, wl->maxs, clipmins, clipmaxs);
+               }
 
                if (!visiblevolumes)
                {
-                       R_Shadow_Stage_Light();
+                       if (wl->castshadows)
+                               R_Shadow_Stage_LightWithShadows();
+                       else
+                               R_Shadow_Stage_LightWithoutShadows();
                        ent = &cl_entities[0].render;
                        if (ent->model && ent->model->DrawLight)
                        {
@@ -1123,7 +1129,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
 
                if (!visiblevolumes)
                {
-                       R_Shadow_Stage_Light();
+                       R_Shadow_Stage_LightWithShadows();
                        ent = &cl_entities[0].render;
                        if (ent->model && ent->model->DrawLight)
                        {
@@ -1245,6 +1251,7 @@ R_RenderView
 r_refdef must be set before the first call
 ================
 */
+extern void R_DrawLightningBeams (void);
 void R_RenderView (void)
 {
        entity_render_t *world;
@@ -1338,6 +1345,9 @@ void R_RenderView (void)
                R_TimeReport("dynlight");
        }
 
+       R_DrawLightningBeams();
+       R_TimeReport("lightning");
+
        R_DrawParticles();
        R_TimeReport("particles");