Skip to content

Commit

Permalink
Merge branch 'praydog:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyhodge authored Mar 8, 2024
2 parents 9b9da12 + 04726bf commit 5e063b3
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 29 deletions.
46 changes: 23 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ endif()
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${utility_SOURCES})

target_compile_features(utility PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(utility PUBLIC
Expand Down Expand Up @@ -1214,7 +1214,7 @@ if(REF_BUILD_RE2_SDK OR REF_BUILD_FRAMEWORK) # build-re2-sdk
endif()

target_compile_features(RE2SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE2SDK PUBLIC
Expand Down Expand Up @@ -1932,7 +1932,7 @@ if(REF_BUILD_RE2_TDB66SDK OR REF_BUILD_FRAMEWORK) # build-re2tdb66-sdk
endif()

target_compile_features(RE2_TDB66SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE2_TDB66SDK PUBLIC
Expand Down Expand Up @@ -2094,7 +2094,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE2 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE2 PUBLIC
Expand Down Expand Up @@ -2291,7 +2291,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE2_TDB66 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE2_TDB66 PUBLIC
Expand Down Expand Up @@ -3045,7 +3045,7 @@ if(REF_BUILD_RE3_SDK OR REF_BUILD_FRAMEWORK) # build-re3-sdk
endif()

target_compile_features(RE3SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE3SDK PUBLIC
Expand Down Expand Up @@ -3763,7 +3763,7 @@ if(REF_BUILD_RE3_TDB67SDK OR REF_BUILD_FRAMEWORK) # build-re3tdb67-sdk
endif()

target_compile_features(RE3_TDB67SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE3_TDB67SDK PUBLIC
Expand Down Expand Up @@ -3925,7 +3925,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE3 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE3 PUBLIC
Expand Down Expand Up @@ -4122,7 +4122,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE3_TDB67 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE3_TDB67 PUBLIC
Expand Down Expand Up @@ -4319,7 +4319,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE4 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE4 PUBLIC
Expand Down Expand Up @@ -5073,7 +5073,7 @@ if(REF_BUILD_RE4_SDK OR REF_BUILD_FRAMEWORK) # build-re4-sdk
endif()

target_compile_features(RE4SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE4SDK PUBLIC
Expand Down Expand Up @@ -5793,7 +5793,7 @@ if(REF_BUILD_RE7_SDK OR REF_BUILD_FRAMEWORK) # build-re7-sdk
endif()

target_compile_features(RE7SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE7SDK PUBLIC
Expand Down Expand Up @@ -6511,7 +6511,7 @@ if(REF_BUILD_RE7_TDB49SDK OR REF_BUILD_FRAMEWORK) # build-re7tdb49-sdk
endif()

target_compile_features(RE7_TDB49SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE7_TDB49SDK PUBLIC
Expand Down Expand Up @@ -6673,7 +6673,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE7 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE7 PUBLIC
Expand Down Expand Up @@ -6870,7 +6870,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE7_TDB49 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE7_TDB49 PUBLIC
Expand Down Expand Up @@ -7624,7 +7624,7 @@ if(REF_BUILD_RE8_SDK OR REF_BUILD_FRAMEWORK) # build-re8-sdk
endif()

target_compile_features(RE8SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE8SDK PUBLIC
Expand Down Expand Up @@ -7787,7 +7787,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(RE8 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(RE8 PUBLIC
Expand Down Expand Up @@ -8541,7 +8541,7 @@ if(REF_BUILD_DMC5_SDK OR REF_BUILD_FRAMEWORK) # build-dmc5-sdk
endif()

target_compile_features(DMC5SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(DMC5SDK PUBLIC
Expand Down Expand Up @@ -8702,7 +8702,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(DMC5 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(DMC5 PUBLIC
Expand Down Expand Up @@ -9456,7 +9456,7 @@ if(REF_BUILD_MHRISE_SDK OR REF_BUILD_FRAMEWORK) # build-mhrise-sdk
endif()

target_compile_features(MHRISESDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(MHRISESDK PUBLIC
Expand Down Expand Up @@ -9619,7 +9619,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(MHRISE PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(MHRISE PUBLIC
Expand Down Expand Up @@ -10373,7 +10373,7 @@ if(REF_BUILD_SF6_SDK OR REF_BUILD_FRAMEWORK) # build-sf6-sdk
endif()

target_compile_features(SF6SDK PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(SF6SDK PUBLIC
Expand Down Expand Up @@ -10536,7 +10536,7 @@ if(REF_BUILD_FRAMEWORK AND CMAKE_SIZEOF_VOID_P EQUAL 8) # build-framework
endif()

target_compile_features(SF6 PUBLIC
cxx_std_20
cxx_std_23
)

target_compile_options(SF6 PUBLIC
Expand Down
6 changes: 3 additions & 3 deletions cmake.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ type = "static"
sources = ["shared/utility/**.cpp", "shared/utility/**.c"]
headers = ["shared/utility/**.hpp", "shared/utility/**.h"]
compile-options = ["/EHa"]
compile-features = ["cxx_std_20"]
compile-features = ["cxx_std_23"]
link-libraries = [
"spdlog",
"minhook",
Expand All @@ -189,7 +189,7 @@ sources = ["shared/sdk/**.cpp", "shared/sdk/**.c"]
headers = ["shared/sdk/**.hpp", "shared/sdk/**.h"]
include-directories = ["shared/", "include/"]
compile-options = ["/EHa"]
compile-features = ["cxx_std_20"]
compile-features = ["cxx_std_23"]
link-libraries = [
"glm_static",
"spdlog"
Expand All @@ -206,7 +206,7 @@ headers = ["src/**.hpp", "src/**.h"]
include-directories = ["shared/", "src/", "include/", "${OPENXR_SOURCE_DIR}/src"]
link-directories = ["dependencies/openvr/lib/win64/"]
compile-options = ["/GS-", "/bigobj", "/EHa"]
compile-features = ["cxx_std_20"]
compile-features = ["cxx_std_23"]
compile-definitions = ["${CMKR_TARGET}", "REFRAMEWORK_EXPORTS", "REFRAMEWORK_GAME_NAME=\"${CMKR_TARGET}\""]
developer-mode.compile-definitions = ["DEVELOPER"]
link-libraries = [
Expand Down
1 change: 1 addition & 0 deletions shared/sdk/REContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ namespace sdk {
if (*(uint32_t*)ptr == *(uint32_t*)"TDB") {
const auto version = *(uint32_t*)((uintptr_t)ptr + 4);

s_tdb_version = version;
s_type_db_offset = i;
s_static_tbl_offset = s_type_db_offset - 0x30; // hope this holds true for the older gameS!!!!!!!!!!!!!!!!!!!
spdlog::info("[VM::update_pointers] s_type_db_offset: {:x}", s_type_db_offset);
Expand Down
1 change: 1 addition & 0 deletions shared/sdk/REContext.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class VM : public regenny::via::clr::VM {
class VM {
#endif
public:
static inline uint32_t s_tdb_version{0};
static VM* get();

public:
Expand Down
10 changes: 9 additions & 1 deletion src/REFramework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1841,7 +1841,7 @@ bool REFramework::init_d3d12() {
// Create back buffer rtvs.
auto swapchain = m_d3d12_hook->get_swap_chain();

for (auto i = 0; i <= (int)D3D12::RTV::BACKBUFFER_3; ++i) {
for (auto i = 0; i <= (int)D3D12::RTV::BACKBUFFER_2; ++i) {
if (SUCCEEDED(swapchain->GetBuffer(i, IID_PPV_ARGS(&m_d3d12.rts[i])))) {
device->CreateRenderTargetView(m_d3d12.rts[i].Get(), nullptr, m_d3d12.get_cpu_rtv(device, (D3D12::RTV)i));
} else {
Expand Down Expand Up @@ -1924,6 +1924,14 @@ bool REFramework::init_d3d12() {
}

void REFramework::deinit_d3d12() {
for (auto& ctx : m_d3d12.cmd_ctxs) {
if (ctx != nullptr) {
ctx->reset();
}
}

m_d3d12.cmd_ctxs.clear();

for (auto userdata : m_d3d12.imgui_backend_datas) {
if (userdata != nullptr) {
ImGui::GetIO().BackendRendererUserData = userdata;
Expand Down
1 change: 0 additions & 1 deletion src/REFramework.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ class REFramework {
BACKBUFFER_0,
BACKBUFFER_1,
BACKBUFFER_2,
BACKBUFFER_3,
IMGUI,
BLANK,
COUNT,
Expand Down
6 changes: 5 additions & 1 deletion src/mods/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,11 @@ void Hooks::global_application_entry_hook_internal(void* entry, const char* name
return original(entry);
}

{
const auto should_allow_ignore = sdk::VM::s_tdb_version >= 73 ?
(hash != 0x76b8100bec7c12c3 && hash != 0x9f63c0fc4eea6626) :
true;

if (should_allow_ignore) {
std::shared_lock _{m_application_entry_data_mutex};

if (m_ignored_application_entries.contains(hash)) {
Expand Down

0 comments on commit 5e063b3

Please sign in to comment.