Skip to content

Commit

Permalink
UI compat: Fix vfunc locator
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Feb 24, 2024
1 parent 34dd564 commit 82a986b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/mods/vr/FFakeStereoRenderingHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1880,8 +1880,6 @@ FRHITexture2D** FFakeStereoRenderingHook::viewport_get_render_target_texture_hoo
SPDLOG_ERROR("Failed to find Scaleform HAL vtable functions!");
}

// however, some games are not so easy and we have to do some extra analysis to verify
// that the return address here is a scaleform-based call.
if (is_scaleform && !scaleform_hal_vtable_functions.empty()) try {
// Walk the stack, get function starts and check if any are in the vtable
constexpr auto max_stack_depth = 100;
Expand All @@ -1894,7 +1892,7 @@ FRHITexture2D** FFakeStereoRenderingHook::viewport_get_render_target_texture_hoo
}

for (auto i = 1; i < std::min<uint16_t>(7, depth); ++i) {
const auto scaleform_func_start = utility::find_function_start(stack[i]);
const auto scaleform_func_start = utility::find_virtual_function_start(stack[i]);

if (!scaleform_func_start) {
continue;
Expand Down

0 comments on commit 82a986b

Please sign in to comment.