mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 15:39:20 +02:00
Ordering them before the imports in the same file was not enough: a project header on line 1 can import a module several levels down whose global module fragment already pulled in the same standard header, and that include guard does not cross the module boundary. Putting them first means the guard is set before anything can import. Skips vendored single-header libraries and anything inside an #if.
54 lines
1.5 KiB
C++
54 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <array>
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <yaml-cpp/yaml.h>
|
|
|
|
|
|
struct MaConfig {
|
|
enum MaTonemapType { Default_Srgb = 0, Linear_Rec2020 };
|
|
void Init(const std::filesystem::path& config_file);
|
|
void Init(const YAML::Node& node);
|
|
struct MaConfigDisplay {
|
|
void Init(const YAML::Node& node);
|
|
struct MaConfigHDR {
|
|
void Init(const YAML::Node& node);
|
|
MaTonemapType m_tonemap_function;
|
|
float m_ui_nits;
|
|
float m_scene_nits;
|
|
float m_scene_exposure;
|
|
float m_scene_gamma;
|
|
float GetMaxOutputNits() const {
|
|
return std::max(m_ui_nits, m_scene_nits);
|
|
}
|
|
float GetMinOutputNits() const { return 1.e-3f; }
|
|
};
|
|
std::array<MaConfigHDR, 2> m_hdr_configs;
|
|
int m_adapter_index;
|
|
int m_output_index;
|
|
bool m_disable_hdr = false;
|
|
MaConfigHDR GetHDRConfig(bool is_hdr) const { return m_hdr_configs[is_hdr]; }
|
|
MaConfigHDR GetHDRConfig() const;
|
|
} m_display;
|
|
struct MaConfigLighting{
|
|
void Init(const YAML::Node& node);
|
|
int m_max_lights_per_scene;
|
|
float m_selfillum_multiplier;
|
|
float m_freespot_multiplier;
|
|
float m_luminance_threshold;
|
|
float m_min_luminance_ev;
|
|
float m_max_luminance_ev;
|
|
} m_lighting;
|
|
std::string m_cloud_texture;
|
|
std::string m_high_cloud_texture;
|
|
int m_envmap_resolution;
|
|
float m_weight_lines;
|
|
float m_weight_tractions;
|
|
struct MaConfigShadow {
|
|
void Init(const YAML::Node& node);
|
|
int m_resolution;
|
|
std::vector<double> m_cascade_distances;
|
|
} m_shadow;
|
|
}; |