Esempio n. 1
0
tribool init_internal_subsystems(GameEngine &engine, const SettingsMap &settings){
    auto flags = settings.count(settings::subsystems_flags)?
        settings.at(settings::subsystems_flags) == settings::subsystems_init_all?
            INIT_EVERYTHING
            : stoul(settings.at(settings::subsystems_flags))
        : 0;
    BOOST_LOG_TRIVIAL(trace) << "Initializing game engine: calling #init_internal_subsystems (flags: " << flags << ")";
    return init_internal_subsystems(engine, flags);
}
Esempio n. 2
0
void init_window(GameEngine &engine, const SettingsMap &settings){
    size_t width = stoul(settings.count(settings::window_width)?
        settings.at(settings::window_width)
        : settings::window_width_example);

    size_t height = stoul(settings.count(settings::window_height)?
        settings.at(settings::window_height)
        : settings::window_height_example);

    const char *title = settings.count(settings::window_title)?
        settings.at(settings::window_title).c_str()
        : settings::window_title_example;

    BOOST_LOG_TRIVIAL(trace) << "Initializing game engine: calling #init_window"
        << "(width: " << width << ", height: " << height << ")";
    init_window(engine, width, height, title);
}