From d94d52e70af291daee2ad200b2fbeec1289106dc Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 9 Feb 2003 04:51:02 +0000 Subject: * Started construction of a new model format, similar to Q2's --- src/cgame/cg_local.h | 1 + src/cgame/cg_players.c | 229 +++++++++++++++++++++++++++++++------------------ src/game/bg_public.h | 44 ++++++++++ 3 files changed, 192 insertions(+), 82 deletions(-) (limited to 'src') diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 702af342..81a0908a 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -385,6 +385,7 @@ typedef struct qboolean newAnims; // true if using the new mission pack animations qboolean fixedlegs; // true if legs yaw is always the same as torso yaw qboolean fixedtorso; // true if torso never changes yaw + qboolean nonsegmented; // true if model is Q2 style nonsegmented vec3_t headOffset; // move head in icon views footstep_t footsteps; diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index b8ca0d26..5384a44e 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -190,6 +190,11 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci ) ci->fixedtorso = qtrue; continue; } + else if( !Q_stricmp( token, "nonsegmented" ) ) + { + ci->nonsegmented = qtrue; + continue; + } // if it is a number, start parsing animations if( token[ 0 ] >= '0' && token[ 0 ] <= '9' ) @@ -201,104 +206,164 @@ static qboolean CG_ParseAnimationFile( const char *filename, clientInfo_t *ci ) Com_Printf( "unknown token '%s' is %s\n", token, filename ); } - // read information for each frame - for( i = 0; i < MAX_PLAYER_ANIMATIONS; i++ ) + if( !ci->nonsegmented ) { - token = COM_Parse( &text_p ); - - if( !*token ) + // read information for each frame + for( i = 0; i < MAX_PLAYER_ANIMATIONS; i++ ) { - if( i >= TORSO_GETFLAG && i <= TORSO_NEGATIVE ) + token = COM_Parse( &text_p ); + + if( !*token ) { - animations[ i ].firstFrame = animations[ TORSO_GESTURE ].firstFrame; - animations[ i ].frameLerp = animations[ TORSO_GESTURE ].frameLerp; - animations[ i ].initialLerp = animations[ TORSO_GESTURE ].initialLerp; - animations[ i ].loopFrames = animations[ TORSO_GESTURE ].loopFrames; - animations[ i ].numFrames = animations[ TORSO_GESTURE ].numFrames; - animations[ i ].reversed = qfalse; - animations[ i ].flipflop = qfalse; - continue; + if( i >= TORSO_GETFLAG && i <= TORSO_NEGATIVE ) + { + animations[ i ].firstFrame = animations[ TORSO_GESTURE ].firstFrame; + animations[ i ].frameLerp = animations[ TORSO_GESTURE ].frameLerp; + animations[ i ].initialLerp = animations[ TORSO_GESTURE ].initialLerp; + animations[ i ].loopFrames = animations[ TORSO_GESTURE ].loopFrames; + animations[ i ].numFrames = animations[ TORSO_GESTURE ].numFrames; + animations[ i ].reversed = qfalse; + animations[ i ].flipflop = qfalse; + continue; + } + + break; } - break; - } - - animations[ i ].firstFrame = atoi( token ); - - // leg only frames are adjusted to not count the upper body only frames - if( i == LEGS_WALKCR ) - skip = animations[ LEGS_WALKCR ].firstFrame - animations[ TORSO_GESTURE ].firstFrame; + animations[ i ].firstFrame = atoi( token ); + + // leg only frames are adjusted to not count the upper body only frames + if( i == LEGS_WALKCR ) + skip = animations[ LEGS_WALKCR ].firstFrame - animations[ TORSO_GESTURE ].firstFrame; - if( i >= LEGS_WALKCR && i= LEGS_WALKCR && i