]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
moved light matrix generation out of the render code and into the light creation...
[xonotic/darkplaces.git] / sv_main.c
index afc29be8f473b0faf8d2e350685c95258b9cb8ef..9893dc367afe252a22dc8579b65d66d398221a29 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -805,7 +805,18 @@ void SV_PrepareEntitiesForSending(void)
                if (cs.viewmodelforclient)
                        cs.flags |= RENDER_VIEWMODEL; // show relative to the view
 
-               cs.specialvisibilityradius = 0;
+               f = GETEDICTFIELDVALUE(ent, eval_color)->vector[0]*256;
+               cs.light[0] = (unsigned short)bound(0, f, 65535);
+               f = GETEDICTFIELDVALUE(ent, eval_color)->vector[1]*256;
+               cs.light[1] = (unsigned short)bound(0, f, 65535);
+               f = GETEDICTFIELDVALUE(ent, eval_color)->vector[2]*256;
+               cs.light[2] = (unsigned short)bound(0, f, 65535);
+               f = GETEDICTFIELDVALUE(ent, eval_light_lev)->_float;
+               cs.light[3] = (unsigned short)bound(0, f, 65535);
+               cs.lightstyle = (qbyte)GETEDICTFIELDVALUE(ent, eval_style)->_float;
+               cs.lightpflags = (qbyte)GETEDICTFIELDVALUE(ent, eval_pflags)->_float;
+
+               cs.specialvisibilityradius = cs.light[3];
                if (cs.glowsize)
                        cs.specialvisibilityradius = max(cs.specialvisibilityradius, cs.glowsize * 4);
                if (cs.flags & RENDER_GLOWTRAIL)