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

Function make_texture_file_path

examples/utils/save_texture_image.cpp:21–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace reshade::api;
20
21static std::filesystem::path make_texture_file_path(uint32_t texture_hash)
22{
23 // Prepend executable directory to image files
24 wchar_t file_prefix[MAX_PATH] = L"";
25 GetModuleFileNameW(nullptr, file_prefix, ARRAYSIZE(file_prefix));
26
27 std::filesystem::path path = file_prefix;
28 path = path.parent_path();
29 path /= RESHADE_ADDON_TEXTURE_SAVE_DIR;
30
31 // Ensure target directory exists
32 if (!std::filesystem::exists(path))
33 std::filesystem::create_directory(path);
34
35 wchar_t hash_string[11];
36 swprintf_s(hash_string, L"0x%08X", texture_hash);
37
38 path /= hash_string;
39 path += RESHADE_ADDON_TEXTURE_SAVE_FORMAT;
40
41 return path;
42}
43
44static void unpack_r5g6b5(uint16_t data, uint8_t rgb[3])
45{

Callers 1

save_texture_imageFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected