diff --git a/src/am_map.cpp b/src/am_map.cpp index 029103274b..72710bdde9 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -196,7 +196,7 @@ CUSTOM_CVAR(Int, am_emptyspacemargin, 0, CVAR_ARCHIVE) CVAR(Bool, am_followplayer, true, CVAR_ARCHIVE) CVAR(Bool, am_portaloverlay, true, CVAR_ARCHIVE) CVAR(Bool, am_showgrid, false, CVAR_ARCHIVE) -CVAR(Float, am_zoomdir, 0, CVAR_ARCHIVE) +CVAR(Float, am_zoomdir, 0.f, CVAR_ARCHIVE) static const char *const DEFAULT_FONT_NAME = "AMMNUMx"; CVAR(String, am_markfont, DEFAULT_FONT_NAME, CVAR_ARCHIVE) diff --git a/src/common/audio/music/music_config.cpp b/src/common/audio/music/music_config.cpp index ee85706110..efdb056374 100644 --- a/src/common/audio/music/music_config.cpp +++ b/src/common/audio/music/music_config.cpp @@ -75,12 +75,12 @@ CUSTOM_CVAR(Int, adl_emulator_id, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIR FORWARD_CVAR(adl_emulator_id); } -CUSTOM_CVAR(Bool, adl_run_at_pcm_rate, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Bool, adl_run_at_pcm_rate, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_BOOL_CVAR(adl_run_at_pcm_rate); } -CUSTOM_CVAR(Bool, adl_fullpan, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Bool, adl_fullpan, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_BOOL_CVAR(adl_fullpan); } @@ -90,7 +90,7 @@ CUSTOM_CVAR(Int, adl_bank, 14, CVAR_ARCHIVE | CVAR_VIRTUAL) FORWARD_CVAR(adl_bank); } -CUSTOM_CVAR(Bool, adl_use_custom_bank, 0, CVAR_ARCHIVE | CVAR_VIRTUAL) +CUSTOM_CVAR(Bool, adl_use_custom_bank, false, CVAR_ARCHIVE | CVAR_VIRTUAL) { FORWARD_BOOL_CVAR(adl_use_custom_bank); } @@ -201,7 +201,7 @@ CUSTOM_CVAR(Float, fluid_chorus_speed, 0.3f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | } // depth is in ms and actual maximum depends on the sample rate -CUSTOM_CVAR(Float, fluid_chorus_depth, 8, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Float, fluid_chorus_depth, 8.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_CVAR(fluid_chorus_depth); } @@ -251,17 +251,17 @@ CUSTOM_CVAR(Int, opn_emulator_id, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIR FORWARD_CVAR(opn_emulator_id); } -CUSTOM_CVAR(Bool, opn_run_at_pcm_rate, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Bool, opn_run_at_pcm_rate, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_BOOL_CVAR(opn_run_at_pcm_rate); } -CUSTOM_CVAR(Bool, opn_fullpan, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Bool, opn_fullpan, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_BOOL_CVAR(opn_fullpan); } -CUSTOM_CVAR(Bool, opn_use_custom_bank, 0, CVAR_ARCHIVE | CVAR_VIRTUAL) +CUSTOM_CVAR(Bool, opn_use_custom_bank, false, CVAR_ARCHIVE | CVAR_VIRTUAL) { FORWARD_BOOL_CVAR(opn_use_custom_bank); } @@ -344,7 +344,7 @@ CUSTOM_CVAR(Bool, timidity_channel_pressure, false, CVAR_ARCHIVE | CVAR_GLOBALCO FORWARD_BOOL_CVAR(timidity_channel_pressure); } -CUSTOM_CVAR(Int, timidity_lpf_def, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Int, timidity_lpf_def, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_CVAR(timidity_lpf_def); } @@ -384,12 +384,12 @@ CUSTOM_CVAR(Int, timidity_key_adjust, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR FORWARD_CVAR(timidity_key_adjust); } -CUSTOM_CVAR(Float, timidity_tempo_adjust, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Float, timidity_tempo_adjust, 1.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_CVAR(timidity_tempo_adjust); } -CUSTOM_CVAR(Float, timidity_min_sustain_time, 5000, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) +CUSTOM_CVAR(Float, timidity_min_sustain_time, 5000.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIRTUAL) { FORWARD_CVAR(timidity_min_sustain_time); } diff --git a/src/common/console/c_cvars.h b/src/common/console/c_cvars.h index a4fe371d9d..d60771d2da 100644 --- a/src/common/console/c_cvars.h +++ b/src/common/console/c_cvars.h @@ -74,6 +74,19 @@ enum CVAR_CONFIG_ONLY = 1 << 18, // do not save var to savegame and do not send it across network. }; +enum ECVarType +{ + CVAR_Bool, + CVAR_Int, + CVAR_Float, + CVAR_String, + CVAR_Color, // stored as CVAR_Int + CVAR_Flag, // just redirects to another cvar + CVAR_Mask, // just redirects to another cvar + CVAR_Dummy, // Unknown +}; + + class FIntCVarRef; union UCVarValue { @@ -92,17 +105,12 @@ union UCVarValue constexpr UCVarValue(FIntCVarRef& v); }; -enum ECVarType -{ - CVAR_Bool, - CVAR_Int, - CVAR_Float, - CVAR_String, - CVAR_Color, // stored as CVAR_Int - CVAR_Flag, // just redirects to another cvar - CVAR_Mask, // just redirects to another cvar - CVAR_Dummy, // Unknown -}; +template constexpr UCVarValue CVarValue(bool v) { static_assert(t == CVAR_Bool); return v; } +template constexpr UCVarValue CVarValue(int v) { static_assert(t == CVAR_Int || t == CVAR_Color); return v; } +template constexpr UCVarValue CVarValue(float v) { static_assert(t == CVAR_Float); return v; } +template constexpr UCVarValue CVarValue(double v) { static_assert(t == CVAR_Float); return v; } +template constexpr UCVarValue CVarValue(const char* v) { static_assert(t == CVAR_String); return v; } +template constexpr UCVarValue CVarValue(FIntCVarRef& v) { static_assert(t == CVAR_Flag || t == CVAR_Mask); return v; } class FConfigFile; @@ -598,7 +606,7 @@ void C_ForgetCVars (void); #define CUSTOM_CVAR(type,name,def,flags) \ static void cvarfunc_##name(F##type##CVar &); \ F##type##CVarRef name; \ - static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, def, nullptr, reinterpret_cast(cvarfunc_##name) }; \ + static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, CVarValue(def), nullptr, reinterpret_cast(cvarfunc_##name) }; \ extern FCVarDecl const *const cvardeclref_##name; \ MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \ static void cvarfunc_##name(F##type##CVar &self) @@ -607,14 +615,14 @@ void C_ForgetCVars (void); #define CUSTOM_CVAR_NAMED(type,name,cname,def,flags) \ static void cvarfunc_##name(F##type##CVar &); \ F##type##CVarRef name; \ - static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #cname, def, nullptr, reinterpret_cast(cvarfunc_##name) }; \ + static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #cname, CVarValue(def), nullptr, reinterpret_cast(cvarfunc_##name) }; \ extern FCVarDecl const *const cvardeclref_##name; \ MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \ static void cvarfunc_##name(F##type##CVar &self) #define CVAR(type,name,def,flags) \ F##type##CVarRef name; \ - static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, def, nullptr, nullptr}; \ + static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, CVarValue(def), nullptr, nullptr}; \ extern FCVarDecl const *const cvardeclref_##name; \ MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; @@ -623,20 +631,20 @@ void C_ForgetCVars (void); #define CUSTOM_CVARD(type,name,def,flags,descr) \ static void cvarfunc_##name(F##type##CVar &); \ F##type##CVarRef name; \ - static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, def, descr, reinterpret_cast(cvarfunc_##name) }; \ + static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, CVarValue(def), descr, reinterpret_cast(cvarfunc_##name) }; \ extern FCVarDecl const *const cvardeclref_##name; \ MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \ static void cvarfunc_##name(F##type##CVar &self) #define CVARD(type,name,def,flags, descr) \ F##type##CVarRef name; \ - static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, def, descr, nullptr}; \ + static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, CVarValue(def), descr, nullptr}; \ extern FCVarDecl const *const cvardeclref_##name; \ MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; #define CVARD_NAMED(type,name,varname,def,flags, descr) \ F##type##CVarRef name; \ - static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #varname, def, descr, nullptr}; \ + static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #varname, CVarValue(def), descr, nullptr}; \ extern FCVarDecl const *const cvardeclref_##name; \ MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; diff --git a/src/common/engine/d_event.cpp b/src/common/engine/d_event.cpp index 6458500b10..b64aa63659 100644 --- a/src/common/engine/d_event.cpp +++ b/src/common/engine/d_event.cpp @@ -50,8 +50,8 @@ int eventhead; int eventtail; event_t events[MAXEVENTS]; -CVAR(Float, m_sensitivity_x, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -CVAR(Float, m_sensitivity_y, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Float, m_sensitivity_x, 4.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CVAR(Float, m_sensitivity_y, 2.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) //========================================================================== @@ -67,7 +67,7 @@ CVAR(Float, m_sensitivity_y, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) void D_ProcessEvents (void) { FixedBitArray keywasdown; - TArray delayedevents; + TArray delayedevents; keywasdown.Zero(); while (eventtail != eventhead) @@ -77,7 +77,7 @@ void D_ProcessEvents (void) if (ev->type == EV_KeyUp && keywasdown[ev->data1]) { - delayedevents.Push(*ev); + delayedevents.Push(ev); continue; } @@ -97,9 +97,9 @@ void D_ProcessEvents (void) if (sysCallbacks.G_Responder(ev) && ev->type == EV_KeyDown) keywasdown.Set(ev->data1); } - for (auto& ev: delayedevents) + for (auto ev: delayedevents) { - D_PostEvent(&ev); + D_PostEvent(ev); } } diff --git a/src/common/platform/posix/sdl/crashcatcher.c b/src/common/platform/posix/sdl/crashcatcher.c index 698707027e..c88e0fe8ac 100644 --- a/src/common/platform/posix/sdl/crashcatcher.c +++ b/src/common/platform/posix/sdl/crashcatcher.c @@ -15,6 +15,8 @@ #include #endif +int I_FileAvailable(const char* filename); + static const char crash_switch[] = "--cc-handle-crash"; @@ -363,12 +365,11 @@ static void crash_handler(const char *logfile) if(logfile) { - const char *str; char buf[512]; - if((str=getenv("KDE_FULL_SESSION")) && strcmp(str, "true") == 0) + if(I_FileAvailable("kdialog")) snprintf(buf, sizeof(buf), "kdialog --title \"Very Fatal Error\" --textbox \"%s\" 800 600", logfile); - else if((str=getenv("GNOME_DESKTOP_SESSION_ID")) && str[0] != '\0') + else if(I_FileAvailable("gxmessage")) snprintf(buf, sizeof(buf), "gxmessage -buttons \"Okay:0\" -geometry 800x600 -title \"Very Fatal Error\" -center -file \"%s\"", logfile); else snprintf(buf, sizeof(buf), "xmessage -buttons \"Okay:0\" -center -file \"%s\"", logfile); diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index 8db0f63ce7..512a7d62b9 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -85,22 +85,18 @@ void I_SetIWADInfo() { } -static bool I_KDialogAvailable() +extern "C" int I_FileAvailable(const char* filename) { - // Is KDE running? - const char* str = getenv("KDE_FULL_SESSION"); - if (str && strcmp(str, "true") == 0) + FString cmd = "which {0} >/dev/null 2>&1"; + cmd.Substitute("{0}", filename); + + if (FILE* f = popen(cmd.GetChars(), "r")) { - // Is kdialog available? - FILE* f = popen("which kdialog >/dev/null 2>&1", "r"); - if (f != NULL) - { - int status = pclose(f); - return WIFEXITED(status) && WEXITSTATUS(status) == 0; - } + int status = pclose(f); + return WIFEXITED(status) && WEXITSTATUS(status) == 0; } - return false; + return 0; } // @@ -117,7 +113,7 @@ void Unix_I_FatalError(const char* errortext) // Close window or exit fullscreen and release mouse capture SDL_QuitSubSystem(SDL_INIT_VIDEO); - if(I_KDialogAvailable()) + if(I_FileAvailable("kdialog")) { FString cmd; cmd << "kdialog --title \"" GAMENAME " " << GetVersionString() @@ -311,7 +307,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad, int& } #ifndef __APPLE__ - if(I_KDialogAvailable()) + if(I_FileAvailable("kdialog")) { FString cmd("kdialog --title \"" GAMENAME " "); cmd << GetVersionString() << ": Select an IWAD to use\"" diff --git a/src/common/rendering/hwrenderer/data/hw_cvars.cpp b/src/common/rendering/hwrenderer/data/hw_cvars.cpp index 14f5f2a87f..a7967b92e3 100644 --- a/src/common/rendering/hwrenderer/data/hw_cvars.cpp +++ b/src/common/rendering/hwrenderer/data/hw_cvars.cpp @@ -115,7 +115,7 @@ CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); // Texture CVARs // //========================================================================== -CUSTOM_CVARD(Float, gl_texture_filter_anisotropic, 8, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL, "changes the OpenGL texture anisotropy setting") +CUSTOM_CVARD(Float, gl_texture_filter_anisotropic, 8.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL, "changes the OpenGL texture anisotropy setting") { screen->SetTextureFilterMode(); } diff --git a/src/common/rendering/hwrenderer/data/hw_skydome.cpp b/src/common/rendering/hwrenderer/data/hw_skydome.cpp index 9d1f76ab58..eae09ffbbb 100644 --- a/src/common/rendering/hwrenderer/data/hw_skydome.cpp +++ b/src/common/rendering/hwrenderer/data/hw_skydome.cpp @@ -70,7 +70,7 @@ // also shamelessly lifted from ZDoomGL! ;) // //----------------------------------------------------------------------------- -CVAR(Float, skyoffset, 0, 0) // for testing +CVAR(Float, skyoffset, 0.f, 0) // for testing struct SkyColor diff --git a/src/common/statusbar/base_sbar.cpp b/src/common/statusbar/base_sbar.cpp index 9e0431610b..d51c5f79f1 100644 --- a/src/common/statusbar/base_sbar.cpp +++ b/src/common/statusbar/base_sbar.cpp @@ -61,7 +61,7 @@ CVAR(Int, crosshairhealth, 2, CVAR_ARCHIVE); CVARD(Float, crosshairscale, 0.5, CVAR_ARCHIVE, "changes the size of the crosshair"); CVAR(Bool, crosshairgrow, false, CVAR_ARCHIVE); -CUSTOM_CVARD(Float, hud_scalefactor, 1, CVAR_ARCHIVE, "changes the hud scale") +CUSTOM_CVARD(Float, hud_scalefactor, 1.f, CVAR_ARCHIVE, "changes the hud scale") { if (self < 0.36f) self = 0.36f; else if (self > 1) self = 1; diff --git a/src/common/utility/vectors.h b/src/common/utility/vectors.h index b8a563ca8f..55baafc1ab 100644 --- a/src/common/utility/vectors.h +++ b/src/common/utility/vectors.h @@ -237,6 +237,12 @@ struct TVector2 { return X*X + Y*Y; } + + double Sum() const + { + return abs(X) + abs(Y); + } + // Return a unit vector facing the same direction as this one TVector2 Unit() const @@ -601,6 +607,12 @@ struct TVector3 { return X*X + Y*Y + Z*Z; } + + double Sum() const + { + return abs(X) + abs(Y) + abs(Z); + } + // Return a unit vector facing the same direction as this one TVector3 Unit() const @@ -900,6 +912,12 @@ struct TVector4 { return X*X + Y*Y + Z*Z + W*W; } + + double Sum() const + { + return abs(X) + abs(Y) + abs(Z) + abs(W); + } + // Return a unit vector facing the same direction as this one TVector4 Unit() const @@ -1693,6 +1711,7 @@ constexpr DAngle nullAngle = DAngle::fromDeg(0.); constexpr DAngle minAngle = DAngle::fromDeg(1. / 65536.); constexpr FAngle nullFAngle = FAngle::fromDeg(0.); +constexpr DAngle DAngle1 = DAngle::fromDeg(1); constexpr DAngle DAngle22_5 = DAngle::fromDeg(22.5); constexpr DAngle DAngle45 = DAngle::fromDeg(45); constexpr DAngle DAngle60 = DAngle::fromDeg(60); diff --git a/src/g_game.cpp b/src/g_game.cpp index 16fe41cea3..e44a632791 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1918,7 +1918,6 @@ static void LoadGameError(const char *label, const char *append = "") void C_SerializeCVars(FSerializer& arc, const char* label, uint32_t filter) { - FBaseCVar* cvar; FString dump; if (arc.BeginObject(label)) diff --git a/src/playsim/p_effect.cpp b/src/playsim/p_effect.cpp index 26c6f2ef9e..38fa616515 100644 --- a/src/playsim/p_effect.cpp +++ b/src/playsim/p_effect.cpp @@ -51,7 +51,7 @@ #include "g_game.h" CVAR (Int, cl_rockettrails, 1, CVAR_ARCHIVE); -CVAR (Bool, r_rail_smartspiral, 0, CVAR_ARCHIVE); +CVAR (Bool, r_rail_smartspiral, false, CVAR_ARCHIVE); CVAR (Int, r_rail_spiralsparsity, 1, CVAR_ARCHIVE); CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE); CVAR (Bool, r_particles, true, 0); diff --git a/src/playsim/p_pspr.cpp b/src/playsim/p_pspr.cpp index c2060cfe9b..38560fba25 100644 --- a/src/playsim/p_pspr.cpp +++ b/src/playsim/p_pspr.cpp @@ -90,7 +90,7 @@ enum EWRF_Options // [SO] 1=Weapons states are all 1 tick // 2=states with a function 1 tick, others 0 ticks. -CVAR(Int, sv_fastweapons, false, CVAR_SERVERINFO); +CVAR(Int, sv_fastweapons, 0, CVAR_SERVERINFO); // PRIVATE DATA DEFINITIONS ------------------------------------------------ diff --git a/src/playsim/p_sectors.cpp b/src/playsim/p_sectors.cpp index 2fe1130b51..a194f177ad 100644 --- a/src/playsim/p_sectors.cpp +++ b/src/playsim/p_sectors.cpp @@ -78,7 +78,7 @@ // //========================================================================== -CUSTOM_CVAR(Int, r_fakecontrast, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Int, r_fakecontrast, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { if (self < 0) self = 1; else if (self > 2) self = 2; diff --git a/src/rendering/swrenderer/drawers/r_draw.cpp b/src/rendering/swrenderer/drawers/r_draw.cpp index 3f50fcef86..4e8a667324 100644 --- a/src/rendering/swrenderer/drawers/r_draw.cpp +++ b/src/rendering/swrenderer/drawers/r_draw.cpp @@ -54,8 +54,8 @@ #include "swrenderer/scene/r_light.h" #include "playsim/a_dynlight.h" -CVAR(Bool, r_dynlights, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); -CVAR(Bool, r_fuzzscale, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); +CVAR(Bool, r_dynlights, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); +CVAR(Bool, r_fuzzscale, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); namespace swrenderer { diff --git a/src/rendering/swrenderer/scene/r_3dfloors.cpp b/src/rendering/swrenderer/scene/r_3dfloors.cpp index 78c88b0aba..c8e9a45211 100644 --- a/src/rendering/swrenderer/scene/r_3dfloors.cpp +++ b/src/rendering/swrenderer/scene/r_3dfloors.cpp @@ -43,7 +43,7 @@ #include "swrenderer/r_renderthread.h" #include "r_memory.h" -CVAR(Int, r_3dfloors, true, 0); +CVAR(Int, r_3dfloors, 1, 0); namespace swrenderer { diff --git a/src/rendering/swrenderer/scene/r_opaque_pass.cpp b/src/rendering/swrenderer/scene/r_opaque_pass.cpp index 6b5592f1f2..08fd1bc52b 100644 --- a/src/rendering/swrenderer/scene/r_opaque_pass.cpp +++ b/src/rendering/swrenderer/scene/r_opaque_pass.cpp @@ -86,7 +86,7 @@ namespace double line_distance_cull = 1e16; } -CUSTOM_CVAR(Float, r_sprite_distance_cull, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Float, r_sprite_distance_cull, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { if (r_sprite_distance_cull > 0.0) { @@ -98,7 +98,7 @@ CUSTOM_CVAR(Float, r_sprite_distance_cull, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) } } -CUSTOM_CVAR(Float, r_line_distance_cull, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) +CUSTOM_CVAR(Float, r_line_distance_cull, 0.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) { if (r_line_distance_cull > 0.0) { @@ -110,7 +110,7 @@ CUSTOM_CVAR(Float, r_line_distance_cull, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) } } -CUSTOM_CVAR(Float, r_model_distance_cull, 1024, 0/*CVAR_ARCHIVE | CVAR_GLOBALCONFIG*/) // Experimental for the moment until a good default is chosen +CUSTOM_CVAR(Float, r_model_distance_cull, 1024.f, 0/*CVAR_ARCHIVE | CVAR_GLOBALCONFIG*/) // Experimental for the moment until a good default is chosen { if (r_model_distance_cull > 0.0) {