mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-23 13:24:13 +00: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 <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "xash3d_mathlib.h"
|
||||||
#include "eiface.h"
|
#include "eiface.h"
|
||||||
#include "studio.h"
|
#include "studio.h"
|
||||||
#include "crtlib.h"
|
#include "crtlib.h"
|
||||||
@ -435,6 +436,29 @@ static void WriteHitBoxInfo( FILE *fp )
|
|||||||
fputs( "\n", 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
|
WriteSequenceInfo
|
||||||
@ -449,7 +473,7 @@ static void WriteSequenceInfo( FILE *fp )
|
|||||||
mstudioseqdesc_t *seqdesc;
|
mstudioseqdesc_t *seqdesc;
|
||||||
|
|
||||||
if( model_hdr->numseqgroups > 1 )
|
if( model_hdr->numseqgroups > 1 )
|
||||||
fputs( "$sequencegroupsize 64\n\n", fp );
|
fprintf( fp, "$sequencegroupsize %d\n\n", CalcSequenceGroupSize( ) );
|
||||||
|
|
||||||
if( model_hdr->numseq > 0 )
|
if( model_hdr->numseq > 0 )
|
||||||
fprintf( fp, "// %i animation sequence(s)\n", model_hdr->numseq );
|
fprintf( fp, "// %i animation sequence(s)\n", model_hdr->numseq );
|
||||||
|
@ -16,6 +16,7 @@ GNU General Public License for more details.
|
|||||||
#ifndef QC_H
|
#ifndef QC_H
|
||||||
#define QC_H
|
#define QC_H
|
||||||
|
|
||||||
|
#define DEFAULT_SEQGROUPSIZE 64
|
||||||
#define ACTIVITIES_FILE "activities.txt"
|
#define ACTIVITIES_FILE "activities.txt"
|
||||||
|
|
||||||
qboolean LoadActivityList( const char *appname );
|
qboolean LoadActivityList( const char *appname );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user