summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_consolecmds.c24
-rw-r--r--src/cgame/cg_draw.c117
-rw-r--r--src/cgame/cg_drawtools.c53
-rw-r--r--src/cgame/cg_event.c7
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_weapons.c37
6 files changed, 0 insertions, 239 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c
index 3a057b3e..697b0e98 100644
--- a/src/cgame/cg_consolecmds.c
+++ b/src/cgame/cg_consolecmds.c
@@ -188,29 +188,6 @@ static void CG_TellAttacker_f( void )
trap_SendClientCommand( command );
}
-static void CG_SquadMark_f( void )
-{
- centity_t *cent;
- vec3_t end;
- trace_t trace;
-
- // Find the player we are looking at
- VectorMA( cg.refdef.vieworg, 131072, cg.refdef.viewaxis[ 0 ], end );
- CG_Trace( &trace, cg.refdef.vieworg, NULL, NULL, end,
- cg.snap->ps.clientNum, CONTENTS_SOLID | CONTENTS_BODY );
- if( trace.entityNum >= MAX_CLIENTS )
- return;
-
- // Only mark teammates
- cent = cg_entities + trace.entityNum;
- if( cent->currentState.eType != ET_PLAYER ||
- cgs.clientinfo[ trace.entityNum ].team !=
- cg.snap->ps.stats[ STAT_PTEAM ] )
- return;
-
- cent->pe.squadMarked = !cent->pe.squadMarked;
-}
-
typedef struct
{
char *cmd;
@@ -242,7 +219,6 @@ static consoleCommand_t commands[ ] =
{ "destroyTestPS", CG_DestroyTestPS_f },
{ "testTS", CG_TestTS_f },
{ "destroyTestTS", CG_DestroyTestTS_f },
- { "squadmark", CG_SquadMark_f },
};
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 3687e195..0feedc68 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2265,120 +2265,6 @@ static void CG_DrawCrosshairNames( rectDef_t *rect, float scale, int textStyle )
/*
===============
-CG_DrawSquadMarkers
-===============
-*/
-#define SQUAD_MARKER_W 16.0f
-#define SQUAD_MARKER_H 8.0f
-#define SQUAD_MARKER_BORDER 8.0f
-static void CG_DrawSquadMarkers( vec4_t color )
-{
- centity_t *cent;
- vec3_t origin;
- qhandle_t shader;
- float x, y, w, h, distance, scale, u1 = 0.0f, v1 = 0.0f, u2 = 1.0f, v2 = 1.0f;
- int i;
- qboolean vertical, flip;
-
- if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR )
- return;
-
- trap_R_SetColor( color );
- for( i = 0; i < cg.snap->numEntities; i++ )
- {
- cent = cg_entities + cg.snap->entities[ i ].number;
- if( cent->currentState.eType != ET_PLAYER ||
- cgs.clientinfo[ cg.snap->entities[ i ].number ].team !=
- cg.snap->ps.stats[ STAT_PTEAM ] ||
- !cent->pe.squadMarked )
- continue;
-
- // Find where on screen the player is
- VectorCopy( cent->lerpOrigin, origin );
- origin[ 2 ] += ( ( cent->currentState.solid >> 16 ) & 255 ) - 30;
- if( !CG_WorldToScreenWrap( origin, &x, &y ) )
- continue;
-
- // Scale the size of the marker with distance
- distance = Distance( cent->lerpOrigin, cg.refdef.vieworg );
- if( !distance )
- continue;
-
- scale = 200.0f / distance;
-
- if( scale > 1.0f )
- scale = 1.0f;
-
- if( scale < 0.25f )
- scale = 0.25f;
-
- // Don't let the marker go off-screen
- vertical = qfalse;
- flip = qfalse;
- if( x < SQUAD_MARKER_BORDER )
- {
- x = SQUAD_MARKER_BORDER;
- vertical = qtrue;
- flip = qfalse;
- }
- else if( x > 640.0f - SQUAD_MARKER_BORDER )
- {
- x = 640.0f - SQUAD_MARKER_BORDER;
- vertical = qtrue;
- flip = qtrue;
- }
-
- if( y < SQUAD_MARKER_BORDER )
- {
- y = SQUAD_MARKER_BORDER;
- vertical = qfalse;
- flip = qtrue;
- }
- else if( y > 480.0f - SQUAD_MARKER_BORDER )
- {
- y = 480.0f - SQUAD_MARKER_BORDER;
- vertical = qfalse;
- flip = qfalse;
- }
-
- // Draw the marker
- if( vertical )
- {
- shader = cgs.media.squadMarkerV;
-
- if( flip )
- {
- u1 = 1.0f;
- u2 = 0.0f;
- }
-
- w = SQUAD_MARKER_H * scale;
- h = SQUAD_MARKER_W * scale;
- }
- else
- {
- shader = cgs.media.squadMarkerH;
-
- if( flip )
- {
- v1 = 1.0f;
- v2 = 0.0f;
- }
-
- w = SQUAD_MARKER_W * scale;
- h = SQUAD_MARKER_H * scale;
- }
-
- CG_AdjustFrom640( &x, &y, &w, &h );
- trap_R_DrawStretchPic( x - w / 2, y - h / 2, w, h, u1, v1, u2, v2,
- shader );
- }
-
- trap_R_SetColor( NULL );
-}
-
-/*
-===============
CG_OwnerDraw
Draw an owner drawn item
@@ -2504,9 +2390,6 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
case CG_HUMANS_SCORE_LABEL:
CG_DrawTeamLabel( &rect, PTE_HUMANS, text_x, text_y, color, scale, textalign, textvalign, textStyle );
break;
- case CG_SQUAD_MARKERS:
- CG_DrawSquadMarkers( color );
- break;
//loading screen
case CG_LOAD_LEVELSHOT:
diff --git a/src/cgame/cg_drawtools.c b/src/cgame/cg_drawtools.c
index fb34f991..06ae0713 100644
--- a/src/cgame/cg_drawtools.c
+++ b/src/cgame/cg_drawtools.c
@@ -349,59 +349,6 @@ qboolean CG_WorldToScreen( vec3_t point, float *x, float *y )
/*
================
-CG_WorldToScreenWrap
-================
-*/
-qboolean CG_WorldToScreenWrap( vec3_t point, float *x, float *y )
-{
- vec3_t trans;
- float px, py, dotForward, dotRight, dotUp, distance, propX, propY;
-
- px = tan( cg.refdef.fov_x * M_PI / 360.0f );
- py = tan( cg.refdef.fov_y * M_PI / 360.0f );
-
- VectorSubtract( point, cg.refdef.vieworg, trans );
-
- dotForward = DotProduct( trans, cg.refdef.viewaxis[ 0 ] );
- dotRight = DotProduct( trans, cg.refdef.viewaxis[ 1 ] );
- dotUp = DotProduct( trans, cg.refdef.viewaxis[ 2 ] );
-
- distance = abs( dotForward );
- propX = dotRight / ( distance * px );
- propY = dotUp / ( distance * py );
-
- // The distance along the forward axis does not make sense once the point
- // moves off-screen so we need to use either the side or the up axis instead
- if( propX < -1.0f || propX > 1.0f )
- {
- distance = abs( dotRight ) / px;
- propY = dotUp / ( distance * py );
- }
- if( propY < -1.0f || propY > 1.0f )
- {
- distance = abs( dotUp ) / py;
- propX = dotRight / ( distance * px );
- }
-
- if( x )
- *x = 320 - propX * 320;
- if( y )
- *y = 240 - propY * 240;
-
- // Snap to the edge of the screen when the point is behind us
- if( dotForward < 0.f && *x > 0 && *x < 640 && *y > 0 && *y < 480 )
- {
- if( abs( *x - 320 ) > abs( *y - 240 ) )
- *x = *x <= 320 ? 0.0f : 640;
- else
- *y = *y <= 240 ? 0.0f : 480;
- }
-
- return qtrue;
-}
-
-/*
-================
CG_KeyBinding
================
*/
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 2d622088..e4b9fb44 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -874,13 +874,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
CG_ShotgunFire( es );
break;
- case EV_MASS_DRIVER:
- DEBUGNAME( "EV_MASS_DRIVER" );
- ByteToDir( es->eventParm, dir );
- CG_MissileHitWall( es->weapon, es->generic1, 0, position, dir, IMPACTSOUND_DEFAULT, 0 );
- CG_MassDriverFire( es );
- break;
-
case EV_GENERAL_SOUND:
DEBUGNAME( "EV_GENERAL_SOUND" );
if( cgs.gameSounds[ es->eventParm ] )
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index d969dca1..01308332 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1617,7 +1617,6 @@ void CG_DrawRect( float x, float y, float width, float height, float size
void CG_DrawSides(float x, float y, float w, float h, float size);
void CG_DrawTopBottom(float x, float y, float w, float h, float size);
qboolean CG_WorldToScreen( vec3_t point, float *x, float *y );
-qboolean CG_WorldToScreenWrap( vec3_t point, float *x, float *y );
char *CG_KeyBinding( const char *bind );
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index d0968dd9..a4f8b667 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -1611,43 +1611,6 @@ void CG_MissileHitPlayer( weapon_t weaponNum, weaponMode_t weaponMode,
CG_MissileHitWall( weaponNum, weaponMode, 0, origin, dir, IMPACTSOUND_FLESH, charge );
}
-/*
-==============
-CG_MassDriverFire
-
-Draws the mass driver trail
-==============
-*/
-
-#define MDRIVER_MUZZLE_OFFSET 48.0f
-
-void CG_MassDriverFire( entityState_t *es )
-{
- vec3_t front, frontToBack;
- trailSystem_t *ts;
- float length;
-
- ts = CG_SpawnNewTrailSystem( cgs.media.massDriverTS );
- if( !CG_IsTrailSystemValid( &ts ) )
- return;
-
- // trail front attaches to the player, needs to be pushed forward a bit
- // so that it doesn't look like it shot out of the wrong location
- VectorCopy( es->origin2, front );
- VectorSubtract( es->pos.trBase, front, frontToBack );
- length = VectorLength( frontToBack );
- if( length - MDRIVER_MUZZLE_OFFSET < 0.0f )
- return;
- VectorScale( frontToBack, 1.0f / length, frontToBack );
- VectorMA( front, MDRIVER_MUZZLE_OFFSET, frontToBack, front );
- CG_SetAttachmentPoint( &ts->frontAttachment, front );
- CG_AttachToPoint( &ts->frontAttachment );
-
- // trail back attaches to the impact point
- CG_SetAttachmentPoint( &ts->backAttachment, es->pos.trBase );
- CG_AttachToPoint( &ts->backAttachment );
-}
-
/*
============================================================================