MCPcopy Create free account
hub / github.com/JACoders/OpenJK / G_LoadAnimFileSet

Function G_LoadAnimFileSet

codeJK2/game/NPC_stats.cpp:517–553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515}
516
517void G_LoadAnimFileSet( gentity_t *ent, const char *modelName )
518{
519//load its animation config
520 char animName[MAX_QPATH];
521 char *GLAName;
522 char *slash = NULL;
523 char *strippedName;
524
525 if ( ent->playerModel == -1 )
526 {
527 return;
528 }
529 //get the location of the animation.cfg
530 GLAName = gi.G2API_GetGLAName( &ent->ghoul2[ent->playerModel] );
531 //now load and parse the animation.cfg, animsounds.cfg and set the animFileIndex
532 if ( !GLAName)
533 {
534 Com_Printf( S_COLOR_RED"Failed find animation file name models/players/%s/animation.cfg\n", modelName );
535 strippedName="broken";
536 }
537 else
538 {
539 Q_strncpyz(animName, GLAName, sizeof( animName ));
540 slash = strrchr( animName, '/' );
541 if ( slash )
542 {
543 *slash = 0;
544 }
545 strippedName = COM_SkipPath( animName );
546 }
547
548 //now load and parse the animation.cfg, animsounds.cfg and set the animFileIndex
549 if ( !G_ParseAnimFileSet( modelName, strippedName, &ent->client->clientInfo.animFileIndex ) )
550 {
551 Com_Printf( S_COLOR_RED"Failed to load animation file set models/players/%s/animation.cfg\n", modelName );
552 }
553}
554
555
556void NPC_PrecacheAnimationCFG( const char *NPC_type )

Callers 2

G_SetG2PlayerModelInfoFunction · 0.70
ClientSpawnFunction · 0.70

Calls 4

Q_strncpyzFunction · 0.85
Com_PrintfFunction · 0.70
G_ParseAnimFileSetFunction · 0.70
COM_SkipPathFunction · 0.50

Tested by

no test coverage detected