if ( VectorLength( si->color ) <= 0.0f ) {
ColorNormalize( color, si->color );
VectorScale( color, ( 1.0f / count ), si->averageColor );
+ si->averageColor[ 3 ] = color[ 3 ] / count;
}
else
{
VectorCopy( si->color, si->averageColor );
+ si->averageColor[ 3 ] = 1.0f;
}
}
if ( !GetTokenAppend( buffer, qtrue ) || strcmp( token, "(" ) ) {
- Error( "Parse1DMatrixAppend(): line %d: ( not found!", scriptline );
+ Error( "Parse1DMatrixAppend(): line %d: ( not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
for ( i = 0; i < x; i++ )
{
if ( !GetTokenAppend( buffer, qfalse ) ) {
- Error( "Parse1DMatrixAppend(): line %d: Number not found!", scriptline );
+ Error( "Parse1DMatrixAppend(): line %d: Number not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
m[ i ] = atof( token );
}
if ( !GetTokenAppend( buffer, qtrue ) || strcmp( token, ")" ) ) {
- Error( "Parse1DMatrixAppend(): line %d: ) not found!", scriptline );
+ Error( "Parse1DMatrixAppend(): line %d: ) not found!\nFile location be: %s\n", scriptline, g_strLoadedFileLocation );
}
}
}
if ( strcmp( token, "{" ) ) {
if ( si != NULL ) {
- Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nLast known shader: %s",
- filename, scriptline, token, si->shader );
+ Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nLast known shader: %s\nFile location be: %s\n",
+ filename, scriptline, token, si->shader, g_strLoadedFileLocation );
}
else{
- Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s",
- filename, scriptline, token );
+ Error( "ParseShaderFile(): %s, line %d: { not found!\nFound instead: %s\nFile location be: %s\n",
+ filename, scriptline, token, g_strLoadedFileLocation );
}
}
!Q_stricmp( token, "clampMap" ) ||
!Q_stricmp( token, "animMap" ) ||
!Q_stricmp( token, "clampAnimMap" ) ||
- !Q_stricmp( token, "clampMap" ) ||
!Q_stricmp( token, "mapComp" ) ||
!Q_stricmp( token, "mapNoComp" ) ) {
/* skip one token for animated stages */
else if ( !Q_stricmp( token, "sun" ) /* sof2 */ || !Q_stricmp( token, "q3map_sun" ) || !Q_stricmp( token, "q3map_sunExt" ) ) {
float a, b;
sun_t *sun;
- qboolean ext;
-
+ qboolean ext = qfalse;
/* ydnar: extended sun directive? */
if ( !Q_stricmp( token, "q3map_sunext" ) ) {
}
/* allocate sun */
- sun = safe_malloc( sizeof( *sun ) );
- memset( sun, 0, sizeof( *sun ) );
+ sun = safe_malloc0( sizeof( *sun ) );
/* set style */
sun->style = si->lightStyle;
surfaceModel_t *model;
/* allocate new model and attach it */
- model = safe_malloc( sizeof( *model ) );
- memset( model, 0, sizeof( *model ) );
+ model = safe_malloc0( sizeof( *model ) );
model->next = si->surfaceModel;
si->surfaceModel = model;
/* allocate new foliage struct and attach it */
- foliage = safe_malloc( sizeof( *foliage ) );
- memset( foliage, 0, sizeof( *foliage ) );
+ foliage = safe_malloc0( sizeof( *foliage ) );
foliage->next = si->foliage;
si->foliage = foliage;
alpha = ( !Q_stricmp( token, "q3map_alphaGen" ) || !Q_stricmp( token, "q3map_alphaMod" ) ) ? 1 : 0;
/* allocate new colormod */
- cm = safe_malloc( sizeof( *cm ) );
- memset( cm, 0, sizeof( *cm ) );
+ cm = safe_malloc0( sizeof( *cm ) );
/* attach to shader */
if ( si->colorMod == NULL ) {