Skip to content

Commit

Permalink
Add -pre25 for override light limit threshold
Browse files Browse the repository at this point in the history
Pre25 parameter sets the limiter to 188
  • Loading branch information
seedee committed Jul 8, 2024
1 parent 1ef7995 commit 5a4e83d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/sdhlt/sdHLRAD/qrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* every surface must be divided into at least two g_patches each axis
*/

bool g_pre25update = DEFAULT_PRE25UPDATE;
bool g_fastmode = DEFAULT_FASTMODE;
typedef enum
{
Expand Down Expand Up @@ -2695,6 +2696,7 @@ static void Usage()
Banner();

Log("\n-= %s Options =-\n\n", g_Program);
Log(" -pre25 : Optimize compile for pre-Half-Life 25th anniversary update.\n");
Log(" -console # : Set to 0 to turn off the pop-up console (default is 1)\n");
Log(" -lang file : localization file\n");
Log(" -waddir folder : Search this folder for wad files.\n");
Expand Down Expand Up @@ -2817,6 +2819,7 @@ static void Settings()
Log("threads [ %17d ] [ %17d ]\n", g_numthreads, DEFAULT_NUMTHREADS);
}

Log("pre-25th anniversary [ %17s ] [ %17s ]\n", g_pre25update ? "on" : "off", DEFAULT_PRE25UPDATE ? "on" : "off");
Log("verbose [ %17s ] [ %17s ]\n", g_verbose ? "on" : "off", DEFAULT_VERBOSE ? "on" : "off");
Log("log [ %17s ] [ %17s ]\n", g_log ? "on" : "off", DEFAULT_LOG ? "on" : "off");
Log("developer [ %17d ] [ %17d ]\n", g_developer, DEFAULT_DEVELOPER);
Expand Down Expand Up @@ -3393,7 +3396,7 @@ int main(const int argc, char** argv)
}
else if (!strcasecmp(argv[i], "-limiter"))
{
if (i + 1 < argc) //added "1" .--vluzacn
if (i + 1 < argc) //"1" was added to check if there is another argument afterwards (expected value) //seedee
{
g_limitthreshold = atof(argv[++i]);
}
Expand Down Expand Up @@ -3873,7 +3876,11 @@ int main(const int argc, char** argv)
Usage();
}
}

else if (!strcasecmp(argv[i], "-pre25")) //Pre25 should be after everything else to override
{
g_pre25update = true;
g_limitthreshold = 188.0;
}
else if (argv[i][0] == '-')
{
Log("Unknown option \"%s\"\n", argv[i]);
Expand Down
5 changes: 3 additions & 2 deletions src/sdhlt/sdHLRAD/qrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <direct.h>
#endif

#define DEFAULT_PRE25UPDATE false
#define DEFAULT_FASTMODE false
#define DEFAULT_METHOD eMethodSparseVismatrix
#define DEFAULT_LERP_ENABLED true
Expand All @@ -52,9 +53,9 @@
#define DEFAULT_AMBIENT_RED 0.0
#define DEFAULT_AMBIENT_GREEN 0.0
#define DEFAULT_AMBIENT_BLUE 0.0
// 188 is the fullbright threshold for pre-Anniversary update Goldsrc, regardless of the brightness and gamma settings in the graphic options.
// 188 is the fullbright threshold for Goldsrc before 25th anniversary, regardless of the brightness and gamma settings in the graphic options. This is no longer necessary
// However, hlrad can only control the light values of each single light style. So the final in-game brightness may exceed 188 if you have set a high value in the "custom appearance" of the light, or if the face receives light from different styles.
#define DEFAULT_LIMITTHRESHOLD 255.0
#define DEFAULT_LIMITTHRESHOLD 255.0 // We override to 188 with pre25 argument. //seedee
#define DEFAULT_TEXSCALE true
#define DEFAULT_CHOP 64.0
#define DEFAULT_TEXCHOP 32.0
Expand Down

0 comments on commit 5a4e83d

Please sign in to comment.