]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
changed brightness of unlit q1bsp maps from 2x white to 1x white (so textures show...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 11 Mar 2007 03:34:50 +0000 (03:34 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 11 Mar 2007 03:34:50 +0000 (03:34 +0000)
fixed bug that made models black in unlit q1bsp maps

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6949 d7cf8633-e32d-0410-b094-e92efae38249

gl_rsurf.c
model_brush.c

index 30d6c6788aa46d54796f127cd5b32fb01aa9a823..7751e7bd8c8db32dacabe4339905d407c59d4314 100644 (file)
@@ -61,7 +61,7 @@ void R_BuildLightMap (const entity_render_t *ent, msurface_t *surface)
        if (!model->brushq1.lightdata)
        {
                for (i = 0;i < size3;i++)
-                       bl[i] = 255*256;
+                       bl[i] = 128*256;
        }
        else
        {
index 7c1ae56ffc76310ec46827483f9447f45b14c2aa..76e666f509a7f80cc3c0cdb398f002b0cd2895da 100644 (file)
@@ -1193,9 +1193,17 @@ middle sample (the one which was requested)
 
 void Mod_Q1BSP_LightPoint(model_t *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal)
 {
-       Mod_Q1BSP_LightPoint_RecursiveBSPNode(model, ambientcolor, diffusecolor, diffusenormal, model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode, p[0], p[1], p[2] + 0.125, p[2] - 65536);
        // pretend lighting is coming down from above (due to lack of a lightgrid to know primary lighting direction)
        VectorSet(diffusenormal, 0, 0, 1);
+
+       if (!model->brushq1.lightdata)
+       {
+               VectorSet(ambientcolor, 1, 1, 1);
+               VectorSet(diffusecolor, 0, 0, 0);
+               return;
+       }
+
+       Mod_Q1BSP_LightPoint_RecursiveBSPNode(model, ambientcolor, diffusecolor, diffusenormal, model->brush.data_nodes + model->brushq1.hulls[0].firstclipnode, p[0], p[1], p[2] + 0.125, p[2] - 65536);
 }
 
 static void Mod_Q1BSP_DecompressVis(const unsigned char *in, const unsigned char *inend, unsigned char *out, unsigned char *outend)
@@ -3406,9 +3414,6 @@ void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend)
        // check if the map supports transparent water rendering
        loadmodel->brush.supportwateralpha = Mod_Q1BSP_CheckWaterAlphaSupport();
 
-       if (!mod->brushq1.lightdata)
-               mod->brush.LightPoint = NULL;
-
        if (mod->brushq1.data_compressedpvs)
                Mem_Free(mod->brushq1.data_compressedpvs);
        mod->brushq1.data_compressedpvs = NULL;