| 136 | s_current_mapping.data = *data; |
| 137 | } |
| 138 | static void on_unmap_texture(device *, resource resource, uint32_t subresource) |
| 139 | { |
| 140 | if (subresource != 0 || resource != s_current_mapping.res) |
| 141 | return; |
| 142 | |
| 143 | s_current_mapping.res = { 0 }; |
| 144 | |
| 145 | void *mapped_data = s_current_mapping.data.data; |
| 146 | |
| 147 | if (load_texture_image(s_current_mapping.desc, s_current_mapping.data, s_data_to_delete)) |
| 148 | { |
| 149 | std::memcpy(mapped_data, s_current_mapping.data.data, s_current_mapping.data.slice_pitch); |
| 150 | |
| 151 | // Free the memory allocated via the 'load_texture_image' call above |
| 152 | s_data_to_delete.clear(); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | extern "C" __declspec(dllexport) const char *NAME = "Texture Replace"; |
| 157 | extern "C" __declspec(dllexport) const char *DESCRIPTION = "Example add-on that replaces textures before they are used by the application with image files from disk (\"" RESHADE_ADDON_TEXTURE_LOAD_DIR "\" directory)."; |
nothing calls this directly
no test coverage detected