wrap Q_stricmp use

This commit is contained in:
Garux 2020-01-24 02:47:33 +03:00
parent 3409de2cb0
commit c7f1391177
19 changed files with 202 additions and 202 deletions

View File

@ -819,7 +819,7 @@ void LoadBMP( const char *filename, byte **pic, byte **palette, int *width, int
void Load256Image( const char *name, byte **pixels, byte **palette, int *width, int *height ){ void Load256Image( const char *name, byte **pixels, byte **palette, int *width, int *height ){
const char *ext = path_get_extension( name ); const char *ext = path_get_extension( name );
if ( !Q_stricmp( ext, "lbm" ) ) { if ( striEqual( ext, "lbm" ) ) {
LoadLBM( name, pixels, palette ); LoadLBM( name, pixels, palette );
if ( width ) { if ( width ) {
*width = bmhd.w; *width = bmhd.w;
@ -828,10 +828,10 @@ void Load256Image( const char *name, byte **pixels, byte **palette, int *width,
*height = bmhd.h; *height = bmhd.h;
} }
} }
else if ( !Q_stricmp( ext, "pcx" ) ) { else if ( striEqual( ext, "pcx" ) ) {
LoadPCX( name, pixels, palette, width, height ); LoadPCX( name, pixels, palette, width, height );
} }
else if ( !Q_stricmp( ext, "bmp" ) ) { else if ( striEqual( ext, "bmp" ) ) {
LoadBMP( name, pixels, palette, width, height ); LoadBMP( name, pixels, palette, width, height );
} }
else{ else{
@ -851,10 +851,10 @@ void Save256Image( const char *name, byte *pixels, byte *palette,
int width, int height ){ int width, int height ){
const char *ext = path_get_extension( name ); const char *ext = path_get_extension( name );
if ( !Q_stricmp( ext, "lbm" ) ) { if ( striEqual( ext, "lbm" ) ) {
WriteLBMfile( name, pixels, width, height, palette ); WriteLBMfile( name, pixels, width, height, palette );
} }
else if ( !Q_stricmp( ext, "pcx" ) ) { else if ( striEqual( ext, "pcx" ) ) {
WritePCXfile( name, pixels, width, height, palette ); WritePCXfile( name, pixels, width, height, palette );
} }
else{ else{
@ -1200,7 +1200,7 @@ void Load32BitImage( const char *name, unsigned **pixels, int *width, int *heig
int i; int i;
int v; int v;
if ( !Q_stricmp( path_get_extension( name ), "tga" ) ) { if ( striEqual( path_get_extension( name ), "tga" ) ) {
LoadTGA( name, (byte **)pixels, width, height ); LoadTGA( name, (byte **)pixels, width, height );
} }
else { else {

View File

@ -184,11 +184,11 @@ void vfsInitDirectory( const char *path ){
const char *ext = path_get_filename_base_end( name ); const char *ext = path_get_filename_base_end( name );
if ( !Q_stricmp( ext, ".pk3" ) ) { if ( striEqual( ext, ".pk3" ) ) {
sprintf( filename, "%s/%s", path, name ); sprintf( filename, "%s/%s", path, name );
vfsInitPakFile( filename ); vfsInitPakFile( filename );
} }
else if ( !Q_stricmp( ext, ".pk3dir" ) ) { else if ( striEqual( ext, ".pk3dir" ) ) {
if ( g_numDirs == VFS_MAXDIRS ) { if ( g_numDirs == VFS_MAXDIRS ) {
continue; continue;
} }
@ -218,7 +218,7 @@ void vfsListShaderFiles( StrList* list, void pushStringCallback( StrList* list,
const char* name; const char* name;
while ( ( name = g_dir_read_name( dir ) ) ) while ( ( name = g_dir_read_name( dir ) ) )
{ {
if ( !Q_stricmp( path_get_filename_base_end( name ), ".shader" ) ) { if ( striEqual( path_get_filename_base_end( name ), ".shader" ) ) {
pushStringCallback( list, name ); pushStringCallback( list, name );
} }
} }
@ -231,7 +231,7 @@ void vfsListShaderFiles( StrList* list, void pushStringCallback( StrList* list,
for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) ) for ( lst = g_pakFiles; lst != NULL; lst = g_slist_next( lst ) )
{ {
VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data; VFS_PAKFILE* file = (VFS_PAKFILE*)lst->data;
if ( !Q_stricmp( path_get_filename_base_end( file->name ), ".shader" ) ) { if ( striEqual( path_get_filename_base_end( file->name ), ".shader" ) ) {
pushStringCallback( list, path_get_filename_start( file->name ) ); pushStringCallback( list, path_get_filename_start( file->name ) );
} }
} }

View File

@ -96,7 +96,7 @@ int CharIsTokenDelimiter( int ch ){
int P3DSkipToToken( const char *name ){ int P3DSkipToToken( const char *name ){
while ( P3DGetToken( 0 ) ) while ( P3DGetToken( 0 ) )
{ {
if ( !Q_stricmp( s_token, name ) ) { if ( striEqual( s_token, name ) ) {
return 1; return 1;
} }
} }
@ -161,14 +161,14 @@ int P3DSkipToTokenInBlock( const char *name ){
while ( P3DGetToken( 0 ) ) while ( P3DGetToken( 0 ) )
{ {
if ( !Q_stricmp( s_token, "}" ) ) { if ( strEqual( s_token, "}" ) ) {
iLevel--; iLevel--;
} }
else if ( !Q_stricmp( s_token, "{" ) ) { else if ( strEqual( s_token, "{" ) ) {
iLevel++; iLevel++;
} }
if ( !Q_stricmp( s_token, name ) ) { if ( striEqual( s_token, name ) ) {
return 1; return 1;
} }
@ -195,7 +195,7 @@ int P3DProcess(){
// skip to the first Obj declaration // skip to the first Obj declaration
while ( P3DGetToken( 0 ) ) while ( P3DGetToken( 0 ) )
{ {
if ( !Q_stricmp( s_token, "Obj" ) ) { if ( striEqual( s_token, "Obj" ) ) {
int j = 0, k = 0; int j = 0, k = 0;
if ( P3DSkipToToken( "Text" ) ) { if ( P3DSkipToToken( "Text" ) ) {
@ -290,7 +290,7 @@ void SkinFromP3D( const char *file ){
// corresponds to and append the shader to it // corresponds to and append the shader to it
for ( i = 0; i < g_data.model.numSurfaces; i++ ) for ( i = 0; i < g_data.model.numSurfaces; i++ )
{ {
if ( !Q_stricmp( g_data.surfData[i].header.name, psetName ) ) { if ( striEqual( g_data.surfData[i].header.name, psetName ) ) {
char *p; char *p;
if ( strstr( associatedShader, gamedir + 1 ) ) { if ( strstr( associatedShader, gamedir + 1 ) ) {

View File

@ -386,7 +386,7 @@ void ReleaseTexture( char *name ){
char path[1024]; char path[1024];
for ( i = 0 ; i < numrtex ; i++ ) for ( i = 0 ; i < numrtex ; i++ )
if ( !Q_stricmp( name, rtex[i] ) ) { if ( striEqual( name, rtex[i] ) ) {
return; return;
} }

View File

@ -60,7 +60,7 @@ static inline void StrList_append( StrList* list, const char* string ){
/* returns index + 1 for boolean use */ /* returns index + 1 for boolean use */
static inline int StrList_find( const StrList* list, const char* string ){ static inline int StrList_find( const StrList* list, const char* string ){
for ( int i = 0; i < list->n; ++i ){ for ( int i = 0; i < list->n; ++i ){
if ( !Q_stricmp( list->s[i], string ) ) if ( striEqual( list->s[i], string ) )
return i + 1; return i + 1;
} }
return 0; return 0;
@ -80,7 +80,7 @@ static inline void tex2list( StrList* texlist, StrList* EXtex, StrList* rEXtex )
return; return;
//StripExtension( token ); //StripExtension( token );
char* dot = path_get_filename_base_end( token ); char* dot = path_get_filename_base_end( token );
if( !Q_stricmp( dot, ".tga" ) || !Q_stricmp( dot, ".jpg" ) || !Q_stricmp( dot, ".png" ) ){ //? might want to also warn on png in non png run if( striEqual( dot, ".tga" ) || striEqual( dot, ".jpg" ) || striEqual( dot, ".png" ) ){ //? might want to also warn on png in non png run
strClear( dot ); strClear( dot );
} }
else{ else{
@ -159,19 +159,19 @@ static void parseEXfile( const char* filename, StrList* ExTextures, StrList* ExS
} }
/* blocks */ /* blocks */
if ( !Q_stricmp( token, "textures" ) ){ if ( striEqual( token, "textures" ) ){
parseEXblock( ExTextures, exName ); parseEXblock( ExTextures, exName );
} }
else if ( !Q_stricmp( token, "shaders" ) ){ else if ( striEqual( token, "shaders" ) ){
parseEXblock( ExShaders, exName ); parseEXblock( ExShaders, exName );
} }
else if ( !Q_stricmp( token, "shaderfiles" ) ){ else if ( striEqual( token, "shaderfiles" ) ){
parseEXblock( ExShaderfiles, exName ); parseEXblock( ExShaderfiles, exName );
} }
else if ( !Q_stricmp( token, "sounds" ) ){ else if ( striEqual( token, "sounds" ) ){
parseEXblock( ExSounds, exName ); parseEXblock( ExSounds, exName );
} }
else if ( !Q_stricmp( token, "videos" ) ){ else if ( striEqual( token, "videos" ) ){
parseEXblock( ExVideos, exName ); parseEXblock( ExVideos, exName );
} }
else{ else{
@ -330,11 +330,11 @@ int pk3BSPMain( int argc, char **argv ){
res2list( pk3Sounds, str ); res2list( pk3Sounds, str );
} }
if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){ if ( striEqual( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
res2list( pk3Sounds, "sound/movers/plats/pt1_strt.wav" ); res2list( pk3Sounds, "sound/movers/plats/pt1_strt.wav" );
res2list( pk3Sounds, "sound/movers/plats/pt1_end.wav" ); res2list( pk3Sounds, "sound/movers/plats/pt1_end.wav" );
} }
if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){ if ( striEqual( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
if ( !( IntForKey( &entities[i], "spawnflags") & 1 ) ){ if ( !( IntForKey( &entities[i], "spawnflags") & 1 ) ){
res2list( pk3Sounds, "sound/misc/windfly.wav" ); res2list( pk3Sounds, "sound/misc/windfly.wav" );
} }
@ -548,7 +548,7 @@ int pk3BSPMain( int argc, char **argv ){
if ( strEqual( token, "{" ) ) { if ( strEqual( token, "{" ) ) {
Sys_FPrintf( SYS_WRN, "WARNING9: %s : line %d : opening brace inside shader stage\n", scriptFile, scriptline ); Sys_FPrintf( SYS_WRN, "WARNING9: %s : line %d : opening brace inside shader stage\n", scriptFile, scriptline );
} }
if ( !Q_stricmp( token, "mapComp" ) || !Q_stricmp( token, "mapNoComp" ) || !Q_stricmp( token, "animmapcomp" ) || !Q_stricmp( token, "animmapnocomp" ) ){ if ( striEqual( token, "mapComp" ) || striEqual( token, "mapNoComp" ) || striEqual( token, "animmapcomp" ) || striEqual( token, "animmapnocomp" ) ){
Sys_FPrintf( SYS_WRN, "WARNING7: %s : line %d : unsupported '%s' map directive\n", scriptFile, scriptline, token ); Sys_FPrintf( SYS_WRN, "WARNING7: %s : line %d : unsupported '%s' map directive\n", scriptFile, scriptline, token );
} }
/* skip the shader */ /* skip the shader */
@ -556,8 +556,8 @@ int pk3BSPMain( int argc, char **argv ){
continue; continue;
/* digest any images */ /* digest any images */
if ( !Q_stricmp( token, "map" ) || if ( striEqual( token, "map" ) ||
!Q_stricmp( token, "clampMap" ) ) { striEqual( token, "clampMap" ) ) {
hasmap = true; hasmap = true;
/* get an image */ /* get an image */
GetToken( false ); GetToken( false );
@ -565,8 +565,8 @@ int pk3BSPMain( int argc, char **argv ){
tex2list( pk3Textures, ExTextures, NULL ); tex2list( pk3Textures, ExTextures, NULL );
} }
} }
else if ( !Q_stricmp( token, "animMap" ) || else if ( striEqual( token, "animMap" ) ||
!Q_stricmp( token, "clampAnimMap" ) ) { striEqual( token, "clampAnimMap" ) ) {
hasmap = true; hasmap = true;
GetToken( false );// skip num GetToken( false );// skip num
while ( TokenAvailable() ){ while ( TokenAvailable() ){
@ -574,7 +574,7 @@ int pk3BSPMain( int argc, char **argv ){
tex2list( pk3Textures, ExTextures, NULL ); tex2list( pk3Textures, ExTextures, NULL );
} }
} }
else if ( !Q_stricmp( token, "videoMap" ) ){ else if ( striEqual( token, "videoMap" ) ){
hasmap = true; hasmap = true;
GetToken( false ); GetToken( false );
FixDOSName( token ); FixDOSName( token );
@ -600,22 +600,22 @@ int pk3BSPMain( int argc, char **argv ){
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
/* match surfaceparm */ /* match surfaceparm */
else if ( !Q_stricmp( token, "surfaceparm" ) ) { else if ( striEqual( token, "surfaceparm" ) ) {
GetToken( false ); GetToken( false );
if ( !Q_stricmp( token, "nodraw" ) ) { if ( striEqual( token, "nodraw" ) ) {
wantShader = false; wantShader = false;
pk3Shaders->s[shader][0] = '\0'; pk3Shaders->s[shader][0] = '\0';
} }
} }
/* skyparms <outer image> <cloud height> <inner image> */ /* skyparms <outer image> <cloud height> <inner image> */
else if ( !Q_stricmp( token, "skyParms" ) ) { else if ( striEqual( token, "skyParms" ) ) {
hasmap = true; hasmap = true;
/* get image base */ /* get image base */
GetToken( false ); GetToken( false );
/* ignore bogus paths */ /* ignore bogus paths */
if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) { if ( !striEqual( token, "-" ) && !striEqual( token, "full" ) ) {
const char skysides[6][3] = { "up", "dn", "lf", "rt", "bk", "ft" }; const char skysides[6][3] = { "up", "dn", "lf", "rt", "bk", "ft" };
char* const skysidestring = token + strcatQ( token, "_@@.tga", sizeof( token ) ) - 6; char* const skysidestring = token + strcatQ( token, "_@@.tga", sizeof( token ) ) - 6;
for( size_t side = 0; side < 6; ++side ){ for( size_t side = 0; side < 6; ++side ){
@ -627,7 +627,7 @@ int pk3BSPMain( int argc, char **argv ){
GetToken( false ); GetToken( false );
GetToken( false ); GetToken( false );
} }
else if ( !Q_stricmp( token, "fogparms" ) ){ else if ( striEqual( token, "fogparms" ) ){
hasmap = true; hasmap = true;
} }
} }
@ -902,7 +902,7 @@ int repackBSPMain( int argc, char **argv ){
/* do some path mangling */ /* do some path mangling */
strcpy( source, ExpandArg( argv[ argc - 1 ] ) ); strcpy( source, ExpandArg( argv[ argc - 1 ] ) );
if ( !Q_stricmp( path_get_filename_base_end( source ), ".bsp" ) ){ if ( striEqual( path_get_filename_base_end( source ), ".bsp" ) ){
strcpy( bspList[bspListN], source ); strcpy( bspList[bspListN], source );
bspListN++; bspListN++;
} }
@ -1002,11 +1002,11 @@ int repackBSPMain( int argc, char **argv ){
res2list( pk3Sounds, str ); res2list( pk3Sounds, str );
} }
if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){ if ( striEqual( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){
res2list( pk3Sounds, "sound/movers/plats/pt1_strt.wav" ); res2list( pk3Sounds, "sound/movers/plats/pt1_strt.wav" );
res2list( pk3Sounds, "sound/movers/plats/pt1_end.wav" ); res2list( pk3Sounds, "sound/movers/plats/pt1_end.wav" );
} }
if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){ if ( striEqual( ValueForKey( &entities[i], "classname" ), "target_push" ) ){
if ( !( IntForKey( &entities[i], "spawnflags") & 1 ) ){ if ( !( IntForKey( &entities[i], "spawnflags") & 1 ) ){
res2list( pk3Sounds, "sound/misc/windfly.wav" ); res2list( pk3Sounds, "sound/misc/windfly.wav" );
} }
@ -1277,8 +1277,8 @@ int repackBSPMain( int argc, char **argv ){
continue; continue;
/* digest any images */ /* digest any images */
if ( !Q_stricmp( token, "map" ) || if ( striEqual( token, "map" ) ||
!Q_stricmp( token, "clampMap" ) ) { striEqual( token, "clampMap" ) ) {
StrBuf_cat2( shaderText, "\n\t\t", token ); StrBuf_cat2( shaderText, "\n\t\t", token );
hasmap = true; hasmap = true;
@ -1289,8 +1289,8 @@ int repackBSPMain( int argc, char **argv ){
} }
StrBuf_cat2( shaderText, " ", token ); StrBuf_cat2( shaderText, " ", token );
} }
else if ( !Q_stricmp( token, "animMap" ) || else if ( striEqual( token, "animMap" ) ||
!Q_stricmp( token, "clampAnimMap" ) ) { striEqual( token, "clampAnimMap" ) ) {
StrBuf_cat2( shaderText, "\n\t\t", token ); StrBuf_cat2( shaderText, "\n\t\t", token );
hasmap = true; hasmap = true;
@ -1303,7 +1303,7 @@ int repackBSPMain( int argc, char **argv ){
} }
tokenready = true; tokenready = true;
} }
else if ( !Q_stricmp( token, "videoMap" ) ){ else if ( striEqual( token, "videoMap" ) ){
StrBuf_cat2( shaderText, "\n\t\t", token ); StrBuf_cat2( shaderText, "\n\t\t", token );
hasmap = true; hasmap = true;
GetToken( false ); GetToken( false );
@ -1318,7 +1318,7 @@ int repackBSPMain( int argc, char **argv ){
!StrList_find( rExVideos, token ) ) !StrList_find( rExVideos, token ) )
StrList_append( pk3Videos, token ); StrList_append( pk3Videos, token );
} }
else if ( !Q_stricmp( token, "mapComp" ) || !Q_stricmp( token, "mapNoComp" ) || !Q_stricmp( token, "animmapcomp" ) || !Q_stricmp( token, "animmapnocomp" ) ){ else if ( striEqual( token, "mapComp" ) || striEqual( token, "mapNoComp" ) || striEqual( token, "animmapcomp" ) || striEqual( token, "animmapnocomp" ) ){
Sys_FPrintf( SYS_WRN, "WARNING7: %s : %s shader\n", pk3Shaders->s[shader], token ); Sys_FPrintf( SYS_WRN, "WARNING7: %s : %s shader\n", pk3Shaders->s[shader], token );
hasmap = true; hasmap = true;
if ( line == scriptline ){ if ( line == scriptline ){
@ -1345,18 +1345,18 @@ int repackBSPMain( int argc, char **argv ){
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
/* match surfaceparm */ /* match surfaceparm */
else if ( !Q_stricmp( token, "surfaceparm" ) ) { else if ( striEqual( token, "surfaceparm" ) ) {
StrBuf_cat( shaderText, "\n\tsurfaceparm " ); StrBuf_cat( shaderText, "\n\tsurfaceparm " );
GetToken( false ); GetToken( false );
StrBuf_cat( shaderText, token ); StrBuf_cat( shaderText, token );
if ( !Q_stricmp( token, "nodraw" ) ) { if ( striEqual( token, "nodraw" ) ) {
wantShader = false; wantShader = false;
pk3Shaders->s[shader][0] = '\0'; pk3Shaders->s[shader][0] = '\0';
} }
} }
/* skyparms <outer image> <cloud height> <inner image> */ /* skyparms <outer image> <cloud height> <inner image> */
else if ( !Q_stricmp( token, "skyParms" ) ) { else if ( striEqual( token, "skyParms" ) ) {
StrBuf_cat( shaderText, "\n\tskyParms " ); StrBuf_cat( shaderText, "\n\tskyParms " );
hasmap = true; hasmap = true;
/* get image base */ /* get image base */
@ -1364,7 +1364,7 @@ int repackBSPMain( int argc, char **argv ){
StrBuf_cat( shaderText, token ); StrBuf_cat( shaderText, token );
/* ignore bogus paths */ /* ignore bogus paths */
if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) { if ( !striEqual( token, "-" ) && !striEqual( token, "full" ) ) {
const char skysides[6][3] = { "up", "dn", "lf", "rt", "bk", "ft" }; const char skysides[6][3] = { "up", "dn", "lf", "rt", "bk", "ft" };
char* const skysidestring = token + strcatQ( token, "_@@.tga", sizeof( token ) ) - 6; char* const skysidestring = token + strcatQ( token, "_@@.tga", sizeof( token ) ) - 6;
for( size_t side = 0; side < 6; ++side ){ for( size_t side = 0; side < 6; ++side ){
@ -1388,7 +1388,7 @@ int repackBSPMain( int argc, char **argv ){
StrBuf_cat2( shaderText, "\n\t", token ); StrBuf_cat2( shaderText, "\n\t", token );
} }
} }
else if ( !Q_stricmp( token, "fogparms" ) ){ else if ( striEqual( token, "fogparms" ) ){
hasmap = true; hasmap = true;
if ( line == scriptline ){ if ( line == scriptline ){
StrBuf_cat2( shaderText, " ", token ); StrBuf_cat2( shaderText, " ", token );
@ -1436,7 +1436,7 @@ int repackBSPMain( int argc, char **argv ){
FixDOSName( pk3Shaders->s[i] ); FixDOSName( pk3Shaders->s[i] );
//what if theres properly slashed one in the list? //what if theres properly slashed one in the list?
for ( j = 0; j < pk3Shaders->n; ++j ){ for ( j = 0; j < pk3Shaders->n; ++j ){
if ( !Q_stricmp( pk3Shaders->s[i], pk3Shaders->s[j] ) && ( i != j ) ){ if ( striEqual( pk3Shaders->s[i], pk3Shaders->s[j] ) && ( i != j ) ){
pk3Shaders->s[i][0] = '\0'; pk3Shaders->s[i][0] = '\0';
break; break;
} }

View File

@ -114,7 +114,7 @@ static void ProcessAdvertisements( void ) {
/* is an advertisement? */ /* is an advertisement? */
className = ValueForKey( &entities[ i ], "classname" ); className = ValueForKey( &entities[ i ], "classname" );
if ( !Q_stricmp( "advertisement", className ) ) { if ( striEqual( "advertisement", className ) ) {
modelKey = ValueForKey( &entities[ i ], "model" ); modelKey = ValueForKey( &entities[ i ], "model" );
@ -1081,7 +1081,7 @@ int BSPMain( int argc, char **argv ){
/* expand mapname */ /* expand mapname */
strcpy( name, ExpandArg( argv[ i ] ) ); strcpy( name, ExpandArg( argv[ i ] ) );
if ( Q_stricmp( path_get_filename_base_end( name ), ".reg" ) ) { /* not .reg */ if ( !striEqual( path_get_filename_base_end( name ), ".reg" ) ) { /* not .reg */
/* if we are doing a full map, delete the last saved region map */ /* if we are doing a full map, delete the last saved region map */
sprintf( path, "%s.reg", source ); sprintf( path, "%s.reg", source );
remove( path ); remove( path );

View File

@ -687,9 +687,9 @@ void UnparseEntities( void ){
} }
/* ydnar: certain entities get stripped from bsp file */ /* ydnar: certain entities get stripped from bsp file */
value2 = ValueForKey( &entities[ i ], "classname" ); value2 = ValueForKey( &entities[ i ], "classname" );
if ( !Q_stricmp( value2, "misc_model" ) || if ( striEqual( value2, "misc_model" ) ||
!Q_stricmp( value2, "_decal" ) || striEqual( value2, "_decal" ) ||
!Q_stricmp( value2, "_skybox" ) ) { striEqual( value2, "_skybox" ) ) {
continue; continue;
} }
@ -943,9 +943,9 @@ void GetEntityShadowFlags( const entity_t *ent, const entity_t *ent2, int *castS
/* vortex: game-specific default entity keys */ /* vortex: game-specific default entity keys */
value = ValueForKey( ent, "classname" ); value = ValueForKey( ent, "classname" );
if ( !Q_stricmp( game->magic, "dq" ) || !Q_stricmp( game->magic, "prophecy" ) ) { if ( striEqual( game->magic, "dq" ) || striEqual( game->magic, "prophecy" ) ) {
/* vortex: deluxe quake default shadow flags */ /* vortex: deluxe quake default shadow flags */
if ( !Q_stricmp( value, "func_wall" ) ) { if ( striEqual( value, "func_wall" ) ) {
if ( recvShadows != NULL ) { if ( recvShadows != NULL ) {
*recvShadows = 1; *recvShadows = 1;
} }

View File

@ -932,19 +932,19 @@ int ConvertBSPMain( int argc, char **argv ){
/* -format map|ase|... */ /* -format map|ase|... */
if ( strEqual( argv[ i ], "-format" ) ) { if ( strEqual( argv[ i ], "-format" ) ) {
i++; i++;
if ( !Q_stricmp( argv[ i ], "ase" ) ) { if ( striEqual( argv[ i ], "ase" ) ) {
convertFunc = ConvertBSPToASE; convertFunc = ConvertBSPToASE;
map_allowed = false; map_allowed = false;
} }
else if ( !Q_stricmp( argv[ i ], "obj" ) ) { else if ( striEqual( argv[ i ], "obj" ) ) {
convertFunc = ConvertBSPToOBJ; convertFunc = ConvertBSPToOBJ;
map_allowed = false; map_allowed = false;
} }
else if ( !Q_stricmp( argv[ i ], "map_bp" ) ) { else if ( striEqual( argv[ i ], "map_bp" ) ) {
convertFunc = ConvertBSPToMap_BP; convertFunc = ConvertBSPToMap_BP;
map_allowed = true; map_allowed = true;
} }
else if ( !Q_stricmp( argv[ i ], "map" ) ) { else if ( striEqual( argv[ i ], "map" ) ) {
convertFunc = ConvertBSPToMap; convertFunc = ConvertBSPToMap;
map_allowed = true; map_allowed = true;
} }
@ -1004,7 +1004,7 @@ int ConvertBSPMain( int argc, char **argv ){
force_bsp = true; force_bsp = true;
} }
if ( force_map || ( !force_bsp && !Q_stricmp( path_get_extension( source ), "map" ) && map_allowed ) ) { if ( force_map || ( !force_bsp && striEqual( path_get_extension( source ), "map" ) && map_allowed ) ) {
if ( !map_allowed ) { if ( !map_allowed ) {
Sys_Warning( "the requested conversion should not be done from .map files. Compile a .bsp first.\n" ); Sys_Warning( "the requested conversion should not be done from .map files. Compile a .bsp first.\n" );
} }

View File

@ -258,7 +258,7 @@ static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin
} }
shader = &bspShaders[ side->shaderNum ]; shader = &bspShaders[ side->shaderNum ];
//"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes ) //"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes )
if( Q_stricmp( shader->shader, "noshader" ) ){ if( !striEqual( shader->shader, "noshader" ) ){
notNoShader++; notNoShader++;
} }
if( notNoShader > 1 ){ if( notNoShader > 1 ){
@ -280,7 +280,7 @@ static void ConvertBrushFast( FILE *f, int num, bspBrush_t *brush, vec3_t origin
} }
shader = &bspShaders[ side->shaderNum ]; shader = &bspShaders[ side->shaderNum ];
//"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes ) //"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes )
if( !Q_stricmp( shader->shader, "default" ) || ( !Q_stricmp( shader->shader, "noshader" ) && !modelclip ) ) if( striEqual( shader->shader, "default" ) || ( striEqual( shader->shader, "noshader" ) && !modelclip ) )
continue; continue;
/* add build side */ /* add build side */
@ -408,7 +408,7 @@ static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, bo
} }
shader = &bspShaders[ side->shaderNum ]; shader = &bspShaders[ side->shaderNum ];
//"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes ) //"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes )
if( Q_stricmp( shader->shader, "noshader" ) ){ if( !striEqual( shader->shader, "noshader" ) ){
notNoShader++; notNoShader++;
} }
if( notNoShader > 1 ){ if( notNoShader > 1 ){
@ -430,7 +430,7 @@ static void ConvertBrush( FILE *f, int num, bspBrush_t *brush, vec3_t origin, bo
} }
shader = &bspShaders[ side->shaderNum ]; shader = &bspShaders[ side->shaderNum ];
//"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes ) //"noshader" happens on modelclip and unwanted sides ( usually breaking complex brushes )
if( !Q_stricmp( shader->shader, "default" ) || ( !Q_stricmp( shader->shader, "noshader" ) && !modelclip ) ) if( striEqual( shader->shader, "default" ) || ( striEqual( shader->shader, "noshader" ) && !modelclip ) )
continue; continue;
/* add build side */ /* add build side */
@ -772,7 +772,7 @@ for ( i = 0; i < brush->numSides; i++ )
continue; continue;
} }
shader = &bspShaders[ side->shaderNum ]; shader = &bspShaders[ side->shaderNum ];
if ( !Q_stricmp( shader->shader, "default" ) || !Q_stricmp( shader->shader, "noshader" ) ) { if ( striEqual( shader->shader, "default" ) || striEqual( shader->shader, "noshader" ) ) {
continue; continue;
} }
@ -979,12 +979,12 @@ static void ConvertEPairs( FILE *f, entity_t *e, bool skip_origin ){
} }
/* ignore model keys with * prefixed values */ /* ignore model keys with * prefixed values */
if ( !Q_stricmp( ep->key, "model" ) && ep->value[ 0 ] == '*' ) { if ( striEqual( ep->key, "model" ) && ep->value[ 0 ] == '*' ) {
continue; continue;
} }
/* ignore origin keys if skip_origin is set */ /* ignore origin keys if skip_origin is set */
if ( skip_origin && !Q_stricmp( ep->key, "origin" ) ) { if ( skip_origin && striEqual( ep->key, "origin" ) ) {
continue; continue;
} }

View File

@ -268,7 +268,7 @@ void Convert_ReferenceLightmaps( const char* base, int* lmIndices ){
Sys_FPrintf( SYS_WRN, "WARNING9: %s : line %d : opening brace inside shader stage\n", shaderfile, scriptline ); Sys_FPrintf( SYS_WRN, "WARNING9: %s : line %d : opening brace inside shader stage\n", shaderfile, scriptline );
/* digest any images */ /* digest any images */
if ( !Q_stricmp( token, "map" ) ) { if ( striEqual( token, "map" ) ) {
/* get an image */ /* get an image */
GetToken( false ); GetToken( false );
if ( *token != '*' && *token != '$' ) { if ( *token != '*' && *token != '$' ) {

View File

@ -425,7 +425,7 @@ void ProcessDecals( void ){
/* get entity */ /* get entity */
e = &entities[ i ]; e = &entities[ i ];
value = ValueForKey( e, "classname" ); value = ValueForKey( e, "classname" );
if ( Q_stricmp( value, "_decal" ) ) { if ( !striEqual( value, "_decal" ) ) {
continue; continue;
} }

View File

@ -2990,7 +2990,7 @@ int LightMain( int argc, char **argv ){
path_set_extension( source, ".bsp" ); path_set_extension( source, ".bsp" );
strcpy( name, ExpandArg( argv[ i ] ) ); strcpy( name, ExpandArg( argv[ i ] ) );
if ( Q_stricmp( path_get_filename_base_end( name ), ".reg" ) ) { /* not .reg */ if ( !striEqual( path_get_filename_base_end( name ), ".reg" ) ) { /* not .reg */
path_set_extension( name, ".map" ); path_set_extension( name, ".map" );
} }

View File

@ -1590,7 +1590,7 @@ void LoadEntityIndexMap( entity_t *e ){
Sys_FPrintf( SYS_VRB, "Entity %d (%s) has shader index map \"%s\"\n", mapEnt->mapEntityNum, ValueForKey( e, "classname" ), indexMapFilename ); Sys_FPrintf( SYS_VRB, "Entity %d (%s) has shader index map \"%s\"\n", mapEnt->mapEntityNum, ValueForKey( e, "classname" ), indexMapFilename );
/* handle tga image */ /* handle tga image */
if ( !Q_stricmp( path_get_extension( indexMapFilename ), "tga" ) ) { if ( striEqual( path_get_extension( indexMapFilename ), "tga" ) ) {
/* load it */ /* load it */
Load32BitImage( indexMapFilename, &pixels32, &w, &h ); Load32BitImage( indexMapFilename, &pixels32, &w, &h );
@ -1802,7 +1802,7 @@ static bool ParseMapEntity( bool onlyLights, bool noCollapseGroups ){
} }
/* ydnar: determine if this is a func_group */ /* ydnar: determine if this is a func_group */
funcGroup = !Q_stricmp( "func_group", classname ); funcGroup = striEqual( "func_group", classname );
/* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */ /* worldspawn (and func_groups) default to cast/recv shadows in worldspawn group */
if ( funcGroup || mapEnt->mapEntityNum == 0 ) { if ( funcGroup || mapEnt->mapEntityNum == 0 ) {
@ -1946,7 +1946,7 @@ static bool ParseMapEntity( bool onlyLights, bool noCollapseGroups ){
} }
/* group_info entities are just for editor grouping (fixme: leak!) */ /* group_info entities are just for editor grouping (fixme: leak!) */
if ( !noCollapseGroups && !Q_stricmp( "group_info", classname ) ) { if ( !noCollapseGroups && striEqual( "group_info", classname ) ) {
numEntities--; numEntities--;
return true; return true;
} }

View File

@ -359,7 +359,7 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap
picoShaderName = NULL; picoShaderName = NULL;
for ( sf2 = sf; sf2 != NULL; sf2 = sf2->next ) for ( sf2 = sf; sf2 != NULL; sf2 = sf2->next )
{ {
if ( !Q_stricmp( surface->name, sf2->name ) ) { if ( striEqual( surface->name, sf2->name ) ) {
Sys_FPrintf( SYS_VRB, "Skin file: mapping %s to %s\n", surface->name, sf2->to ); Sys_FPrintf( SYS_VRB, "Skin file: mapping %s to %s\n", surface->name, sf2->to );
picoShaderName = sf2->to; picoShaderName = sf2->to;
break; break;
@ -1421,7 +1421,7 @@ void AddTriangleModels( entity_t *e ){
e2 = &entities[ num ]; e2 = &entities[ num ];
/* convert misc_models into raw geometry */ /* convert misc_models into raw geometry */
if ( Q_stricmp( "misc_model", ValueForKey( e2, "classname" ) ) ) { if ( !striEqual( "misc_model", ValueForKey( e2, "classname" ) ) ) {
continue; continue;
} }

View File

@ -210,13 +210,13 @@ game_t *GetGame( char *arg ){
} }
/* joke */ /* joke */
if ( !Q_stricmp( arg, "quake1" ) || if ( striEqual( arg, "quake1" ) ||
!Q_stricmp( arg, "quake2" ) || striEqual( arg, "quake2" ) ||
!Q_stricmp( arg, "unreal" ) || striEqual( arg, "unreal" ) ||
!Q_stricmp( arg, "ut2k3" ) || striEqual( arg, "ut2k3" ) ||
!Q_stricmp( arg, "dn3d" ) || striEqual( arg, "dn3d" ) ||
!Q_stricmp( arg, "dnf" ) || striEqual( arg, "dnf" ) ||
!Q_stricmp( arg, "hl" ) ) { striEqual( arg, "hl" ) ) {
Sys_Printf( "April fools, silly rabbit!\n" ); Sys_Printf( "April fools, silly rabbit!\n" );
exit( 0 ); exit( 0 );
} }
@ -225,7 +225,7 @@ game_t *GetGame( char *arg ){
i = 0; i = 0;
while ( games[ i ].arg != NULL ) while ( games[ i ].arg != NULL )
{ {
if ( Q_stricmp( arg, games[ i ].arg ) == 0 ) { if ( striEqual( arg, games[ i ].arg ) ) {
return &games[ i ]; return &games[ i ];
} }
i++; i++;

View File

@ -680,7 +680,7 @@ int FloodEntities( tree_t *tree ){
/* handle skybox entities */ /* handle skybox entities */
value = ValueForKey( e, "classname" ); value = ValueForKey( e, "classname" );
if ( !Q_stricmp( value, "_skybox" ) ) { if ( striEqual( value, "_skybox" ) ) {
skybox = true; skybox = true;
skyboxPresent = true; skyboxPresent = true;

View File

@ -261,7 +261,7 @@ bool ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *co
while ( sp->name != NULL ) while ( sp->name != NULL )
{ {
/* match? */ /* match? */
if ( !Q_stricmp( name, sp->name ) ) { if ( striEqual( name, sp->name ) ) {
/* clear and set flags */ /* clear and set flags */
*contentFlags &= ~( sp->contentFlagsClear ); *contentFlags &= ~( sp->contentFlagsClear );
*contentFlags |= sp->contentFlags; *contentFlags |= sp->contentFlags;
@ -285,7 +285,7 @@ bool ApplySurfaceParm( char *name, int *contentFlags, int *surfaceFlags, int *co
sp = &custSurfaceParms[ i ]; sp = &custSurfaceParms[ i ];
/* match? */ /* match? */
if ( !Q_stricmp( name, sp->name ) ) { if ( striEqual( name, sp->name ) ) {
/* clear and set flags */ /* clear and set flags */
*contentFlags &= ~( sp->contentFlagsClear ); *contentFlags &= ~( sp->contentFlagsClear );
*contentFlags |= sp->contentFlags; *contentFlags |= sp->contentFlags;
@ -848,7 +848,7 @@ shaderInfo_t *ShaderInfoForShader( const char *shaderName ){
for ( i = 0; i < numShaderInfo; i++ ) for ( i = 0; i < numShaderInfo; i++ )
{ {
si = &shaderInfo[ i ]; si = &shaderInfo[ i ];
if ( !Q_stricmp( shader, si->shader ) ) { if ( striEqual( shader, si->shader ) ) {
/* check if shader is deprecated */ /* check if shader is deprecated */
if ( deprecationDepth < MAX_SHADER_DEPRECATION_DEPTH && si->deprecateShader && si->deprecateShader[ 0 ] ) { if ( deprecationDepth < MAX_SHADER_DEPRECATION_DEPTH && si->deprecateShader && si->deprecateShader[ 0 ] ) {
/* override name */ /* override name */
@ -1048,14 +1048,14 @@ static void ParseShaderFile( const char *filename ){
/* only care about images if we don't have a editor/light image */ /* only care about images if we don't have a editor/light image */
if ( si->editorImagePath[ 0 ] == '\0' && si->lightImagePath[ 0 ] == '\0' && si->implicitImagePath[ 0 ] == '\0' ) { if ( si->editorImagePath[ 0 ] == '\0' && si->lightImagePath[ 0 ] == '\0' && si->implicitImagePath[ 0 ] == '\0' ) {
/* digest any images */ /* digest any images */
if ( !Q_stricmp( token, "map" ) || if ( striEqual( token, "map" ) ||
!Q_stricmp( token, "clampMap" ) || striEqual( token, "clampMap" ) ||
!Q_stricmp( token, "animMap" ) || striEqual( token, "animMap" ) ||
!Q_stricmp( token, "clampAnimMap" ) || striEqual( token, "clampAnimMap" ) ||
!Q_stricmp( token, "mapComp" ) || striEqual( token, "mapComp" ) ||
!Q_stricmp( token, "mapNoComp" ) ) { striEqual( token, "mapNoComp" ) ) {
/* skip one token for animated stages */ /* skip one token for animated stages */
if ( !Q_stricmp( token, "animMap" ) || !Q_stricmp( token, "clampAnimMap" ) ) { if ( striEqual( token, "animMap" ) || striEqual( token, "clampAnimMap" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
} }
@ -1079,7 +1079,7 @@ static void ParseShaderFile( const char *filename ){
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
/* match surfaceparm */ /* match surfaceparm */
else if ( !Q_stricmp( token, "surfaceparm" ) ) { else if ( striEqual( token, "surfaceparm" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( !ApplySurfaceParm( token, &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) ) { if ( !ApplySurfaceParm( token, &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) ) {
Sys_Warning( "Unknown surfaceparm: \"%s\"\n", token ); Sys_Warning( "Unknown surfaceparm: \"%s\"\n", token );
@ -1092,25 +1092,25 @@ static void ParseShaderFile( const char *filename ){
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
/* ydnar: fogparms (for determining fog volumes) */ /* ydnar: fogparms (for determining fog volumes) */
else if ( !Q_stricmp( token, "fogparms" ) ) { else if ( striEqual( token, "fogparms" ) ) {
si->fogParms = true; si->fogParms = true;
} }
/* ydnar: polygonoffset (for no culling) */ /* ydnar: polygonoffset (for no culling) */
else if ( !Q_stricmp( token, "polygonoffset" ) ) { else if ( striEqual( token, "polygonoffset" ) ) {
si->polygonOffset = true; si->polygonOffset = true;
} }
/* tesssize is used to force liquid surfaces to subdivide */ /* tesssize is used to force liquid surfaces to subdivide */
else if ( !Q_stricmp( token, "tessSize" ) || !Q_stricmp( token, "q3map_tessSize" ) /* sof2 */ ) { else if ( striEqual( token, "tessSize" ) || striEqual( token, "q3map_tessSize" ) /* sof2 */ ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->subdivisions = atof( token ); si->subdivisions = atof( token );
} }
/* cull none will set twoSided (ydnar: added disable too) */ /* cull none will set twoSided (ydnar: added disable too) */
else if ( !Q_stricmp( token, "cull" ) ) { else if ( striEqual( token, "cull" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( !Q_stricmp( token, "none" ) || !Q_stricmp( token, "disable" ) || !Q_stricmp( token, "twosided" ) ) { if ( striEqual( token, "none" ) || striEqual( token, "disable" ) || striEqual( token, "twosided" ) ) {
si->twoSided = true; si->twoSided = true;
} }
} }
@ -1118,7 +1118,7 @@ static void ParseShaderFile( const char *filename ){
/* deformVertexes autosprite[ 2 ] /* deformVertexes autosprite[ 2 ]
we catch this so autosprited surfaces become point we catch this so autosprited surfaces become point
lights instead of area lights */ lights instead of area lights */
else if ( !Q_stricmp( token, "deformVertexes" ) ) { else if ( striEqual( token, "deformVertexes" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
/* deformVertexes autosprite(2) */ /* deformVertexes autosprite(2) */
@ -1133,7 +1133,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* deformVertexes move <x> <y> <z> <func> <base> <amplitude> <phase> <freq> (ydnar: for particle studio support) */ /* deformVertexes move <x> <y> <z> <func> <base> <amplitude> <phase> <freq> (ydnar: for particle studio support) */
if ( !Q_stricmp( token, "move" ) ) { if ( striEqual( token, "move" ) ) {
vec3_t amt, mins, maxs; vec3_t amt, mins, maxs;
float base, amp; float base, amp;
@ -1159,13 +1159,13 @@ static void ParseShaderFile( const char *filename ){
} }
/* light <value> (old-style flare specification) */ /* light <value> (old-style flare specification) */
else if ( !Q_stricmp( token, "light" ) ) { else if ( striEqual( token, "light" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->flareShader = game->flareShader; si->flareShader = game->flareShader;
} }
/* ydnar: damageShader <shader> <health> (sof2 mods) */ /* ydnar: damageShader <shader> <health> (sof2 mods) */
else if ( !Q_stricmp( token, "damageShader" ) ) { else if ( striEqual( token, "damageShader" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] != '\0' ) { if ( token[ 0 ] != '\0' ) {
si->damageShader = copystring( token ); si->damageShader = copystring( token );
@ -1174,7 +1174,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: enemy territory implicit shaders */ /* ydnar: enemy territory implicit shaders */
else if ( !Q_stricmp( token, "implicitMap" ) ) { else if ( striEqual( token, "implicitMap" ) ) {
si->implicitMap = IM_OPAQUE; si->implicitMap = IM_OPAQUE;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) { if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) {
@ -1185,7 +1185,7 @@ static void ParseShaderFile( const char *filename ){
} }
} }
else if ( !Q_stricmp( token, "implicitMask" ) ) { else if ( striEqual( token, "implicitMask" ) ) {
si->implicitMap = IM_MASKED; si->implicitMap = IM_MASKED;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) { if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) {
@ -1196,7 +1196,7 @@ static void ParseShaderFile( const char *filename ){
} }
} }
else if ( !Q_stricmp( token, "implicitBlend" ) ) { else if ( striEqual( token, "implicitBlend" ) ) {
si->implicitMap = IM_MASKED; si->implicitMap = IM_MASKED;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) { if ( token[ 0 ] == '-' && token[ 1 ] == '\0' ) {
@ -1213,33 +1213,33 @@ static void ParseShaderFile( const char *filename ){
----------------------------------------------------------------- */ ----------------------------------------------------------------- */
/* qer_editorimage <image> */ /* qer_editorimage <image> */
else if ( !Q_stricmp( token, "qer_editorImage" ) ) { else if ( striEqual( token, "qer_editorImage" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
strcpy( si->editorImagePath, token ); strcpy( si->editorImagePath, token );
DefaultExtension( si->editorImagePath, ".tga" ); DefaultExtension( si->editorImagePath, ".tga" );
} }
/* ydnar: q3map_normalimage <image> (bumpmapping normal map) */ /* ydnar: q3map_normalimage <image> (bumpmapping normal map) */
else if ( !Q_stricmp( token, "q3map_normalImage" ) ) { else if ( striEqual( token, "q3map_normalImage" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
strcpy( si->normalImagePath, token ); strcpy( si->normalImagePath, token );
DefaultExtension( si->normalImagePath, ".tga" ); DefaultExtension( si->normalImagePath, ".tga" );
} }
/* q3map_lightimage <image> */ /* q3map_lightimage <image> */
else if ( !Q_stricmp( token, "q3map_lightImage" ) ) { else if ( striEqual( token, "q3map_lightImage" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
strcpy( si->lightImagePath, token ); strcpy( si->lightImagePath, token );
DefaultExtension( si->lightImagePath, ".tga" ); DefaultExtension( si->lightImagePath, ".tga" );
} }
/* ydnar: skyparms <outer image> <cloud height> <inner image> */ /* ydnar: skyparms <outer image> <cloud height> <inner image> */
else if ( !Q_stricmp( token, "skyParms" ) ) { else if ( striEqual( token, "skyParms" ) ) {
/* get image base */ /* get image base */
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
/* ignore bogus paths */ /* ignore bogus paths */
if ( Q_stricmp( token, "-" ) && Q_stricmp( token, "full" ) ) { if ( !striEqual( token, "-" ) && !striEqual( token, "full" ) ) {
strcpy( si->skyParmsImageBase, token ); strcpy( si->skyParmsImageBase, token );
/* use top image as sky light image */ /* use top image as sky light image */
@ -1262,11 +1262,11 @@ static void ParseShaderFile( const char *filename ){
intensity falls off with angle but not distance 100 is a fairly bright sun intensity falls off with angle but not distance 100 is a fairly bright sun
degree of 0 = from the east, 90 = north, etc. altitude of 0 = sunrise/set, 90 = noon degree of 0 = from the east, 90 = north, etc. altitude of 0 = sunrise/set, 90 = noon
ydnar: sof2map has bareword 'sun' token, so we support that as well */ ydnar: sof2map has bareword 'sun' token, so we support that as well */
else if ( !Q_stricmp( token, "sun" ) /* sof2 */ || !Q_stricmp( token, "q3map_sun" ) || !Q_stricmp( token, "q3map_sunExt" ) ) { else if ( striEqual( token, "sun" ) /* sof2 */ || striEqual( token, "q3map_sun" ) || striEqual( token, "q3map_sunExt" ) ) {
float a, b; float a, b;
sun_t *sun; sun_t *sun;
/* ydnar: extended sun directive? */ /* ydnar: extended sun directive? */
const bool ext = !Q_stricmp( token, "q3map_sunext" ); const bool ext = striEqual( token, "q3map_sunext" );
/* allocate sun */ /* allocate sun */
sun = safe_calloc( sizeof( *sun ) ); sun = safe_calloc( sizeof( *sun ) );
@ -1335,7 +1335,7 @@ static void ParseShaderFile( const char *filename ){
/* match q3map_ */ /* match q3map_ */
else if ( !Q_strncasecmp( token, "q3map_", 6 ) ) { else if ( !Q_strncasecmp( token, "q3map_", 6 ) ) {
/* ydnar: q3map_baseShader <shader> (inherit this shader's parameters) */ /* ydnar: q3map_baseShader <shader> (inherit this shader's parameters) */
if ( !Q_stricmp( token, "q3map_baseShader" ) ) { if ( striEqual( token, "q3map_baseShader" ) ) {
shaderInfo_t *si2; shaderInfo_t *si2;
bool oldWarnImage; bool oldWarnImage;
@ -1365,7 +1365,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_surfacemodel <path to model> <density> <min scale> <max scale> <min angle> <max angle> <oriented (0 or 1)> */ /* ydnar: q3map_surfacemodel <path to model> <density> <min scale> <max scale> <min angle> <max angle> <oriented (0 or 1)> */
else if ( !Q_stricmp( token, "q3map_surfacemodel" ) ) { else if ( striEqual( token, "q3map_surfacemodel" ) ) {
surfaceModel_t *model; surfaceModel_t *model;
/* allocate new model and attach it */ /* allocate new model and attach it */
@ -1397,7 +1397,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar/sd: q3map_foliage <path to model> <scale> <density> <odds> <invert alpha (1 or 0)> */ /* ydnar/sd: q3map_foliage <path to model> <scale> <density> <odds> <invert alpha (1 or 0)> */
else if ( !Q_stricmp( token, "q3map_foliage" ) ) { else if ( striEqual( token, "q3map_foliage" ) ) {
foliage_t *foliage; foliage_t *foliage;
@ -1421,13 +1421,13 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_bounce <value> (fraction of light to re-emit during radiosity passes) */ /* ydnar: q3map_bounce <value> (fraction of light to re-emit during radiosity passes) */
else if ( !Q_stricmp( token, "q3map_bounce" ) || !Q_stricmp( token, "q3map_bounceScale" ) ) { else if ( striEqual( token, "q3map_bounce" ) || striEqual( token, "q3map_bounceScale" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->bounceScale = atof( token ); si->bounceScale = atof( token );
} }
/* ydnar/splashdamage: q3map_skyLight <value> <iterations> */ /* ydnar/splashdamage: q3map_skyLight <value> <iterations> */
else if ( !Q_stricmp( token, "q3map_skyLight" ) ) { else if ( striEqual( token, "q3map_skyLight" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->skyLightValue = atof( token ); si->skyLightValue = atof( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1443,13 +1443,13 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_surfacelight <value> */ /* q3map_surfacelight <value> */
else if ( !Q_stricmp( token, "q3map_surfacelight" ) ) { else if ( striEqual( token, "q3map_surfacelight" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->value = atof( token ); si->value = atof( token );
} }
/* q3map_lightStyle (sof2/jk2 lightstyle) */ /* q3map_lightStyle (sof2/jk2 lightstyle) */
else if ( !Q_stricmp( token, "q3map_lightStyle" ) ) { else if ( striEqual( token, "q3map_lightStyle" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
val = atoi( token ); val = atoi( token );
if ( val < 0 ) { if ( val < 0 ) {
@ -1462,7 +1462,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* wolf: q3map_lightRGB <red> <green> <blue> */ /* wolf: q3map_lightRGB <red> <green> <blue> */
else if ( !Q_stricmp( token, "q3map_lightRGB" ) ) { else if ( striEqual( token, "q3map_lightRGB" ) ) {
VectorClear( si->color ); VectorClear( si->color );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->color[ 0 ] = atof( token ); si->color[ 0 ] = atof( token );
@ -1479,13 +1479,13 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_lightSubdivide <value> */ /* q3map_lightSubdivide <value> */
else if ( !Q_stricmp( token, "q3map_lightSubdivide" ) ) { else if ( striEqual( token, "q3map_lightSubdivide" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->lightSubdivide = atoi( token ); si->lightSubdivide = atoi( token );
} }
/* q3map_backsplash <percent> <distance> */ /* q3map_backsplash <percent> <distance> */
else if ( !Q_stricmp( token, "q3map_backsplash" ) ) { else if ( striEqual( token, "q3map_backsplash" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->backsplashFraction = atof( token ) * 0.01f; si->backsplashFraction = atof( token ) * 0.01f;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1493,7 +1493,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_floodLight <r> <g> <b> <diste> <intensity> <light_direction_power> */ /* q3map_floodLight <r> <g> <b> <diste> <intensity> <light_direction_power> */
else if ( !Q_stricmp( token, "q3map_floodLight" ) ) { else if ( striEqual( token, "q3map_floodLight" ) ) {
/* get color */ /* get color */
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->floodlightRGB[ 0 ] = atof( token ); si->floodlightRGB[ 0 ] = atof( token );
@ -1516,24 +1516,24 @@ static void ParseShaderFile( const char *filename ){
} }
/* jal: q3map_nodirty : skip dirty */ /* jal: q3map_nodirty : skip dirty */
else if ( !Q_stricmp( token, "q3map_nodirty" ) ) { else if ( striEqual( token, "q3map_nodirty" ) ) {
si->noDirty = true; si->noDirty = true;
} }
/* q3map_lightmapSampleSize <value> */ /* q3map_lightmapSampleSize <value> */
else if ( !Q_stricmp( token, "q3map_lightmapSampleSize" ) ) { else if ( striEqual( token, "q3map_lightmapSampleSize" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->lightmapSampleSize = atoi( token ); si->lightmapSampleSize = atoi( token );
} }
/* q3map_lightmapSampleOffset <value> */ /* q3map_lightmapSampleOffset <value> */
else if ( !Q_stricmp( token, "q3map_lightmapSampleOffset" ) ) { else if ( striEqual( token, "q3map_lightmapSampleOffset" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->lightmapSampleOffset = atof( token ); si->lightmapSampleOffset = atof( token );
} }
/* ydnar: q3map_lightmapFilterRadius <self> <other> */ /* ydnar: q3map_lightmapFilterRadius <self> <other> */
else if ( !Q_stricmp( token, "q3map_lightmapFilterRadius" ) ) { else if ( striEqual( token, "q3map_lightmapFilterRadius" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->lmFilterRadius = atof( token ); si->lmFilterRadius = atof( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1541,15 +1541,15 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_lightmapAxis [xyz] */ /* ydnar: q3map_lightmapAxis [xyz] */
else if ( !Q_stricmp( token, "q3map_lightmapAxis" ) ) { else if ( striEqual( token, "q3map_lightmapAxis" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( !Q_stricmp( token, "x" ) ) { if ( striEqual( token, "x" ) ) {
VectorSet( si->lightmapAxis, 1, 0, 0 ); VectorSet( si->lightmapAxis, 1, 0, 0 );
} }
else if ( !Q_stricmp( token, "y" ) ) { else if ( striEqual( token, "y" ) ) {
VectorSet( si->lightmapAxis, 0, 1, 0 ); VectorSet( si->lightmapAxis, 0, 1, 0 );
} }
else if ( !Q_stricmp( token, "z" ) ) { else if ( striEqual( token, "z" ) ) {
VectorSet( si->lightmapAxis, 0, 0, 1 ); VectorSet( si->lightmapAxis, 0, 0, 1 );
} }
else else
@ -1560,7 +1560,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_lightmapSize <width> <height> (for autogenerated shaders + external tga lightmaps) */ /* ydnar: q3map_lightmapSize <width> <height> (for autogenerated shaders + external tga lightmaps) */
else if ( !Q_stricmp( token, "q3map_lightmapSize" ) ) { else if ( striEqual( token, "q3map_lightmapSize" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->lmCustomWidth = atoi( token ); si->lmCustomWidth = atoi( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1577,7 +1577,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_lightmapBrightness N (for autogenerated shaders + external tga lightmaps) */ /* ydnar: q3map_lightmapBrightness N (for autogenerated shaders + external tga lightmaps) */
else if ( !Q_stricmp( token, "q3map_lightmapBrightness" ) || !Q_stricmp( token, "q3map_lightmapGamma" ) ) { else if ( striEqual( token, "q3map_lightmapBrightness" ) || striEqual( token, "q3map_lightmapGamma" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->lmBrightness *= atof( token ); si->lmBrightness *= atof( token );
if ( si->lmBrightness < 0 ) { if ( si->lmBrightness < 0 ) {
@ -1586,18 +1586,18 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_vertexScale (scale vertex lighting by this fraction) */ /* q3map_vertexScale (scale vertex lighting by this fraction) */
else if ( !Q_stricmp( token, "q3map_vertexScale" ) ) { else if ( striEqual( token, "q3map_vertexScale" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->vertexScale *= atof( token ); si->vertexScale *= atof( token );
} }
/* q3map_noVertexLight */ /* q3map_noVertexLight */
else if ( !Q_stricmp( token, "q3map_noVertexLight" ) ) { else if ( striEqual( token, "q3map_noVertexLight" ) ) {
si->noVertexLight = true; si->noVertexLight = true;
} }
/* q3map_flare[Shader] <shader> */ /* q3map_flare[Shader] <shader> */
else if ( !Q_stricmp( token, "q3map_flare" ) || !Q_stricmp( token, "q3map_flareShader" ) ) { else if ( striEqual( token, "q3map_flare" ) || striEqual( token, "q3map_flareShader" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] != '\0' ) { if ( token[ 0 ] != '\0' ) {
si->flareShader = copystring( token ); si->flareShader = copystring( token );
@ -1605,7 +1605,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_backShader <shader> */ /* q3map_backShader <shader> */
else if ( !Q_stricmp( token, "q3map_backShader" ) ) { else if ( striEqual( token, "q3map_backShader" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] != '\0' ) { if ( token[ 0 ] != '\0' ) {
si->backShader = copystring( token ); si->backShader = copystring( token );
@ -1613,7 +1613,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_cloneShader <shader> */ /* ydnar: q3map_cloneShader <shader> */
else if ( !Q_stricmp( token, "q3map_cloneShader" ) ) { else if ( striEqual( token, "q3map_cloneShader" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] != '\0' ) { if ( token[ 0 ] != '\0' ) {
si->cloneShader = copystring( token ); si->cloneShader = copystring( token );
@ -1621,7 +1621,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_remapShader <shader> */ /* q3map_remapShader <shader> */
else if ( !Q_stricmp( token, "q3map_remapShader" ) ) { else if ( striEqual( token, "q3map_remapShader" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] != '\0' ) { if ( token[ 0 ] != '\0' ) {
si->remapShader = copystring( token ); si->remapShader = copystring( token );
@ -1629,7 +1629,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_deprecateShader <shader> */ /* q3map_deprecateShader <shader> */
else if ( !Q_stricmp( token, "q3map_deprecateShader" ) ) { else if ( striEqual( token, "q3map_deprecateShader" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
if ( token[ 0 ] != '\0' ) { if ( token[ 0 ] != '\0' ) {
si->deprecateShader = copystring( token ); si->deprecateShader = copystring( token );
@ -1637,13 +1637,13 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_offset <value> */ /* ydnar: q3map_offset <value> */
else if ( !Q_stricmp( token, "q3map_offset" ) ) { else if ( striEqual( token, "q3map_offset" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->offset = atof( token ); si->offset = atof( token );
} }
/* ydnar: q3map_fur <numlayers> <offset> <fade> */ /* ydnar: q3map_fur <numlayers> <offset> <fade> */
else if ( !Q_stricmp( token, "q3map_fur" ) ) { else if ( striEqual( token, "q3map_fur" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->furNumLayers = atoi( token ); si->furNumLayers = atoi( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1653,7 +1653,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: gs mods: legacy support for terrain/terrain2 shaders */ /* ydnar: gs mods: legacy support for terrain/terrain2 shaders */
else if ( !Q_stricmp( token, "q3map_terrain" ) ) { else if ( striEqual( token, "q3map_terrain" ) ) {
/* team arena terrain is assumed to be nonplanar, with full normal averaging, /* team arena terrain is assumed to be nonplanar, with full normal averaging,
passed through the metatriangle surface pipeline, with a lightmap axis on z */ passed through the metatriangle surface pipeline, with a lightmap axis on z */
si->legacyTerrain = true; si->legacyTerrain = true;
@ -1667,18 +1667,18 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: picomodel: q3map_forceMeta (forces brush faces and/or triangle models to go through the metasurface pipeline) */ /* ydnar: picomodel: q3map_forceMeta (forces brush faces and/or triangle models to go through the metasurface pipeline) */
else if ( !Q_stricmp( token, "q3map_forceMeta" ) ) { else if ( striEqual( token, "q3map_forceMeta" ) ) {
si->forceMeta = true; si->forceMeta = true;
} }
/* ydnar: gs mods: q3map_shadeAngle <degrees> */ /* ydnar: gs mods: q3map_shadeAngle <degrees> */
else if ( !Q_stricmp( token, "q3map_shadeAngle" ) ) { else if ( striEqual( token, "q3map_shadeAngle" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->shadeAngleDegrees = atof( token ); si->shadeAngleDegrees = atof( token );
} }
/* ydnar: q3map_textureSize <width> <height> (substitute for q3map_lightimage derivation for terrain) */ /* ydnar: q3map_textureSize <width> <height> (substitute for q3map_lightimage derivation for terrain) */
else if ( !Q_stricmp( token, "q3map_textureSize" ) ) { else if ( striEqual( token, "q3map_textureSize" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
si->shaderWidth = atoi( token ); si->shaderWidth = atoi( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1686,18 +1686,18 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: gs mods: q3map_tcGen <style> <parameters> */ /* ydnar: gs mods: q3map_tcGen <style> <parameters> */
else if ( !Q_stricmp( token, "q3map_tcGen" ) ) { else if ( striEqual( token, "q3map_tcGen" ) ) {
si->tcGen = true; si->tcGen = true;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
/* q3map_tcGen vector <s vector> <t vector> */ /* q3map_tcGen vector <s vector> <t vector> */
if ( !Q_stricmp( token, "vector" ) ) { if ( striEqual( token, "vector" ) ) {
Parse1DMatrixAppend( shaderText, 3, si->vecs[ 0 ] ); Parse1DMatrixAppend( shaderText, 3, si->vecs[ 0 ] );
Parse1DMatrixAppend( shaderText, 3, si->vecs[ 1 ] ); Parse1DMatrixAppend( shaderText, 3, si->vecs[ 1 ] );
} }
/* q3map_tcGen ivector <1.0/s vector> <1.0/t vector> (inverse vector, easier for mappers to understand) */ /* q3map_tcGen ivector <1.0/s vector> <1.0/t vector> (inverse vector, easier for mappers to understand) */
else if ( !Q_stricmp( token, "ivector" ) ) { else if ( striEqual( token, "ivector" ) ) {
Parse1DMatrixAppend( shaderText, 3, si->vecs[ 0 ] ); Parse1DMatrixAppend( shaderText, 3, si->vecs[ 0 ] );
Parse1DMatrixAppend( shaderText, 3, si->vecs[ 1 ] ); Parse1DMatrixAppend( shaderText, 3, si->vecs[ 1 ] );
for ( i = 0; i < 3; i++ ) for ( i = 0; i < 3; i++ )
@ -1715,15 +1715,15 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: gs mods: q3map_[color|rgb|alpha][Gen|Mod] <style> <parameters> */ /* ydnar: gs mods: q3map_[color|rgb|alpha][Gen|Mod] <style> <parameters> */
else if ( !Q_stricmp( token, "q3map_colorGen" ) || !Q_stricmp( token, "q3map_colorMod" ) || else if ( striEqual( token, "q3map_colorGen" ) || striEqual( token, "q3map_colorMod" ) ||
!Q_stricmp( token, "q3map_rgbGen" ) || !Q_stricmp( token, "q3map_rgbMod" ) || striEqual( token, "q3map_rgbGen" ) || striEqual( token, "q3map_rgbMod" ) ||
!Q_stricmp( token, "q3map_alphaGen" ) || !Q_stricmp( token, "q3map_alphaMod" ) ) { striEqual( token, "q3map_alphaGen" ) || striEqual( token, "q3map_alphaMod" ) ) {
colorMod_t *cm, *cm2; colorMod_t *cm, *cm2;
int alpha; int alpha;
/* alphamods are colormod + 1 */ /* alphamods are colormod + 1 */
alpha = ( !Q_stricmp( token, "q3map_alphaGen" ) || !Q_stricmp( token, "q3map_alphaMod" ) ) ? 1 : 0; alpha = ( striEqual( token, "q3map_alphaGen" ) || striEqual( token, "q3map_alphaMod" ) ) ? 1 : 0;
/* allocate new colormod */ /* allocate new colormod */
cm = safe_calloc( sizeof( *cm ) ); cm = safe_calloc( sizeof( *cm ) );
@ -1747,14 +1747,14 @@ static void ParseShaderFile( const char *filename ){
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
/* alpha set|const A */ /* alpha set|const A */
if ( alpha && ( !Q_stricmp( token, "set" ) || !Q_stricmp( token, "const" ) ) ) { if ( alpha && ( striEqual( token, "set" ) || striEqual( token, "const" ) ) ) {
cm->type = CM_ALPHA_SET; cm->type = CM_ALPHA_SET;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
cm->data[ 0 ] = atof( token ); cm->data[ 0 ] = atof( token );
} }
/* color|rgb set|const ( X Y Z ) */ /* color|rgb set|const ( X Y Z ) */
else if ( !Q_stricmp( token, "set" ) || !Q_stricmp( token, "const" ) ) { else if ( striEqual( token, "set" ) || striEqual( token, "const" ) ) {
cm->type = CM_COLOR_SET; cm->type = CM_COLOR_SET;
Parse1DMatrixAppend( shaderText, 3, cm->data ); Parse1DMatrixAppend( shaderText, 3, cm->data );
if ( colorsRGB ) { if ( colorsRGB ) {
@ -1765,44 +1765,44 @@ static void ParseShaderFile( const char *filename ){
} }
/* alpha scale A */ /* alpha scale A */
else if ( alpha && !Q_stricmp( token, "scale" ) ) { else if ( alpha && striEqual( token, "scale" ) ) {
cm->type = CM_ALPHA_SCALE; cm->type = CM_ALPHA_SCALE;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
cm->data[ 0 ] = atof( token ); cm->data[ 0 ] = atof( token );
} }
/* color|rgb scale ( X Y Z ) */ /* color|rgb scale ( X Y Z ) */
else if ( !Q_stricmp( token, "scale" ) ) { else if ( striEqual( token, "scale" ) ) {
cm->type = CM_COLOR_SCALE; cm->type = CM_COLOR_SCALE;
Parse1DMatrixAppend( shaderText, 3, cm->data ); Parse1DMatrixAppend( shaderText, 3, cm->data );
} }
/* dotProduct ( X Y Z ) */ /* dotProduct ( X Y Z ) */
else if ( !Q_stricmp( token, "dotProduct" ) ) { else if ( striEqual( token, "dotProduct" ) ) {
cm->type = CM_COLOR_DOT_PRODUCT + alpha; cm->type = CM_COLOR_DOT_PRODUCT + alpha;
Parse1DMatrixAppend( shaderText, 3, cm->data ); Parse1DMatrixAppend( shaderText, 3, cm->data );
} }
/* dotProductScale ( X Y Z MIN MAX ) */ /* dotProductScale ( X Y Z MIN MAX ) */
else if ( !Q_stricmp( token, "dotProductScale" ) ) { else if ( striEqual( token, "dotProductScale" ) ) {
cm->type = CM_COLOR_DOT_PRODUCT_SCALE + alpha; cm->type = CM_COLOR_DOT_PRODUCT_SCALE + alpha;
Parse1DMatrixAppend( shaderText, 5, cm->data ); Parse1DMatrixAppend( shaderText, 5, cm->data );
} }
/* dotProduct2 ( X Y Z ) */ /* dotProduct2 ( X Y Z ) */
else if ( !Q_stricmp( token, "dotProduct2" ) ) { else if ( striEqual( token, "dotProduct2" ) ) {
cm->type = CM_COLOR_DOT_PRODUCT_2 + alpha; cm->type = CM_COLOR_DOT_PRODUCT_2 + alpha;
Parse1DMatrixAppend( shaderText, 3, cm->data ); Parse1DMatrixAppend( shaderText, 3, cm->data );
} }
/* dotProduct2scale ( X Y Z MIN MAX ) */ /* dotProduct2scale ( X Y Z MIN MAX ) */
else if ( !Q_stricmp( token, "dotProduct2scale" ) ) { else if ( striEqual( token, "dotProduct2scale" ) ) {
cm->type = CM_COLOR_DOT_PRODUCT_2_SCALE + alpha; cm->type = CM_COLOR_DOT_PRODUCT_2_SCALE + alpha;
Parse1DMatrixAppend( shaderText, 5, cm->data ); Parse1DMatrixAppend( shaderText, 5, cm->data );
} }
/* volume */ /* volume */
else if ( !Q_stricmp( token, "volume" ) ) { else if ( striEqual( token, "volume" ) ) {
/* special stub mode for flagging volume brushes */ /* special stub mode for flagging volume brushes */
cm->type = CM_VOLUME; cm->type = CM_VOLUME;
} }
@ -1814,14 +1814,14 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: gs mods: q3map_tcMod <style> <parameters> */ /* ydnar: gs mods: q3map_tcMod <style> <parameters> */
else if ( !Q_stricmp( token, "q3map_tcMod" ) ) { else if ( striEqual( token, "q3map_tcMod" ) ) {
float a, b; float a, b;
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
/* q3map_tcMod [translate | shift | offset] <s> <t> */ /* q3map_tcMod [translate | shift | offset] <s> <t> */
if ( !Q_stricmp( token, "translate" ) || !Q_stricmp( token, "shift" ) || !Q_stricmp( token, "offset" ) ) { if ( striEqual( token, "translate" ) || striEqual( token, "shift" ) || striEqual( token, "offset" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
a = atof( token ); a = atof( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1831,7 +1831,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_tcMod scale <s> <t> */ /* q3map_tcMod scale <s> <t> */
else if ( !Q_stricmp( token, "scale" ) ) { else if ( striEqual( token, "scale" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
a = atof( token ); a = atof( token );
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
@ -1841,7 +1841,7 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_tcMod rotate <s> <t> (fixme: make this communitive) */ /* q3map_tcMod rotate <s> <t> (fixme: make this communitive) */
else if ( !Q_stricmp( token, "rotate" ) ) { else if ( striEqual( token, "rotate" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
a = atof( token ); a = atof( token );
TCModRotate( si->mod, a ); TCModRotate( si->mod, a );
@ -1852,88 +1852,88 @@ static void ParseShaderFile( const char *filename ){
} }
/* q3map_fogDir (direction a fog shader fades from transparent to opaque) */ /* q3map_fogDir (direction a fog shader fades from transparent to opaque) */
else if ( !Q_stricmp( token, "q3map_fogDir" ) ) { else if ( striEqual( token, "q3map_fogDir" ) ) {
Parse1DMatrixAppend( shaderText, 3, si->fogDir ); Parse1DMatrixAppend( shaderText, 3, si->fogDir );
VectorNormalize( si->fogDir, si->fogDir ); VectorNormalize( si->fogDir, si->fogDir );
} }
/* q3map_globaltexture */ /* q3map_globaltexture */
else if ( !Q_stricmp( token, "q3map_globaltexture" ) ) { else if ( striEqual( token, "q3map_globaltexture" ) ) {
si->globalTexture = true; si->globalTexture = true;
} }
/* ydnar: gs mods: q3map_nonplanar (make it a nonplanar merge candidate for meta surfaces) */ /* ydnar: gs mods: q3map_nonplanar (make it a nonplanar merge candidate for meta surfaces) */
else if ( !Q_stricmp( token, "q3map_nonplanar" ) ) { else if ( striEqual( token, "q3map_nonplanar" ) ) {
si->nonplanar = true; si->nonplanar = true;
} }
/* ydnar: gs mods: q3map_noclip (preserve original face winding, don't clip by bsp tree) */ /* ydnar: gs mods: q3map_noclip (preserve original face winding, don't clip by bsp tree) */
else if ( !Q_stricmp( token, "q3map_noclip" ) ) { else if ( striEqual( token, "q3map_noclip" ) ) {
si->noClip = true; si->noClip = true;
} }
/* q3map_notjunc */ /* q3map_notjunc */
else if ( !Q_stricmp( token, "q3map_notjunc" ) ) { else if ( striEqual( token, "q3map_notjunc" ) ) {
si->notjunc = true; si->notjunc = true;
} }
/* q3map_nofog */ /* q3map_nofog */
else if ( !Q_stricmp( token, "q3map_nofog" ) ) { else if ( striEqual( token, "q3map_nofog" ) ) {
si->noFog = true; si->noFog = true;
} }
/* ydnar: gs mods: q3map_indexed (for explicit terrain-style indexed mapping) */ /* ydnar: gs mods: q3map_indexed (for explicit terrain-style indexed mapping) */
else if ( !Q_stricmp( token, "q3map_indexed" ) ) { else if ( striEqual( token, "q3map_indexed" ) ) {
si->indexed = true; si->indexed = true;
} }
/* ydnar: q3map_invert (inverts a drawsurface's facing) */ /* ydnar: q3map_invert (inverts a drawsurface's facing) */
else if ( !Q_stricmp( token, "q3map_invert" ) ) { else if ( striEqual( token, "q3map_invert" ) ) {
si->invert = true; si->invert = true;
} }
/* ydnar: gs mods: q3map_lightmapMergable (ok to merge non-planar */ /* ydnar: gs mods: q3map_lightmapMergable (ok to merge non-planar */
else if ( !Q_stricmp( token, "q3map_lightmapMergable" ) ) { else if ( striEqual( token, "q3map_lightmapMergable" ) ) {
si->lmMergable = true; si->lmMergable = true;
} }
/* ydnar: q3map_nofast */ /* ydnar: q3map_nofast */
else if ( !Q_stricmp( token, "q3map_noFast" ) ) { else if ( striEqual( token, "q3map_noFast" ) ) {
si->noFast = true; si->noFast = true;
} }
/* q3map_patchshadows */ /* q3map_patchshadows */
else if ( !Q_stricmp( token, "q3map_patchShadows" ) ) { else if ( striEqual( token, "q3map_patchShadows" ) ) {
si->patchShadows = true; si->patchShadows = true;
} }
/* q3map_vertexshadows */ /* q3map_vertexshadows */
else if ( !Q_stricmp( token, "q3map_vertexShadows" ) ) { else if ( striEqual( token, "q3map_vertexShadows" ) ) {
si->vertexShadows = true; /* ydnar */ si->vertexShadows = true; /* ydnar */
} }
/* q3map_novertexshadows */ /* q3map_novertexshadows */
else if ( !Q_stricmp( token, "q3map_noVertexShadows" ) ) { else if ( striEqual( token, "q3map_noVertexShadows" ) ) {
si->vertexShadows = false; /* ydnar */ si->vertexShadows = false; /* ydnar */
} }
/* q3map_splotchfix (filter dark lightmap luxels on lightmapped models) */ /* q3map_splotchfix (filter dark lightmap luxels on lightmapped models) */
else if ( !Q_stricmp( token, "q3map_splotchfix" ) ) { else if ( striEqual( token, "q3map_splotchfix" ) ) {
si->splotchFix = true; /* ydnar */ si->splotchFix = true; /* ydnar */
} }
/* q3map_forcesunlight */ /* q3map_forcesunlight */
else if ( !Q_stricmp( token, "q3map_forceSunlight" ) ) { else if ( striEqual( token, "q3map_forceSunlight" ) ) {
si->forceSunlight = true; si->forceSunlight = true;
} }
/* q3map_onlyvertexlighting (sof2) */ /* q3map_onlyvertexlighting (sof2) */
else if ( !Q_stricmp( token, "q3map_onlyVertexLighting" ) ) { else if ( striEqual( token, "q3map_onlyVertexLighting" ) ) {
ApplySurfaceParm( "pointlight", &si->contentFlags, &si->surfaceFlags, &si->compileFlags ); ApplySurfaceParm( "pointlight", &si->contentFlags, &si->surfaceFlags, &si->compileFlags );
} }
/* q3map_material (sof2) */ /* q3map_material (sof2) */
else if ( !Q_stricmp( token, "q3map_material" ) ) { else if ( striEqual( token, "q3map_material" ) ) {
GetTokenAppend( shaderText, false ); GetTokenAppend( shaderText, false );
sprintf( temp, "*mat_%s", token ); sprintf( temp, "*mat_%s", token );
if ( !ApplySurfaceParm( temp, &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) ) { if ( !ApplySurfaceParm( temp, &si->contentFlags, &si->surfaceFlags, &si->compileFlags ) ) {
@ -1942,15 +1942,15 @@ static void ParseShaderFile( const char *filename ){
} }
/* ydnar: q3map_clipmodel (autogenerate clip brushes for model triangles using this shader) */ /* ydnar: q3map_clipmodel (autogenerate clip brushes for model triangles using this shader) */
else if ( !Q_stricmp( token, "q3map_clipmodel" ) ) { else if ( striEqual( token, "q3map_clipmodel" ) ) {
si->clipModel = true; si->clipModel = true;
} }
/* ydnar: q3map_styleMarker[2] */ /* ydnar: q3map_styleMarker[2] */
else if ( !Q_stricmp( token, "q3map_styleMarker" ) ) { else if ( striEqual( token, "q3map_styleMarker" ) ) {
si->styleMarker = 1; si->styleMarker = 1;
} }
else if ( !Q_stricmp( token, "q3map_styleMarker2" ) ) { /* uses depthFunc equal */ else if ( striEqual( token, "q3map_styleMarker2" ) ) { /* uses depthFunc equal */
si->styleMarker = 2; si->styleMarker = 2;
} }

View File

@ -342,7 +342,7 @@ void LoadSurfaceExtraFile( const char *path ){
} }
/* default? */ /* default? */
if ( !Q_stricmp( token, "default" ) ) { if ( striEqual( token, "default" ) ) {
se = &seDefault; se = &seDefault;
} }
@ -372,49 +372,49 @@ void LoadSurfaceExtraFile( const char *path ){
} }
/* shader */ /* shader */
if ( !Q_stricmp( token, "shader" ) ) { if ( striEqual( token, "shader" ) ) {
GetToken( false ); GetToken( false );
se->si = ShaderInfoForShader( token ); se->si = ShaderInfoForShader( token );
} }
/* parent surface number */ /* parent surface number */
else if ( !Q_stricmp( token, "parent" ) ) { else if ( striEqual( token, "parent" ) ) {
GetToken( false ); GetToken( false );
se->parentSurfaceNum = atoi( token ); se->parentSurfaceNum = atoi( token );
} }
/* entity number */ /* entity number */
else if ( !Q_stricmp( token, "entity" ) ) { else if ( striEqual( token, "entity" ) ) {
GetToken( false ); GetToken( false );
se->entityNum = atoi( token ); se->entityNum = atoi( token );
} }
/* cast shadows */ /* cast shadows */
else if ( !Q_stricmp( token, "castShadows" ) ) { else if ( striEqual( token, "castShadows" ) ) {
GetToken( false ); GetToken( false );
se->castShadows = atoi( token ); se->castShadows = atoi( token );
} }
/* recv shadows */ /* recv shadows */
else if ( !Q_stricmp( token, "receiveShadows" ) ) { else if ( striEqual( token, "receiveShadows" ) ) {
GetToken( false ); GetToken( false );
se->recvShadows = atoi( token ); se->recvShadows = atoi( token );
} }
/* lightmap sample size */ /* lightmap sample size */
else if ( !Q_stricmp( token, "sampleSize" ) ) { else if ( striEqual( token, "sampleSize" ) ) {
GetToken( false ); GetToken( false );
se->sampleSize = atoi( token ); se->sampleSize = atoi( token );
} }
/* longest curve */ /* longest curve */
else if ( !Q_stricmp( token, "longestCurve" ) ) { else if ( striEqual( token, "longestCurve" ) ) {
GetToken( false ); GetToken( false );
se->longestCurve = atof( token ); se->longestCurve = atof( token );
} }
/* lightmap axis vector */ /* lightmap axis vector */
else if ( !Q_stricmp( token, "lightmapAxis" ) ) { else if ( striEqual( token, "lightmapAxis" ) ) {
Parse1DMatrix( 3, se->lightmapAxis ); Parse1DMatrix( 3, se->lightmapAxis );
} }

View File

@ -70,7 +70,7 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
} }
} }
/* compare name */ /* compare name */
if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) { if ( striEqual( shader, bspShaders[ i ].shader ) ) {
return i; return i;
} }
} }