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++)
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()
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);
}
}
-extern cvar_t gl_vertexarrays;
-extern qboolean lighthalf;
void GL_DrawModelMesh(int skin, byte *colors, maliashdr_t *maliashdr)
{
int i;
int modeldlightbits[8];
extern int r_dlightframecount;
-extern void R_LightPoint (vec3_t color, vec3_t p);
/*
=================
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++)
if ((flags & EF_FULLBRIGHT) || (effects & EF_FULLBRIGHT))
color[0] = color[1] = color[2] = 256;
else
- {
- // HACK HACK HACK -- no fullbright colors, so make torches full light
- if (!strcmp (clmodel->name, "progs/flame2.mdl") || !strcmp (clmodel->name, "progs/flame.mdl") )
- color[0] = color[1] = color[2] = 128;
- else
- R_LightPoint (color, org);
- }
+ R_LightPoint (color, org);
if (r_render.value)
glDisable(GL_ALPHA_TEST);