]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_models.c
fixed the SU_ITEMS fix so that it doesn't trash the PROTOCOL_DARKPLACES6 parsing
[xonotic/darkplaces.git] / gl_models.c
index d416dd0223a33ca24a1587488f8f962e8c3572cd..5dfc5bc7a2dfba84889b7e5f13f6a35a2e044d65 100644 (file)
@@ -222,13 +222,13 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
 
        colorscale = 1;
        m.texrgbscale[0] = 0;
+       m.pointer_color = NULL;
 
-       if (texture->skin.glow)
+       if (doglow)
        {
                GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
                GL_DepthMask(false);
                m.tex[0] = R_GetTexture(texture->skin.glow);
-               m.pointer_color = NULL;
                GL_Color(1, 1, 1, ent->alpha);
                R_Mesh_State(&m);
                c_alias_polys += mesh->num_triangles;
@@ -242,7 +242,6 @@ static void R_DrawAliasModelCallback (const void *calldata1, int calldata2)
                GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
                GL_DepthMask(false);
                m.tex[0] = R_GetTexture(texture->skin.fog);
-               m.pointer_color = NULL;
                GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], fog * ent->alpha);
                R_Mesh_State(&m);
                c_alias_polys += mesh->num_triangles;
@@ -387,14 +386,7 @@ void R_Model_Alias_DrawLight(entity_render_t *ent, vec3_t relativelightorigin, v
                        Mod_BuildTextureVectorsAndNormals(0, mesh->num_vertices, mesh->num_triangles, vertex3f, mesh->data_texcoord2f, mesh->data_element3i, svector3f, tvector3f, normal3f);
                }
                c_alias_polys += mesh->num_triangles;
-               R_Shadow_RenderLighting(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i, vertex3f, svector3f, tvector3f, normal3f, mesh->data_texcoord2f, relativelightorigin, relativeeyeorigin, lightcolorbase, matrix_modeltolight, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, (ent->colormap >= 0 || !texture->skin.merged) ? texture->skin.base : texture->skin.merged, texture->skin.nmap, texture->skin.gloss, lightcubemap, ambientscale, diffusescale, specularscale);
-               if (ent->colormap >= 0)
-               {
-                       if (texture->skin.pants && VectorLength2(lightcolorpants) >= 0.001)
-                               R_Shadow_RenderLighting(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i, vertex3f, svector3f, tvector3f, normal3f, mesh->data_texcoord2f, relativelightorigin, relativeeyeorigin, lightcolorpants, matrix_modeltolight, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, texture->skin.pants, texture->skin.nmap, NULL, lightcubemap, ambientscale, diffusescale, 0);
-                       if (texture->skin.shirt && VectorLength2(lightcolorshirt) >= 0.001)
-                               R_Shadow_RenderLighting(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i, vertex3f, svector3f, tvector3f, normal3f, mesh->data_texcoord2f, relativelightorigin, relativeeyeorigin, lightcolorshirt, matrix_modeltolight, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, texture->skin.shirt, texture->skin.nmap, NULL, lightcubemap, ambientscale, diffusescale, 0);
-               }
+               R_Shadow_RenderLighting(0, mesh->num_vertices, mesh->num_triangles, mesh->data_element3i, vertex3f, svector3f, tvector3f, normal3f, mesh->data_texcoord2f, relativelightorigin, relativeeyeorigin, lightcolorbase, lightcolorpants, lightcolorshirt, matrix_modeltolight, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, (ent->colormap >= 0 || !texture->skin.merged) ? texture->skin.base : texture->skin.merged, ent->colormap >= 0 ? texture->skin.pants : 0, ent->colormap >= 0 ? texture->skin.shirt : 0, texture->skin.nmap, texture->skin.gloss, lightcubemap, ambientscale, diffusescale, specularscale);
        }
 }