diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_public.h | 8 | ||||
-rw-r--r-- | src/game/g_misc.c | 74 | ||||
-rw-r--r-- | src/game/g_spawn.c | 15 | ||||
-rw-r--r-- | src/game/g_utils.c | 4 | ||||
-rw-r--r-- | src/game/q_shared.h | 1 |
5 files changed, 79 insertions, 23 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 6205bc2e..da4f09ea 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -98,12 +98,13 @@ #define CS_MODELS 33 #define CS_SOUNDS (CS_MODELS+MAX_MODELS) -#define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) +#define CS_SHADERS (CS_SOUNDS+MAX_SOUNDS) +#define CS_PLAYERS (CS_SHADERS+MAX_SHADERS) #define CS_PRECACHES (CS_PLAYERS+MAX_CLIENTS) #define CS_LOCATIONS (CS_PRECACHES+MAX_CLIENTS) -#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) +/*#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) TA: never used?!*/ -#define CS_MAX (CS_PARTICLES+MAX_LOCATIONS) +#define CS_MAX (CS_LOCATIONS+MAX_LOCATIONS) #if (CS_MAX) > MAX_CONFIGSTRINGS #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS @@ -1003,6 +1004,7 @@ typedef enum { ET_TORCH, //TA: torch type ET_CORPSE, + ET_SPRITER, ET_EVENTS // any of the EV_* events can be added freestanding // by setting eType to ET_EVENTS + eventNum diff --git a/src/game/g_misc.c b/src/game/g_misc.c index a874d5b0..870b5144 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -70,24 +70,6 @@ void SP_light( gentity_t *self ) { G_FreeEntity( self ); } -//TA: position/colour/intensity calculating function -void ShineTorch( gentity_t *self ) -{ - vec3_t origin, angles; - - VectorCopy( self->parent->s.pos.trBase, origin ); - VectorCopy( self->parent->s.apos.trBase, angles ); - - G_SetOrigin( self, origin ); - - VectorCopy( angles, self->s.apos.trBase ); - - //so we can use the predicted values client side if available - self->s.clientNum = self->parent->s.number; - - trap_LinkEntity( self ); -} - /* @@ -356,3 +338,59 @@ void SP_shooter_grenade( gentity_t *ent ) { //InitShooter( ent, WP_GRENADE_LAUNCHER); } +/* +====================================================================== + + NEAT EFFECTS AND STUFF FOR TREMULOUS + +====================================================================== +*/ + +//TA: position/colour/intensity calculating function +void ShineTorch( gentity_t *self ) +{ + vec3_t origin, angles; + + VectorCopy( self->parent->s.pos.trBase, origin ); + VectorCopy( self->parent->s.apos.trBase, angles ); + + G_SetOrigin( self, origin ); + + VectorCopy( angles, self->s.apos.trBase ); + + //so we can use the predicted values client side if available + self->s.clientNum = self->parent->s.number; + + trap_LinkEntity( self ); +} + +void SP_spriter( gentity_t *self ) +{ + vec3_t accel; + + G_SetOrigin( self, self->s.origin ); + + VectorCopy( self->acceleration, self->s.origin2 ); + + self->s.time = (int)self->speed; + self->s.time2 = (int)self->wait; + self->s.powerups = (int)self->random; + self->s.angles2[ 0 ] = self->physicsBounce; + + self->s.modelindex = self->pos1[ 0 ]; + self->s.modelindex2 = self->pos1[ 1 ]; + + self->s.legsAnim = self->pos2[ 0 ]; + self->s.torsoAnim = self->pos2[ 1 ]; + + if( self->count > 0 ) + self->s.angles2[ 1 ] = ( 1000 / self->count ); + else + self->s.angles2[ 1 ] = 1000; + + self->s.weapon = G_ShaderIndex( self->targetShaderName ); + + self->s.eType = ET_SPRITER; + + trap_LinkEntity( self ); +} diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 8f74a4ee..37dbc82e 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -118,6 +118,12 @@ field_t fields[] = { {"dmg", FOFS(damage), F_INT}, {"angles", FOFS(s.angles), F_VECTOR}, {"angle", FOFS(s.angles), F_ANGLEHACK}, + //TA + {"bounce", FOFS(physicsBounce), F_FLOAT}, + {"alpha", FOFS(pos1), F_VECTOR}, + {"radius", FOFS(pos2), F_VECTOR}, + {"acceleration", FOFS(acceleration), F_VECTOR}, + //TA {"targetShaderName", FOFS(targetShaderName), F_LSTRING}, {"targetShaderNewName", FOFS(targetShaderNewName), F_LSTRING}, @@ -135,8 +141,8 @@ void SP_info_player_deathmatch (gentity_t *ent); void SP_info_player_intermission (gentity_t *ent); //TA: extra bits -void SP_info_droid_intermission (gentity_t *ent); -void SP_info_human_intermission (gentity_t *ent); +void SP_info_droid_intermission( gentity_t *ent ); +void SP_info_human_intermission( gentity_t *ent ); void SP_info_firstplace(gentity_t *ent); void SP_info_secondplace(gentity_t *ent); @@ -195,6 +201,9 @@ void SP_team_CTF_blueplayer( gentity_t *ent ); void SP_team_CTF_redspawn( gentity_t *ent ); void SP_team_CTF_bluespawn( gentity_t *ent ); +//TA: +void SP_spriter( gentity_t *ent ); + spawn_t spawns[] = { // info entities don't do anything at all, but provide positional // information for things controlled by other processes @@ -266,6 +275,8 @@ spawn_t spawns[] = { {"team_CTF_redspawn", SP_team_CTF_redspawn}, {"team_CTF_bluespawn", SP_team_CTF_bluespawn}, + {"spriter", SP_spriter}, + {0, 0} }; diff --git a/src/game/g_utils.c b/src/game/g_utils.c index 07d0adf4..d13b9356 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -117,6 +117,10 @@ int G_FindConfigstringIndex( char *name, int start, int max, qboolean create ) { return i; } +//TA: added ShaderIndex +int G_ShaderIndex( char *name ) { + return G_FindConfigstringIndex (name, CS_SHADERS, MAX_SHADERS, qtrue); +} int G_ModelIndex( char *name ) { return G_FindConfigstringIndex (name, CS_MODELS, MAX_MODELS, qtrue); diff --git a/src/game/q_shared.h b/src/game/q_shared.h index b5fd5889..153ce970 100644 --- a/src/game/q_shared.h +++ b/src/game/q_shared.h @@ -1102,6 +1102,7 @@ typedef enum { #define MAX_MODELS 256 // these are sent over the net as 8 bits #define MAX_SOUNDS 256 // so they cannot be blindly increased +#define MAX_SHADERS 256 //TA: should be in bg_public.h #define MAX_CONFIGSTRINGS 1024 |