Add portable Windows build and update GC runtime
This commit is contained in:
@@ -17,6 +17,11 @@ target_link_libraries(openroller-desktop
|
||||
Vectorail::GCEffects
|
||||
)
|
||||
|
||||
if(MINGW AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_options(openroller-desktop PRIVATE
|
||||
-static -static-libgcc -static-libstdc++)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(openroller-desktop PRIVATE /W4)
|
||||
else()
|
||||
@@ -25,3 +30,27 @@ endif()
|
||||
|
||||
configure_file(openroller.cfg openroller.cfg COPYONLY)
|
||||
file(COPY shaders DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
add_custom_command(TARGET openroller-desktop POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/shaders"
|
||||
"$<TARGET_FILE_DIR:openroller-desktop>/shaders"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/openroller.cfg"
|
||||
"$<TARGET_FILE_DIR:openroller-desktop>/openroller.cfg"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
if(WIN32 AND TARGET SDL3::SDL3-shared)
|
||||
add_custom_command(TARGET openroller-desktop POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"$<TARGET_FILE:SDL3::SDL3-shared>"
|
||||
"$<TARGET_FILE_DIR:openroller-desktop>"
|
||||
VERBATIM
|
||||
)
|
||||
install(FILES "$<TARGET_FILE:SDL3::SDL3-shared>" DESTINATION .)
|
||||
endif()
|
||||
|
||||
install(TARGETS openroller-desktop RUNTIME DESTINATION .)
|
||||
install(DIRECTORY shaders DESTINATION .)
|
||||
install(FILES openroller.cfg DESTINATION .)
|
||||
|
||||
@@ -686,12 +686,12 @@ struct GcKeySample {
|
||||
float sampledTimeMs = 0.0f;
|
||||
};
|
||||
|
||||
bool gcLoopFlag(const gc::TransformPoint& key) { return key.tweenTowards; }
|
||||
bool gcLoopFlag(const gc::ObjectColorPoint& key) { return key.tweenTowards; }
|
||||
bool gcLoopFlag(const gc::VisibilityPoint& key) { return key.fadeOut; }
|
||||
bool gcInterpolateFlag(const gc::TransformPoint& key) { return key.tweenAway; }
|
||||
bool gcInterpolateFlag(const gc::ObjectColorPoint& key) { return key.tweenAway; }
|
||||
bool gcInterpolateFlag(const gc::VisibilityPoint& key) { return key.fadeIn; }
|
||||
bool gcLoopFlag(const gc::TransformPoint& key) { return key.repeat; }
|
||||
bool gcLoopFlag(const gc::ObjectColorPoint& key) { return key.repeat; }
|
||||
bool gcLoopFlag(const gc::VisibilityPoint& key) { return key.repeat; }
|
||||
bool gcInterpolateFlag(const gc::TransformPoint& key) { return key.interpolate; }
|
||||
bool gcInterpolateFlag(const gc::ObjectColorPoint& key) { return key.interpolate; }
|
||||
bool gcInterpolateFlag(const gc::VisibilityPoint& key) { return key.interpolate; }
|
||||
|
||||
// FUN_005e9100 is shared by all five object-animation channels. The first
|
||||
// flag marks a repeat block; the second enables interpolation to the next key.
|
||||
@@ -807,7 +807,7 @@ GcVisibilityState gcObjectVisibility(const gc::StageObject& object, float timeMs
|
||||
if (active + 1 < static_cast<int>(keys.size())) {
|
||||
const auto& next = keys[active + 1];
|
||||
const float untilNext = static_cast<float>(next.timeMs) - sample.sampledTimeMs;
|
||||
if (next.visible != visible && next.fadeIn &&
|
||||
if (next.visible != visible && next.interpolate &&
|
||||
untilNext >= 0.0f && untilNext < kGcVisibilityFadeMs) {
|
||||
const float remaining = std::clamp(untilNext / kGcVisibilityFadeMs, 0.0f, 1.0f);
|
||||
alpha = next.visible ? 1.0f - remaining : remaining;
|
||||
|
||||
Reference in New Issue
Block a user