----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PM_OBJ_C
-
/* dependencies */
#include "picointernal.h"
+#include "globaldefs.h"
/* disable warnings */
-#ifdef WIN32
+#if GDEF_COMPILER_MSVC
#pragma warning( disable:4100 ) /* unref param */
#endif
* allocates - and reallocates as soon as required -
* my vertex data array in even steps.
*/
-#define SIZE_OBJ_STEP 4096
+const int SIZE_OBJ_STEP = 4096;
static TObjVertexData *SizeObjVertexData(
TObjVertexData *vertexData, int reqEntries,
newSurface = PicoNewSurface( model ); \
if ( newSurface == NULL ) { \
_obj_error_return( "Error allocating surface" ); } \
- /* reset face index for surface */ \
+ /* reset face index and vertex index for surface */ \
curFace = 0; \
+ curVertex = 0; \
/* if we can, assign the previous shader to this surface */ \
if ( curSurface ) { \
PicoSetSurfaceShader( newSurface, curSurface->shader ); } \
/* helper */
#define _obj_error_return( m ) \
{ \
- _pico_printf( PICO_ERROR,"%s in OBJ, line %d.",m,p->curLine ); \
+ _pico_printf( PICO_ERROR, "%s in OBJ %s, line %d.", m, model->fileName, p->curLine ); \
_pico_free_parser( p ); \
FreeObjVertexData( vertexData ); \
PicoFreeModel( model ); \
#endif
}
- if ( curFace == 0 ) {
+ if ( curFace == 0 && curSurface != NULL ) {
PicoSetSurfaceName( curSurface,groupName );
}
else