+void R_CompleteLightPoint (vec3_t color, vec3_t p, int dynamic, mleaf_t *leaf)
+{
+ if (leaf == NULL)
+ leaf = Mod_PointInLeaf(p, cl.worldmodel);
+
+ if (leaf->contents == CONTENTS_SOLID)
+ {
+ color[0] = color[1] = color[2] = 0;
+ return;
+ }
+
+ if (r_fullbright.value || !cl.worldmodel->lightdata)
+ {
+ color[0] = color[1] = color[2] = 255;
+ return;
+ }
+
+ color[0] = color[1] = color[2] = r_ambient.value * 2.0f;
+ RecursiveLightPoint (color, cl.worldmodel->nodes, p[0], p[1], p[2], p[2] - 65536);
+
+ if (dynamic)
+ R_DynamicLightPoint(color, p, leaf->dlightbits);
+}
+
+void R_ModelLightPoint (vec3_t color, vec3_t p, int *dlightbits)
+{
+ mleaf_t *leaf;
+ leaf = Mod_PointInLeaf(p, cl.worldmodel);
+ if (leaf->contents == CONTENTS_SOLID)
+ {
+ color[0] = color[1] = color[2] = 0;
+ dlightbits[0] = dlightbits[1] = dlightbits[2] = dlightbits[3] = dlightbits[4] = dlightbits[5] = dlightbits[6] = dlightbits[7] = 0;
+ return;
+ }
+
+ if (r_fullbright.value || !cl.worldmodel->lightdata)
+ {
+ color[0] = color[1] = color[2] = 255;
+ dlightbits[0] = dlightbits[1] = dlightbits[2] = dlightbits[3] = dlightbits[4] = dlightbits[5] = dlightbits[6] = dlightbits[7] = 0;
+ return;
+ }
+
+ color[0] = color[1] = color[2] = r_ambient.value * 2.0f;
+ RecursiveLightPoint (color, cl.worldmodel->nodes, p[0], p[1], p[2], p[2] - 65536);
+
+ if (leaf->dlightframe == r_framecount)
+ {
+ dlightbits[0] = leaf->dlightbits[0];
+ dlightbits[1] = leaf->dlightbits[1];
+ dlightbits[2] = leaf->dlightbits[2];
+ dlightbits[3] = leaf->dlightbits[3];
+ dlightbits[4] = leaf->dlightbits[4];
+ dlightbits[5] = leaf->dlightbits[5];
+ dlightbits[6] = leaf->dlightbits[6];
+ dlightbits[7] = leaf->dlightbits[7];
+ }
+ else
+ dlightbits[0] = dlightbits[1] = dlightbits[2] = dlightbits[3] = dlightbits[4] = dlightbits[5] = dlightbits[6] = dlightbits[7] = 0;
+}
+
+/* // not currently used