diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-06-27 15:54:39 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-06-27 15:54:39 +0200 |
commit | 9f6a3c3c4c0d8c50f7e380feeb93e860af17638f (patch) | |
tree | 9eb94b7aa4b21c9b4ce0c8dd4a2b357e5bc02015 /src/cgame/cg_draw.c | |
parent | be6717d194c33d61a906aa92c3de9520bf1d3259 (diff) |
Improve Wraith warp vision.
Diffstat (limited to 'src/cgame/cg_draw.c')
-rw-r--r-- | src/cgame/cg_draw.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 15a5cc4..8597482 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -4143,19 +4143,50 @@ CG_DrawWarpOverlay */ static void CG_DrawWarpOverlay( void ) { - if( !cg.warping || - cg.renderingThirdPerson ) + static qboolean last_valid = qfalse, last_warping; + static int timestamp = 0; + + if( cg.renderingThirdPerson || + cg.predictedPlayerState.weapon != WP_ALEVEL1 ) { + last_valid = qfalse; return; } - trap_R_SetColor( NULL ); - CG_DrawPic( 0, 0, 640, 480, cgs.media.warpOverlay ); + if( last_valid ) + { + if( last_warping != cg.warping ) + { + timestamp = cg.time; + } + + if( timestamp && cg.time < timestamp + 200 ) + { + float frac; + + frac = ( 1.0f - ( cg.time - timestamp ) / 200.0f ); + frac = pow( frac, 4 ) * 6; - if( cg.warpExitBlocked ) + CG_DrawPic( 320 - 320 * frac, 240 - 240 * frac, + 640 * frac, 480 * frac, + cgs.media.warpParticle ); + } + } + + if( cg.warping ) { - CG_DrawPic( 0, 0, 640, 480, cgs.media.warpOverlayBlocked ); + trap_R_SetColor( NULL ); + CG_DrawPic( 0, 0, 640, 480, cgs.media.warpOverlay ); + + if( cg.warpExitBlocked ) + { + CG_DrawPic( 0, 0, 640, 480, cgs.media.warpOverlayBlocked ); + } } + +out: + last_valid = qtrue; + last_warping = cg.warping; } //================================================================================== |