diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_local.h | 15 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 17 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 48 |
3 files changed, 25 insertions, 55 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 9f14d58e..cf125215 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -929,17 +929,8 @@ typedef struct //TA: for wolf trail effects qhandle_t sparkFlareShader; -} cgMedia_t; - - -//TA: media used for armour switching stuff -typedef struct -{ - qhandle_t bsuitLegsModel; - qhandle_t bsuitTorsoModel; - qhandle_t bsuitLegsSkin; - qhandle_t bsuitTorsoSkin; + //TA: media used for armour switching stuff qhandle_t helmetModel; qhandle_t helmetSkin; @@ -948,7 +939,8 @@ typedef struct qhandle_t carmourTorsoSkin; qhandle_t clarmourTorsoSkin; qhandle_t larmourTorsoSkin; -} cgArmourMedia_t; +} cgMedia_t; + // The client game static (cgs) structure hold everything // loaded or calculated from the gamestate. It will NOT @@ -1033,7 +1025,6 @@ typedef struct // media cgMedia_t media; - cgArmourMedia_t amedia; } cgs_t; //============================================================================== diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index ce687fcb..f2186543 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -888,19 +888,14 @@ static void CG_RegisterClients( void ) trap_UpdateScreen( ); } - cgs.amedia.bsuitLegsModel = trap_R_RegisterModel( "models/players/tankjr/lower.md3" ); - cgs.amedia.bsuitTorsoModel = trap_R_RegisterModel( "models/players/tankjr/upper.md3" ); - cgs.amedia.bsuitLegsSkin = trap_R_RegisterShader( "models/players/tankjr/lower_default.skin" ); - cgs.amedia.bsuitTorsoSkin = trap_R_RegisterShader( "models/players/tankjr/upper_default.skin" ); + cgs.media.helmetModel = trap_R_RegisterModel( "models/players/doom/head.md3" ); + cgs.media.helmetSkin = trap_R_RegisterSkin( "models/players/doom/head_default.skin" ); - cgs.amedia.helmetModel = trap_R_RegisterModel( "models/players/doom/head.md3" ); - cgs.amedia.helmetSkin = trap_R_RegisterShader( "models/players/doom/head_default.skin" ); - - cgs.amedia.larmourLegsSkin = trap_R_RegisterShader( "models/players/sarge/lower_red.skin" ); + cgs.media.larmourLegsSkin = trap_R_RegisterSkin( "models/players/sarge/lower_red.skin" ); - cgs.amedia.carmourTorsoSkin = trap_R_RegisterShader( "models/players/sarge/upper_krusade.skin" ); - cgs.amedia.clarmourTorsoSkin = trap_R_RegisterShader( "models/players/sarge/upper_roderic.skin" ); - cgs.amedia.larmourTorsoSkin = trap_R_RegisterShader( "models/players/sarge/upper_blue.skin" ); + cgs.media.carmourTorsoSkin = trap_R_RegisterSkin( "models/players/sarge/upper_krusade.skin" ); + cgs.media.clarmourTorsoSkin = trap_R_RegisterSkin( "models/players/sarge/upper_roderic.skin" ); + cgs.media.larmourTorsoSkin = trap_R_RegisterSkin( "models/players/sarge/upper_blue.skin" ); cg.charModelFraction = 1.0f; trap_UpdateScreen( ); diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index 277a8ea9..3f285ac1 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -2012,20 +2012,12 @@ void CG_Player( centity_t *cent ) // if( !ci->nonsegmented ) { - if( held & ( 1 << UP_BATTLESUIT ) ) - { - legs.hModel = cgs.amedia.bsuitLegsModel; - legs.customSkin = cgs.amedia.bsuitLegsSkin; - } - else - { - legs.hModel = ci->legsModel; + legs.hModel = ci->legsModel; - if( held & ( 1 << UP_LIMBARMOUR ) ) - legs.customSkin = cgs.amedia.larmourLegsSkin; - else - legs.customSkin = ci->legsSkin; - } + if( held & ( 1 << UP_LIMBARMOUR ) ) + legs.customSkin = cgs.media.larmourLegsSkin; + else + legs.customSkin = ci->legsSkin; } else { @@ -2085,24 +2077,16 @@ void CG_Player( centity_t *cent ) // // add the torso // - if( held & ( 1 << UP_BATTLESUIT ) ) - { - torso.hModel = cgs.amedia.bsuitTorsoModel; - torso.customSkin = cgs.amedia.bsuitTorsoSkin; - } + torso.hModel = ci->torsoModel; + + if( ( held & ( 1 << UP_LIMBARMOUR ) ) && ( held & ( 1 << UP_CHESTARMOUR ) ) ) + torso.customSkin = cgs.media.clarmourTorsoSkin; + else if( held & ( 1 << UP_CHESTARMOUR ) ) + torso.customSkin = cgs.media.carmourTorsoSkin; + else if( held & ( 1 << UP_LIMBARMOUR ) ) + torso.customSkin = cgs.media.larmourTorsoSkin; else - { - torso.hModel = ci->torsoModel; - - if( ( held & ( 1 << UP_LIMBARMOUR ) ) && ( held & ( 1 << UP_CHESTARMOUR ) ) ) - torso.customSkin = cgs.amedia.clarmourTorsoSkin; - if( held & ( 1 << UP_CHESTARMOUR ) ) - torso.customSkin = cgs.amedia.carmourTorsoSkin; - if( held & ( 1 << UP_LIMBARMOUR ) ) - torso.customSkin = cgs.amedia.larmourLegsSkin; - else - torso.customSkin = ci->torsoSkin; - } + torso.customSkin = ci->torsoSkin; if( !torso.hModel ) return; @@ -2121,8 +2105,8 @@ void CG_Player( centity_t *cent ) // if( held & ( 1 << UP_HELMET ) ) { - head.hModel = cgs.amedia.helmetModel; - head.customSkin = cgs.amedia.helmetSkin; + head.hModel = cgs.media.helmetModel; + head.customSkin = cgs.media.helmetSkin; } else { |