| 82 | return ReShadeSetConfigArray(module, runtime, section, key, value, value != nullptr ? std::strlen(value) : 0); |
| 83 | } |
| 84 | void ReShadeSetConfigArray(void *, reshade::api::effect_runtime *runtime, const char *section, const char *key, const char *value, size_t size) |
| 85 | { |
| 86 | reshade::ini_file &config = (runtime != nullptr) ? reshade::ini_file::load_cache(static_cast<reshade::runtime *>(runtime)->get_config_path()) : reshade::global_config(); |
| 87 | |
| 88 | if (value != nullptr) |
| 89 | { |
| 90 | std::vector<std::string> elements; |
| 91 | for (size_t i = 0, k = 0; i < size; i++) |
| 92 | { |
| 93 | if (k >= elements.size()) |
| 94 | elements.resize(k + 1); |
| 95 | |
| 96 | if (value[i] == '\0') |
| 97 | { |
| 98 | k++; |
| 99 | continue; |
| 100 | } |
| 101 | |
| 102 | elements[k] += value[i]; |
| 103 | } |
| 104 | |
| 105 | config.set(section != nullptr ? section : std::string(), key != nullptr ? key : std::string(), elements); |
| 106 | } |
| 107 | else |
| 108 | { |
| 109 | config.remove_key(section != nullptr ? section : std::string(), key != nullptr ? key : std::string()); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | #include "d3d9/d3d9_impl_device.hpp" |
| 114 | #include "d3d9/d3d9_impl_swapchain.hpp" |
no test coverage detected