1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 21:42:13 +00:00
OpenMW/components/settings/values.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
580 B
C++
Raw Normal View History

#include "values.hpp"
2023-04-22 18:40:17 +00:00
#include <stdexcept>
namespace Settings
{
Values* Values::sValues = nullptr;
2023-04-22 18:40:17 +00:00
void Values::initDefaults()
{
2023-04-22 18:40:17 +00:00
if (Values::sValues != nullptr)
throw std::logic_error("Default settings already initialized");
static Values values;
Values::sValues = &values;
}
2023-04-22 18:40:17 +00:00
void Values::init()
{
if (Values::sValues == nullptr)
throw std::logic_error("Default settings are not initialized");
static Values values(std::move(*Values::sValues));
Values::sValues = &values;
}
}