You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/components/settings/values.cpp

25 lines
580 B
C++

#include "values.hpp"
#include <stdexcept>
namespace Settings
{
Values* Values::sValues = nullptr;
void Values::initDefaults()
{
if (Values::sValues != nullptr)
throw std::logic_error("Default settings already initialized");
static Values values;
Values::sValues = &values;
}
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;
}
}