summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-02-11 01:39:31 +0000
committerTim Angus <tim@ngus.net>2003-02-11 01:39:31 +0000
commit64d793805923e8a1a20b6d7a305ace38e5719c86 (patch)
treef83e2a82d956f710a9c860c4603f3719e758326d /src
parent7fb2163f6ae14777a69de60ce8eb89e6a8dbbdc2 (diff)
* Death animations now play correctly for nonsegmented models
* Nonesgmented corpses now render properly
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_players.c83
-rw-r--r--src/game/bg_misc.c2
-rw-r--r--src/game/g_client.c53
-rw-r--r--src/game/g_combat.c49
-rw-r--r--src/game/g_local.h2
5 files changed, 130 insertions, 59 deletions
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index a1135bd0..2ab59e1f 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -2223,13 +2223,17 @@ void CG_Corpse( centity_t *cent )
origin[ 2 ] -= ( liveZ[ 2 ] - deadZ[ 2 ] );
VectorCopy( cent->currentState.angles, cent->lerpAngles );
+
// get the rotation information
- CG_PlayerAngles( cent, cent->lerpAngles, legs.axis, torso.axis, head.axis );
+ if( !ci->nonsegmented )
+ CG_PlayerAngles( cent, cent->lerpAngles, legs.axis, torso.axis, head.axis );
+ else
+ CG_PlayerNonSegAngles( cent, cent->lerpAngles, legs.axis );
//set the correct frame (should always be dead)
if( cg_noPlayerAnims.integer )
legs.oldframe = legs.frame = torso.oldframe = torso.frame = 0;
- else
+ else if( !ci->nonsegmented )
{
CG_RunLerpFrame( ci, &cent->pe.legs, cent->currentState.legsAnim, 1 );
legs.oldframe = cent->pe.legs.oldFrame;
@@ -2241,7 +2245,13 @@ void CG_Corpse( centity_t *cent )
torso.frame = cent->pe.torso.frame;
torso.backlerp = cent->pe.torso.backlerp;
}
-
+ else
+ {
+ CG_RunLerpFrame( ci, &cent->pe.nonseg, cent->currentState.legsAnim, 1 );
+ legs.oldframe = cent->pe.nonseg.oldFrame;
+ legs.frame = cent->pe.nonseg.frame;
+ legs.backlerp = cent->pe.nonseg.backlerp;
+ }
// add the shadow
shadow = CG_PlayerShadow( cent, &shadowPlane );
@@ -2257,8 +2267,16 @@ void CG_Corpse( centity_t *cent )
//
// add the legs
//
- legs.hModel = ci->legsModel;
- legs.customSkin = ci->legsSkin;
+ if( !ci->nonsegmented )
+ {
+ legs.hModel = ci->legsModel;
+ legs.customSkin = ci->legsSkin;
+ }
+ else
+ {
+ legs.hModel = ci->nonSegModel;
+ legs.customSkin = ci->nonSegSkin;
+ }
VectorCopy( origin, legs.origin );
@@ -2286,43 +2304,46 @@ void CG_Corpse( centity_t *cent )
if( !legs.hModel )
return;
- //
- // add the torso
- //
- torso.hModel = ci->torsoModel;
- if( !torso.hModel )
- return;
+ if( !ci->nonsegmented )
+ {
+ //
+ // add the torso
+ //
+ torso.hModel = ci->torsoModel;
+ if( !torso.hModel )
+ return;
- torso.customSkin = ci->torsoSkin;
+ torso.customSkin = ci->torsoSkin;
- VectorCopy( origin, torso.lightingOrigin );
+ VectorCopy( origin, torso.lightingOrigin );
- CG_PositionRotatedEntityOnTag( &torso, &legs, ci->legsModel, "tag_torso" );
+ CG_PositionRotatedEntityOnTag( &torso, &legs, ci->legsModel, "tag_torso" );
- torso.shadowPlane = shadowPlane;
- torso.renderfx = renderfx;
+ torso.shadowPlane = shadowPlane;
+ torso.renderfx = renderfx;
- //CG_AddRefEntityWithPowerups( &torso, cent->currentState.powerups, ci->team );
- trap_R_AddRefEntityToScene( &torso );
+ //CG_AddRefEntityWithPowerups( &torso, cent->currentState.powerups, ci->team );
+ trap_R_AddRefEntityToScene( &torso );
- //
- // add the head
- //
- head.hModel = ci->headModel;
- if( !head.hModel )
- return;
+ //
+ // add the head
+ //
+ head.hModel = ci->headModel;
+ if( !head.hModel )
+ return;
- head.customSkin = ci->headSkin;
+ head.customSkin = ci->headSkin;
- VectorCopy( origin, head.lightingOrigin );
+ VectorCopy( origin, head.lightingOrigin );
- CG_PositionRotatedEntityOnTag( &head, &torso, ci->torsoModel, "tag_head");
+ CG_PositionRotatedEntityOnTag( &head, &torso, ci->torsoModel, "tag_head");
- head.shadowPlane = shadowPlane;
- head.renderfx = renderfx;
+ head.shadowPlane = shadowPlane;
+ head.renderfx = renderfx;
- //CG_AddRefEntityWithPowerups( &head, cent->currentState.powerups, ci->team );
- trap_R_AddRefEntityToScene( &head );
+ //CG_AddRefEntityWithPowerups( &head, cent->currentState.powerups, ci->team );
+ trap_R_AddRefEntityToScene( &head );
+ }
if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS )
{
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 68b6b9da..893f2f2d 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -1462,7 +1462,7 @@ classAttributes_t bg_classList[ ] =
"chimera", //char *classname;
"Chimera", //char *humanname;
"prowl", //char *modelname;
- 1.0f, //float modelScale;
+ 0.75f, //float modelScale;
"default", //char *skinname;
"alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 224c4bca..edd2ebed 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -709,6 +709,7 @@ void SpawnCorpse( gentity_t *ent )
body->r.contents = CONTENTS_CORPSE;
body->clipmask = CONTENTS_SOLID | CONTENTS_PLAYERCLIP;
body->s.clientNum = ent->client->ps.stats[ STAT_PCLASS ];
+ body->nonSegModel = ent->client->ps.persistant[ PERS_STATE ] & PS_NONSEGMODEL;
if( ent->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS )
{
@@ -746,21 +747,45 @@ void SpawnCorpse( gentity_t *ent )
}
body->s.legsAnim = ent->s.legsAnim;
- switch( body->s.legsAnim & ~ANIM_TOGGLEBIT )
+
+ if( !body->nonSegModel )
{
- case BOTH_DEATH1:
- case BOTH_DEAD1:
- body->s.torsoAnim = body->s.legsAnim = BOTH_DEAD1;
- break;
- case BOTH_DEATH2:
- case BOTH_DEAD2:
- body->s.torsoAnim = body->s.legsAnim = BOTH_DEAD2;
- break;
- case BOTH_DEATH3:
- case BOTH_DEAD3:
- default:
- body->s.torsoAnim = body->s.legsAnim = BOTH_DEAD3;
- break;
+ switch( body->s.legsAnim & ~ANIM_TOGGLEBIT )
+ {
+ case BOTH_DEATH1:
+ case BOTH_DEAD1:
+ body->s.torsoAnim = body->s.legsAnim = BOTH_DEAD1;
+ break;
+ case BOTH_DEATH2:
+ case BOTH_DEAD2:
+ body->s.torsoAnim = body->s.legsAnim = BOTH_DEAD2;
+ break;
+ case BOTH_DEATH3:
+ case BOTH_DEAD3:
+ default:
+ body->s.torsoAnim = body->s.legsAnim = BOTH_DEAD3;
+ break;
+ }
+ }
+ else
+ {
+ G_Printf( "nonsegmented death\n" );
+ switch( body->s.legsAnim & ~ANIM_TOGGLEBIT )
+ {
+ case NSPA_DEATH1:
+ case NSPA_DEAD1:
+ body->s.legsAnim = NSPA_DEAD1;
+ break;
+ case NSPA_DEATH2:
+ case NSPA_DEAD2:
+ body->s.legsAnim = NSPA_DEAD2;
+ break;
+ case NSPA_DEATH3:
+ case NSPA_DEAD3:
+ default:
+ body->s.legsAnim = NSPA_DEAD3;
+ break;
+ }
}
body->takedamage = qfalse;
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index a394d29f..391c09b6 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -312,18 +312,37 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
// normal death
static int i;
- switch( i )
+ if( !( self->client->ps.persistant[ PERS_STATE ] & PS_NONSEGMODEL ) )
{
- case 0:
- anim = BOTH_DEATH1;
- break;
- case 1:
- anim = BOTH_DEATH2;
- break;
- case 2:
- default:
- anim = BOTH_DEATH3;
- break;
+ switch( i )
+ {
+ case 0:
+ anim = BOTH_DEATH1;
+ break;
+ case 1:
+ anim = BOTH_DEATH2;
+ break;
+ case 2:
+ default:
+ anim = BOTH_DEATH3;
+ break;
+ }
+ }
+ else
+ {
+ switch( i )
+ {
+ case 0:
+ anim = NSPA_DEATH1;
+ break;
+ case 1:
+ anim = NSPA_DEATH2;
+ break;
+ case 2:
+ default:
+ anim = NSPA_DEATH3;
+ break;
+ }
}
// for the no-blood option, we need to prevent the health
@@ -333,8 +352,12 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
self->client->ps.legsAnim =
( ( self->client->ps.legsAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
- self->client->ps.torsoAnim =
- ( ( self->client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
+
+ if( !( self->client->ps.persistant[ PERS_STATE ] & PS_NONSEGMODEL ) )
+ {
+ self->client->ps.torsoAnim =
+ ( ( self->client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
+ }
G_AddEvent( self, EV_DEATH1 + i, killer );
diff --git a/src/game/g_local.h b/src/game/g_local.h
index ed67b3ee..7a6c5521 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -191,6 +191,8 @@ struct gentity_s
vec3_t turretAim; //TA: aim vector for turrets
gentity_t *builder; //TA: occupant of this hovel
+
+ qboolean nonSegModel; //TA: this entity uses a nonsegmented player model
};
typedef enum