Added gl1 square particles CVar

This commit is contained in:
DenisBelmondo 2019-12-04 22:13:39 -07:00 committed by Yamagi
parent e23010c9f9
commit af45aa56f1
2 changed files with 22 additions and 6 deletions

View File

@ -88,6 +88,7 @@ cvar_t *gl1_particle_size;
cvar_t *gl1_particle_att_a;
cvar_t *gl1_particle_att_b;
cvar_t *gl1_particle_att_c;
cvar_t *gl1_particle_square;
cvar_t *gl1_palettedtexture;
cvar_t *gl1_pointparameters;
@ -1218,6 +1219,7 @@ R_Register(void)
gl1_particle_att_a = ri.Cvar_Get("gl1_particle_att_a", "0.01", CVAR_ARCHIVE);
gl1_particle_att_b = ri.Cvar_Get("gl1_particle_att_b", "0.0", CVAR_ARCHIVE);
gl1_particle_att_c = ri.Cvar_Get("gl1_particle_att_c", "0.01", CVAR_ARCHIVE);
gl1_particle_square = ri.Cvar_Get("gl1_particle_square", "0", CVAR_ARCHIVE);
r_modulate = ri.Cvar_Get("r_modulate", "1", CVAR_ARCHIVE);
r_mode = ri.Cvar_Get("r_mode", "4", CVAR_ARCHIVE);
@ -1667,6 +1669,26 @@ RI_BeginFrame(float camera_separation)
glEnable(GL_ALPHA_TEST);
glColor4f(1, 1, 1, 1);
if (gl1_particle_square->modified)
{
gl1_particle_square->modified = false;
/* yamagi: GL_POINT_SMOOTH is not implemented by some
OpenGL drivers, especially the crappy Mesa3D backends
like i915.so. That the points are squares and not
circles is not a problem by Quake II! */
switch ((int)gl1_particle_square->value)
{
default:
glDisable(GL_POINT_SMOOTH);
break;
case 0:
glEnable(GL_POINT_SMOOTH);
break;
}
}
/* draw buffer stuff */
if (gl_drawbuffer->modified)
{

View File

@ -189,11 +189,6 @@ R_SetDefaultState(void)
attenuations[1] = gl1_particle_att_b->value;
attenuations[2] = gl1_particle_att_c->value;
/* GL_POINT_SMOOTH is not implemented by some OpenGL
drivers, especially the crappy Mesa3D backends like
i915.so. That the points are squares and not circles
is not a problem by Quake II! */
glEnable(GL_POINT_SMOOTH);
qglPointParameterfARB(GL_POINT_SIZE_MIN_EXT, gl1_particle_min_size->value);
qglPointParameterfARB(GL_POINT_SIZE_MAX_EXT, gl1_particle_max_size->value);
qglPointParameterfvARB(GL_DISTANCE_ATTENUATION_EXT, attenuations);
@ -211,4 +206,3 @@ R_SetDefaultState(void)
glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST);
}
}