diff options
-rw-r--r-- | src/cgame/cg_buildable.c | 8 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 13 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 6 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 9 | ||||
-rw-r--r-- | src/cgame/cg_particles.c | 54 |
5 files changed, 73 insertions, 17 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 119a84a4..51176488 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -31,8 +31,8 @@ char *cg_buildableSoundNames[ MAX_BUILDABLE_ANIMATIONS ] = "destroyed.wav" }; -sfxHandle_t defaultAlienSounds[ MAX_BUILDABLE_ANIMATIONS ]; -sfxHandle_t defaultHumanSounds[ MAX_BUILDABLE_ANIMATIONS ]; +static sfxHandle_t defaultAlienSounds[ MAX_BUILDABLE_ANIMATIONS ]; +static sfxHandle_t defaultHumanSounds[ MAX_BUILDABLE_ANIMATIONS ]; /* @@ -82,6 +82,8 @@ void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir ) int count; particleSystem_t *ps; + trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.alienBuildableExplosion ); + // allow gibs to be turned off for speed if( cg_gibs.integer ) { @@ -157,7 +159,7 @@ void CG_HumanBuildableExplosion( vec3_t origin, vec3_t dir ) lightColor[ 1 ] = 0.75; lightColor[ 2 ] = 0.0; - trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.humanBuildableExpl ); + trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.humanBuildableExplosion ); // // create the explosion -- only the light is important really diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 0d8f26de..869eb8c6 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -408,14 +408,11 @@ static void CG_Missile( centity_t *cent ) if( VectorNormalize2( es->pos.trDelta, ent.axis[ 0 ] ) == 0 ) ent.axis[ 0 ][ 2 ] = 1; - if( wi->wim[ weaponMode ].missileRotates ) - { - // spin as it moves - if( es->pos.trType != TR_STATIONARY ) - RotateAroundDirection( ent.axis, cg.time / 4 ); - else - RotateAroundDirection( ent.axis, es->time ); - } + // spin as it moves + if( es->pos.trType != TR_STATIONARY && wi->wim[ weaponMode ].missileRotates ) + RotateAroundDirection( ent.axis, cg.time / 4 ); + else + RotateAroundDirection( ent.axis, es->time ); } //only refresh if there is something to display diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index e6b2d7d4..92d94321 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1126,6 +1126,7 @@ typedef struct sfxHandle_t gibBounce1Sound; sfxHandle_t gibBounce2Sound; sfxHandle_t gibBounce3Sound; + sfxHandle_t metalGibBounceSound; sfxHandle_t teleInSound; sfxHandle_t teleOutSound; sfxHandle_t noAmmoSound; @@ -1162,8 +1163,9 @@ typedef struct sfxHandle_t alienOvermindDying; sfxHandle_t alienOvermindSpawns; - sfxHandle_t humanBuildableExpl; - + sfxHandle_t alienBuildableExplosion; + sfxHandle_t humanBuildableExplosion; + qhandle_t cursor; qhandle_t selectCursor; qhandle_t sizeCursor; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index e3f34df4..8dffa7dd 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -563,8 +563,6 @@ static void CG_RegisterSounds( void ) char name[ MAX_QPATH ]; const char *soundName; - // voice commands - cgs.media.alienStageTransition = trap_S_RegisterSound( "sound/announcements/overmindevolved.wav", qtrue ); cgs.media.humanStageTransition = trap_S_RegisterSound( "sound/announcements/reinforcement.wav", qtrue ); @@ -580,6 +578,7 @@ 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 ); @@ -640,8 +639,9 @@ static void CG_RegisterSounds( void ) cgs.media.alienEvolveSound = trap_S_RegisterSound( "sound/player/alienevolve.wav", qfalse ); - cgs.media.humanBuildableExpl = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.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.hgrenb1aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb1a.wav", qfalse ); cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); @@ -784,6 +784,7 @@ static void CG_RegisterGraphics( void ) cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" ); cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "poisonCloudPS" ); + cgs.media.alienEvolvePS = CG_RegisterParticleSystem( "alienEvolvePS" ); cgs.media.alienAcidTubePS = CG_RegisterParticleSystem( "alienAcidTubePS" ); cgs.media.jetPackDescendPS = CG_RegisterParticleSystem( "jetPackDescendPS" ); diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index 9925afba..40512ecd 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -1299,6 +1299,12 @@ Attach a particle system to a centity_t */ void CG_AttachParticleSystemToCent( particleSystem_t *ps ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachType = PSA_CENT_ORIGIN; ps->attached = qtrue; } @@ -1312,6 +1318,12 @@ Set a particle system attachment means */ void CG_SetParticleSystemCent( particleSystem_t *ps, centity_t *cent ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachment.centValid = qtrue; ps->attachment.centNum = cent->currentState.number; } @@ -1325,6 +1337,12 @@ Attach a particle system to a model tag */ void CG_AttachParticleSystemToTag( particleSystem_t *ps ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachType = PSA_TAG; ps->attached = qtrue; } @@ -1339,6 +1357,12 @@ Set a particle system attachment means void CG_SetParticleSystemTag( particleSystem_t *ps, refEntity_t parent, qhandle_t model, char *tagName ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachment.tagValid = qtrue; ps->attachment.parent = parent; ps->attachment.model = model; @@ -1354,6 +1378,12 @@ Attach a particle system to a point in space */ void CG_AttachParticleSystemToOrigin( particleSystem_t *ps ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachType = PSA_STATIC; ps->attached = qtrue; } @@ -1367,6 +1397,12 @@ Set a particle system attachment means */ void CG_SetParticleSystemOrigin( particleSystem_t *ps, vec3_t origin ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachment.staticValid = qtrue; VectorCopy( origin, ps->attachment.origin ); } @@ -1380,6 +1416,12 @@ Set a particle system attachment means */ void CG_SetParticleSystemNormal( particleSystem_t *ps, vec3_t normal ) { + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to modify a NULL particle system\n" ); + return; + } + ps->attachment.normalValid = qtrue; VectorCopy( normal, ps->attachment.normal ); } @@ -1397,6 +1439,12 @@ void CG_DestroyParticleSystem( particleSystem_t *ps ) int i; particleEjector_t *pe; + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to destroy a NULL particle system\n" ); + return; + } + if( cg_debugParticles.integer >= 1 ) CG_Printf( "PS destroyed\n" ); @@ -1423,6 +1471,12 @@ qboolean CG_IsParticleSystemInfinite( particleSystem_t *ps ) int i; particleEjector_t *pe; + if( ps == NULL ) + { + CG_Printf( S_COLOR_YELLOW "WARNING: tried to test a NULL particle system\n" ); + return qfalse; + } + //don't bother checking already invalid systems if( !ps->valid ) return qfalse; |