Files
AC6_recomp/CMakeLists.txt
T
Dipshet 175480efb7 Fix aircraft acceleration/deceleration at high FPS
The flight model's longitudinal force/speed-command accumulator and the
accel/brake trigger command are stepped by fixed per-frame constants with no
delta, so with ac6_unlock_fps active the plane accelerates and brakes
proportionally faster at higher frame rates.

Wrap the two flight-model functions (rex_sub_823046A0 force step,
rex_sub_82329B40 input shaping) and rescale each accumulator's net per-call
change by frame_time / 33.3ms, reproducing the native 30fps continuous-time
dynamics at any frame rate. Bit-exact pass-through at <=30fps; applies to
player and AI aircraft. Gated by ac6_fps_physics_fix (default on) and only
active while the unlock's timing hooks are (ac6::TimingHooksActive).
2026-07-09 22:33:39 +03:00

69 lines
2.2 KiB
CMake

# ac6recomp - ReXGlue Recompiled Project
#
# This file is yours to edit. 'rexglue migrate' will NOT overwrite it.
# SDK boilerplate lives in generated/rexglue.cmake.
cmake_minimum_required(VERSION 3.25)
project(ac6recomp LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CheckIPOSupported)
check_ipo_supported(RESULT AC6RECOMP_IPO_SUPPORTED OUTPUT AC6RECOMP_IPO_ERROR)
# Keep reconfigure passes pinned to the vendored SDK when the cache is empty.
if(NOT DEFINED REXSDK_DIR OR REXSDK_DIR STREQUAL "")
set(_ac6_vendored_rexsdk "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/rexglue-sdk")
if(EXISTS "${_ac6_vendored_rexsdk}/CMakeLists.txt")
set(REXSDK_DIR "${_ac6_vendored_rexsdk}" CACHE PATH "Path to rexglue-sdk source tree" FORCE)
endif()
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generated/rexglue.cmake")
include(generated/rexglue.cmake)
else()
include(cmake/rexglue_bootstrap.cmake)
endif()
# Sources
set(AC6RECOMP_SOURCES
src/main.cpp
src/ac6_pac_decode_dump.cpp
src/ac6_pac_decoder_probe.cpp
src/ac6_pac_index.cpp
src/d3d_hooks.cpp
src/render_hooks.cpp
src/ac6_texture_overrides.cpp
src/ac6_native_graphics.cpp
src/ac6_native_graphics_overlay.cpp
src/ac6_backend_fixes/ac6_backend_capture_bridge.cpp
src/ac6_backend_fixes/ac6_backend_hooks.cpp
src/ac6_backend_fixes/ac6_backend_pass_classifier.cpp
src/ac6_backend_fixes/ac6_fps_physics_fix.cpp
)
if(WIN32)
add_executable(ac6recomp WIN32 ${AC6RECOMP_SOURCES})
else()
add_executable(ac6recomp ${AC6RECOMP_SOURCES})
endif()
rexglue_setup_target(ac6recomp)
# Link libmspack for AC6 PAC LZX decompression in the runtime dump path.
target_link_libraries(ac6recomp PRIVATE mspack)
if(AC6RECOMP_IPO_SUPPORTED)
set_property(TARGET ac6recomp PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set_property(TARGET ac6recomp PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
else()
message(STATUS "IPO/LTO disabled for ac6recomp: ${AC6RECOMP_IPO_ERROR}")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
target_compile_options(ac6recomp PRIVATE
$<$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>:-fomit-frame-pointer>
)
endif()