| 19 | using namespace reshade::api; |
| 20 | |
| 21 | static 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 | |
| 44 | static void unpack_r5g6b5(uint16_t data, uint8_t rgb[3]) |
| 45 | { |
no outgoing calls
no test coverage detected