StripExtension( token );
FixDOSName( token );
for ( i = 0; i < *texnum; i++ ){
- if ( !stricmp( texlist + i*65, token ) ) return;
+ if ( !Q_stricmp( texlist[i], token ) ) return;
}
for ( i = 0; i < *EXtexnum; i++ ){
- if ( !stricmp( EXtex + i*65, token ) ) return;
+ if ( !Q_stricmp( EXtex[i], token ) ) return;
}
- strcpy ( texlist[*texnum], token );
+ strcpy ( texlist + (*texnum)*65, token );
(*texnum)++;
return;
}
/*
Check if newcoming res is unique
*/
- void res2list( char data[512][MAX_QPATH], int *num ){
+ void res2list( char* data, int *num ){
int i;
- if ( data[*num][0] == '\0') return;
+ if ( *( data + (*num)*65 ) == '\0') return;
for ( i = 0; i < *num; i++ ){
- if ( !stricmp( data + i*65, data + (*num)*65 ) ) return;
+ if ( !Q_stricmp( data[i], data[*num] ) ) return;
}
(*num)++;
return;
epair_t *ep;
for ( ep = entities[0].epairs; ep != NULL; ep = ep->next )
{
- if ( !strnicmp( ep->key, "vertexremapshader", 17 ) ) {
+ if ( !Q_strncasecmp( ep->key, "vertexremapshader", 17 ) ) {
- sscanf( ep->value, "%*[^;] %*[;] %s", pk3Shaders[pk3ShadersN] );
+ sscanf( ep->value, "%*[^;] %*[;] %s", pk3Shaders + pk3ShadersN*65 );
res2list( pk3Shaders, &pk3ShadersN );
}
}
for ( i = 0; i < numBSPEntities && i < numEntities; i++ )
{
- strcpy( pk3Sounds[pk3SoundsN], ValueForKey( &entities[i], "noise" ) );
- if ( pk3Sounds[pk3SoundsN][0] != '*' ) res2list( pk3Sounds, &pk3SoundsN );
+ strcpy( pk3Sounds + pk3SoundsN*65, ValueForKey( &entities[i], "noise" ) );
+ if ( *( pk3Sounds + pk3SoundsN*65 ) != '\0' && *( pk3Sounds + pk3SoundsN*65 ) != '*' ){
+ FixDOSName( pk3Sounds + pk3SoundsN*65 );
+ DefaultExtension( pk3Sounds + pk3SoundsN*65, ".wav" );
+ res2list( pk3Sounds, &pk3SoundsN );
+ }
- if ( !stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
+ if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
- strcpy( pk3Sounds[pk3SoundsN], "sound/movers/plats/pt1_strt.wav");
+ strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_strt.wav");
res2list( pk3Sounds, &pk3SoundsN );
- strcpy( pk3Sounds[pk3SoundsN], "sound/movers/plats/pt1_end.wav");
+ strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_end.wav");
res2list( pk3Sounds, &pk3SoundsN );
}
- if ( !stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
+ if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
if ( !(IntForKey( &entities[i], "spawnflags") & 1) ){
- strcpy( pk3Sounds[pk3SoundsN], "sound/misc/windfly.wav");
+ strcpy( pk3Sounds + pk3SoundsN*65, "sound/misc/windfly.wav");
res2list( pk3Sounds, &pk3SoundsN );
}
}
/* do wanna le shader? */
wantShader = qfalse;
for ( j = 0; j < pk3ShadersN; j++ ){
- if ( !Q_stricmp( pk3Shaders[j], token) ){
- strcpy ( shadername, pk3Shaders[j] );
- pk3Shaders[j][0] = '\0';
- if ( !stricmp( pk3Shaders + j*65, token) ){
++ if ( !Q_stricmp( pk3Shaders + j*65, token) ){
+ strcpy ( shadername, pk3Shaders + j*65 );
+ *(pk3Shaders + j*65) = '\0';
wantShader = qtrue;
break;
}
strcpy( token, temp );
}
for ( j = 0; j < pk3VideosN; j++ ){
- if ( !Q_stricmp( pk3Videos[j], token ) ){
- if ( !stricmp( pk3Videos + j*65, token ) ){
++ if ( !Q_stricmp( pk3Videos + j*65, token ) ){
goto away;
}
}
for ( j = 0; j < EXpk3VideosN; j++ ){
- if ( !Q_stricmp( EXpk3Videos[j], token ) ){
- if ( !stricmp( EXpk3Videos + j*65, token ) ){
++ if ( !Q_stricmp( EXpk3Videos + j*65, token ) ){
goto away;
}
}
//exclude shader
if ( wantShader ){
for ( j = 0; j < EXpk3ShadersN; j++ ){
- if ( !Q_stricmp( EXpk3Shaders[j], shadername ) ){
- if ( !stricmp( EXpk3Shaders + j*65, shadername ) ){
++ if ( !Q_stricmp( EXpk3Shaders + j*65, shadername ) ){
wantShader = qfalse;
break;
}
/* shouldnt make shaders for shipped with the game textures aswell */
if ( wantShader ){
for ( j = 0; j < EXpk3TexturesN; j++ ){
- if ( !Q_stricmp( EXpk3Textures[j], shadername ) ){
- if ( !stricmp( EXpk3Textures + j*65, shadername ) ){
++ if ( !Q_stricmp( EXpk3Textures + j*65, shadername ) ){
wantShader = qfalse;
break;
}
//exclude shader file
if ( wantShaderFile ){
for ( j = 0; j < EXpk3ShaderfilesN; j++ ){
- if ( !Q_stricmp( EXpk3Shaderfiles[j], pk3Shaderfiles[ i ] ) ){
- Sys_Printf( "WARNING: excluded shader %s, since it was located in restricted shader file: %s\n", lastwantedShader, pk3Shaderfiles[i] );
- pk3Shaderfiles[ i ][0] = '\0';
- if ( !stricmp( EXpk3Shaderfiles + j*65, pk3Shaderfiles + i*65 ) ){
++ if ( !Q_stricmp( EXpk3Shaderfiles + j*65, pk3Shaderfiles + i*65 ) ){
+ Sys_Printf( "WARNING: excluded shader %s, since it was located in restricted shader file: %s\n", lastwantedShader, pk3Shaderfiles + i*65 );
+ *( pk3Shaderfiles + i*65 ) = '\0';
break;
}
}
/* exclude stuff */
//pure textures (shader ones are done)
for ( i = 0; i < pk3ShadersN; i++ ){
- if ( pk3Shaders[i][0] != '\0' ){
- FixDOSName( pk3Shaders[i] );
+ if ( *( pk3Shaders + i*65 ) != '\0' ){
+ FixDOSName( pk3Shaders + i*65 );
for ( j = 0; j < pk3TexturesN; j++ ){
- if ( !Q_stricmp( pk3Shaders[i], pk3Textures[j] ) ){
- pk3Shaders[i][0] = '\0';
- if ( !stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){
++ if ( !Q_stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){
+ *( pk3Shaders + i*65 ) = '\0';
break;
}
}
- if ( pk3Shaders[i][0] == '\0' ) continue;
+ if ( *( pk3Shaders + i*65 ) == '\0' ) continue;
for ( j = 0; j < EXpk3TexturesN; j++ ){
- if ( !Q_stricmp( pk3Shaders[i], EXpk3Textures[j] ) ){
- pk3Shaders[i][0] = '\0';
- if ( !stricmp( pk3Shaders + i*65, EXpk3Textures + j*65 ) ){
++ if ( !Q_stricmp( pk3Shaders + i*65, EXpk3Textures + j*65 ) ){
+ *( pk3Shaders + i*65 ) = '\0';
break;
}
}
//snds
for ( i = 0; i < pk3SoundsN; i++ ){
- FixDOSName( pk3Sounds[i] );
for ( j = 0; j < EXpk3SoundsN; j++ ){
- if ( !Q_stricmp( pk3Sounds[i], EXpk3Sounds[j] ) ){
- pk3Sounds[i][0] = '\0';
- if ( !stricmp( pk3Sounds + i*65, EXpk3Sounds + j*65 ) ){
++ if ( !Q_stricmp( pk3Sounds + i*65, EXpk3Sounds + j*65 ) ){
+ *( pk3Sounds + i*65 ) = '\0';
break;
}
}