| 624 | ReShadeRegisterOverlayForAddon(nullptr, title, callback); |
| 625 | } |
| 626 | void ReShadeRegisterOverlayForAddon(void *module, const char *title, void(*callback)(reshade::api::effect_runtime *runtime)) |
| 627 | { |
| 628 | reshade::addon_info *const info = reshade::find_addon(module != nullptr ? module : static_cast<void *>(callback)); |
| 629 | if (info == nullptr) |
| 630 | { |
| 631 | reshade::log::message(reshade::log::level::error, "Could not find associated add-on and therefore failed to register overlay with title \"%s\".", title); |
| 632 | return; |
| 633 | } |
| 634 | |
| 635 | assert(info->handle == module || module == nullptr); |
| 636 | |
| 637 | if (title == nullptr) |
| 638 | { |
| 639 | info->settings_overlay_callback = callback; |
| 640 | return; |
| 641 | } |
| 642 | |
| 643 | info->overlay_callbacks.push_back(reshade::addon_info::overlay_callback { title, callback }); |
| 644 | |
| 645 | #if RESHADE_VERBOSE_LOG |
| 646 | reshade::log::message(reshade::log::level::debug, "Registered overlay with title \"%s\" and callback %p.", title, static_cast<void *>(callback)); |
| 647 | #endif |
| 648 | } |
| 649 | void ReShadeUnregisterOverlay(const char *title, void(*callback)(reshade::api::effect_runtime *runtime)) |
| 650 | { |
| 651 | ReShadeUnregisterOverlayForAddon(nullptr, title, callback); |
no test coverage detected