pm_obj.c File Reference

#include "picointernal.h"
Include dependency graph for pm_obj.c:

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 TObjVertexDataSizeObjVertexData (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 Documentation

#define _obj_error_return ( m   ) 
Value:
{ \
        _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 PM_OBJ_C

Definition at line 36 of file pm_obj.c.

#define SIZE_OBJ_STEP   4096

Definition at line 119 of file pm_obj.c.

Referenced by SizeObjVertexData().


Typedef Documentation

this holds temporary vertex data read by parser


Function Documentation

static int _obj_canload ( PM_PARAMS_CANLOAD   )  [static]
static picoShader_t* _obj_default_shader ( picoModel_t model  )  [static]
static picoModel_t* _obj_load ( PM_PARAMS_LOAD   )  [static]
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().


Variable Documentation

Initial value:
 { "0.6-b", 
"Wavefront ASCII", 
"seaw0lf", 
"2002 seaw0lf", 
{ "obj", NULL, NULL, NULL 
}, _obj_canload, 
_obj_load, 
NULL, 
NULL 
}

Definition at line 821 of file pm_obj.c.


Generated by  doxygen 1.6.2