Skip to content

Commit

Permalink
Add SceneView compatibility mode
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Nov 7, 2023
1 parent b07480d commit 762d963
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/mods/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,7 @@ void VR::on_draw_sidebar_entry(std::string_view name) {
ImGui::SetNextItemOpen(true, ImGuiCond_::ImGuiCond_Once);
if (ImGui::TreeNode("Compatibility Options")) {
m_compatibility_skip_pip->draw("Skip PostInitProperties");
m_sceneview_compatibility_mode->draw("SceneView Compatibility Mode");
m_extreme_compat_mode->draw("Extreme Compatibility Mode");
ImGui::TreePop();
}
Expand Down
11 changes: 9 additions & 2 deletions src/mods/VR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ class VR : public Mod {
return m_splitscreen_view_index->value();
}

bool is_sceneview_compatibility_enabled() const {
return m_sceneview_compatibility_mode->value();
}

bool is_ghosting_fix_enabled() const {
return m_ghosting_fix->value();
}
Expand Down Expand Up @@ -725,9 +729,11 @@ class VR : public Mod {
const ModSlider::Ptr m_custom_z_near{ ModSlider::create(generate_name("CustomZNear"), 0.001f, 100.0f, 0.01f) };
const ModToggle::Ptr m_custom_z_near_enabled{ ModToggle::create(generate_name("EnableCustomZNear"), false) };

const ModToggle::Ptr m_splitscreen_compatibility_mode{ ModToggle::create(generate_name("SplitscreenCompatibilityMode"), false) };
const ModToggle::Ptr m_splitscreen_compatibility_mode{ ModToggle::create(generate_name("Compatibility_SplitScreen"), false) };
const ModInt32::Ptr m_splitscreen_view_index{ ModInt32::create(generate_name("SplitscreenViewIndex"), 0) };

const ModToggle::Ptr m_sceneview_compatibility_mode{ ModToggle::create(generate_name("Compatibility_SceneView"), false) };

const ModToggle::Ptr m_compatibility_skip_pip{ ModToggle::create(generate_name("Compatibility_SkipPostInitProperties"), false) };

struct DecoupledPitchData {
Expand Down Expand Up @@ -786,7 +792,8 @@ class VR : public Mod {
*m_ghosting_fix,
*m_splitscreen_compatibility_mode,
*m_splitscreen_view_index,
*m_compatibility_skip_pip
*m_compatibility_skip_pip,
*m_sceneview_compatibility_mode,
};


Expand Down
4 changes: 2 additions & 2 deletions src/mods/vr/FFakeStereoRenderingHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void FFakeStereoRenderingHook::attempt_hook_fsceneview_constructor() {

auto& vr = VR::get();

if (!vr->is_ghosting_fix_enabled() && !vr->is_splitscreen_compatibility_enabled()) {
if (!vr->is_ghosting_fix_enabled() && !vr->is_splitscreen_compatibility_enabled() && !vr->is_sceneview_compatibility_enabled()) {
return;
}

Expand Down Expand Up @@ -2547,7 +2547,7 @@ sdk::FSceneView* FFakeStereoRenderingHook::sceneview_constructor(sdk::FSceneView

const auto true_index = vr->is_using_afr() ? (g_frame_count + last_index) % 2 : last_index;

if (vr->is_splitscreen_compatibility_enabled()) {
if (vr->is_splitscreen_compatibility_enabled() || vr->is_sceneview_compatibility_enabled()) {
int32_t w = vr->get_hmd_width();
int32_t h = vr->get_hmd_height();

Expand Down

0 comments on commit 762d963

Please sign in to comment.