xash3d-fwgs/utils/mdldec/qc.c

637 lines
15 KiB
C
Raw Permalink Normal View History

2020-03-04 05:08:14 +01:00
/*
qc.c - Quake C script writer
Copyright (C) 2020 Andrey Akhmichin
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include <stdlib.h>
#include <string.h>
#include "xash3d_mathlib.h"
2020-03-04 05:08:14 +01:00
#include "eiface.h"
#include "studio.h"
#include "crtlib.h"
#include "version.h"
#include "mdldec.h"
#include "utils.h"
#include "smd.h"
#include "texture.h"
2020-03-04 05:08:14 +01:00
#include "qc.h"
static char **activity_names;
static int activity_count;
/*
============
LoadActivityList
============
*/
qboolean LoadActivityList( const char *appname )
{
FILE *fp;
const char *p;
char path[MAX_SYSPATH];
char buf[256];
fp = fopen( ACTIVITIES_FILE, "r" );
if( !fp )
{
p = getenv( "MDLDEC_ACT_PATH" );
if( !p )
{
fprintf( stderr, "ERROR: Couldn't find file " ACTIVITIES_FILE ".\n" \
"Place " ACTIVITIES_FILE " beside %s or set MDLDEC_ACT_PATH environment variable.\n", appname );
return false;
}
Q_strncpy( path, p, MAX_SYSPATH - 1 );
COM_PathSlashFix( path );
Q_strncat( path, ACTIVITIES_FILE, MAX_SYSPATH );
fp = fopen( path, "r" );
if( !fp )
{
fputs( "ERROR: Couldn't open file " ACTIVITIES_FILE ".\n", stderr );
2020-03-04 05:08:14 +01:00
return false;
}
}
while( fgets( buf, sizeof( buf ), fp ) )
{
activity_names = realloc( activity_names, sizeof( char* ) * ++activity_count );
if( !activity_names )
{
fputs( "ERROR: Couldn't allocate memory for activities strings.\n", stderr );
return false;
}
COM_RemoveLineFeed( buf );
activity_names[activity_count - 1] = strdup( buf );
if( !activity_names[activity_count - 1] )
{
fputs( "ERROR: Couldn't allocate memory for activities strings.\n", stderr );
return false;
}
}
fclose( fp );
return true;
}
/*
============
FindActivityName
============
*/
static const char *FindActivityName( int type )
{
if( type >= 0 && type < activity_count )
return activity_names[type];
return NULL;
}
/*
============
GetMotionTypeString
============
*/
static void GetMotionTypeString( int type, char *str, size_t size, qboolean is_composite )
2020-03-04 05:08:14 +01:00
{
const char *p = NULL;
str[0] = '\0';
if( is_composite )
{
if( type & STUDIO_X )
Q_strncat( str, " X", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_Y )
Q_strncat( str, " Y", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_Z )
Q_strncat( str, " Z", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_XR )
Q_strncat( str, " XR", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_YR )
Q_strncat( str, " YR", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_ZR )
Q_strncat( str, " ZR", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_LX )
Q_strncat( str, " LX", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_LY )
Q_strncat( str, " LY", size );
2020-03-04 05:08:14 +01:00
if( type & STUDIO_LZ )
Q_strncat( str, " LZ", size );
2020-03-04 05:08:14 +01:00
2020-11-28 01:34:15 +01:00
if( type & STUDIO_LXR )
Q_strncat( str, " LXR", size );
2020-03-04 05:08:14 +01:00
2020-11-28 01:34:15 +01:00
if( type & STUDIO_LYR )
Q_strncat( str, " LYR", size );
2020-03-04 05:08:14 +01:00
2020-11-28 01:34:15 +01:00
if( type & STUDIO_LZR )
Q_strncat( str, " LZR", size );
2020-03-04 05:08:14 +01:00
2020-11-28 01:34:15 +01:00
if( type & STUDIO_LINEAR )
Q_strncat( str, " LM", size );
2020-03-04 05:08:14 +01:00
2020-11-28 01:34:15 +01:00
if( type & STUDIO_QUADRATIC_MOTION )
Q_strncat( str, " LQ", size );
2020-03-04 05:08:14 +01:00
return;
}
type &= STUDIO_TYPES;
switch( type )
{
2020-11-28 01:34:15 +01:00
case STUDIO_X: p = "X"; break;
case STUDIO_Y: p = "Y"; break;
case STUDIO_Z: p = "Z"; break;
case STUDIO_XR: p = "XR"; break;
case STUDIO_YR: p = "YR"; break;
case STUDIO_ZR: p = "ZR"; break;
case STUDIO_LX: p = "LX"; break;
case STUDIO_LY: p = "LY"; break;
case STUDIO_LZ: p = "LZ"; break;
case STUDIO_LXR: p = "LXR"; break;
case STUDIO_LYR: p = "LYR"; break;
case STUDIO_LZR: p = "LZR"; break;
case STUDIO_LINEAR: p = "LM"; break;
case STUDIO_QUADRATIC_MOTION: p = "LQ"; break;
2020-03-04 05:08:14 +01:00
default: break;
}
if( p )
Q_strncpy( str, p, size );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteTextureRenderMode
============
*/
static void WriteTextureRenderMode( FILE *fp )
{
int i;
mstudiotexture_t *texture;
2023-10-14 20:51:19 +02:00
long pos = ftell( fp );
2020-03-04 05:08:14 +01:00
for( i = 0; i < texture_hdr->numtextures; i++ )
{
texture = (mstudiotexture_t *)( (byte *)texture_hdr + texture_hdr->textureindex ) + i;
if( texture->flags & STUDIO_NF_FLATSHADE )
fprintf( fp,"$texrendermode \"%s\" \"flatshade\" \n", texture->name ); // sven-coop extension
if( texture->flags & STUDIO_NF_CHROME )
fprintf( fp, "$texrendermode \"%s\" \"chrome\" \n", texture->name ); // sven-coop extension/may be added in HLMV
if( texture->flags & STUDIO_NF_FULLBRIGHT )
fprintf( fp, "$texrendermode \"%s\" \"fullbright\" \n", texture->name ); // sven-coop extension/xash3d extension
if( texture->flags & STUDIO_NF_NOMIPS )
fprintf( fp, "$texrendermode \"%s\" \"nomips\" \n", texture->name ); // sven-coop extension
2020-11-28 01:34:15 +01:00
if( texture->flags & STUDIO_NF_SMOOTH )
2020-03-04 05:08:14 +01:00
{
fprintf( fp, "$texrendermode \"%s\" \"alpha\" \n", texture->name ); // sven-coop extension
fprintf( fp, "$texrendermode \"%s\" \"smooth\" \n", texture->name ); // xash3d extension
2020-03-04 05:08:14 +01:00
}
if( texture->flags & STUDIO_NF_ADDITIVE )
fprintf( fp, "$texrendermode \"%s\" \"additive\" \n", texture->name );
if( texture->flags & STUDIO_NF_MASKED )
{
if( texture->flags & STUDIO_NF_ALPHASOLID )
fprintf( fp, "$texrendermode \"%s\" \"masked_solid\" \n", texture->name ); // xash3d extension
else
fprintf( fp, "$texrendermode \"%s\" \"masked\" \n", texture->name );
}
2020-03-04 05:08:14 +01:00
if( texture->flags & STUDIO_NF_TWOSIDE )
fprintf( fp, "$texrendermode \"%s\" \"twoside\" \n", texture->name );
}
2023-10-14 20:51:19 +02:00
if( ftell( fp ) != pos )
fputs( "\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteSkinFamilyInfo
============
*/
static void WriteSkinFamilyInfo( FILE *fp )
{
int i, j, k;
2023-10-19 08:20:36 +02:00
short *skinref, *index;
2020-03-04 05:08:14 +01:00
mstudiotexture_t *texture;
if( texture_hdr->numskinfamilies < 2 )
return;
2023-10-14 20:51:19 +02:00
fprintf( fp, "// %i skin families\n", texture_hdr->numskinfamilies );
2020-03-04 05:08:14 +01:00
fputs( "$texturegroup \"skinfamilies\"\n{\n", fp );
2020-03-04 05:08:14 +01:00
skinref = (short *)( (byte *)texture_hdr + texture_hdr->skinindex );
2023-10-19 08:20:36 +02:00
texture = (mstudiotexture_t *)( (byte *)texture_hdr + texture_hdr->textureindex );
2020-03-04 05:08:14 +01:00
for( i = 0; i < texture_hdr->numskinfamilies; ++i )
{
fputs( "\t{\n", fp );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
index = skinref + i * texture_hdr->numskinref;
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( j = 0; j < texture_hdr->numskinref; ++j, ++index )
{
2020-03-04 05:08:14 +01:00
for( k = 0; k < texture_hdr->numskinfamilies; ++k )
{
2023-10-19 08:20:36 +02:00
if( *index == *( skinref + k * texture_hdr->numskinref + j ) )
2020-03-04 05:08:14 +01:00
continue;
2023-10-19 08:20:36 +02:00
fprintf( fp, "\t\t\"%s\"\n", texture[*index].name );
2020-03-04 05:08:14 +01:00
break;
}
}
fputs( "\t}\n", fp );
2020-03-04 05:08:14 +01:00
}
2023-10-14 20:51:19 +02:00
fputs( "}\n\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteAttachmentInfo
============
*/
static void WriteAttachmentInfo( FILE *fp )
{
int i;
mstudioattachment_t *attachment;
mstudiobone_t *bone;
if( !model_hdr->numattachments )
return;
2023-10-19 08:20:36 +02:00
attachment = (mstudioattachment_t *)( (byte *)model_hdr + model_hdr->attachmentindex );
bone = (mstudiobone_t *)( (byte *)model_hdr + model_hdr->boneindex );
fprintf( fp, "// %i attachment%s\n", model_hdr->numattachments, model_hdr->numattachments > 1 ? "s" : "" );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( i = 0; i < model_hdr->numattachments; ++i, ++attachment )
fprintf( fp, "$attachment %i \"%s\" %f %f %f\n", i, bone[attachment->bone].name, attachment->org[0], attachment->org[1], attachment->org[2] );
2023-10-14 20:51:19 +02:00
fputs( "\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteBodyGroupInfo
============
*/
static void WriteBodyGroupInfo( FILE *fp )
{
int i, j;
2023-10-19 08:20:36 +02:00
mstudiobodyparts_t *bodypart = (mstudiobodyparts_t *) ( (byte *)model_hdr + model_hdr->bodypartindex );
2020-03-04 05:08:14 +01:00
mstudiomodel_t *model;
fprintf( fp, "// %i reference mesh%s\n", model_hdr->numbodyparts, model_hdr->numbodyparts > 1 ? "es" : "" );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( i = 0; i < model_hdr->numbodyparts; ++i, ++bodypart )
2020-03-04 05:08:14 +01:00
{
2023-10-19 08:20:36 +02:00
model = (mstudiomodel_t *)( (byte *)model_hdr + bodypart->modelindex );
2020-03-04 05:08:14 +01:00
if( bodypart->nummodels == 1 )
{
fprintf( fp, "$body \"%s\" \"%s\"\n", bodypart->name, model->name );
2020-03-04 05:08:14 +01:00
continue;
}
fprintf( fp, "$bodygroup \"%s\"\n", bodypart->name );
fputs( "{\n", fp );
2023-10-19 08:20:36 +02:00
for( j = 0; j < bodypart->nummodels; ++j, ++model )
2020-03-04 05:08:14 +01:00
{
if( !Q_strncmp( model->name, "blank", 5 ) )
{
fputs( "\tblank\n", fp );
2020-03-04 05:08:14 +01:00
continue;
}
fprintf( fp, "\tstudio \"%s\"\n", model->name );
2020-03-04 05:08:14 +01:00
}
2023-10-14 20:51:19 +02:00
fputs( "}\n", fp );
2020-03-04 05:08:14 +01:00
}
2023-10-14 20:51:19 +02:00
fputs( "\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteControllerInfo
============
*/
static void WriteControllerInfo( FILE *fp )
{
int i;
mstudiobonecontroller_t *bonecontroller;
mstudiobone_t *bone;
char motion_types[64];
if( !model_hdr->numbonecontrollers )
return;
2023-10-19 08:20:36 +02:00
bonecontroller = (mstudiobonecontroller_t *)( (byte *)model_hdr + model_hdr->bonecontrollerindex );
bone = (mstudiobone_t *)( (byte *)model_hdr + model_hdr->boneindex );
fprintf( fp, "// %i bone controller%s\n", model_hdr->numbonecontrollers, model_hdr->numbonecontrollers > 1 ? "s" : "" );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( i = 0; i < model_hdr->numbonecontrollers; ++i, ++bonecontroller )
2020-03-04 05:08:14 +01:00
{
GetMotionTypeString( bonecontroller->type & ~STUDIO_RLOOP, motion_types, sizeof( motion_types ), false );
2020-03-04 05:08:14 +01:00
fputs( "$controller ", fp );
if( bonecontroller->index == 4 )
fputs( "Mouth", fp );
else
fprintf( fp, "%i", bonecontroller->index );
fprintf( fp, " \"%s\" %s %f %f\n",
2023-10-19 08:20:36 +02:00
bone[bonecontroller->bone].name, motion_types,
2020-03-04 05:08:14 +01:00
bonecontroller->start, bonecontroller->end );
}
2023-10-14 20:51:19 +02:00
fputs( "\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteHitBoxInfo
============
*/
static void WriteHitBoxInfo( FILE *fp )
{
int i;
mstudiobbox_t *hitbox;
mstudiobone_t *bone;
if( !model_hdr->numhitboxes )
return;
2023-10-19 08:20:36 +02:00
hitbox = (mstudiobbox_t *)( (byte *)model_hdr + model_hdr->hitboxindex );
bone = (mstudiobone_t *)( (byte *)model_hdr + model_hdr->boneindex );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
fprintf( fp, "// %i hit box%s\n", model_hdr->numhitboxes, model_hdr->numhitboxes > 1 ? "es" : "" );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( i = 0; i < model_hdr->numhitboxes; ++i, ++hitbox )
2020-03-04 05:08:14 +01:00
fprintf( fp, "$hbox %i \"%s\" %f %f %f %f %f %f\n",
2023-10-19 08:20:36 +02:00
hitbox->group, bone[hitbox->bone].name,
2020-03-04 05:08:14 +01:00
hitbox->bbmin[0], hitbox->bbmin[1], hitbox->bbmin[2],
hitbox->bbmax[0], hitbox->bbmax[1], hitbox->bbmax[2] );
2023-10-14 20:51:19 +02:00
fputs( "\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
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;
}
2020-03-04 05:08:14 +01:00
/*
============
WriteSequenceInfo
============
*/
static void WriteSequenceInfo( FILE *fp )
{
int i, j;
const char *activity;
char motion_types[256];
mstudioevent_t *event;
mstudioseqdesc_t *seqdesc;
if( model_hdr->numseqgroups > 1 )
fprintf( fp, "$sequencegroupsize %d\n\n", CalcSequenceGroupSize( ) );
2020-03-04 05:08:14 +01:00
if( model_hdr->numseq > 0 )
fprintf( fp, "// %i animation sequence%s\n", model_hdr->numseq, model_hdr->numseq > 1 ? "s" : "" );
2023-10-19 08:20:36 +02:00
else return;
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
seqdesc = (mstudioseqdesc_t *)( (byte *)model_hdr + model_hdr->seqindex );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( i = 0; i < model_hdr->numseq; ++i, ++seqdesc )
{
fprintf( fp, "$sequence \"%s\" {\n", seqdesc->label );
2020-03-04 05:08:14 +01:00
if( seqdesc->numblends > 1 )
{
for( j = 0; j < seqdesc->numblends; j++ )
fprintf( fp, "\t\"" DEFAULT_SEQUENCEPATH "%s_blend%02i\"\n", seqdesc->label, j + 1 );
2020-03-04 05:08:14 +01:00
}
else
{
fprintf( fp, "\t\"" DEFAULT_SEQUENCEPATH "%s\"\n", seqdesc->label );
2020-03-04 05:08:14 +01:00
}
if( seqdesc->activity )
{
activity = FindActivityName( seqdesc->activity );
if( activity )
{
fprintf( fp, "\t%s %i\n", activity, seqdesc->actweight );
2020-03-04 05:08:14 +01:00
}
else
{
printf( "WARNING: Sequence %s has a custom activity flag (ACT_%i %i).\n",
seqdesc->label, seqdesc->activity, seqdesc->actweight );
fprintf( fp, "\tACT_%i %i\n", seqdesc->activity, seqdesc->actweight );
2020-03-04 05:08:14 +01:00
}
}
if( seqdesc->numblends > 1 )
2020-03-04 05:08:14 +01:00
{
GetMotionTypeString( seqdesc->blendtype[0], motion_types, sizeof( motion_types ), false );
fprintf( fp, "\tblend %s %.0f %.0f\n",
motion_types, seqdesc->blendstart[0], seqdesc->blendend[0] );
if( !seqdesc->blendtype[0] )
printf( "WARNING: Something wrong with blending type for sequence: %s\n", seqdesc->label );
2020-03-04 05:08:14 +01:00
}
2023-10-19 08:20:36 +02:00
event = (mstudioevent_t *)( (byte *)model_hdr + seqdesc->eventindex );
2020-03-04 05:08:14 +01:00
2023-10-19 08:20:36 +02:00
for( j = 0; j < seqdesc->numevents; ++j, ++event )
{
fprintf( fp, "\t{ event %i %i", event->event, event->frame );
2020-03-04 05:08:14 +01:00
if( event->options[0] != '\0' )
fprintf( fp, " \"%s\"", event->options );
2020-03-04 05:08:14 +01:00
fputs( " }\n", fp );
}
2020-03-04 05:08:14 +01:00
fprintf( fp, "\tfps %.0f\n", seqdesc->fps );
2020-03-04 05:08:14 +01:00
if( seqdesc->flags == 1 )
fputs( "\tloop\n", fp );
2020-03-04 05:08:14 +01:00
if( seqdesc->motiontype )
{
GetMotionTypeString( seqdesc->motiontype, motion_types, sizeof( motion_types ), true );
2020-03-04 05:08:14 +01:00
fprintf( fp, "\t%s\n", motion_types );
2020-03-04 05:08:14 +01:00
}
if( seqdesc->entrynode && seqdesc->exitnode )
{
if( seqdesc->entrynode == seqdesc->exitnode )
fprintf( fp, "\tnode %i\n", seqdesc->entrynode );
else if( seqdesc->nodeflags )
fprintf( fp, "\trtransition %i %i\n", seqdesc->entrynode, seqdesc->exitnode );
else
fprintf( fp, "\ttransition %i %i\n", seqdesc->entrynode, seqdesc->exitnode );
}
2020-03-04 05:08:14 +01:00
fputs( "}\n", fp );
2020-03-04 05:08:14 +01:00
}
2023-10-14 20:51:19 +02:00
fputs( "\n", fp );
2020-03-04 05:08:14 +01:00
}
/*
============
WriteQCScript
============
*/
void WriteQCScript( void )
{
FILE *fp;
char filename[MAX_SYSPATH];
2020-11-28 01:34:15 +01:00
int len;
2020-03-04 05:08:14 +01:00
len = Q_snprintf( filename, MAX_SYSPATH, "%s%s.qc", destdir, modelfile );
2020-11-28 01:34:15 +01:00
if( len == -1 )
2020-03-04 05:08:14 +01:00
{
fprintf( stderr, "ERROR: Destination path is too long. Couldn't write %s.qc\n", modelfile );
2020-03-04 05:08:14 +01:00
return;
}
fp = fopen( filename, "w" );
if( !fp )
{
fprintf( stderr, "ERROR: Couldn't write %s\n", filename );
2020-03-04 05:08:14 +01:00
return;
}
fputs( "/*\n", fp );
fputs( "==============================================================================\n\n", fp );
fputs( "QC script generated by Half-Life Studio Model Decompiler " APP_VERSION "\n", fp );
fprintf( fp, "Copyright Flying With Gauss %s (c) \n\n", Q_timestamp( TIME_YEAR_ONLY ) );
fprintf( fp, "%s.mdl\n\n", modelfile );
fputs( "Original internal name:\n", fp );
fprintf( fp, "\"%s\"\n\n", model_hdr->name );
fputs( "==============================================================================\n", fp );
fputs( "*/\n\n", fp );
fprintf( fp, "$modelname \"%s.mdl\"\n", modelfile );
fputs( "$cd \".\"\n", fp );
fputs( "$cdtexture \"./" DEFAULT_TEXTUREPATH "\"\n", fp );
2020-03-04 05:08:14 +01:00
fputs( "$cliptotextures\n", fp );
2023-10-14 20:51:19 +02:00
fputs( "$scale 1.0\n", fp );
2020-03-04 05:08:14 +01:00
fputs( "\n", fp );
2024-02-29 01:57:15 +01:00
if( model_hdr->flags & STUDIO_HAS_BONEINFO )
{
if( model_hdr->flags & STUDIO_HAS_BONEWEIGHTS )
fputs( "$boneweights\n\n", fp );
}
2023-10-14 20:51:19 +02:00
WriteBodyGroupInfo( fp );
2020-03-04 05:08:14 +01:00
fprintf( fp, "$flags %u\n\n", model_hdr->flags &~( STUDIO_HAS_BONEINFO | STUDIO_HAS_BONEWEIGHTS ) );
2023-10-14 20:51:19 +02:00
fprintf( fp, "$eyeposition %f %f %f\n\n", model_hdr->eyeposition[0], model_hdr->eyeposition[1], model_hdr->eyeposition[2] );
2020-03-04 05:08:14 +01:00
2023-10-14 20:51:19 +02:00
if( !model_hdr->numtextures )
fputs( "$externaltextures\n\n", fp );
WriteSkinFamilyInfo( fp );
WriteTextureRenderMode( fp );
WriteAttachmentInfo( fp );
2020-03-04 05:08:14 +01:00
fprintf( fp, "$bbox %f %f %f", model_hdr->min[0], model_hdr->min[1], model_hdr->min[2] );
2023-10-14 20:51:19 +02:00
fprintf( fp, " %f %f %f\n\n", model_hdr->max[0], model_hdr->max[1], model_hdr->max[2] );
2020-03-04 05:08:14 +01:00
fprintf( fp, "$cbox %f %f %f", model_hdr->bbmin[0], model_hdr->bbmin[1], model_hdr->bbmin[2] );
2023-10-14 20:51:19 +02:00
fprintf( fp, " %f %f %f\n\n", model_hdr->bbmax[0], model_hdr->bbmax[1], model_hdr->bbmax[2] );
2020-03-04 05:08:14 +01:00
WriteHitBoxInfo( fp );
2023-10-14 20:51:19 +02:00
WriteControllerInfo( fp );
2020-03-04 05:08:14 +01:00
WriteSequenceInfo( fp );
2023-10-14 20:51:19 +02:00
fputs( "// End of QC script.\n", fp );
2020-03-04 05:08:14 +01:00
fclose( fp );
printf( "QC Script: %s\n", filename );
}