mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 22:33:06 +00:00
Make ConfigDB properly thread-safe.
Replace CreateValue with SetValueString so we don't pass pointers to internal ConfigDB structures around. Refs #1810. Remove some splash screen related functions since we can achieve the same with the ConfigDB functions exposed to scripts. This was SVN commit r14437.
This commit is contained in:
@@ -504,21 +504,6 @@ bool IsUserReportEnabled(void* UNUSED(cbdata))
|
||||
return g_UserReporter.IsReportingEnabled();
|
||||
}
|
||||
|
||||
bool IsSplashScreenEnabled(void* UNUSED(cbdata))
|
||||
{
|
||||
bool splashScreenEnable = true;
|
||||
CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable);
|
||||
return splashScreenEnable;
|
||||
}
|
||||
|
||||
void SetSplashScreenEnabled(void* UNUSED(cbdata), bool enabled)
|
||||
{
|
||||
CStr val = (enabled ? "true" : "false");
|
||||
g_ConfigDB.CreateValue(CFG_USER, "splashscreenenable")->m_String = val;
|
||||
g_ConfigDB.WriteFile(CFG_USER);
|
||||
}
|
||||
|
||||
|
||||
void SetUserReportEnabled(void* UNUSED(cbdata), bool enabled)
|
||||
{
|
||||
g_UserReporter.SetReportingEnabled(enabled);
|
||||
@@ -701,10 +686,6 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
|
||||
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
|
||||
scriptInterface.RegisterFunction<void, std::string, int, std::wstring, &SubmitUserReport>("SubmitUserReport");
|
||||
|
||||
// Splash screen functions
|
||||
scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled");
|
||||
scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");
|
||||
|
||||
// Development/debugging functions
|
||||
scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate");
|
||||
scriptInterface.RegisterFunction<float, &GetSimRate>("GetSimRate");
|
||||
|
||||
Reference in New Issue
Block a user