From 6a0c927855d030620dc2a54a261be7119b771897 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Wed, 15 Aug 2001 00:39:36 +0000 Subject: Added spriter - simple particle engine for mappers --- src/cgame/cg_ents.c | 3 +++ src/cgame/cg_local.h | 13 +++++++++++++ src/cgame/cg_main.c | 11 +++++++++++ src/cgame/cg_servercmds.c | 4 +++- 4 files changed, 30 insertions(+), 1 deletion(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 62920756..d145f387 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -953,6 +953,9 @@ static void CG_AddCEntity( centity_t *cent ) { case ET_GRAPPLE: CG_Grapple( cent ); break; + case ET_SPRITER: + CG_Spriter( cent ); + break; } } diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 0a672504..9f701bc8 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -220,6 +220,7 @@ typedef enum { LE_SPRITE_EXPLOSION, LE_FRAGMENT, LE_MOVE_SCALE_FADE, + LE_SPRITER, LE_FALL_SCALE_FADE, LE_FADE_RGB, LE_SCALE_FADE @@ -272,6 +273,12 @@ typedef struct localEntity_s { leBounceSoundType_t leBounceSoundType; refEntity_t refEntity; + + //TA: random stuff for cg_spriter.c + vec3_t acceleration; + float initAlp, finalAlp; + float initRad, finalRad; + qboolean overdraw; } localEntity_t; //====================================================================== @@ -1025,6 +1032,7 @@ typedef struct { // locally derived information from gamestate // qhandle_t gameModels[MAX_MODELS]; + qhandle_t gameShaders[MAX_SHADERS]; sfxHandle_t gameSounds[MAX_SOUNDS]; int numInlineModels; @@ -1327,6 +1335,11 @@ sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ); void CG_Buildable( centity_t *cent ); void CG_InitBuildables( ); +// +// cg_spriter.c +// +void CG_Spriter( centity_t *cent ); + // // cg_predict.c // diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 2cdc9149..35a6022b 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -907,6 +907,17 @@ static void CG_RegisterGraphics( void ) { cgs.gameModels[i] = trap_R_RegisterModel( modelName ); } + // register all the server specified shaders + for (i=1 ; i= CS_MODELS && num < CS_MODELS+MAX_MODELS ) { cgs.gameModels[ num-CS_MODELS ] = trap_R_RegisterModel( str ); - } else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_MODELS ) { + } else if ( num >= CS_SHADERS && num < CS_SHADERS+MAX_SHADERS ) { + cgs.gameShaders[ num-CS_SHADERS ] = trap_R_RegisterShader( str ); + } else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_SOUNDS ) { if ( str[0] != '*' ) { // player specific sounds don't register here cgs.gameSounds[ num-CS_SOUNDS] = trap_S_RegisterSound( str, qfalse ); } -- cgit