Icon culling hides car icons when zoomed out past a configurable threshold (default 40%), keeping only locomotive icons visible. Locos scale up automatically when culling is active (configurable boost). An option also hides MU trailing units. All managed by the new MapIconCuller class with smooth fade transitions. EOTD (End-of-Train Device): a blinking red dot at the rear of each consist. Shown by default when car icons are hidden. Dot size and visibility conditions are configurable. Implemented in EotdSystem as a programmatically generated circle texture to avoid asset dependencies. Added an Icons submenu to the gear menu containing all icon and EOTD settings. Controls grey out to reflect dependencies: culling sub-settings (MU hide, loco boost, EOTD) grey out when culling is off; EOTD dot size and hide-when-visible grey out when EOTD is off. Changes round-trip via UICmd events, persist to PopoutSettings, and call MapIconCuller.Refresh(). Native state is seeded from C# on window init via RRPOPOUT_SetIconCullingState. Settings completeness: added Right-click recenters toggle and Map BG opacity slider to the UMM settings panel (were only accessible from the gear menu). Replaced four FindObjectOfType<MapWindow> calls with PanelFinder.GetMapWindow(). Fixed AV false-positive on release zips: ImGui's built-in font blob contained the substring "UPX", matching the heuristic for UPX-packed binaries. Added IMGUI_DISABLE_DEFAULT_FONT to strip the blob; ProggyClean.ttf is now shipped as a separate file alongside the DLL and loaded at runtime instead.
77 lines
2.4 KiB
CMake
77 lines
2.4 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(S3Native CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Dear ImGui — fetched once at configure time, built as a static lib.
|
|
# Only the D3D11 backend is compiled; Win32 input is fed manually via atomics.
|
|
# ---------------------------------------------------------------------------
|
|
include(FetchContent)
|
|
FetchContent_Declare(
|
|
imgui
|
|
GIT_REPOSITORY https://github.com/ocornut/imgui.git
|
|
GIT_TAG v1.90.4
|
|
GIT_SHALLOW TRUE
|
|
)
|
|
FetchContent_MakeAvailable(imgui)
|
|
|
|
add_library(imgui STATIC
|
|
${imgui_SOURCE_DIR}/imgui.cpp
|
|
${imgui_SOURCE_DIR}/imgui_draw.cpp
|
|
${imgui_SOURCE_DIR}/imgui_tables.cpp
|
|
${imgui_SOURCE_DIR}/imgui_widgets.cpp
|
|
${imgui_SOURCE_DIR}/backends/imgui_impl_dx11.cpp
|
|
)
|
|
target_include_directories(imgui PUBLIC
|
|
${imgui_SOURCE_DIR}
|
|
${imgui_SOURCE_DIR}/backends
|
|
)
|
|
# imgui_impl_dx11.cpp calls D3DCompile at runtime to build its own shaders.
|
|
target_link_libraries(imgui PUBLIC d3d11 d3dcompiler)
|
|
|
|
# Remove the built-in ProggyClean base85 blob. That blob incidentally contains
|
|
# the 3-char string "UPX" which triggers AV false-positives on every release zip.
|
|
# We ship ProggyClean.ttf as a standalone file and load it at runtime instead.
|
|
target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_DEFAULT_FONT)
|
|
|
|
# Suppress MSVC warnings inside third-party ImGui source.
|
|
if(MSVC)
|
|
target_compile_options(imgui PRIVATE /W0)
|
|
endif()
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# S3Native native plugin DLL
|
|
# ---------------------------------------------------------------------------
|
|
add_library(S3Native SHARED
|
|
src/dllmain.cpp
|
|
src/exports.cpp
|
|
src/popout_windows.cpp
|
|
src/d3d11_renderer.cpp
|
|
)
|
|
|
|
target_include_directories(S3Native PRIVATE
|
|
include
|
|
external
|
|
)
|
|
|
|
target_link_libraries(S3Native PRIVATE
|
|
imgui
|
|
d3d11
|
|
dxgi
|
|
d3dcompiler
|
|
dwmapi # DwmSetWindowAttribute (dark title bar, rounded corners)
|
|
shell32 # ExtractIconExW (EXE icon loading)
|
|
)
|
|
|
|
set_target_properties(S3Native PROPERTIES
|
|
OUTPUT_NAME "S3Native"
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
)
|
|
|
|
if(MSVC)
|
|
target_compile_options(S3Native PRIVATE /W3 /WX- /GR- /EHsc)
|
|
target_compile_options(S3Native PRIVATE $<$<CONFIG:Release>:/Zi>)
|
|
target_link_options(S3Native PRIVATE $<$<CONFIG:Release>:/DEBUG /OPT:REF /OPT:ICF>)
|
|
endif()
|