diff options
-rw-r--r-- | assets/gfx/level1/warpOverlay.jpg | bin | 308 -> 287 bytes | |||
-rw-r--r-- | assets/gfx/level1/warpOverlay2.jpg | bin | 9251 -> 0 bytes | |||
-rw-r--r-- | assets/scripts/aw_level1.shader | 10 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 43 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 1 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 1 |
6 files changed, 46 insertions, 9 deletions
diff --git a/assets/gfx/level1/warpOverlay.jpg b/assets/gfx/level1/warpOverlay.jpg Binary files differindex 02b1b6b..33e83e2 100644 --- a/assets/gfx/level1/warpOverlay.jpg +++ b/assets/gfx/level1/warpOverlay.jpg diff --git a/assets/gfx/level1/warpOverlay2.jpg b/assets/gfx/level1/warpOverlay2.jpg Binary files differdeleted file mode 100644 index 702489c..0000000 --- a/assets/gfx/level1/warpOverlay2.jpg +++ /dev/null diff --git a/assets/scripts/aw_level1.shader b/assets/scripts/aw_level1.shader index 8d209db..33ce967 100644 --- a/assets/scripts/aw_level1.shader +++ b/assets/scripts/aw_level1.shader @@ -2,11 +2,15 @@ gfx/level1/warpOverlay { { map gfx/level1/warpOverlay.jpg - blendFunc GL_ONE_MINUS_DST_COLOR GL_ONE_MINUS_SRC_COLOR + blendFunc GL_DST_COLOR GL_ONE } { - map gfx/level1/warpOverlay2.jpg - blendFunc filter + map gfx/level1/warpOverlay.jpg + blendFunc GL_DST_COLOR GL_ONE + } + { + map gfx/level1/warpOverlay.jpg + blendFunc GL_ONE_MINUS_DST_COLOR GL_ONE_MINUS_SRC_COLOR } } 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; } //================================================================================== diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 555063f..d1ae009 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1364,6 +1364,7 @@ typedef struct qhandle_t warpOverlayBlocked; qhandle_t warpingShader; qhandle_t warpingEnvironmentShader; + qhandle_t warpParticle; } cgMedia_t; typedef struct diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 2e7fb66..672b8bb 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -940,6 +940,7 @@ static void CG_RegisterGraphics( void ) cgs.media.warpOverlayBlocked = trap_R_RegisterShader( "gfx/level1/warpOverlayBlocked" ); cgs.media.warpingShader = trap_R_RegisterShader( "gfx/level1/warping" ); cgs.media.warpingEnvironmentShader = trap_R_RegisterShader( "gfx/level1/warpingEnvironment" ); + cgs.media.warpParticle = trap_R_RegisterShader( "gfx/level1/warpParticle1" ); CG_BuildableStatusParse( "ui/assets/human/buildstat.cfg", &cgs.humanBuildStat ); CG_BuildableStatusParse( "ui/assets/alien/buildstat.cfg", &cgs.alienBuildStat ); |