MCPcopy Create free account
hub / github.com/crosire/reshade / ReShadeSetConfigArray

Function ReShadeSetConfigArray

source/addon.cpp:84–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 return ReShadeSetConfigArray(module, runtime, section, key, value, value != nullptr ? std::strlen(value) : 0);
83}
84void 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"

Callers 2

ReShadeSetConfigValueFunction · 0.85
set_config_valueFunction · 0.85

Calls 2

setMethod · 0.80
remove_keyMethod · 0.80

Tested by

no test coverage detected