]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Simplify R_DrawCustomSurface by calling R_DrawCustomSurface_Texture.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 23 Mar 2020 20:37:55 +0000 (20:37 +0000)
committerRudolf Polzer <divVerent@gmail.com>
Mon, 23 Mar 2020 20:51:43 +0000 (13:51 -0700)
Also, removed some stuff that's redundant with R_GetCurrentTexture.

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12524 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=c78240adf3aa2928002de7201e7bdfe02ecfe3b5

gl_rmain.c

index 4e35c2edaadbdb961f6345c727a5e214bb3d64cf..93d575aac9bd0debb86d61fb5faffc4bcd196cbe 100644 (file)
@@ -12436,36 +12436,8 @@ void R_DrawCustomSurface(skinframe_t *skinframe, const matrix4x4_t *texmatrix, i
        texture.specularscalemod = 1;
        texture.specularpowermod = 1;
        texture.transparentsort = TRANSPARENTSORT_DISTANCE;
-       // WHEN ADDING DEFAULTS HERE, REMEMBER TO PUT DEFAULTS IN ALL LOADERS
-       // JUST GREP FOR "specularscalemod = 1".
 
-       for (q = 0; q < 3; q++)
-       {
-               texture.render_glowmod[q] = r_refdef.view.colorscale * r_hdr_glowintensity.value;
-               texture.render_modellight_lightdir[q] = q == 2;
-               texture.render_modellight_ambient[q] = r_refdef.view.colorscale * r_refdef.scene.ambientintensity;
-               texture.render_modellight_diffuse[q] = r_refdef.view.colorscale;
-               texture.render_modellight_specular[q] = r_refdef.view.colorscale;
-               texture.render_lightmap_ambient[q] = r_refdef.view.colorscale * r_refdef.scene.ambientintensity;
-               texture.render_lightmap_diffuse[q] = r_refdef.view.colorscale * r_refdef.scene.lightmapintensity;
-               texture.render_lightmap_specular[q] = r_refdef.view.colorscale;
-               texture.render_rtlight_diffuse[q] = r_refdef.view.colorscale;
-               texture.render_rtlight_specular[q] = r_refdef.view.colorscale;
-       }
-       texture.currentalpha = 1.0f;
-
-       surface.texture = &texture;
-       surface.num_triangles = numtriangles;
-       surface.num_firsttriangle = firsttriangle;
-       surface.num_vertices = numvertices;
-       surface.num_firstvertex = firstvertex;
-
-       // now render it
-       rsurface.texture = R_GetCurrentTexture(surface.texture);
-       rsurface.lightmaptexture = NULL;
-       rsurface.deluxemaptexture = NULL;
-       rsurface.uselightmaptexture = false;
-       R_DrawModelTextureSurfaceList(1, &surfacelist, writedepth, prepass);
+       R_DrawCustomSurface_Texture(&texture, texmatrix, materialflags, firstvertex, numvertices, firsttriangle, numtriangles, writedepth, prepass);
 }
 
 void R_DrawCustomSurface_Texture(texture_t *texture, const matrix4x4_t *texmatrix, int materialflags, int firstvertex, int numvertices, int firsttriangle, int numtriangles, qboolean writedepth, qboolean prepass)