From 934ace091f153e11f5511a76ddc78b99c7ff119d Mon Sep 17 00:00:00 2001 From: Dan Olson Date: Sun, 19 Mar 2000 21:50:00 +0000 Subject: [PATCH] Particle scaling code. Controlled with gl_pscale cvar. 1 is default, anything over 20 is just plain overkill. Thanx to QER for the idea. --- common/gl_rpart.c | 5 +++-- common/gl_vidglx.c | 2 ++ common/gl_vidlinux_3dfx.c | 2 ++ common/gl_vidnt.c | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/gl_rpart.c b/common/gl_rpart.c index a368501..424e99a 100644 --- a/common/gl_rpart.c +++ b/common/gl_rpart.c @@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern particle_t *active_particles, *free_particles; extern int ramp1[8], ramp2[8], ramp3[8]; +extern cvar_t *gl_pscale; /* =============== @@ -112,9 +113,9 @@ void R_DrawParticles (void) + (p->org[1] - r_origin[1])*vpn[1] + (p->org[2] - r_origin[2])*vpn[2]; if (scale < 20) - scale = 1; + scale = gl_pscale->value; else - scale = 1 + scale * 0.004; + scale = gl_pscale->value + scale * 0.004; #if 0 // was in uquake, but give it a go glColor3ubv ((byte *)&d_8to24table[(int)p->color]); #else diff --git a/common/gl_vidglx.c b/common/gl_vidglx.c index e14789e..861fc4e 100644 --- a/common/gl_vidglx.c +++ b/common/gl_vidglx.c @@ -85,6 +85,7 @@ cvar_t *vid_mode; cvar_t *vid_glx_fullscreen; extern cvar_t *gl_triplebuffer; extern cvar_t *vid_dga_mouseaccel; +cvar_t *gl_pscale; #ifdef HAS_DGA static int nummodes; @@ -555,4 +556,5 @@ void VID_Init(unsigned char *palette) void VID_InitCvars() { gl_triplebuffer = Cvar_Get("gl_triplebuffer","1",CVAR_ARCHIVE,"None"); + gl_pscale = Cvar_Get("gl_pscale","1",0,"Sets the size of particles"); } diff --git a/common/gl_vidlinux_3dfx.c b/common/gl_vidlinux_3dfx.c index 6a1dbb7..195acb4 100644 --- a/common/gl_vidlinux_3dfx.c +++ b/common/gl_vidlinux_3dfx.c @@ -51,6 +51,7 @@ static cvar_t *vid_redrawfull; static cvar_t *vid_waitforrefresh; cvar_t *gl_ztrick; extern cvar_t *gl_triplebuffer; +cvar_t *gl_pscale; static fxMesaContext fc = NULL; static int scr_width, scr_height; @@ -511,4 +512,5 @@ void VID_ExtraOptionCmd(int option_cursor) void VID_InitCvars () { gl_triplebuffer = Cvar_Get ("gl_triplebuffer","1",CVAR_ARCHIVE,"None"); + gl_pscale = Cvar_Get ("gl_pscale","1",0,"Sets the size of particles"); } diff --git a/common/gl_vidnt.c b/common/gl_vidnt.c index 0d93738..e64efda 100644 --- a/common/gl_vidnt.c +++ b/common/gl_vidnt.c @@ -151,6 +151,7 @@ qboolean gl_mtexable = false; //==================================== cvar_t *gl_ztrick; +cvar_t *gl_pscale; cvar_t *vid_mode; // Note that 0 is MODE_WINDOWED @@ -1607,6 +1608,7 @@ void VID_Init (unsigned char *palette) "None"); _windowed_mouse = Cvar_Get ("_windowed_mouse","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"); Cmd_AddCommand ("vid_nummodes", VID_NumModes_f); Cmd_AddCommand ("vid_describecurrentmode", VID_DescribeCurrentMode_f);