RenderInfo amb tres estats (off/dalt/baix), temps de joc i persistència; ombra, mono-dígits i easing compartits (v0.14.0)
This commit is contained in:
1 parent
46a578fd86
commit
6f3fafbfff
17 files changed
+376
-97
No files matched your search
+26
-2
@@ -43,6 +43,24 @@ namespace {
|
||||
return text == "linear" ? Defaults::TextureFilter::LINEAR : Defaults::TextureFilter::NEAREST;
|
||||
}
|
||||
|
||||
auto renderInfoPositionToString(Defaults::RenderInfoPosition pos) -> const char* {
|
||||
switch (pos) {
|
||||
case Defaults::RenderInfoPosition::TOP:
|
||||
return "top";
|
||||
case Defaults::RenderInfoPosition::BOTTOM:
|
||||
return "bottom";
|
||||
case Defaults::RenderInfoPosition::OFF:
|
||||
return "off";
|
||||
}
|
||||
return "off";
|
||||
}
|
||||
|
||||
auto renderInfoPositionFromString(const std::string& text) -> Defaults::RenderInfoPosition {
|
||||
if (text == "top") { return Defaults::RenderInfoPosition::TOP; }
|
||||
if (text == "bottom") { return Defaults::RenderInfoPosition::BOTTOM; }
|
||||
return Defaults::RenderInfoPosition::OFF;
|
||||
}
|
||||
|
||||
auto readFileOrEmpty(const std::string& path) -> std::string {
|
||||
std::ifstream file(path);
|
||||
if (!file) { return {}; }
|
||||
@@ -97,7 +115,12 @@ namespace {
|
||||
if (node.contains("texture_filter")) {
|
||||
Options::video.texture_filter = filterFromString(node["texture_filter"].get_value<std::string>());
|
||||
}
|
||||
if (node.contains("render_info")) { Options::video.render_info = node["render_info"].get_value<bool>(); }
|
||||
if (node.contains("render_info_position")) {
|
||||
Options::video.render_info_position = renderInfoPositionFromString(node["render_info_position"].get_value<std::string>());
|
||||
}
|
||||
if (node.contains("render_info_show_time")) {
|
||||
Options::video.render_info_show_time = node["render_info_show_time"].get_value<bool>();
|
||||
}
|
||||
parseGpu(node);
|
||||
parseShader(node);
|
||||
}
|
||||
@@ -370,7 +393,8 @@ namespace Options {
|
||||
out << " vsync: " << (video.vsync ? "true" : "false") << "\n";
|
||||
out << " scaling_mode: \"" << scalingModeToString(video.scaling_mode) << "\"\n";
|
||||
out << " texture_filter: \"" << filterToString(video.texture_filter) << "\"\n";
|
||||
out << " render_info: " << (video.render_info ? "true" : "false") << "\n";
|
||||
out << " render_info_position: \"" << renderInfoPositionToString(video.render_info_position) << "\"\n";
|
||||
out << " render_info_show_time: " << (video.render_info_show_time ? "true" : "false") << "\n";
|
||||
out << " gpu:\n";
|
||||
out << " acceleration: " << (video.gpu.acceleration ? "true" : "false") << "\n";
|
||||
out << " preferred_driver: \"" << video.gpu.preferred_driver << "\"\n";
|
||||
|
||||
Reference in new issue
Block a user