----------------------------------------------------------------------------- */
-
-
-/* marker */
-#define PICOMODEL_C
-
-
-
/* dependencies */
#include "picointernal.h"
}
}
+ _pico_deduce_shadernames( model );
+
return model;
}
*/
picoShader_t *PicoFindShader( picoModel_t *model, char *name, int caseSensitive ){
- int i;
-
-
/* sanity checks */
if ( model == NULL || name == NULL ) { /* sea: null name fix */
return NULL;
}
/* walk list */
- for ( i = 0; i < model->numShaders; i++ )
+ for ( int i = 0; i < model->numShaders; i++ )
{
/* skip null shaders or shaders with null names */
if ( model->shader[ i ] == NULL ||
-void PicoSetSurfaceColor( picoSurface_t *surface, int array, int num, picoColor_t color ){
+void PicoSetSurfaceColor( picoSurface_t *surface, int array, int num, const picoColor_t color ){
if ( surface == NULL || num < 0 || color == NULL ) {
return;
}
/* hashtable code for faster vertex lookups */
//#define HASHTABLE_SIZE 32768 // 2048 /* power of 2, use & */
-#define HASHTABLE_SIZE 7919 // 32749 // 2039 /* prime, use % */
+const int HASHTABLE_SIZE = 7919; // 32749 // 2039 /* prime, use % */
int PicoGetHashTableSize( void ){
return HASHTABLE_SIZE;
fixme: needs non-naive algorithm
*/
-int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, picoColor_t *color, picoIndex_t smoothingGroup ){
+int PicoFindSurfaceVertexNum( picoSurface_t *surface, picoVec3_t xyz, picoVec3_t normal, int numSTs, picoVec2_t *st, int numColors, const picoColor_t *color, picoIndex_t smoothingGroup ){
int i, j;
if ( numColors > 0 && color != NULL ) {
for ( j = 0; j < numSTs; j++ )
{
- if ( *( (int*) surface->color[ j ] ) != *( (int*) color[ j ] ) ) {
+ if ( *( (const int*) surface->color[ j ] ) != *( (const int*) color[ j ] ) ) {
break;
}
}
*/
void PicoAddTriangleToModel( picoModel_t *model, picoVec3_t** xyz, picoVec3_t** normals,
- int numSTs, picoVec2_t **st, int numColors, picoColor_t **colors,
+ int numSTs, picoVec2_t **st, int numColors, const picoColor_t **colors,
picoShader_t* shader, const char *name, picoIndex_t* smoothingGroup ){
int i,j;
int vertDataIndex;