2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 #include "globaldefs.h"
30 #define MAX_ASE_MATERIALS 32
31 #define MAX_ASE_OBJECTS 64
32 #define MAX_ASE_ANIMATIONS 32
33 #define MAX_ASE_ANIMATION_FRAMES 512
35 #define VERBOSE( x ) { if ( ase.verbose ) { Sys_Printf x ; } }
49 typedef int aseFace_t[3];
59 aseVertex_t *vertexes;
60 aseTVertex_t *tvertexes;
61 aseFace_t *faces, *tfaces;
63 int currentFace, currentVertex;
69 aseMesh_t frames[MAX_ASE_ANIMATION_FRAMES];
80 ** contains the animate sequence of a single surface
81 ** using a single material
90 aseMeshAnimation_t anim;
97 aseMaterial_t materials[MAX_ASE_MATERIALS];
98 aseGeomObject_t objects[MAX_ASE_OBJECTS];
110 static char s_token[1024];
112 static char gl_filename[1024];
114 static void ASE_Process( void );
115 static void ASE_FreeGeomObject( int ndx );
117 #if GDEF_OS_LINUX || GDEF_OS_MACOS
119 static char* strlwr( char* string ){
121 for ( cp = string; *cp; ++cp )
123 if ( 'A' <= *cp && *cp <= 'Z' ) {
136 void ASE_Load( const char *filename, qboolean verbose, qboolean grabAnims ){
137 FILE *fp = fopen( filename, "rb" );
140 Error( "File not found '%s'", filename );
143 memset( &ase, 0, sizeof( ase ) );
145 ase.verbose = verbose;
146 ase.grabAnims = grabAnims;
147 ase.len = Q_filelength( fp );
149 ase.curpos = ase.buffer = safe_malloc( ase.len );
151 Sys_Printf( "Processing '%s'\n", filename );
153 if ( fread( ase.buffer, ase.len, 1, fp ) != 1 ) {
155 Error( "fread() != -1 for '%s'", filename );
160 strcpy( gl_filename, filename );
168 void ASE_Free( void ){
171 for ( i = 0; i < ase.currentObject; i++ )
173 ASE_FreeGeomObject( i );
178 ** ASE_GetNumSurfaces
180 int ASE_GetNumSurfaces( void ){
181 return ase.currentObject;
185 ** ASE_GetSurfaceName
187 const char *ASE_GetSurfaceName( int which ){
188 aseGeomObject_t *pObject = &ase.objects[which];
190 if ( !pObject->anim.numFrames ) {
194 return pObject->name;
198 ** ASE_GetSurfaceAnimation
200 ** Returns an animation (sequence of polysets)
202 polyset_t *ASE_GetSurfaceAnimation( int which, int *pNumFrames, int skipFrameStart, int skipFrameEnd, int maxFrames ){
203 aseGeomObject_t *pObject = &ase.objects[which];
205 int numFramesInAnimation;
209 if ( !pObject->anim.numFrames ) {
213 if ( pObject->anim.numFrames > maxFrames && maxFrames != -1 ) {
214 numFramesInAnimation = maxFrames;
218 numFramesInAnimation = pObject->anim.numFrames;
219 if ( maxFrames != -1 ) {
220 Sys_FPrintf( SYS_WRN, "WARNING: ASE_GetSurfaceAnimation maxFrames > numFramesInAnimation\n" );
224 if ( skipFrameEnd != -1 ) {
225 numFramesToKeep = numFramesInAnimation - ( skipFrameEnd - skipFrameStart + 1 );
228 numFramesToKeep = numFramesInAnimation;
231 *pNumFrames = numFramesToKeep;
233 psets = calloc( sizeof( polyset_t ) * numFramesToKeep, 1 );
235 for ( f = 0, i = 0; i < numFramesInAnimation; i++ )
238 aseMesh_t *pMesh = &pObject->anim.frames[i];
240 if ( skipFrameStart != -1 ) {
241 if ( i >= skipFrameStart && i <= skipFrameEnd ) {
246 strcpy( psets[f].name, pObject->name );
247 strcpy( psets[f].materialname, ase.materials[pObject->materialRef].name );
249 psets[f].triangles = calloc( sizeof( triangle_t ) * pObject->anim.frames[i].numFaces, 1 );
250 psets[f].numtriangles = pObject->anim.frames[i].numFaces;
252 for ( t = 0; t < pObject->anim.frames[i].numFaces; t++ )
256 for ( k = 0; k < 3; k++ )
258 psets[f].triangles[t].verts[k][0] = pMesh->vertexes[pMesh->faces[t][k]].x;
259 psets[f].triangles[t].verts[k][1] = pMesh->vertexes[pMesh->faces[t][k]].y;
260 psets[f].triangles[t].verts[k][2] = pMesh->vertexes[pMesh->faces[t][k]].z;
262 if ( pMesh->tvertexes && pMesh->tfaces ) {
263 psets[f].triangles[t].texcoords[k][0] = pMesh->tvertexes[pMesh->tfaces[t][k]].s;
264 psets[f].triangles[t].texcoords[k][1] = pMesh->tvertexes[pMesh->tfaces[t][k]].t;
276 static void ASE_FreeGeomObject( int ndx ){
277 aseGeomObject_t *pObject;
280 pObject = &ase.objects[ndx];
282 for ( i = 0; i < pObject->anim.numFrames; i++ )
284 if ( pObject->anim.frames[i].vertexes ) {
285 free( pObject->anim.frames[i].vertexes );
287 if ( pObject->anim.frames[i].tvertexes ) {
288 free( pObject->anim.frames[i].tvertexes );
290 if ( pObject->anim.frames[i].faces ) {
291 free( pObject->anim.frames[i].faces );
293 if ( pObject->anim.frames[i].tfaces ) {
294 free( pObject->anim.frames[i].tfaces );
298 memset( pObject, 0, sizeof( *pObject ) );
301 static aseMesh_t *ASE_GetCurrentMesh( void ){
302 aseGeomObject_t *pObject;
304 if ( ase.currentObject >= MAX_ASE_OBJECTS ) {
305 Error( "Too many GEOMOBJECTs" );
306 return 0; // never called
309 pObject = &ase.objects[ase.currentObject];
311 if ( pObject->anim.currentFrame >= MAX_ASE_ANIMATION_FRAMES ) {
312 Error( "Too many MESHes" );
316 return &pObject->anim.frames[pObject->anim.currentFrame];
319 static int CharIsTokenDelimiter( int ch ){
326 static int ASE_GetToken( qboolean restOfLine ){
329 if ( ase.buffer == 0 ) {
333 if ( ( ase.curpos - ase.buffer ) == ase.len ) {
338 while ( ( ( ase.curpos - ase.buffer ) < ase.len ) &&
339 ( *ase.curpos <= 32 ) )
344 while ( ( ase.curpos - ase.buffer ) < ase.len )
346 s_token[i] = *ase.curpos;
351 if ( ( CharIsTokenDelimiter( s_token[i - 1] ) && !restOfLine ) ||
352 ( ( s_token[i - 1] == '\n' ) || ( s_token[i - 1] == '\r' ) ) ) {
363 static void ASE_ParseBracedBlock( void ( *parser )( const char *token ) ){
366 while ( ASE_GetToken( qfalse ) )
368 if ( !strcmp( s_token, "{" ) ) {
371 else if ( !strcmp( s_token, "}" ) ) {
376 else if ( indent < 0 ) {
377 Error( "Unexpected '}'" );
389 static void ASE_SkipEnclosingBraces( void ){
392 while ( ASE_GetToken( qfalse ) )
394 if ( !strcmp( s_token, "{" ) ) {
397 else if ( !strcmp( s_token, "}" ) ) {
402 else if ( indent < 0 ) {
403 Error( "Unexpected '}'" );
409 static void ASE_SkipRestOfLine( void ){
410 ASE_GetToken( qtrue );
413 static void ASE_KeyMAP_DIFFUSE( const char *token ){
418 strcpy( filename, gl_filename );
420 if ( !strcmp( token, "*BITMAP" ) ) {
421 ASE_GetToken( qfalse );
423 // the purpose of this whole chunk of code below is to extract the relative path
424 // from a full path in the ASE
426 strcpy( bitmap, s_token + 1 );
427 if ( strchr( bitmap, '"' ) ) {
428 *strchr( bitmap, '"' ) = 0;
431 /* convert backslash to slash */
434 if ( bitmap[i] == '\\' ) {
440 /* remove filename from path */
441 for ( i = strlen( filename ); i > 0; i-- )
443 if ( filename[i] == '/' ) {
449 /* replaces a relative path with a full path */
450 if ( bitmap[0] == '.' && bitmap[1] == '.' && bitmap[2] == '/' ) {
451 while ( bitmap[0] == '.' && bitmap[1] == '.' && bitmap[2] == '/' )
453 /* remove last item from path */
454 for ( i = strlen( filename ); i > 0; i-- )
456 if ( filename[i] == '/' ) {
461 strcpy( bitmap, &bitmap[3] );
463 strcat( filename, "/" );
464 strcat( filename, bitmap );
465 strcpy( bitmap, filename );
468 if ( strstr( bitmap, gamedir ) ) {
469 strcpy( ase.materials[ase.numMaterials].name, strstr( bitmap, gamedir ) + strlen( gamedir ) );
470 Sys_Printf( "material name: \'%s\'\n", strstr( bitmap, gamedir ) + strlen( gamedir ) );
474 sprintf( ase.materials[ase.numMaterials].name, "(not converted: '%s')", bitmap );
475 Sys_FPrintf( SYS_WRN, "WARNING: illegal material name '%s'\n", bitmap );
483 static void ASE_KeyMATERIAL( const char *token ){
484 if ( !strcmp( token, "*MAP_DIFFUSE" ) ) {
485 ASE_ParseBracedBlock( ASE_KeyMAP_DIFFUSE );
492 static void ASE_KeyMATERIAL_LIST( const char *token ){
493 if ( !strcmp( token, "*MATERIAL_COUNT" ) ) {
494 ASE_GetToken( qfalse );
495 VERBOSE( ( "..num materials: %s\n", s_token ) );
496 if ( atoi( s_token ) > MAX_ASE_MATERIALS ) {
497 Error( "Too many materials!" );
499 ase.numMaterials = 0;
501 else if ( !strcmp( token, "*MATERIAL" ) ) {
502 VERBOSE( ( "..material %d ", ase.numMaterials ) );
503 ASE_ParseBracedBlock( ASE_KeyMATERIAL );
508 static void ASE_KeyMESH_VERTEX_LIST( const char *token ){
509 aseMesh_t *pMesh = ASE_GetCurrentMesh();
511 if ( !strcmp( token, "*MESH_VERTEX" ) ) {
512 ASE_GetToken( qfalse ); // skip number
514 ASE_GetToken( qfalse );
515 pMesh->vertexes[pMesh->currentVertex].y = atof( s_token );
517 ASE_GetToken( qfalse );
518 pMesh->vertexes[pMesh->currentVertex].x = -atof( s_token );
520 ASE_GetToken( qfalse );
521 pMesh->vertexes[pMesh->currentVertex].z = atof( s_token );
523 pMesh->currentVertex++;
525 if ( pMesh->currentVertex > pMesh->numVertexes ) {
526 Error( "pMesh->currentVertex >= pMesh->numVertexes" );
531 Error( "Unknown token '%s' while parsing MESH_VERTEX_LIST", token );
535 static void ASE_KeyMESH_FACE_LIST( const char *token ){
536 aseMesh_t *pMesh = ASE_GetCurrentMesh();
538 if ( !strcmp( token, "*MESH_FACE" ) ) {
539 ASE_GetToken( qfalse ); // skip face number
541 ASE_GetToken( qfalse ); // skip label
542 ASE_GetToken( qfalse ); // first vertex
543 pMesh->faces[pMesh->currentFace][0] = atoi( s_token );
545 ASE_GetToken( qfalse ); // skip label
546 ASE_GetToken( qfalse ); // second vertex
547 pMesh->faces[pMesh->currentFace][2] = atoi( s_token );
549 ASE_GetToken( qfalse ); // skip label
550 ASE_GetToken( qfalse ); // third vertex
551 pMesh->faces[pMesh->currentFace][1] = atoi( s_token );
553 ASE_GetToken( qtrue );
556 if ( ( p = strstr( s_token, "*MESH_MTLID" ) ) != 0 )
558 p += strlen( "*MESH_MTLID" ) + 1;
563 Error( "No *MESH_MTLID found for face!" );
567 pMesh->currentFace++;
571 Error( "Unknown token '%s' while parsing MESH_FACE_LIST", token );
575 static void ASE_KeyTFACE_LIST( const char *token ){
576 aseMesh_t *pMesh = ASE_GetCurrentMesh();
578 if ( !strcmp( token, "*MESH_TFACE" ) ) {
581 ASE_GetToken( qfalse );
583 ASE_GetToken( qfalse );
585 ASE_GetToken( qfalse );
587 ASE_GetToken( qfalse );
590 pMesh->tfaces[pMesh->currentFace][0] = a;
591 pMesh->tfaces[pMesh->currentFace][1] = b;
592 pMesh->tfaces[pMesh->currentFace][2] = c;
594 pMesh->currentFace++;
598 Error( "Unknown token '%s' in MESH_TFACE", token );
602 static void ASE_KeyMESH_TVERTLIST( const char *token ){
603 aseMesh_t *pMesh = ASE_GetCurrentMesh();
605 if ( !strcmp( token, "*MESH_TVERT" ) ) {
606 char u[80], v[80], w[80];
608 ASE_GetToken( qfalse );
610 ASE_GetToken( qfalse );
611 strcpy( u, s_token );
613 ASE_GetToken( qfalse );
614 strcpy( v, s_token );
616 ASE_GetToken( qfalse );
617 strcpy( w, s_token );
619 pMesh->tvertexes[pMesh->currentVertex].s = atof( u );
620 pMesh->tvertexes[pMesh->currentVertex].t = 1.0f - atof( v );
622 pMesh->currentVertex++;
624 if ( pMesh->currentVertex > pMesh->numTVertexes ) {
625 Error( "pMesh->currentVertex > pMesh->numTVertexes" );
630 Error( "Unknown token '%s' while parsing MESH_TVERTLIST", token );
634 static void ASE_KeyMESH( const char *token ){
635 aseMesh_t *pMesh = ASE_GetCurrentMesh();
637 if ( !strcmp( token, "*TIMEVALUE" ) ) {
638 ASE_GetToken( qfalse );
640 pMesh->timeValue = atoi( s_token );
641 VERBOSE( ( ".....timevalue: %d\n", pMesh->timeValue ) );
643 else if ( !strcmp( token, "*MESH_NUMVERTEX" ) ) {
644 ASE_GetToken( qfalse );
646 pMesh->numVertexes = atoi( s_token );
647 VERBOSE( ( ".....TIMEVALUE: %d\n", pMesh->timeValue ) );
648 VERBOSE( ( ".....num vertexes: %d\n", pMesh->numVertexes ) );
650 else if ( !strcmp( token, "*MESH_NUMFACES" ) ) {
651 ASE_GetToken( qfalse );
653 pMesh->numFaces = atoi( s_token );
654 VERBOSE( ( ".....num faces: %d\n", pMesh->numFaces ) );
656 else if ( !strcmp( token, "*MESH_NUMTVFACES" ) ) {
657 ASE_GetToken( qfalse );
659 if ( atoi( s_token ) != pMesh->numFaces ) {
660 Error( "MESH_NUMTVFACES != MESH_NUMFACES" );
663 else if ( !strcmp( token, "*MESH_NUMTVERTEX" ) ) {
664 ASE_GetToken( qfalse );
666 pMesh->numTVertexes = atoi( s_token );
667 VERBOSE( ( ".....num tvertexes: %d\n", pMesh->numTVertexes ) );
669 else if ( !strcmp( token, "*MESH_VERTEX_LIST" ) ) {
670 pMesh->vertexes = calloc( sizeof( aseVertex_t ) * pMesh->numVertexes, 1 );
671 pMesh->currentVertex = 0;
672 VERBOSE( ( ".....parsing MESH_VERTEX_LIST\n" ) );
673 ASE_ParseBracedBlock( ASE_KeyMESH_VERTEX_LIST );
675 else if ( !strcmp( token, "*MESH_TVERTLIST" ) ) {
676 pMesh->currentVertex = 0;
677 pMesh->tvertexes = calloc( sizeof( aseTVertex_t ) * pMesh->numTVertexes, 1 );
678 VERBOSE( ( ".....parsing MESH_TVERTLIST\n" ) );
679 ASE_ParseBracedBlock( ASE_KeyMESH_TVERTLIST );
681 else if ( !strcmp( token, "*MESH_FACE_LIST" ) ) {
682 pMesh->faces = calloc( sizeof( aseFace_t ) * pMesh->numFaces, 1 );
683 pMesh->currentFace = 0;
684 VERBOSE( ( ".....parsing MESH_FACE_LIST\n" ) );
685 ASE_ParseBracedBlock( ASE_KeyMESH_FACE_LIST );
687 else if ( !strcmp( token, "*MESH_TFACELIST" ) ) {
688 pMesh->tfaces = calloc( sizeof( aseFace_t ) * pMesh->numFaces, 1 );
689 pMesh->currentFace = 0;
690 VERBOSE( ( ".....parsing MESH_TFACE_LIST\n" ) );
691 ASE_ParseBracedBlock( ASE_KeyTFACE_LIST );
693 else if ( !strcmp( token, "*MESH_NORMALS" ) ) {
694 ASE_ParseBracedBlock( 0 );
698 static void ASE_KeyMESH_ANIMATION( const char *token ){
699 aseMesh_t *pMesh = ASE_GetCurrentMesh();
701 // loads a single animation frame
702 if ( !strcmp( token, "*MESH" ) ) {
703 VERBOSE( ( "...found MESH\n" ) );
704 assert( pMesh->faces == 0 );
705 assert( pMesh->vertexes == 0 );
706 assert( pMesh->tvertexes == 0 );
707 memset( pMesh, 0, sizeof( *pMesh ) );
709 ASE_ParseBracedBlock( ASE_KeyMESH );
711 if ( ++ase.objects[ase.currentObject].anim.currentFrame == MAX_ASE_ANIMATION_FRAMES ) {
712 Error( "Too many animation frames" );
717 Error( "Unknown token '%s' while parsing MESH_ANIMATION", token );
721 static void ASE_KeyGEOMOBJECT( const char *token ){
722 if ( !strcmp( token, "*NODE_NAME" ) ) {
723 char *name = ase.objects[ase.currentObject].name;
725 ASE_GetToken( qtrue );
726 VERBOSE( ( " %s\n", s_token ) );
727 strcpy( ase.objects[ase.currentObject].name, s_token + 1 );
728 if ( strchr( ase.objects[ase.currentObject].name, '"' ) ) {
729 *strchr( ase.objects[ase.currentObject].name, '"' ) = 0;
732 if ( strstr( name, "tag" ) == name ) {
733 while ( strchr( name, '_' ) != strrchr( name, '_' ) )
735 *strrchr( name, '_' ) = 0;
737 while ( strrchr( name, ' ' ) )
739 *strrchr( name, ' ' ) = 0;
743 else if ( !strcmp( token, "*NODE_PARENT" ) ) {
744 ASE_SkipRestOfLine();
746 // ignore unused data blocks
747 else if ( !strcmp( token, "*NODE_TM" ) ||
748 !strcmp( token, "*TM_ANIMATION" ) ) {
749 ASE_ParseBracedBlock( 0 );
751 // ignore regular meshes that aren't part of animation
752 else if ( !strcmp( token, "*MESH" ) && !ase.grabAnims ) {
754 if ( strstr( ase.objects[ase.currentObject].name, "tag_" ) == ase.objects[ase.currentObject].name )
756 s_forceStaticMesh = true;
757 ASE_ParseBracedBlock( ASE_KeyMESH );
758 s_forceStaticMesh = false;
761 ASE_ParseBracedBlock( ASE_KeyMESH );
762 if ( ++ase.objects[ase.currentObject].anim.currentFrame == MAX_ASE_ANIMATION_FRAMES ) {
763 Error( "Too many animation frames" );
765 ase.objects[ase.currentObject].anim.numFrames = ase.objects[ase.currentObject].anim.currentFrame;
766 ase.objects[ase.currentObject].numAnimations++;
768 // ignore meshes that aren't part of animations if this object isn't a
772 ASE_ParseBracedBlock( 0 );
776 // according to spec these are obsolete
777 else if ( !strcmp( token, "*MATERIAL_REF" ) ) {
778 ASE_GetToken( qfalse );
780 ase.objects[ase.currentObject].materialRef = atoi( s_token );
782 // loads a sequence of animation frames
783 else if ( !strcmp( token, "*MESH_ANIMATION" ) ) {
784 if ( ase.grabAnims ) {
785 VERBOSE( ( "..found MESH_ANIMATION\n" ) );
787 if ( ase.objects[ase.currentObject].numAnimations ) {
788 Error( "Multiple MESH_ANIMATIONS within a single GEOM_OBJECT" );
790 ASE_ParseBracedBlock( ASE_KeyMESH_ANIMATION );
791 ase.objects[ase.currentObject].anim.numFrames = ase.objects[ase.currentObject].anim.currentFrame;
792 ase.objects[ase.currentObject].numAnimations++;
796 ASE_SkipEnclosingBraces();
800 else if ( !strcmp( token, "*PROP_MOTIONBLUR" ) ||
801 !strcmp( token, "*PROP_CASTSHADOW" ) ||
802 !strcmp( token, "*PROP_RECVSHADOW" ) ) {
803 ASE_SkipRestOfLine();
807 static void ConcatenateObjects( aseGeomObject_t *pObjA, aseGeomObject_t *pObjB ){
810 static void CollapseObjects( void ){
812 int numObjects = ase.currentObject;
814 for ( i = 0; i < numObjects; i++ )
819 if ( strstr( ase.objects[i].name, "tag" ) == ase.objects[i].name ) {
823 if ( !ase.objects[i].numAnimations ) {
827 for ( j = i + 1; j < numObjects; j++ )
829 if ( strstr( ase.objects[j].name, "tag" ) == ase.objects[j].name ) {
832 if ( ase.objects[i].materialRef == ase.objects[j].materialRef ) {
833 if ( ase.objects[j].numAnimations ) {
834 ConcatenateObjects( &ase.objects[i], &ase.objects[j] );
844 static void ASE_Process( void ){
845 while ( ASE_GetToken( qfalse ) )
847 if ( !strcmp( s_token, "*3DSMAX_ASCIIEXPORT" ) ||
848 !strcmp( s_token, "*COMMENT" ) ) {
849 ASE_SkipRestOfLine();
851 else if ( !strcmp( s_token, "*SCENE" ) ) {
852 ASE_SkipEnclosingBraces();
854 else if ( !strcmp( s_token, "*MATERIAL_LIST" ) ) {
855 VERBOSE( ( "MATERIAL_LIST\n" ) );
857 ASE_ParseBracedBlock( ASE_KeyMATERIAL_LIST );
859 else if ( !strcmp( s_token, "*GEOMOBJECT" ) ) {
860 VERBOSE( ( "GEOMOBJECT" ) );
862 ASE_ParseBracedBlock( ASE_KeyGEOMOBJECT );
864 if ( strstr( ase.objects[ase.currentObject].name, "Bip" ) ||
865 strstr( ase.objects[ase.currentObject].name, "ignore_" ) ) {
866 ASE_FreeGeomObject( ase.currentObject );
867 VERBOSE( ( "(discarding BIP/ignore object)\n" ) );
869 else if ( ( strstr( ase.objects[ase.currentObject].name, "h_" ) != ase.objects[ase.currentObject].name ) &&
870 ( strstr( ase.objects[ase.currentObject].name, "l_" ) != ase.objects[ase.currentObject].name ) &&
871 ( strstr( ase.objects[ase.currentObject].name, "u_" ) != ase.objects[ase.currentObject].name ) &&
872 ( strstr( ase.objects[ase.currentObject].name, "tag" ) != ase.objects[ase.currentObject].name ) &&
874 VERBOSE( ( "(ignoring improperly labeled object '%s')\n", ase.objects[ase.currentObject].name ) );
875 ASE_FreeGeomObject( ase.currentObject );
879 if ( ++ase.currentObject == MAX_ASE_OBJECTS ) {
880 Error( "Too many GEOMOBJECTs" );
884 else if ( s_token[0] ) {
885 Error( "Unknown token '%s'\n", s_token );
889 if ( !ase.currentObject ) {
890 Error( "No animation data!" );