summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-06-26 13:46:44 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-06-26 14:13:09 +0200
commit7ea0e9de3459b4caa9b35b71f742b658b38ef151 (patch)
treef7a0b638d1ff825d4f6171eecd36095ae7ab57f7 /src
parentecf51bf1e505e7e36df07eeb30a77a89ef2b7c55 (diff)
More Wraith improvements.
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_buildable.c15
-rw-r--r--src/cgame/cg_event.c4
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c1
-rw-r--r--src/cgame/cg_players.c39
-rw-r--r--src/cgame/cg_tutorial.c30
6 files changed, 90 insertions, 0 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index 5ecdafb..5b2582c 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -1399,6 +1399,11 @@ void CG_Buildable( centity_t *cent )
if( CG_PlayerIsBuilder( es->modelindex ) && CG_BuildableRemovalPending( es->number ) )
ent.customShader = cgs.media.redBuildShader;
+ if( cg.warping )
+ {
+ ent.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
//add to refresh list
trap_R_AddRefEntityToScene( &ent );
@@ -1444,6 +1449,11 @@ void CG_Buildable( centity_t *cent )
if( CG_PlayerIsBuilder( es->modelindex ) && CG_BuildableRemovalPending( es->number ) )
turretBarrel.customShader = cgs.media.redBuildShader;
+ if( cg.warping )
+ {
+ turretBarrel.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &turretBarrel );
}
@@ -1489,6 +1499,11 @@ void CG_Buildable( centity_t *cent )
if( CG_PlayerIsBuilder( es->modelindex ) && CG_BuildableRemovalPending( es->number ) )
turretTop.customShader = cgs.media.redBuildShader;
+ if( cg.warping )
+ {
+ turretTop.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &turretTop );
}
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 4ce2b25..c459f32 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -1008,6 +1008,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
}
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.warpEnterSound );
+
+ CG_InduceViewQuake( cent->lerpOrigin, 15 );
}
break;
@@ -1024,6 +1026,8 @@ void CG_EntityEvent( centity_t *cent, vec3_t position )
}
trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.warpExitSound );
+
+ CG_InduceViewQuake( cent->lerpOrigin, 15 );
}
break;
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 91ea3a9..555063f 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1363,6 +1363,7 @@ typedef struct
qhandle_t warpOverlay;
qhandle_t warpOverlayBlocked;
qhandle_t warpingShader;
+ qhandle_t warpingEnvironmentShader;
} cgMedia_t;
typedef struct
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 2fae20f..2e7fb66 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -939,6 +939,7 @@ static void CG_RegisterGraphics( void )
cgs.media.warpOverlay = trap_R_RegisterShader( "gfx/level1/warpOverlay" );
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" );
CG_BuildableStatusParse( "ui/assets/human/buildstat.cfg", &cgs.humanBuildStat );
CG_BuildableStatusParse( "ui/assets/alien/buildstat.cfg", &cgs.alienBuildStat );
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index c3afab3..a6ee457 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -1448,6 +1448,11 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso )
//FIXME: change to tag_back when it exists
CG_PositionRotatedEntityOnTag( &jetpack, torso, torso->hModel, "tag_head" );
+ if( cg.warping )
+ {
+ jetpack.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &jetpack );
if( active & ( 1 << UP_JETPACK ) )
@@ -1544,6 +1549,11 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso )
//FIXME: change to tag_back when it exists
CG_PositionRotatedEntityOnTag( &battpack, torso, torso->hModel, "tag_head" );
+ if( cg.warping )
+ {
+ battpack.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &battpack );
}
}
@@ -2071,6 +2081,10 @@ void CG_Player( centity_t *cent )
{
legs.customShader = cgs.media.warpingShader;
}
+ else if( cg.warping )
+ {
+ legs.customShader = cgs.media.warpingEnvironmentShader;
+ }
trap_R_AddRefEntityToScene( &legs );
@@ -2109,6 +2123,11 @@ void CG_Player( centity_t *cent )
torso.shadowPlane = shadowPlane;
torso.renderfx = renderfx;
+ if( cg.warping )
+ {
+ torso.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &torso );
//
@@ -2140,6 +2159,11 @@ void CG_Player( centity_t *cent )
head.shadowPlane = shadowPlane;
head.renderfx = renderfx;
+ if( cg.warping )
+ {
+ head.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &head );
}
@@ -2287,6 +2311,11 @@ void CG_Corpse( centity_t *cent )
legs.nonNormalizedAxes = qtrue;
}
+ if( cg.warping )
+ {
+ legs.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &legs );
// if the model failed, allow the default nullmodel to be displayed
@@ -2311,6 +2340,11 @@ void CG_Corpse( centity_t *cent )
torso.shadowPlane = shadowPlane;
torso.renderfx = renderfx;
+ if( cg.warping )
+ {
+ torso.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &torso );
//
@@ -2329,6 +2363,11 @@ void CG_Corpse( centity_t *cent )
head.shadowPlane = shadowPlane;
head.renderfx = renderfx;
+ if( cg.warping )
+ {
+ head.customShader = cgs.media.warpingEnvironmentShader;
+ }
+
trap_R_AddRefEntityToScene( &head );
}
}
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index b44b2f1..9dcb057 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -270,6 +270,36 @@ static void CG_AlienLevel1Text( char *text, playerState_t *ps )
va( "Press %s to swipe\n",
CG_KeyNameForCommand( "+attack" ) ) );
+ if( cg.warping )
+ {
+ if( cg.warpExitBlocked )
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "You can't stop warping if you're intersecting a "
+ "player or a building\n" ) );
+ }
+ else
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Release %s to stop warping\n",
+ CG_KeyNameForCommand( "+button5" ) ) );
+ }
+ }
+ else
+ {
+ if( ps->stats[ STAT_MISC ] < LEVEL1_WARP_MIN_TIME )
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "You have to wait before warping again.\n" ) );
+ }
+ else
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Hold down %s to warp\n",
+ CG_KeyNameForCommand( "+button5" ) ) );
+ }
+ }
+
Q_strcat( text, MAX_TUTORIAL_TEXT,
va( "Press %s to walk on walls\n",
CG_KeyNameForCommand( "+movedown" ) ) );