CI/CD, CMake improvements, more targets, fix gcc (#258)

* CI attempt

* syntax

* fix cmake for linux

* fix include directories and merge main

* fix PDB fighting

* fix gcc compiling

* fix SSCACHE for windows

* try and fix gcc

* more CI presets

* remove the android target for now

* bump cmake minimum to fix debug information format

* yet another attempt at fixing gcc

* yet another attempt at fixing gcc

* better CI matrixing

* yet another attempt at fixing GCC

* fix arm

* fix CI

* placeholder icons

* compile dawn from source for windows arm64

* fix icons and linker warnings

* fix cmake

* fetch libjpegturbo

---------

Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
qwertyquerty
2026-04-09 18:22:53 -07:00
committed by GitHub
parent 06ed3988c0
commit 3366c22e99
35 changed files with 2561 additions and 146 deletions
+206
View File
@@ -0,0 +1,206 @@
name: Build
on:
push:
paths-ignore:
- '*.md'
- '*LICENSE'
pull_request:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
jobs:
build-linux:
name: Build Linux (${{matrix.name}})
runs-on: ${{matrix.runner}}
strategy:
fail-fast: false
matrix:
include:
- name: GCC x86_64
runner: ubuntu-latest
preset: gcc
artifact_arch: x86_64
- name: GCC aarch64
runner: ubuntu-24.04-arm
preset: gcc
artifact_arch: aarch64
# - name: Clang x86_64
# runner: ubuntu-latest
# preset: clang
# artifact_arch: x86_64
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \
libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \
libxss-dev libfuse2
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure CMake
run: cmake --preset x-linux-ci-${{matrix.preset}}
- name: Build
run: cmake --build --preset x-linux-ci-${{matrix.preset}}
- name: Generate AppImage
run: ci/build-appimage.sh
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dusk-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
path: |
build/install/Dusk-*.AppImage
build/install/debug.tar.*
build-apple:
name: Build Apple (${{matrix.name}})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- name: AppleClang macOS universal
platform: macos
preset: x-macos-ci
artifact_name: macos-appleclang-universal
# - name: AppleClang iOS arm64 # TODO enable when CI is free
# platform: ios
# preset: x-ios-ci
# artifact_name: ios-appleclang-arm64
# - name: AppleClang tvOS arm64 # TODO enable when CI is free
# platform: tvos
# preset: x-tvos-ci
# artifact_name: tvos-appleclang-arm64
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Update Homebrew
if: matrix.platform == 'tvos'
run: |
brew update
brew upgrade --formula
- name: Install dependencies
run: brew install cmake ninja
- name: Install markupsafe
if: matrix.platform == 'tvos'
run: pip3 install --break-system-packages markupsafe
- name: Install Rust iOS target
if: matrix.platform == 'ios'
run: rustup target add aarch64-apple-ios
- name: Install Rust tvOS target
if: matrix.platform == 'tvos'
run: |
rustup toolchain install nightly
rustup target add --toolchain nightly aarch64-apple-tvos
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure CMake
run: cmake --preset ${{matrix.preset}}
- name: Build
run: cmake --build --preset ${{matrix.preset}}
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dusk-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
path: |
build/install/Dusk.app
build/install/debug.tar.*
build-windows:
name: Build Windows (${{matrix.name}})
runs-on: ${{matrix.runner}}
env:
BUILD_DIR: C:\build
SCCACHE_DIR: C:\sccache
strategy:
fail-fast: false
matrix:
include:
- name: MSVC x86_64
runner: windows-latest
preset: msvc
msvc_arch: amd64
vcpkg_arch: x64
artifact_arch: x86_64
- name: MSVC arm64
runner: windows-11-arm
preset: arm64-msvc
msvc_arch: arm64
vcpkg_arch: arm64
artifact_arch: arm64
# - name: Clang x86_64
# runner: windows-latest
# preset: clang
# msvc_arch: amd64
# vcpkg_arch: x64
# artifact_arch: x86_64
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Enable Visual Studio environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.msvc_arch}}
# msvc-dev-cmd sets VCPKG_ROOT, set it back
- name: Override VCPKG_ROOT
run: echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Install dependencies
run: |
choco install ninja
vcpkg install zlib:${{matrix.vcpkg_arch}}-windows-static bzip2:${{matrix.vcpkg_arch}}-windows-static `
zstd:${{matrix.vcpkg_arch}}-windows-static liblzma:${{matrix.vcpkg_arch}}-windows-static `
freetype:${{matrix.vcpkg_arch}}-windows-static
- name: Configure CMake
run: cmake --preset x-windows-ci-${{matrix.preset}}
- name: Build
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: dusk-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
path: |
${{env.BUILD_DIR}}/install/*.exe
${{env.BUILD_DIR}}/install/debug.7z
+256 -40
View File
@@ -1,14 +1,86 @@
cmake_minimum_required(VERSION 3.16)
if (APPLE)
project(dusk LANGUAGES C CXX OBJC OBJCXX)
else ()
project(dusk LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.25)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
endif ()
# obtain revision info from git
find_package(Git)
if (GIT_FOUND)
# make sure version information gets re-run when the current Git HEAD changes
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
OUTPUT_VARIABLE dusk_git_head_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
OUTPUT_VARIABLE dusk_git_head_symbolic
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
# defines DUSK_WC_REVISION
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE DUSK_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DESCRIBE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove the git hash, then collapse a clean "-0" suffix only
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
# defines DUSK_WC_BRANCH
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE DUSK_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DATE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
OUTPUT_VARIABLE DUSK_WC_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
message(STATUS "Unable to find git, commit information will not be available")
endif ()
if (DUSK_WC_DESCRIBE)
string(REGEX REPLACE "v([0-9]+)\.([0-9]+)\.([0-9]+)\-([0-9]+).*" "\\1.\\2.\\3.\\4" DUSK_VERSION_STRING "${DUSK_WC_DESCRIBE}")
string(REGEX REPLACE "v([0-9]+)\.([0-9]+)\.([0-9]+).*" "\\1.\\2.\\3" DUSK_SHORT_VERSION_STRING "${DUSK_WC_DESCRIBE}")
else ()
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
set(DUSK_VERSION_STRING "0.0.0")
endif ()
# Add version information to CI environment variables
if(DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
endif()
message(STATUS "Dusk version set to ${DUSK_WC_DESCRIBE}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
project(dusk LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
# ios.toolchain.cmake hack for SDL
set(TVOS ON)
set(IOS OFF)
endif ()
if(APPLE AND NOT CMAKE_OSX_SYSROOT)
# If the Xcode SDK is lagging behind system version, CMake needs this done first
execute_process(COMMAND xcrun --sdk macosx --show-sdk-path
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE)
@@ -19,15 +91,46 @@ add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
add_subdirectory(libs/freeverb)
option(DUSK_BUILD_WARNINGS "If off, compiler warnings will be suppressed")
option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)")
option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.")
option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON)
find_package(libjpeg-turbo)
set(DUSK_MOVIE_SUPPORT_REAL ${DUSK_MOVIE_SUPPORT})
if (DUSK_MOVIE_SUPPORT AND NOT libjpeg-turbo_FOUND)
message(WARNING "libjpeg-turbo not found but DUSK_MOVIE_SUPPORT set, movie playback will not be available!")
set(DUSK_MOVIE_SUPPORT_REAL OFF)
if (DUSK_MOVIE_SUPPORT)
find_package(libjpeg-turbo QUIET)
if (libjpeg-turbo_FOUND)
message(STATUS "dusk: Using system libjpeg-turbo")
else ()
message(STATUS "dusk: Fetching libjpeg-turbo")
include(ExternalProject)
set(_jpeg_install_dir ${CMAKE_BINARY_DIR}/libjpeg-turbo-install)
if (WIN32)
set(_jpeg_lib ${_jpeg_install_dir}/lib/turbojpeg-static.lib)
else ()
set(_jpeg_lib ${_jpeg_install_dir}/lib/libturbojpeg.a)
endif ()
ExternalProject_Add(libjpeg-turbo-ext
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.1.0.tar.gz
URL_HASH SHA256=35fec2e1ddfb05ecf6d93e50bc57c1e54bc81c16d611ddf6eff73fff266d8285
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}
-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}
-DENABLE_SHARED=OFF
-DWITH_TURBOJPEG=ON
-DWITH_JAVA=OFF
BUILD_BYPRODUCTS ${_jpeg_lib}
)
file(MAKE_DIRECTORY ${_jpeg_install_dir}/include)
add_library(libjpeg-turbo::turbojpeg-static STATIC IMPORTED GLOBAL)
set_target_properties(libjpeg-turbo::turbojpeg-static PROPERTIES
IMPORTED_LOCATION ${_jpeg_lib}
INTERFACE_INCLUDE_DIRECTORIES ${_jpeg_install_dir}/include
)
add_dependencies(libjpeg-turbo::turbojpeg-static libjpeg-turbo-ext)
endif ()
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
@@ -48,6 +151,8 @@ elseif (MSVC)
add_compile_options(/bigobj)
add_compile_options(/Zc:strictStrings-)
add_compile_options(/MP)
add_compile_options(/FS)
if (NOT DUSK_BUILD_WARNINGS)
add_compile_options(/W0)
else ()
@@ -63,33 +168,34 @@ endif ()
include(FetchContent)
# Declare all dependencies first so CMake can download them in parallel
message(STATUS "dusk: Fetching cxxopts")
FetchContent_Declare(
cxxopts
GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
GIT_TAG v3.3.1
FetchContent_Declare(cxxopts
URL https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.3.1.tar.gz
URL_HASH SHA256=3bfc70542c521d4b55a46429d808178916a579b28d048bd8c727ee76c39e2072
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(cxxopts)
message(STATUS "dusk: Fetching nlohmann/json")
FetchContent_Declare(json
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(json)
FetchContent_MakeAvailable(cxxopts json)
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
include(files.cmake)
# TODO: version handling for res includes
set(DUSK_BUNDLE_NAME Dusk)
set(DUSK_BUNDLE_IDENTIFIER dev.decomp.dusk)
set(DUSK_GAME_NAME "GZ2E")
set(DUSK_GAME_VERSION "01")
set(DUSK_TP_VERSION ${DUSK_GAME_NAME}${DUSK_GAME_VERSION})
message(STATUS "dusk: Game Name: ${DUSK_GAME_NAME}")
message(STATUS "dusk: Game Version: ${DUSK_GAME_VERSION}")
message(STATUS "dusk: TP Version: ${DUSK_TP_VERSION}")
message(STATUS "dusk: Game Version: ${DUSK_TP_VERSION}")
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${JSYSTEM_DEBUG_FILES} ${REL_FILES})
source_group("dusk" FILES ${DUSK_FILES})
@@ -104,20 +210,15 @@ set(GAME_INCLUDE_DIRS
libs/JSystem/include
libs
extern/aurora/include/dolphin
extern)
extern
${CMAKE_BINARY_DIR})
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient)
if (DUSK_MOVIE_SUPPORT_REAL)
if (TARGET libjpeg-turbo::turbojpeg-static)
message(STATUS "dusk: Linking against libjpeg-turbo static library")
list(APPEND GAME_LIBS "libjpeg-turbo::turbojpeg-static")
else ()
message(STATUS "dusk: Linking against libjpeg-turbo shared library")
list(APPEND GAME_LIBS "libjpeg-turbo::turbojpeg")
endif ()
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
if (DUSK_MOVIE_SUPPORT)
list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static)
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
endif ()
# game_debug is for game code files that we know work when compiled with DEBUG=1
@@ -125,17 +226,13 @@ endif ()
add_library(game_debug OBJECT ${JSYSTEM_DEBUG_FILES} ${SSYSTEM_FILES}
src/dusk/audio/DuskAudioSystem.cpp
src/dusk/audio/JASCriticalSection.cpp
src/dusk/audio/DuskDsp.hpp
src/dusk/audio/DuskDsp.cpp
src/dusk/audio/Adpcm.cpp
src/dusk/audio/Adpcm.hpp
src/dusk/audio/DspStub.cpp)
src/dusk/audio/DspStub.cpp
src/dusk/imgui/ImGuiAudio.cpp)
# game_base is for all other game code files
add_library(game_base OBJECT ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES}
${DOLPHIN_FILES}
src/dusk/imgui/ImGuiStubLog.cpp
src/dusk/imgui/ImGuiAudio.cpp)
add_library(game_base OBJECT ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES})
target_compile_definitions(game_debug PRIVATE ${GAME_COMPILE_DEFS} $<$<CONFIG:Debug>:DEBUG=1> $<$<CONFIG:Debug>:PARTIAL_DEBUG=1>)
target_compile_definitions(game_base PRIVATE ${GAME_COMPILE_DEFS} NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0 $<$<CONFIG:Debug>:PARTIAL_DEBUG=1>)
@@ -160,7 +257,7 @@ target_link_libraries(game PUBLIC ${GAME_LIBS})
add_executable(dusk src/dusk/main.cpp)
target_compile_definitions(dusk PRIVATE TARGET_PC AVOID_UB=1 VERSION=0)
target_include_directories(dusk PRIVATE include)
target_link_libraries(dusk PRIVATE game aurora::main freeverb)
target_link_libraries(dusk PRIVATE game aurora::main)
add_custom_command(TARGET dusk POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
@@ -169,6 +266,49 @@ add_custom_command(TARGET dusk POST_BUILD
COMMENT "Copying resources"
)
if (APPLE)
if (IOS)
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
file(GLOB_RECURSE DUSK_RESOURCE_FILES "${DUSK_RESOURCE_DIR}/Base.lproj/*")
endif ()
if (IOS OR TVOS)
target_sources(dusk PRIVATE ${DUSK_RESOURCE_FILES})
foreach (FILE ${DUSK_RESOURCE_FILES})
file(RELATIVE_PATH NEW_FILE "${DUSK_RESOURCE_DIR}" ${FILE})
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}")
endforeach ()
set_target_properties(
dusk PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING}
OUTPUT_NAME dusk
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
)
if (CMAKE_GENERATOR STREQUAL "Xcode")
set_target_properties(dusk PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST})
elseif (DEFINED DUSK_INFO_PLIST)
set(MACOSX_BUNDLE_EXECUTABLE_NAME dusk)
set(MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER})
set(MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME})
set(MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING})
set(DUSK_GENERATED_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/dusk.Info.plist)
configure_file(${DUSK_INFO_PLIST} ${DUSK_GENERATED_INFO_PLIST})
add_custom_command(
TARGET dusk POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DUSK_GENERATED_INFO_PLIST} $<TARGET_FILE_DIR:dusk>/Info.plist
VERBATIM
)
endif ()
endif ()
endif ()
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
aurora_copy_runtime_dlls(dusk)
@@ -183,3 +323,79 @@ if (DUSK_SELECTED_OPT)
target_compile_options(aurora_gx PRIVATE ${_opt_flags})
target_compile_options(freeverb PRIVATE ${_opt_flags})
endif ()
# Packaging logic
function(get_target_output_name target result_var)
get_target_property(output_name ${target} OUTPUT_NAME)
if (NOT output_name)
set(${result_var} "${target}" PARENT_SCOPE)
else ()
set(${result_var} "${output_name}" PARENT_SCOPE)
endif ()
endfunction()
function(get_target_prefix target result_var)
set(${result_var} "" PARENT_SCOPE)
if (APPLE)
# Have to recreate some bundle logic here, since CMake can't tell us
get_target_property(is_bundle ${target} MACOSX_BUNDLE)
if (is_bundle)
get_target_output_name(${target} output_name)
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(${result_var} "${output_name}.app/Contents/MacOS/" PARENT_SCOPE)
else ()
set(${result_var} "${output_name}.app/" PARENT_SCOPE)
endif ()
endif ()
endif ()
endfunction()
list(APPEND BINARY_TARGETS dusk)
set(EXTRA_TARGETS "")
if (TARGET crashpad_handler)
list(APPEND EXTRA_TARGETS crashpad_handler)
endif ()
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
set(DEBUG_FILES_LIST "")
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
get_target_output_name(${target} output_name)
if (WIN32)
install(FILES $<TARGET_PDB_FILE:${target}> DESTINATION ${CMAKE_INSTALL_PREFIX} OPTIONAL)
elseif (APPLE)
get_target_prefix(${target} target_prefix)
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND rm -fr \"$<TARGET_FILE_NAME:${target}>.dSYM\")")
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND dsymutil \"${target_prefix}$<TARGET_FILE_NAME:${target}>\")")
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND strip -S \"${target_prefix}$<TARGET_FILE_NAME:${target}>\")")
if (NOT target_prefix STREQUAL "")
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND mv \"${target_prefix}$<TARGET_FILE_NAME:${target}>.dSYM\" .)")
endif ()
elseif (UNIX)
get_target_prefix(${target} target_prefix)
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND objcopy --only-keep-debug \"${target_prefix}$<TARGET_FILE_NAME:${target}>\" \"${target_prefix}$<TARGET_FILE_NAME:${target}>.dbg\")")
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND objcopy --strip-debug --add-gnu-debuglink=$<TARGET_FILE_NAME:${target}>.dbg \"${target_prefix}$<TARGET_FILE_NAME:${target}>\")")
endif ()
list(APPEND DEBUG_FILES_LIST "${output_name}")
endforeach ()
if (WIN32)
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND 7z a -t7z \"${CMAKE_INSTALL_PREFIX}/debug.7z\" ${DEBUG_FILES})")
elseif (APPLE)
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar acfv \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
elseif (UNIX)
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dbg")
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar -I \"xz -9 -T0\" -cvf \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
endif ()
endif ()
foreach (target IN LISTS BINARY_TARGETS)
get_target_prefix(${target} target_prefix)
foreach (extra_target IN LISTS EXTRA_TARGETS)
get_target_prefix(${extra_target} extra_prefix)
if (NOT "${target_prefix}" STREQUAL "${extra_prefix}")
# Copy extra target to target prefix
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND cp \"${extra_prefix}$<TARGET_FILE_NAME:${extra_target}>\" \"${target_prefix}$<TARGET_FILE_NAME:${extra_target}>\")")
endif ()
endforeach ()
endforeach ()
+603
View File
@@ -0,0 +1,603 @@
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "debug",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDebugDLL"
}
},
{
"name": "relwithdebinfo",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded"
}
},
{
"name": "linux-default",
"displayName": "Linux (default)",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Linux"
]
},
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"
}
}
},
{
"name": "linux-default-debug",
"displayName": "Linux (default) Debug",
"inherits": [
"debug",
"linux-default"
]
},
{
"name": "linux-default-relwithdebinfo",
"displayName": "Linux (default) RelWithDebInfo",
"inherits": [
"relwithdebinfo",
"linux-default"
]
},
{
"name": "linux-clang",
"displayName": "Linux (Clang)",
"inherits": [
"linux-default"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
},
{
"name": "linux-clang-debug",
"displayName": "Linux (Clang) Debug",
"inherits": [
"debug",
"linux-clang"
]
},
{
"name": "linux-clang-relwithdebinfo",
"displayName": "Linux (Clang) RelWithDebInfo",
"inherits": [
"relwithdebinfo",
"linux-clang"
]
},
{
"name": "windows-msvc",
"displayName": "Windows (MSVC)",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "windows-msvc-debug",
"displayName": "Windows (MSVC) Debug",
"inherits": [
"debug",
"windows-msvc"
]
},
{
"name": "windows-msvc-relwithdebinfo",
"displayName": "Windows (MSVC) RelWithDebInfo",
"inherits": [
"relwithdebinfo",
"windows-msvc"
]
},
{
"name": "windows-arm64-msvc",
"displayName": "Windows ARM64 (MSVC)",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"architecture": {
"value": "arm64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install",
"AURORA_DAWN_PROVIDER": "vendor"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"Windows"
]
}
}
},
{
"name": "windows-clang",
"displayName": "Windows (Clang)",
"inherits": [
"windows-msvc"
],
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl",
"CMAKE_LINKER": "lld-link"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "windows-clang-x64"
}
}
},
{
"name": "windows-clang-debug",
"displayName": "Windows (Clang) Debug",
"inherits": [
"debug",
"windows-clang"
]
},
{
"name": "windows-clang-relwithdebinfo",
"displayName": "Windows (Clang) RelWithDebInfo",
"inherits": [
"relwithdebinfo",
"windows-clang"
]
},
{
"name": "macos-default",
"displayName": "macOS (default)",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"macOS"
]
}
}
},
{
"name": "macos-default-debug",
"displayName": "macOS (default) Debug",
"inherits": [
"debug",
"macos-default"
]
},
{
"name": "macos-default-relwithdebinfo",
"displayName": "macOS (default) RelWithDebInfo",
"inherits": [
"relwithdebinfo",
"macos-default"
]
},
{
"name": "ios-default",
"displayName": "iOS",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": [
"relwithdebinfo"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "ios.toolchain.cmake",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
"PLATFORM": "OS64",
"DEPLOYMENT_TARGET": "14.0",
"ENABLE_BITCODE": {
"type": "BOOL",
"value": false
},
"ENABLE_ARC": {
"type": "BOOL",
"value": false
},
"Rust_CARGO_TARGET": "aarch64-apple-ios",
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": false
},
"CMAKE_DISABLE_FIND_PACKAGE_BZip2": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_LibLZMA": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_zstd": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_Freetype": {
"type": "BOOL",
"value": true
}
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"macOS"
]
}
}
},
{
"name": "tvos-default",
"displayName": "tvOS",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": [
"relwithdebinfo"
],
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "ios.toolchain.cmake",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
"PLATFORM": "TVOS",
"DEPLOYMENT_TARGET": "14.5",
"ENABLE_BITCODE": {
"type": "BOOL",
"value": false
},
"Rust_CARGO_TARGET": "aarch64-apple-tvos",
"Rust_TOOLCHAIN": "nightly",
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": false
},
"CMAKE_DISABLE_FIND_PACKAGE_BZip2": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_LibLZMA": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_zstd": {
"type": "BOOL",
"value": true
}
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [
"macOS"
]
}
}
},
{
"name": "android-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"inherits": [
"relwithdebinfo"
],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
"CMAKE_TOOLCHAIN_FILE": "$env{ANDROID_HOME}/ndk/$env{ANDROID_NDK_VERSION}/build/cmake/android.toolchain.cmake",
"ANDROID_PLATFORM": "android-24"
}
},
{
"name": "android-arm64",
"displayName": "Android (arm64-v8a)",
"inherits": [
"android-base"
],
"cacheVariables": {
"ANDROID_ABI": "arm64-v8a"
}
},
{
"name": "android-x86_64",
"displayName": "Android (x86_64)",
"inherits": [
"android-base"
],
"cacheVariables": {
"ANDROID_ABI": "x86_64"
}
},
{
"name": "x-linux-ci",
"hidden": true,
"inherits": [
"relwithdebinfo"
],
"cacheVariables": {
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
}
},
{
"name": "x-linux-ci-gcc",
"inherits": [
"x-linux-ci",
"linux-default"
]
},
{
"name": "x-linux-ci-clang",
"inherits": [
"x-linux-ci",
"linux-clang"
]
},
{
"name": "x-macos-ci",
"inherits": [
"macos-default-relwithdebinfo"
],
"cacheVariables": {
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
}
},
{
"name": "x-ios-ci",
"inherits": [
"ios-default"
],
"cacheVariables": {
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
}
},
{
"name": "x-tvos-ci",
"inherits": [
"tvos-default"
],
"cacheVariables": {
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
}
},
{
"name": "x-windows-ci",
"hidden": true,
"inherits": [
"relwithdebinfo"
],
"binaryDir": "$env{BUILD_DIR}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "$env{BUILD_DIR}/install",
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded"
}
},
{
"name": "x-windows-ci-msvc",
"inherits": [
"x-windows-ci",
"windows-msvc"
]
},
{
"name": "x-windows-ci-clang",
"inherits": [
"x-windows-ci",
"windows-clang"
]
},
{
"name": "x-windows-ci-arm64-msvc",
"inherits": [
"x-windows-ci",
"windows-arm64-msvc"
]
}
],
"buildPresets": [
{
"name": "linux-default-debug",
"configurePreset": "linux-default-debug",
"description": "Linux (default) debug build",
"displayName": "Linux (default) Debug"
},
{
"name": "linux-default-relwithdebinfo",
"configurePreset": "linux-default-relwithdebinfo",
"description": "Linux (default) release build with debug info",
"displayName": "Linux (default) RelWithDebInfo"
},
{
"name": "linux-clang-debug",
"configurePreset": "linux-clang-debug",
"description": "Linux (Clang) debug build",
"displayName": "Linux (Clang) Debug"
},
{
"name": "linux-clang-relwithdebinfo",
"configurePreset": "linux-clang-relwithdebinfo",
"description": "Linux (Clang) release build with debug info",
"displayName": "Linux (Clang) RelWithDebInfo"
},
{
"name": "macos-default-debug",
"configurePreset": "macos-default-debug",
"description": "macOS debug build",
"displayName": "macOS Debug"
},
{
"name": "macos-default-relwithdebinfo",
"configurePreset": "macos-default-relwithdebinfo",
"description": "macOS release build with debug info",
"displayName": "macOS RelWithDebInfo"
},
{
"name": "ios-default",
"configurePreset": "ios-default",
"description": "iOS release build with debug info",
"displayName": "iOS RelWithDebInfo",
"targets": [
"dusk"
]
},
{
"name": "tvos-default",
"configurePreset": "tvos-default",
"description": "tvOS release build with debug info",
"displayName": "tvOS RelWithDebInfo",
"targets": [
"dusk"
]
},
{
"name": "android-arm64",
"configurePreset": "android-arm64",
"description": "Android arm64-v8a release build with debug info",
"displayName": "Android arm64-v8a RelWithDebInfo",
"targets": [
"dusk"
]
},
{
"name": "android-x86_64",
"configurePreset": "android-x86_64",
"description": "Android x86_64 release build with debug info",
"displayName": "Android x86_64 RelWithDebInfo",
"targets": [
"dusk"
]
},
{
"name": "windows-msvc-debug",
"configurePreset": "windows-msvc-debug",
"description": "Windows (MSVC) debug build",
"displayName": "Windows (MSVC) Debug"
},
{
"name": "windows-msvc-relwithdebinfo",
"configurePreset": "windows-msvc-relwithdebinfo",
"description": "Windows (MSVC) release build with debug info",
"displayName": "Windows (MSVC) RelWithDebInfo"
},
{
"name": "windows-clang-debug",
"configurePreset": "windows-clang-debug",
"description": "Windows (Clang) debug build",
"displayName": "Windows (Clang) Debug"
},
{
"name": "windows-clang-relwithdebinfo",
"configurePreset": "windows-clang-relwithdebinfo",
"description": "Windows (Clang) release build with debug info",
"displayName": "Windows (Clang) RelWithDebInfo"
},
{
"name": "x-linux-ci-gcc",
"configurePreset": "x-linux-ci-gcc",
"description": "(Internal) Linux CI GCC",
"displayName": "(Internal) Linux CI GCC",
"targets": [
"install"
]
},
{
"name": "x-linux-ci-clang",
"configurePreset": "x-linux-ci-clang",
"description": "(Internal) Linux CI Clang",
"displayName": "(Internal) Linux CI Clang",
"targets": [
"install"
]
},
{
"name": "x-macos-ci",
"configurePreset": "x-macos-ci",
"description": "(Internal) macOS CI",
"displayName": "(Internal) macOS CI",
"targets": [
"install"
]
},
{
"name": "x-ios-ci",
"configurePreset": "x-ios-ci",
"description": "(Internal) iOS CI",
"displayName": "(Internal) iOS CI",
"targets": [
"install"
]
},
{
"name": "x-tvos-ci",
"configurePreset": "x-tvos-ci",
"description": "(Internal) tvOS CI",
"displayName": "(Internal) tvOS CI",
"targets": [
"install"
]
},
{
"name": "x-windows-ci-msvc",
"configurePreset": "x-windows-ci-msvc",
"description": "(Internal) Windows CI MSVC",
"displayName": "(Internal) Windows CI MSVC",
"targets": [
"install"
]
},
{
"name": "x-windows-ci-clang",
"configurePreset": "x-windows-ci-clang",
"description": "(Internal) Windows CI Clang",
"displayName": "(Internal) Windows CI Clang",
"targets": [
"install"
]
},
{
"name": "x-windows-ci-arm64-msvc",
"configurePreset": "x-windows-ci-arm64-msvc",
"description": "(Internal) Windows CI MSVC arm64",
"displayName": "(Internal) Windows CI MSVC arm64",
"targets": [
"install"
]
}
]
}
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash -ex
shopt -s extglob
# Get linuxdeploy
cd "$RUNNER_WORKSPACE"
curl -fOL https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$(uname -m).AppImage
chmod +x linuxdeploy-$(uname -m).AppImage
# Build AppImage
cd "$GITHUB_WORKSPACE"
mkdir -p build/appdir/usr/{bin,share/{applications,icons/hicolor}}
cp build/install/!(*.*) build/appdir/usr/bin
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
cp platforms/freedesktop/dusk.desktop build/appdir/usr/share/applications
cd build/install
VERSION="$DUSK_VERSION" NO_STRIP=1 "$RUNNER_WORKSPACE"/linuxdeploy-$(uname -m).AppImage \
--appdir "$GITHUB_WORKSPACE"/build/appdir --output appimage
+1 -1
View File
@@ -165,7 +165,7 @@ public:
* @param arg Arguments to forward to construct the default value.
*/
template <typename... Args>
explicit ConfigVar(const char* name, Args&&... arg)
ConfigVar(const char* name, Args&&... arg)
: ConfigVarBase(name, GetConfigImpl<T>()), defaultValue(std::forward<Args>(arg)...),
value(), overrideValue() {}
+6 -1
View File
@@ -14,6 +14,7 @@
#endif
#include <Windows.h>
#include <shellapi.h>
#include <intrin.h>
#endif
#include "dusk/logging.h"
@@ -92,7 +93,11 @@ private:
}
do {
QueryPerformanceCounter(&current);
_mm_pause(); // Yield CPU
#if defined(_M_ARM64) || defined(_M_ARM)
__yield();
#else
_mm_pause();
#endif
} while (current.QuadPart - start.QuadPart < ticksToWait);
}
#else
+1 -4
View File
@@ -194,15 +194,12 @@ static const float INF = 2000000000.0f;
#endif
// potential fakematch?
#if DEBUG
#define FABSF fabsf
#else
#define FABSF std::fabsf
#endif
#ifndef __MWERKS__
#if __cplusplus
#include <cmath>
#include <math.h>
using std::isnan;
#endif
#endif
+1177
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -8,7 +8,7 @@ namespace {
template <typename T>
class TPRIsEqual_pointer_ {
public:
TPRIsEqual_pointer_<T>(const T* p) { this->p_ = p; }
TPRIsEqual_pointer_(const T* p) { this->p_ = p; }
bool operator()(const T& rSrc) const { return &rSrc == this->p_; }
@@ -19,7 +19,7 @@ namespace nw4hbm {
inline f32 TanFIdx(f32 fidx) {
// They were just like "Ah fuck it we already got too many tables" haha lol
return std::tanf(fidx * convert::FIdx2Rad);
return tanf(fidx * convert::FIdx2Rad);
}
inline f32 CosRad(f32 rad) {
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 761 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

+9
View File
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Dusk
GenericName=Dusk
Comment=The Legend of Zelda: Twilight Princess
Exec=dusk
Icon=dusk
Terminal=false
Type=Application
Categories=Graphics;3DGraphics;Game
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en-US</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleDisplayName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon60x60</string>
<string>AppIcon76x76</string>
</array>
<key>CFBundleIconName</key>
<string>AppIcon</string>
</dict>
</dict>
<key>MinimumOSVersion</key>
<string>${DEPLOYMENT_TARGET}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.adventure-games</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDarkContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
</dict>
</plist>
+30
View File
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en-US</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>mainicon.icns</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleDisplayName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
+49
View File
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en-US</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleDisplayName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>AppleTVOS</string>
</array>
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<string>App Icon</string>
</dict>
<key>MinimumOSVersion</key>
<string>${DEPLOYMENT_TARGET}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.adventure-games</string>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIUserInterfaceStyle</key>
<string>Automatic</string>
</dict>
</plist>
+42 -42
View File
@@ -1444,11 +1444,11 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(240.0f, 274.0f, 2075.0f);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
}
spFC.set(0.0f, 0.0f, 1700.0f);
@@ -1478,16 +1478,16 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamCenterTarget.set(76.0f, 204.0f, 1782.0f);
i_this->mDemoCamEyeTarget.set(-41.0f, 261.0f, 2095.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
i_this->mDemoMode = 12;
@@ -1584,16 +1584,16 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamCenterTarget.set(0.0f, 278.0f, 1252.0f);
i_this->mDemoCamEyeTarget.set(0.0f, 86.0f, 2167.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
i_this->mDemoMode = 14;
@@ -1741,16 +1741,16 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamCenterTarget.set(-2243.0f, 1340.0f, 977.0f);
i_this->mDemoCamEyeTarget.set(-1226.0f, 980.0f, 1350.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
i_this->mDemoMode = 34;
@@ -1814,9 +1814,9 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEye.set(95.0f, 50.0f, 2800.0f);
i_this->mDemoCamEyeTarget.set(72.0f, 52.0f, 2153.0f);
i_this->field_0x127c.x = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x127c.x = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.set(0.0f, 0.0f, 0.0f);
i_this->field_0x129c = 0.0f;
@@ -1973,18 +1973,18 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(1214.0f, 350.0f, 2696.0f);
i_this->field_0x127c.x =
std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y =
std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z =
std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x129c = 0.0f;
} else if (i_this->mDemoModeTimer < 140) {
@@ -1993,18 +1993,18 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(23.0f, 108.0f, 2155.0f);
i_this->field_0x127c.x =
std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y =
std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z =
std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
}
cam_3d_morf(i_this, 0.1f);
@@ -2042,18 +2042,18 @@ static void demo_camera(b_bq_class* i_this) {
i_this->mDemoCamEyeTarget.set(953.0f, 997.0f, -36.0f);
i_this->field_0x127c.x =
std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x127c.y =
std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x127c.z =
std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x1288.x =
std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x1288.y =
std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x1288.z =
std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
cXyz pos(0.0f, 0.0f, 0.0f);
for (int i = 0; i < 5; i++) {
+18 -18
View File
@@ -2462,12 +2462,12 @@ static void demo_camera(b_ob_class* i_this) {
i_this->mDemoCamCenterTarget.set(80.0f, -24093.0f, 160.0f);
i_this->mDemoCamEyeTarget.set(-447.0f, -22850.0f, -718.0f);
i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cb4 = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cd0 = 0.0f;
daPy_getPlayerActorClass()->changeDemoMode(0x17, 0, 0, 0);
@@ -2590,12 +2590,12 @@ static void demo_camera(b_ob_class* i_this) {
i_this->mDemoCamCenterTarget.set(-6378.0f, -21886.0f, 7150.0f);
i_this->mDemoCamEyeTarget.set(-6961.0f, -21727.0f, 7278.0f);
i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cb4 = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cd0 = 0.0f;
i_this->mDemoAction = 46;
@@ -2656,12 +2656,12 @@ static void demo_camera(b_ob_class* i_this) {
i_this->mDemoCamCenterTarget.set(-2933.0f, -22626.0f, 6829.0f);
i_this->mDemoCamEyeTarget.set(-3295.0f, -22459.0f, 7307.0f);
i_this->field_0x5cb4 = std::fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = std::fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = std::fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = std::fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = std::fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = std::fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cb4 = fabsf(i_this->mDemoCamEyeTarget.x - i_this->mDemoCamEye.x);
i_this->field_0x5cb8 = fabsf(i_this->mDemoCamEyeTarget.y - i_this->mDemoCamEye.y);
i_this->field_0x5cbc = fabsf(i_this->mDemoCamEyeTarget.z - i_this->mDemoCamEye.z);
i_this->field_0x5cc0 = fabsf(i_this->mDemoCamCenterTarget.x - i_this->mDemoCamCenter.x);
i_this->field_0x5cc4 = fabsf(i_this->mDemoCamCenterTarget.y - i_this->mDemoCamCenter.y);
i_this->field_0x5cc8 = fabsf(i_this->mDemoCamCenterTarget.z - i_this->mDemoCamCenter.z);
i_this->field_0x5cd0 = 0.0f;
i_this->mDemoAction = 48;
+1 -1
View File
@@ -516,7 +516,7 @@ void daE_YMB_c::checkWaterPos() {
field_0x6cc = wtr_pos;
field_0x69c.y = wtr_pos + 1000.0f + l_HIO.fly_height_adjust;
UNUSED(std::fabsf(field_0x6cc - current.pos.y));
UNUSED(fabsf(field_0x6cc - current.pos.y));
if (current.pos.y < (200.0f + field_0x6cc)) {
if (field_0x715 == 0) {
setWaterEffect1();
+1 -1
View File
@@ -650,7 +650,7 @@ void daTbox_c::dropProcInit() {
field_0x97c = false;
f32 delta_y = pos.y - pnt1.y;
f32 abs_gravity = std::fabsf(fopAcM_GetGravity(this));
f32 abs_gravity = fabsf(fopAcM_GetGravity(this));
var_f30 = JMAFastSqrt(2.0f * delta_y / abs_gravity);
speedF = pos.absXZ(pnt1) / var_f30;
+36 -36
View File
@@ -2458,8 +2458,8 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
int bVar2 = 0;
var_f29 = std::fabsf(cM_atan2f(pos1.x, -pos1.z));
var_f28 = std::fabsf(cM_atan2f(pos1.y, -pos1.z));
var_f29 = fabsf(cM_atan2f(pos1.x, -pos1.z));
var_f28 = fabsf(cM_atan2f(pos1.y, -pos1.z));
if (var_f29 > sp30) {
bVar2 |= 1;
}
@@ -2467,8 +2467,8 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
bVar2 |= 2;
}
var_f29 = std::fabsf(cM_atan2f(pos2.x, -pos2.z));
var_f28 = std::fabsf(cM_atan2f(pos2.y, -pos2.z));
var_f29 = fabsf(cM_atan2f(pos2.x, -pos2.z));
var_f28 = fabsf(cM_atan2f(pos2.y, -pos2.z));
if (var_f29 > sp30) {
bVar2 |= 4;
}
@@ -2493,25 +2493,25 @@ f32 dCamera_c::radiusActorInSight(fopAc_ac_c* i_actor1, fopAc_ac_c* i_actor2, cX
f32 var_f31;
if (bVar2 & 1) {
var_f31 = pos1.z + std::fabsf(pos1.x) / local_12c;
var_f31 = pos1.z + fabsf(pos1.x) / local_12c;
if (var_f31 > ret) {
ret = var_f31;
}
}
if (bVar2 & 2) {
var_f31 = pos1.z + std::fabsf(pos1.y) / local_130;
var_f31 = pos1.z + fabsf(pos1.y) / local_130;
if (var_f31 > ret) {
ret = var_f31;
}
}
if (bVar2 & 4) {
var_f31 = pos2.z + std::fabsf(pos2.x) / local_12c;
var_f31 = pos2.z + fabsf(pos2.x) / local_12c;
if (var_f31 > ret) {
ret = var_f31;
}
}
if (bVar2 & 8) {
var_f31 = pos2.z + std::fabsf(pos2.y) / local_130;
var_f31 = pos2.z + fabsf(pos2.y) / local_130;
if (var_f31 > ret) {
ret = var_f31;
}
@@ -2799,7 +2799,7 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
}
wind_pow -= 0.3f;
cSAngle angle = wind_globe.U() - mViewCache.mDirection.U();
mFovy += mCamSetup.WindShakeGap4Fvy() * cM_rndFX(wind_pow / 0.7f) * (1.0f - std::fabsf(angle.Norm()));
mFovy += mCamSetup.WindShakeGap4Fvy() * cM_rndFX(wind_pow / 0.7f) * (1.0f - fabsf(angle.Norm()));
#if DEBUG
dDbVw_Report(300, 180, "wind %f %f", wind_pow, angle.Norm());
@@ -2943,7 +2943,7 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
cXyz cross;
f32 dot = VECDotProduct(normal1, normal2);
VECCrossProduct(normal1, normal2, &cross);
if (chkCornerCos(dot) && std::fabsf(cross.y) > 0.5f
if (chkCornerCos(dot) && fabsf(cross.y) > 0.5f
&& cBgW_CheckBWall(normal2->y)) {
var_r27 = 5;
} else {
@@ -3056,7 +3056,7 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
field_0x96c += (1.0f - field_0x96c) * 0.1f;
}
if (sp0C || !(mMonitor.field_0xc < 5.0f)
|| !(std::fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f)) {
|| !(fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f)) {
field_0x968 = 0.2f;
} else {
field_0x968 *= mMonitor.field_0xc / 5.0f;
@@ -3999,7 +3999,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
}
cSAngle ang;
if ((chkFlag(0x100000) || sp1C || bVar6) && std::fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f) {
if ((chkFlag(0x100000) || sp1C || bVar6) && fabsf(mPadInfo.mCStick.mLastPosX) < 0.05f) {
ang.Val(directionOf(mpPlayerActor).Inv());
} else {
ang.Val(mViewCache.mDirection.U());
@@ -4014,13 +4014,13 @@ bool dCamera_c::chaseCamera(s32 param_0) {
pos3 = pos;
pos.y += dist;
sp1AC = cXyz(mCenter - pos3).abs() * 8.0f;
sp1BC = std::fabsf(dist1 > sp1AC ? dist1 : sp1AC);
sp1BC = fabsf(dist1 > sp1AC ? dist1 : sp1AC);
dist1 = val18 + (val17 - val18) * chase->field_0xa4;
sp1AC = std::fabsf(mFovy - dist1);
sp1AC = fabsf(mFovy - dist1);
f32 sin = cSAngle(mFovy > dist1 ? mFovy : dist1).Sin();
sp1AC = 100.0f * (sin * sin) * sp1AC;
sp1BC = std::fabsf(sp1BC > sp1AC ? sp1BC : sp1AC);
sp1BC = fabsf(sp1BC > sp1AC ? sp1BC : sp1AC);
sp1BC *= 1.2f;
sp1BC *= 0.00625f;
chase->field_0x4 = (int)(JMAFastSqrt(sp1BC) * 2.2f) + 1;
@@ -4128,7 +4128,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
mViewCache.mCenter += (pos - mViewCache.mCenter) * rate;
f32 dist = dCamMath::xyzHorizontalDistance(pos, chase->field_0x58);
if (dist < std::fabsf(vec.x > vec.z ? vec.x : vec.z) + 20.0f) {
if (dist < fabsf(vec.x > vec.z ? vec.x : vec.z) + 20.0f) {
cXyz attention_pos = attentionPos(mpPlayerActor);
attention_pos.y -= 15.0f;
dBgS_CamLinChk lin_chk;
@@ -4294,7 +4294,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
cSAngle ang = -mViewCache.mDirection.U();
delta = dCamMath::xyzRotateY(delta, ang);
cXyz vec5 = delta;
if (std::fabsf(vec5.y) < 200.0f) {
if (fabsf(vec5.y) < 200.0f) {
vec5.y = 0.0f;
vec5.x *= 0.5f;
f32 sp16C = vec5.abs();
@@ -4415,17 +4415,17 @@ bool dCamera_c::chaseCamera(s32 param_0) {
bool sp11 = false;
f32 sp140 = 0.05f;
f32 last_pos_x = mPadInfo.mCStick.mLastPosX;
f32 sp138 = std::fabsf(last_pos_x);
f32 sp138 = fabsf(last_pos_x);
f32 sp134 = mPadInfo.mCStick.mLastPosY;
f32 sp130 = std::fabsf(sp134);
f32 sp130 = fabsf(sp134);
f32 sp12C = 8.0f;
f32 sp128 = 12.0f;
chase->field_0x93 = false;
if (sp11 || (!mCamParam.Flag(param_0, 0x40) && std::fabsf(last_pos_x) > sp140)) {
if (sp11 || (!mCamParam.Flag(param_0, 0x40) && fabsf(last_pos_x) > sp140)) {
chase->field_0xac += (dCamMath::rationalBezierRatio(last_pos_x, 0.5f) * sp12C - chase->field_0xac) * chase->field_0x4c;
ang3 = globe.U() + cSAngle(chase->field_0xac);
sp148 = std::fabsf(last_pos_x) - 0.05f;
sp148 = fabsf(last_pos_x) - 0.05f;
if (mCamSetup.CheckFlag(0x1000) && mFakeAngleSys.field_0x0 == 0) {
setUSOAngle();
}
@@ -4922,7 +4922,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
sp0C = true;
}
f32 fVar43 = 1.0f - std::fabsf(mPadInfo.mCStick.mLastPosY);
f32 fVar43 = 1.0f - fabsf(mPadInfo.mCStick.mLastPosY);
f32 fVar44;
if (bVar1) {
@@ -4981,12 +4981,12 @@ bool dCamera_c::lockonCamera(s32 param_0) {
cSAngle u, v;
cSAngle ang5 = globe.V() - lockon->field_0x34.V();
if (sp0C) {
r = lockon->field_0x34.R() * 0.75f * std::fabsf(ang5.Cos());
r = lockon->field_0x34.R() * 0.75f * fabsf(ang5.Cos());
u.Val(lockon->field_0x34.U() + (ang4 - lockon->field_0x34.U()) * lockon->field_0x58);
v.Val(lockon->field_0x34.V() + ang5 * 0.05f);
} else {
r = lockon->field_0x34.R() + (sp184 - lockon->field_0x34.R()) *
lockon->field_0x54 * std::fabsf(ang5.Cos());
lockon->field_0x54 * fabsf(ang5.Cos());
u.Val(lockon->field_0x34.U() + (ang4 - lockon->field_0x34.U()) * lockon->field_0x58);
v.Val(lockon->field_0x34.V() + ang5 * lockon->field_0x58);
}
@@ -5043,9 +5043,9 @@ bool dCamera_c::lockonCamera(s32 param_0) {
}
bool bVar3 = false;
if (std::fabsf(sp158) > 0.05f) {
if (fabsf(sp158) > 0.05f) {
cSAngle ang = globe2.U() + cSAngle(dCamMath::rationalBezierRatio(sp158, 0.5f) * 7.5f);
sp15C = std::fabsf(sp158) - 0.05f;
sp15C = fabsf(sp158) - 0.05f;
lockon->field_0x42 = ang;
lockon->field_0x4c = 0.0f;
bVar3 = true;
@@ -5109,7 +5109,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
}
ang6 = ang1.Inv() - mViewCache.mDirection.U();
if (std::fabsf(ang6.Degree()) < 2.0f && false) {
if (fabsf(ang6.Degree()) < 2.0f && false) {
lockon->field_0x2a = true;
}
u2 += ang6 * sp15C * lockon->field_0x4c;
@@ -5137,7 +5137,7 @@ bool dCamera_c::lockonCamera(s32 param_0) {
} else {
lockon->field_0xc = 0;
if (!mBG.field_0xc0.field_0x44 && !bVar1) {
v2 += (globe2.V() - v2) * fVar43 * std::fabsf(mViewCache.mDirection.V().Cos());
v2 += (globe2.V() - v2) * fVar43 * fabsf(mViewCache.mDirection.V().Cos());
} else {
cSAngle ang7 = lockon->field_0x34.V();
ang7 *= cSAngle(lockon->field_0x34.U() - mViewCache.mDirection.U()).Cos();
@@ -5469,7 +5469,7 @@ bool dCamera_c::talktoCamera(s32 param_0) {
if (talk->field_0x84 != 0) {
talk->field_0x48 = 1;
} else {
talk->field_0x48 = (int)(JMAFastSqrt(std::fabsf(mViewCache.mDirection.R() - talk->field_0x28.R())) / 2.0f);
talk->field_0x48 = (int)(JMAFastSqrt(fabsf(mViewCache.mDirection.R() - talk->field_0x28.R())) / 2.0f);
if (talk->field_0x48 < 2) {
talk->field_0x48 = 2;
}
@@ -5609,7 +5609,7 @@ bool dCamera_c::talktoCamera(s32 param_0) {
for (i = 0; i < 36; i++) {
sp26C = talk->field_0x28.U() - talk->field_0x30.U();
if (std::fabsf(sp26C.Degree()) < 10.0f) {
if (fabsf(sp26C.Degree()) < 10.0f) {
talk->field_0x28.U(talk->field_0x28.U() + sp270);
} else {
if (!sp5B) {
@@ -7172,7 +7172,7 @@ bool dCamera_c::subjectCamera(s32 param_0) {
f32 zoom_fovy = dCamMath::zoomFovy(val17 * 0.5f, tmp2) * 2.0f;
mViewCache.mFovy += (zoom_fovy - mViewCache.mFovy) * val22;
setComZoomScale(tmp2);
setComZoomForcus(1.0f - std::fabsf(sp88 - sp84) * -511.0f);
setComZoomForcus(1.0f - fabsf(sp88 - sp84) * -511.0f);
if (check_owner_action(mPadID, 0x200000)) {
setComStat(8);
}
@@ -7263,12 +7263,12 @@ bool dCamera_c::magneCamera(s32 param_0) {
cSAngle stack_238;
if (mCurMode == 1) {
stack_238 = sp54.Inv();
} else if (std::fabsf(cstick_x) > 0.05f) {
} else if (fabsf(cstick_x) > 0.05f) {
stack_238 = magne->field_0x1c.U() + cSAngle(dCamMath::rationalBezierRatio(cstick_x, 0.5f) * 10.0f);
} else {
cSAngle stack_23c = sp54.Inv() - stack_230.U();
f32 sin = stack_23c.Sin();
f32 tmp = std::fabsf(sin * mPadInfo.mMainStick.mLastValue);
f32 tmp = fabsf(sin * mPadInfo.mMainStick.mLastValue);
f32 tmp2 = stack_23c.Cos() > 0.0f ? 8.0f : 4.0f;
stack_238 = stack_230.U() + cSAngle(sin * tmp2 * dCamMath::rationalBezierRatio(tmp, 1.0f));
}
@@ -7584,7 +7584,7 @@ bool dCamera_c::towerCamera(s32 param_0) {
cXyz stack_21c = relationalPos(mpPlayerActor, &stack_210);
f32 sp1A8 = cXyz(mEye - stack_21c).abs() - val7;
f32 sp1A4 = cXyz(mCenter - stack_21c).abs() - val7;
f32 sp1A0 = std::fabsf(sp1A8 > sp1A4 ? sp1A8 : sp1A4);
f32 sp1A0 = fabsf(sp1A8 > sp1A4 ? sp1A8 : sp1A4);
sp1A8 = heightOf(mpPlayerActor);
sp1A0 /= (sp1A8 < 10.0f ? 10.0f : sp1A8);
tower->field_0x4 = (int)(JMAFastSqrt(sp1A0) * sp220) + 1;
@@ -7706,9 +7706,9 @@ bool dCamera_c::towerCamera(s32 param_0) {
cSAngle sp108;
cSAngle sp104 = stack_454 + (stack_454 - stack_458) * sp188;
if (!mCamParam.Flag(param_0, 0x40) && std::fabsf(sp18C) > sp184) {
if (!mCamParam.Flag(param_0, 0x40) && fabsf(sp18C) > sp184) {
cSAngle sp100 = mViewCache.mDirection.U() + cSAngle(dCamMath::rationalBezierRatio(sp18C, 0.5f) * sp180);
f32 sp17C = std::fabsf(sp18C) - sp184;
f32 sp17C = fabsf(sp18C) - sp184;
sp108.Val(mViewCache.mDirection.U() + (sp100 - mViewCache.mDirection.U()) * sp17C);
tower->field_0x6a = true;
tower->field_0x78 += (0.8f - tower->field_0x78) * 0.05f;
+6
View File
@@ -49,6 +49,8 @@
#include "dusk/imgui/ImGuiEngine.hpp"
#include "dusk/logging.h"
#include "dusk/main.h"
#include "dusk/imgui/ImGuiConsole.hpp"
#include "version.h"
#include "dusk/time.h"
#include <aurora/aurora.h>
@@ -341,6 +343,10 @@ int game_main(int argc, char* argv[]) {
auroraInfo = aurora_initialize(argc, argv, &config);
VISetWindowTitle(
fmt::format("Dusk {} [{}]", DUSK_WC_DESCRIBE, dusk::backend_name(auroraInfo.backend))
.c_str());
const auto& dvd_path = parsed_arg_options["dvd"].as<std::string>();
DuskLog.info("Loading DVD image: {}", dvd_path);
if (!aurora_dvd_open(dvd_path.c_str())) {
+20
View File
@@ -0,0 +1,20 @@
#ifndef VERSION_H
#define VERSION_H
#define DUSK_WC_DESCRIBE "@DUSK_WC_DESCRIBE@"
#define DUSK_VERSION_STRING "@DUSK_VERSION_STRING@"
#define DUSK_WC_BRANCH "@DUSK_WC_BRANCH@"
#define DUSK_WC_REVISION "@DUSK_WC_REVISION@"
#define DUSK_WC_DATE "@DUSK_WC_DATE@"
#define DUSK_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#if defined(__x86_64__) || defined(_M_AMD64)
#define DUSK_DLPACKAGE "dusk-@DUSK_WC_DESCRIBE@-@PLATFORM_NAME@-x86_64"
#elif defined(__i386__) || defined(_M_IX86)
#define DUSK_DLPACKAGE "dusk-@DUSK_WC_DESCRIBE@-@PLATFORM_NAME@-x86"
#elif defined(__aarch64__) || defined(_M_ARM64)
#define DUSK_DLPACKAGE "dusk-@DUSK_WC_DESCRIBE@-@PLATFORM_NAME@-arm64"
#endif
#endif