mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-25 13:21:04 +00:00
Fixes/enhancements to particle scaling. Firstly, cvar is renamed to
gl_particles. Secondly, setting it to 0 now removes particles completely. Once I figure out how to do this for software, it will become r_particles.
This commit is contained in:
parent
049119d9f8
commit
69be4092e4
4 changed files with 142 additions and 136 deletions
|
@ -37,7 +37,7 @@
|
||||||
|
|
||||||
extern particle_t *active_particles, *free_particles;
|
extern particle_t *active_particles, *free_particles;
|
||||||
extern int ramp1[8], ramp2[8], ramp3[8];
|
extern int ramp1[8], ramp2[8], ramp3[8];
|
||||||
extern cvar_t *gl_pscale;
|
extern cvar_t *gl_particles;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
|
@ -61,6 +61,8 @@ void R_DrawParticles (void)
|
||||||
float scale;
|
float scale;
|
||||||
qboolean alphaTestEnabled;
|
qboolean alphaTestEnabled;
|
||||||
|
|
||||||
|
if (gl_particles->value)
|
||||||
|
{
|
||||||
GL_Bind(particletexture);
|
GL_Bind(particletexture);
|
||||||
alphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
|
alphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
|
||||||
|
|
||||||
|
@ -120,9 +122,9 @@ void R_DrawParticles (void)
|
||||||
+ (p->org[1] - r_origin[1])*vpn[1]
|
+ (p->org[1] - r_origin[1])*vpn[1]
|
||||||
+ (p->org[2] - r_origin[2])*vpn[2];
|
+ (p->org[2] - r_origin[2])*vpn[2];
|
||||||
if (scale < 20)
|
if (scale < 20)
|
||||||
scale = gl_pscale->value;
|
scale = gl_particles->value;
|
||||||
else
|
else
|
||||||
scale = gl_pscale->value + scale * 0.004;
|
scale = gl_particles->value + scale * 0.004;
|
||||||
#if 0 // was in uquake, but give it a go
|
#if 0 // was in uquake, but give it a go
|
||||||
glColor3ubv ((byte *)&d_8to24table[(int)p->color]);
|
glColor3ubv ((byte *)&d_8to24table[(int)p->color]);
|
||||||
#else
|
#else
|
||||||
|
@ -211,5 +213,6 @@ void R_DrawParticles (void)
|
||||||
if (alphaTestEnabled)
|
if (alphaTestEnabled)
|
||||||
glEnable(GL_ALPHA_TEST);
|
glEnable(GL_ALPHA_TEST);
|
||||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||||
|
} // if (gl_particles->value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ cvar_t *vid_mode;
|
||||||
cvar_t *vid_glx_fullscreen;
|
cvar_t *vid_glx_fullscreen;
|
||||||
extern cvar_t *gl_triplebuffer;
|
extern cvar_t *gl_triplebuffer;
|
||||||
extern cvar_t *vid_dga_mouseaccel;
|
extern cvar_t *vid_dga_mouseaccel;
|
||||||
cvar_t *gl_pscale;
|
cvar_t *gl_particles;
|
||||||
|
|
||||||
#ifdef HAS_DGA
|
#ifdef HAS_DGA
|
||||||
static int nummodes;
|
static int nummodes;
|
||||||
|
@ -568,7 +568,8 @@ void VID_Init(unsigned char *palette)
|
||||||
void VID_InitCvars()
|
void VID_InitCvars()
|
||||||
{
|
{
|
||||||
gl_triplebuffer = Cvar_Get("gl_triplebuffer","1",CVAR_ARCHIVE,"None");
|
gl_triplebuffer = Cvar_Get("gl_triplebuffer","1",CVAR_ARCHIVE,"None");
|
||||||
gl_pscale = Cvar_Get("gl_pscale","1",0,"Sets the size of particles");
|
gl_particles = Cvar_Get("gl_particles","1",0,
|
||||||
|
"Sets the size of particles");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -58,7 +58,7 @@ static cvar_t *vid_redrawfull;
|
||||||
static cvar_t *vid_waitforrefresh;
|
static cvar_t *vid_waitforrefresh;
|
||||||
cvar_t *gl_ztrick;
|
cvar_t *gl_ztrick;
|
||||||
extern cvar_t *gl_triplebuffer;
|
extern cvar_t *gl_triplebuffer;
|
||||||
cvar_t *gl_pscale;
|
cvar_t *gl_particles;
|
||||||
|
|
||||||
static fxMesaContext fc = NULL;
|
static fxMesaContext fc = NULL;
|
||||||
static int scr_width, scr_height;
|
static int scr_width, scr_height;
|
||||||
|
@ -519,7 +519,8 @@ void VID_ExtraOptionCmd(int option_cursor)
|
||||||
void VID_InitCvars ()
|
void VID_InitCvars ()
|
||||||
{
|
{
|
||||||
gl_triplebuffer = Cvar_Get ("gl_triplebuffer","1",CVAR_ARCHIVE,"None");
|
gl_triplebuffer = Cvar_Get ("gl_triplebuffer","1",CVAR_ARCHIVE,"None");
|
||||||
gl_pscale = Cvar_Get ("gl_pscale","1",0,"Sets the size of particles");
|
gl_particles = Cvar_Get ("gl_particles","1",0,
|
||||||
|
"Sets the size of particles");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -158,7 +158,7 @@ qboolean gl_mtexable = false;
|
||||||
//====================================
|
//====================================
|
||||||
|
|
||||||
cvar_t *gl_ztrick;
|
cvar_t *gl_ztrick;
|
||||||
cvar_t *gl_pscale;
|
cvar_t *gl_particles;
|
||||||
|
|
||||||
cvar_t *vid_mode;
|
cvar_t *vid_mode;
|
||||||
// Note that 0 is MODE_WINDOWED
|
// Note that 0 is MODE_WINDOWED
|
||||||
|
@ -1626,7 +1626,8 @@ void VID_Init (unsigned char *palette)
|
||||||
"None");
|
"None");
|
||||||
_windowed_mouse = Cvar_Get ("_windowed_mouse","1",CVAR_ARCHIVE,"None");
|
_windowed_mouse = Cvar_Get ("_windowed_mouse","1",CVAR_ARCHIVE,"None");
|
||||||
gl_ztrick = Cvar_Get ("gl_ztrick","1",CVAR_ARCHIVE,"None");
|
gl_ztrick = Cvar_Get ("gl_ztrick","1",CVAR_ARCHIVE,"None");
|
||||||
gl_pscale = Cvar_Get ("gl_pscale","1",0,"Sets the size of particles");
|
gl_particles = Cvar_Get ("gl_particles","1",0,
|
||||||
|
"Sets the size of particles");
|
||||||
|
|
||||||
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
Cmd_AddCommand ("vid_nummodes", VID_NumModes_f);
|
||||||
Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);
|
Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);
|
||||||
|
|
Loading…
Reference in a new issue