Skip to content

Commit

Permalink
Add ‘gl_partstyle’ variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Nov 29, 2012
1 parent 2c327f4 commit f367840
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions doc/client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,11 @@ gl_drawsky::
gl_partscale::
Specifies minimum size of particles. Default value is 2.

gl_partstyle::
Specifies drawing style of particles. Default value is 0.
- 0 — blend colors
- 1 — saturate colors

gl_celshading::
Enables drawing black contour lines around 3D models (aka ‘celshading’).
Value of this variable specifies thickness of the lines drawn. Default
Expand Down
1 change: 1 addition & 0 deletions src/refresh/gl/gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ extern statCounters_t c;

// regular variables
extern cvar_t *gl_partscale;
extern cvar_t *gl_partstyle;
extern cvar_t *gl_celshading;
extern cvar_t *gl_dotshading;
extern cvar_t *gl_shadows;
Expand Down
2 changes: 2 additions & 0 deletions src/refresh/gl/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ int registration_sequence;

// regular variables
cvar_t *gl_partscale;
cvar_t *gl_partstyle;
cvar_t *gl_celshading;
cvar_t *gl_dotshading;
cvar_t *gl_shadows;
Expand Down Expand Up @@ -736,6 +737,7 @@ static void GL_Register(void)
{
// regular variables
gl_partscale = Cvar_Get("gl_partscale", "2", 0);
gl_partstyle = Cvar_Get("gl_partstyle", "0", 0);
gl_celshading = Cvar_Get("gl_celshading", "0", 0);
gl_dotshading = Cvar_Get("gl_dotshading", "1", 0);
gl_shadows = Cvar_Get("gl_shadows", "0", CVAR_ARCHIVE);
Expand Down
8 changes: 7 additions & 1 deletion src/refresh/gl/tess.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@ void GL_DrawParticles(void)
int numverts;
vec_t *dst_vert;
uint32_t *dst_color;
int blend;

if (!glr.fd.num_particles) {
return;
}

if (gl_partstyle->integer)
blend = GLS_BLEND_ADD;
else
blend = GLS_BLEND_BLEND;

GL_BindTexture(TEXNUM_PARTICLE);
GL_TexEnv(GL_MODULATE);
GL_Bits(GLS_BLEND_BLEND | GLS_DEPTHMASK_FALSE);
GL_Bits(blend | GLS_DEPTHMASK_FALSE);

qglEnableClientState(GL_COLOR_ARRAY);
qglColorPointer(4, GL_UNSIGNED_BYTE, 0, tess.colors);
Expand Down

0 comments on commit f367840

Please sign in to comment.