1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

25 lines
580 B
C++
Raw Normal View History

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