From: havoc Date: Sun, 11 Mar 2007 03:34:50 +0000 (+0000) Subject: changed brightness of unlit q1bsp maps from 2x white to 1x white (so textures show... X-Git-Tag: xonotic-v0.1.0preview~3467 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=87c956a833d3a46ff0879c36ffcee4c3f2f9e787;p=xonotic%2Fdarkplaces.git changed brightness of unlit q1bsp maps from 2x white to 1x white (so textures show as their true colors rather than twice as bright) 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 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index 30d6c678..7751e7bd 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -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 { diff --git a/model_brush.c b/model_brush.c index 7c1ae56f..76e666f5 100644 --- a/model_brush.c +++ b/model_brush.c @@ -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;