----------------------------------------------------------------------------- */
-/* marker */
-#define PM_LWO_C
-
/* dependencies */
#include "picointernal.h"
#include "lwo/lwo2.h"
int ret;
/* create a new pico memorystream */
- s = _pico_new_memstream( (picoByte_t *)buffer, bufSize );
+ s = _pico_new_memstream( (const picoByte_t *)buffer, bufSize );
if ( s == NULL ) {
return PICO_PMV_ERROR_MEMORY;
}
lwPolygon *pol;
lwPolVert *v;
lwVMapPt *vm;
- char name[ 64 ];
+ char name[256];
+ name[255] = '\0';
int i, j, k, numverts;
picoModel_t *picoModel;
}
/* create a new pico memorystream */
- s = _pico_new_memstream( (picoByte_t *)buffer, bufSize );
+ s = _pico_new_memstream( (const picoByte_t *)buffer, bufSize );
if ( s == NULL ) {
return NULL;
}
}
/* detox and set shader name */
- strncpy( name, surface->name, sizeof( name ) );
- _pico_setfext( name, "" );
+ strncpy( name, surface->name, sizeof( name ) - 1 );
+ _pico_first_token( name );
+ _pico_setfext( name, NULL );
_pico_unixify( name );
PicoSetShaderName( picoShader, name );
xyz[ 1 ] = pt->pos[ 2 ];
xyz[ 2 ] = pt->pos[ 1 ];
- normal[ 0 ] = v->norm[ 0 ];
- normal[ 1 ] = v->norm[ 2 ];
- normal[ 2 ] = v->norm[ 1 ];
+/* doom3 lwo data doesn't seem to have smoothing-angle information */
+#if 0
+ if ( surface->smooth <= 0 ) {
+ /* use face normals */
+ normal[ 0 ] = v->norm[ 0 ];
+ normal[ 1 ] = v->norm[ 2 ];
+ normal[ 2 ] = v->norm[ 1 ];
+ }
+ else
+#endif
+ {
+ /* smooth normals later */
+ normal[ 0 ] = 0;
+ normal[ 1 ] = 0;
+ normal[ 2 ] = 0;
+ }
st[ 0 ] = xyz[ defaultSTAxis[ 0 ] ] * defaultXYZtoSTScale[ 0 ];
st[ 1 ] = xyz[ defaultSTAxis[ 1 ] ] * defaultXYZtoSTScale[ 1 ];