diff options
author | Tim Angus <tim@ngus.net> | 2003-08-01 02:04:03 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2003-08-01 02:04:03 +0000 |
commit | 176ad9f581c7612446d6cf04ff06c24b242fbed8 (patch) | |
tree | 3990e8da1a11d28a4d1631c436d6e2a9717bcfb1 /src/cgame | |
parent | beb34e28a4f933107a3fa08a306125a712e885ad (diff) |
* Jetpack media code
* Various other media issues
* Light flare tweaks
* I can spell, no really I can... (canon->cannon)
* Other stuff I forgot
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_ents.c | 8 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 6 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 28 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 14 |
5 files changed, 39 insertions, 19 deletions
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 674c758c..c09f1c0f 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -370,7 +370,7 @@ static void CG_Missile( centity_t *cent ) return; break; - case WP_LUCIFER_CANON: + case WP_LUCIFER_CANNON: ent.skinNum = cg.clientFrame & 1; ent.hModel = weapon->missileModel; ent.renderfx = weapon->missileRenderfx | RF_NOSHADOW; @@ -381,7 +381,7 @@ static void CG_Missile( centity_t *cent ) RotateAroundDirection( ent.axis, cg.time / 4 ); - fraction = (float)s1->generic1 / (float)LCANON_TOTAL_CHARGE; + fraction = (float)s1->generic1 / (float)LCANNON_TOTAL_CHARGE; VectorScale( ent.axis[ 0 ], fraction, ent.axis[ 0 ] ); VectorScale( ent.axis[ 1 ], fraction, ent.axis[ 1 ] ); VectorScale( ent.axis[ 2 ], fraction, ent.axis[ 2 ] ); @@ -522,7 +522,7 @@ static void CG_Portal( centity_t *cent ) #define SETBOUNDS(v1,v2,r) ((v1)[0]=(-r/2),(v1)[1]=(-r/2),(v1)[2]=(-r/2),\ (v2)[0]=(r/2),(v2)[1]=(r/2),(v2)[2]=(r/2)) -#define RADIUSSTEP 1.0f +#define RADIUSSTEP 0.5f #define FLARE_OFF 0 #define FLARE_NOFADE 1 @@ -591,7 +591,7 @@ static void CG_LightFlare( centity_t *cent ) return; //only recalculate radius and ratio every three frames - if( !( cg.clientFrame % 3 ) ) + if( !( cg.clientFrame % 2 ) ) { //can only see the flare when in front of it flare.radius = len / es->origin2[ 0 ]; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index e1488cba..435de800 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -942,6 +942,8 @@ typedef struct qhandle_t carmourTorsoSkin; qhandle_t clarmourTorsoSkin; qhandle_t larmourTorsoSkin; + + qhandle_t jetpackModel; } cgMedia_t; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 13cd3b96..d651f329 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -880,8 +880,8 @@ static void CG_RegisterClients( void ) trap_UpdateScreen( ); } - cgs.media.helmetModel = trap_R_RegisterModel( "models/players/doom/head.md3" ); - cgs.media.helmetSkin = trap_R_RegisterSkin( "models/players/doom/head_default.skin" ); + cgs.media.helmetModel = trap_R_RegisterModel( "models/players/human_base/helmet.md3" ); + cgs.media.helmetSkin = trap_R_RegisterSkin( "models/players/human_base/helmet_default.skin" ); cgs.media.larmourLegsSkin = trap_R_RegisterSkin( "models/players/sarge/lower_red.skin" ); @@ -889,6 +889,8 @@ static void CG_RegisterClients( void ) cgs.media.clarmourTorsoSkin = trap_R_RegisterSkin( "models/players/sarge/upper_roderic.skin" ); cgs.media.larmourTorsoSkin = trap_R_RegisterSkin( "models/players/sarge/upper_blue.skin" ); + cgs.media.jetpackModel = trap_R_RegisterModel( "models/players/human_base/jetpack.md3" ); + cg.charModelFraction = 1.0f; trap_UpdateScreen( ); diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 3e2235f3..7d49ae2f 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -1501,10 +1501,10 @@ static void CG_PlayerNonSegAngles( centity_t *cent, vec3_t srcAngles, vec3_t non CG_PlayerUpgrade =============== */ -static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso ) +static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *legs, + vec3_t torsoAxis[ 3 ], qhandle_t legsModel ) { int held, active; - clientInfo_t *ci; vec3_t acc = { 0.0f, 0.0f, 10.0f }; vec3_t vel = { 0.0f, 0.0f, 0.0f }; vec3_t origin; @@ -1513,15 +1513,28 @@ static void CG_PlayerUpgrades( centity_t *cent, refEntity_t *torso ) vec3_t right = { 0.0f, 1.0f, 0.0f }; vec3_t pvel; int addTime; + refEntity_t jetpack; held = cent->currentState.modelindex; active = cent->currentState.modelindex2; if( held & ( 1 << UP_JETPACK ) ) { - //FIXME: add model to back - //CG_PositionRotatedEntityOnTag( &head, &torso, ci->torsoModel, "tag_back" ); + memset( &jetpack, 0, sizeof( jetpack ) ); + + jetpack.hModel = cgs.media.jetpackModel; + + AxisCopy( torsoAxis, jetpack.axis ); + VectorCopy( cent->lerpOrigin, jetpack.lightingOrigin ); + + //FIXME: change to tag_back when it exists + CG_PositionRotatedEntityOnTag( &jetpack, legs, legsModel, "tag_torso" ); + jetpack.shadowPlane = legs->shadowPlane; + jetpack.renderfx = legs->renderfx; + + trap_R_AddRefEntityToScene( &jetpack ); + if( active & ( 1 << UP_JETPACK ) ) { if( cent->currentState.pos.trDelta[ 2 ] > 10.0f ) @@ -1927,7 +1940,7 @@ void CG_Player( centity_t *cent ) entityState_t *es = ¢->currentState; int class = ( es->powerups >> 8 ) & 0xFF; float scale; - vec3_t tempAxis[ 3 ], tempAxis2[ 3 ]; + vec3_t tempAxis[ 3 ], tempAxis2[ 3 ], torsoAxis[ 3 ]; vec3_t angles; int held = es->modelindex; pTeam_t team = es->powerups & 0xFF; @@ -1980,6 +1993,9 @@ void CG_Player( centity_t *cent ) else CG_PlayerNonSegAngles( cent, angles, legs.axis ); + //for CG_PlayerUpgrades + AxisCopy( torso.axis, torsoAxis ); + //rotate the legs axis to back to the wall if( es->eFlags & EF_WALLCLIMB && BG_rotateAxis( es->angles2, legs.axis, tempAxis, qfalse, es->eFlags & EF_WALLCLIMBCEILING ) ) @@ -2134,7 +2150,7 @@ void CG_Player( centity_t *cent ) if( team == PTE_HUMANS ) CG_AddPlayerWeapon( &torso, NULL, cent ); - CG_PlayerUpgrades( cent, &torso ); + CG_PlayerUpgrades( cent, &legs, torsoAxis, ci->legsModel ); } /* diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index d6efba1f..e5b5fc9d 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1120,9 +1120,9 @@ void CG_AddViewWeapon( playerState_t *ps ) VectorMA( hand.origin, cg_gun_y.value, cg.refdef.viewaxis[ 1 ], hand.origin ); VectorMA( hand.origin, ( cg_gun_z.value + fovOffset ), cg.refdef.viewaxis[ 2 ], hand.origin ); - if( ps->weapon == WP_LUCIFER_CANON && ps->stats[ STAT_MISC ] > 0 ) + if( ps->weapon == WP_LUCIFER_CANNON && ps->stats[ STAT_MISC ] > 0 ) { - float fraction = (float)ps->stats[ STAT_MISC ] / (float)LCANON_TOTAL_CHARGE; + float fraction = (float)ps->stats[ STAT_MISC ] / (float)LCANNON_TOTAL_CHARGE; VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 0 ], hand.origin ); VectorMA( hand.origin, random( ) * fraction, cg.refdef.viewaxis[ 1 ], hand.origin ); @@ -1648,9 +1648,9 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im radius = 8; break; - #define LCANON_EJECTION_VEL 300 + #define LCANNON_EJECTION_VEL 300 - case WP_LUCIFER_CANON: + case WP_LUCIFER_CANNON: mod = cgs.media.dishFlashModel; shader = cgs.media.bfgExplosionShader; mark = cgs.media.bulletMarkShader; @@ -1671,9 +1671,9 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im else spark = cgs.media.scannerBlipShader; - velocity[ 0 ] = ( 2 * random( ) - 1.0f ) * LCANON_EJECTION_VEL; - velocity[ 1 ] = ( 2 * random( ) - 1.0f ) * LCANON_EJECTION_VEL; - velocity[ 2 ] = ( 2 * random( ) - 1.0f ) * LCANON_EJECTION_VEL; + velocity[ 0 ] = ( 2 * random( ) - 1.0f ) * LCANNON_EJECTION_VEL; + velocity[ 1 ] = ( 2 * random( ) - 1.0f ) * LCANNON_EJECTION_VEL; + velocity[ 2 ] = ( 2 * random( ) - 1.0f ) * LCANNON_EJECTION_VEL; CG_LaunchSprite( origin, velocity, accel, 0.0f, 0.9f, 1.0f, 40.0f, 255, 0, rand( ) % 360, |