summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-04-08 21:45:16 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-04-08 21:45:16 +0200
commitee25f4aadf87fa2852bb345062eeecea9e86d1dc (patch)
treeb7dd37970f250812a67c750d63b901c38fbee35f /src/cgame
parent0f4407b328c59f132ee5bbf31004d31b81dc3b3b (diff)
Revert human physics to vq3.
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c73
-rw-r--r--src/cgame/cg_tutorial.c11
-rw-r--r--src/cgame/cg_view.c12
3 files changed, 2 insertions, 94 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 0af9839..570276b 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -375,34 +375,10 @@ static void CG_DrawPlayerStamina( int ownerDraw, rectDef_t *rect,
vec4_t backColor, vec4_t foreColor,
qhandle_t shader )
{
- playerState_t *ps = &cg.snap->ps;
- float stamina = ps->stats[ STAT_STAMINA ];
- float maxStaminaBy3 = (float)STAMINA_MAX / 3.0f;
float progress;
vec4_t color;
- switch( ownerDraw )
- {
- case CG_PLAYER_STAMINA_1:
- progress = ( stamina - 2 * (int)maxStaminaBy3 ) / maxStaminaBy3;
- break;
- case CG_PLAYER_STAMINA_2:
- progress = ( stamina - (int)maxStaminaBy3 ) / maxStaminaBy3;
- break;
- case CG_PLAYER_STAMINA_3:
- progress = stamina / maxStaminaBy3;
- break;
- case CG_PLAYER_STAMINA_4:
- progress = ( stamina + STAMINA_MAX ) / STAMINA_MAX;
- break;
- default:
- return;
- }
-
- if( progress > 1.0f )
- progress = 1.0f;
- else if( progress < 0.0f )
- progress = 0.0f;
+ progress = 0.0f;
Vector4Lerp( progress, backColor, foreColor, color );
@@ -419,25 +395,9 @@ CG_DrawPlayerStaminaBolt
static void CG_DrawPlayerStaminaBolt( rectDef_t *rect, vec4_t backColor,
vec4_t foreColor, qhandle_t shader )
{
- float stamina = cg.snap->ps.stats[ STAT_STAMINA ];
vec4_t color;
- if( cg.predictedPlayerState.stats[ STAT_STATE ] & SS_SPEEDBOOST )
- {
- if( stamina >= 0 )
- Vector4Lerp( ( sin( cg.time / 150.0f ) + 1 ) / 2,
- backColor, foreColor, color );
- else
- Vector4Lerp( ( sin( cg.time / 2000.0f ) + 1 ) / 2,
- backColor, foreColor, color );
- }
- else
- {
- if( stamina < 0 )
- Vector4Copy( backColor, color );
- else
- Vector4Copy( foreColor, color );
- }
+ Vector4Copy( backColor, color );
trap_R_SetColor( color );
CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
@@ -3460,31 +3420,6 @@ void CG_RunMenuScript( char **args )
}
//END TA UI
-
-/*
-================
-CG_DrawLighting
-
-================
-*/
-static void CG_DrawLighting( void )
-{
- // centity_t *cent;
-
- // cent = &cg_entities[ cg.snap->ps.clientNum ];
-
- //fade to black if stamina is low
- if( ( cg.snap->ps.stats[ STAT_STAMINA ] < STAMINA_BLACKOUT_LEVEL ) &&
- ( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) )
- {
- vec4_t black = { 0, 0, 0, 0 };
- black[ 3 ] = 1.0 - ( (float)( cg.snap->ps.stats[ STAT_STAMINA ] + 1000 ) / 200.0f );
- trap_R_SetColor( black );
- CG_DrawPic( 0, 0, 640, 480, cgs.media.whiteShader );
- trap_R_SetColor( NULL );
- }
-}
-
/*
===============================================================================
@@ -4162,10 +4097,6 @@ static void CG_Draw2D( void )
if( cg.levelShot )
return;
- // fading to black if stamina runs out
- // (only 2D that can't be disabled)
- CG_DrawLighting( );
-
if( cg_draw2D.integer == 0 )
return;
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index d36ecac..d2f01b3 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -514,17 +514,6 @@ static void CG_HumanText( char *text, playerState_t *ps )
BG_Upgrade( UP_MEDKIT )->humanName ) );
}
- if( ps->stats[ STAT_STAMINA ] <= STAMINA_BLACKOUT_LEVEL )
- {
- Q_strcat( text, MAX_TUTORIAL_TEXT,
- "You are blacking out. Stop sprinting to recover stamina\n" );
- }
- else if( ps->stats[ STAT_STAMINA ] <= STAMINA_SLOW_LEVEL )
- {
- Q_strcat( text, MAX_TUTORIAL_TEXT,
- "Your stamina is low. Stop sprinting to recover\n" );
- }
-
switch( cg.nearUsableBuildable )
{
case BA_H_ARMOURY:
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 1221fe9..333e421 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -809,18 +809,6 @@ void CG_OffsetFirstPersonView( void )
cg.predictedPlayerState.pm_type == PM_JETPACK ) )
{
angles[PITCH] += cg.bobfracsin * bob2 * 0.5;
-
- // heavy breathing effects //FIXME: sound
- if( cg.predictedPlayerState.stats[ STAT_STAMINA ] < STAMINA_BREATHING_LEVEL )
- {
- float deltaBreath = ( cg.predictedPlayerState.stats[ STAT_STAMINA ] -
- STAMINA_BREATHING_LEVEL ) / -250.0;
- float deltaAngle = cos( (float)cg.time/150.0 ) * deltaBreath;
-
- deltaAngle += ( deltaAngle < 0 ? -deltaAngle : deltaAngle ) * 0.5;
-
- angles[ PITCH ] -= deltaAngle;
- }
}
//===================================