]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
more size_t
[xonotic/darkplaces.git] / gl_rsurf.c
index f739601c0f88b5763bc1a47dfa5b76eb4eb532af..27f6d6db4c2774aea025b5c3712e4d4e41e64689 100644 (file)
@@ -489,6 +489,7 @@ void R_Q1BSP_Draw(entity_render_t *ent)
                model_t *model = ent->model;
                msurface_t *surface;
                q3mbrush_t *brush;
+               R_Mesh_Matrix(&ent->matrix);
                GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
                GL_DepthMask(false);
                GL_DepthTest(true);
@@ -667,7 +668,7 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
        model_t *model = ent->model;
        msurface_t *surface;
        int surfacelistindex;
-       float projectdistance = lightradius + model->radius + r_shadow_projectdistance.value;
+       float projectdistance = lightradius + model->radius*2 + r_shadow_projectdistance.value;
        vec3_t modelorg;
        texture_t *texture;
        // check the box in modelspace, it was already checked in worldspace
@@ -710,7 +711,7 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
        }
        else
        {
-               projectdistance = lightradius + ent->model->radius;
+               projectdistance = lightradius + ent->model->radius*2;
                Matrix4x4_Transform(&ent->inversematrix, r_vieworigin, modelorg);
                for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
                {
@@ -791,7 +792,7 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, float *lightcolor, int numsurfaces,
                                vec3_t lightcolorpants, lightcolorshirt;
                                // 128-224 are backwards ranges
                                int b = (ent->colormap & 0xF) << 4;b += (b >= 128 && b < 224) ? 4 : 12;
-                               if (texture->skin.pants && b >= 224)
+                               if (texture->skin.pants && b < 224)
                                {
                                        qbyte *bcolor = (qbyte *) (&palette_complete[b]);
                                        lightcolorpants[0] = lightcolor[0] * bcolor[0] * (1.0f / 255.0f);
@@ -802,7 +803,7 @@ void R_Q1BSP_DrawLight(entity_render_t *ent, float *lightcolor, int numsurfaces,
                                        VectorClear(lightcolorpants);
                                // 128-224 are backwards ranges
                                b = (ent->colormap & 0xF0);b += (b >= 128 && b < 224) ? 4 : 12;
-                               if (texture->skin.shirt && b >= 224)
+                               if (texture->skin.shirt && b < 224)
                                {
                                        qbyte *bcolor = (qbyte *) (&palette_complete[b]);
                                        lightcolorshirt[0] = lightcolor[0] * bcolor[0] * (1.0f / 255.0f);