summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-11-25 16:21:10 +0000
committerTim Angus <tim@ngus.net>2005-11-25 16:21:10 +0000
commit3460e8bf9381c61e1bef98b78d320a8bd52b7f5f (patch)
tree4e9fd1150b31476e22078364a7782c8327f4efb8 /src
parent63f0272dd145b10c349163ba465fcbcf5ac48e0d (diff)
* Removal of remaining hard coded effects
* Removal of local entities system * Particle system enhancements to replace functionality lost by removing localents
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_buildable.c136
-rw-r--r--src/cgame/cg_event.c9
-rw-r--r--src/cgame/cg_local.h226
-rw-r--r--src/cgame/cg_main.c107
-rw-r--r--src/cgame/cg_marks.c22
-rw-r--r--src/cgame/cg_particles.c270
-rw-r--r--src/cgame/cg_players.c56
-rw-r--r--src/cgame/cg_servercmds.c1
-rw-r--r--src/cgame/cg_trails.c10
-rw-r--r--src/cgame/cg_view.c1
-rw-r--r--src/cgame/cg_weapons.c85
-rw-r--r--src/game/g_client.c8
-rw-r--r--src/game/g_misc.c13
13 files changed, 399 insertions, 545 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index 1daaf464..954b1aa3 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -34,39 +34,6 @@ char *cg_buildableSoundNames[ MAX_BUILDABLE_ANIMATIONS ] =
static sfxHandle_t defaultAlienSounds[ MAX_BUILDABLE_ANIMATIONS ];
static sfxHandle_t defaultHumanSounds[ MAX_BUILDABLE_ANIMATIONS ];
-
-/*
-==================
-CG_AlienBuildableExplosionFragment
-==================
-*/
-void CG_AlienBuildableExplosionFragment( vec3_t origin, vec3_t velocity, qhandle_t hModel )
-{
- localEntity_t *le;
- refEntity_t *re;
-
- le = CG_AllocLocalEntity( );
- re = &le->refEntity;
-
- le->leType = LE_FRAGMENT;
- le->startTime = cg.time;
- le->endTime = le->startTime + 5000 + random( ) * 3000;
-
- VectorCopy( origin, re->origin );
- AxisCopy( axisDefault, re->axis );
- re->hModel = hModel;
-
- le->pos.trType = TR_GRAVITY;
- VectorCopy( origin, le->pos.trBase );
- VectorCopy( velocity, le->pos.trDelta );
- le->pos.trTime = cg.time;
-
- le->bounceFactor = 0.3;
-
- le->leBounceSoundType = LEBS_BLOOD;
- le->leMarkType = LEMT_GREENBLOOD;
-}
-
/*
===================
CG_AlienBuildableExplosion
@@ -74,38 +41,12 @@ CG_AlienBuildableExplosion
Generated a bunch of gibs launching out from a location
===================
*/
-#define GGIB_VELOCITY 250
-#define GGIB_JUMP 250
void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir )
{
- vec3_t velocity;
particleSystem_t *ps;
- qhandle_t gibModel = cgs.media.alienGib1;
- int i;
trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.alienBuildableExplosion );
- // allow gibs to be turned off for speed
- if( cg_gibs.integer )
- {
- for( i = 1; i <= 8; i++ )
- {
- velocity[ 0 ] = crandom( ) * GGIB_VELOCITY;
- velocity[ 1 ] = crandom( ) * GGIB_VELOCITY;
- velocity[ 2 ] = GGIB_JUMP + crandom( ) * GGIB_VELOCITY;
-
- switch( i )
- {
- case 1: case 5: gibModel = cgs.media.alienGib1; break;
- case 2: case 6: gibModel = cgs.media.alienGib2; break;
- case 3: case 7: gibModel = cgs.media.alienGib3; break;
- case 4: case 8: gibModel = cgs.media.alienGib4; break;
- }
-
- CG_AlienBuildableExplosionFragment( origin, velocity, gibModel );
- }
- }
-
//particle system
ps = CG_SpawnNewParticleSystem( cgs.media.alienBuildableDestroyedPS );
@@ -117,41 +58,6 @@ void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir )
}
}
-
-/*
-==================
-CG_HumanBuildableExplosionFragment
-==================
-*/
-static void CG_HumanBuildableExplosionFragment( vec3_t origin, vec3_t velocity, qhandle_t hModel )
-{
- localEntity_t *le;
- refEntity_t *re;
-
- le = CG_AllocLocalEntity( );
- re = &le->refEntity;
-
- le->leType = LE_FRAGMENT;
- le->startTime = cg.time;
- le->endTime = le->startTime + 10000 + ( crandom( ) * 3000 );
-
- VectorCopy( origin, re->origin );
- AxisCopy( axisDefault, re->axis );
- re->hModel = hModel;
- re->shaderTime = cg.time / 1000.0f;
-
- le->pos.trType = TR_GRAVITY;
- VectorCopy( origin, le->pos.trBase );
- VectorCopy( velocity, le->pos.trDelta );
- le->pos.trTime = cg.time;
-
- le->bounceFactor = 0.3;
-
- le->leBounceSoundType = LEBS_BANG;
- le->leMarkType = LEMT_BANG;
-}
-
-
/*
=================
CG_HumanBuildableExplosion
@@ -159,54 +65,12 @@ CG_HumanBuildableExplosion
Called for human buildables as they are destroyed
=================
*/
-#define EXF_VELOCITY 250
-#define EXF_JUMP 250
void CG_HumanBuildableExplosion( vec3_t origin, vec3_t dir )
{
- vec3_t lightColor, fragOrigin, velocity;
- localEntity_t *le;
- int i;
- qhandle_t gibModel = cgs.media.metalGib1;
particleSystem_t *ps;
- lightColor[ 0 ] = 1;
- lightColor[ 1 ] = 0.75;
- lightColor[ 2 ] = 0.0;
-
trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.humanBuildableExplosion );
- //
- // create the explosion -- only the light is important really
- //
- le = CG_MakeExplosion( origin, dir, cgs.media.dishFlashModel,
- cgs.media.explosionShader,
- 1000, qtrue );
- le->light = 300;
- VectorCopy( lightColor, le->lightColor );
-
- //fragments
- for( i = 1; i <= 8; i++ )
- {
- VectorCopy( origin, fragOrigin );
- velocity[ 0 ] = crandom( ) * EXF_VELOCITY;
- velocity[ 1 ] = crandom( ) * EXF_VELOCITY;
- velocity[ 2 ] = EXF_JUMP + crandom( ) * EXF_VELOCITY;
-
- switch( i )
- {
- case 1: gibModel = cgs.media.metalGib1; break;
- case 2: gibModel = cgs.media.metalGib2; break;
- case 3: gibModel = cgs.media.metalGib3; break;
- case 4: gibModel = cgs.media.metalGib4; break;
- case 5: gibModel = cgs.media.metalGib5; break;
- case 6: gibModel = cgs.media.metalGib6; break;
- case 7: gibModel = cgs.media.metalGib7; break;
- case 8: gibModel = cgs.media.metalGib8; break;
- }
-
- CG_HumanBuildableExplosionFragment( fragOrigin, velocity, gibModel );
- }
-
//particle system
ps = CG_SpawnNewParticleSystem( cgs.media.humanBuildableDestroyedPS );
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index dfafc18e..459d45f2 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -671,14 +671,12 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
//
case EV_PLAYER_TELEPORT_IN:
DEBUGNAME( "EV_PLAYER_TELEPORT_IN" );
- trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.teleInSound );
- CG_SpawnEffect( position );
+ //deprecated
break;
case EV_PLAYER_TELEPORT_OUT:
DEBUGNAME( "EV_PLAYER_TELEPORT_OUT" );
- trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.teleOutSound );
- CG_SpawnEffect( position );
+ CG_PlayerDisconnect( position );
break;
case EV_BUILD_CONSTRUCT:
@@ -824,8 +822,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
case EV_GIB_PLAYER:
DEBUGNAME( "EV_GIB_PLAYER" );
- trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.gibSound );
- CG_GibPlayer( cent->lerpOrigin );
+ // no gibbing
break;
case EV_STOPLOOPINGSOUND:
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 8b619648..908cd1b3 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -268,9 +268,30 @@ typedef struct baseParticle_s
float bounceFracRandFrac;
qboolean bounceCull;
+ char bounceMarkName[ MAX_QPATH ];
+ qhandle_t bounceMark;
+ float bounceMarkRadius;
+ float bounceMarkRadiusRandFrac;
+ float bounceMarkCount;
+ float bounceMarkCountRandFrac;
+
+ char bounceSoundName[ MAX_QPATH ];
+ qhandle_t bounceSound;
+ float bounceSoundCount;
+ float bounceSoundCountRandFrac;
+
pLerpValues_t radius;
pLerpValues_t alpha;
pLerpValues_t rotation;
+
+ qboolean dynamicLight;
+ pLerpValues_t dLightRadius;
+ byte dLightColor[ 3 ];
+
+ int colorDelay;
+ float colorDelayRandFrac;
+ byte initialColor[ 3 ];
+ byte finalColor[ 3 ];
char childSystemName[ MAX_QPATH ];
qhandle_t childSystemHandle;
@@ -364,6 +385,9 @@ typedef struct particle_s
int birthTime;
int lifeTime;
+ float bounceMarkRadius;
+ int bounceMarkCount;
+ int bounceSoundCount;
qboolean atRest;
vec3_t origin;
@@ -380,6 +404,10 @@ typedef struct particle_s
pLerpValues_t alpha;
pLerpValues_t rotation;
+ pLerpValues_t dLightRadius;
+
+ int colorDelay;
+
qhandle_t model;
lerpFrame_t lf;
vec3_t lastAxis[ 3 ];
@@ -630,9 +658,6 @@ typedef struct centity_s
//======================================================================
-// local entities are created as a result of events or predicted actions,
-// and live independantly from all server transmitted entities
-
typedef struct markPoly_s
{
struct markPoly_s *prevMark, *nextMark;
@@ -644,79 +669,6 @@ typedef struct markPoly_s
polyVert_t verts[ MAX_VERTS_ON_POLY ];
} markPoly_t;
-
-typedef enum
-{
- LE_MARK,
- LE_EXPLOSION,
- LE_SPRITE_EXPLOSION,
- LE_FRAGMENT,
- LE_MOVE_SCALE_FADE,
- LE_FALL_SCALE_FADE,
- LE_FADE_RGB,
- LE_SCALE_FADE
-} leType_t;
-
-typedef enum
-{
- LEF_PUFF_DONT_SCALE = 0x0001, // do not scale size over time
- LEF_TUMBLE = 0x0002 // tumble over time, used for ejecting shells
-} leFlag_t;
-
-typedef enum
-{
- LEMT_NONE,
- LEMT_BURN,
- LEMT_BLOOD,
- LEMT_GREENBLOOD, //TA: when aliens are injured
- LEMT_BANG //TA: human item explosions
-} leMarkType_t; // fragment local entities can leave marks on walls
-
-typedef enum
-{
- LEBS_NONE,
- LEBS_BLOOD,
- LEBS_BANG, //TA: human item explosions
- LEBS_BRASS
-} leBounceSoundType_t; // fragment local entities can make sounds on impacts
-
-typedef struct localEntity_s
-{
- struct localEntity_s *prev, *next;
- leType_t leType;
- int leFlags;
-
- int startTime;
- int endTime;
- int fadeInTime;
-
- float lifeRate; // 1.0 / (endTime - startTime)
-
- trajectory_t pos;
- trajectory_t angles;
-
- float bounceFactor; // 0.0 = no bounce, 1.0 = perfect
-
- float color[4];
-
- float radius;
-
- float light;
- vec3_t lightColor;
-
- leMarkType_t leMarkType; // mark to leave on fragment impact
- leBounceSoundType_t leBounceSoundType;
-
- refEntity_t refEntity;
-
- unsigned int sortKey;
-
- //TA: lightning bolt endpoint entities
- int srcENum, destENum;
- int vOffset;
- int maxRange;
-} localEntity_t;
-
//======================================================================
@@ -841,15 +793,11 @@ typedef struct weaponInfoMode_s
qhandle_t muzzleParticleSystem;
qboolean alwaysImpact;
- qhandle_t impactModel;
- qhandle_t impactModelShader;
qhandle_t impactParticleSystem;
qhandle_t impactMark;
qhandle_t impactMarkSize;
sfxHandle_t impactSound[ 4 ]; //random impact sound
sfxHandle_t impactFleshSound[ 4 ]; //random impact sound
- float impactDlight;
- vec3_t impactDlightColor;
} weaponInfoMode_t;
// each WP_* weapon enum has an associated weaponInfo_t
@@ -1181,41 +1129,8 @@ typedef struct
qhandle_t whiteShader;
qhandle_t outlineShader;
- qhandle_t deferShader;
-
- // gib explosions
- qhandle_t gibAbdomen;
- qhandle_t gibArm;
- qhandle_t gibChest;
- qhandle_t gibFist;
- qhandle_t gibFoot;
- qhandle_t gibForearm;
- qhandle_t gibIntestine;
- qhandle_t gibLeg;
- qhandle_t gibSkull;
- qhandle_t gibBrain;
-
- qhandle_t metalGib1;
- qhandle_t metalGib2;
- qhandle_t metalGib3;
- qhandle_t metalGib4;
- qhandle_t metalGib5;
- qhandle_t metalGib6;
- qhandle_t metalGib7;
- qhandle_t metalGib8;
-
- qhandle_t alienGib1;
- qhandle_t alienGib2;
- qhandle_t alienGib3;
- qhandle_t alienGib4;
-
- qhandle_t gibSpark1;
- qhandle_t gibSpark2;
-
qhandle_t level2ZapTS;
- qhandle_t friendShader;
-
qhandle_t balloonShader;
qhandle_t connectionShader;
@@ -1224,22 +1139,7 @@ typedef struct
qhandle_t tracerShader;
qhandle_t crosshairShader[ WP_NUM_WEAPONS ];
qhandle_t backTileShader;
- qhandle_t noammoShader;
-
- qhandle_t smokePuffShader;
- qhandle_t smokePuffRageProShader;
- qhandle_t shotgunSmokePuffShader;
- qhandle_t waterBubbleShader;
- qhandle_t bloodTrailShader;
-
- //TA: extra stuff
- qhandle_t explosionShader;
- qhandle_t greenBloodTrailShader;
- qhandle_t greenBloodMarkShader;
- qhandle_t greenBloodExplosionShader;
- qhandle_t explosionTrailShader;
-
- qhandle_t flameExplShader;
+
qhandle_t creepShader;
qhandle_t scannerShader;
@@ -1250,45 +1150,22 @@ typedef struct
qhandle_t numberShaders[ 11 ];
qhandle_t shadowMarkShader;
-
- // wall mark shaders
qhandle_t wakeMarkShader;
- qhandle_t bloodMarkShader;
- qhandle_t bulletMarkShader;
- qhandle_t burnMarkShader;
- qhandle_t holeMarkShader;
- qhandle_t energyMarkShader;
- //TA: buildable shaders
+ // buildable shaders
qhandle_t greenBuildShader;
qhandle_t redBuildShader;
qhandle_t noPowerShader;
qhandle_t humanSpawningShader;
- // weapon effect models
- qhandle_t bulletFlashModel;
- qhandle_t ringFlashModel;
- qhandle_t dishFlashModel;
-
- // weapon effect shaders
- qhandle_t bloodExplosionShader;
-
- // special effects models
- qhandle_t teleportEffectModel;
- qhandle_t teleportEffectShader;
+ // disconnect
+ qhandle_t disconnectPS;
+ qhandle_t disconnectSound;
// sounds
sfxHandle_t tracerSound;
sfxHandle_t selectSound;
sfxHandle_t footsteps[ FOOTSTEP_TOTAL ][ 4 ];
- sfxHandle_t gibSound;
- sfxHandle_t gibBounce1Sound;
- sfxHandle_t gibBounce2Sound;
- sfxHandle_t gibBounce3Sound;
- sfxHandle_t metalGibBounceSound;
- sfxHandle_t teleInSound;
- sfxHandle_t teleOutSound;
- sfxHandle_t respawnSound;
sfxHandle_t talkSound;
sfxHandle_t landSound;
sfxHandle_t fallSound;
@@ -1360,6 +1237,10 @@ typedef struct
qhandle_t humanBuildableDestroyedPS;
qhandle_t alienBuildableDamagedPS;
qhandle_t alienBuildableDestroyedPS;
+
+ qhandle_t alienBleedPS;
+ qhandle_t humanBleedPS;
+
qhandle_t teslaZapTS;
sfxHandle_t lCannonWarningSound;
@@ -1694,7 +1575,7 @@ void CG_DrawLoadingScreen( void );
void CG_UpdateMediaFraction( float newFract );
//
-// cg_player.c
+// cg_players.c
//
void CG_Player( centity_t *cent );
void CG_Corpse( centity_t *cent );
@@ -1703,6 +1584,8 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, int tea
void CG_NewClientInfo( int clientNum );
void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin );
sfxHandle_t CG_CustomSound( int clientNum, const char *soundName );
+void CG_PlayerDisconnect( vec3_t org );
+void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum );
//
// cg_buildable.c
@@ -1809,35 +1692,6 @@ void CG_ImpactMark( qhandle_t markShader,
float radius, qboolean temporary );
//
-// cg_localents.c
-//
-void CG_InitLocalEntities( void );
-localEntity_t *CG_AllocLocalEntity( void );
-void CG_AddLocalEntities( void );
-
-//
-// cg_effects.c
-//
-localEntity_t *CG_SmokePuff( const vec3_t p,
- const vec3_t vel,
- float radius,
- float r, float g, float b, float a,
- float duration,
- int startTime,
- int fadeInTime,
- int leFlags,
- qhandle_t hShader );
-void CG_BubbleTrail( vec3_t start, vec3_t end, float spacing );
-void CG_SpawnEffect( vec3_t org );
-void CG_GibPlayer( vec3_t playerOrigin );
-
-void CG_Bleed( vec3_t origin, int entityNum );
-
-localEntity_t *CG_MakeExplosion( vec3_t origin, vec3_t dir,
- qhandle_t hModel, qhandle_t shader, int msec,
- qboolean isSprite );
-
-//
// cg_snapshot.c
//
void CG_ProcessSnapshots( void );
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index dbb2b1ea..98d2788d 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -617,24 +617,19 @@ static void CG_RegisterSounds( void )
cgs.media.alienL4ChargePrepare = trap_S_RegisterSound( "sound/player/level4/charge_prepare.wav", qtrue );
cgs.media.alienL4ChargeStart = trap_S_RegisterSound( "sound/player/level4/charge_start.wav", qtrue );
- cgs.media.tracerSound = trap_S_RegisterSound( "sound/weapons/machinegun/buletby1.wav", qfalse );
+ cgs.media.tracerSound = trap_S_RegisterSound( "sound/weapons/machinegun/buletby1.wav", qfalse ); //FIXME
cgs.media.selectSound = trap_S_RegisterSound( "sound/weapons/change.wav", qfalse );
- cgs.media.gibSound = trap_S_RegisterSound( "sound/player/gibsplt1.wav", qfalse );
- 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.teleInSound = trap_S_RegisterSound( "sound/world/telein.wav", qfalse );
- cgs.media.teleOutSound = trap_S_RegisterSound( "sound/world/teleout.wav", qfalse );
- cgs.media.respawnSound = trap_S_RegisterSound( "sound/items/respawn1.wav", qfalse );
+ cgs.media.talkSound = trap_S_RegisterSound( "sound/player/talk.wav", qfalse ); //FIXME
+ cgs.media.landSound = trap_S_RegisterSound( "sound/player/land1.wav", qfalse ); //FIXME
- cgs.media.talkSound = trap_S_RegisterSound( "sound/player/talk.wav", qfalse );
- cgs.media.landSound = trap_S_RegisterSound( "sound/player/land1.wav", qfalse );
+ cgs.media.watrInSound = trap_S_RegisterSound( "sound/player/watr_in.wav", qfalse ); //FIXME
+ cgs.media.watrOutSound = trap_S_RegisterSound( "sound/player/watr_out.wav", qfalse ); //FIXME
+ cgs.media.watrUnSound = trap_S_RegisterSound( "sound/player/watr_un.wav", qfalse ); //FIXME
- cgs.media.watrInSound = trap_S_RegisterSound( "sound/player/watr_in.wav", qfalse );
- cgs.media.watrOutSound = trap_S_RegisterSound( "sound/player/watr_out.wav", qfalse );
- cgs.media.watrUnSound = trap_S_RegisterSound( "sound/player/watr_un.wav", qfalse );
+ cgs.media.disconnectSound = trap_S_RegisterSound( "sound/world/telein.wav", qfalse ); //FIXME
+ //FIXME
for( i = 0; i < 4; i++ )
{
Com_sprintf( name, sizeof( name ), "sound/player/footsteps/step%i.wav", i + 1 );
@@ -672,7 +667,6 @@ static void CG_RegisterSounds( void )
cgs.gameSounds[ i ] = trap_S_RegisterSound( soundName, qfalse );
}
- //TA:
cgs.media.jetpackDescendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/low.wav", qfalse );
cgs.media.jetpackIdleSound = trap_S_RegisterSound( "sound/upgrades/jetpack/idle.wav", qfalse );
cgs.media.jetpackAscendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/hi.wav", qfalse );
@@ -687,14 +681,13 @@ static void CG_RegisterSounds( void )
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 );
+ cgs.media.hgrenb1aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb1a.wav", qfalse ); //FIXME
+ cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); //FIXME
cgs.media.repeaterUseSound = trap_S_RegisterSound( "sound/buildables/repeater/use.wav", qfalse );
@@ -754,35 +747,19 @@ static void CG_RegisterGraphics( void )
for( i = 0; i < 11; i++ )
cgs.media.numberShaders[ i ] = trap_R_RegisterShader( sb_nums[ i ] );
- cgs.media.viewBloodShader = trap_R_RegisterShader( "viewBloodBlend" );
-
- cgs.media.deferShader = trap_R_RegisterShaderNoMip( "gfx/2d/defer.tga" );
+ cgs.media.viewBloodShader = trap_R_RegisterShader( "viewBloodBlend" ); //FIXME
- cgs.media.smokePuffShader = trap_R_RegisterShader( "smokePuff" );
- cgs.media.smokePuffRageProShader = trap_R_RegisterShader( "smokePuffRagePro" );
- cgs.media.shotgunSmokePuffShader = trap_R_RegisterShader( "shotgunSmokePuff" );
- cgs.media.bloodTrailShader = trap_R_RegisterShader( "bloodTrail" );
- cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" );
-
- //TA: extra stuff
- cgs.media.explosionShader = trap_R_RegisterShader( "grenadeExplosion" );
- cgs.media.greenBloodTrailShader = trap_R_RegisterShader( "greenBloodTrail" );
- cgs.media.greenBloodMarkShader = trap_R_RegisterShader( "greenBloodMark" );
- cgs.media.explosionTrailShader = trap_R_RegisterShader( "explosionTrail" );
+ cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" ); //FIXME?
cgs.media.creepShader = trap_R_RegisterShader( "creep" );
cgs.media.scannerBlipShader = trap_R_RegisterShader( "gfx/2d/blip" );
cgs.media.scannerLineShader = trap_R_RegisterShader( "gfx/2d/stalk" );
- cgs.media.waterBubbleShader = trap_R_RegisterShader( "waterBubble" );
-
- cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" );
+ cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" ); //FIXME
cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" );
- cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" );
- cgs.media.noammoShader = trap_R_RegisterShader( "icons/noammo" );
- cgs.media.friendShader = trap_R_RegisterShader( "sprites/foe" );
+ cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" ); //FIXME
//TA: building shaders
@@ -796,58 +773,17 @@ static void CG_RegisterGraphics( void )
cgs.media.upgradeClassIconShader = trap_R_RegisterShader( "icons/icona_upgrade.tga" );
- cgs.media.gibAbdomen = trap_R_RegisterModel( "models/gibs/abdomen.md3" );
- cgs.media.gibArm = trap_R_RegisterModel( "models/gibs/arm.md3" );
- cgs.media.gibChest = trap_R_RegisterModel( "models/gibs/chest.md3" );
- cgs.media.gibFist = trap_R_RegisterModel( "models/gibs/fist.md3" );
- cgs.media.gibFoot = trap_R_RegisterModel( "models/gibs/foot.md3" );
- cgs.media.gibForearm = trap_R_RegisterModel( "models/gibs/forearm.md3" );
- cgs.media.gibIntestine = trap_R_RegisterModel( "models/gibs/intestine.md3" );
- cgs.media.gibLeg = trap_R_RegisterModel( "models/gibs/leg.md3" );
- cgs.media.gibSkull = trap_R_RegisterModel( "models/gibs/skull.md3" );
- cgs.media.gibBrain = trap_R_RegisterModel( "models/gibs/brain.md3" );
-
- cgs.media.metalGib1 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib1.md3" );
- cgs.media.metalGib2 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib2.md3" );
- cgs.media.metalGib3 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib3.md3" );
- cgs.media.metalGib4 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib4.md3" );
- cgs.media.metalGib5 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib5.md3" );
- cgs.media.metalGib6 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib6.md3" );
- cgs.media.metalGib7 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib7.md3" );
- cgs.media.metalGib8 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib8.md3" );
-
- cgs.media.gibSpark1 = trap_R_RegisterShader( "models/fx/metal_gibs/spark.jpg" );
- cgs.media.gibSpark2 = trap_R_RegisterShader( "models/fx/metal_gibs/spark2.jpg" );
-
- cgs.media.alienGib1 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib1.md3" );
- cgs.media.alienGib2 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib2.md3" );
- cgs.media.alienGib3 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib3.md3" );
- cgs.media.alienGib4 = trap_R_RegisterModel( "models/fx/alien_gibs/a_gib4.md3" );
-
- cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" );
-
- cgs.media.bloodExplosionShader = trap_R_RegisterShader( "bloodExplosion" );
- cgs.media.greenBloodExplosionShader = trap_R_RegisterShader( "greenBloodExplosion" );
-
- cgs.media.bulletFlashModel = trap_R_RegisterModel( "models/weaphits/bullet.md3" );
- cgs.media.ringFlashModel = trap_R_RegisterModel( "models/weaphits/ring02.md3" );
- cgs.media.dishFlashModel = trap_R_RegisterModel( "models/weaphits/boom01.md3" );
- cgs.media.teleportEffectModel = trap_R_RegisterModel( "models/misc/telep.md3" );
- cgs.media.teleportEffectShader = trap_R_RegisterShader( "teleportEffect" );
+ cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" ); //FIXME?
+
+ cgs.media.disconnectPS = CG_RegisterParticleSystem( "disconnectPS" );
CG_UpdateMediaFraction( 0.7f );
memset( cg_weapons, 0, sizeof( cg_weapons ) );
memset( cg_upgrades, 0, sizeof( cg_upgrades ) );
- // wall marks
- cgs.media.bulletMarkShader = trap_R_RegisterShader( "gfx/damage/bullet_mrk" );
- cgs.media.burnMarkShader = trap_R_RegisterShader( "gfx/damage/burn_med_mrk" );
- cgs.media.holeMarkShader = trap_R_RegisterShader( "gfx/damage/hole_lg_mrk" );
- cgs.media.energyMarkShader = trap_R_RegisterShader( "gfx/damage/plasma_mrk" );
- cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" );
- cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" );
- cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" );
+ cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" ); //FIXME
+ cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" ); //FIXME
cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "poisonCloudPS" );
cgs.media.alienEvolvePS = CG_RegisterParticleSystem( "alienEvolvePS" );
@@ -862,6 +798,9 @@ static void CG_RegisterGraphics( void )
cgs.media.humanBuildableDestroyedPS = CG_RegisterParticleSystem( "humanBuildableDestroyedPS" );
cgs.media.alienBuildableDestroyedPS = CG_RegisterParticleSystem( "alienBuildableDestroyedPS" );
+ cgs.media.alienBleedPS = CG_RegisterParticleSystem( "alienBleedPS" );
+ cgs.media.humanBleedPS = CG_RegisterParticleSystem( "humanBleedPS" );
+
// register the inline models
cgs.numInlineModels = trap_CM_NumInlineModels( );
@@ -1822,8 +1761,6 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum )
cg.loading = qfalse; // future players will be deferred
- CG_InitLocalEntities( );
-
CG_InitMarkPolys( );
// remove the last loading update
diff --git a/src/cgame/cg_marks.c b/src/cgame/cg_marks.c
index b9c09009..cc8979de 100644
--- a/src/cgame/cg_marks.c
+++ b/src/cgame/cg_marks.c
@@ -253,28 +253,6 @@ void CG_AddMarks( void )
continue;
}
- // fade out the energy bursts
- if( mp->markShader == cgs.media.energyMarkShader )
- {
-
- fade = 450 - 450 * ( (cg.time - mp->time ) / 3000.0 );
- if( fade < 255 )
- {
- if( fade < 0 )
- fade = 0;
-
- if( mp->verts[ 0 ].modulate[ 0 ] != 0 )
- {
- for( j = 0; j < mp->poly.numVerts; j++ )
- {
- mp->verts[ j ].modulate[ 0 ] = mp->color[ 0 ] * fade;
- mp->verts[ j ].modulate[ 1 ] = mp->color[ 1 ] * fade;
- mp->verts[ j ].modulate[ 2 ] = mp->color[ 2 ] * fade;
- }
- }
- }
- }
-
// fade all marks out with time
t = mp->time + MARK_TOTAL_TIME - cg.time;
if( t < MARK_FADE_TIME )
diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c
index 02d4b5f8..8e77f075 100644
--- a/src/cgame/cg_particles.c
+++ b/src/cgame/cg_particles.c
@@ -156,6 +156,21 @@ static particle_t *CG_SpawnNewParticle( baseParticle_t *bp, particleEjector_t *p
p->rotation.initial = CG_RandomiseValue( bp->rotation.initial, bp->rotation.initialRandFrac );
p->rotation.final = CG_RandomiseValue( bp->rotation.final, bp->rotation.finalRandFrac );
+ p->dLightRadius.delay =
+ (int)CG_RandomiseValue( (float)bp->dLightRadius.delay, bp->dLightRadius.delayRandFrac );
+ p->dLightRadius.initial =
+ CG_RandomiseValue( bp->dLightRadius.initial, bp->dLightRadius.initialRandFrac );
+ p->dLightRadius.final =
+ CG_RandomiseValue( bp->dLightRadius.final, bp->dLightRadius.finalRandFrac );
+
+ p->colorDelay = CG_RandomiseValue( bp->colorDelay, bp->colorDelayRandFrac );
+
+ p->bounceMarkRadius = CG_RandomiseValue( bp->bounceMarkRadius, bp->bounceMarkRadiusRandFrac );
+ p->bounceMarkCount =
+ round( CG_RandomiseValue( (float)bp->bounceMarkCount, bp->bounceMarkCountRandFrac ) );
+ p->bounceSoundCount =
+ round( CG_RandomiseValue( (float)bp->bounceSoundCount, bp->bounceSoundCountRandFrac ) );
+
if( bp->numModels )
{
p->model = bp->models[ rand( ) % bp->numModels ];
@@ -496,6 +511,12 @@ qhandle_t CG_RegisterParticleSystem( char *name )
for( k = 0; k < bp->numModels; k++ )
bp->models[ k ] = trap_R_RegisterModel( bp->modelNames[ k ] );
+ if( bp->bounceMarkName[ 0 ] != '\0' )
+ bp->bounceMark = trap_R_RegisterShader( bp->bounceMarkName );
+
+ if( bp->bounceSoundName[ 0 ] != '\0' )
+ bp->bounceSound = trap_S_RegisterSound( bp->bounceSoundName, qfalse );
+
//recursively register any children
if( bp->childSystemName[ 0 ] != '\0' )
{
@@ -584,6 +605,28 @@ static void CG_ParseValueAndVariance( char *token, float *value, float *variance
*variance = localVariance;
}
+/*
+===============
+CG_ParseColor
+===============
+*/
+static qboolean CG_ParseColor( byte *c, char **text_p )
+{
+ char *token;
+ int i;
+
+ for( i = 0; i <= 2; i++ )
+ {
+ token = COM_Parse( text_p );
+
+ if( !Q_stricmp( token, "" ) )
+ return qfalse;
+
+ c[ i ] = (int)( (float)0xFF * atof_neg( token, qfalse ) );
+ }
+
+ return qtrue;
+}
/*
===============
@@ -632,6 +675,53 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p )
continue;
}
+ else if( !Q_stricmp( token, "bounceMark" ) )
+ {
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->bounceMarkCount = number;
+ bp->bounceMarkCountRandFrac = randFrac;
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->bounceMarkRadius = number;
+ bp->bounceMarkRadiusRandFrac = randFrac;
+
+ token = COM_ParseExt( text_p, qfalse );
+ if( !*token )
+ break;
+
+ Q_strncpyz( bp->bounceMarkName, token, MAX_QPATH );
+
+ continue;
+ }
+ else if( !Q_stricmp( token, "bounceSound" ) )
+ {
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->bounceSoundCount = number;
+ bp->bounceSoundCountRandFrac = randFrac;
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ Q_strncpyz( bp->bounceSoundName, token, MAX_QPATH );
+
+ continue;
+ }
else if( !Q_stricmp( token, "shader" ) )
{
if( bp->numModels > 0 )
@@ -967,6 +1057,64 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p )
continue;
}
+ else if( !Q_stricmp( token, "dynamicLight" ) )
+ {
+ bp->dynamicLight = qtrue;
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->dLightRadius.delay = (int)number;
+ bp->dLightRadius.delayRandFrac = randFrac;
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->dLightRadius.initial = number;
+ bp->dLightRadius.initialRandFrac = randFrac;
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ if( !Q_stricmp( token, "-" ) )
+ {
+ bp->dLightRadius.final = PARTICLES_SAME_AS_INITIAL;
+ bp->dLightRadius.finalRandFrac = 0.0f;
+ }
+ else
+ {
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->dLightRadius.final = number;
+ bp->dLightRadius.finalRandFrac = randFrac;
+ }
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ if( !Q_stricmp( token, "{" ) )
+ {
+ if( !CG_ParseColor( bp->dLightColor, text_p ) )
+ break;
+
+ token = COM_Parse( text_p );
+ if( Q_stricmp( token, "}" ) )
+ {
+ CG_Printf( S_COLOR_RED "ERROR: missing '}'\n" );
+ break;
+ }
+ }
+
+ continue;
+ }
else if( !Q_stricmp( token, "cullOnStartSolid" ) )
{
bp->cullOnStartSolid = qtrue;
@@ -1051,6 +1199,69 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p )
continue;
}
+ else if( !Q_stricmp( token, "color" ) )
+ {
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ CG_ParseValueAndVariance( token, &number, &randFrac, qfalse );
+
+ bp->colorDelay = (int)number;
+ bp->colorDelayRandFrac = randFrac;
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ if( !Q_stricmp( token, "{" ) )
+ {
+ if( !CG_ParseColor( bp->initialColor, text_p ) )
+ break;
+
+ token = COM_Parse( text_p );
+ if( Q_stricmp( token, "}" ) )
+ {
+ CG_Printf( S_COLOR_RED "ERROR: missing '}'\n" );
+ break;
+ }
+
+ token = COM_Parse( text_p );
+ if( !*token )
+ break;
+
+ if( !Q_stricmp( token, "-" ) )
+ {
+ bp->finalColor[ 0 ] = bp->initialColor[ 0 ];
+ bp->finalColor[ 1 ] = bp->initialColor[ 1 ];
+ bp->finalColor[ 2 ] = bp->initialColor[ 2 ];
+ }
+ else if( !Q_stricmp( token, "{" ) )
+ {
+ if( !CG_ParseColor( bp->finalColor, text_p ) )
+ break;
+
+ token = COM_Parse( text_p );
+ if( Q_stricmp( token, "}" ) )
+ {
+ CG_Printf( S_COLOR_RED "ERROR: missing '}'\n" );
+ break;
+ }
+ }
+ else
+ {
+ CG_Printf( S_COLOR_RED "ERROR: missing '{'\n" );
+ break;
+ }
+ }
+ else
+ {
+ CG_Printf( S_COLOR_RED "ERROR: missing '{'\n" );
+ break;
+ }
+
+ continue;
+ }
else if( !Q_stricmp( token, "rotation" ) )
{
token = COM_Parse( text_p );
@@ -1145,6 +1356,18 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p )
return qfalse;
}
+/*
+===============
+CG_InitialiseBaseParticle
+===============
+*/
+static void CG_InitialiseBaseParticle( baseParticle_t *bp )
+{
+ memset( bp, 0, sizeof( baseParticle_t ) );
+
+ memset( bp->initialColor, 0xFF, sizeof( bp->initialColor ) );
+ memset( bp->finalColor, 0xFF, sizeof( bp->finalColor ) );
+}
/*
===============
@@ -1171,6 +1394,8 @@ static qboolean CG_ParseParticleEjector( baseParticleEjector_t *bpe, char **text
if( !Q_stricmp( token, "{" ) )
{
+ CG_InitialiseBaseParticle( &baseParticles[ numBaseParticles ] );
+
if( !CG_ParseParticle( &baseParticles[ numBaseParticles ], text_p ) )
{
CG_Printf( S_COLOR_RED "ERROR: failed to parse particle\n" );
@@ -1909,6 +2134,19 @@ static void CG_EvaluateParticlePhysics( particle_t *p )
p->velocity[ 2 ] < -cg.frametime * p->velocity[ 2 ] ) )
p->atRest = qtrue;
+ if( bp->bounceMarkName[ 0 ] && p->bounceMarkCount > 0 )
+ {
+ CG_ImpactMark( bp->bounceMark, trace.endpos, trace.plane.normal,
+ random( ) * 360, 1, 1, 1, 1, qtrue, bp->bounceMarkRadius, qfalse );
+ p->bounceMarkCount--;
+ }
+
+ if( bp->bounceSoundName[ 0 ] && p->bounceSoundCount > 0 )
+ {
+ trap_S_StartSound( trace.endpos, ENTITYNUM_WORLD, CHAN_AUTO, bp->bounceSound );
+ p->bounceSoundCount--;
+ }
+
VectorCopy( trace.endpos, p->origin );
}
@@ -2036,21 +2274,32 @@ static void CG_RenderParticle( particle_t *p )
p->lifeTime,
p->radius.delay ) );
+ re.shaderTime = p->birthTime / 1000.0f;
+
if( bp->numFrames ) //shader based
{
re.reType = RT_SPRITE;
- re.shaderTime = p->birthTime / 1000.0f; //FIXME: allow user to change?
-
//apply environmental lighting to the particle
if( bp->realLight )
{
trap_R_LightForPoint( p->origin, alight, dlight, lightdir );
for( i = 0; i <= 2; i++ )
- re.shaderRGBA[ i ] = (int)alight[ i ];
+ re.shaderRGBA[ i ] = (byte)alight[ i ];
}
else
- for( i = 0; i <= 3; re.shaderRGBA[ i++ ] = 0xFF );
+ {
+ vec3_t colorRange;
+
+ VectorSubtract( bp->finalColor,
+ bp->initialColor, colorRange );
+
+ VectorMA( bp->initialColor,
+ CG_CalculateTimeFrac( p->birthTime,
+ p->lifeTime,
+ p->colorDelay ),
+ colorRange, re.shaderRGBA );
+ }
re.shaderRGBA[ 3 ] = (byte)( (float)0xFF *
CG_LerpValues( p->alpha.initial,
@@ -2136,9 +2385,20 @@ static void CG_RenderParticle( particle_t *p )
}
if( bps->thirdPersonOnly &&
- CG_AttachmentCentNum( &ps->attachment ) == cg.snap->ps.clientNum )
+ CG_AttachmentCentNum( &ps->attachment ) == cg.snap->ps.clientNum &&
+ !cg.renderingThirdPerson )
re.renderfx |= RF_THIRD_PERSON;
+ if( bp->dynamicLight && !( re.renderfx & RF_THIRD_PERSON ) )
+ {
+ trap_R_AddLightToScene( p->origin,
+ CG_LerpValues( p->dLightRadius.initial, p->dLightRadius.final,
+ CG_CalculateTimeFrac( p->birthTime, p->lifeTime, p->dLightRadius.delay ) ),
+ (float)bp->dLightColor[ 0 ] / (float)0xFF,
+ (float)bp->dLightColor[ 1 ] / (float)0xFF,
+ (float)bp->dLightColor[ 2 ] / (float)0xFF );
+ }
+
VectorCopy( p->origin, re.origin );
trap_R_AddRefEntityToScene( &re );
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index dce04324..d1a361d8 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -2511,3 +2511,59 @@ void CG_ResetPlayerEntity( centity_t *cent )
CG_Printf( "%i ResetPlayerEntity yaw=%i\n", cent->currentState.number, cent->pe.torso.yawAngle );
}
+/*
+==================
+CG_PlayerDisconnect
+
+Player disconnecting
+==================
+*/
+void CG_PlayerDisconnect( vec3_t org )
+{
+ particleSystem_t *ps;
+
+ trap_S_StartSound( org, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.disconnectSound );
+
+ ps = CG_SpawnNewParticleSystem( cgs.media.disconnectPS );
+
+ if( CG_IsParticleSystemValid( &ps ) )
+ {
+ CG_SetAttachmentPoint( &ps->attachment, org );
+ CG_AttachToPoint( &ps->attachment );
+ }
+}
+
+/*
+=================
+CG_Bleed
+
+This is the spurt of blood when a character gets hit
+=================
+*/
+void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum )
+{
+ pTeam_t team = cgs.clientinfo[ entityNum ].team;
+ qhandle_t bleedPS;
+ particleSystem_t *ps;
+
+ if( !cg_blood.integer )
+ return;
+
+ if( team == PTE_ALIENS )
+ bleedPS = cgs.media.alienBleedPS;
+ else if( team == PTE_HUMANS )
+ bleedPS = cgs.media.humanBleedPS;
+ else
+ return;
+
+ ps = CG_SpawnNewParticleSystem( bleedPS );
+
+ if( CG_IsParticleSystemValid( &ps ) )
+ {
+ CG_SetAttachmentPoint( &ps->attachment, origin );
+ CG_SetAttachmentCent( &ps->attachment, &cg_entities[ entityNum ] );
+ CG_AttachToPoint( &ps->attachment );
+
+ CG_SetParticleSystemNormal( ps, normal );
+ }
+}
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index a92fa37e..24a869a0 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -481,7 +481,6 @@ static void CG_MapRestart( void )
if( cg_showmiss.integer )
CG_Printf( "CG_MapRestart\n" );
- CG_InitLocalEntities( );
CG_InitMarkPolys( );
// make sure the "3 frags left" warnings play again
diff --git a/src/cgame/cg_trails.c b/src/cgame/cg_trails.c
index 6f9aefcf..c745b2bb 100644
--- a/src/cgame/cg_trails.c
+++ b/src/cgame/cg_trails.c
@@ -925,20 +925,20 @@ static qboolean CG_ParseTrailBeam( baseTrailBeam_t *btb, char **text_p )
/*
===============
-CG_InitialiseTrailBeam
+CG_InitialiseBaseTrailBeam
===============
*/
-static void CG_InitialiseTrailBeam( baseTrailBeam_t *btb )
+static void CG_InitialiseBaseTrailBeam( baseTrailBeam_t *btb )
{
memset( btb, 0, sizeof( baseTrailBeam_t ) );
btb->numSegments = 1;
- btb->frontWidth = btb->backWidth = 8.0f;
+ btb->frontWidth = btb->backWidth = 1.0f;
btb->frontAlpha = btb->backAlpha = 1.0f;
memset( btb->frontColor, 0xFF, sizeof( btb->frontColor ) );
memset( btb->backColor, 0xFF, sizeof( btb->backColor ) );
- btb->segmentTime = 250;
+ btb->segmentTime = 100;
btb->textureType = TBTT_STRETCH;
btb->frontTextureCoord = 0.0f;
@@ -966,7 +966,7 @@ static qboolean CG_ParseTrailSystem( baseTrailSystem_t *bts, char **text_p, cons
if( !Q_stricmp( token, "{" ) )
{
- CG_InitialiseTrailBeam( &baseTrailBeams[ numBaseTrailBeams ] );
+ CG_InitialiseBaseTrailBeam( &baseTrailBeams[ numBaseTrailBeams ] );
if( !CG_ParseTrailBeam( &baseTrailBeams[ numBaseTrailBeams ], text_p ) )
{
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 59016dc4..89a072ab 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -1313,7 +1313,6 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demo
{
CG_AddPacketEntities( ); // after calcViewValues, so predicted player state is correct
CG_AddMarks( );
- CG_AddLocalEntities( );
}
CG_AddViewWeapon( &cg.predictedPlayerState );
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 7df8b0fa..f47f75ab 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -220,28 +220,6 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p
continue;
}
- else if( !Q_stricmp( token, "impactModel" ) )
- {
- token = COM_Parse( text_p );
- if( !token )
- break;
-
- wim->impactModel = trap_R_RegisterModel( token );
-
- if( !wim->impactModel )
- CG_Printf( S_COLOR_RED "ERROR: impact model not found %s\n", token );
-
- token = COM_Parse( text_p );
- if( !token )
- break;
-
- wim->impactModelShader = trap_R_RegisterShader( token );
-
- if( !wim->impactModelShader )
- CG_Printf( S_COLOR_RED "ERROR: impact model shader not found %s\n", token );
-
- continue;
- }
else if( !Q_stricmp( token, "impactMark" ) )
{
int size = 0;
@@ -313,36 +291,6 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p
continue;
}
- else if( !Q_stricmp( token, "impactDlightColor" ) )
- {
- for( i = 0 ; i < 3 ; i++ )
- {
- token = COM_Parse( text_p );
- if( !token )
- break;
-
- wim->impactDlightColor[ i ] = atof( token );
- }
-
- continue;
- }
- else if( !Q_stricmp( token, "impactDlight" ) )
- {
- int size = 0;
-
- token = COM_Parse( text_p );
- if( !token )
- break;
-
- size = atoi( token );
-
- if( size < 0 )
- size = 0;
-
- wim->impactDlight = size;
-
- continue;
- }
else if( !Q_stricmp( token, "alwaysImpact" ) )
{
wim->alwaysImpact = qtrue;
@@ -1529,23 +1477,14 @@ Caused by an EV_MISSILE_MISS event, or directly by local bullet tracing
void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientNum,
vec3_t origin, vec3_t dir, impactSound_t soundType )
{
- qhandle_t mod = 0;
qhandle_t mark = 0;
- qhandle_t shader = 0;
qhandle_t ps = 0;
int c;
float radius = 1.0f;
- float light = 0.0f;
- vec3_t lightColor = { 0.0f, 0.0f, 0.0f };
- localEntity_t *le;
weaponInfo_t *weapon = &cg_weapons[ weaponNum ];
mark = weapon->wim[ weaponMode ].impactMark;
radius = weapon->wim[ weaponMode ].impactMarkSize;
- mod = weapon->wim[ weaponMode ].impactModel;
- shader = weapon->wim[ weaponMode ].impactModelShader;
- light = weapon->wim[ weaponMode ].impactDlight;
- VectorCopy( weapon->wim[ weaponMode ].impactDlightColor, lightColor );
ps = weapon->wim[ weaponMode ].impactParticleSystem;
if( soundType == IMPACTSOUND_FLESH )
@@ -1595,16 +1534,6 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN
}
//
- // create the explosion
- //
- if( mod )
- {
- le = CG_MakeExplosion( origin, dir, mod, shader, 600, qfalse );
- le->light = light;
- VectorCopy( lightColor, le->lightColor );
- }
-
- //
// impact mark
//
if( radius > 0.0f )
@@ -1617,11 +1546,16 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN
CG_MissileHitPlayer
=================
*/
-void CG_MissileHitPlayer( weapon_t weaponNum, weaponMode_t weaponMode, vec3_t origin, vec3_t dir, int entityNum )
+void CG_MissileHitPlayer( weapon_t weaponNum, weaponMode_t weaponMode,
+ vec3_t origin, vec3_t dir, int entityNum )
{
+ vec3_t normal;
weaponInfo_t *weapon = &cg_weapons[ weaponNum ];
- CG_Bleed( origin, entityNum );
+ VectorCopy( dir, normal );
+ VectorInverse( normal );
+
+ CG_Bleed( origin, normal, entityNum );
if( weapon->wim[ weaponMode ].alwaysImpact )
CG_MissileHitWall( weaponNum, weaponMode, 0, origin, dir, IMPACTSOUND_FLESH );
@@ -1776,8 +1710,6 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal, qboolean flesh,
{
if( CG_CalcMuzzlePoint( sourceEntityNum, start ) )
{
- CG_BubbleTrail( start, end, 32 );
-
// draw a tracer
if( random( ) < cg_tracerChance.value )
CG_Tracer( start, end );
@@ -1786,7 +1718,7 @@ void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal, qboolean flesh,
// impact splash and mark
if( flesh )
- CG_Bleed( end, fleshEntityNum );
+ CG_Bleed( end, normal, fleshEntityNum );
else
CG_MissileHitWall( WP_MACHINEGUN, WPM_PRIMARY, 0, end, normal, IMPACTSOUND_DEFAULT );
}
@@ -1831,7 +1763,6 @@ static void CG_ShotgunPattern( vec3_t origin, vec3_t origin2, int seed, int othe
VectorMA( end, u, up, end );
CG_Trace( &tr, origin, NULL, NULL, end, otherEntNum, MASK_SHOT );
- CG_BubbleTrail( origin, end, 32 );
if( !( tr.surfaceFlags & SURF_NOIMPACT ) )
{
diff --git a/src/game/g_client.c b/src/game/g_client.c
index d8fb60a9..e86439c4 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1178,7 +1178,6 @@ void ClientBegin( int clientNum )
{
gentity_t *ent;
gclient_t *client;
- gentity_t *tent;
int flags;
ent = g_entities + clientNum;
@@ -1210,13 +1209,6 @@ void ClientBegin( int clientNum )
ClientSpawn( ent, NULL, NULL, NULL );
- if( client->sess.sessionTeam != TEAM_SPECTATOR )
- {
- // send event
- tent = G_TempEntity( ent->client->ps.origin, EV_PLAYER_TELEPORT_IN );
- tent->s.clientNum = ent->s.clientNum;
- }
-
G_InitCommandQueue( clientNum );
G_SendCommandFromServer( -1, va( "print \"%s" S_COLOR_WHITE " entered the game\n\"", client->pers.netname ) );
diff --git a/src/game/g_misc.c b/src/game/g_misc.c
index b7172ea3..4bcb387f 100644
--- a/src/game/g_misc.c
+++ b/src/game/g_misc.c
@@ -66,19 +66,6 @@ TELEPORTERS
void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles )
{
- gentity_t *tent;
-
- // use temp events at source and destination to prevent the effect
- // from getting dropped by a second player event
- if( player->client->sess.sessionTeam != TEAM_SPECTATOR )
- {
- tent = G_TempEntity( player->client->ps.origin, EV_PLAYER_TELEPORT_OUT );
- tent->s.clientNum = player->s.clientNum;
-
- tent = G_TempEntity( origin, EV_PLAYER_TELEPORT_IN );
- tent->s.clientNum = player->s.clientNum;
- }
-
// unlink to make sure it can't possibly interfere with G_KillBox
trap_UnlinkEntity( player );