summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-06-27 15:54:39 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-06-27 15:54:39 +0200
commit9f6a3c3c4c0d8c50f7e380feeb93e860af17638f (patch)
tree9eb94b7aa4b21c9b4ce0c8dd4a2b357e5bc02015
parentbe6717d194c33d61a906aa92c3de9520bf1d3259 (diff)
Improve Wraith warp vision.
-rw-r--r--assets/gfx/level1/warpOverlay.jpgbin308 -> 287 bytes
-rw-r--r--assets/gfx/level1/warpOverlay2.jpgbin9251 -> 0 bytes
-rw-r--r--assets/scripts/aw_level1.shader10
-rw-r--r--src/cgame/cg_draw.c43
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c1
6 files changed, 46 insertions, 9 deletions
diff --git a/assets/gfx/level1/warpOverlay.jpg b/assets/gfx/level1/warpOverlay.jpg
index 02b1b6b..33e83e2 100644
--- a/assets/gfx/level1/warpOverlay.jpg
+++ b/assets/gfx/level1/warpOverlay.jpg
Binary files differ
diff --git a/assets/gfx/level1/warpOverlay2.jpg b/assets/gfx/level1/warpOverlay2.jpg
deleted file mode 100644
index 702489c..0000000
--- a/assets/gfx/level1/warpOverlay2.jpg
+++ /dev/null
Binary files differ
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 );