#include "picointernal.h"
Go to the source code of this file.
Data Structures | |
struct | SObjVertexData |
Defines | |
#define | PM_OBJ_C |
#define | SIZE_OBJ_STEP 4096 |
#define | _obj_error_return(m) |
Typedefs | |
typedef struct SObjVertexData | TObjVertexData |
Functions | |
static int | _obj_canload (PM_PARAMS_CANLOAD) |
validates a wavefront obj model file. | |
static TObjVertexData * | SizeObjVertexData (TObjVertexData *vertexData, int reqEntries, int *entries, int *allocated) |
This pretty piece of 'alloc ahead' code dynamically allocates - and reallocates as soon as required - my vertex data array in even steps. | |
static void | FreeObjVertexData (TObjVertexData *vertexData) |
static picoShader_t * | _obj_default_shader (picoModel_t *model) |
static picoModel_t * | _obj_load (PM_PARAMS_LOAD) |
loads a wavefront obj model file. | |
Variables | |
const picoModule_t | picoModuleOBJ |
#define _obj_error_return | ( | m | ) |
{ \ _pico_printf( PICO_ERROR,"%s in OBJ, line %d.",m,p->curLine); \ _pico_free_parser( p ); \ FreeObjVertexData( vertexData ); \ PicoFreeModel( model ); \ return NULL; \ }
Referenced by _obj_load().
#define SIZE_OBJ_STEP 4096 |
Definition at line 119 of file pm_obj.c.
Referenced by SizeObjVertexData().
typedef struct SObjVertexData TObjVertexData |
this holds temporary vertex data read by parser
static int _obj_canload | ( | PM_PARAMS_CANLOAD | ) | [static] |
validates a wavefront obj model file.
Definition at line 62 of file pm_obj.c.
References _pico_free_parser(), _pico_new_parser(), _pico_parse_first(), _pico_parse_skip_rest(), _pico_stricmp, _pico_stristr(), picoParser_s::curLine, PICO_PMV_ERROR, PICO_PMV_ERROR_MEMORY, PICO_PMV_ERROR_SIZE, PICO_PMV_OK, and picoParser_s::token.
static picoShader_t* _obj_default_shader | ( | picoModel_t * | model | ) | [static] |
Definition at line 195 of file pm_obj.c.
References _pico_clone_alloc(), _pico_free(), _pico_setfext(), picoModel_s::fileName, PicoNewShader(), and PicoSetShaderName().
Referenced by _obj_load().
static picoModel_t* _obj_load | ( | PM_PARAMS_LOAD | ) | [static] |
loads a wavefront obj model file.
Definition at line 466 of file pm_obj.c.
References _obj_default_shader(), _obj_error_return, _pico_copy_vec(), _pico_copy_vec2(), _pico_free_parser(), _pico_new_parser(), _pico_parse(), _pico_parse_first(), _pico_parse_skip_rest(), _pico_parse_vec(), _pico_parse_vec2(), _pico_strchcount(), _pico_stricmp, data, FreeObjVertexData(), i, PICO_TRIANGLES, PicoNewModel(), PicoNewSurface(), PicoSetModelFileName(), PicoSetModelFrameNum(), PicoSetModelName(), PicoSetSurfaceIndex(), PicoSetSurfaceName(), PicoSetSurfaceNormal(), PicoSetSurfaceShader(), PicoSetSurfaceST(), PicoSetSurfaceType(), PicoSetSurfaceXYZ(), SizeObjVertexData(), picoParser_s::token, SObjVertexData::v, SObjVertexData::vn, and SObjVertexData::vt.
static void FreeObjVertexData | ( | TObjVertexData * | vertexData | ) | [static] |
Definition at line 188 of file pm_obj.c.
Referenced by _obj_load().
static TObjVertexData* SizeObjVertexData | ( | TObjVertexData * | vertexData, | |
int | reqEntries, | |||
int * | entries, | |||
int * | allocated | |||
) | [static] |
This pretty piece of 'alloc ahead' code dynamically allocates - and reallocates as soon as required - my vertex data array in even steps.
Definition at line 125 of file pm_obj.c.
References _pico_alloc(), _pico_realloc(), and SIZE_OBJ_STEP.
Referenced by _obj_load().
const picoModule_t picoModuleOBJ |
{ "0.6-b", "Wavefront ASCII", "seaw0lf", "2002 seaw0lf", { "obj", NULL, NULL, NULL }, _obj_canload, _obj_load, NULL, NULL }