mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-12-27 11:16:43 +01:00
utils: mdldec: qc.c: calculate sequence group size.
This commit is contained in:
parent
64c5d141af
commit
487a652aa8
@ -15,6 +15,7 @@ GNU General Public License for more details.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "xash3d_mathlib.h"
|
||||
#include "eiface.h"
|
||||
#include "studio.h"
|
||||
#include "crtlib.h"
|
||||
@ -435,6 +436,29 @@ static void WriteHitBoxInfo( FILE *fp )
|
||||
fputs( "\n", fp );
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
CalcSequenceGroupSize
|
||||
============
|
||||
*/
|
||||
static int CalcSequenceGroupSize( void )
|
||||
{
|
||||
int i, maxsize = 0, groupsize = DEFAULT_SEQGROUPSIZE;
|
||||
|
||||
for( i = 1; i < model_hdr->numseqgroups; i++ )
|
||||
maxsize = Q_max( anim_hdr[i]->length, maxsize );
|
||||
|
||||
if( maxsize > 0 )
|
||||
{
|
||||
groupsize = maxsize / 1024;
|
||||
|
||||
if( maxsize % 1024 )
|
||||
groupsize++;
|
||||
}
|
||||
|
||||
return groupsize;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
WriteSequenceInfo
|
||||
@ -449,7 +473,7 @@ static void WriteSequenceInfo( FILE *fp )
|
||||
mstudioseqdesc_t *seqdesc;
|
||||
|
||||
if( model_hdr->numseqgroups > 1 )
|
||||
fputs( "$sequencegroupsize 64\n\n", fp );
|
||||
fprintf( fp, "$sequencegroupsize %d\n\n", CalcSequenceGroupSize( ) );
|
||||
|
||||
if( model_hdr->numseq > 0 )
|
||||
fprintf( fp, "// %i animation sequence(s)\n", model_hdr->numseq );
|
||||
|
@ -16,6 +16,7 @@ GNU General Public License for more details.
|
||||
#ifndef QC_H
|
||||
#define QC_H
|
||||
|
||||
#define DEFAULT_SEQGROUPSIZE 64
|
||||
#define ACTIVITIES_FILE "activities.txt"
|
||||
|
||||
qboolean LoadActivityList( const char *appname );
|
||||
|
Loading…
Reference in New Issue
Block a user