ASE model loading. More...
#include "../bsp.h"
#include "shared.h"
#include "aselib.h"
Go to the source code of this file.
Data Structures | |
struct | aseVertex_t |
struct | aseTVertex_t |
struct | aseMesh_t |
struct | aseMeshAnimation_t |
struct | aseMaterial_t |
struct | aseGeomObject_t |
contains the animate sequence of a single surface using a single material More... | |
struct | ase_t |
Defines | |
#define | MAX_ASE_MATERIALS 32 |
#define | MAX_ASE_OBJECTS 64 |
#define | MAX_ASE_ANIMATIONS 32 |
#define | MAX_ASE_ANIMATION_FRAMES 512 |
#define | VERBOSE(x) { if (ase.verbose) { Com_Printf x; } } |
Typedefs | |
typedef int | aseFace_t [3] |
Functions | |
static void | ASE_Process (void) |
static void | ASE_FreeGeomObject (int ndx) |
void | ASE_Load (const char *filename, qboolean verbose) |
void | ASE_Free (void) |
int | ASE_GetNumSurfaces (void) |
const char * | ASE_GetSurfaceName (int which) |
polyset_t * | ASE_GetSurfaceAnimation (int whichSurface) |
Returns an animation (sequence of polysets). | |
static aseMesh_t * | ASE_GetCurrentMesh (void) |
static int | CharIsTokenDelimiter (int ch) |
static int | ASE_GetToken (qboolean restOfLine) |
static void | ASE_ParseBracedBlock (void(*parser)(const char *token)) |
static void | ASE_SkipEnclosingBraces (void) |
static void | ASE_SkipRestOfLine (void) |
static void | ASE_KeyMAP_DIFFUSE (const char *token) |
static void | ASE_KeyMATERIAL (const char *token) |
static void | ASE_KeyMATERIAL_LIST (const char *token) |
static void | ASE_KeyMESH_VERTEX_LIST (const char *token) |
static void | ASE_KeyMESH_FACE_LIST (const char *token) |
static void | ASE_KeyTFACE_LIST (const char *token) |
static void | ASE_KeyMESH_TVERTLIST (const char *token) |
static void | ASE_KeyMESH (const char *token) |
static void | ASE_KeyGEOMOBJECT (const char *token) |
static void | ConcatenateObjects (aseGeomObject_t *pObjA, aseGeomObject_t *pObjB) |
static void | CollapseObjects (void) |
Variables | |
static char | s_token [1024] |
static ase_t | ase |
ASE model loading.
Definition in file aselib.c.
#define MAX_ASE_ANIMATION_FRAMES 512 |
Definition at line 34 of file aselib.c.
Referenced by ASE_GetCurrentMesh(), and ASE_KeyGEOMOBJECT().
#define MAX_ASE_MATERIALS 32 |
Definition at line 31 of file aselib.c.
Referenced by ASE_KeyMATERIAL_LIST().
#define MAX_ASE_OBJECTS 64 |
Definition at line 32 of file aselib.c.
Referenced by ASE_GetCurrentMesh(), and ASE_Process().
#define VERBOSE | ( | x | ) | { if (ase.verbose) { Com_Printf x; } } |
Definition at line 36 of file aselib.c.
Referenced by ASE_KeyGEOMOBJECT(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), and ASE_Process().
void ASE_Free | ( | void | ) |
Definition at line 135 of file aselib.c.
References ASE_FreeGeomObject(), ase_t::currentObject, and i.
static void ASE_FreeGeomObject | ( | int | ndx | ) | [static] |
Definition at line 206 of file aselib.c.
References aseGeomObject_t::anim, aseMesh_t::faces, aseMeshAnimation_t::frames, i, Mem_Free, aseMeshAnimation_t::numFrames, ase_t::objects, aseMesh_t::tfaces, aseMesh_t::tvertexes, and aseMesh_t::vertexes.
Referenced by ASE_Free(), and ASE_Process().
static aseMesh_t* ASE_GetCurrentMesh | ( | void | ) | [static] |
Definition at line 227 of file aselib.c.
References aseGeomObject_t::anim, aseMeshAnimation_t::currentFrame, ase_t::currentObject, aseMeshAnimation_t::frames, MAX_ASE_ANIMATION_FRAMES, MAX_ASE_OBJECTS, ase_t::objects, and Sys_Error().
Referenced by ASE_KeyMESH(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), and ASE_KeyTFACE_LIST().
int ASE_GetNumSurfaces | ( | void | ) |
Definition at line 143 of file aselib.c.
References ase_t::currentObject.
polyset_t* ASE_GetSurfaceAnimation | ( | int | whichSurface | ) |
Returns an animation (sequence of polysets).
Definition at line 161 of file aselib.c.
References aseGeomObject_t::anim, f, aseMesh_t::faces, aseMeshAnimation_t::frames, i, aseGeomObject_t::materialRef, ase_t::materials, Mem_Alloc, aseMaterial_t::name, aseGeomObject_t::name, name, aseMesh_t::numFaces, aseMeshAnimation_t::numFrames, polyset_t::numtriangles, ase_t::objects, aseTVertex_t::s, aseTVertex_t::t, triangle_t::texcoords, aseMesh_t::tfaces, polyset_t::triangles, aseMesh_t::tvertexes, aseMesh_t::vertexes, triangle_t::verts, aseVertex_t::x, aseVertex_t::y, and aseVertex_t::z.
const char* ASE_GetSurfaceName | ( | int | which | ) |
Definition at line 148 of file aselib.c.
References aseGeomObject_t::anim, aseGeomObject_t::name, aseMeshAnimation_t::numFrames, and ase_t::objects.
static int ASE_GetToken | ( | qboolean | restOfLine | ) | [static] |
Definition at line 249 of file aselib.c.
References ase_t::buffer, CharIsTokenDelimiter(), ase_t::curpos, i, ase_t::len, and s_token.
Referenced by ASE_KeyGEOMOBJECT(), ASE_KeyMAP_DIFFUSE(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), ASE_KeyTFACE_LIST(), ASE_ParseBracedBlock(), ASE_Process(), ASE_SkipEnclosingBraces(), and ASE_SkipRestOfLine().
static void ASE_KeyGEOMOBJECT | ( | const char * | token | ) | [static] |
Definition at line 533 of file aselib.c.
References aseGeomObject_t::anim, ASE_GetToken(), ASE_KeyMESH(), ASE_ParseBracedBlock(), ASE_SkipEnclosingBraces(), ASE_SkipRestOfLine(), aseMeshAnimation_t::currentFrame, ase_t::currentObject, aseGeomObject_t::materialRef, MAX_ASE_ANIMATION_FRAMES, aseGeomObject_t::name, name, aseGeomObject_t::numAnimations, aseMeshAnimation_t::numFrames, ase_t::objects, qfalse, qtrue, s_token, Sys_Error(), and VERBOSE.
Referenced by ASE_Process().
static void ASE_KeyMAP_DIFFUSE | ( | const char * | token | ) | [static] |
Definition at line 324 of file aselib.c.
References ASE_GetToken(), Com_StripExtension(), len, ase_t::materials, MAX_QPATH, aseMaterial_t::name, ase_t::numMaterials, qfalse, s_token, VERB_EXTRA, and Verb_Printf().
Referenced by ASE_KeyMATERIAL().
static void ASE_KeyMATERIAL | ( | const char * | token | ) | [static] |
Definition at line 342 of file aselib.c.
References ASE_KeyMAP_DIFFUSE(), and ASE_ParseBracedBlock().
Referenced by ASE_KeyMATERIAL_LIST().
static void ASE_KeyMATERIAL_LIST | ( | const char * | token | ) | [static] |
Definition at line 348 of file aselib.c.
References ASE_GetToken(), ASE_KeyMATERIAL(), ASE_ParseBracedBlock(), MAX_ASE_MATERIALS, ase_t::numMaterials, qfalse, s_token, Sys_Error(), and VERBOSE.
Referenced by ASE_Process().
static void ASE_KeyMESH | ( | const char * | token | ) | [static] |
Definition at line 478 of file aselib.c.
References ASE_GetCurrentMesh(), ASE_GetToken(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), ASE_KeyTFACE_LIST(), ASE_ParseBracedBlock(), aseMesh_t::currentFace, aseMesh_t::currentVertex, aseMesh_t::faces, aseMesh_t::numFaces, aseMesh_t::numTVertexes, aseMesh_t::numVertexes, qfalse, s_token, Sys_Error(), aseMesh_t::tfaces, aseMesh_t::timeValue, aseMesh_t::tvertexes, VERBOSE, and aseMesh_t::vertexes.
Referenced by ASE_KeyGEOMOBJECT().
static void ASE_KeyMESH_FACE_LIST | ( | const char * | token | ) | [static] |
Definition at line 388 of file aselib.c.
References ASE_GetCurrentMesh(), ASE_GetToken(), aseMesh_t::currentFace, aseMesh_t::faces, qfalse, qtrue, s_token, and Sys_Error().
Referenced by ASE_KeyMESH().
static void ASE_KeyMESH_TVERTLIST | ( | const char * | token | ) | [static] |
Definition at line 448 of file aselib.c.
References ASE_GetCurrentMesh(), ASE_GetToken(), aseMesh_t::currentVertex, aseMesh_t::numTVertexes, qfalse, aseTVertex_t::s, s_token, Sys_Error(), aseTVertex_t::t, and aseMesh_t::tvertexes.
Referenced by ASE_KeyMESH().
static void ASE_KeyMESH_VERTEX_LIST | ( | const char * | token | ) | [static] |
Definition at line 364 of file aselib.c.
References ASE_GetCurrentMesh(), ASE_GetToken(), aseMesh_t::currentVertex, aseMesh_t::numVertexes, qfalse, s_token, Sys_Error(), aseMesh_t::vertexes, aseVertex_t::x, aseVertex_t::y, and aseVertex_t::z.
Referenced by ASE_KeyMESH().
static void ASE_KeyTFACE_LIST | ( | const char * | token | ) | [static] |
Definition at line 423 of file aselib.c.
References ASE_GetCurrentMesh(), ASE_GetToken(), aseMesh_t::currentFace, qfalse, s_token, Sys_Error(), and aseMesh_t::tfaces.
Referenced by ASE_KeyMESH().
void ASE_Load | ( | const char * | filename, | |
qboolean | verbose | |||
) |
Definition at line 106 of file aselib.c.
References ASE_Process(), ase_t::buffer, ase_t::curpos, qFILE_s::f, FILE_READ, FS_CloseFile(), FS_FileLength(), FS_OpenFile(), FS_Read(), ase_t::len, Mem_Alloc, Sys_Error(), VERB_EXTRA, Verb_Printf(), ase_t::verbose, and qFILE_s::z.
static void ASE_ParseBracedBlock | ( | void(*)(const char *token) | parser | ) | [static] |
Definition at line 282 of file aselib.c.
References ASE_GetToken(), qfalse, s_token, and Sys_Error().
Referenced by ASE_KeyGEOMOBJECT(), ASE_KeyMATERIAL(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), and ASE_Process().
static void ASE_Process | ( | void | ) | [static] |
Definition at line 627 of file aselib.c.
References ASE_FreeGeomObject(), ASE_GetToken(), ASE_KeyGEOMOBJECT(), ASE_KeyMATERIAL_LIST(), ASE_ParseBracedBlock(), ASE_SkipEnclosingBraces(), ASE_SkipRestOfLine(), CollapseObjects(), Com_Printf(), ase_t::currentObject, MAX_ASE_OBJECTS, aseGeomObject_t::name, ase_t::objects, qfalse, s_token, Sys_Error(), and VERBOSE.
Referenced by ASE_Load().
static void ASE_SkipEnclosingBraces | ( | void | ) | [static] |
Definition at line 302 of file aselib.c.
References ASE_GetToken(), qfalse, s_token, and Sys_Error().
Referenced by ASE_KeyGEOMOBJECT(), and ASE_Process().
static void ASE_SkipRestOfLine | ( | void | ) | [static] |
Definition at line 319 of file aselib.c.
References ASE_GetToken(), and qtrue.
Referenced by ASE_KeyGEOMOBJECT(), and ASE_Process().
static int CharIsTokenDelimiter | ( | int | ch | ) | [inline, static] |
Definition at line 242 of file aselib.c.
Referenced by ASE_GetToken().
static void CollapseObjects | ( | void | ) | [static] |
Definition at line 601 of file aselib.c.
References ConcatenateObjects(), ase_t::currentObject, i, aseGeomObject_t::materialRef, aseGeomObject_t::name, aseGeomObject_t::numAnimations, and ase_t::objects.
Referenced by ASE_Process().
static void ConcatenateObjects | ( | aseGeomObject_t * | pObjA, | |
aseGeomObject_t * | pObjB | |||
) | [static] |
Definition at line 597 of file aselib.c.
Referenced by CollapseObjects().
char s_token[1024] [static] |
Definition at line 100 of file aselib.c.
Referenced by ASE_GetToken(), ASE_KeyGEOMOBJECT(), ASE_KeyMAP_DIFFUSE(), ASE_KeyMATERIAL_LIST(), ASE_KeyMESH(), ASE_KeyMESH_FACE_LIST(), ASE_KeyMESH_TVERTLIST(), ASE_KeyMESH_VERTEX_LIST(), ASE_KeyTFACE_LIST(), ASE_ParseBracedBlock(), ASE_Process(), and ASE_SkipEnclosingBraces().