mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-03-10 11:11:51 +00:00
- made CVar declarations type safe again.
This commit is contained in:
parent
453688ccc6
commit
671b8696bb
17 changed files with 87 additions and 64 deletions
|
@ -196,7 +196,7 @@ CUSTOM_CVAR(Int, am_emptyspacemargin, 0, CVAR_ARCHIVE)
|
||||||
CVAR(Bool, am_followplayer, true, CVAR_ARCHIVE)
|
CVAR(Bool, am_followplayer, true, CVAR_ARCHIVE)
|
||||||
CVAR(Bool, am_portaloverlay, true, CVAR_ARCHIVE)
|
CVAR(Bool, am_portaloverlay, true, CVAR_ARCHIVE)
|
||||||
CVAR(Bool, am_showgrid, false, 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";
|
static const char *const DEFAULT_FONT_NAME = "AMMNUMx";
|
||||||
CVAR(String, am_markfont, DEFAULT_FONT_NAME, CVAR_ARCHIVE)
|
CVAR(String, am_markfont, DEFAULT_FONT_NAME, CVAR_ARCHIVE)
|
||||||
|
|
|
@ -75,12 +75,12 @@ CUSTOM_CVAR(Int, adl_emulator_id, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_VIR
|
||||||
FORWARD_CVAR(adl_emulator_id);
|
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);
|
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);
|
FORWARD_BOOL_CVAR(adl_fullpan);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ CUSTOM_CVAR(Int, adl_bank, 14, CVAR_ARCHIVE | CVAR_VIRTUAL)
|
||||||
FORWARD_CVAR(adl_bank);
|
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);
|
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
|
// 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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
FORWARD_CVAR(timidity_min_sustain_time);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,19 @@ enum
|
||||||
CVAR_CONFIG_ONLY = 1 << 18, // do not save var to savegame and do not send it across network.
|
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;
|
class FIntCVarRef;
|
||||||
union UCVarValue
|
union UCVarValue
|
||||||
{
|
{
|
||||||
|
@ -92,17 +105,12 @@ union UCVarValue
|
||||||
constexpr UCVarValue(FIntCVarRef& v);
|
constexpr UCVarValue(FIntCVarRef& v);
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ECVarType
|
template <ECVarType t> constexpr UCVarValue CVarValue(bool v) { static_assert(t == CVAR_Bool); return v; }
|
||||||
{
|
template <ECVarType t> constexpr UCVarValue CVarValue(int v) { static_assert(t == CVAR_Int || t == CVAR_Color); return v; }
|
||||||
CVAR_Bool,
|
template <ECVarType t> constexpr UCVarValue CVarValue(float v) { static_assert(t == CVAR_Float); return v; }
|
||||||
CVAR_Int,
|
template <ECVarType t> constexpr UCVarValue CVarValue(double v) { static_assert(t == CVAR_Float); return v; }
|
||||||
CVAR_Float,
|
template <ECVarType t> constexpr UCVarValue CVarValue(const char* v) { static_assert(t == CVAR_String); return v; }
|
||||||
CVAR_String,
|
template <ECVarType t> constexpr UCVarValue CVarValue(FIntCVarRef& v) { static_assert(t == CVAR_Flag || t == CVAR_Mask); return v; }
|
||||||
CVAR_Color, // stored as CVAR_Int
|
|
||||||
CVAR_Flag, // just redirects to another cvar
|
|
||||||
CVAR_Mask, // just redirects to another cvar
|
|
||||||
CVAR_Dummy, // Unknown
|
|
||||||
};
|
|
||||||
|
|
||||||
class FConfigFile;
|
class FConfigFile;
|
||||||
|
|
||||||
|
@ -598,7 +606,7 @@ void C_ForgetCVars (void);
|
||||||
#define CUSTOM_CVAR(type,name,def,flags) \
|
#define CUSTOM_CVAR(type,name,def,flags) \
|
||||||
static void cvarfunc_##name(F##type##CVar &); \
|
static void cvarfunc_##name(F##type##CVar &); \
|
||||||
F##type##CVarRef name; \
|
F##type##CVarRef name; \
|
||||||
static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, def, nullptr, reinterpret_cast<void*>(cvarfunc_##name) }; \
|
static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, CVarValue<CVAR_##type>(def), nullptr, reinterpret_cast<void*>(cvarfunc_##name) }; \
|
||||||
extern FCVarDecl const *const cvardeclref_##name; \
|
extern FCVarDecl const *const cvardeclref_##name; \
|
||||||
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \
|
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \
|
||||||
static void cvarfunc_##name(F##type##CVar &self)
|
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) \
|
#define CUSTOM_CVAR_NAMED(type,name,cname,def,flags) \
|
||||||
static void cvarfunc_##name(F##type##CVar &); \
|
static void cvarfunc_##name(F##type##CVar &); \
|
||||||
F##type##CVarRef name; \
|
F##type##CVarRef name; \
|
||||||
static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #cname, def, nullptr, reinterpret_cast<void*>(cvarfunc_##name) }; \
|
static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #cname, CVarValue<CVAR_##type>(def), nullptr, reinterpret_cast<void*>(cvarfunc_##name) }; \
|
||||||
extern FCVarDecl const *const cvardeclref_##name; \
|
extern FCVarDecl const *const cvardeclref_##name; \
|
||||||
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \
|
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \
|
||||||
static void cvarfunc_##name(F##type##CVar &self)
|
static void cvarfunc_##name(F##type##CVar &self)
|
||||||
|
|
||||||
#define CVAR(type,name,def,flags) \
|
#define CVAR(type,name,def,flags) \
|
||||||
F##type##CVarRef name; \
|
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<CVAR_##type>(def), nullptr, nullptr}; \
|
||||||
extern FCVarDecl const *const cvardeclref_##name; \
|
extern FCVarDecl const *const cvardeclref_##name; \
|
||||||
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##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) \
|
#define CUSTOM_CVARD(type,name,def,flags,descr) \
|
||||||
static void cvarfunc_##name(F##type##CVar &); \
|
static void cvarfunc_##name(F##type##CVar &); \
|
||||||
F##type##CVarRef name; \
|
F##type##CVarRef name; \
|
||||||
static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, def, descr, reinterpret_cast<void*>(cvarfunc_##name) }; \
|
static FCVarDecl cvardecl_##name = { &name, CVAR_##type, (flags), #name, CVarValue<CVAR_##type>(def), descr, reinterpret_cast<void*>(cvarfunc_##name) }; \
|
||||||
extern FCVarDecl const *const cvardeclref_##name; \
|
extern FCVarDecl const *const cvardeclref_##name; \
|
||||||
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \
|
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name; \
|
||||||
static void cvarfunc_##name(F##type##CVar &self)
|
static void cvarfunc_##name(F##type##CVar &self)
|
||||||
|
|
||||||
#define CVARD(type,name,def,flags, descr) \
|
#define CVARD(type,name,def,flags, descr) \
|
||||||
F##type##CVarRef name; \
|
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<CVAR_##type>(def), descr, nullptr}; \
|
||||||
extern FCVarDecl const *const cvardeclref_##name; \
|
extern FCVarDecl const *const cvardeclref_##name; \
|
||||||
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name;
|
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name;
|
||||||
|
|
||||||
#define CVARD_NAMED(type,name,varname,def,flags, descr) \
|
#define CVARD_NAMED(type,name,varname,def,flags, descr) \
|
||||||
F##type##CVarRef name; \
|
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<CVAR_##type>(def), descr, nullptr}; \
|
||||||
extern FCVarDecl const *const cvardeclref_##name; \
|
extern FCVarDecl const *const cvardeclref_##name; \
|
||||||
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name;
|
MSVC_VSEG FCVarDecl const *const cvardeclref_##name GCC_VSEG = &cvardecl_##name;
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,8 @@ int eventhead;
|
||||||
int eventtail;
|
int eventtail;
|
||||||
event_t events[MAXEVENTS];
|
event_t events[MAXEVENTS];
|
||||||
|
|
||||||
CVAR(Float, m_sensitivity_x, 4, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CVAR(Float, m_sensitivity_x, 4.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
CVAR(Float, m_sensitivity_y, 2, 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)
|
void D_ProcessEvents (void)
|
||||||
{
|
{
|
||||||
FixedBitArray<NUM_KEYS> keywasdown;
|
FixedBitArray<NUM_KEYS> keywasdown;
|
||||||
TArray<event_t> delayedevents;
|
TArray<event_t*> delayedevents;
|
||||||
|
|
||||||
keywasdown.Zero();
|
keywasdown.Zero();
|
||||||
while (eventtail != eventhead)
|
while (eventtail != eventhead)
|
||||||
|
@ -77,7 +77,7 @@ void D_ProcessEvents (void)
|
||||||
|
|
||||||
if (ev->type == EV_KeyUp && keywasdown[ev->data1])
|
if (ev->type == EV_KeyUp && keywasdown[ev->data1])
|
||||||
{
|
{
|
||||||
delayedevents.Push(*ev);
|
delayedevents.Push(ev);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,9 +97,9 @@ void D_ProcessEvents (void)
|
||||||
if (sysCallbacks.G_Responder(ev) && ev->type == EV_KeyDown) keywasdown.Set(ev->data1);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int I_FileAvailable(const char* filename);
|
||||||
|
|
||||||
|
|
||||||
static const char crash_switch[] = "--cc-handle-crash";
|
static const char crash_switch[] = "--cc-handle-crash";
|
||||||
|
|
||||||
|
@ -363,12 +365,11 @@ static void crash_handler(const char *logfile)
|
||||||
|
|
||||||
if(logfile)
|
if(logfile)
|
||||||
{
|
{
|
||||||
const char *str;
|
|
||||||
char buf[512];
|
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);
|
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);
|
snprintf(buf, sizeof(buf), "gxmessage -buttons \"Okay:0\" -geometry 800x600 -title \"Very Fatal Error\" -center -file \"%s\"", logfile);
|
||||||
else
|
else
|
||||||
snprintf(buf, sizeof(buf), "xmessage -buttons \"Okay:0\" -center -file \"%s\"", logfile);
|
snprintf(buf, sizeof(buf), "xmessage -buttons \"Okay:0\" -center -file \"%s\"", logfile);
|
||||||
|
|
|
@ -85,22 +85,18 @@ void I_SetIWADInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool I_KDialogAvailable()
|
extern "C" int I_FileAvailable(const char* filename)
|
||||||
{
|
{
|
||||||
// Is KDE running?
|
FString cmd = "which {0} >/dev/null 2>&1";
|
||||||
const char* str = getenv("KDE_FULL_SESSION");
|
cmd.Substitute("{0}", filename);
|
||||||
if (str && strcmp(str, "true") == 0)
|
|
||||||
{
|
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);
|
int status = pclose(f);
|
||||||
return WIFEXITED(status) && WEXITSTATUS(status) == 0;
|
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
|
// Close window or exit fullscreen and release mouse capture
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
|
|
||||||
if(I_KDialogAvailable())
|
if(I_FileAvailable("kdialog"))
|
||||||
{
|
{
|
||||||
FString cmd;
|
FString cmd;
|
||||||
cmd << "kdialog --title \"" GAMENAME " " << GetVersionString()
|
cmd << "kdialog --title \"" GAMENAME " " << GetVersionString()
|
||||||
|
@ -311,7 +307,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad, int&
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
if(I_KDialogAvailable())
|
if(I_FileAvailable("kdialog"))
|
||||||
{
|
{
|
||||||
FString cmd("kdialog --title \"" GAMENAME " ");
|
FString cmd("kdialog --title \"" GAMENAME " ");
|
||||||
cmd << GetVersionString() << ": Select an IWAD to use\""
|
cmd << GetVersionString() << ": Select an IWAD to use\""
|
||||||
|
|
|
@ -115,7 +115,7 @@ CVAR(Int, gl_satformula, 1, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||||
// Texture CVARs
|
// 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();
|
screen->SetTextureFilterMode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
// also shamelessly lifted from ZDoomGL! ;)
|
// also shamelessly lifted from ZDoomGL! ;)
|
||||||
//
|
//
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
CVAR(Float, skyoffset, 0, 0) // for testing
|
CVAR(Float, skyoffset, 0.f, 0) // for testing
|
||||||
|
|
||||||
|
|
||||||
struct SkyColor
|
struct SkyColor
|
||||||
|
|
|
@ -61,7 +61,7 @@ CVAR(Int, crosshairhealth, 2, CVAR_ARCHIVE);
|
||||||
CVARD(Float, crosshairscale, 0.5, CVAR_ARCHIVE, "changes the size of the crosshair");
|
CVARD(Float, crosshairscale, 0.5, CVAR_ARCHIVE, "changes the size of the crosshair");
|
||||||
CVAR(Bool, crosshairgrow, false, CVAR_ARCHIVE);
|
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;
|
if (self < 0.36f) self = 0.36f;
|
||||||
else if (self > 1) self = 1;
|
else if (self > 1) self = 1;
|
||||||
|
|
|
@ -238,6 +238,12 @@ struct TVector2
|
||||||
return X*X + Y*Y;
|
return X*X + Y*Y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double Sum() const
|
||||||
|
{
|
||||||
|
return abs(X) + abs(Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return a unit vector facing the same direction as this one
|
// Return a unit vector facing the same direction as this one
|
||||||
TVector2 Unit() const
|
TVector2 Unit() const
|
||||||
{
|
{
|
||||||
|
@ -602,6 +608,12 @@ struct TVector3
|
||||||
return X*X + Y*Y + Z*Z;
|
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
|
// Return a unit vector facing the same direction as this one
|
||||||
TVector3 Unit() const
|
TVector3 Unit() const
|
||||||
{
|
{
|
||||||
|
@ -901,6 +913,12 @@ struct TVector4
|
||||||
return X*X + Y*Y + Z*Z + W*W;
|
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
|
// Return a unit vector facing the same direction as this one
|
||||||
TVector4 Unit() const
|
TVector4 Unit() const
|
||||||
{
|
{
|
||||||
|
@ -1693,6 +1711,7 @@ constexpr DAngle nullAngle = DAngle::fromDeg(0.);
|
||||||
constexpr DAngle minAngle = DAngle::fromDeg(1. / 65536.);
|
constexpr DAngle minAngle = DAngle::fromDeg(1. / 65536.);
|
||||||
constexpr FAngle nullFAngle = FAngle::fromDeg(0.);
|
constexpr FAngle nullFAngle = FAngle::fromDeg(0.);
|
||||||
|
|
||||||
|
constexpr DAngle DAngle1 = DAngle::fromDeg(1);
|
||||||
constexpr DAngle DAngle22_5 = DAngle::fromDeg(22.5);
|
constexpr DAngle DAngle22_5 = DAngle::fromDeg(22.5);
|
||||||
constexpr DAngle DAngle45 = DAngle::fromDeg(45);
|
constexpr DAngle DAngle45 = DAngle::fromDeg(45);
|
||||||
constexpr DAngle DAngle60 = DAngle::fromDeg(60);
|
constexpr DAngle DAngle60 = DAngle::fromDeg(60);
|
||||||
|
|
|
@ -1918,7 +1918,6 @@ static void LoadGameError(const char *label, const char *append = "")
|
||||||
|
|
||||||
void C_SerializeCVars(FSerializer& arc, const char* label, uint32_t filter)
|
void C_SerializeCVars(FSerializer& arc, const char* label, uint32_t filter)
|
||||||
{
|
{
|
||||||
FBaseCVar* cvar;
|
|
||||||
FString dump;
|
FString dump;
|
||||||
|
|
||||||
if (arc.BeginObject(label))
|
if (arc.BeginObject(label))
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#include "g_game.h"
|
#include "g_game.h"
|
||||||
|
|
||||||
CVAR (Int, cl_rockettrails, 1, CVAR_ARCHIVE);
|
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_spiralsparsity, 1, CVAR_ARCHIVE);
|
||||||
CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE);
|
CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE);
|
||||||
CVAR (Bool, r_particles, true, 0);
|
CVAR (Bool, r_particles, true, 0);
|
||||||
|
|
|
@ -90,7 +90,7 @@ enum EWRF_Options
|
||||||
|
|
||||||
// [SO] 1=Weapons states are all 1 tick
|
// [SO] 1=Weapons states are all 1 tick
|
||||||
// 2=states with a function 1 tick, others 0 ticks.
|
// 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 ------------------------------------------------
|
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -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;
|
if (self < 0) self = 1;
|
||||||
else if (self > 2) self = 2;
|
else if (self > 2) self = 2;
|
||||||
|
|
|
@ -54,8 +54,8 @@
|
||||||
#include "swrenderer/scene/r_light.h"
|
#include "swrenderer/scene/r_light.h"
|
||||||
#include "playsim/a_dynlight.h"
|
#include "playsim/a_dynlight.h"
|
||||||
|
|
||||||
CVAR(Bool, r_dynlights, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
CVAR(Bool, r_dynlights, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||||
CVAR(Bool, r_fuzzscale, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
CVAR(Bool, r_fuzzscale, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "swrenderer/r_renderthread.h"
|
#include "swrenderer/r_renderthread.h"
|
||||||
#include "r_memory.h"
|
#include "r_memory.h"
|
||||||
|
|
||||||
CVAR(Int, r_3dfloors, true, 0);
|
CVAR(Int, r_3dfloors, 1, 0);
|
||||||
|
|
||||||
namespace swrenderer
|
namespace swrenderer
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace
|
||||||
double line_distance_cull = 1e16;
|
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)
|
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)
|
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)
|
if (r_model_distance_cull > 0.0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue