diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 7 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 4 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 12 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 53 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 68 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 8 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 3 |
7 files changed, 54 insertions, 101 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 88d54293..071f10ad 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -1305,7 +1305,7 @@ static void CG_DrawLevelShot( rectDef_t *rect ) CG_DrawPic( rect->x, rect->y, rect->w, rect->h, levelshot ); // blend a detail texture over it - detail = trap_R_RegisterShader( "levelShotDetail" ); + detail = trap_R_RegisterShader( "gfx/misc/detail" ); CG_DrawPic( rect->x, rect->y, rect->w, rect->h, detail ); } @@ -3270,6 +3270,9 @@ static void CG_PainBlend( void ) float x, y, w, h; float s1, t1, s2, t2; + if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) + return; + damage = cg.lastHealth - cg.snap->ps.stats[ STAT_HEALTH ]; if( damage < 0 ) @@ -3362,7 +3365,7 @@ void CG_ResetPainBlend( void ) { cg.painBlendValue = 0.0f; cg.painBlendTarget = 0.0f; - cg.lastHealth = cg.snap->ps.stats[ STAT_MAX_HEALTH ]; + cg.lastHealth = cg.snap->ps.stats[ STAT_HEALTH ]; } /* diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 70fa057d..d1e330b9 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -706,9 +706,9 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_GRENADE_BOUNCE: DEBUGNAME( "EV_GRENADE_BOUNCE" ); if( rand( ) & 1 ) - trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.hgrenb1aSound ); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.hardBounceSound1 ); else - trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.hgrenb2aSound ); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.hardBounceSound2 ); break; // diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index b319e547..f31e2cde 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -92,10 +92,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA typedef enum { FOOTSTEP_NORMAL, - FOOTSTEP_BOOT, FOOTSTEP_FLESH, - FOOTSTEP_MECH, - FOOTSTEP_ENERGY, FOOTSTEP_METAL, FOOTSTEP_SPLASH, FOOTSTEP_CUSTOM, @@ -1125,7 +1122,7 @@ typedef struct consoleLine_t consoleLines[ MAX_CONSOLE_LINES ]; int numConsoleLines; - particleSystem_t *poisonCloudPS; + particleSystem_t *poisonCloudPS; float painBlendValue; float painBlendTarget; @@ -1148,7 +1145,6 @@ typedef struct qhandle_t balloonShader; qhandle_t connectionShader; - qhandle_t selectShader; qhandle_t viewBloodShader; qhandle_t tracerShader; qhandle_t crosshairShader[ WP_NUM_WEAPONS ]; @@ -1181,11 +1177,13 @@ typedef struct sfxHandle_t selectSound; sfxHandle_t footsteps[ FOOTSTEP_TOTAL ][ 4 ]; sfxHandle_t talkSound; + sfxHandle_t alienTalkSound; + sfxHandle_t humanTalkSound; sfxHandle_t landSound; sfxHandle_t fallSound; - sfxHandle_t hgrenb1aSound; - sfxHandle_t hgrenb2aSound; + sfxHandle_t hardBounceSound1; + sfxHandle_t hardBounceSound2; sfxHandle_t voteNow; sfxHandle_t votePassed; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index a64d736a..beda0462 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -639,36 +639,28 @@ 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 ); //FIXME + cgs.media.tracerSound = trap_S_RegisterSound( "sound/weapons/tracer.wav", qfalse ); cgs.media.selectSound = trap_S_RegisterSound( "sound/weapons/change.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/misc/talk.wav", qfalse ); + cgs.media.alienTalkSound = trap_S_RegisterSound( "sound/misc/alien_talk.wav", qfalse ); + cgs.media.humanTalkSound = trap_S_RegisterSound( "sound/misc/human_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 + cgs.media.disconnectSound = trap_S_RegisterSound( "sound/misc/disconnect.wav", qfalse ); - //FIXME for( i = 0; i < 4; i++ ) { Com_sprintf( name, sizeof( name ), "sound/player/footsteps/step%i.wav", i + 1 ); cgs.media.footsteps[ FOOTSTEP_NORMAL ][ i ] = trap_S_RegisterSound( name, qfalse ); - Com_sprintf( name, sizeof( name ), "sound/player/footsteps/boot%i.wav", i + 1 ); - cgs.media.footsteps[ FOOTSTEP_BOOT ][ i ] = trap_S_RegisterSound( name, qfalse ); - Com_sprintf( name, sizeof( name ), "sound/player/footsteps/flesh%i.wav", i + 1 ); cgs.media.footsteps[ FOOTSTEP_FLESH ][ i ] = trap_S_RegisterSound( name, qfalse ); - Com_sprintf( name, sizeof( name ), "sound/player/footsteps/mech%i.wav", i + 1 ); - cgs.media.footsteps[ FOOTSTEP_MECH ][ i ] = trap_S_RegisterSound( name, qfalse ); - - Com_sprintf( name, sizeof( name ), "sound/player/footsteps/energy%i.wav", i + 1 ); - cgs.media.footsteps[ FOOTSTEP_ENERGY ][ i ] = trap_S_RegisterSound( name, qfalse ); - Com_sprintf( name, sizeof( name ), "sound/player/footsteps/splash%i.wav", i + 1 ); cgs.media.footsteps[ FOOTSTEP_SPLASH ][ i ] = trap_S_RegisterSound( name, qfalse ); @@ -708,8 +700,8 @@ static void CG_RegisterSounds( void ) 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 ); //FIXME - cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); //FIXME + cgs.media.hardBounceSound1 = trap_S_RegisterSound( "sound/misc/hard_bounce1.wav", qfalse ); + cgs.media.hardBounceSound2 = trap_S_RegisterSound( "sound/misc/hard_bounce2.wav", qfalse ); cgs.media.repeaterUseSound = trap_S_RegisterSound( "sound/buildables/repeater/use.wav", qfalse ); @@ -769,25 +761,24 @@ 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( "gfx/damage/fullscreen_painblend" ); //FIXME + cgs.media.viewBloodShader = trap_R_RegisterShader( "gfx/damage/fullscreen_painblend" ); - cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" ); //FIXME? + cgs.media.connectionShader = trap_R_RegisterShader( "gfx/2d/net" ); 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.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" ); //FIXME - cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" ); + cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" ); - cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" ); //FIXME + cgs.media.backTileShader = trap_R_RegisterShader( "console" ); //TA: building shaders - cgs.media.greenBuildShader = trap_R_RegisterShader("gfx/2d/greenbuild" ); - cgs.media.redBuildShader = trap_R_RegisterShader("gfx/2d/redbuild" ); - cgs.media.noPowerShader = trap_R_RegisterShader("gfx/2d/nopower" ); + cgs.media.greenBuildShader = trap_R_RegisterShader("gfx/misc/greenbuild" ); + cgs.media.redBuildShader = trap_R_RegisterShader("gfx/misc/redbuild" ); + cgs.media.noPowerShader = trap_R_RegisterShader("gfx/misc/nopower" ); cgs.media.humanSpawningShader = trap_R_RegisterShader("models/buildables/telenode/rep_cyl" ); for( i = 0; i < 8; i++ ) @@ -795,7 +786,7 @@ static void CG_RegisterGraphics( void ) cgs.media.upgradeClassIconShader = trap_R_RegisterShader( "icons/icona_upgrade.tga" ); - cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" ); //FIXME? + cgs.media.balloonShader = trap_R_RegisterShader( "gfx/sprites/chatballoon" ); cgs.media.disconnectPS = CG_RegisterParticleSystem( "disconnectPS" ); @@ -804,10 +795,10 @@ static void CG_RegisterGraphics( void ) memset( cg_weapons, 0, sizeof( cg_weapons ) ); memset( cg_upgrades, 0, sizeof( cg_upgrades ) ); - cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" ); //FIXME - cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" ); //FIXME + cgs.media.shadowMarkShader = trap_R_RegisterShader( "gfx/marks/shadow" ); + cgs.media.wakeMarkShader = trap_R_RegisterShader( "gfx/marks/wake" ); - cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "poisonCloudPS" ); + cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "firstPersonPoisonCloudPS" ); cgs.media.alienEvolvePS = CG_RegisterParticleSystem( "alienEvolvePS" ); cgs.media.alienAcidTubePS = CG_RegisterParticleSystem( "alienAcidTubePS" ); diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index d35c5eca..3eb5e998 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -149,14 +149,8 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci ) if( !Q_stricmp( token, "default" ) || !Q_stricmp( token, "normal" ) ) ci->footsteps = FOOTSTEP_NORMAL; - else if( !Q_stricmp( token, "boot" ) ) - ci->footsteps = FOOTSTEP_BOOT; else if( !Q_stricmp( token, "flesh" ) ) ci->footsteps = FOOTSTEP_FLESH; - else if( !Q_stricmp( token, "mech" ) ) - ci->footsteps = FOOTSTEP_MECH; - else if( !Q_stricmp( token, "energy" ) ) - ci->footsteps = FOOTSTEP_ENERGY; else if( !Q_stricmp( token, "none" ) ) ci->footsteps = FOOTSTEP_NONE; else if( !Q_stricmp( token, "custom" ) ) @@ -1819,7 +1813,7 @@ static qboolean CG_PlayerShadow( centity_t *cent, float *shadowPlane, pClass_t c // add the mark as a temporary, so it goes directly to the renderer // without taking a spot in the cg_marks array CG_ImpactMark( cgs.media.shadowMarkShader, trace.endpos, trace.plane.normal, - cent->pe.legs.yawAngle, alpha, alpha, alpha, 1, qfalse, + cent->pe.legs.yawAngle, 0.0f, 0.0f, 0.0f, alpha, qfalse, 24.0f * BG_FindShadowScaleForClass( class ), qtrue ); return qtrue; @@ -1833,18 +1827,20 @@ CG_PlayerSplash Draw a mark at the water surface =============== */ -static void CG_PlayerSplash( centity_t *cent ) +static void CG_PlayerSplash( centity_t *cent, pClass_t class ) { vec3_t start, end; + vec3_t mins, maxs; trace_t trace; int contents; - polyVert_t verts[ 4 ]; if( !cg_shadows.integer ) return; + BG_FindBBoxForClass( class, mins, maxs, NULL, NULL, NULL ); + VectorCopy( cent->lerpOrigin, end ); - end[ 2 ] -= 24; + end[ 2 ] += mins[ 2 ]; // if the feet aren't in liquid, don't make a mark // this won't handle moving water brushes, but they wouldn't draw right anyway... @@ -1863,53 +1859,15 @@ static void CG_PlayerSplash( centity_t *cent ) return; // trace down to find the surface - trap_CM_BoxTrace( &trace, start, end, NULL, NULL, 0, ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ); + trap_CM_BoxTrace( &trace, start, end, NULL, NULL, 0, + ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ); - if( trace.fraction == 1.0 ) + if( trace.fraction == 1.0f ) return; - // create a mark polygon - VectorCopy( trace.endpos, verts[ 0 ].xyz ); - verts[ 0 ].xyz[ 0 ] -= 32; - verts[ 0 ].xyz[ 1 ] -= 32; - verts[ 0 ].st[ 0 ] = 0; - verts[ 0 ].st[ 1 ] = 0; - verts[ 0 ].modulate[ 0 ] = 255; - verts[ 0 ].modulate[ 1 ] = 255; - verts[ 0 ].modulate[ 2 ] = 255; - verts[ 0 ].modulate[ 3 ] = 255; - - VectorCopy( trace.endpos, verts[ 1 ].xyz ); - verts[ 1 ].xyz[ 0 ] -= 32; - verts[ 1 ].xyz[ 1 ] += 32; - verts[ 1 ].st[ 0 ] = 0; - verts[ 1 ].st[ 1 ] = 1; - verts[ 1 ].modulate[ 0 ] = 255; - verts[ 1 ].modulate[ 1 ] = 255; - verts[ 1 ].modulate[ 2 ] = 255; - verts[ 1 ].modulate[ 3 ] = 255; - - VectorCopy( trace.endpos, verts[ 2 ].xyz ); - verts[ 2 ].xyz[ 0 ] += 32; - verts[ 2 ].xyz[ 1 ] += 32; - verts[ 2 ].st[ 0 ] = 1; - verts[ 2 ].st[ 1 ] = 1; - verts[ 2 ].modulate[ 0 ] = 255; - verts[ 2 ].modulate[ 1 ] = 255; - verts[ 2 ].modulate[ 2 ] = 255; - verts[ 2 ].modulate[ 3 ] = 255; - - VectorCopy( trace.endpos, verts[ 3 ].xyz ); - verts[ 3 ].xyz[ 0 ] += 32; - verts[ 3 ].xyz[ 1 ] -= 32; - verts[ 3 ].st[ 0 ] = 1; - verts[ 3 ].st[ 1 ] = 0; - verts[ 3 ].modulate[ 0 ] = 255; - verts[ 3 ].modulate[ 1 ] = 255; - verts[ 3 ].modulate[ 2 ] = 255; - verts[ 3 ].modulate[ 3 ] = 255; - - trap_R_AddPolyToScene( cgs.media.wakeMarkShader, 4, verts ); + CG_ImpactMark( cgs.media.wakeMarkShader, trace.endpos, trace.plane.normal, + cent->pe.legs.yawAngle, 1.0f, 1.0f, 1.0f, 1.0f, qfalse, + 32.0f * BG_FindShadowScaleForClass( class ), qtrue ); } @@ -2155,7 +2113,7 @@ void CG_Player( centity_t *cent ) shadow = CG_PlayerShadow( cent, &shadowPlane, class ); // add a water splash if partially in and out of water - CG_PlayerSplash( cent ); + CG_PlayerSplash( cent, class ); if( cg_shadows.integer == 3 && shadow ) renderfx |= RF_SHADOW_PLANE; diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index a2970c3c..7b7a7b74 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -995,7 +995,13 @@ static void CG_ServerCommand( void ) if( !strcmp( cmd, "tchat" ) ) { - trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); + if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + trap_S_StartLocalSound( cgs.media.alienTalkSound, CHAN_LOCAL_SOUND ); + else if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + trap_S_StartLocalSound( cgs.media.humanTalkSound, CHAN_LOCAL_SOUND ); + else + trap_S_StartLocalSound( cgs.media.talkSound, CHAN_LOCAL_SOUND ); + Q_strncpyz( text, CG_Argv( 1 ), MAX_SAY_TEXT ); CG_RemoveChatEscapeChar( text ); CG_AddToTeamChat( text ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 558b5ac4..f37078f4 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1239,9 +1239,6 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) CG_DrawPic( x, y, iconsize, iconsize, cg_upgrades[ items[ item ] - 32 ].upgradeIcon ); trap_R_SetColor( NULL ); - -/* if( displacement == 0 ) - CG_DrawPic( x, y, iconsize, iconsize, cgs.media.selectShader );*/ } if( vertical ) |