Skip to content

Commit

Permalink
Fix ghosting fix requiring native to be enabled beforehand
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Jun 19, 2023
1 parent b76b4de commit 3c99a61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions shared/sdk/ConsoleManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ sdk::FConsoleManager** try_find_console_manager(const std::wstring& string_candi

SPDLOG_INFO("Found {} stringref: {:x}", utility::narrow(string_candidate), (uintptr_t)*candidate_stringref);

// This might need to be improved a bit, it can be insanely slow on obfuscated builds
const auto containing_function = utility::find_function_start_with_call(*candidate_stringref);

if (!containing_function) {
Expand Down
1 change: 1 addition & 0 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@ void VR::on_pre_engine_tick(sdk::UGameEngine* engine, float delta) {
m_render_target_pool_hook->on_pre_engine_tick(engine, delta);

// Dont update action states on AFR frames
// TODO: fix this for actual AFR, but we dont really care about pure AFR since synced beats it most of the time
if (m_fake_stereo_hook != nullptr && !m_fake_stereo_hook->is_ignoring_next_viewport_draw()) {
update_action_states();
}
Expand Down
10 changes: 9 additions & 1 deletion src/mods/vr/FFakeStereoRenderingHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4301,7 +4301,15 @@ uint32_t FFakeStereoRenderingHook::get_desired_number_of_views_hook(FFakeStereoR
SPDLOG_INFO_ONCE("get desired number of views hook called!");
#endif

if (!is_stereo_enabled || (VR::get()->is_using_afr() && !VR::get()->is_splitscreen_compatibility_enabled())) {
auto& vr = VR::get();

if (!is_stereo_enabled || (vr->is_using_afr() && !vr->is_splitscreen_compatibility_enabled())) {
if (is_stereo_enabled && vr->is_ghosting_fix_enabled() && vr->is_using_afr() &&
g_hook->m_sceneview_data.known_scene_states.size() == 1 && g_hook->m_fixed_localplayer_view_count)
{
return 2; // We need to know about the second scene state to fix ghosting
}

return 1;
}

Expand Down

0 comments on commit 3c99a61

Please sign in to comment.