diff --git a/tools/quake3/q3map2/autopk3.cpp b/tools/quake3/q3map2/autopk3.cpp index 30108f8b..789e4bcd 100644 --- a/tools/quake3/q3map2/autopk3.cpp +++ b/tools/quake3/q3map2/autopk3.cpp @@ -218,13 +218,13 @@ int pk3BSPMain( int argc, char **argv ){ /* process arguments */ for ( i = 1; i < ( argc - 1 ); ++i ){ - if ( strEqual( argv[ i ], "-dbg" ) ) { + if ( striEqual( argv[ i ], "-dbg" ) ) { dbg = true; } - else if ( strEqual( argv[ i ], "-png" ) ) { + else if ( striEqual( argv[ i ], "-png" ) ) { png = true; } - else if ( strEqual( argv[ i ], "-complevel" ) ) { + else if ( striEqual( argv[ i ], "-complevel" ) ) { compLevel = std::clamp( atoi( argv[ i + 1 ] ), -1, 10 ); i++; Sys_Printf( "Compression level set to %i\n", compLevel ); @@ -765,16 +765,16 @@ int repackBSPMain( int argc, char **argv ){ StringOutputStream stream( 256 ); /* process arguments */ for ( i = 1; i < ( argc - 1 ); ++i ){ - if ( strEqual( argv[ i ], "-dbg" ) ) { + if ( striEqual( argv[ i ], "-dbg" ) ) { dbg = true; } - else if ( strEqual( argv[ i ], "-png" ) ) { + else if ( striEqual( argv[ i ], "-png" ) ) { png = true; } - else if ( strEqual( argv[ i ], "-analyze" ) ) { // only analyze bsps and exit + else if ( striEqual( argv[ i ], "-analyze" ) ) { // only analyze bsps and exit analyze = true; } - else if ( strEqual( argv[ i ], "-complevel" ) ) { + else if ( striEqual( argv[ i ], "-complevel" ) ) { compLevel = std::clamp( atoi( argv[ i + 1 ] ), -1, 10 ); i++; Sys_Printf( "Compression level set to %i\n", compLevel ); diff --git a/tools/quake3/q3map2/bsp.cpp b/tools/quake3/q3map2/bsp.cpp index 136e2642..3d7b4f2a 100644 --- a/tools/quake3/q3map2/bsp.cpp +++ b/tools/quake3/q3map2/bsp.cpp @@ -684,7 +684,7 @@ int BSPMain( int argc, char **argv ){ char tempSource[ 1024 ]; bool onlyents = false; - if ( argc >= 2 && strEqual( argv[ 1 ], "-bsp" ) ) { + if ( argc >= 2 && striEqual( argv[ 1 ], "-bsp" ) ) { Sys_Printf( "-bsp argument unnecessary\n" ); argv++; argc--; @@ -710,128 +710,128 @@ int BSPMain( int argc, char **argv ){ /* process arguments */ for ( i = 1; i < ( argc - 1 ); i++ ) { - if ( strEqual( argv[ i ], "-onlyents" ) ) { + if ( striEqual( argv[ i ], "-onlyents" ) ) { Sys_Printf( "Running entity-only compile\n" ); onlyents = true; } - else if ( strEqual( argv[ i ], "-tempname" ) ) { + else if ( striEqual( argv[ i ], "-tempname" ) ) { strcpy( tempSource, argv[ ++i ] ); } - else if ( strEqual( argv[ i ], "-nowater" ) ) { + else if ( striEqual( argv[ i ], "-nowater" ) ) { Sys_Printf( "Disabling water\n" ); nowater = true; } - else if ( strEqual( argv[ i ], "-keeplights" ) ) { + else if ( striEqual( argv[ i ], "-keeplights" ) ) { keepLights = true; Sys_Printf( "Leaving light entities on map after compile\n" ); } - else if ( strEqual( argv[ i ], "-nodetail" ) ) { + else if ( striEqual( argv[ i ], "-nodetail" ) ) { Sys_Printf( "Ignoring detail brushes\n" ) ; nodetail = true; } - else if ( strEqual( argv[ i ], "-fulldetail" ) ) { + else if ( striEqual( argv[ i ], "-fulldetail" ) ) { Sys_Printf( "Turning detail brushes into structural brushes\n" ); fulldetail = true; } - else if ( strEqual( argv[ i ], "-nofog" ) ) { + else if ( striEqual( argv[ i ], "-nofog" ) ) { Sys_Printf( "Fog volumes disabled\n" ); nofog = true; } - else if ( strEqual( argv[ i ], "-nosubdivide" ) ) { + else if ( striEqual( argv[ i ], "-nosubdivide" ) ) { Sys_Printf( "Disabling brush face subdivision\n" ); nosubdivide = true; } - else if ( strEqual( argv[ i ], "-leaktest" ) ) { + else if ( striEqual( argv[ i ], "-leaktest" ) ) { Sys_Printf( "Leaktest enabled\n" ); leaktest = true; } - else if ( strEqual( argv[ i ], "-verboseentities" ) ) { + else if ( striEqual( argv[ i ], "-verboseentities" ) ) { Sys_Printf( "Verbose entities enabled\n" ); verboseEntities = true; } - else if ( strEqual( argv[ i ], "-nocurves" ) ) { + else if ( striEqual( argv[ i ], "-nocurves" ) ) { Sys_Printf( "Ignoring curved surfaces (patches)\n" ); noCurveBrushes = true; } - else if ( strEqual( argv[ i ], "-notjunc" ) ) { + else if ( striEqual( argv[ i ], "-notjunc" ) ) { Sys_Printf( "T-junction fixing disabled\n" ); notjunc = true; } - else if ( strEqual( argv[ i ], "-fakemap" ) ) { + else if ( striEqual( argv[ i ], "-fakemap" ) ) { Sys_Printf( "Generating fakemap.map\n" ); fakemap = true; } - else if ( strEqual( argv[ i ], "-samplesize" ) ) { + else if ( striEqual( argv[ i ], "-samplesize" ) ) { sampleSize = std::max( 1, atoi( argv[ i + 1 ] ) ); i++; Sys_Printf( "Lightmap sample size set to %dx%d units\n", sampleSize, sampleSize ); } - else if ( strEqual( argv[ i ], "-minsamplesize" ) ) { + else if ( striEqual( argv[ i ], "-minsamplesize" ) ) { minSampleSize = std::max( 1, atoi( argv[ i + 1 ] ) ); i++; Sys_Printf( "Minimum lightmap sample size set to %dx%d units\n", minSampleSize, minSampleSize ); } - else if ( strEqual( argv[ i ], "-custinfoparms" ) ) { + else if ( striEqual( argv[ i ], "-custinfoparms" ) ) { Sys_Printf( "Custom info parms enabled\n" ); useCustomInfoParms = true; } /* sof2 args */ - else if ( strEqual( argv[ i ], "-rename" ) ) { + else if ( striEqual( argv[ i ], "-rename" ) ) { Sys_Printf( "Appending _bsp suffix to misc_model shaders (SOF2)\n" ); renameModelShaders = true; } /* ydnar args */ - else if ( strEqual( argv[ i ], "-ne" ) ) { + else if ( striEqual( argv[ i ], "-ne" ) ) { normalEpsilon = atof( argv[ i + 1 ] ); i++; Sys_Printf( "Normal epsilon set to %f\n", normalEpsilon ); } - else if ( strEqual( argv[ i ], "-de" ) ) { + else if ( striEqual( argv[ i ], "-de" ) ) { distanceEpsilon = atof( argv[ i + 1 ] ); i++; Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon ); } - else if ( strEqual( argv[ i ], "-mv" ) ) { + else if ( striEqual( argv[ i ], "-mv" ) ) { maxLMSurfaceVerts = std::max( 3, atoi( argv[ i + 1 ] ) ); value_maximize( maxSurfaceVerts, maxLMSurfaceVerts ); i++; Sys_Printf( "Maximum lightmapped surface vertex count set to %d\n", maxLMSurfaceVerts ); } - else if ( strEqual( argv[ i ], "-mi" ) ) { + else if ( striEqual( argv[ i ], "-mi" ) ) { maxSurfaceIndexes = std::max( 3, atoi( argv[ i + 1 ] ) ); Sys_Printf( "Maximum per-surface index count set to %d\n", maxSurfaceIndexes ); i++; } - else if ( strEqual( argv[ i ], "-np" ) ) { + else if ( striEqual( argv[ i ], "-np" ) ) { npDegrees = std::max( 0.0, atof( argv[ i + 1 ] ) ); if ( npDegrees > 0.0f ) { Sys_Printf( "Forcing nonplanar surfaces with a breaking angle of %f degrees\n", npDegrees ); } i++; } - else if ( strEqual( argv[ i ], "-snap" ) ) { + else if ( striEqual( argv[ i ], "-snap" ) ) { bevelSnap = std::max( 0, atoi( argv[ i + 1 ] ) ); if ( bevelSnap > 0 ) { Sys_Printf( "Snapping brush bevel planes to %d units\n", bevelSnap ); } i++; } - else if ( strEqual( argv[ i ], "-texrange" ) ) { + else if ( striEqual( argv[ i ], "-texrange" ) ) { texRange = std::max( 0, atoi( argv[ i + 1 ] ) ); i++; Sys_Printf( "Limiting per-surface texture range to %d texels\n", texRange ); } - else if ( strEqual( argv[ i ], "-nohint" ) ) { + else if ( striEqual( argv[ i ], "-nohint" ) ) { Sys_Printf( "Hint brushes disabled\n" ); noHint = true; } - else if ( strEqual( argv[ i ], "-flat" ) ) { + else if ( striEqual( argv[ i ], "-flat" ) ) { Sys_Printf( "Flatshading enabled\n" ); flat = true; } - else if ( strEqual( argv[ i ], "-celshader" ) ) { + else if ( striEqual( argv[ i ], "-celshader" ) ) { ++i; if ( !strEmpty( argv[ i ] ) ) { globalCelShader( "textures/", argv[ i ] ); @@ -841,25 +841,25 @@ int BSPMain( int argc, char **argv ){ } Sys_Printf( "Global cel shader set to \"%s\"\n", globalCelShader.c_str() ); } - else if ( strEqual( argv[ i ], "-meta" ) ) { + else if ( striEqual( argv[ i ], "-meta" ) ) { Sys_Printf( "Creating meta surfaces from brush faces\n" ); meta = true; } - else if ( strEqual( argv[ i ], "-metaadequatescore" ) ) { + else if ( striEqual( argv[ i ], "-metaadequatescore" ) ) { metaAdequateScore = std::max( -1, atoi( argv[ i + 1 ] ) ); i++; if ( metaAdequateScore >= 0 ) { Sys_Printf( "Setting ADEQUATE meta score to %d (see surface_meta.c)\n", metaAdequateScore ); } } - else if ( strEqual( argv[ i ], "-metagoodscore" ) ) { + else if ( striEqual( argv[ i ], "-metagoodscore" ) ) { metaGoodScore = std::max( -1, atoi( argv[ i + 1 ] ) ); i++; if ( metaGoodScore >= 0 ) { Sys_Printf( "Setting GOOD meta score to %d (see surface_meta.c)\n", metaGoodScore ); } } - else if ( strEqual( argv[ i ], "-metamaxbboxdistance" ) ) { + else if ( striEqual( argv[ i ], "-metamaxbboxdistance" ) ) { metaMaxBBoxDistance = atof( argv[ i + 1 ] ); if ( metaMaxBBoxDistance < 0 ) { metaMaxBBoxDistance = -1; @@ -869,82 +869,82 @@ int BSPMain( int argc, char **argv ){ Sys_Printf( "Setting meta maximum bounding box distance to %f\n", metaMaxBBoxDistance ); } } - else if ( strEqual( argv[ i ], "-patchmeta" ) ) { + else if ( striEqual( argv[ i ], "-patchmeta" ) ) { Sys_Printf( "Creating meta surfaces from patches\n" ); patchMeta = true; } - else if ( strEqual( argv[ i ], "-flares" ) ) { + else if ( striEqual( argv[ i ], "-flares" ) ) { Sys_Printf( "Flare surfaces enabled\n" ); emitFlares = true; } - else if ( strEqual( argv[ i ], "-noflares" ) ) { + else if ( striEqual( argv[ i ], "-noflares" ) ) { Sys_Printf( "Flare surfaces disabled\n" ); emitFlares = false; } - else if ( strEqual( argv[ i ], "-skyfix" ) ) { + else if ( striEqual( argv[ i ], "-skyfix" ) ) { Sys_Printf( "GL_CLAMP sky fix/hack/workaround enabled\n" ); skyFixHack = true; } - else if ( strEqual( argv[ i ], "-debugsurfaces" ) ) { + else if ( striEqual( argv[ i ], "-debugsurfaces" ) ) { Sys_Printf( "emitting debug surfaces\n" ); debugSurfaces = true; } - else if ( strEqual( argv[ i ], "-debuginset" ) ) { + else if ( striEqual( argv[ i ], "-debuginset" ) ) { Sys_Printf( "Debug surface triangle insetting enabled\n" ); debugInset = true; } - else if ( strEqual( argv[ i ], "-debugportals" ) ) { + else if ( striEqual( argv[ i ], "-debugportals" ) ) { Sys_Printf( "Debug portal surfaces enabled\n" ); debugPortals = true; } - else if ( strEqual( argv[ i ], "-debugclip" ) ) { + else if ( striEqual( argv[ i ], "-debugclip" ) ) { Sys_Printf( "Debug model clip enabled\n" ); debugClip = true; } - else if ( strEqual( argv[ i ], "-clipdepth" ) ) { + else if ( striEqual( argv[ i ], "-clipdepth" ) ) { clipDepthGlobal = atof( argv[ i + 1 ] ); i++; Sys_Printf( "Model autoclip thickness set to %.3f\n", clipDepthGlobal ); } - else if ( strEqual( argv[ i ], "-sRGBtex" ) ) { + else if ( striEqual( argv[ i ], "-sRGBtex" ) ) { texturesRGB = true; Sys_Printf( "Textures are in sRGB\n" ); } - else if ( strEqual( argv[ i ], "-nosRGBtex" ) ) { + else if ( striEqual( argv[ i ], "-nosRGBtex" ) ) { texturesRGB = false; Sys_Printf( "Textures are linear\n" ); } - else if ( strEqual( argv[ i ], "-sRGBcolor" ) ) { + else if ( striEqual( argv[ i ], "-sRGBcolor" ) ) { colorsRGB = true; Sys_Printf( "Colors are in sRGB\n" ); } - else if ( strEqual( argv[ i ], "-nosRGBcolor" ) ) { + else if ( striEqual( argv[ i ], "-nosRGBcolor" ) ) { colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } - else if ( strEqual( argv[ i ], "-nosRGB" ) ) { + else if ( striEqual( argv[ i ], "-nosRGB" ) ) { texturesRGB = false; Sys_Printf( "Textures are linear\n" ); colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } - else if ( strEqual( argv[ i ], "-altsplit" ) ) { + else if ( striEqual( argv[ i ], "-altsplit" ) ) { Sys_Printf( "Alternate BSP splitting (by 27) enabled\n" ); bspAlternateSplitWeights = true; } - else if ( strEqual( argv[ i ], "-deep" ) ) { + else if ( striEqual( argv[ i ], "-deep" ) ) { Sys_Printf( "Deep BSP tree generation enabled\n" ); deepBSP = true; } - else if ( strEqual( argv[ i ], "-maxarea" ) ) { + else if ( striEqual( argv[ i ], "-maxarea" ) ) { Sys_Printf( "Max Area face surface generation enabled\n" ); maxAreaFaceSurface = true; } - else if ( strEqual( argv[ i ], "-noob" ) ) { + else if ( striEqual( argv[ i ], "-noob" ) ) { Sys_Printf( "No oBs!\n" ); noob = true; } - else if ( strEqual( argv[ i ], "-autocaulk" ) ) { + else if ( striEqual( argv[ i ], "-autocaulk" ) ) { Sys_Printf( "\trunning in autocaulk mode\n" ); g_autocaulk = true; } diff --git a/tools/quake3/q3map2/convert_bsp.cpp b/tools/quake3/q3map2/convert_bsp.cpp index a000fd70..764ab994 100644 --- a/tools/quake3/q3map2/convert_bsp.cpp +++ b/tools/quake3/q3map2/convert_bsp.cpp @@ -164,7 +164,7 @@ int AnalyzeBSP( int argc, char **argv ){ for ( i = 1; i < ( argc - 1 ); i++ ) { /* -format map|ase|... */ - if ( strEqual( argv[ i ], "-lumpswap" ) ) { + if ( striEqual( argv[ i ], "-lumpswap" ) ) { Sys_Printf( "Swapped lump structs enabled\n" ); lumpSwap = true; } @@ -418,10 +418,10 @@ int ScaleBSPMain( int argc, char **argv ){ texscale = false; for ( i = 1; i < argc - 2; ++i ) { - if ( strEqual( argv[i], "-tex" ) ) { + if ( striEqual( argv[i], "-tex" ) ) { texscale = true; } - else if ( strEqual( argv[i], "-spawn_ref" ) ) { + else if ( striEqual( argv[i], "-spawn_ref" ) ) { spawn_ref = atof( argv[i + 1] ); ++i; } @@ -639,9 +639,9 @@ int ShiftBSPMain( int argc, char **argv ){ for ( i = 1; i < argc - 2; ++i ) { - if ( strEqual( argv[i], "-tex" ) ) { + if ( striEqual( argv[i], "-tex" ) ) { } - else if ( strEqual( argv[i], "-spawn_ref" ) ) { + else if ( striEqual( argv[i], "-spawn_ref" ) ) { spawn_ref = atof( argv[i + 1] ); ++i; } @@ -886,7 +886,7 @@ int ConvertBSPMain( int argc, char **argv ){ for ( i = 1; i < ( argc - 1 ); i++ ) { /* -format map|ase|... */ - if ( strEqual( argv[ i ], "-format" ) ) { + if ( striEqual( argv[ i ], "-format" ) ) { i++; if ( striEqual( argv[ i ], "ase" ) ) { convertFunc = ConvertBSPToASE; @@ -913,40 +913,40 @@ int ConvertBSPMain( int argc, char **argv ){ } } } - else if ( strEqual( argv[ i ], "-ne" ) ) { + else if ( striEqual( argv[ i ], "-ne" ) ) { normalEpsilon = atof( argv[ i + 1 ] ); i++; Sys_Printf( "Normal epsilon set to %f\n", normalEpsilon ); } - else if ( strEqual( argv[ i ], "-de" ) ) { + else if ( striEqual( argv[ i ], "-de" ) ) { distanceEpsilon = atof( argv[ i + 1 ] ); i++; Sys_Printf( "Distance epsilon set to %f\n", distanceEpsilon ); } - else if ( strEqual( argv[ i ], "-shaderasbitmap" ) || strEqual( argv[ i ], "-shadersasbitmap" ) ) { + else if ( striEqual( argv[ i ], "-shaderasbitmap" ) || striEqual( argv[ i ], "-shadersasbitmap" ) ) { shadersAsBitmap = true; } - else if ( strEqual( argv[ i ], "-lightmapastexcoord" ) || strEqual( argv[ i ], "-lightmapsastexcoord" ) ) { + else if ( striEqual( argv[ i ], "-lightmapastexcoord" ) || striEqual( argv[ i ], "-lightmapsastexcoord" ) ) { lightmapsAsTexcoord = true; } - else if ( strEqual( argv[ i ], "-deluxemapastexcoord" ) || strEqual( argv[ i ], "-deluxemapsastexcoord" ) ) { + else if ( striEqual( argv[ i ], "-deluxemapastexcoord" ) || striEqual( argv[ i ], "-deluxemapsastexcoord" ) ) { lightmapsAsTexcoord = true; deluxemap = true; } - else if ( strEqual( argv[ i ], "-readbsp" ) ) { + else if ( striEqual( argv[ i ], "-readbsp" ) ) { force_bsp = true; } - else if ( strEqual( argv[ i ], "-readmap" ) ) { + else if ( striEqual( argv[ i ], "-readmap" ) ) { force_map = true; } - else if ( strEqual( argv[ i ], "-meta" ) ) { + else if ( striEqual( argv[ i ], "-meta" ) ) { meta = true; } - else if ( strEqual( argv[ i ], "-patchmeta" ) ) { + else if ( striEqual( argv[ i ], "-patchmeta" ) ) { meta = true; patchMeta = true; } - else if ( strEqual( argv[ i ], "-fast" ) ) { + else if ( striEqual( argv[ i ], "-fast" ) ) { fast = true; } } diff --git a/tools/quake3/q3map2/help.cpp b/tools/quake3/q3map2/help.cpp index ce8b7047..0528f73c 100644 --- a/tools/quake3/q3map2/help.cpp +++ b/tools/quake3/q3map2/help.cpp @@ -449,7 +449,7 @@ void HelpMain(const char* arg) unsigned i; for ( i = 0; i < sizeof(stages)/sizeof(struct HelpOption); i++ ) - if ( strEqual(arg, stages[i].name+1) ) + if ( striEqual(arg, stages[i].name+1) ) { help_funcs[i](); return; diff --git a/tools/quake3/q3map2/light.cpp b/tools/quake3/q3map2/light.cpp index af37431b..01da3bdd 100644 --- a/tools/quake3/q3map2/light.cpp +++ b/tools/quake3/q3map2/light.cpp @@ -2048,7 +2048,7 @@ int LightMain( int argc, char **argv ){ for ( i = 1; i < ( argc - 1 ); i++ ) { /* lightsource scaling */ - if ( strEqual( argv[ i ], "-point" ) || strEqual( argv[ i ], "-pointscale" ) ) { + if ( striEqual( argv[ i ], "-point" ) || striEqual( argv[ i ], "-pointscale" ) ) { f = atof( argv[ i + 1 ] ); pointScale *= f; spotScale *= f; @@ -2057,42 +2057,42 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-spherical" ) || strEqual( argv[ i ], "-sphericalscale" ) ) { + else if ( striEqual( argv[ i ], "-spherical" ) || striEqual( argv[ i ], "-sphericalscale" ) ) { f = atof( argv[ i + 1 ] ); pointScale *= f; Sys_Printf( "Spherical point (entity) light scaled by %f to %f\n", f, pointScale ); i++; } - else if ( strEqual( argv[ i ], "-spot" ) || strEqual( argv[ i ], "-spotscale" ) ) { + else if ( striEqual( argv[ i ], "-spot" ) || striEqual( argv[ i ], "-spotscale" ) ) { f = atof( argv[ i + 1 ] ); spotScale *= f; Sys_Printf( "Spot point (entity) light scaled by %f to %f\n", f, spotScale ); i++; } - else if ( strEqual( argv[ i ], "-area" ) || strEqual( argv[ i ], "-areascale" ) ) { + else if ( striEqual( argv[ i ], "-area" ) || striEqual( argv[ i ], "-areascale" ) ) { f = atof( argv[ i + 1 ] ); areaScale *= f; Sys_Printf( "Area (shader) light scaled by %f to %f\n", f, areaScale ); i++; } - else if ( strEqual( argv[ i ], "-sky" ) || strEqual( argv[ i ], "-skyscale" ) ) { + else if ( striEqual( argv[ i ], "-sky" ) || striEqual( argv[ i ], "-skyscale" ) ) { f = atof( argv[ i + 1 ] ); skyScale *= f; Sys_Printf( "Sky/sun light scaled by %f to %f\n", f, skyScale ); i++; } - else if ( strEqual( argv[ i ], "-vertexscale" ) ) { + else if ( striEqual( argv[ i ], "-vertexscale" ) ) { f = atof( argv[ i + 1 ] ); vertexglobalscale *= f; Sys_Printf( "Vertexlight scaled by %f to %f\n", f, vertexglobalscale ); i++; } - else if ( strEqual( argv[ i ], "-backsplash" ) && i < ( argc - 3 ) ) { + else if ( striEqual( argv[ i ], "-backsplash" ) && i < ( argc - 3 ) ) { g_backsplashFractionScale = atof( argv[ i + 1 ] ); Sys_Printf( "Area lights backsplash fraction scaled by %f\n", g_backsplashFractionScale ); f = atof( argv[ i + 2 ] ); @@ -2103,25 +2103,25 @@ int LightMain( int argc, char **argv ){ i+=2; } - else if ( strEqual( argv[ i ], "-nolm" ) ) { + else if ( striEqual( argv[ i ], "-nolm" ) ) { nolm = true; Sys_Printf( "No lightmaps yo\n" ); } - else if ( strEqual( argv[ i ], "-bouncecolorratio" ) ) { + else if ( striEqual( argv[ i ], "-bouncecolorratio" ) ) { bounceColorRatio = std::clamp( atof( argv[ i + 1 ] ), 0.0, 1.0 ); Sys_Printf( "Bounce color ratio set to %f\n", bounceColorRatio ); i++; } - else if ( strEqual( argv[ i ], "-bouncescale" ) ) { + else if ( striEqual( argv[ i ], "-bouncescale" ) ) { f = atof( argv[ i + 1 ] ); bounceScale *= f; Sys_Printf( "Bounce (radiosity) light scaled by %f to %f\n", f, bounceScale ); i++; } - else if ( strEqual( argv[ i ], "-scale" ) ) { + else if ( striEqual( argv[ i ], "-scale" ) ) { f = atof( argv[ i + 1 ] ); pointScale *= f; spotScale *= f; @@ -2132,72 +2132,72 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-gridscale" ) ) { + else if ( striEqual( argv[ i ], "-gridscale" ) ) { f = atof( argv[ i + 1 ] ); Sys_Printf( "Grid lightning scaled by %f\n", f ); gridScale *= f; i++; } - else if ( strEqual( argv[ i ], "-gridambientscale" ) ) { + else if ( striEqual( argv[ i ], "-gridambientscale" ) ) { f = atof( argv[ i + 1 ] ); Sys_Printf( "Grid ambient lightning scaled by %f\n", f ); gridAmbientScale *= f; i++; } - else if ( strEqual( argv[ i ], "-griddirectionality" ) ) { + else if ( striEqual( argv[ i ], "-griddirectionality" ) ) { gridDirectionality = std::min( 1.0, atof( argv[ i + 1 ] ) ); value_minimize( gridAmbientDirectionality, gridDirectionality ); Sys_Printf( "Grid directionality is %f\n", gridDirectionality ); i++; } - else if ( strEqual( argv[ i ], "-gridambientdirectionality" ) ) { + else if ( striEqual( argv[ i ], "-gridambientdirectionality" ) ) { gridAmbientDirectionality = std::max( -1.0, atof( argv[ i + 1 ] ) ); value_maximize( gridDirectionality, gridAmbientDirectionality ); Sys_Printf( "Grid ambient directionality is %f\n", gridAmbientDirectionality ); i++; } - else if ( strEqual( argv[ i ], "-gamma" ) ) { + else if ( striEqual( argv[ i ], "-gamma" ) ) { f = atof( argv[ i + 1 ] ); lightmapGamma = f; Sys_Printf( "Lighting gamma set to %f\n", lightmapGamma ); i++; } - else if ( strEqual( argv[ i ], "-sRGBlight" ) ) { + else if ( striEqual( argv[ i ], "-sRGBlight" ) ) { lightmapsRGB = true; Sys_Printf( "Lighting is in sRGB\n" ); } - else if ( strEqual( argv[ i ], "-nosRGBlight" ) ) { + else if ( striEqual( argv[ i ], "-nosRGBlight" ) ) { lightmapsRGB = false; Sys_Printf( "Lighting is linear\n" ); } - else if ( strEqual( argv[ i ], "-sRGBtex" ) ) { + else if ( striEqual( argv[ i ], "-sRGBtex" ) ) { texturesRGB = true; Sys_Printf( "Textures are in sRGB\n" ); } - else if ( strEqual( argv[ i ], "-nosRGBtex" ) ) { + else if ( striEqual( argv[ i ], "-nosRGBtex" ) ) { texturesRGB = false; Sys_Printf( "Textures are linear\n" ); } - else if ( strEqual( argv[ i ], "-sRGBcolor" ) ) { + else if ( striEqual( argv[ i ], "-sRGBcolor" ) ) { colorsRGB = true; Sys_Printf( "Colors are in sRGB\n" ); } - else if ( strEqual( argv[ i ], "-nosRGBcolor" ) ) { + else if ( striEqual( argv[ i ], "-nosRGBcolor" ) ) { colorsRGB = false; Sys_Printf( "Colors are linear\n" ); } - else if ( strEqual( argv[ i ], "-sRGB" ) ) { + else if ( striEqual( argv[ i ], "-sRGB" ) ) { lightmapsRGB = true; Sys_Printf( "Lighting is in sRGB\n" ); texturesRGB = true; @@ -2206,7 +2206,7 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Colors are in sRGB\n" ); } - else if ( strEqual( argv[ i ], "-nosRGB" ) ) { + else if ( striEqual( argv[ i ], "-nosRGB" ) ) { lightmapsRGB = false; Sys_Printf( "Lighting is linear\n" ); texturesRGB = false; @@ -2215,14 +2215,14 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Colors are linear\n" ); } - else if ( strEqual( argv[ i ], "-exposure" ) ) { + else if ( striEqual( argv[ i ], "-exposure" ) ) { f = atof( argv[ i + 1 ] ); lightmapExposure = f; Sys_Printf( "Lighting exposure set to %f\n", lightmapExposure ); i++; } - else if ( strEqual( argv[ i ], "-compensate" ) ) { + else if ( striEqual( argv[ i ], "-compensate" ) ) { f = atof( argv[ i + 1 ] ); if ( f <= 0.0f ) { f = 1.0f; @@ -2233,14 +2233,14 @@ int LightMain( int argc, char **argv ){ } /* Lightmaps brightness */ - else if( strEqual( argv[ i ], "-brightness" ) ){ + else if( striEqual( argv[ i ], "-brightness" ) ){ lightmapBrightness = atof( argv[ i + 1 ] ); Sys_Printf( "Scaling lightmaps brightness by %f\n", lightmapBrightness ); i++; } /* Lighting contrast */ - else if( strEqual( argv[ i ], "-contrast" ) ){ + else if( striEqual( argv[ i ], "-contrast" ) ){ lightmapContrast = std::clamp( atof( argv[ i + 1 ] ), -255.0, 255.0 ); Sys_Printf( "Lighting contrast set to %f\n", lightmapContrast ); i++; @@ -2249,7 +2249,7 @@ int LightMain( int argc, char **argv ){ } /* ydnar switches */ - else if ( strEqual( argv[ i ], "-bounce" ) ) { + else if ( striEqual( argv[ i ], "-bounce" ) ) { bounce = std::max( 0, atoi( argv[ i + 1 ] ) ); if ( bounce > 0 ) { Sys_Printf( "Radiosity enabled with %d bounce(s)\n", bounce ); @@ -2257,7 +2257,7 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-supersample" ) || strEqual( argv[ i ], "-super" ) ) { + else if ( striEqual( argv[ i ], "-supersample" ) || striEqual( argv[ i ], "-super" ) ) { superSample = std::max( 1, atoi( argv[ i + 1 ] ) ); if ( superSample > 1 ) { Sys_Printf( "Ordered-grid supersampling enabled with %d sample(s) per lightmap texel\n", ( superSample * superSample ) ); @@ -2265,12 +2265,12 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-randomsamples" ) ) { + else if ( striEqual( argv[ i ], "-randomsamples" ) ) { lightRandomSamples = true; Sys_Printf( "Random sampling enabled\n", lightRandomSamples ); } - else if ( strEqual( argv[ i ], "-samples" ) ) { + else if ( striEqual( argv[ i ], "-samples" ) ) { lightSamplesInsist = ( *argv[i + 1] == '+' ); lightSamples = std::max( 1, atoi( argv[ i + 1 ] ) ); if ( lightSamples > 1 ) { @@ -2279,24 +2279,24 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-samplessearchboxsize" ) ) { + else if ( striEqual( argv[ i ], "-samplessearchboxsize" ) ) { lightSamplesSearchBoxSize = std::clamp( atoi( argv[ i + 1 ] ), 1, 4 ); /* more makes no sense */ if ( lightSamplesSearchBoxSize != 1 ) Sys_Printf( "Adaptive supersampling uses %f times the normal search box size\n", lightSamplesSearchBoxSize ); i++; } - else if ( strEqual( argv[ i ], "-filter" ) ) { + else if ( striEqual( argv[ i ], "-filter" ) ) { filter = true; Sys_Printf( "Lightmap filtering enabled\n" ); } - else if ( strEqual( argv[ i ], "-dark" ) ) { + else if ( striEqual( argv[ i ], "-dark" ) ) { dark = true; Sys_Printf( "Dark lightmap seams enabled\n" ); } - else if ( strEqual( argv[ i ], "-shadeangle" ) ) { + else if ( striEqual( argv[ i ], "-shadeangle" ) ) { shadeAngleDegrees = std::max( 0.0, atof( argv[ i + 1 ] ) ); if ( shadeAngleDegrees > 0.0f ) { shade = true; @@ -2305,7 +2305,7 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-thresh" ) ) { + else if ( striEqual( argv[ i ], "-thresh" ) ) { subdivideThreshold = atof( argv[ i + 1 ] ); if ( subdivideThreshold < 0 ) { subdivideThreshold = DEFAULT_SUBDIVIDE_THRESHOLD; @@ -2316,18 +2316,18 @@ int LightMain( int argc, char **argv ){ i++; } - else if ( strEqual( argv[ i ], "-approx" ) ) { + else if ( striEqual( argv[ i ], "-approx" ) ) { approximateTolerance = std::max( 0, atoi( argv[ i + 1 ] ) ); if ( approximateTolerance > 0 ) { Sys_Printf( "Approximating lightmaps within a byte tolerance of %d\n", approximateTolerance ); } i++; } - else if ( strEqual( argv[ i ], "-deluxe" ) || strEqual( argv[ i ], "-deluxemap" ) ) { + else if ( striEqual( argv[ i ], "-deluxe" ) || striEqual( argv[ i ], "-deluxemap" ) ) { deluxemap = true; Sys_Printf( "Generating deluxemaps for average light direction\n" ); } - else if ( strEqual( argv[ i ], "-deluxemode" ) ) { + else if ( striEqual( argv[ i ], "-deluxemode" ) ) { deluxemode = atoi( argv[ i + 1 ] ); if ( deluxemode != 1 ) { Sys_Printf( "Generating modelspace deluxemaps\n" ); @@ -2338,18 +2338,18 @@ int LightMain( int argc, char **argv ){ } i++; } - else if ( strEqual( argv[ i ], "-nodeluxe" ) || strEqual( argv[ i ], "-nodeluxemap" ) ) { + else if ( striEqual( argv[ i ], "-nodeluxe" ) || striEqual( argv[ i ], "-nodeluxemap" ) ) { deluxemap = false; Sys_Printf( "Disabling generating of deluxemaps for average light direction\n" ); } - else if ( strEqual( argv[ i ], "-external" ) ) { + else if ( striEqual( argv[ i ], "-external" ) ) { externalLightmaps = true; Sys_Printf( "Storing all lightmaps externally\n" ); } - else if ( strEqual( argv[ i ], "-lightmapsize" ) - || strEqual( argv[ i ], "-extlmhacksize" ) ) { - const bool extlmhack = strEqual( argv[ i ], "-extlmhacksize" ); + else if ( striEqual( argv[ i ], "-lightmapsize" ) + || striEqual( argv[ i ], "-extlmhacksize" ) ) { + const bool extlmhack = striEqual( argv[ i ], "-extlmhacksize" ); lmCustomSizeW = lmCustomSizeH = atoi( argv[ i + 1 ] ); if( i + 2 < argc - 1 && argv[ i + 2 ][0] != '-' && 0 != atoi( argv[ i + 2 ] ) ){ @@ -2374,14 +2374,14 @@ int LightMain( int argc, char **argv ){ } } - else if ( strEqual( argv[ i ], "-rawlightmapsizelimit" ) ) { + else if ( striEqual( argv[ i ], "-rawlightmapsizelimit" ) ) { lmLimitSize = atoi( argv[ i + 1 ] ); i++; Sys_Printf( "Raw lightmap size limit set to %d x %d pixels\n", lmLimitSize, lmLimitSize ); } - else if ( strEqual( argv[ i ], "-lightmapdir" ) ) { + else if ( striEqual( argv[ i ], "-lightmapdir" ) ) { lmCustomDir = argv[i + 1]; i++; Sys_Printf( "Lightmap directory set to %s\n", lmCustomDir ); @@ -2390,91 +2390,91 @@ int LightMain( int argc, char **argv ){ } /* ydnar: add this to suppress warnings */ - else if ( strEqual( argv[ i ], "-custinfoparms" ) ) { + else if ( striEqual( argv[ i ], "-custinfoparms" ) ) { Sys_Printf( "Custom info parms enabled\n" ); useCustomInfoParms = true; } - else if ( strEqual( argv[ i ], "-wolf" ) ) { + else if ( striEqual( argv[ i ], "-wolf" ) ) { /* -game should already be set */ wolfLight = true; Sys_Printf( "Enabling Wolf lighting model (linear default)\n" ); } - else if ( strEqual( argv[ i ], "-q3" ) ) { + else if ( striEqual( argv[ i ], "-q3" ) ) { /* -game should already be set */ wolfLight = false; Sys_Printf( "Enabling Quake 3 lighting model (nonlinear default)\n" ); } - else if ( strEqual( argv[ i ], "-extradist" ) ) { + else if ( striEqual( argv[ i ], "-extradist" ) ) { extraDist = std::max( 0.0, atof( argv[ i + 1 ] ) ); i++; Sys_Printf( "Default extra radius set to %f units\n", extraDist ); } - else if ( strEqual( argv[ i ], "-sunonly" ) ) { + else if ( striEqual( argv[ i ], "-sunonly" ) ) { sunOnly = true; Sys_Printf( "Only computing sunlight\n" ); } - else if ( strEqual( argv[ i ], "-bounceonly" ) ) { + else if ( striEqual( argv[ i ], "-bounceonly" ) ) { bounceOnly = true; Sys_Printf( "Storing bounced light (radiosity) only\n" ); } - else if ( strEqual( argv[ i ], "-nocollapse" ) ) { + else if ( striEqual( argv[ i ], "-nocollapse" ) ) { noCollapse = true; Sys_Printf( "Identical lightmap collapsing disabled\n" ); } - else if ( strEqual( argv[ i ], "-nolightmapsearch" ) ) { + else if ( striEqual( argv[ i ], "-nolightmapsearch" ) ) { lightmapSearchBlockSize = 1; Sys_Printf( "No lightmap searching - all lightmaps will be sequential\n" ); } - else if ( strEqual( argv[ i ], "-lightmapsearchpower" ) ) { + else if ( striEqual( argv[ i ], "-lightmapsearchpower" ) ) { lightmapMergeSize = ( game->lightmapSize << atoi( argv[i + 1] ) ); ++i; Sys_Printf( "Restricted lightmap searching enabled - optimize for lightmap merge power %d (size %d)\n", atoi( argv[i] ), lightmapMergeSize ); } - else if ( strEqual( argv[ i ], "-lightmapsearchblocksize" ) ) { + else if ( striEqual( argv[ i ], "-lightmapsearchblocksize" ) ) { lightmapSearchBlockSize = atoi( argv[i + 1] ); ++i; Sys_Printf( "Restricted lightmap searching enabled - block size set to %d\n", lightmapSearchBlockSize ); } - else if ( strEqual( argv[ i ], "-shade" ) ) { + else if ( striEqual( argv[ i ], "-shade" ) ) { shade = true; Sys_Printf( "Phong shading enabled\n" ); } - else if ( strEqual( argv[ i ], "-bouncegrid" ) ) { + else if ( striEqual( argv[ i ], "-bouncegrid" ) ) { bouncegrid = true; if ( bounce > 0 ) { Sys_Printf( "Grid lighting with radiosity enabled\n" ); } } - else if ( strEqual( argv[ i ], "-smooth" ) ) { + else if ( striEqual( argv[ i ], "-smooth" ) ) { lightSamples = EXTRA_SCALE; Sys_Printf( "The -smooth argument is deprecated, use \"-samples 2\" instead\n" ); } - else if ( strEqual( argv[ i ], "-nofastpoint" ) ) { + else if ( striEqual( argv[ i ], "-nofastpoint" ) ) { fastpoint = false; Sys_Printf( "Automatic fast mode for point lights disabled\n" ); } - else if ( strEqual( argv[ i ], "-fast" ) ) { + else if ( striEqual( argv[ i ], "-fast" ) ) { fast = true; fastgrid = true; fastbounce = true; Sys_Printf( "Fast mode enabled for all area lights\n" ); } - else if ( strEqual( argv[ i ], "-faster" ) ) { + else if ( striEqual( argv[ i ], "-faster" ) ) { faster = true; fast = true; fastgrid = true; @@ -2482,124 +2482,124 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Faster mode enabled\n" ); } -// else if ( strEqual( argv[ i ], "-fastallocate" ) ) { +// else if ( striEqual( argv[ i ], "-fastallocate" ) ) { // fastAllocate = true; // Sys_Printf( "Fast allocation mode enabled\n" ); // } - else if ( strEqual( argv[ i ], "-slowallocate" ) ) { + else if ( striEqual( argv[ i ], "-slowallocate" ) ) { fastAllocate = false; Sys_Printf( "Slow allocation mode enabled\n" ); } - else if ( strEqual( argv[ i ], "-fastgrid" ) ) { + else if ( striEqual( argv[ i ], "-fastgrid" ) ) { fastgrid = true; Sys_Printf( "Fast grid lighting enabled\n" ); } - else if ( strEqual( argv[ i ], "-fastbounce" ) ) { + else if ( striEqual( argv[ i ], "-fastbounce" ) ) { fastbounce = true; Sys_Printf( "Fast bounce mode enabled\n" ); } - else if ( strEqual( argv[ i ], "-cheap" ) ) { + else if ( striEqual( argv[ i ], "-cheap" ) ) { cheap = true; cheapgrid = true; Sys_Printf( "Cheap mode enabled\n" ); } - else if ( strEqual( argv[ i ], "-cheapgrid" ) ) { + else if ( striEqual( argv[ i ], "-cheapgrid" ) ) { cheapgrid = true; Sys_Printf( "Cheap grid mode enabled\n" ); } - else if ( strEqual( argv[ i ], "-normalmap" ) ) { + else if ( striEqual( argv[ i ], "-normalmap" ) ) { normalmap = true; Sys_Printf( "Storing normal map instead of lightmap\n" ); } - else if ( strEqual( argv[ i ], "-trisoup" ) ) { + else if ( striEqual( argv[ i ], "-trisoup" ) ) { trisoup = true; Sys_Printf( "Converting brush faces to triangle soup\n" ); } - else if ( strEqual( argv[ i ], "-debug" ) ) { + else if ( striEqual( argv[ i ], "-debug" ) ) { debug = true; Sys_Printf( "Lightmap debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugsurfaces" ) || strEqual( argv[ i ], "-debugsurface" ) ) { + else if ( striEqual( argv[ i ], "-debugsurfaces" ) || striEqual( argv[ i ], "-debugsurface" ) ) { debugSurfaces = true; Sys_Printf( "Lightmap surface debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugunused" ) ) { + else if ( striEqual( argv[ i ], "-debugunused" ) ) { debugUnused = true; Sys_Printf( "Unused luxel debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugaxis" ) ) { + else if ( striEqual( argv[ i ], "-debugaxis" ) ) { debugAxis = true; Sys_Printf( "Lightmap axis debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugcluster" ) ) { + else if ( striEqual( argv[ i ], "-debugcluster" ) ) { debugCluster = true; Sys_Printf( "Luxel cluster debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugorigin" ) ) { + else if ( striEqual( argv[ i ], "-debugorigin" ) ) { debugOrigin = true; Sys_Printf( "Luxel origin debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugdeluxe" ) ) { + else if ( striEqual( argv[ i ], "-debugdeluxe" ) ) { deluxemap = true; debugDeluxemap = true; Sys_Printf( "Deluxemap debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-export" ) ) { + else if ( striEqual( argv[ i ], "-export" ) ) { exportLightmaps = true; Sys_Printf( "Exporting lightmaps\n" ); } - else if ( strEqual( argv[ i ], "-notrace" ) ) { + else if ( striEqual( argv[ i ], "-notrace" ) ) { noTrace = true; Sys_Printf( "Shadow occlusion disabled\n" ); } - else if ( strEqual( argv[ i ], "-patchshadows" ) ) { + else if ( striEqual( argv[ i ], "-patchshadows" ) ) { patchShadows = true; Sys_Printf( "Patch shadow casting enabled\n" ); } - else if ( strEqual( argv[ i ], "-extra" ) ) { + else if ( striEqual( argv[ i ], "-extra" ) ) { superSample = EXTRA_SCALE; /* ydnar */ Sys_Printf( "The -extra argument is deprecated, use \"-super 2\" instead\n" ); } - else if ( strEqual( argv[ i ], "-extrawide" ) ) { + else if ( striEqual( argv[ i ], "-extrawide" ) ) { superSample = EXTRAWIDE_SCALE; /* ydnar */ filter = true; /* ydnar */ Sys_Printf( "The -extrawide argument is deprecated, use \"-filter [-super 2]\" instead\n" ); } - else if ( strEqual( argv[ i ], "-samplesize" ) ) { + else if ( striEqual( argv[ i ], "-samplesize" ) ) { sampleSize = std::max( 1, atoi( argv[ i + 1 ] ) ); i++; Sys_Printf( "Default lightmap sample size set to %dx%d units\n", sampleSize, sampleSize ); } - else if ( strEqual( argv[ i ], "-minsamplesize" ) ) { + else if ( striEqual( argv[ i ], "-minsamplesize" ) ) { minSampleSize = std::max( 1, atoi( argv[ i + 1 ] ) ); i++; Sys_Printf( "Minimum lightmap sample size set to %dx%d units\n", minSampleSize, minSampleSize ); } - else if ( strEqual( argv[ i ], "-samplescale" ) ) { + else if ( striEqual( argv[ i ], "-samplescale" ) ) { sampleScale = atoi( argv[ i + 1 ] ); i++; Sys_Printf( "Lightmaps sample scale set to %d\n", sampleScale ); } - else if ( strEqual( argv[ i ], "-debugsamplesize" ) ) { + else if ( striEqual( argv[ i ], "-debugsamplesize" ) ) { debugSampleSize = 1; Sys_Printf( "debugging Lightmaps SampleSize\n" ); } - else if ( strEqual( argv[ i ], "-novertex" ) ) { + else if ( striEqual( argv[ i ], "-novertex" ) ) { noVertexLighting = 1; f = atof( argv[ i + 1 ] ); if ( f != 0 && f < 1 ) { @@ -2611,27 +2611,27 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Disabling vertex lighting\n" ); } } - else if ( strEqual( argv[ i ], "-nogrid" ) ) { + else if ( striEqual( argv[ i ], "-nogrid" ) ) { noGridLighting = true; Sys_Printf( "Disabling grid lighting\n" ); } - else if ( strEqual( argv[ i ], "-border" ) ) { + else if ( striEqual( argv[ i ], "-border" ) ) { lightmapBorder = true; Sys_Printf( "Adding debug border to lightmaps\n" ); } - else if ( strEqual( argv[ i ], "-nosurf" ) ) { + else if ( striEqual( argv[ i ], "-nosurf" ) ) { noSurfaces = true; Sys_Printf( "Not tracing against surfaces\n" ); } - else if ( strEqual( argv[ i ], "-dump" ) ) { + else if ( striEqual( argv[ i ], "-dump" ) ) { dump = true; Sys_Printf( "Dumping radiosity lights into numbered prefabs\n" ); } - else if ( strEqual( argv[ i ], "-lomem" ) ) { + else if ( striEqual( argv[ i ], "-lomem" ) ) { loMem = true; Sys_Printf( "Enabling low-memory (potentially slower) lighting mode\n" ); } - else if ( strEqual( argv[ i ], "-lightanglehl" ) ) { + else if ( striEqual( argv[ i ], "-lightanglehl" ) ) { if ( ( atoi( argv[ i + 1 ] ) != 0 ) != lightAngleHL ) { lightAngleHL = ( atoi( argv[ i + 1 ] ) != 0 ); if ( lightAngleHL ) { @@ -2643,41 +2643,41 @@ int LightMain( int argc, char **argv ){ i++; } } - else if ( strEqual( argv[ i ], "-nostyle" ) || strEqual( argv[ i ], "-nostyles" ) ) { + else if ( striEqual( argv[ i ], "-nostyle" ) || striEqual( argv[ i ], "-nostyles" ) ) { noStyles = true; Sys_Printf( "Disabling lightstyles\n" ); } - else if ( strEqual( argv[ i ], "-style" ) || strEqual( argv[ i ], "-styles" ) ) { + else if ( striEqual( argv[ i ], "-style" ) || striEqual( argv[ i ], "-styles" ) ) { noStyles = false; Sys_Printf( "Enabling lightstyles\n" ); } - else if ( strEqual( argv[ i ], "-cpma" ) ) { + else if ( striEqual( argv[ i ], "-cpma" ) ) { cpmaHack = true; Sys_Printf( "Enabling Challenge Pro Mode Asstacular Vertex Lighting Mode (tm)\n" ); } - else if ( strEqual( argv[ i ], "-floodlight" ) ) { + else if ( striEqual( argv[ i ], "-floodlight" ) ) { floodlighty = true; Sys_Printf( "FloodLighting enabled\n" ); } - else if ( strEqual( argv[ i ], "-debugnormals" ) ) { + else if ( striEqual( argv[ i ], "-debugnormals" ) ) { debugnormals = true; Sys_Printf( "DebugNormals enabled\n" ); } - else if ( strEqual( argv[ i ], "-lowquality" ) ) { + else if ( striEqual( argv[ i ], "-lowquality" ) ) { floodlight_lowquality = true; Sys_Printf( "Low Quality FloodLighting enabled\n" ); } /* r7: dirtmapping */ - else if ( strEqual( argv[ i ], "-dirty" ) ) { + else if ( striEqual( argv[ i ], "-dirty" ) ) { dirty = true; Sys_Printf( "Dirtmapping enabled\n" ); } - else if ( strEqual( argv[ i ], "-dirtdebug" ) || strEqual( argv[ i ], "-debugdirt" ) ) { + else if ( striEqual( argv[ i ], "-dirtdebug" ) || striEqual( argv[ i ], "-debugdirt" ) ) { dirtDebug = true; Sys_Printf( "Dirtmap debugging enabled\n" ); } - else if ( strEqual( argv[ i ], "-dirtmode" ) ) { + else if ( striEqual( argv[ i ], "-dirtmode" ) ) { dirtMode = atoi( argv[ i + 1 ] ); if ( dirtMode != 0 && dirtMode != 1 ) { dirtMode = 0; @@ -2690,7 +2690,7 @@ int LightMain( int argc, char **argv ){ } i++; } - else if ( strEqual( argv[ i ], "-dirtdepth" ) ) { + else if ( striEqual( argv[ i ], "-dirtdepth" ) ) { dirtDepth = atof( argv[ i + 1 ] ); if ( dirtDepth <= 0.0f ) { dirtDepth = 128.0f; @@ -2698,7 +2698,7 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Dirtmapping depth set to %.1f\n", dirtDepth ); i++; } - else if ( strEqual( argv[ i ], "-dirtscale" ) ) { + else if ( striEqual( argv[ i ], "-dirtscale" ) ) { dirtScale = atof( argv[ i + 1 ] ); if ( dirtScale <= 0.0f ) { dirtScale = 1.0f; @@ -2706,7 +2706,7 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Dirtmapping scale set to %.1f\n", dirtScale ); i++; } - else if ( strEqual( argv[ i ], "-dirtgain" ) ) { + else if ( striEqual( argv[ i ], "-dirtgain" ) ) { dirtGain = atof( argv[ i + 1 ] ); if ( dirtGain <= 0.0f ) { dirtGain = 1.0f; @@ -2714,17 +2714,17 @@ int LightMain( int argc, char **argv ){ Sys_Printf( "Dirtmapping gain set to %.1f\n", dirtGain ); i++; } - else if ( strEqual( argv[ i ], "-trianglecheck" ) ) { + else if ( striEqual( argv[ i ], "-trianglecheck" ) ) { lightmapTriangleCheck = true; } - else if ( strEqual( argv[ i ], "-extravisnudge" ) ) { + else if ( striEqual( argv[ i ], "-extravisnudge" ) ) { lightmapExtraVisClusterNudge = true; } - else if ( strEqual( argv[ i ], "-fill" ) ) { + else if ( striEqual( argv[ i ], "-fill" ) ) { lightmapFill = true; Sys_Printf( "Filling lightmap colors from surrounding pixels to improve JPEG compression\n" ); } - else if ( strEqual( argv[ i ], "-fillpink" ) ) { + else if ( striEqual( argv[ i ], "-fillpink" ) ) { lightmapPink = true; } /* unhandled args */ diff --git a/tools/quake3/q3map2/main.cpp b/tools/quake3/q3map2/main.cpp index 22d1bea5..d65b6086 100644 --- a/tools/quake3/q3map2/main.cpp +++ b/tools/quake3/q3map2/main.cpp @@ -82,14 +82,14 @@ int main( int argc, char **argv ){ for ( i = 1; i < argc; i++ ) { /* -help */ - if ( strEqual( argv[ i ], "-h" ) || strEqual( argv[ i ], "--help" ) - || strEqual( argv[ i ], "-help" ) ) { + if ( striEqual( argv[ i ], "-h" ) || striEqual( argv[ i ], "--help" ) + || striEqual( argv[ i ], "-help" ) ) { HelpMain( ( i + 1 < argc ) ? argv[ i + 1 ] : NULL ); return 0; } /* -connect */ - if ( strEqual( argv[ i ], "-connect" ) ) { + if ( striEqual( argv[ i ], "-connect" ) ) { if ( ++i >= argc || !argv[ i ] ) { Error( "Out of arguments: No address specified after %s", argv[ i - 1 ] ); } @@ -99,7 +99,7 @@ int main( int argc, char **argv ){ } /* verbose */ - else if ( strEqual( argv[ i ], "-v" ) ) { + else if ( striEqual( argv[ i ], "-v" ) ) { if ( !verbose ) { verbose = true; argv[ i ] = NULL; @@ -107,13 +107,13 @@ int main( int argc, char **argv ){ } /* force */ - else if ( strEqual( argv[ i ], "-force" ) ) { + else if ( striEqual( argv[ i ], "-force" ) ) { force = true; argv[ i ] = NULL; } /* patch subdivisions */ - else if ( strEqual( argv[ i ], "-subdivisions" ) ) { + else if ( striEqual( argv[ i ], "-subdivisions" ) ) { if ( ++i >= argc || !argv[ i ] ) { Error( "Out of arguments: No value specified after %s", argv[ i - 1 ] ); } @@ -126,7 +126,7 @@ int main( int argc, char **argv ){ } /* threads */ - else if ( strEqual( argv[ i ], "-threads" ) ) { + else if ( striEqual( argv[ i ], "-threads" ) ) { if ( ++i >= argc || !argv[ i ] ) { Error( "Out of arguments: No value specified after %s", argv[ i - 1 ] ); } @@ -135,7 +135,7 @@ int main( int argc, char **argv ){ argv[ i ] = NULL; } - else if( strEqual( argv[ i ], "-nocmdline" ) ) + else if( striEqual( argv[ i ], "-nocmdline" ) ) { Sys_Printf( "noCmdLine\n" ); nocmdline = true; @@ -187,79 +187,79 @@ int main( int argc, char **argv ){ } /* fixaas */ - if ( strEqual( argv[ 1 ], "-fixaas" ) ) { + if ( striEqual( argv[ 1 ], "-fixaas" ) ) { r = FixAAS( argc - 1, argv + 1 ); } /* analyze */ - else if ( strEqual( argv[ 1 ], "-analyze" ) ) { + else if ( striEqual( argv[ 1 ], "-analyze" ) ) { r = AnalyzeBSP( argc - 1, argv + 1 ); } /* info */ - else if ( strEqual( argv[ 1 ], "-info" ) ) { + else if ( striEqual( argv[ 1 ], "-info" ) ) { r = BSPInfo( argc - 2, argv + 2 ); } /* vis */ - else if ( strEqual( argv[ 1 ], "-vis" ) ) { + else if ( striEqual( argv[ 1 ], "-vis" ) ) { r = VisMain( argc - 1, argv + 1 ); } /* light */ - else if ( strEqual( argv[ 1 ], "-light" ) ) { + else if ( striEqual( argv[ 1 ], "-light" ) ) { r = LightMain( argc - 1, argv + 1 ); } /* vlight */ - else if ( strEqual( argv[ 1 ], "-vlight" ) ) { + else if ( striEqual( argv[ 1 ], "-vlight" ) ) { Sys_Warning( "VLight is no longer supported, defaulting to -light -fast instead\n\n" ); argv[ 1 ] = "-fast"; /* eek a hack */ r = LightMain( argc, argv ); } /* QBall: export entities */ - else if ( strEqual( argv[ 1 ], "-exportents" ) ) { + else if ( striEqual( argv[ 1 ], "-exportents" ) ) { r = ExportEntitiesMain( argc - 1, argv + 1 ); } /* ydnar: lightmap export */ - else if ( strEqual( argv[ 1 ], "-export" ) ) { + else if ( striEqual( argv[ 1 ], "-export" ) ) { r = ExportLightmapsMain( argc - 1, argv + 1 ); } /* ydnar: lightmap import */ - else if ( strEqual( argv[ 1 ], "-import" ) ) { + else if ( striEqual( argv[ 1 ], "-import" ) ) { r = ImportLightmapsMain( argc - 1, argv + 1 ); } /* ydnar: bsp scaling */ - else if ( strEqual( argv[ 1 ], "-scale" ) ) { + else if ( striEqual( argv[ 1 ], "-scale" ) ) { r = ScaleBSPMain( argc - 1, argv + 1 ); } /* bsp shifting */ - else if ( strEqual( argv[ 1 ], "-shift" ) ) { + else if ( striEqual( argv[ 1 ], "-shift" ) ) { r = ShiftBSPMain( argc - 1, argv + 1 ); } /* autopacking */ - else if ( strEqual( argv[ 1 ], "-pk3" ) ) { + else if ( striEqual( argv[ 1 ], "-pk3" ) ) { r = pk3BSPMain( argc - 1, argv + 1 ); } /* repacker */ - else if ( strEqual( argv[ 1 ], "-repack" ) ) { + else if ( striEqual( argv[ 1 ], "-repack" ) ) { r = repackBSPMain( argc - 1, argv + 1 ); } /* ydnar: bsp conversion */ - else if ( strEqual( argv[ 1 ], "-convert" ) ) { + else if ( striEqual( argv[ 1 ], "-convert" ) ) { r = ConvertBSPMain( argc - 1, argv + 1 ); } /* div0: minimap */ - else if ( strEqual( argv[ 1 ], "-minimap" ) ) { + else if ( striEqual( argv[ 1 ], "-minimap" ) ) { r = MiniMapBSPMain( argc - 1, argv + 1 ); } diff --git a/tools/quake3/q3map2/minimap.cpp b/tools/quake3/q3map2/minimap.cpp index dcc94995..b14b75d6 100644 --- a/tools/quake3/q3map2/minimap.cpp +++ b/tools/quake3/q3map2/minimap.cpp @@ -499,17 +499,17 @@ int MiniMapBSPMain( int argc, char **argv ){ /* process arguments */ for ( i = 1; i < ( argc - 1 ); i++ ) { - if ( strEqual( argv[ i ], "-size" ) ) { + if ( striEqual( argv[ i ], "-size" ) ) { minimap.width = minimap.height = atoi( argv[i + 1] ); i++; Sys_Printf( "Image size set to %i\n", minimap.width ); } - else if ( strEqual( argv[ i ], "-sharpen" ) ) { + else if ( striEqual( argv[ i ], "-sharpen" ) ) { minimapSharpen = atof( argv[i + 1] ); i++; Sys_Printf( "Sharpening coefficient set to %f\n", minimapSharpen ); } - else if ( strEqual( argv[ i ], "-samples" ) ) { + else if ( striEqual( argv[ i ], "-samples" ) ) { minimap.samples = atoi( argv[i + 1] ); i++; Sys_Printf( "Samples set to %i\n", minimap.samples ); @@ -517,32 +517,32 @@ int MiniMapBSPMain( int argc, char **argv ){ minimap.sample_offsets = safe_malloc( 2 * sizeof( *minimap.sample_offsets ) * minimap.samples ); MiniMapMakeSampleOffsets(); } - else if ( strEqual( argv[ i ], "-random" ) ) { + else if ( striEqual( argv[ i ], "-random" ) ) { minimap.samples = atoi( argv[i + 1] ); i++; Sys_Printf( "Random samples set to %i\n", minimap.samples ); free( minimap.sample_offsets ); minimap.sample_offsets = NULL; } - else if ( strEqual( argv[ i ], "-border" ) ) { + else if ( striEqual( argv[ i ], "-border" ) ) { border = atof( argv[i + 1] ); i++; Sys_Printf( "Border set to %f\n", border ); } - else if ( strEqual( argv[ i ], "-keepaspect" ) ) { + else if ( striEqual( argv[ i ], "-keepaspect" ) ) { keepaspect = true; Sys_Printf( "Keeping aspect ratio by letterboxing\n", border ); } - else if ( strEqual( argv[ i ], "-nokeepaspect" ) ) { + else if ( striEqual( argv[ i ], "-nokeepaspect" ) ) { keepaspect = false; Sys_Printf( "Not keeping aspect ratio\n", border ); } - else if ( strEqual( argv[ i ], "-o" ) ) { + else if ( striEqual( argv[ i ], "-o" ) ) { strcpy( minimapFilename, argv[i + 1] ); i++; Sys_Printf( "Output file name set to %s\n", minimapFilename ); } - else if ( strEqual( argv[ i ], "-minmax" ) && i < ( argc - 7 ) ) { + else if ( striEqual( argv[ i ], "-minmax" ) && i < ( argc - 7 ) ) { mins[0] = atof( argv[i + 1] ); mins[1] = atof( argv[i + 2] ); mins[2] = atof( argv[i + 3] ); @@ -552,38 +552,38 @@ int MiniMapBSPMain( int argc, char **argv ){ i += 6; Sys_Printf( "Map mins/maxs overridden\n" ); } - else if ( strEqual( argv[ i ], "-gray" ) ) { + else if ( striEqual( argv[ i ], "-gray" ) ) { mode = EMiniMapMode::Gray; Sys_Printf( "Writing as white-on-black image\n" ); } - else if ( strEqual( argv[ i ], "-black" ) ) { + else if ( striEqual( argv[ i ], "-black" ) ) { mode = EMiniMapMode::Black; Sys_Printf( "Writing as black alpha image\n" ); } - else if ( strEqual( argv[ i ], "-white" ) ) { + else if ( striEqual( argv[ i ], "-white" ) ) { mode = EMiniMapMode::White; Sys_Printf( "Writing as white alpha image\n" ); } - else if ( strEqual( argv[ i ], "-boost" ) && i < ( argc - 2 ) ) { + else if ( striEqual( argv[ i ], "-boost" ) && i < ( argc - 2 ) ) { minimap.boost = atof( argv[i + 1] ); i++; Sys_Printf( "Contrast boost set to %f\n", minimap.boost ); } - else if ( strEqual( argv[ i ], "-brightness" ) && i < ( argc - 2 ) ) { + else if ( striEqual( argv[ i ], "-brightness" ) && i < ( argc - 2 ) ) { minimap.brightness = atof( argv[i + 1] ); i++; Sys_Printf( "Brightness set to %f\n", minimap.brightness ); } - else if ( strEqual( argv[ i ], "-contrast" ) && i < ( argc - 2 ) ) { + else if ( striEqual( argv[ i ], "-contrast" ) && i < ( argc - 2 ) ) { minimap.contrast = atof( argv[i + 1] ); i++; Sys_Printf( "Contrast set to %f\n", minimap.contrast ); } - else if ( strEqual( argv[ i ], "-autolevel" ) ) { + else if ( striEqual( argv[ i ], "-autolevel" ) ) { autolevel = true; Sys_Printf( "Auto level enabled\n", border ); } - else if ( strEqual( argv[ i ], "-noautolevel" ) ) { + else if ( striEqual( argv[ i ], "-noautolevel" ) ) { autolevel = false; Sys_Printf( "Auto level disabled\n", border ); } diff --git a/tools/quake3/q3map2/path_init.cpp b/tools/quake3/q3map2/path_init.cpp index fc4d06bc..cfb48fac 100644 --- a/tools/quake3/q3map2/path_init.cpp +++ b/tools/quake3/q3map2/path_init.cpp @@ -387,7 +387,7 @@ void InitPaths( int *argc, char **argv ){ } /* -game */ - if ( strEqual( argv[ i ], "-game" ) ) { + if ( striEqual( argv[ i ], "-game" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No game specified after %s", argv[ i - 1 ] ); } @@ -400,7 +400,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_forbiddenpath */ - else if ( strEqual( argv[ i ], "-fs_forbiddenpath" ) ) { + else if ( striEqual( argv[ i ], "-fs_forbiddenpath" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } @@ -414,7 +414,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_basepath */ - else if ( strEqual( argv[ i ], "-fs_basepath" ) ) { + else if ( striEqual( argv[ i ], "-fs_basepath" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } @@ -424,7 +424,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_game */ - else if ( strEqual( argv[ i ], "-fs_game" ) ) { + else if ( striEqual( argv[ i ], "-fs_game" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } @@ -434,7 +434,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_home */ - else if ( strEqual( argv[ i ], "-fs_home" ) ) { + else if ( striEqual( argv[ i ], "-fs_home" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } @@ -444,7 +444,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_homebase */ - else if ( strEqual( argv[ i ], "-fs_homebase" ) ) { + else if ( striEqual( argv[ i ], "-fs_homebase" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } @@ -454,7 +454,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_homepath - sets both of them */ - else if ( strEqual( argv[ i ], "-fs_homepath" ) ) { + else if ( striEqual( argv[ i ], "-fs_homepath" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } @@ -465,7 +465,7 @@ void InitPaths( int *argc, char **argv ){ } /* -fs_pakpath */ - else if ( strEqual( argv[ i ], "-fs_pakpath" ) ) { + else if ( striEqual( argv[ i ], "-fs_pakpath" ) ) { if ( ++i >= *argc || !argv[ i ] ) { Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); } diff --git a/tools/quake3/q3map2/vis.cpp b/tools/quake3/q3map2/vis.cpp index da1e5166..5ecd81ea 100644 --- a/tools/quake3/q3map2/vis.cpp +++ b/tools/quake3/q3map2/vis.cpp @@ -1056,40 +1056,40 @@ int VisMain( int argc, char **argv ){ /* process arguments */ for ( i = 1 ; i < ( argc - 1 ) ; i++ ) { - if ( strEqual( argv[i], "-fast" ) ) { + if ( striEqual( argv[i], "-fast" ) ) { Sys_Printf( "fastvis = true\n" ); fastvis = true; } - else if ( strEqual( argv[i], "-merge" ) ) { + else if ( striEqual( argv[i], "-merge" ) ) { Sys_Printf( "merge = true\n" ); mergevis = true; } - else if ( strEqual( argv[i], "-mergeportals" ) ) { + else if ( striEqual( argv[i], "-mergeportals" ) ) { Sys_Printf( "mergeportals = true\n" ); mergevisportals = true; } - else if ( strEqual( argv[i], "-nopassage" ) ) { + else if ( striEqual( argv[i], "-nopassage" ) ) { Sys_Printf( "nopassage = true\n" ); noPassageVis = true; } - else if ( strEqual( argv[i], "-passageOnly" ) ) { + else if ( striEqual( argv[i], "-passageOnly" ) ) { Sys_Printf( "passageOnly = true\n" ); passageVisOnly = true; } - else if ( strEqual( argv[i], "-nosort" ) ) { + else if ( striEqual( argv[i], "-nosort" ) ) { Sys_Printf( "nosort = true\n" ); nosort = true; } - else if ( strEqual( argv[i], "-saveprt" ) ) { + else if ( striEqual( argv[i], "-saveprt" ) ) { Sys_Printf( "saveprt = true\n" ); saveprt = true; } - else if ( strEqual( argv[ i ], "-v" ) ) { + else if ( striEqual( argv[ i ], "-v" ) ) { debugCluster = true; Sys_Printf( "Extra verbose mode enabled\n" ); } /* ydnar: -hint to merge all but hint portals */ - else if ( strEqual( argv[ i ], "-hint" ) ) { + else if ( striEqual( argv[ i ], "-hint" ) ) { Sys_Printf( "hint = true\n" ); hint = true; mergevis = true;