static cvar_t r_drawparticles = {0, "r_drawparticles", "1"};
static cvar_t r_particles_lighting = {0, "r_particles_lighting", "1"};
-static byte shadebubble(float dx, float dy, vec3_t light)
+static qbyte shadebubble(float dx, float dy, vec3_t light)
{
float dz, f, dot;
vec3_t normal;
f *= 128;
f += 16; // just to give it a haze so you can see the outline
f = bound(0, f, 255);
- return (byte) f;
+ return (qbyte) f;
}
else
return 0;
}
-static void setuptex(int cltexnum, int fog, int rtexnum, byte *data, byte *particletexturedata)
+static void setuptex(int cltexnum, int fog, int rtexnum, qbyte *data, qbyte *particletexturedata)
{
int basex, basey, y;
basex = ((rtexnum >> 0) & 7) * 32;
{
int x,y,d,i,m;
float dx, dy, radius, f, f2;
- byte data[32][32][4], noise1[64][64], noise2[64][64];
+ qbyte data[32][32][4], noise1[64][64], noise2[64][64];
vec3_t light;
- byte particletexturedata[256*256*4];
+ qbyte particletexturedata[256*256*4];
memset(particletexturedata, 255, sizeof(particletexturedata));
if (d > 0)
d = (d * (256 - (int) (dx*dx+dy*dy))) >> 8;
d = bound(0, d, 255);
- data[y][x][3] = (byte) d;
+ data[y][x][3] = (qbyte) d;
if (m < d)
m = d;
}
dx = x - 16;
d = (256 - (dx*dx+dy*dy));
d = bound(0, d, 255);
- data[y][x][3] = (byte) d;
+ data[y][x][3] = (qbyte) d;
}
}
setuptex(24, 0, 32, &data[0][0][0], particletexturedata);
R_RegisterModule("R_Particles", r_part_start, r_part_shutdown, r_part_newmap);
}
-//int partindexarray[6] = {0, 1, 2, 0, 2, 3};
+int partindexarray[6] = {0, 1, 2, 0, 2, 3};
void R_DrawParticles (void)
{
m.transparent = true;
m.blendfunc1 = GL_SRC_ALPHA;
m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA;
- //m.numtriangles = 2;
- //m.index = partindexarray;
- //m.numverts = 4;
+ m.numtriangles = 2;
+ m.index = partindexarray;
+ m.numverts = 4;
m.vertex = &tvxyz[0][0];
- //m.vertexstep = sizeof(float[4]);
+ m.vertexstep = sizeof(float[4]);
m.tex[0] = R_GetTexture(particlefonttexture);
m.texcoords[0] = &tvst[0][0];
- //m.texcoordstep[0] = sizeof(float[2]);
+ m.texcoordstep[0] = sizeof(float[2]);
for (i = 0, r = r_refdef.particles;i < r_refdef.numparticles;i++, r++)
{
m.cr *= ifog;
m.cg *= ifog;
m.cb *= ifog;
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
}
else
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
else
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
else
{
tvst[2][1] = texfog->t2;
tvst[3][0] = texfog->s2;
tvst[3][1] = texfog->t1;
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
else
{
m.cr += fogcolor[0] * fog;
m.cg += fogcolor[1] * fog;
m.cb += fogcolor[2] * fog;
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
else
{
// render the first pass (alpha), then do additive fog
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
m.blendfunc2 = GL_ONE;
m.cr = fogcolor[0];
tvst[2][1] = texfog->t2;
tvst[3][0] = texfog->s2;
tvst[3][1] = texfog->t1;
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
}
}
else
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
else
- R_Mesh_DrawDecal(&m);
+ R_Mesh_Draw(&m);
}
}
}