]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_models.c
added back r_speeds2, with masses of information (6 lines high), and made it print...
[xonotic/darkplaces.git] / gl_models.c
index 9ff2baec7b62528548d0979704f70fadf156df8e..8b2d2823db8d942dd8858513a582ba919356940e 100644 (file)
@@ -15,7 +15,7 @@ void makechrometexture()
        byte noise[64*64];
        byte data[64*64][4];
 
-       fractalnoise(noise, 64);
+       fractalnoise(noise, 64, 16);
 
        // convert to RGBA data
        for (i = 0;i < 64*64;i++)
@@ -30,19 +30,19 @@ void makechrometexture()
 void gl_models_start()
 {
        // allocate vertex processing arrays
-       aliasvert = malloc(sizeof(float[MD2MAX_VERTS][3]));
-       aliasvertnorm = malloc(sizeof(float[MD2MAX_VERTS][3]));
-       aliasvertcolor = malloc(sizeof(byte[MD2MAX_VERTS][4]));
-       aliasvertcolor2 = malloc(sizeof(byte[MD2MAX_VERTS][4])); // used temporarily for tinted coloring
+       aliasvert = qmalloc(sizeof(float[MD2MAX_VERTS][3]));
+       aliasvertnorm = qmalloc(sizeof(float[MD2MAX_VERTS][3]));
+       aliasvertcolor = qmalloc(sizeof(byte[MD2MAX_VERTS][4]));
+       aliasvertcolor2 = qmalloc(sizeof(byte[MD2MAX_VERTS][4])); // used temporarily for tinted coloring
        makechrometexture();
 }
 
 void gl_models_shutdown()
 {
-       free(aliasvert);
-       free(aliasvertnorm);
-       free(aliasvertcolor);
-       free(aliasvertcolor2);
+       qfree(aliasvert);
+       qfree(aliasvertnorm);
+       qfree(aliasvertcolor);
+       qfree(aliasvertcolor2);
 }
 
 void GL_Models_Init()
@@ -70,8 +70,6 @@ void R_AliasLerpVerts(int vertcount, float lerp, trivert2 *verts1, vec3_t scale1
        if (lerp != 0)
        {
                float ilerp, ilerp127, lerp127, scalex1, scalex2, translatex, scaley1, scaley2, translatey, scalez1, scalez2, translatez;
-               if (lerp < 0) lerp = 0;
-               if (lerp > 1) lerp = 1;
                ilerp = 1 - lerp;
                ilerp127 = ilerp * (1.0 / 127.0);
                lerp127 = lerp * (1.0 / 127.0);
@@ -146,8 +144,6 @@ float R_CalcAnimLerp(entity_t *ent, int pose, float lerpscale)
        }
 }
 
-extern cvar_t gl_vertexarrays;
-extern qboolean lighthalf;
 void GL_DrawModelMesh(int skin, byte *colors, maliashdr_t *maliashdr)
 {
        int i;
@@ -630,7 +626,6 @@ void R_DrawQ2AliasFrame (md2mem_t *pheader, float alpha, vec3_t color, entity_t
 
 int modeldlightbits[8];
 extern int r_dlightframecount;
-extern void R_LightPoint (vec3_t color, vec3_t p);
 
 /*
 =================
@@ -655,6 +650,8 @@ void R_DrawAliasModel (entity_t *ent, int cull, float alpha, model_t *clmodel, i
        if (cull && R_CullBox (mins, maxs))
                return;
 
+       c_models++;
+
        leaf = Mod_PointInLeaf (org, cl.worldmodel);
        if (leaf->dlightframe == r_dlightframecount)
                for (i = 0;i < 8;i++)