#include "picointernal.h"
Go to the source code of this file.
Data Structures | |
struct | aseSubMaterial_s |
struct | aseMaterial_s |
struct | aseVertex_s |
struct | aseTexCoord_s |
struct | aseColor_s |
struct | aseFace_s |
Defines | |
#define | PM_ASE_C |
#define | _ase_error_return(m) |
Typedefs | |
typedef struct aseSubMaterial_s | aseSubMaterial_t |
typedef struct aseMaterial_s | aseMaterial_t |
typedef struct aseVertex_s | aseVertex_t |
typedef struct aseTexCoord_s | aseTexCoord_t |
typedef struct aseColor_s | aseColor_t |
typedef struct aseFace_s | aseFace_t |
typedef aseFace_t * | aseFacesIter_t |
Functions | |
static aseMaterial_t * | _ase_get_material (aseMaterial_t *list, int mtlIdParent) |
static aseSubMaterial_t * | _ase_get_submaterial (aseMaterial_t *list, int mtlIdParent, int subMtlId) |
static aseSubMaterial_t * | _ase_get_submaterial_or_default (aseMaterial_t *materials, int mtlIdParent, int subMtlId) |
static aseMaterial_t * | _ase_add_material (aseMaterial_t **list, int mtlIdParent) |
static aseSubMaterial_t * | _ase_add_submaterial (aseMaterial_t **list, int mtlIdParent, int subMtlId, picoShader_t *shader) |
static void | _ase_free_materials (aseMaterial_t **list) |
static int | _ase_canload (PM_PARAMS_CANLOAD) |
validates a 3dsmax ase model file. | |
static void | _ase_submit_triangles (picoModel_t *model, aseMaterial_t *materials, aseVertex_t *vertices, aseTexCoord_t *texcoords, aseColor_t *colors, aseFace_t *faces, int numFaces) |
use the surface and the current face list to look up material/submaterial IDs and submit them to the model for proper processing | |
static void | shadername_convert (char *shaderName) |
static picoModel_t * | _ase_load (PM_PARAMS_LOAD) |
loads a 3dsmax ase model file. | |
Variables | |
static picoColor_t | white = { 255, 255, 255, 255 } |
const picoModule_t | picoModuleASE |
#define _ase_error_return | ( | m | ) |
{ \ _pico_printf(PICO_ERROR, "%s in ASE, line %d.",m,p->curLine); \ _pico_free_parser(p); \ PicoFreeModel(model); \ return NULL; \ }
Referenced by _ase_load().
typedef struct aseColor_s aseColor_t |
typedef aseFace_t* aseFacesIter_t |
typedef struct aseMaterial_s aseMaterial_t |
typedef struct aseSubMaterial_s aseSubMaterial_t |
typedef struct aseTexCoord_s aseTexCoord_t |
typedef struct aseVertex_s aseVertex_t |
static aseMaterial_t* _ase_add_material | ( | aseMaterial_t ** | list, | |
int | mtlIdParent | |||
) | [static] |
Definition at line 123 of file pm_ase.c.
References _pico_calloc().
Referenced by _ase_add_submaterial().
static aseSubMaterial_t* _ase_add_submaterial | ( | aseMaterial_t ** | list, | |
int | mtlIdParent, | |||
int | subMtlId, | |||
picoShader_t * | shader | |||
) | [static] |
Definition at line 134 of file pm_ase.c.
References _ase_add_material(), _ase_get_material(), _pico_calloc(), aseSubMaterial_s::next, aseSubMaterial_s::shader, and aseSubMaterial_s::subMtlId.
Referenced by _ase_load().
static int _ase_canload | ( | PM_PARAMS_CANLOAD | ) | [static] |
validates a 3dsmax ase model file.
Definition at line 199 of file pm_ase.c.
References _pico_free_parser(), _pico_new_parser(), _pico_parse_first(), _pico_stricmp, PICO_PMV_ERROR_IDENT, PICO_PMV_ERROR_MEMORY, PICO_PMV_ERROR_SIZE, PICO_PMV_OK, and picoParser_s::token.
static void _ase_free_materials | ( | aseMaterial_t ** | list | ) | [static] |
Definition at line 152 of file pm_ase.c.
References _pico_free(), and aseSubMaterial_s::next.
Referenced by _ase_load().
static aseMaterial_t* _ase_get_material | ( | aseMaterial_t * | list, | |
int | mtlIdParent | |||
) | [static] |
Definition at line 73 of file pm_ase.c.
Referenced by _ase_add_submaterial(), and _ase_get_submaterial().
static aseSubMaterial_t* _ase_get_submaterial | ( | aseMaterial_t * | list, | |
int | mtlIdParent, | |||
int | subMtlId | |||
) | [static] |
Definition at line 86 of file pm_ase.c.
References _ase_get_material(), _pico_printf(), aseSubMaterial_s::next, PICO_ERROR, and aseSubMaterial_s::subMtlId.
Referenced by _ase_get_submaterial_or_default().
static aseSubMaterial_t* _ase_get_submaterial_or_default | ( | aseMaterial_t * | materials, | |
int | mtlIdParent, | |||
int | subMtlId | |||
) | [static] |
Definition at line 106 of file pm_ase.c.
References _ase_get_submaterial(), _pico_printf(), and PICO_ERROR.
Referenced by _ase_submit_triangles().
static picoModel_t* _ase_load | ( | PM_PARAMS_LOAD | ) | [static] |
loads a 3dsmax ase model file.
Definition at line 318 of file pm_ase.c.
References _ase_add_submaterial(), _ase_error_return, _ase_free_materials(), _ase_submit_triangles(), _pico_alloc(), _pico_calloc(), _pico_first_token(), _pico_free(), _pico_free_parser(), _pico_new_parser(), _pico_parse(), _pico_parse_check(), _pico_parse_first(), _pico_parse_float(), _pico_parse_int(), _pico_parse_skip_rest(), _pico_parse_vec(), _pico_printf(), _pico_stricmp, _pico_strnicmp, aseColor_s::color, i, aseFace_s::indices, int(), level, aseFace_s::materialId, name, PICO_NORMAL, PicoFreeModel(), PicoNewModel(), PicoNewShader(), PicoSetModelFileName(), PicoSetModelFrameNum(), PicoSetModelName(), PicoSetShaderAmbientColor(), PicoSetShaderDiffuseColor(), PicoSetShaderMapName(), PicoSetShaderName(), PicoSetShaderShininess(), PicoSetShaderSpecularColor(), PicoSetShaderTransparency(), shader, shadername_convert(), aseTexCoord_s::texcoord, and picoParser_s::token.
static void _ase_submit_triangles | ( | picoModel_t * | model, | |
aseMaterial_t * | materials, | |||
aseVertex_t * | vertices, | |||
aseTexCoord_t * | texcoords, | |||
aseColor_t * | colors, | |||
aseFace_t * | faces, | |||
int | numFaces | |||
) | [static] |
use the surface and the current face list to look up material/submaterial IDs and submit them to the model for proper processing
Definition at line 265 of file pm_ase.c.
References _ase_get_submaterial_or_default(), aseColor_s::color, i, PicoAddTriangleToModel(), aseSubMaterial_s::shader, st, aseTexCoord_s::texcoord, and white.
Referenced by _ase_load().
static void shadername_convert | ( | char * | shaderName | ) | [static] |
Definition at line 304 of file pm_ase.c.
Referenced by _ase_load().
const picoModule_t picoModuleASE |
{ "1.0", "Autodesk 3DSMAX ASCII", "Jared Hefty, seaw0lf", "2003 Jared Hefty, 2002 seaw0lf", { "ase", NULL, NULL, NULL }, _ase_canload, _ase_load, NULL, NULL }
picoColor_t white = { 255, 255, 255, 255 } [static] |
Definition at line 50 of file pm_ase.c.
Referenced by _ase_submit_triangles(), and MAP_DrawMapMarkers().