summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_local.h2
-rw-r--r--src/cgame/cg_main.c6
-rw-r--r--src/cgame/cg_view.c27
3 files changed, 30 insertions, 5 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 143403e1..101aa8ed 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1004,7 +1004,9 @@ typedef struct
// development tool
refEntity_t testModelEntity;
+ refEntity_t testModelBarrelEntity;
char testModelName[MAX_QPATH];
+ char testModelBarrelName[MAX_QPATH];
qboolean testGun;
int spawnTime; //TA: fovwarp
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 839e6b17..2510fc17 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -1492,6 +1492,9 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha
else if( feederID == FEEDER_HUMANTEAM_LIST )
team = PTE_HUMANS;
+ info = CG_InfoFromScoreIndex( index, team, &scoreIndex );
+ sp = &cg.scores[ scoreIndex ];
+
if( ( atoi( CG_ConfigString( CS_CLIENTS_READY ) ) & ( 1 << sp->client ) ) &&
cg.intermissionStarted )
showIcons = qfalse;
@@ -1499,9 +1502,6 @@ static const char *CG_FeederItemText( float feederID, int index, int column, qha
team == cg.snap->ps.stats[ STAT_PTEAM ] || cg.intermissionStarted )
showIcons = qtrue;
- info = CG_InfoFromScoreIndex( index, team, &scoreIndex );
- sp = &cg.scores[ scoreIndex ];
-
if( info && info->infoValid )
{
switch( column )
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 12772a3d..454582db 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -67,12 +67,18 @@ void CG_TestModel_f( void )
vec3_t angles;
memset( &cg.testModelEntity, 0, sizeof( cg.testModelEntity ) );
+ memset( &cg.testModelBarrelEntity, 0, sizeof( cg.testModelBarrelEntity ) );
if( trap_Argc( ) < 2 )
return;
Q_strncpyz( cg.testModelName, CG_Argv( 1 ), MAX_QPATH );
cg.testModelEntity.hModel = trap_R_RegisterModel( cg.testModelName );
+
+ Q_strncpyz( cg.testModelBarrelName, CG_Argv( 1 ), MAX_QPATH );
+ cg.testModelBarrelName[ strlen( cg.testModelBarrelName ) - 4 ] = '\0';
+ Q_strcat( cg.testModelBarrelName, MAX_QPATH, "_barrel.md3" );
+ cg.testModelBarrelEntity.hModel = trap_R_RegisterModel( cg.testModelBarrelName );
if( trap_Argc( ) == 3 )
{
@@ -95,6 +101,14 @@ void CG_TestModel_f( void )
AnglesToAxis( angles, cg.testModelEntity.axis );
cg.testGun = qfalse;
+
+ if( cg.testModelBarrelEntity.hModel )
+ {
+ angles[ YAW ] = 0;
+ angles[ PITCH ] = 0;
+ angles[ ROLL ] = 0;
+ AnglesToAxis( angles, cg.testModelBarrelEntity.axis );
+ }
}
/*
@@ -150,10 +164,11 @@ static void CG_AddTestModel( void )
// re-register the model, because the level may have changed
cg.testModelEntity.hModel = trap_R_RegisterModel( cg.testModelName );
+ cg.testModelBarrelEntity.hModel = trap_R_RegisterModel( cg.testModelBarrelName );
- if( ! cg.testModelEntity.hModel )
+ if( !cg.testModelEntity.hModel )
{
- CG_Printf ("Can't register model\n");
+ CG_Printf( "Can't register model\n" );
return;
}
@@ -175,6 +190,14 @@ static void CG_AddTestModel( void )
}
trap_R_AddRefEntityToScene( &cg.testModelEntity );
+
+ if( cg.testModelBarrelEntity.hModel )
+ {
+ CG_PositionEntityOnTag( &cg.testModelBarrelEntity, &cg.testModelEntity,
+ cg.testModelEntity.hModel, "tag_barrel" );
+
+ trap_R_AddRefEntityToScene( &cg.testModelBarrelEntity );
+ }
}