diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/initmathlib.cpp | |
| download | archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip | |
Diffstat (limited to 'engine/initmathlib.cpp')
| -rw-r--r-- | engine/initmathlib.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/engine/initmathlib.cpp b/engine/initmathlib.cpp new file mode 100644 index 0000000..9628305 --- /dev/null +++ b/engine/initmathlib.cpp @@ -0,0 +1,67 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + + +#include "mathlib/mathlib.h" +#include "convar.h" // ConVar define +#include "view.h" +#include "gl_cvars.h" // mat_overbright +#include "cmd.h" // Cmd_* +#include "console.h" // ConMsg + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +static bool s_bAllow3DNow = true; +static bool s_bAllowSSE2 = true; + +void InitMathlib( void ) +{ + MathLib_Init( 2.2f, // v_gamma.GetFloat() + 2.2f, // v_texgamma.GetFloat() + 0.0f /*v_brightness.GetFloat() */, + 2.0f /*mat_overbright.GetInt() */, s_bAllow3DNow, true, s_bAllowSSE2, true ); +} + +/* +=============== +R_SSE2 +=============== +*/ +CON_COMMAND( r_sse2, "Enable/disable SSE2 code" ) +{ + if (args.ArgC() == 1) + { + s_bAllowSSE2 = true; + } + else + { + s_bAllowSSE2 = atoi( args[1] ) ? true : false; + } + + InitMathlib(); + ConMsg( "SSE2 code is %s\n", MathLib_SSE2Enabled() ? "enabled" : "disabled" ); +} + +/* +=============== +R_3DNow +=============== +*/ +CON_COMMAND( r_3dnow, "Enable/disable 3DNow code" ) +{ + if (args.ArgC() == 1) + { + s_bAllow3DNow = true; + } + else + { + s_bAllow3DNow = atoi( args[1] ) ? true : false; + } + + InitMathlib(); + ConMsg( "3DNow code is %s\n", MathLib_3DNowEnabled() ? "enabled" : "disabled" ); +}
\ No newline at end of file |