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

28 lines
661 B
C++

#include "values.hpp"
#include <stdexcept>
namespace Settings
{
Index* StaticValues::sIndex = nullptr;
Values* StaticValues::sValues = nullptr;
void StaticValues::initDefaults()
{
if (sValues != nullptr)
throw std::logic_error("Default settings already initialized");
static Index index;
static Values values(index);
sIndex = &index;
sValues = &values;
}
void StaticValues::init()
{
if (sValues == nullptr)
throw std::logic_error("Default settings are not initialized");
static Values values(std::move(*sValues));
sValues = &values;
}
}