diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 7 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 1 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 3 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 7 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 12 | ||||
-rw-r--r-- | src/cgame/cg_particles.c | 19 |
6 files changed, 35 insertions, 14 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 2414b3d5..29b89ec4 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -979,12 +979,17 @@ void CG_Buildable( centity_t *cent ) if( !( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) { + sfxHandle_t prebuildSound; + if( team == BIT_HUMANS ) { ent.customShader = cgs.media.humanSpawningShader; + prebuildSound = cgs.media.humanBuildablePrebuild; } + else if( team == BIT_ALIENS ) + prebuildSound = cgs.media.alienBuildablePrebuild; - /*trap_S_AddLoopingSound*/ + trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, prebuildSound ); } CG_BuildableAnimation( cent, &ent.oldframe, &ent.frame, &ent.backlerp ); diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 1d6d5733..278309b8 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -882,6 +882,7 @@ static void CG_CEntityPVSEnter( centity_t *cent ) cent->jetPackState = JPS_OFF; cent->buildablePS = NULL; cent->entityPS = NULL; + cent->entityPSMissing = qfalse; //make sure that the buildable animations are in a consistent state //when a buildable enters the PVS diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 3157b660..6edcf942 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -710,7 +710,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_HUMAN_BUILDABLE_DAMAGE: DEBUGNAME( "EV_HUMAN_BUILDABLE_DAMAGE" ); - trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.humanBuildableDamage ); + i = rand( ) % 4; + trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.humanBuildableDamage[ i ] ); break; case EV_ALIEN_BUILDABLE_DAMAGE: diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 3120ee18..4c5f36a3 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -465,6 +465,7 @@ typedef struct centity_s jetPackState_t jetPackState; particleSystem_t *entityPS; + qboolean entityPSMissing; qboolean valid; qboolean oldValid; @@ -1178,9 +1179,11 @@ typedef struct sfxHandle_t alienOvermindSpawns; sfxHandle_t alienBuildableExplosion; - sfxHandle_t humanBuildableExplosion; sfxHandle_t alienBuildableDamage; - sfxHandle_t humanBuildableDamage; + sfxHandle_t alienBuildablePrebuild; + sfxHandle_t humanBuildableExplosion; + sfxHandle_t humanBuildablePrebuild; + sfxHandle_t humanBuildableDamage[ 4 ]; qhandle_t cursor; qhandle_t selectCursor; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index ee007318..baa1146a 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -586,7 +586,6 @@ static void CG_RegisterSounds( void ) cgs.media.gibBounce1Sound = trap_S_RegisterSound( "sound/player/gibimp1.wav", qfalse ); cgs.media.gibBounce2Sound = trap_S_RegisterSound( "sound/player/gibimp2.wav", qfalse ); cgs.media.gibBounce3Sound = trap_S_RegisterSound( "sound/player/gibimp3.wav", qfalse ); - cgs.media.metalGibBounceSound = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse ); cgs.media.teleInSound = trap_S_RegisterSound( "sound/world/telein.wav", qfalse ); cgs.media.teleOutSound = trap_S_RegisterSound( "sound/world/teleout.wav", qfalse ); @@ -648,9 +647,16 @@ static void CG_RegisterSounds( void ) cgs.media.alienEvolveSound = trap_S_RegisterSound( "sound/player/alienevolve.wav", qfalse ); cgs.media.alienBuildableExplosion = trap_S_RegisterSound( "sound/buildables/alien/explosion.wav", qfalse ); - cgs.media.humanBuildableExplosion = trap_S_RegisterSound( "sound/buildables/human/explosion.wav", qfalse ); cgs.media.alienBuildableDamage = trap_S_RegisterSound( "sound/buildables/alien/damage.wav", qfalse ); - cgs.media.humanBuildableDamage = trap_S_RegisterSound( "sound/buildables/human/damage.wav", qfalse ); + cgs.media.alienBuildablePrebuild = trap_S_RegisterSound( "sound/buildables/alien/prebuild.wav", qfalse ); + + cgs.media.humanBuildableExplosion = trap_S_RegisterSound( "sound/buildables/human/explosion.wav", qfalse ); + cgs.media.humanBuildablePrebuild = trap_S_RegisterSound( "sound/buildables/human/prebuild.wav", qfalse ); + cgs.media.metalGibBounceSound = trap_S_RegisterSound( "sound/buildables/human/fragmentbounce.wav", qfalse ); + + for( i = 0; i < 4; i++ ) + cgs.media.humanBuildableDamage[ i ] = trap_S_RegisterSound( + va( "sound/buildables/human/damage%d.wav", i ), qfalse ); cgs.media.hgrenb1aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb1a.wav", qfalse ); cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index ce0020d5..b3139bbf 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -357,8 +357,7 @@ particleSystem_t *CG_SpawnNewParticleSystem( qhandle_t psHandle ) if( !bps->registered ) { - CG_Printf( S_COLOR_RED "ERROR: particle system %s has not been registered yet\n", - bps->name ); + CG_Printf( S_COLOR_RED "ERROR: a particle system has not been registered yet\n" ); return NULL; } @@ -426,7 +425,7 @@ qhandle_t CG_RegisterParticleSystem( char *name ) } } - CG_Printf( S_COLOR_YELLOW "WARNING: failed to load particle system %s\n", name ); + CG_Printf( S_COLOR_RED "ERROR: failed to load particle system %s\n", name ); return 0; } @@ -2004,11 +2003,17 @@ void CG_ParticleSystemEntity( centity_t *cent ) return; } - if( !CG_IsParticleSystemValid( ¢->entityPS ) ) + if( !CG_IsParticleSystemValid( ¢->entityPS ) && !cent->entityPSMissing ) { cent->entityPS = CG_SpawnNewParticleSystem( cgs.gameParticleSystems[ es->modelindex ] ); - CG_SetParticleSystemOrigin( cent->entityPS, cent->lerpOrigin ); - CG_SetParticleSystemCent( cent->entityPS, cent ); - CG_AttachParticleSystemToOrigin( cent->entityPS ); + + if( CG_IsParticleSystemValid( ¢->entityPS ) ) + { + CG_SetParticleSystemOrigin( cent->entityPS, cent->lerpOrigin ); + CG_SetParticleSystemCent( cent->entityPS, cent ); + CG_AttachParticleSystemToOrigin( cent->entityPS ); + } + else + cent->entityPSMissing = qtrue; } } |